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 1154bc3f
authored
Sep 15, 2018
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
role-用户组件接口
1 parent
8680beae
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
93 additions
and
37 deletions
src/common/roleConst.js
src/components/UserDetail/src/main.vue
src/config/common.conf.js
src/views/customer/role/index.vue
src/views/customer/user/index.vue
src/common/roleConst.js
View file @
1154bc3
const
roleCreateStructure
=
{
i
d
:
Number
,
roleI
d
:
Number
,
roleName
:
''
,
description
:
''
,
departName
:
''
,
right
:
Array
,
state
:
1
,
state
:
Number
,
createTime
:
''
}
const
userRoleDetailColumn
=
[{
label
:
'序号'
,
prop
:
'
i
d'
prop
:
'
userI
d'
},
{
label
:
'账号'
,
prop
:
'username'
...
...
src/components/UserDetail/src/main.vue
View file @
1154bc3
...
...
@@ -3,17 +3,20 @@
<div>
<gl-dialog
:title=
"userDetailTitle"
:visible
.
sync=
"userDetailVisible"
:before-close=
"handleClose"
>
<gl-table
:table=
"tableParam"
></gl-table>
<gl-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"pageNum"
:page-sizes=
"[1,2,3,4]"
:page-size=
"pageSize"
layout=
"total, prev, pager, next"
:total=
"total"
>
</gl-pagination>
</gl-dialog>
</div>
</
template
>
<
script
>
import
{
selectUserRoleByRoleId
}
from
'@/api/api'
export
default
{
name
:
'UserDetail'
,
props
:
{
userDetailTitle
:
String
,
userDetailVisible
:
Boolean
,
// dataParam: Array
,
resParam
:
[
Array
,
Object
]
,
columnParam
:
Array
,
consoleParam
:
[
Array
,
Object
]
},
...
...
@@ -23,36 +26,72 @@ export default {
},
consoleParam
(
val
)
{
this
.
tableParam
.
console
=
val
},
apiParams
(
val
)
{
// this.tableParam.data = val.list
// this.total = val.total
this
.
id
=
val
console
.
log
(
this
.
id
)
this
.
selectUser
()
}
},
data
()
{
return
{
pageNum
:
1
,
pageSize
:
10
,
total
:
10
,
id
:
Number
,
tableParam
:
{
border
:
true
,
// role-data
// data: [{
//
i
d: '1006',
//
userI
d: '1006',
// username: 'text11',
// realname: '陈婉清',
// state: '启动'
// }],
data
:
[{
username
:
'abc'
,
realname
:
'陈婉清'
,
isadmin
:
'否'
,
mobile
:
'13033333333'
,
email
:
'abc@didihu.com'
,
roles
:
'好车主'
,
state
:
'开启'
}],
data
:
[],
column
:
[],
console
:
[]
}
}
},
methods
:
{
getParams
()
{
return
{
pageSize
:
this
.
pageSize
,
pageNum
:
this
.
pageNum
,
roleId
:
this
.
id
}
},
// 获取角色的相关用户详细信息
selectUser
()
{
const
params
=
this
.
getParams
()
// const params = {
// pageSize: this.pageSize,
// pageNum: this.pageNum,
// roleName: this.roleName
// roleId: roleId
// }
// console.log(params)
selectUserRoleByRoleId
.
req
(
params
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
total
=
res
.
total
this
.
resParam
=
res
.
list
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
},
handleClose
()
{
this
.
$emit
(
'userDetailClose'
)
},
handleSizeChange
(
val
)
{
this
.
pageSize
=
val
this
.
selectUser
()
},
handleCurrentChange
(
val
)
{
this
.
pageNum
=
val
this
.
selectUser
()
}
}
}
...
...
src/config/common.conf.js
View file @
1154bc3
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 @
1154bc3
...
...
@@ -16,7 +16,8 @@
<gl-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"pageNum"
:page-sizes=
"[10,20,30,40]"
:page-size=
"pageSize"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"total"
>
</gl-pagination>
<role-detail
:detailVisible=
"detailVisible"
:roleParam=
"roleParam"
@
detailClose=
"handleDetailClose"
></role-detail>
<user-detail
:userDetailVisible=
"userDetailVisible"
:userDetailTitle=
"userDetailTitle"
@
userDetailClose=
"handleUserDetailClose"
:dataParam=
"[]"
:columnParam=
"columnParam"
:consoleParam=
"consoleParam"
></user-detail>
<!--
<user-detail
:userDetailVisible=
"userDetailVisible"
:userDetailTitle=
"userDetailTitle"
@
userDetailClose=
"handleUserDetailClose"
:resParam=
"resParam"
:columnParam=
"columnParam"
:consoleParam=
"consoleParam"
></user-detail>
-->
<user-detail
:userDetailVisible=
"userDetailVisible"
:userDetailTitle=
"userDetailTitle"
@
userDetailClose=
"handleUserDetailClose"
:apiParams=
"apiParams"
:columnParam=
"columnParam"
:consoleParam=
"consoleParam"
></user-detail>
</div>
</div>
</div>
...
...
@@ -25,7 +26,7 @@
<
script
>
import
{
RoleCreate
,
RoleDetail
,
UserDetail
}
from
'@/components/index'
// 接口
import
{
getRoleList
,
selectUserRoleByRoleId
}
from
'@/api/api'
import
{
getRoleList
}
from
'@/api/api'
import
{
roleCreateStructure
,
userRoleDetailColumn
,
userRoleDetailConsole
}
from
'@/common/commonConst'
export
default
{
name
:
'role'
,
...
...
@@ -37,14 +38,14 @@ export default {
data
()
{
return
{
roleName
:
''
,
role
i
d
:
Number
,
role
I
d
:
Number
,
createVisible
:
false
,
detailVisible
:
false
,
userDetailVisible
:
false
,
roleParam
:
roleCreateStructure
,
columnParam
:
[],
consoleParam
:
[],
dataParam
:
[]
,
apiParams
:
Number
,
createOrEditTitle
:
'新增角色'
,
userDetailTitle
:
'用户列表'
,
// 分页所需参数-start
...
...
@@ -97,7 +98,7 @@ export default {
label
:
'用户'
,
type
:
'text'
,
callback
:
(
index
,
rows
)
=>
{
this
.
handleGetUserDetail
()
this
.
handleGetUserDetail
(
index
,
rows
)
}
}]
}
...
...
@@ -143,36 +144,48 @@ export default {
return
{
pageSize
:
this
.
pageSize
,
pageNum
:
this
.
pageNum
,
roleName
:
this
.
roleName
,
roleId
:
1006
roleName
:
this
.
roleName
}
},
reqList
()
{
// const params = this.getParams()
},
// 接口请求-start---------------------------------------
// 获取展示数据,请求表格数据
getList
()
{
const
params
=
this
.
getParams
()
getRoleList
.
req
(
params
).
then
(
res
=>
{
// console.log(res)
this
.
total
=
res
.
total
this
.
roleData
.
data
=
res
.
list
// console.log(this.roleData.data)
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
},
// 获取角色的相关用户详细信息
selectUser
()
{
const
params
=
this
.
getParams
()
selectUserRoleByRoleId
.
req
(
params
).
then
(
res
=>
{
this
.
total
=
res
.
total
this
.
roleData
.
data
=
res
.
list
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
},
// selectUser(roleId) {
// // const params = this.getParams()
// const params = {
// pageSize: this.pageSize,
// pageNum: this.pageNum,
// roleName: this.roleName
// // roleId: roleId
// }
// // console.log(params)
// selectUserRoleByRoleId.req(params).then(res => {
// console.log(res)
// // this.total = res.total
// this.resParam = res
// }).catch(err => {
// console.log(err)
// })
// },
// 接口请求-end---------------------------------------
// 新增用户到页面
aaaddRole
(
data
)
{
// 后台获取----------------------
data
.
id
=
'1038'
//
data.id = '1038'
data
.
createTime
=
new
Date
().
toLocaleString
().
split
(
'/'
).
join
(
'-'
)
// 后台获取----------------------
const
newData
=
data
...
...
@@ -209,14 +222,18 @@ export default {
this
.
deleteDialogVisible
()
this
.
roleParam
=
roleCreateStructure
},
handleGetUserDetail
()
{
handleGetUserDetail
(
index
,
rows
)
{
this
.
columnParam
=
userRoleDetailColumn
this
.
consoleParam
=
userRoleDetailConsole
this
.
dataParam
=
this
.
userDetailDialogVisible
()
this
.
apiParams
=
rows
[
index
].
id
// console.log(rows[index].id)
// this.selectUser({ roleId: rows[index].id })
// this.selectUser(rows[index].id)
this
.
userDetailDialogVisible
()
},
handleUserDetailClose
()
{
this
.
userDetailDialogVisible
()
this
.
apiParams
=
Number
},
handleCreateOrEdit
(
params
,
title
)
{
this
.
createDialogVisible
()
...
...
src/views/customer/user/index.vue
View file @
1154bc3
...
...
@@ -16,7 +16,7 @@
<gl-table
:table=
"userData"
ref=
"multipleTable"
></gl-table>
<gl-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"pageNum"
:page-sizes=
"[10,20,30,40]"
:page-size=
"pageSize"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"total"
>
</gl-pagination>
<user-detail
:userDetailVisible=
"userDetailVisible"
:userDetailTitle=
"userDetailTitle"
@
userDetailClose=
"handleUserDetailClose"
:
data
Param=
"[]"
:columnParam=
"columnParam"
:consoleParam=
"consoleParam"
></user-detail>
<user-detail
:userDetailVisible=
"userDetailVisible"
:userDetailTitle=
"userDetailTitle"
@
userDetailClose=
"handleUserDetailClose"
:
res
Param=
"[]"
:columnParam=
"columnParam"
:consoleParam=
"consoleParam"
></user-detail>
</div>
</div>
</div>
...
...
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