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 9dcc9c83
authored
Sep 29, 2018
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
树组件-联动
1 parent
c8cf8829
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
17 deletions
src/api/roleApi.js
src/common/roleConst.js
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/api/roleApi.js
View file @
9dcc9c8
...
@@ -40,9 +40,9 @@ const getRoleList = {
...
@@ -40,9 +40,9 @@ const getRoleList = {
const
saveRoleList
=
{
const
saveRoleList
=
{
p
:
[
__sSaveRoleList
],
p
:
[
__sSaveRoleList
],
// req: params => GlAxios.get(__sSaveRoleList, params)
// req: params => GlAxios.get(__sSaveRoleList, params)
//
req: params => GlAxios.post(__sSaveRoleList, params, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' }})
req
:
params
=>
GlAxios
.
post
(
__sSaveRoleList
,
params
,
{
headers
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
}})
// req: params => GlAxios.post(__sSaveRoleList, params, { headers: { 'Content-Type': 'application/json; charset=utf-8' }})
// req: params => GlAxios.post(__sSaveRoleList, params, { headers: { 'Content-Type': 'application/json; charset=utf-8' }})
req
:
params
=>
GlAxios
.
post
(
__sSaveRoleList
,
params
)
//
req: params => GlAxios.post(__sSaveRoleList, params)
}
}
const
selectMenuTreeRoleId
=
{
const
selectMenuTreeRoleId
=
{
...
...
src/common/roleConst.js
View file @
9dcc9c8
...
@@ -55,6 +55,7 @@ const userRoleDetailColumn = [{
...
@@ -55,6 +55,7 @@ const userRoleDetailColumn = [{
}]
}]
const
userRoleDetailConsole
=
{
const
userRoleDetailConsole
=
{
// show: true,
label
:
'操作'
,
label
:
'操作'
,
prop
:
'option'
,
prop
:
'option'
,
button
:
[{
button
:
[{
...
...
src/components/RoleCreate/src/main.vue
View file @
9dcc9c8
...
@@ -43,6 +43,7 @@ export default {
...
@@ -43,6 +43,7 @@ export default {
createVisible
(
val
)
{
createVisible
(
val
)
{
!
val
&&
this
.
$refs
[
'createRuleForm'
].
resetFields
()
!
val
&&
this
.
$refs
[
'createRuleForm'
].
resetFields
()
this
.
keyFresh
=
val
this
.
keyFresh
=
val
// console.log(this.keyFresh)
},
},
flagCOrE
(
val
)
{
flagCOrE
(
val
)
{
this
.
title
=
val
?
'新建角色'
:
'角色列表'
this
.
title
=
val
?
'新建角色'
:
'角色列表'
...
...
src/components/Tree/src/main.vue
View file @
9dcc9c8
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
:props=
'props'
:props=
'props'
:default-expand-all=
'defaultExpandAll'
:default-expand-all=
'defaultExpandAll'
:default-checked-keys=
"defaultCheckedKeys"
:default-checked-keys=
"defaultCheckedKeys"
:check-strictly=
"checkStrictly"
@
check=
'check'
@
check=
'check'
@
node-click=
'nodeClick'
@
node-click=
'nodeClick'
></gl-tree>
></gl-tree>
...
@@ -22,6 +23,7 @@ export default {
...
@@ -22,6 +23,7 @@ export default {
data
()
{
data
()
{
return
{
return
{
data
:
null
,
data
:
null
,
checkStrictly
:
true
,
props
:
{
props
:
{
label
:
'text'
label
:
'text'
}
}
...
@@ -44,7 +46,7 @@ export default {
...
@@ -44,7 +46,7 @@ export default {
keyFresh
(
val
)
{
keyFresh
(
val
)
{
// console.log(`keyFresh----------------------${this.keyFresh}`)
// console.log(`keyFresh----------------------${this.keyFresh}`)
// console.log(this.defaultCheckedKeys)
// console.log(this.defaultCheckedKeys)
val
&&
this
.
loadingTree
()
val
&&
(
this
.
checkStrictly
=
val
)
&&
this
.
loadingTree
()
},
},
propsData
(
val
)
{
propsData
(
val
)
{
this
.
loadingTree
()
this
.
loadingTree
()
...
@@ -58,8 +60,11 @@ export default {
...
@@ -58,8 +60,11 @@ export default {
this
.
$emit
(
'input'
,
{
data
,
treeData
})
this
.
$emit
(
'input'
,
{
data
,
treeData
})
},
},
loadingTree
()
{
loadingTree
()
{
// console.log(this.checkStrictly)
!
this
.
propsData
&&
this
.
getData
()
!
this
.
propsData
&&
this
.
getData
()
this
.
propsData
&&
(
this
.
data
=
fn
(
this
.
propsData
,
'#'
))
this
.
propsData
&&
(
this
.
data
=
fn
(
this
.
propsData
,
'#'
))
this
.
checkStrictly
=
false
// console.log(this.checkStrictly)
// console.log(this.propsData)
// console.log(this.propsData)
// console.log(this.data)
// console.log(this.data)
},
},
...
...
src/views/customer/role/index.vue
View file @
9dcc9c8
...
@@ -63,6 +63,7 @@ export default {
...
@@ -63,6 +63,7 @@ export default {
data
:
[],
data
:
[],
column
:
roleDataColumn
,
column
:
roleDataColumn
,
console
:
{
console
:
{
show
:
true
,
label
:
'操作'
,
label
:
'操作'
,
prop
:
'roleOptions'
,
prop
:
'roleOptions'
,
button
:
[{
button
:
[{
...
@@ -166,30 +167,40 @@ export default {
...
@@ -166,30 +167,40 @@ export default {
// 添加角色
// 添加角色
addRole
(
params
)
{
addRole
(
params
)
{
console
.
log
(
params
)
console
.
log
(
params
)
this
.
createOrEditSuccess
()
//
this.createOrEditSuccess()
// editData = { roleName: editData.roleName }
// editData = { roleName: editData.roleName }
// const aa = { role: editData }
// const aa = { role: editData }
// const aa = JSON.stringify(editData)
// const aa = JSON.stringify(editData)
// console.log(aa)
// console.log(aa)
// console.log(editData)
// console.log(editData)
// const cc = { roleName: 'ggg' }
// const cc = { roleName: 'ggg' }
// saveRoleList.req(params).then((data) => {
// ----------------------
// console.log(data)
// delete params.roleName
// this.createOrEditSuccess()
delete
params
.
description
// }).catch(err => {
delete
params
.
departId
// console.log(err)
delete
params
.
departName
// })
delete
params
.
departPath
delete
params
.
rights
delete
params
.
state
const
paramsJS
=
JSON
.
stringify
(
params
)
console
.
log
(
paramsJS
)
saveRoleList
.
req
(
paramsJS
).
then
((
data
)
=>
{
console
.
log
(
data
)
this
.
createOrEditSuccess
()
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
},
},
// 编辑角色
// 编辑角色
updateRoleInfo
(
params
)
{
updateRoleInfo
(
params
)
{
console
.
log
(
params
)
console
.
log
(
params
)
this
.
createOrEditSuccess
()
this
.
createOrEditSuccess
()
//
updateRole.req(params).then((data) => {
updateRole
.
req
(
params
).
then
((
data
)
=>
{
//
console.log(data)
console
.
log
(
data
)
//
this.createOrEditSuccess()
this
.
createOrEditSuccess
()
//
}).catch(err => {
}).
catch
(
err
=>
{
//
console.log(err)
console
.
log
(
err
)
//
})
})
},
},
// 接口请求-end---------------------------------------
// 接口请求-end---------------------------------------
createDialogVisible
()
{
createDialogVisible
()
{
...
...
src/views/customer/user/index.vue
View file @
9dcc9c8
...
@@ -101,6 +101,7 @@ export default {
...
@@ -101,6 +101,7 @@ export default {
}
}
},
},
console
:
{
console
:
{
// show: true,
label
:
'操作'
,
label
:
'操作'
,
prop
:
'operation'
,
prop
:
'operation'
,
button
:
[{
button
:
[{
...
@@ -120,7 +121,8 @@ export default {
...
@@ -120,7 +121,8 @@ export default {
label
:
'禁用'
,
label
:
'禁用'
,
type
:
'text'
,
type
:
'text'
,
formatter
(
index
,
column
,
rows
)
{
formatter
(
index
,
column
,
rows
)
{
column
.
label
=
rows
[
index
].
state
<
1
?
'启动'
:
'禁用'
console
.
log
(
rows
[
index
])
// column.label = rows[index].state < 1 ? '启动' : '禁用'
},
},
callback
:
(
index
,
rows
)
=>
{
callback
:
(
index
,
rows
)
=>
{
console
.
log
(
rows
[
index
].
state
)
console
.
log
(
rows
[
index
].
state
)
...
...
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