Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
bdc
/
bdcjg-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
efdf4650
authored
2023-01-03 14:54:50 +0800
by
任超
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
style:全局字典
1 parent
5f8e7d8a
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
17 deletions
src/components/business/parcelBaseInfo.vue
src/main.js
src/permission.js
src/store/modules/dict.js
src/styles/index.scss
src/components/business/parcelBaseInfo.vue
View file @
efdf465
...
...
@@ -310,7 +310,7 @@
</el-form-item>
</el-col>
<
!--
<
el-col
:span=
"8"
>
<el-col
:span=
"8"
>
<el-form-item
prop=
"ZT"
class=
"borderTopNone"
>
<span
slot=
"label"
>
状态:
<br
/>
...
...
@@ -321,7 +321,7 @@
</el-option>
</el-select>
</el-form-item>
</el-col>
-->
</el-col>
</el-row>
<el-row>
...
...
src/main.js
View file @
efdf465
...
...
@@ -33,7 +33,7 @@ import './image/icons' // icon
import
store
from
'./store'
import
router
from
'./router'
import
_
from
'lodash'
//
import './permission' // permission control
import
'./permission'
// permission control
Vue
.
use
(
Element
,
{
size
:
'small'
,
zIndex
:
1000
})
Vue
.
use
(
Base
)
Vue
.
component
(
'icon'
,
Icon
);
...
...
src/permission.js
View file @
efdf465
...
...
@@ -10,23 +10,28 @@ NProgress.configure({ showSpinner: false }) // NProgress Configuration
router
.
beforeEach
(
async
(
to
,
from
,
next
)
=>
{
NProgress
.
start
()
document
.
title
=
getPageTitle
(
to
.
meta
.
title
)
let
hasAddDict
=
store
.
state
.
dict
.
addDict
let
hasAddRoute
=
store
.
state
.
permission
.
addRoutes
if
(
!
hasAddDict
)
{
store
.
dispatch
(
'dict/generateDic'
)
}
if
(
hasAddRoute
)
{
next
()
// next({ ...to, replace: true })
}
else
{
const
{
result
:
getMenuData
}
=
await
getMenuInfo
()
const
accessRoutes
=
await
store
.
dispatch
(
'permission/generateRoutes'
,
getMenuData
)
// 获取用户信息
await
store
.
dispatch
(
'user/getUserInfo'
)
router
.
addRoutes
([...
accessRoutes
,
{
path
:
'*'
,
redirect
:
'/404'
,
hidden
:
true
}])
const
routeTo
=
Cookies
.
get
(
'routerTo'
)
if
(
routeTo
&&
routeTo
!==
'/'
)
{
next
({
...
to
,
replace
:
true
})
}
else
{
next
(
'/home'
)
}
}
// else {
// const { result: getMenuData } = await getMenuInfo()
// const accessRoutes = await store.dispatch('permission/generateRoutes', getMenuData)
// // 获取用户信息
// await store.dispatch('user/getUserInfo')
// router.addRoutes([...accessRoutes, { path: '*', redirect: '/404', hidden: true }])
// const routeTo = Cookies.get('routerTo')
// if (routeTo && routeTo !== '/') {
// next({ ...to, replace: true })
// } else {
// next('/home')
// }
// }
next
()
NProgress
.
done
()
})
router
.
afterEach
(
to
=>
{
...
...
src/store/modules/dict.js
0 → 100644
View file @
efdf465
import
{
getAllDict
}
from
'@/api/user'
const
state
=
{
dictData
:
{},
addDict
:
false
,
}
const
mutations
=
{
SET_DATA
:
(
state
,
data
)
=>
{
state
.
addDict
=
true
state
.
dictData
=
data
},
RESET_DICT
:
(
state
)
=>
{
state
.
addDict
=
false
}
}
const
actions
=
{
generateDic
({
commit
})
{
return
new
Promise
(
async
(
resolve
)
=>
{
let
{
result
:
res
}
=
await
getAllDict
()
commit
(
'SET_DATA'
,
res
)
resolve
(
true
)
})
},
resetdict
({
commit
})
{
commit
(
'RESET_DICT'
)
}
}
export
default
{
namespaced
:
true
,
state
,
mutations
,
actions
}
src/styles/index.scss
View file @
efdf465
...
...
@@ -355,14 +355,16 @@ aside {
// 通过 入库
.adopt
{
color
:
#00FAA8
;
position
:
relative
;
}
.
adopt
:
:
before
{
position
:
absolute
;
content
:
''
;
display
:
block
;
width
:
5px
;
height
:
5px
;
background
:
#
999999
;
background
:
#
00FAA8
;
border-radius
:
50%
;
margin-right
:
6px
;
}
...
...
Please
register
or
sign in
to post a comment