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 cc2fe29a
authored
Sep 12, 2018
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
分页
1 parent
7bebbbed
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
9 deletions
src/api/api.js
src/common/roleCommon.js
src/views/customer/role/index.vue
src/api/api.js
0 → 100644
View file @
cc2fe29
import
{
roleTest
,
deleteRoleById
,
deleteUserRoleById
,
getRoleDetail
,
getRoleList
,
isRoleNameExit
,
addRole
,
selectMenuTreeRoleId
,
selectUserRoleByRoleId
,
updateRole
}
from
'./roleApi'
import
{
getUserInfo
}
from
'./userApi'
export
{
// role接口
roleTest
,
deleteRoleById
,
deleteUserRoleById
,
getRoleDetail
,
getRoleList
,
isRoleNameExit
,
addRole
,
selectMenuTreeRoleId
,
selectUserRoleByRoleId
,
updateRole
,
// user接口
getUserInfo
}
src/common/roleCommon.js
View file @
cc2fe29
...
@@ -3,7 +3,7 @@ const roleCreateStructure = {
...
@@ -3,7 +3,7 @@ const roleCreateStructure = {
roleName
:
''
,
roleName
:
''
,
description
:
''
,
description
:
''
,
departName
:
''
,
departName
:
''
,
menuOption
:
''
,
right
:
[]
,
state
:
'启动'
,
state
:
'启动'
,
createTime
:
''
createTime
:
''
}
}
...
...
src/views/customer/role/index.vue
View file @
cc2fe29
...
@@ -10,7 +10,17 @@
...
@@ -10,7 +10,17 @@
<gl-button
class=
"control-tabledata-button"
size=
"small"
@
click=
"handleCreateOrEdit(roleParam, '新增角色')"
>
创建
</gl-button>
<gl-button
class=
"control-tabledata-button"
size=
"small"
@
click=
"handleCreateOrEdit(roleParam, '新增角色')"
>
创建
</gl-button>
<role-create
:createVisible=
"createVisible"
:roleParam=
"roleParam"
:createOrEditTitle=
"createOrEditTitle"
@
createClose=
"handleCreateClose"
></role-create>
<role-create
:createVisible=
"createVisible"
:roleParam=
"roleParam"
:createOrEditTitle=
"createOrEditTitle"
@
createClose=
"handleCreateClose"
></role-create>
<div
class=
"m-b8"
>
<div
class=
"m-b8"
>
<gl-table
:table=
"roleData"
:pagination=
"pagination"
></gl-table>
<gl-table
:table=
"roleData"
></gl-table>
<gl-pagination
background
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page=
"pagination.pageNum"
:page-sizes=
"[10,20,30,40]"
:page-size=
"pagination.pageSize"
layout=
"total, sizes, prev, pager, next, jumper"
:total=
"total"
>
</gl-pagination>
<role-detail
:detailVisible=
"detailVisible"
:roleParam=
"roleParam"
@
detailClose=
"handleDetailClose"
></role-detail>
<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"
:dataParam=
"[]"
:columnParam=
"columnParam"
:consoleParam=
"consoleParam"
></user-detail>
</div>
</div>
...
@@ -20,7 +30,10 @@
...
@@ -20,7 +30,10 @@
<
script
>
<
script
>
import
{
RoleCreate
,
RoleDetail
,
UserDetail
}
from
'@/components/index'
import
{
RoleCreate
,
RoleDetail
,
UserDetail
}
from
'@/components/index'
import
{
roleTest
}
from
'@/api/roleApi'
// easy mock接口
// import { roleTest } from '@/api/api'
// 后台接口
import
{
getRoleList
}
from
'@/api/api'
import
{
roleCreateStructure
,
userRoleDetailColumn
,
userRoleDetailConsole
}
from
'@/common/common'
import
{
roleCreateStructure
,
userRoleDetailColumn
,
userRoleDetailConsole
}
from
'@/common/common'
export
default
{
export
default
{
name
:
'role'
,
name
:
'role'
,
...
@@ -40,6 +53,13 @@ export default {
...
@@ -40,6 +53,13 @@ export default {
consoleParam
:
[],
consoleParam
:
[],
createOrEditTitle
:
'新增角色'
,
createOrEditTitle
:
'新增角色'
,
userDetailTitle
:
'用户列表'
,
userDetailTitle
:
'用户列表'
,
// 分页所需参数-start
total
:
100
,
pagination
:
{
pageNum
:
1
,
pageSize
:
10
},
// 分页所需参数-end
roleData
:
{
roleData
:
{
border
:
true
,
border
:
true
,
height
:
400
,
height
:
400
,
...
@@ -89,16 +109,18 @@ export default {
...
@@ -89,16 +109,18 @@ export default {
}
}
}]
}]
}
}
},
pagination
:
{
show
:
true
,
layout
:
'total, sizes, prev, pager, next, jumper'
}
}
}
}
},
},
mounted
()
{
mounted
()
{
roleTest
.
req
().
then
(
res
=>
{
// roleTest.req().then(res => {
this
.
roleData
.
data
=
res
.
roleData
// this.roleData.data = res.roleData
// })
// 请求表格数据
getRoleList
.
req
(
this
.
pagination
).
then
(
res
=>
{
console
.
log
(
res
)
this
.
total
=
res
.
total
this
.
roleData
.
data
=
res
.
condition
})
})
},
},
methods
:
{
methods
:
{
...
@@ -145,6 +167,13 @@ export default {
...
@@ -145,6 +167,13 @@ export default {
userDetailDialogVisible
()
{
userDetailDialogVisible
()
{
this
.
userDetailVisible
=
!
this
.
userDetailVisible
this
.
userDetailVisible
=
!
this
.
userDetailVisible
},
},
// 调取接口相关函数
handleSizeChange
(
val
)
{
this
.
pagination
.
pageSize
=
val
},
handleCurrentChange
(
val
)
{
this
.
pagination
.
pageNum
=
val
},
handleSearchRoleName
()
{
handleSearchRoleName
()
{
this
.
roleName
=
''
this
.
roleName
=
''
},
},
...
...
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