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 3ca97c43
authored
Oct 08, 2018
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
解决角色名重复
1 parent
42115ac1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
5 deletions
src/views/customer/role/index.vue
src/views/customer/role/index.vue
View file @
3ca97c4
...
@@ -38,15 +38,16 @@ export default {
...
@@ -38,15 +38,16 @@ export default {
data
()
{
data
()
{
return
{
return
{
roleName
:
''
,
roleName
:
''
,
roleId
:
Number
,
//
roleId: Number,
createVisible
:
false
,
createVisible
:
false
,
detailVisible
:
false
,
detailVisible
:
false
,
userDetailVisible
:
false
,
userDetailVisible
:
false
,
roleParam
:
this
.
$deep_clone
(
roleCreateStructure
),
roleParam
:
this
.
$deep_clone
(
roleCreateStructure
),
roleParamName
:
String
,
roleMenu
:
[],
roleMenu
:
[],
columnParam
:
[],
columnParam
:
[],
consoleParam
:
[],
consoleParam
:
[],
apiParam
:
Number
,
apiParam
:
Object
,
flagRoleOrUser
:
true
,
flagRoleOrUser
:
true
,
flagCOrE
:
Boolean
,
flagCOrE
:
Boolean
,
editOrDetail
:
Boolean
,
editOrDetail
:
Boolean
,
...
@@ -72,6 +73,7 @@ export default {
...
@@ -72,6 +73,7 @@ export default {
type
:
'text'
,
type
:
'text'
,
callback
:
(
index
,
rows
)
=>
{
callback
:
(
index
,
rows
)
=>
{
this
.
roleParam
=
this
.
$deep_clone
(
rows
[
index
])
this
.
roleParam
=
this
.
$deep_clone
(
rows
[
index
])
this
.
roleParamName
=
this
.
$deep_clone
(
rows
[
index
].
roleName
)
this
.
handleCreateOrEdit
(
this
.
flagCOrE
=
false
)
this
.
handleCreateOrEdit
(
this
.
flagCOrE
=
false
)
}
}
},
{
},
{
...
@@ -186,18 +188,22 @@ export default {
...
@@ -186,18 +188,22 @@ export default {
console
.
log
(
data
)
console
.
log
(
data
)
this
.
createOrEditSuccess
()
this
.
createOrEditSuccess
()
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
this
.
message
(
err
,
'error'
)
console
.
log
(
err
)
console
.
log
(
err
)
})
})
},
},
// 编辑角色
// 编辑角色
updateRoleInfo
(
params
)
{
updateRoleInfo
(
params
)
{
console
.
log
(
params
)
// console.log(this.roleParamName)
// console.log(params.roleName)
// if (this.roleParamName === params.roleName) delete params.roleName
delete
params
.
createTime
delete
params
.
createTime
delete
params
.
updateTime
delete
params
.
updateTime
updateRole
.
req
(
params
).
then
((
data
)
=>
{
updateRole
.
req
(
params
).
then
((
data
)
=>
{
console
.
log
(
data
)
//
console.log(data)
this
.
createOrEditSuccess
()
this
.
createOrEditSuccess
()
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
this
.
message
(
err
,
'error'
)
console
.
log
(
err
)
console
.
log
(
err
)
})
})
},
},
...
@@ -215,6 +221,7 @@ export default {
...
@@ -215,6 +221,7 @@ export default {
this
.
createDialogVisible
()
this
.
createDialogVisible
()
this
.
message
(
this
.
flagCOrE
?
'创建角色成功!'
:
'已经成功修改数据!'
,
'success'
)
this
.
message
(
this
.
flagCOrE
?
'创建角色成功!'
:
'已经成功修改数据!'
,
'success'
)
this
.
roleMenu
=
[]
this
.
roleMenu
=
[]
this
.
roleParamName
=
''
this
.
getList
()
this
.
getList
()
},
},
// 调取接口相关函数
// 调取接口相关函数
...
@@ -247,7 +254,7 @@ export default {
...
@@ -247,7 +254,7 @@ export default {
handleUserDetailClose
()
{
handleUserDetailClose
()
{
this
.
userDetailDialogVisible
()
this
.
userDetailDialogVisible
()
this
.
getList
()
this
.
getList
()
this
.
apiParam
=
Number
this
.
apiParam
=
Object
},
},
handleCreateOrEdit
()
{
handleCreateOrEdit
()
{
this
.
roleParam
=
this
.
flagCOrE
?
this
.
$deep_clone
(
roleCreateStructure
)
:
this
.
roleParam
this
.
roleParam
=
this
.
flagCOrE
?
this
.
$deep_clone
(
roleCreateStructure
)
:
this
.
roleParam
...
@@ -262,6 +269,7 @@ export default {
...
@@ -262,6 +269,7 @@ export default {
if
(
!
data
)
{
if
(
!
data
)
{
this
.
createDialogVisible
()
this
.
createDialogVisible
()
this
.
roleMenu
=
[]
this
.
roleMenu
=
[]
this
.
roleParamName
=
''
this
.
message
(
this
.
flagCOrE
?
'取消创建角色'
:
'取消编辑角色'
,
'info'
)
this
.
message
(
this
.
flagCOrE
?
'取消创建角色'
:
'取消编辑角色'
,
'info'
)
return
false
return
false
}
}
...
...
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