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 734ac25d
authored
Sep 18, 2018
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改
1 parent
3356373c
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
66 additions
and
45 deletions
src/api/roleApi.js
src/common/roleConst.js
src/common/userConst.js
src/components/RoleCreate/src/main.vue
src/components/Tree/src/main.vue
src/components/UserDetail/src/main.vue
src/config/common.conf.js
src/views/customer/role/index.vue
src/views/customer/user/index.vue
src/api/roleApi.js
View file @
734ac25
...
...
@@ -39,6 +39,7 @@ const getRoleList = {
const
saveRoleList
=
{
p
:
[
__sSaveRoleList
],
// req: params => GlAxios.post(__sSaveRoleList, JSON.stringify(params), { headers: { 'Content/-Type': 'application/json;charset=UTF-8' }})
req
:
params
=>
GlAxios
.
post
(
__sSaveRoleList
,
params
)
}
...
...
src/common/roleConst.js
View file @
734ac25
const
roleCreateStructure
=
{
roleI
d
:
Number
,
i
d
:
Number
,
roleName
:
''
,
description
:
''
,
departName
:
''
,
right
:
Array
,
state
:
Number
,
right
s
:
Array
,
state
:
1
,
createTime
:
''
}
...
...
@@ -19,7 +19,10 @@ const userRoleDetailColumn = [{
prop
:
'realname'
},
{
label
:
'状态'
,
prop
:
'state'
prop
:
'state'
,
formatter
:
(
cellValue
)
=>
{
return
cellValue
<
1
?
'禁止'
:
'启动'
}
}]
const
userRoleDetailConsole
=
{
...
...
src/common/userConst.js
View file @
734ac25
...
...
@@ -6,7 +6,10 @@ const userDetailColumn = [{
prop
:
'realname'
},
{
label
:
'管理员'
,
prop
:
'isadmin'
prop
:
'isadmin'
,
formatter
:
(
cellValue
)
=>
{
return
cellValue
<
1
?
'否'
:
'是'
}
},
{
label
:
'手机号码'
,
prop
:
'mobile'
...
...
@@ -18,7 +21,10 @@ const userDetailColumn = [{
prop
:
'roles'
},
{
label
:
'状态'
,
prop
:
'state'
prop
:
'state'
,
formatter
:
(
cellValue
)
=>
{
return
cellValue
<
1
?
'禁止'
:
'启动'
}
}]
export
{
userDetailColumn
}
src/components/RoleCreate/src/main.vue
View file @
734ac25
...
...
@@ -76,24 +76,29 @@ export default {
methods
:
{
// tree-strat
getMenuOption
(
params
)
{
this
.
createRuleForm
.
right
=
params
return
params
this
.
createRuleForm
.
rights
=
params
.
treeData
.
checkedKeys
.
concat
(
params
.
treeData
.
halfCheckedKeys
)
},
// tree-end
getParams
()
{
return
this
.
$deep_clone
(
this
.
createRuleForm
)
},
// 接口
addRole
()
{
saveRoleList
.
req
(
this
.
getParams
()).
then
((
data
)
=>
{
addRole
(
flagEOrC
,
editData
)
{
// editData = { roleName: editData.roleName }
// const aa = JSON.stringify(editData)
// console.log(aa)
// console.log(editData)
saveRoleList
.
req
(
editData
).
then
((
data
)
=>
{
console
.
log
(
data
)
this
.
$emit
(
'createClose'
,
flagEOrC
,
editData
)
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
},
updateRoleInfo
()
{
updateRole
.
req
(
this
.
getParams
()
).
then
((
data
)
=>
{
updateRoleInfo
(
flagEOrC
,
editData
)
{
updateRole
.
req
(
editData
).
then
((
data
)
=>
{
console
.
log
(
data
)
this
.
$emit
(
'createClose'
,
flagEOrC
,
editData
)
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
...
...
@@ -103,13 +108,13 @@ export default {
const
editData
=
this
.
getParams
()
console
.
log
(
editData
)
// eidt:true;create:false
const
flagEOrC
=
editData
.
id
=
==
Number
const
flagEOrC
=
editData
.
id
!
==
Number
// console.log(flagEOrC)
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
!
flagEOrC
&&
this
.
addRole
()
flagEOrC
&&
this
.
updateRoleInfo
()
this
.
$emit
(
'createClose'
,
flagEOrC
,
editData
)
!
flagEOrC
&&
this
.
addRole
(
flagEOrC
,
editData
)
flagEOrC
&&
this
.
updateRoleInfo
(
flagEOrC
,
editData
)
//
this.$emit('createClose', flagEOrC, editData)
}
else
{
return
false
}
...
...
src/components/Tree/src/main.vue
View file @
734ac25
<
template
>
<div
class=
"tree"
:style=
"treeStyle"
>
<gl-tree
ref=
'tree'
highlight-current
:data=
'data'
:show-checkbox=
'showCheckbox'
node-key=
'id'
:props=
'props'
:default-expand-all=
'defaultExpandAll'
@
check=
'check'
@
node-click=
'nodeClick'
></gl-tree>
<gl-tree
ref=
'tree'
highlight-current
:data=
'data'
:show-checkbox=
'showCheckbox'
node-key=
'id'
:props=
'props'
:default-expand-all=
'defaultExpandAll'
@
check=
'check'
@
node-click=
'nodeClick'
></gl-tree>
</div>
</
template
>
<
script
>
import
{
findMenuTree
}
from
'@/api/api'
function
fn
(
data
,
pid
)
{
var
result
=
[]
let
temp
=
null
for
(
var
i
in
data
)
{
if
(
data
[
i
].
parent
==
pid
)
{
result
.
push
(
data
[
i
])
temp
=
fn
(
data
,
data
[
i
].
id
)
if
(
temp
.
length
>
0
)
{
data
[
i
].
children
=
temp
}
}
}
return
result
}
export
default
{
name
:
'Tree'
,
data
()
{
return
{
// data: this.$get_session_config().resources || this.$get_session_config(),
data
:
Object
,
data
:
[
Array
,
Function
]
,
props
:
{
// label: 'title'
label
:
'text'
}
}
...
...
@@ -35,9 +40,10 @@ export default {
},
mounted
()
{
findMenuTree
.
req
().
then
(
res
=>
{
console
.
log
(
res
)
// this.data = res
this
.
data
=
this
.
$get_menus
(
res
,
0
,
'parent'
)
// this.data = this.$get_menus(res, '#', 'parent')
this
.
data
=
fn
(
res
,
'#'
)
// console.log(this.data)
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
...
...
@@ -53,8 +59,8 @@ export default {
}
</
script
>
<
style
scoped
>
.tree
{
.tree
{
height
:
550px
;
overflow-y
:
scroll
;
}
}
</
style
>
src/components/UserDetail/src/main.vue
View file @
734ac25
...
...
@@ -45,6 +45,7 @@ export default {
flag
:
Number
,
tableParam
:
{
border
:
true
,
align
:
'center'
,
data
:
[],
column
:
[],
console
:
[]
...
...
src/config/common.conf.js
View file @
734ac25
export
default
{
axios
:
{
//
baseURL: 'http://cas.dev.glsx.net/admin-operating-auth/',
baseURL
:
'http://192.168.3.171:7300/mock/5b91805391b67469b43e2921/subsystem/'
,
baseURL
:
'http://cas.dev.glsx.net/admin-operating-auth/'
,
//
baseURL: 'http://192.168.3.171:7300/mock/5b91805391b67469b43e2921/subsystem/',
whiteList
:
[
'role/deleteRoleById'
,
'role/deleteUserRoleById'
,
'role/getRoleDetail'
,
'role/getRoleDetail'
,
'role/getRoleList'
,
'role/isRoleNameExit'
,
'role/saveRoleList'
,
'role/selectMenuTreeRoleId'
,
'role/selectUserRoleByRoleId'
,
'role/updateRole'
,
'user/batcheDel'
,
'user/findAll'
,
'user/get'
,
'user/getWithRoles'
,
'user/operatUser'
,
'user/updateUser'
,
'department/del'
,
'department/findTree'
,
'department/getPName'
,
'department/getTreeNode'
,
'department/updateDepartment'
,
'menu/add'
,
'menu/del'
,
'menu/edit'
,
'menu/findById'
,
'menu/findTree'
,
'menu/getByUserId'
,
'menu/getPName'
],
timeout
:
15000
,
result
:
{
...
...
src/views/customer/role/index.vue
View file @
734ac25
...
...
@@ -69,7 +69,7 @@ export default {
},
{
label
:
'状态'
,
prop
:
'state'
,
formatter
:
(
row
,
column
,
cellValue
,
index
)
=>
{
formatter
:
(
cellValue
)
=>
{
return
cellValue
<
1
?
'禁止'
:
'启动'
}
},
{
...
...
@@ -111,7 +111,6 @@ export default {
mounted
()
{
this
.
getList
()
},
// search--------------------
watch
:
{
roleName
(
val
)
{
!
val
&&
this
.
getList
()
...
...
@@ -137,8 +136,6 @@ export default {
}).
then
(()
=>
{
// 删除角色,根据返回的code值来判断是否删除成功
this
.
deleteRole
(
rows
[
index
].
id
)
rows
.
splice
(
index
,
1
)
this
.
message
(
'删除成功'
,
'success'
)
}).
catch
(()
=>
{
this
.
message
(
'取消删除'
)
})
...
...
@@ -151,9 +148,6 @@ export default {
keyWork
:
this
.
roleName
}
},
reqList
()
{
// const params = this.getParams()
},
// 接口请求-start---------------------------------------
// 获取展示数据,请求表格数据
getList
()
{
...
...
@@ -169,8 +163,9 @@ export default {
},
// 删除角色
deleteRole
(
params
)
{
deleteRoleById
.
req
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
deleteRoleById
.
req
({
roleId
:
params
}).
then
(
res
=>
{
this
.
message
(
'删除成功'
,
'success'
)
this
.
getList
()
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
...
...
@@ -206,7 +201,6 @@ export default {
},
handleSearchRoleName
()
{
this
.
getList
()
// this.roleName = ''
},
handleGetRoleDetail
(
params
)
{
this
.
roleParam
=
params
...
...
src/views/customer/user/index.vue
View file @
734ac25
...
...
@@ -74,7 +74,7 @@ export default {
},
{
label
:
'状态'
,
prop
:
'state'
,
formatter
:
(
row
,
column
,
cellValue
,
index
)
=>
{
formatter
:
(
cellValue
)
=>
{
return
cellValue
<
1
?
'禁止'
:
'启动'
}
},
{
...
...
@@ -125,6 +125,11 @@ export default {
mounted
()
{
this
.
findUserList
()
},
watch
:
{
userName
(
val
)
{
!
val
&&
this
.
findUserList
()
}
},
methods
:
{
// 获取所需字段
getParams
()
{
...
...
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