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 = {
departId
:
''
,
departName
:
''
,
departPath
:
''
,
rights
:
Array
,
state
:
1
,
createTime
:
''
rights
:
[]
,
state
:
1
//
createTime: ''
}
const
roleDataColumn
=
[{
...
...
src/components/LeftManager/src/main.vue
View file @
305e7c2
...
...
@@ -68,10 +68,10 @@ export default {
for
(
const
key
in
this
.
value
.
form
)
{
this
.
value
.
form
[
key
]
=
null
}
if
(
this
.
value
.
form
.
createTime
!==
undefined
)
{
this
.
value
.
form
.
createTime
=
timeTip
this
.
value
.
form
.
updateTime
=
timeTip
}
//
if (this.value.form.createTime !== undefined) {
//
this.value.form.createTime = timeTip
//
this.value.form.updateTime = timeTip
//
}
}
}
}
...
...
src/components/RightForm/src/main.vue
View file @
305e7c2
...
...
@@ -131,7 +131,7 @@ export default {
const
treeData
=
this
.
value
.
allNode
if
(
this
.
value
.
form
[
this
.
form
[
0
].
value
]
!==
''
&&
this
.
value
.
form
[
this
.
form
[
0
].
value
]
!==
null
)
{
const
obj
=
this
.
getMenuObj
()
obj
.
updateTime
=
new
Date
().
getTime
()
//
obj.updateTime = new Date().getTime()
obj
.
isHidden
=
this
.
value
.
form
.
isHidden
===
true
?
0
:
1
console
.
log
(
obj
)
// 添加同级
...
...
@@ -148,7 +148,7 @@ export default {
this
.
addData
(
obj
)
// 修改
}
else
{
obj
.
createTime
=
this
.
unix
(
this
.
value
.
form
.
createTime
)
//
obj.createTime = this.unix(this.value.form.createTime)
editMenu
.
req
(
obj
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
Tip
(
true
)
...
...
@@ -167,7 +167,11 @@ export default {
return
new
Date
(
time
).
getTime
()
},
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
)
{
addMenu
.
req
(
obj
).
then
(
res
=>
{
console
.
log
(
res
)
...
...
src/components/RoleCreate/src/main.vue
View file @
305e7c2
...
...
@@ -15,9 +15,9 @@
<gl-form-item
label=
"所属部门:"
prop=
"departName"
>
<gl-select
placeholder=
"请选择"
v-model=
"createRuleForm.departName"
>
<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>
</gl-option>
<!--
<gl-option
label=
"运营平台"
value=
"运营平台"
></gl-option>
-->
</gl-select>
</gl-form-item>
<gl-form-item
label=
"菜单选项:"
prop=
"rights"
>
...
...
src/components/RoleDetail/src/main.vue
View file @
305e7c2
...
...
@@ -20,6 +20,9 @@ export default {
detailVisible
:
Boolean
,
roleParam
:
Object
},
mounted
()
{
console
.
log
(
this
.
roleParam
)
},
data
()
{
return
{
}
...
...
src/components/Tree/src/main.vue
View file @
305e7c2
...
...
@@ -38,26 +38,34 @@ export default {
},
isDepart
:
Boolean
},
watch
:
{
defaultCheckedKeys
(
val
)
{
this
.
loadingTree
()
}
},
methods
:
{
nodeClick
(
data
,
treeData
,
vue
)
{
this
.
$emit
(
'node-click'
,
data
,
treeData
,
vue
,
this
.
props
)
},
check
(
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
()
{
!
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
)
})
this
.
loadingTree
()
}
}
function
fn
(
data
,
pid
)
{
...
...
src/views/customer/menu/index.vue
View file @
305e7c2
...
...
@@ -29,7 +29,7 @@ export default {
data
:
[],
form
:
{
id
:
0
,
urlName
:
''
,
urlName
:
'
ttt
'
,
hostName
:
''
,
openStyle
:
'新系统'
,
menuType
:
''
,
...
...
@@ -39,8 +39,8 @@ export default {
baseUrl
:
''
,
iorder
:
null
,
isHidden
:
0
,
createTime
:
null
,
updateTime
:
null
,
//
createTime: null,
//
updateTime: null,
grade
:
0
,
iconUrl
:
''
,
lastOperatorId
:
0
,
...
...
@@ -119,11 +119,14 @@ export default {
// console.log(res[key], typeof res[key], key)
// }
// console.log(this.menuMG.allNode, this.menuMG.node)
console
.
log
(
res
)
for
(
const
key
in
this
.
menuMG
.
form
)
{
if
(
key
===
'isHidden'
)
{
this
.
menuMG
.
form
[
key
]
=
res
[
key
]
===
0
}
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'
)
{
this
.
menuMG
.
form
[
key
]
=
node
.
level
===
1
?
'顶级菜单'
:
node
.
parent
.
data
[
props
.
label
]
}
else
{
...
...
src/views/customer/role/index.vue
View file @
305e7c2
...
...
@@ -49,6 +49,7 @@ export default {
apiParam
:
Number
,
flagRoleOrUser
:
true
,
flagCOrE
:
Boolean
,
editOrDetail
:
Boolean
,
roleMenuTree
:
[],
createOrEditTitle
:
'新增角色'
,
userDetailTitle
:
'用户列表'
,
...
...
@@ -76,7 +77,8 @@ export default {
label
:
'详细'
,
type
:
'text'
,
callback
:
(
index
,
rows
)
=>
{
this
.
handleGetRoleDetail
(
rows
[
index
])
this
.
roleParam
=
this
.
$deep_clone
(
rows
[
index
])
this
.
handleGetRoleDetail
()
}
},
{
label
:
'删除'
,
...
...
@@ -143,6 +145,7 @@ export default {
// console.log(res)
this
.
total
=
res
.
total
this
.
roleData
.
data
=
res
.
list
// this.$set(this.roleData, 'data', res.list)
// console.log(this.roleData.data)
}).
catch
(
err
=>
{
console
.
log
(
err
)
...
...
@@ -159,11 +162,14 @@ export default {
},
// 获得角色的相关权限详细信息,并返回树形数据
getMenuTree
(
params
)
{
console
.
log
(
typeof
(
this
.
roleParam
.
rights
))
selectMenuTreeRoleId
.
req
({
id
:
params
}).
then
(
res
=>
{
res
.
forEach
(
item
=>
{
this
.
roleMenuTree
.
push
(
item
.
id
)
this
.
roleParam
.
rights
.
push
(
item
.
id
)
})
this
.
createDialogVisible
()
this
.
editOrDetail
&&
this
.
createDialogVisible
()
!
this
.
editOrDetail
&&
this
.
deleteDialogVisible
()
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
...
...
@@ -223,9 +229,8 @@ export default {
handleSearchRoleName
()
{
this
.
getList
()
},
handleGetRoleDetail
(
params
)
{
this
.
roleParam
=
params
this
.
deleteDialogVisible
()
handleGetRoleDetail
()
{
this
.
getMenuTree
(
this
.
roleParam
.
id
,
this
.
editOrDetail
=
false
)
},
handleDetailClose
()
{
this
.
deleteDialogVisible
()
...
...
@@ -246,7 +251,7 @@ export default {
handleCreateOrEdit
()
{
this
.
roleParam
=
this
.
flagCOrE
?
roleCreateStructure
:
this
.
roleParam
this
.
flagCOrE
&&
this
.
createDialogVisible
()
!
this
.
flagCOrE
&&
this
.
getMenuTree
(
this
.
roleParam
.
id
)
!
this
.
flagCOrE
&&
this
.
getMenuTree
(
this
.
roleParam
.
id
,
this
.
editOrDetail
=
true
)
},
// 关闭新增用户组件
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