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