修复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

View File

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

View File

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