Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-system
/
system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7ec7a65e
authored
Oct 29, 2020
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化代码
1 parent
ffd10ebf
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
59 additions
and
20 deletions
src/components/rule-form/index.vue
src/config/config.js
src/services/user.js
src/views/dictionaryManage/dictionaryData/index.vue
src/views/dictionaryManage/index.vue
src/views/menuManage/index.vue
src/views/orginizaManage/index.vue
src/views/role/index.vue
src/views/user/index.vue
src/views/workLog/index.vue
src/components/rule-form/index.vue
View file @
7ec7a65
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
:class=
"item.clickFunc ? 'pointer' : ''"
:class=
"item.clickFunc ? 'pointer' : ''"
:ref=
"item.ref"
:ref=
"item.ref"
v-model=
"ruleForm[item.prop]"
v-model=
"ruleForm[item.prop]"
@
input=
"update($event)"
>
>
</el-input>
</el-input>
<el-input
<el-input
...
@@ -62,6 +63,7 @@
...
@@ -62,6 +63,7 @@
@
change=
"radioChange($event,item.prop)"
@
change=
"radioChange($event,item.prop)"
v-model=
"ruleForm[item.prop]"
v-model=
"ruleForm[item.prop]"
>
>
{{
ruleForm
[
item
.
prop
]
}}
<el-radio
<el-radio
v-for=
"(child,childIndex) in item.children"
v-for=
"(child,childIndex) in item.children"
:key=
"childIndex"
:key=
"childIndex"
...
@@ -151,6 +153,9 @@ export default {
...
@@ -151,6 +153,9 @@ export default {
radioChange
(
event
,
prop
)
{
radioChange
(
event
,
prop
)
{
// console.log(event,prop,'radioChange')
// console.log(event,prop,'radioChange')
this
.
$emit
(
'radioChange'
,
event
,
prop
)
this
.
$emit
(
'radioChange'
,
event
,
prop
)
},
update
(
e
)
{
this
.
$forceUpdate
()
}
}
}
}
}
}
...
...
src/config/config.js
View file @
7ec7a65
...
@@ -59,7 +59,8 @@ const DICT_API = {
...
@@ -59,7 +59,8 @@ const DICT_API = {
DICTDATA_EXPORT
:
'/publiccenter/dict/data/export'
,
DICTDATA_EXPORT
:
'/publiccenter/dict/data/export'
,
DICTDATA_ADD
:
'/publiccenter/dict/data/add'
,
DICTDATA_ADD
:
'/publiccenter/dict/data/add'
,
DICTDATA_EDIT
:
'/publiccenter/dict/data/edit'
,
DICTDATA_EDIT
:
'/publiccenter/dict/data/edit'
,
DICTDATA_DELETE
:
'/publiccenter/dict/data/delete'
DICTDATA_DELETE
:
'/publiccenter/dict/data/delete'
,
DICTDATA_TYPE
:
'/publiccenter/dict/data/type'
}
}
const
WORKLOG_API
=
{
const
WORKLOG_API
=
{
WORKLOG_SEARCH
:
'/loggincenter/loggin/search'
,
WORKLOG_SEARCH
:
'/loggincenter/loggin/search'
,
...
...
src/services/user.js
View file @
7ec7a65
import
{
USER_API
}
from
'@/config/config'
import
{
USER_API
,
DICT_API
}
from
'@/config/config'
import
request
from
'@/services/request'
import
request
from
'@/services/request'
// 获取用户列表
// 获取用户列表
...
@@ -36,4 +36,9 @@ function roleList (params) {
...
@@ -36,4 +36,9 @@ function roleList (params) {
const
url
=
USER_API
.
ROLE_SIMPLELIST
const
url
=
USER_API
.
ROLE_SIMPLELIST
return
request
(
params
,
url
)
return
request
(
params
,
url
)
}
}
export
{
getUserList
,
getSuperUser
,
addUser
,
editUser
,
detailUser
,
deleteUser
,
roleList
}
// 字典
function
dictInfo
(
params
)
{
const
url
=
`
${
DICT_API
.
DICTDATA_TYPE
}
/
${
params
}
`
return
request
({},
url
)
}
export
{
getUserList
,
getSuperUser
,
addUser
,
editUser
,
detailUser
,
deleteUser
,
roleList
,
dictInfo
}
src/views/dictionaryManage/dictionaryData/index.vue
View file @
7ec7a65
<
template
>
<
template
>
<div
class=
"system-container"
>
<div
class=
"system-container"
>
<div
class=
"
user-
container"
>
<div
class=
"container"
>
<search-form
<search-form
class=
"searchTop border-shadow"
class=
"searchTop border-shadow"
:formModel=
"searchForm"
:formModel=
"searchForm"
...
@@ -251,9 +251,11 @@ export default {
...
@@ -251,9 +251,11 @@ export default {
console
.
log
(
pType
,
scope
)
console
.
log
(
pType
,
scope
)
switch
(
pType
)
{
switch
(
pType
)
{
case
'create'
:
case
'create'
:
this
.
dictDataDialogTitle
=
'新增字典'
this
.
handleClose
()
this
.
handleClose
()
break
break
case
'edit'
:
case
'edit'
:
this
.
dictDataDialogTitle
=
'编辑字典'
this
.
editEvent
(
scope
)
this
.
editEvent
(
scope
)
break
break
case
'delete'
:
case
'delete'
:
...
...
src/views/dictionaryManage/index.vue
View file @
7ec7a65
<
template
>
<
template
>
<div
class=
"system-container"
>
<div
class=
"system-container"
>
<div
class=
"
user-
container"
>
<div
class=
"container"
>
<search-form
<search-form
class=
"searchTop border-shadow"
class=
"searchTop border-shadow"
:formModel=
"searchForm"
:formModel=
"searchForm"
...
...
src/views/menuManage/index.vue
View file @
7ec7a65
<
template
>
<
template
>
<div
class=
"system-container"
>
<div
class=
"system-container"
>
<div
class=
"
user-
container"
>
<div
class=
"container"
>
<search-form
<search-form
class=
"searchTop border-shadow"
class=
"searchTop border-shadow"
:formModel=
"searchForm"
:formModel=
"searchForm"
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
>
新增
</el-button>
>
新增
</el-button>
</div>
</div>
<el-table
<el-table
ref=
"table"
:data=
"menuTableData"
:data=
"menuTableData"
style=
"width: 100%"
style=
"width: 100%"
row-key=
"id"
row-key=
"id"
...
@@ -55,15 +56,19 @@
...
@@ -55,15 +56,19 @@
></span>
></span>
<span
class=
"statusText"
>
{{
scope
.
row
.
enableStatus
?
MENUSTATUS
[
scope
.
row
.
enableStatus
].
split
(
','
)[
0
]
:
'--'
}}
</span>
<span
class=
"statusText"
>
{{
scope
.
row
.
enableStatus
?
MENUSTATUS
[
scope
.
row
.
enableStatus
].
split
(
','
)[
0
]
:
'--'
}}
</span>
</
template
>
</
template
>
<
template
v-else-if=
"item.prop === 'type'"
>
<span>
{{
scope
.
row
.
type
?
MENU_TYPE
[
scope
.
row
.
type
]
:
'--'
}}
</span>
</
template
>
<
template
v-else
>
<
template
v-else
>
{{
scope
.
row
[
item
.
prop
]?
scope
.
row
[
item
.
prop
]:
'--'
}}
{{
scope
.
row
[
item
.
prop
]?
scope
.
row
[
item
.
prop
]:
'--'
}}
</
template
>
</
template
>
</template>
</template>
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
ref=
"table"
align=
"center"
align=
"center"
width=
"
17
0"
width=
"
25
0"
fixed=
"right"
fixed=
"right"
prop=
"btn"
prop=
"btn"
label=
"操作"
label=
"操作"
...
@@ -142,6 +147,7 @@ export default {
...
@@ -142,6 +147,7 @@ export default {
data
()
{
data
()
{
return
{
return
{
MENUSTATUS
:
this
.
$Constants
.
MENU_STATUS
,
MENUSTATUS
:
this
.
$Constants
.
MENU_STATUS
,
MENU_TYPE
:
this
.
$Constants
.
MENU_TYPE
,
searchForm
:
{},
searchForm
:
{},
menuFormList
:
[
menuFormList
:
[
{
{
...
@@ -203,16 +209,19 @@ export default {
...
@@ -203,16 +209,19 @@ export default {
menuDialogTitle
:
'新增菜单'
,
menuDialogTitle
:
'新增菜单'
,
menuVisible
:
false
,
menuVisible
:
false
,
menuForm
:
{
menuForm
:
{
type
:
'1'
,
parentName
:
''
,
parentName
:
''
,
enableStatus
:
true
enableStatus
:
true
,
permissionTag
:
''
},
},
form
:
{
form
:
{
type
:
'2'
,
parentName
:
''
,
parentName
:
''
,
enableStatus
:
true
enableStatus
:
true
},
},
menuData
:
[
menuData
:
[
{
label
:
'菜单类型'
,
prop
:
'type'
,
type
:
'radio'
,
children
:
this
.
$Constants
.
MENU_TYPE
},
{
label
:
'菜单类型'
,
prop
:
'type'
,
type
:
'radio'
,
children
:
this
.
$Constants
.
MENU_TYPE
},
{
label
:
'上级菜单'
,
prop
:
'parentName'
,
type
:
'input'
,
readonly
:
true
,
clickFunc
:
this
.
selectSuperior
,
hidden
:
tru
e
},
{
label
:
'上级菜单'
,
prop
:
'parentName'
,
type
:
'input'
,
readonly
:
true
,
clickFunc
:
this
.
selectSuperior
,
hidden
:
fals
e
},
{
label
:
'菜单名称'
,
prop
:
'menuName'
,
type
:
'input'
},
{
label
:
'菜单名称'
,
prop
:
'menuName'
,
type
:
'input'
},
{
label
:
'权限标识'
,
prop
:
'permissionTag'
,
type
:
'input'
},
{
label
:
'权限标识'
,
prop
:
'permissionTag'
,
type
:
'input'
},
{
label
:
'前端路由'
,
prop
:
'frontRoute'
,
type
:
'input'
},
{
label
:
'前端路由'
,
prop
:
'frontRoute'
,
type
:
'input'
},
...
@@ -221,7 +230,7 @@ export default {
...
@@ -221,7 +230,7 @@ export default {
{
label
:
'图标'
,
prop
:
'icon'
,
type
:
'input'
}
{
label
:
'图标'
,
prop
:
'icon'
,
type
:
'input'
}
],
],
menuRules
:
{
menuRules
:
{
type
:
[{
required
:
true
,
message
:
'请
输入菜单类型'
,
trigger
:
'change
'
}],
type
:
[{
required
:
true
,
message
:
'请
选择菜单类型'
,
trigger
:
'blur
'
}],
menuName
:
[{
required
:
true
,
message
:
'请输入菜单名称'
,
trigger
:
'blur'
}],
menuName
:
[{
required
:
true
,
message
:
'请输入菜单名称'
,
trigger
:
'blur'
}],
orderNum
:
[{
required
:
true
,
message
:
'请输入显示排序'
,
trigger
:
'blur'
}],
orderNum
:
[{
required
:
true
,
message
:
'请输入显示排序'
,
trigger
:
'blur'
}],
enableStatus
:
[{
required
:
true
}],
enableStatus
:
[{
required
:
true
}],
...
@@ -307,7 +316,6 @@ export default {
...
@@ -307,7 +316,6 @@ export default {
this
.
$refs
.
menuForm
.
$children
[
0
].
resetFields
()
this
.
$refs
.
menuForm
.
$children
[
0
].
resetFields
()
}
}
this
.
menuVisible
=
!
this
.
menuVisible
this
.
menuVisible
=
!
this
.
menuVisible
if
(
!
this
.
menuVisible
)
this
.
menuForm
=
_
.
cloneDeep
(
this
.
form
)
},
},
// 按钮事件
// 按钮事件
btnClick
(
pType
,
scope
)
{
btnClick
(
pType
,
scope
)
{
...
@@ -317,12 +325,14 @@ export default {
...
@@ -317,12 +325,14 @@ export default {
this
.
isOpen
=
true
this
.
isOpen
=
true
this
.
menuDialogTitle
=
'新增菜单'
this
.
menuDialogTitle
=
'新增菜单'
this
.
menuData
[
0
].
children
=
this
.
$Constants
.
MENU_TYPE
this
.
menuData
[
0
].
children
=
this
.
$Constants
.
MENU_TYPE
this
.
menuForm
=
_
.
cloneDeep
(
this
.
form
)
this
.
handleClose
()
this
.
handleClose
()
break
break
case
'btnCreate'
:
case
'btnCreate'
:
this
.
isOpen
=
true
this
.
isOpen
=
true
this
.
menuDialogTitle
=
'新增菜单'
this
.
menuDialogTitle
=
'新增菜单'
this
.
menuData
[
0
].
children
=
this
.
$Constants
.
MENU_OTYPE
this
.
menuData
[
0
].
children
=
this
.
$Constants
.
MENU_OTYPE
this
.
menuForm
=
_
.
cloneDeep
(
this
.
form
)
this
.
handleClose
()
this
.
handleClose
()
break
break
case
'edit'
:
case
'edit'
:
...
@@ -444,9 +454,17 @@ export default {
...
@@ -444,9 +454,17 @@ export default {
radioChange
(
event
,
prop
)
{
radioChange
(
event
,
prop
)
{
console
.
log
(
event
,
prop
)
console
.
log
(
event
,
prop
)
if
(
event
!=
1
)
{
if
(
event
!=
1
)
{
this
.
menuData
[
1
].
hidden
=
false
this
.
menuData
.
map
(
item
=>
{
if
(
item
.
prop
==
'parentName'
)
{
item
.
hidden
=
false
}
})
}
else
{
}
else
{
this
.
menuData
[
1
].
hidden
=
true
this
.
menuData
.
map
(
item
=>
{
if
(
item
.
prop
==
'parentName'
)
{
item
.
hidden
=
true
}
})
}
}
}
}
}
}
...
...
src/views/orginizaManage/index.vue
View file @
7ec7a65
...
@@ -63,7 +63,7 @@
...
@@ -63,7 +63,7 @@
</el-table-column>
</el-table-column>
<el-table-column
<el-table-column
align=
"center"
align=
"center"
width=
"
17
0"
width=
"
25
0"
fixed=
"right"
fixed=
"right"
prop=
"btn"
prop=
"btn"
label=
"操作"
label=
"操作"
...
...
src/views/role/index.vue
View file @
7ec7a65
...
@@ -277,8 +277,8 @@ export default {
...
@@ -277,8 +277,8 @@ export default {
this
.
roleForm
.
enableStatus
=
res
.
data
.
enableStatus
==
1
?
true
:
false
this
.
roleForm
.
enableStatus
=
res
.
data
.
enableStatus
==
1
?
true
:
false
this
.
roleForm
.
roleVisibility
=
res
.
data
.
roleVisibility
+
''
this
.
roleForm
.
roleVisibility
=
res
.
data
.
roleVisibility
+
''
this
.
roleForm
.
rolePermissionType
=
res
.
data
.
rolePermissionType
+
''
this
.
roleForm
.
rolePermissionType
=
res
.
data
.
rolePermissionType
+
''
this
.
roleForm
.
roleTenants
=
res
.
data
.
roleTenants
.
split
(
','
).
map
(
Number
)
if
(
res
.
data
.
roleTenants
)
this
.
roleForm
.
roleTenants
=
res
.
data
.
roleTenants
.
split
(
','
).
map
(
Number
)
this
.
getMenuTree
({
roleId
:
1
})
this
.
getMenuTree
({
roleId
:
row
.
id
})
this
.
handleClose
(
res
.
data
)
this
.
handleClose
(
res
.
data
)
})
})
},
},
...
...
src/views/user/index.vue
View file @
7ec7a65
...
@@ -127,7 +127,7 @@
...
@@ -127,7 +127,7 @@
<
script
>
<
script
>
// import UserService from 'services/user';
// import UserService from 'services/user';
import
{
getUserList
,
getSuperUser
,
addUser
,
editUser
,
detailUser
,
deleteUser
,
roleList
}
from
'services/user'
;
import
{
getUserList
,
getSuperUser
,
addUser
,
editUser
,
detailUser
,
deleteUser
,
roleList
,
dictInfo
}
from
'services/user'
;
import
{
getSimpleList
,
getTreeOrg
}
from
'services/orginizaManage'
import
{
getSimpleList
,
getTreeOrg
}
from
'services/orginizaManage'
export
default
{
export
default
{
data
()
{
data
()
{
...
@@ -231,7 +231,7 @@ export default {
...
@@ -231,7 +231,7 @@ export default {
{
label
:
'手机:'
,
prop
:
'phoneNumber'
,
type
:
'input'
},
{
label
:
'手机:'
,
prop
:
'phoneNumber'
,
type
:
'input'
},
{
label
:
'性别:'
,
prop
:
'gender'
,
type
:
'select'
,
options
:
[{
label
:
'男'
,
value
:
0
},
{
label
:
'女'
,
value
:
1
}]
},
{
label
:
'性别:'
,
prop
:
'gender'
,
type
:
'select'
,
options
:
[{
label
:
'男'
,
value
:
0
},
{
label
:
'女'
,
value
:
1
}]
},
{
label
:
'状态:'
,
prop
:
'enableStatus'
,
type
:
'switch'
},
{
label
:
'状态:'
,
prop
:
'enableStatus'
,
type
:
'switch'
},
{
label
:
'岗位:'
,
prop
:
'position'
,
type
:
'select'
,
options
:
[
{
label
:
'12121'
,
value
:
0
},
{
label
:
'fasdfas'
,
value
:
1
}]
}
{
label
:
'岗位:'
,
prop
:
'position'
,
type
:
'select'
,
options
:
[
],
key
:
'dictLabel'
,
value
:
'id'
}
],
],
userRules
:
{
userRules
:
{
account
:
[{
required
:
true
,
message
:
'请输入登录名称'
,
trigger
:
'blur'
}],
account
:
[{
required
:
true
,
message
:
'请输入登录名称'
,
trigger
:
'blur'
}],
...
@@ -257,6 +257,7 @@ export default {
...
@@ -257,6 +257,7 @@ export default {
mounted
()
{
mounted
()
{
this
.
getTreeOrg
()
this
.
getTreeOrg
()
this
.
getRoleList
()
this
.
getRoleList
()
this
.
getPosti
()
},
},
methods
:
{
methods
:
{
emptyData
(
params
)
{
emptyData
(
params
)
{
...
@@ -455,6 +456,13 @@ export default {
...
@@ -455,6 +456,13 @@ export default {
this
.
getTreeOrg
(
params
)
this
.
getTreeOrg
(
params
)
this
.
isExpand
=
true
this
.
isExpand
=
true
// this.$refs.userTable.refreshTable()
// this.$refs.userTable.refreshTable()
},
// 岗位列表
getPosti
(
value
)
{
dictInfo
(
'sys_position'
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
userData
[
this
.
userData
.
length
-
1
].
options
=
res
.
data
})
}
}
}
}
}
}
...
...
src/views/workLog/index.vue
View file @
7ec7a65
<
template
>
<
template
>
<div
class=
"system-container"
>
<div
class=
"system-container"
>
<div
class=
"
user-
container"
>
<div
class=
"container"
>
<search-form
<search-form
class=
"searchTop border-shadow"
class=
"searchTop border-shadow"
:formModel=
"searchForm"
:formModel=
"searchForm"
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment