Commit c6e49daa by cwq0219

role-用户组件

1 parent e97bff0e
......@@ -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
}
<!-- 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>
......
......@@ -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: []
}
}
},
......
......@@ -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
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!