修复bug

This commit is contained in:
weipengfei 2023-08-26 17:58:49 +08:00
parent 2f316b0015
commit 1b870c2921
2 changed files with 17 additions and 6 deletions
src/views
user_menu
user_role

@ -64,12 +64,12 @@
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
<!-- <el-table-column type="selection" width="55" /> -->
<el-table-column label="上级菜单" prop="pid" show-overflow-tooltip />
<!-- <el-table-column
label="权限类型: M=目录C=菜单A=按钮"
prop="type"
show-overflow-tooltip
/> -->
<!-- <el-table-column label="上级菜单" prop="pid" show-overflow-tooltip>
<template #default="{ row }">
<span v-if="row.pid == 0">顶级</span>
<span v-else>{{ row.parentName }}</span>
</template>
</el-table-column> -->
<el-table-column label="菜单名称" prop="name" show-overflow-tooltip />
<el-table-column label="菜单图标" prop="icon" show-overflow-tooltip>
<template #default="{ row }">
@ -215,5 +215,15 @@ const handleDelete = async (id: number | any[]) => {
};
getLists();
watch(
() => pager.lists,
(newValue, oldValue) => {
newValue.forEach((item: any) => {
item.children.forEach((t: any) => {
t.parentName = item.name;
});
});
}
);
</script>

@ -61,6 +61,7 @@
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="ID" prop="id" show-overflow-tooltip />
<el-table-column label="名称" prop="name" show-overflow-tooltip />
<el-table-column label="描述" prop="desc" show-overflow-tooltip />
<el-table-column