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 c6e49daa
authored
Sep 11, 2018
by
cwq0219
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
role-用户组件
1 parent
e97bff0e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
43 deletions
src/common/roleCommon.js
src/components/RoleDetail/src/main.vue
src/components/UserDetail/src/main.vue
src/views/customer/role/index.vue
src/common/roleCommon.js
View file @
c6e49da
...
...
@@ -8,4 +8,34 @@ const roleCreateStructure = {
createTime
:
''
}
export
{
roleCreateStructure
}
const
userRoleDetailColumn
=
[{
label
:
'序号'
,
prop
:
'id'
},
{
label
:
'账号'
,
prop
:
'username'
},
{
label
:
'用户名称'
,
prop
:
'realname'
},
{
label
:
'状态'
,
prop
:
'state'
}]
const
userRoleDetailConsole
=
{
label
:
'操作'
,
prop
:
'option'
,
button
:
[{
label
:
'删除'
,
type
:
'text'
,
callback
:
(
index
,
rows
)
=>
{
this
.
$alert
(
rows
[
index
])
}
}]
}
export
{
roleCreateStructure
,
userRoleDetailColumn
,
userRoleDetailConsole
}
src/components/RoleDetail/src/main.vue
View file @
c6e49da
<!-- RoleDetail -->
<
template
>
<gl-dialog
title=
"角色列表"
:visible
.
sync=
"detailVisible"
:before-close=
"handleDetailCancel"
>
<gl-form
label-width=
"105px"
>
<gl-form-item
label=
"角色名称:"
>
<span>
{{
roleParam
.
roleName
}}
</span>
</gl-form-item>
<gl-form-item
label=
"角色描述:"
>
<span
style=
"word-wrap: break-word;"
>
{{
roleParam
.
description
}}
</span>
</gl-form-item>
<gl-form-item
label=
"菜单选项:"
></gl-form-item>
</gl-form>
</gl-dialog>
<gl-dialog
title=
"角色列表"
:visible
.
sync=
"detailVisible"
:before-close=
"handleDetailCancel"
>
<gl-form
label-width=
"105px"
>
<gl-form-item
label=
"角色名称:"
>
<span>
{{
roleParam
.
roleName
}}
</span>
</gl-form-item>
<gl-form-item
label=
"角色描述:"
>
<span
style=
"word-wrap: break-word;"
>
{{
roleParam
.
description
}}
</span>
</gl-form-item>
<gl-form-item
label=
"菜单选项:"
></gl-form-item>
</gl-form>
</gl-dialog>
</
template
>
<
script
>
...
...
src/components/UserDetail/src/main.vue
View file @
c6e49da
...
...
@@ -13,8 +13,17 @@ export default {
props
:
{
userDetailTitle
:
String
,
userDetailVisible
:
Boolean
,
dataParam
:
Object
,
columnParam
:
Object
// dataParam: Object,
columnParam
:
Array
,
consoleParam
:
[
Array
,
Object
]
},
watch
:
{
columnParam
(
val
)
{
this
.
tableParam
.
column
=
this
.
$deep_clone
(
val
)
},
consoleParam
(
val
)
{
this
.
tableParam
.
console
=
this
.
$deep_clone
(
val
)
}
},
data
()
{
return
{
...
...
@@ -26,30 +35,8 @@ export default {
realname
:
'陈婉清'
,
state
:
'启动'
}],
column
:
[{
label
:
'序号'
,
prop
:
'id'
},
{
label
:
'账号'
,
prop
:
'username'
},
{
label
:
'用户名称'
,
prop
:
'realname'
},
{
label
:
'状态'
,
prop
:
'state'
}],
console
:
{
label
:
'操作'
,
prop
:
'option'
,
button
:
[{
label
:
'删除'
,
type
:
'text'
,
callback
:
(
index
,
rows
)
=>
{
this
.
$alert
(
rows
[
index
])
}
}]
}
column
:
[],
console
:
[]
}
}
},
...
...
src/views/customer/role/index.vue
View file @
c6e49da
...
...
@@ -10,9 +10,9 @@
<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-detail
:detailVisible=
"detailVisible"
:roleParam=
"roleParam"
@
detailClose=
"handleDetailClose"
></role-detail>
<user-detail
:userDetailVisible=
"userDetailVisible"
:userDetailTitle=
"userDetailTitle"
@
userDetailClose=
"
userDetailDialogVisible
"
></user-detail>
<user-detail
:userDetailVisible=
"userDetailVisible"
:userDetailTitle=
"userDetailTitle"
@
userDetailClose=
"
handleUserDetailClose"
:dataParam=
"[]"
:columnParam=
"columnParam"
:consoleParam=
"consoleParam
"
></user-detail>
<div
class=
"m-b8"
>
<gl-table
:table=
"roleData"
:pagination=
"pagination"
:dataParam=
"[]"
:columnParam=
"[]"
></gl-table>
<gl-table
:table=
"roleData"
:pagination=
"pagination"
></gl-table>
</div>
</div>
</div>
...
...
@@ -21,7 +21,7 @@
<
script
>
import
{
RoleCreate
,
RoleDetail
,
UserDetail
}
from
'@/components/index'
import
{
roleTest
}
from
'@/api/roleApi'
import
{
roleCreateStructure
}
from
'@/common/roleCommon'
import
{
roleCreateStructure
,
userRoleDetailColumn
,
userRoleDetailConsole
}
from
'@/common/roleCommon'
export
default
{
name
:
'role'
,
components
:
{
...
...
@@ -36,6 +36,8 @@ export default {
detailVisible
:
false
,
userDetailVisible
:
false
,
roleParam
:
roleCreateStructure
,
columnParam
:
[],
consoleParam
:
[],
createOrEditTitle
:
'新增角色'
,
userDetailTitle
:
'用户列表'
,
roleData
:
{
...
...
@@ -83,7 +85,7 @@ export default {
label
:
'用户'
,
type
:
'text'
,
callback
:
(
index
,
rows
)
=>
{
this
.
handleGetUserDetail
(
rows
[
index
]
)
this
.
handleGetUserDetail
()
}
}]
}
...
...
@@ -154,9 +156,16 @@ export default {
this
.
detaleDialogVisible
()
this
.
roleParam
=
roleCreateStructure
},
handleGetUserDetail
(
params
)
{
handleGetUserDetail
()
{
this
.
columnParam
=
this
.
$deep_clone
(
userRoleDetailColumn
)
this
.
consoleParam
=
this
.
$deep_clone
(
userRoleDetailConsole
)
this
.
userDetailDialogVisible
()
},
handleUserDetailClose
()
{
this
.
userDetailDialogVisible
()
this
.
columnParam
=
[]
this
.
consoleParam
=
[]
},
handleCreateOrEdit
(
params
,
title
)
{
this
.
createDialogVisible
()
this
.
createOrEditTitle
=
title
...
...
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