Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
authority
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit ec86d91f
authored
Sep 29, 2018
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
合并,再拉取
2 parents
1038b9f1
3e574839
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
13 deletions
src/components/RoleCreate/src/main.vue
src/components/Tree/src/main.vue
src/views/customer/role/index.vue
src/views/customer/user/index.vue
src/components/RoleCreate/src/main.vue
View file @
ec86d91
...
@@ -32,24 +32,21 @@
...
@@ -32,24 +32,21 @@
</
template
>
</
template
>
<
script
>
<
script
>
// import { roleCreateStructure } from '@/common/commonConst'
export
default
{
export
default
{
name
:
'RoleCreate'
,
name
:
'RoleCreate'
,
props
:
{
props
:
{
createVisible
:
Boolean
,
createVisible
:
Boolean
,
createRuleForm
:
Object
,
createRuleForm
:
Object
,
flagCOrE
:
[
Boolean
,
Array
,
Function
]
flagCOrE
:
[
Boolean
,
Array
,
Function
]
// roleMenuTree: Array
},
},
watch
:
{
watch
:
{
createVisible
(
val
)
{
createVisible
(
val
)
{
!
val
&&
this
.
$refs
[
'createRuleForm'
].
resetFields
()
!
val
&&
this
.
$refs
[
'createRuleForm'
].
resetFields
()
val
&&
(
this
.
key
=
Date
.
now
())
val
&&
(
this
.
key
=
Date
.
now
())
// 考虑一下放这里还是放下面
// this.createRuleForm.rights = this.roleMenuTree
},
},
flagCOrE
(
val
)
{
flagCOrE
(
val
)
{
this
.
title
=
val
?
'新建角色'
:
'角色列表'
this
.
title
=
val
?
'新建角色'
:
'角色列表'
// this.createRuleForm.rights = this.roleMenuTree
},
},
'createRuleForm.description.length'
(
val
)
{
'createRuleForm.description.length'
(
val
)
{
this
.
numberErr
=
val
>
200
?
1
:
0
this
.
numberErr
=
val
>
200
?
1
:
0
...
...
src/components/Tree/src/main.vue
View file @
ec86d91
...
@@ -59,7 +59,7 @@ export default {
...
@@ -59,7 +59,7 @@ export default {
// console.log(this.data)
// console.log(this.data)
},
},
getData
()
{
getData
()
{
console
.
log
(
this
.
defaultCheckedKeys
)
//
console.log(this.defaultCheckedKeys)
!
this
.
isDepart
!
this
.
isDepart
?
findMenuTree
.
req
().
then
(
res
=>
{
?
findMenuTree
.
req
().
then
(
res
=>
{
// console.log(res)
// console.log(res)
...
...
src/views/customer/role/index.vue
View file @
ec86d91
...
@@ -43,7 +43,7 @@ export default {
...
@@ -43,7 +43,7 @@ export default {
createVisible
:
false
,
createVisible
:
false
,
detailVisible
:
false
,
detailVisible
:
false
,
userDetailVisible
:
false
,
userDetailVisible
:
false
,
roleParam
:
roleCreateStructure
,
roleParam
:
this
.
$deep_clone
(
roleCreateStructure
)
,
columnParam
:
[],
columnParam
:
[],
consoleParam
:
[],
consoleParam
:
[],
apiParam
:
Number
,
apiParam
:
Number
,
...
@@ -223,7 +223,7 @@ export default {
...
@@ -223,7 +223,7 @@ export default {
},
},
handleDetailClose
()
{
handleDetailClose
()
{
this
.
deleteDialogVisible
()
this
.
deleteDialogVisible
()
this
.
roleParam
=
roleCreateStructure
this
.
roleParam
=
this
.
$deep_clone
(
roleCreateStructure
)
this
.
roleMenuTree
=
[]
this
.
roleMenuTree
=
[]
},
},
handleGetUserDetail
(
index
,
rows
)
{
handleGetUserDetail
(
index
,
rows
)
{
...
@@ -239,14 +239,14 @@ export default {
...
@@ -239,14 +239,14 @@ export default {
this
.
apiParam
=
Number
this
.
apiParam
=
Number
},
},
handleCreateOrEdit
()
{
handleCreateOrEdit
()
{
this
.
roleParam
=
this
.
flagCOrE
?
roleCreateStructure
:
this
.
roleParam
this
.
roleParam
=
this
.
flagCOrE
?
this
.
$deep_clone
(
roleCreateStructure
)
:
this
.
roleParam
this
.
createDialogVisible
()
this
.
createDialogVisible
()
// this.flagCOrE && this.createDialogVisible()
// this.flagCOrE && this.createDialogVisible()
// !this.flagCOrE && this.getMenuTree(this.roleParam.id, this.editOrDetail = true)
// !this.flagCOrE && this.getMenuTree(this.roleParam.id, this.editOrDetail = true)
},
},
// 关闭新增用户组件
// 关闭新增用户组件
handleCreateClose
(
data
)
{
handleCreateClose
(
data
)
{
this
.
roleParam
=
roleCreateStructure
this
.
roleParam
=
this
.
$deep_clone
(
roleCreateStructure
)
if
(
!
data
)
{
if
(
!
data
)
{
this
.
createDialogVisible
()
this
.
createDialogVisible
()
this
.
message
(
this
.
flagCOrE
?
'取消创建角色'
:
'取消编辑角色'
,
'info'
)
this
.
message
(
this
.
flagCOrE
?
'取消创建角色'
:
'取消编辑角色'
,
'info'
)
...
...
src/views/customer/user/index.vue
View file @
ec86d91
...
@@ -52,7 +52,7 @@ export default {
...
@@ -52,7 +52,7 @@ export default {
// 分页所需参数-end
// 分页所需参数-end
columnParam
:
[],
columnParam
:
[],
consoleParam
:
[],
consoleParam
:
[],
apiParam
:
Number
,
apiParam
:
Object
,
flagRoleOrUser
:
Boolean
,
flagRoleOrUser
:
Boolean
,
userData
:
{
userData
:
{
select
:
this
.
handleSelectionChange
,
select
:
this
.
handleSelectionChange
,
...
@@ -199,6 +199,7 @@ export default {
...
@@ -199,6 +199,7 @@ export default {
getRoleOptions
()
{
getRoleOptions
()
{
getRoleList
.
req
().
then
(
res
=>
{
getRoleList
.
req
().
then
(
res
=>
{
userForm
.
roleList
=
res
.
list
userForm
.
roleList
=
res
.
list
// return res.list
})
})
},
},
// 新增更新用户接口请求
// 新增更新用户接口请求
...
@@ -262,6 +263,7 @@ export default {
...
@@ -262,6 +263,7 @@ export default {
}
}
})
})
Promise
.
all
([
findAll
,
getRoleList
]).
then
((
result
)
=>
{
Promise
.
all
([
findAll
,
getRoleList
]).
then
((
result
)
=>
{
console
.
log
(
row
.
roles
)
if
(
row
.
roles
&&
typeof
(
row
.
roles
)
===
'string'
)
{
if
(
row
.
roles
&&
typeof
(
row
.
roles
)
===
'string'
)
{
row
.
roles
=
(
row
.
roles
+
''
).
split
(
','
).
map
(
role
=>
+
role
)
row
.
roles
=
(
row
.
roles
+
''
).
split
(
','
).
map
(
role
=>
+
role
)
}
else
{
}
else
{
...
@@ -331,12 +333,27 @@ export default {
...
@@ -331,12 +333,27 @@ export default {
this
.
message
(
'取消删除'
,
'info'
)
this
.
message
(
'取消删除'
,
'info'
)
})
})
},
},
findRolesName
(
params
)
{
// console.log(userForm.roleList)
var
nameArray
=
[]
const
userRoles
=
params
.
split
(
','
)
userRoles
.
forEach
(
userItem
=>
{
userForm
.
roleList
.
forEach
(
item
=>
{
if
(
+
userItem
===
item
.
id
)
{
nameArray
.
push
(
item
.
roleName
)
}
})
})
return
nameArray
.
join
(
','
)
},
// 详细操作
// 详细操作
handleGetUserDetail
(
index
,
rows
)
{
handleGetUserDetail
(
index
,
rows
)
{
this
.
columnParam
=
userDetailColumn
this
.
columnParam
=
userDetailColumn
this
.
consoleParam
=
[]
this
.
consoleParam
=
[]
this
.
flagRoleOrUser
=
false
this
.
flagRoleOrUser
=
false
this
.
apiParam
=
rows
[
index
]
this
.
apiParam
=
this
.
$deep_clone
(
rows
[
index
])
console
.
log
(
rows
[
index
])
this
.
apiParam
.
roles
=
this
.
findRolesName
(
this
.
apiParam
.
roles
)
console
.
log
(
this
.
apiParam
)
console
.
log
(
this
.
apiParam
)
this
.
userDetailVisible
=
!
this
.
userDetailVisible
this
.
userDetailVisible
=
!
this
.
userDetailVisible
},
},
...
@@ -359,9 +376,9 @@ export default {
...
@@ -359,9 +376,9 @@ export default {
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
.search-w250
{
.search-w250
{
width
:
250px
;
width
:
250px
;
}
}
.m-b8
{
.m-b8
{
margin-bottom
:
8px
;
margin-bottom
:
8px
;
}
}
</
style
>
</
style
>
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