refactor(AppRoleRightsManager): BUG 526 优化角色用户展示和编辑功能- 重新设计角色用户列表的展示方式,使用标签替代原有格式
- 调整角色名称列宽,提高可读性- 编辑角色时增加角色类型参数,可能为后续流程使用
This commit is contained in:
@@ -35,23 +35,12 @@
|
|||||||
@getList="getTableData" :col-configs="colConfigs" :dict="dict"
|
@getList="getTableData" :col-configs="colConfigs" :dict="dict"
|
||||||
@selection-change="v=>multipleSelection=v">
|
@selection-change="v=>multipleSelection=v">
|
||||||
<el-table-column label="角色用户" slot="users" align="center">
|
<el-table-column label="角色用户" slot="users" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="{row}">
|
||||||
<el-tooltip
|
<div class="font-12 flex wrap gap-6">
|
||||||
effect="light"
|
<el-tag size="mini" v-for="(item, i) in row.users" :key="i">{{ item.name }}
|
||||||
placement="top"
|
<template v-if="item.phone">({{ item.phone }})</template>
|
||||||
:disabled="scope.row.users.length <= 2"
|
</el-tag>
|
||||||
content="更多角色用户请点击详情按钮">
|
</div>
|
||||||
<span v-if="scope.row.users.length">
|
|
||||||
{{
|
|
||||||
scope.row.users
|
|
||||||
.slice(0, 2)
|
|
||||||
.map((e) => e.name + "(" + e.phone + ")")
|
|
||||||
.join(";")
|
|
||||||
}}
|
|
||||||
<span v-if="scope.row.users.length > 2">...</span>
|
|
||||||
</span>
|
|
||||||
<span v-else>-</span>
|
|
||||||
</el-tooltip>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
<el-table-column slot="options" label="操作" fixed="right" align="center">
|
||||||
@@ -186,7 +175,7 @@ export default {
|
|||||||
colConfigs() {
|
colConfigs() {
|
||||||
return [
|
return [
|
||||||
{type: "selection"},
|
{type: "selection"},
|
||||||
{label: "角色名", prop: "name", width: '100px'},
|
{label: "角色名", prop: "name", width: 140},
|
||||||
{label: "所属端", prop: "type", width: '100px', dict: "roleType"},
|
{label: "所属端", prop: "type", width: '100px', dict: "roleType"},
|
||||||
{label: "用户数量", prop: "roleCount", align: 'center', width: '80px'},
|
{label: "用户数量", prop: "roleCount", align: 'center', width: '80px'},
|
||||||
{slot: "users"},
|
{slot: "users"},
|
||||||
@@ -248,7 +237,8 @@ export default {
|
|||||||
hash: "#add",
|
hash: "#add",
|
||||||
query: {
|
query: {
|
||||||
id: item.id,
|
id: item.id,
|
||||||
name: item.name
|
name: item.name,
|
||||||
|
type: item.type,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
form: {},
|
form: {},
|
||||||
roleName: '',
|
|
||||||
id: '',
|
id: '',
|
||||||
appList: [],
|
appList: [],
|
||||||
roleList: [],
|
roleList: [],
|
||||||
@@ -73,8 +72,8 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if (this.isEdit) {
|
if (this.isEdit) {
|
||||||
let {id, name: roleName} = this.$route.query
|
let {id, name: roleName, type} = this.$route.query
|
||||||
this.form = {menus: [], id, roleName}
|
this.form = {menus: [], id, roleName, type}
|
||||||
this.msgTitle = '编辑'
|
this.msgTitle = '编辑'
|
||||||
}
|
}
|
||||||
this.getPermissions()
|
this.getPermissions()
|
||||||
|
|||||||
Reference in New Issue
Block a user