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 305e7c28
authored
Sep 28, 2018
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' of
https://github.com/glsx-web/authority
2 parents
7d4176fb
af3c6006
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
55 additions
and
32 deletions
src/common/roleConst.js
src/components/LeftManager/src/main.vue
src/components/RightForm/src/main.vue
src/components/RoleCreate/src/main.vue
src/components/RoleDetail/src/main.vue
src/components/Tree/src/main.vue
src/views/customer/menu/index.vue
src/views/customer/role/index.vue
src/common/roleConst.js
View file @
305e7c2
...
@@ -7,9 +7,9 @@ const roleCreateStructure = {
...
@@ -7,9 +7,9 @@ const roleCreateStructure = {
departId
:
''
,
departId
:
''
,
departName
:
''
,
departName
:
''
,
departPath
:
''
,
departPath
:
''
,
rights
:
Array
,
rights
:
[]
,
state
:
1
,
state
:
1
createTime
:
''
//
createTime: ''
}
}
const
roleDataColumn
=
[{
const
roleDataColumn
=
[{
...
...
src/components/LeftManager/src/main.vue
View file @
305e7c2
...
@@ -68,10 +68,10 @@ export default {
...
@@ -68,10 +68,10 @@ export default {
for
(
const
key
in
this
.
value
.
form
)
{
for
(
const
key
in
this
.
value
.
form
)
{
this
.
value
.
form
[
key
]
=
null
this
.
value
.
form
[
key
]
=
null
}
}
if
(
this
.
value
.
form
.
createTime
!==
undefined
)
{
//
if (this.value.form.createTime !== undefined) {
this
.
value
.
form
.
createTime
=
timeTip
//
this.value.form.createTime = timeTip
this
.
value
.
form
.
updateTime
=
timeTip
//
this.value.form.updateTime = timeTip
}
//
}
}
}
}
}
}
}
...
...
src/components/RightForm/src/main.vue
View file @
305e7c2
...
@@ -131,7 +131,7 @@ export default {
...
@@ -131,7 +131,7 @@ export default {
const
treeData
=
this
.
value
.
allNode
const
treeData
=
this
.
value
.
allNode
if
(
this
.
value
.
form
[
this
.
form
[
0
].
value
]
!==
''
&&
this
.
value
.
form
[
this
.
form
[
0
].
value
]
!==
null
)
{
if
(
this
.
value
.
form
[
this
.
form
[
0
].
value
]
!==
''
&&
this
.
value
.
form
[
this
.
form
[
0
].
value
]
!==
null
)
{
const
obj
=
this
.
getMenuObj
()
const
obj
=
this
.
getMenuObj
()
obj
.
updateTime
=
new
Date
().
getTime
()
//
obj.updateTime = new Date().getTime()
obj
.
isHidden
=
this
.
value
.
form
.
isHidden
===
true
?
0
:
1
obj
.
isHidden
=
this
.
value
.
form
.
isHidden
===
true
?
0
:
1
console
.
log
(
obj
)
console
.
log
(
obj
)
// 添加同级
// 添加同级
...
@@ -148,7 +148,7 @@ export default {
...
@@ -148,7 +148,7 @@ export default {
this
.
addData
(
obj
)
this
.
addData
(
obj
)
// 修改
// 修改
}
else
{
}
else
{
obj
.
createTime
=
this
.
unix
(
this
.
value
.
form
.
createTime
)
//
obj.createTime = this.unix(this.value.form.createTime)
editMenu
.
req
(
obj
).
then
(
res
=>
{
editMenu
.
req
(
obj
).
then
(
res
=>
{
console
.
log
(
res
)
console
.
log
(
res
)
this
.
Tip
(
true
)
this
.
Tip
(
true
)
...
@@ -167,7 +167,11 @@ export default {
...
@@ -167,7 +167,11 @@ export default {
return
new
Date
(
time
).
getTime
()
return
new
Date
(
time
).
getTime
()
},
},
addData
(
obj
)
{
addData
(
obj
)
{
obj
.
createTime
=
new
Date
().
getTime
()
// obj.createTime = new Date().getTime()
// const objPackge = { menu: obj }
// console.log(objPackge)
// delete obj.createTime
// delete obj.updateTime
if
(
!
this
.
isDepart
)
{
if
(
!
this
.
isDepart
)
{
addMenu
.
req
(
obj
).
then
(
res
=>
{
addMenu
.
req
(
obj
).
then
(
res
=>
{
console
.
log
(
res
)
console
.
log
(
res
)
...
...
src/components/RoleCreate/src/main.vue
View file @
305e7c2
...
@@ -15,9 +15,9 @@
...
@@ -15,9 +15,9 @@
<gl-form-item
label=
"所属部门:"
prop=
"departName"
>
<gl-form-item
label=
"所属部门:"
prop=
"departName"
>
<gl-select
placeholder=
"请选择"
v-model=
"createRuleForm.departName"
>
<gl-select
placeholder=
"请选择"
v-model=
"createRuleForm.departName"
>
<gl-option
style=
"height:160px"
>
<gl-option
style=
"height:160px"
>
<!--
<gl-input-tree
:data=
''
></gl-input-tree>
-->
<tree
ref=
'tree'
:isDepart=
"isDepart"
v-model=
"createRuleForm.departName"
:defaultExpandAll=
"defaultExpandAll"
@
node-click=
'clickDepart'
style=
"height:160px"
></tree>
<tree
ref=
'tree'
:isDepart=
"isDepart"
v-model=
"createRuleForm.departName"
:defaultExpandAll=
"defaultExpandAll"
@
node-click=
'clickDepart'
style=
"height:160px"
></tree>
</gl-option>
</gl-option>
<!--
<gl-option
label=
"运营平台"
value=
"运营平台"
></gl-option>
-->
</gl-select>
</gl-select>
</gl-form-item>
</gl-form-item>
<gl-form-item
label=
"菜单选项:"
prop=
"rights"
>
<gl-form-item
label=
"菜单选项:"
prop=
"rights"
>
...
...
src/components/RoleDetail/src/main.vue
View file @
305e7c2
...
@@ -20,6 +20,9 @@ export default {
...
@@ -20,6 +20,9 @@ export default {
detailVisible
:
Boolean
,
detailVisible
:
Boolean
,
roleParam
:
Object
roleParam
:
Object
},
},
mounted
()
{
console
.
log
(
this
.
roleParam
)
},
data
()
{
data
()
{
return
{
return
{
}
}
...
...
src/components/Tree/src/main.vue
View file @
305e7c2
...
@@ -38,26 +38,34 @@ export default {
...
@@ -38,26 +38,34 @@ export default {
},
},
isDepart
:
Boolean
isDepart
:
Boolean
},
},
watch
:
{
defaultCheckedKeys
(
val
)
{
this
.
loadingTree
()
}
},
methods
:
{
methods
:
{
nodeClick
(
data
,
treeData
,
vue
)
{
nodeClick
(
data
,
treeData
,
vue
)
{
this
.
$emit
(
'node-click'
,
data
,
treeData
,
vue
,
this
.
props
)
this
.
$emit
(
'node-click'
,
data
,
treeData
,
vue
,
this
.
props
)
},
},
check
(
data
,
treeData
)
{
check
(
data
,
treeData
)
{
this
.
$emit
(
'input'
,
{
data
,
treeData
})
this
.
$emit
(
'input'
,
{
data
,
treeData
})
},
loadingTree
()
{
!
this
.
isDepart
?
findMenuTree
.
req
().
then
(
res
=>
{
this
.
data
=
fn
(
res
,
'#'
)
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
:
findDepartTree
.
req
().
then
(
res
=>
{
this
.
data
=
fn
(
res
,
'#'
)
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
}
}
},
},
mounted
()
{
mounted
()
{
!
this
.
isDepart
this
.
loadingTree
()
?
findMenuTree
.
req
().
then
(
res
=>
{
this
.
data
=
fn
(
res
,
'#'
)
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
:
findDepartTree
.
req
().
then
(
res
=>
{
this
.
data
=
fn
(
res
,
'#'
)
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
}
}
}
}
function
fn
(
data
,
pid
)
{
function
fn
(
data
,
pid
)
{
...
...
src/views/customer/menu/index.vue
View file @
305e7c2
...
@@ -29,7 +29,7 @@ export default {
...
@@ -29,7 +29,7 @@ export default {
data
:
[],
data
:
[],
form
:
{
form
:
{
id
:
0
,
id
:
0
,
urlName
:
''
,
urlName
:
'
ttt
'
,
hostName
:
''
,
hostName
:
''
,
openStyle
:
'新系统'
,
openStyle
:
'新系统'
,
menuType
:
''
,
menuType
:
''
,
...
@@ -39,8 +39,8 @@ export default {
...
@@ -39,8 +39,8 @@ export default {
baseUrl
:
''
,
baseUrl
:
''
,
iorder
:
null
,
iorder
:
null
,
isHidden
:
0
,
isHidden
:
0
,
createTime
:
null
,
//
createTime: null,
updateTime
:
null
,
//
updateTime: null,
grade
:
0
,
grade
:
0
,
iconUrl
:
''
,
iconUrl
:
''
,
lastOperatorId
:
0
,
lastOperatorId
:
0
,
...
@@ -119,11 +119,14 @@ export default {
...
@@ -119,11 +119,14 @@ export default {
// console.log(res[key], typeof res[key], key)
// console.log(res[key], typeof res[key], key)
// }
// }
// console.log(this.menuMG.allNode, this.menuMG.node)
// console.log(this.menuMG.allNode, this.menuMG.node)
console
.
log
(
res
)
for
(
const
key
in
this
.
menuMG
.
form
)
{
for
(
const
key
in
this
.
menuMG
.
form
)
{
if
(
key
===
'isHidden'
)
{
if
(
key
===
'isHidden'
)
{
this
.
menuMG
.
form
[
key
]
=
res
[
key
]
===
0
this
.
menuMG
.
form
[
key
]
=
res
[
key
]
===
0
}
else
if
(
key
===
'createTime'
||
key
===
'updateTime'
)
{
}
else
if
(
key
===
'createTime'
||
key
===
'updateTime'
)
{
this
.
menuMG
.
form
[
key
]
=
new
Date
(
res
[
key
]).
format
(
'yyyy-MM-dd HH:mm:ss'
)
console
.
log
(
res
[
key
])
this
.
menuMG
.
form
[
key
]
=
res
[
key
]
// this.menuMG.form[key] = new Date(res[key]).format('yyyy-MM-dd HH:mm:ss')
}
else
if
(
key
===
'name'
)
{
}
else
if
(
key
===
'name'
)
{
this
.
menuMG
.
form
[
key
]
=
node
.
level
===
1
?
'顶级菜单'
:
node
.
parent
.
data
[
props
.
label
]
this
.
menuMG
.
form
[
key
]
=
node
.
level
===
1
?
'顶级菜单'
:
node
.
parent
.
data
[
props
.
label
]
}
else
{
}
else
{
...
...
src/views/customer/role/index.vue
View file @
305e7c2
...
@@ -49,6 +49,7 @@ export default {
...
@@ -49,6 +49,7 @@ export default {
apiParam
:
Number
,
apiParam
:
Number
,
flagRoleOrUser
:
true
,
flagRoleOrUser
:
true
,
flagCOrE
:
Boolean
,
flagCOrE
:
Boolean
,
editOrDetail
:
Boolean
,
roleMenuTree
:
[],
roleMenuTree
:
[],
createOrEditTitle
:
'新增角色'
,
createOrEditTitle
:
'新增角色'
,
userDetailTitle
:
'用户列表'
,
userDetailTitle
:
'用户列表'
,
...
@@ -76,7 +77,8 @@ export default {
...
@@ -76,7 +77,8 @@ export default {
label
:
'详细'
,
label
:
'详细'
,
type
:
'text'
,
type
:
'text'
,
callback
:
(
index
,
rows
)
=>
{
callback
:
(
index
,
rows
)
=>
{
this
.
handleGetRoleDetail
(
rows
[
index
])
this
.
roleParam
=
this
.
$deep_clone
(
rows
[
index
])
this
.
handleGetRoleDetail
()
}
}
},
{
},
{
label
:
'删除'
,
label
:
'删除'
,
...
@@ -143,6 +145,7 @@ export default {
...
@@ -143,6 +145,7 @@ export default {
// console.log(res)
// console.log(res)
this
.
total
=
res
.
total
this
.
total
=
res
.
total
this
.
roleData
.
data
=
res
.
list
this
.
roleData
.
data
=
res
.
list
// this.$set(this.roleData, 'data', res.list)
// console.log(this.roleData.data)
// console.log(this.roleData.data)
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
console
.
log
(
err
)
console
.
log
(
err
)
...
@@ -159,11 +162,14 @@ export default {
...
@@ -159,11 +162,14 @@ export default {
},
},
// 获得角色的相关权限详细信息,并返回树形数据
// 获得角色的相关权限详细信息,并返回树形数据
getMenuTree
(
params
)
{
getMenuTree
(
params
)
{
console
.
log
(
typeof
(
this
.
roleParam
.
rights
))
selectMenuTreeRoleId
.
req
({
id
:
params
}).
then
(
res
=>
{
selectMenuTreeRoleId
.
req
({
id
:
params
}).
then
(
res
=>
{
res
.
forEach
(
item
=>
{
res
.
forEach
(
item
=>
{
this
.
roleMenuTree
.
push
(
item
.
id
)
this
.
roleMenuTree
.
push
(
item
.
id
)
this
.
roleParam
.
rights
.
push
(
item
.
id
)
})
})
this
.
createDialogVisible
()
this
.
editOrDetail
&&
this
.
createDialogVisible
()
!
this
.
editOrDetail
&&
this
.
deleteDialogVisible
()
}).
catch
(
err
=>
{
}).
catch
(
err
=>
{
console
.
log
(
err
)
console
.
log
(
err
)
})
})
...
@@ -223,9 +229,8 @@ export default {
...
@@ -223,9 +229,8 @@ export default {
handleSearchRoleName
()
{
handleSearchRoleName
()
{
this
.
getList
()
this
.
getList
()
},
},
handleGetRoleDetail
(
params
)
{
handleGetRoleDetail
()
{
this
.
roleParam
=
params
this
.
getMenuTree
(
this
.
roleParam
.
id
,
this
.
editOrDetail
=
false
)
this
.
deleteDialogVisible
()
},
},
handleDetailClose
()
{
handleDetailClose
()
{
this
.
deleteDialogVisible
()
this
.
deleteDialogVisible
()
...
@@ -246,7 +251,7 @@ export default {
...
@@ -246,7 +251,7 @@ export default {
handleCreateOrEdit
()
{
handleCreateOrEdit
()
{
this
.
roleParam
=
this
.
flagCOrE
?
roleCreateStructure
:
this
.
roleParam
this
.
roleParam
=
this
.
flagCOrE
?
roleCreateStructure
:
this
.
roleParam
this
.
flagCOrE
&&
this
.
createDialogVisible
()
this
.
flagCOrE
&&
this
.
createDialogVisible
()
!
this
.
flagCOrE
&&
this
.
getMenuTree
(
this
.
roleParam
.
id
)
!
this
.
flagCOrE
&&
this
.
getMenuTree
(
this
.
roleParam
.
id
,
this
.
editOrDetail
=
true
)
},
},
// 关闭新增用户组件
// 关闭新增用户组件
handleCreateClose
(
data
)
{
handleCreateClose
(
data
)
{
...
...
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