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 = {
...
@@ -8,4 +8,34 @@ const roleCreateStructure = {
createTime
:
''
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 -->
<!-- RoleDetail -->
<
template
>
<
template
>
<gl-dialog
title=
"角色列表"
:visible
.
sync=
"detailVisible"
:before-close=
"handleDetailCancel"
>
<gl-dialog
title=
"角色列表"
:visible
.
sync=
"detailVisible"
:before-close=
"handleDetailCancel"
>
<gl-form
label-width=
"105px"
>
<gl-form
label-width=
"105px"
>
<gl-form-item
label=
"角色名称:"
>
<gl-form-item
label=
"角色名称:"
>
<span>
{{
roleParam
.
roleName
}}
</span>
<span>
{{
roleParam
.
roleName
}}
</span>
</gl-form-item>
</gl-form-item>
<gl-form-item
label=
"角色描述:"
>
<gl-form-item
label=
"角色描述:"
>
<span
style=
"word-wrap: break-word;"
>
{{
roleParam
.
description
}}
</span>
<span
style=
"word-wrap: break-word;"
>
{{
roleParam
.
description
}}
</span>
</gl-form-item>
</gl-form-item>
<gl-form-item
label=
"菜单选项:"
></gl-form-item>
<gl-form-item
label=
"菜单选项:"
></gl-form-item>
</gl-form>
</gl-form>
</gl-dialog>
</gl-dialog>
</
template
>
</
template
>
<
script
>
<
script
>
...
...
src/components/UserDetail/src/main.vue
View file @
c6e49da
...
@@ -13,8 +13,17 @@ export default {
...
@@ -13,8 +13,17 @@ export default {
props
:
{
props
:
{
userDetailTitle
:
String
,
userDetailTitle
:
String
,
userDetailVisible
:
Boolean
,
userDetailVisible
:
Boolean
,
dataParam
:
Object
,
// dataParam: Object,
columnParam
:
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
()
{
data
()
{
return
{
return
{
...
@@ -26,30 +35,8 @@ export default {
...
@@ -26,30 +35,8 @@ export default {
realname
:
'陈婉清'
,
realname
:
'陈婉清'
,
state
:
'启动'
state
:
'启动'
}],
}],
column
:
[{
column
:
[],
label
:
'序号'
,
console
:
[]
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
])
}
}]
}
}
}
}
}
},
},
...
...
src/views/customer/role/index.vue
View file @
c6e49da
...
@@ -10,9 +10,9 @@
...
@@ -10,9 +10,9 @@
<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>
<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=
"
userDetailDialogVisible
"
></user-detail>
<user-detail
:userDetailVisible=
"userDetailVisible"
:userDetailTitle=
"userDetailTitle"
@
userDetailClose=
"
handleUserDetailClose"
:dataParam=
"[]"
:columnParam=
"columnParam"
:consoleParam=
"consoleParam
"
></user-detail>
<div
class=
"m-b8"
>
<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>
</div>
</div>
</div>
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
<
script
>
<
script
>
import
{
RoleCreate
,
RoleDetail
,
UserDetail
}
from
'@/components/index'
import
{
RoleCreate
,
RoleDetail
,
UserDetail
}
from
'@/components/index'
import
{
roleTest
}
from
'@/api/roleApi'
import
{
roleTest
}
from
'@/api/roleApi'
import
{
roleCreateStructure
}
from
'@/common/roleCommon'
import
{
roleCreateStructure
,
userRoleDetailColumn
,
userRoleDetailConsole
}
from
'@/common/roleCommon'
export
default
{
export
default
{
name
:
'role'
,
name
:
'role'
,
components
:
{
components
:
{
...
@@ -36,6 +36,8 @@ export default {
...
@@ -36,6 +36,8 @@ export default {
detailVisible
:
false
,
detailVisible
:
false
,
userDetailVisible
:
false
,
userDetailVisible
:
false
,
roleParam
:
roleCreateStructure
,
roleParam
:
roleCreateStructure
,
columnParam
:
[],
consoleParam
:
[],
createOrEditTitle
:
'新增角色'
,
createOrEditTitle
:
'新增角色'
,
userDetailTitle
:
'用户列表'
,
userDetailTitle
:
'用户列表'
,
roleData
:
{
roleData
:
{
...
@@ -83,7 +85,7 @@ export default {
...
@@ -83,7 +85,7 @@ export default {
label
:
'用户'
,
label
:
'用户'
,
type
:
'text'
,
type
:
'text'
,
callback
:
(
index
,
rows
)
=>
{
callback
:
(
index
,
rows
)
=>
{
this
.
handleGetUserDetail
(
rows
[
index
]
)
this
.
handleGetUserDetail
()
}
}
}]
}]
}
}
...
@@ -154,9 +156,16 @@ export default {
...
@@ -154,9 +156,16 @@ export default {
this
.
detaleDialogVisible
()
this
.
detaleDialogVisible
()
this
.
roleParam
=
roleCreateStructure
this
.
roleParam
=
roleCreateStructure
},
},
handleGetUserDetail
(
params
)
{
handleGetUserDetail
()
{
this
.
columnParam
=
this
.
$deep_clone
(
userRoleDetailColumn
)
this
.
consoleParam
=
this
.
$deep_clone
(
userRoleDetailConsole
)
this
.
userDetailDialogVisible
()
this
.
userDetailDialogVisible
()
},
},
handleUserDetailClose
()
{
this
.
userDetailDialogVisible
()
this
.
columnParam
=
[]
this
.
consoleParam
=
[]
},
handleCreateOrEdit
(
params
,
title
)
{
handleCreateOrEdit
(
params
,
title
)
{
this
.
createDialogVisible
()
this
.
createDialogVisible
()
this
.
createOrEditTitle
=
title
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