Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
9
91isoft_vue_manage
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨硕
91isoft_vue_manage
Commits
e1b478e8
Commit
e1b478e8
authored
Jan 04, 2024
by
张伯涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户角色模块代码格式规范
parent
1a5f448d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
44 deletions
+35
-44
role.js
src/api/system/role.js
+8
-0
index.vue
src/views/system/role/index.vue
+14
-27
index.vue
src/views/system/user/index.vue
+13
-17
No files found.
src/api/system/role.js
View file @
e1b478e8
...
...
@@ -10,6 +10,7 @@ import Qs from 'qs'
* 6.角色状态修改
* 7.删除角色
* 8.导出角色
* 9.查询角色下拉
* */
// 查询角色列表
...
...
@@ -93,3 +94,10 @@ export function exportRole(query) {
responseType
:
'blob'
})
}
// 查询角色下拉
export
function
getlistRole
()
{
return
request
({
url
:
'system/role/listAll'
,
method
:
'get'
})
}
src/views/system/role/index.vue
View file @
e1b478e8
...
...
@@ -44,8 +44,8 @@
</el-form-item>
<div
style=
"float: right"
>
<el-form-item>
<coolbutton
style=
"padding: 8px 7px;"
:type=
"
typePrimary"
:name=
"addName"
:size=
"smallSize"
:icon=
"
addIcon"
:haspermi=
"hasAddPerm"
@
btn-click=
"handleAdd"
/>
<coolbutton
style=
"padding: 8px 7px;"
:type=
"
typeSuccess"
:name=
"exportName"
:size=
"smallSize"
:icon=
"
exportIcon"
:haspermi=
"hasExportPerm"
@
btn-click=
"handleExport"
/>
<coolbutton
style=
"padding: 8px 7px;"
:type=
"
commonField.typePrimary"
:name=
"commonField.addName"
:size=
"commonField.smallSize"
:icon=
"commonField.
addIcon"
:haspermi=
"hasAddPerm"
@
btn-click=
"handleAdd"
/>
<coolbutton
style=
"padding: 8px 7px;"
:type=
"
commonField.typeSuccess"
:name=
"commonField.exportName"
:size=
"commonField.smallSize"
:icon=
"commonField.
exportIcon"
:haspermi=
"hasExportPerm"
@
btn-click=
"handleExport"
/>
</el-form-item>
</div>
</el-form>
...
...
@@ -86,7 +86,7 @@
</el-table-column>
<el-table-column
label=
"操作"
class-name=
"small-padding fixed-width"
width=
"200px"
>
<
template
slot-scope=
"scope"
>
<coolbutton
style=
"color: #49cec9"
:type=
"
typeParent"
:name=
"updateName"
:size=
"
size"
:haspermi=
"hasUpdatePerm"
@
btn-click=
"handleUpdate(scope.row)"
/>
<coolbutton
style=
"color: #49cec9"
:type=
"
commonField.typeParent"
:name=
"commonField.updateName"
:size=
"commonField.
size"
:haspermi=
"hasUpdatePerm"
@
btn-click=
"handleUpdate(scope.row)"
/>
<el-button
v-hasPermi=
"['sys:role:update']"
size=
"mini"
...
...
@@ -234,9 +234,10 @@
<
script
>
import
{
listRole
,
getRole
,
delRole
,
addRole
,
updateRole
,
exportRole
,
dataScope
,
changeRoleStatus
}
from
'@/api/system/role'
import
{
roleMenuTreeselectMC
,
treeselect
as
menuTreeselect
,
roleMenuTreeselect
}
from
'@/api/system/menu'
import
{
treeselect
as
deptTreeselect
,
roleDeptTreeselect
}
from
'@/api/system/dept'
import
{
roleDeptTreeselect
}
from
'@/api/system/dept'
import
Coolbutton
from
'@/components/coolbutton'
import
{
getDataCache
,
setDataCache
}
from
'@/assets/js/filterData'
import
commonField
from
'@/utils/commonField'
export
default
{
name
:
'Role'
,
components
:
{
Coolbutton
},
...
...
@@ -246,20 +247,6 @@ export default {
updateMenu
:
[],
// 自定义页面默认打开的树状菜单
customSizeTree
:
[],
typeParent
:
'text'
,
typePrimary
:
'primary'
,
typeSuccess
:
'success'
,
nameParent
:
'删除'
,
resetName
:
'重置'
,
addName
:
'新增'
,
exportName
:
'导出'
,
updateName
:
'修改'
,
size
:
'mini'
,
smallSize
:
'small'
,
delIcon
:
'el-icon-delete'
,
addIcon
:
'el-icon-plus'
,
exportIcon
:
'el-icon-download'
,
resetIcon
:
''
,
hasDelPerm
:
[
'sys:role:delete'
],
hasResetPerm
:
[
'sys:role:resetPwd'
],
hasUpdatePerm
:
[
'sys:role:update'
],
...
...
@@ -360,14 +347,19 @@ export default {
deptOptions
:
[]
}
},
computed
:
{
commonField
()
{
return
commonField
}
},
/** 路由离开前存储筛选条件*/
beforeRouteLeave
(
to
,
from
,
next
)
{
setDataCache
(
this
.
$route
.
path
,
this
.
queryParams
)
next
()
},
created
()
{
this
.
queryParams
=
JSON
.
parse
(
getDataCache
(
this
.
$route
.
path
))
this
.
getList
()
this
.
queryParams
=
JSON
.
parse
(
getDataCache
(
this
.
$route
.
path
))
// 获取存储的筛选项
this
.
getList
()
// 列表查询
},
methods
:
{
/** 菜单权限check事件*/
...
...
@@ -394,7 +386,7 @@ export default {
// console.log(node);
if
(
node
.
parent
)
{
for
(
const
key
in
node
)
{
if
(
key
==
'id'
)
{
if
(
key
==
=
'id'
)
{
// console.log(node[key]);
this
.
$refs
.
menu
.
setChecked
(
node
,
true
)
}
...
...
@@ -429,12 +421,6 @@ export default {
this
.
loading
=
false
})
},
/** 查询部门树结构 */
getDeptTreeSelect
()
{
deptTreeselect
().
then
(
response
=>
{
this
.
deptOptions
=
response
.
data
})
},
// 数据权限的树状菜单
handleDeptCheckChange
(
data
,
check
,
subCheck
)
{
// data为选中节点信息,check选中状态
...
...
@@ -442,6 +428,7 @@ export default {
this
.
checkDeptNode
(
data
.
children
,
check
)
// 调用checkNode方法
}
},
/** 遍历所有下级节点*/
checkDeptNode
(
data
,
check
)
{
// 遍历所有下级节点信息
data
.
forEach
(
item
=>
{
...
...
src/views/system/user/index.vue
View file @
e1b478e8
...
...
@@ -280,7 +280,7 @@
</el-upload>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"upload.open = false"
>
取 消
</el-button>
<el-button
:loading=
"importLoading"
type=
"primary"
@
click
.
one
=
"submitFileForm"
>
确 定
</el-button>
<el-button
:loading=
"importLoading"
type=
"primary"
@
click=
"submitFileForm"
>
确 定
</el-button>
</div>
</el-dialog>
<el-dialog
...
...
@@ -534,15 +534,16 @@ export default {
},
created
()
{
// 分页参数初始化为{"page":1,"rows":10},如需自定义分页参数,自行修改
this
.
queryParams
=
JSON
.
parse
(
getDataCache
(
this
.
$route
.
path
))
this
.
getList
()
this
.
getTreeSelect
()
this
.
getRole
()
this
.
queryParams
=
JSON
.
parse
(
getDataCache
(
this
.
$route
.
path
))
// 获取存储的筛选项
this
.
getList
()
// 列表查询
this
.
getTreeSelect
()
// 查询部门下拉树结构
this
.
getRole
()
// 查询角色下拉
// this.getConfigKey('sys.user.initPassword').then(response => {
// this.initPassword = response.msg
// })
},
methods
:
{
/** 部门change事件*/
changeValue
()
{
this
.
$refs
.
form
.
validateField
(
'id'
)
},
...
...
@@ -558,6 +559,7 @@ export default {
}
)
},
/** 角色change事件*/
roleChange
(
e
)
{
// TODO: clear this log
this
.
$forceUpdate
()
...
...
@@ -582,6 +584,7 @@ export default {
// this.form.postId = response.data.checkedKeys
})
},
/** 查询角色下拉*/
getRole
()
{
getlistRole
().
then
(
response
=>
{
...
...
@@ -664,7 +667,7 @@ export default {
rows
:
10
,
username
:
''
,
flag
:
''
}
,
}
this
.
handleQuery
()
},
// 多选框选中数据
...
...
@@ -712,6 +715,7 @@ export default {
this
.
ruleForm
.
row
=
row
.
businessId
this
.
resetPwdDiaLog
=
!
this
.
resetPwdDiaLog
},
/** 修改密码确定操作*/
handleResetPwdSure
()
{
this
.
$refs
.
ruleForm
.
validate
(
pass
=>
{
if
(
pass
)
{
...
...
@@ -731,16 +735,6 @@ export default {
}
})
},
// 数组值是否相同
isAllEqual
(
array
)
{
if
(
array
.
length
>
0
)
{
return
!
array
.
some
(
function
(
value
,
index
)
{
return
value
!==
array
[
0
]
})
}
else
{
return
true
}
},
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
'form'
].
validate
(
valid
=>
{
...
...
@@ -885,18 +879,20 @@ export default {
this
.
$message
.
success
(
err
.
message
)
this
.
importLoading
=
false
})
this
.
importLoading
=
false
}
},
/** 导入change*/
employeeUpload
(
file
,
fileList
)
{
if
(
fileList
.
length
>
1
)
{
fileList
.
splice
(
0
,
1
)
}
this
.
fileList
=
fileList
[
0
].
raw
},
/** 导入remove操作*/
handleRemove
(
file
,
fileList
)
{
this
.
fileList
=
[]
},
/** 导入beforeRemove操作*/
beforeRemove
(
file
,
fileList
)
{
this
.
fileList
=
[]
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment