diff --git a/src/views/admin/system/menu/index.vue b/src/views/admin/system/menu/index.vue
index 96ae119..dbb86b6 100644
--- a/src/views/admin/system/menu/index.vue
+++ b/src/views/admin/system/menu/index.vue
@@ -4,12 +4,7 @@
-
+
@@ -34,24 +29,15 @@
-
+
@@ -72,38 +58,17 @@
关闭
-
+
-
+
{{ $t("common.addBtn") }}
- {{ $t("common.editBtn") }}
-
+
({
createdIsNeed: false,
- pageList: pageList, // H
+ pageList: pageList,
queryForm: {
- parentId: -1,
+ // parentId: -1,
menuName: "",
},
isPage: false,
@@ -154,21 +119,32 @@ onMounted(async () => {
getDataList()
})
-// 根据类型判断是否有子节点
-const setHasChildren = (arr: any[]) => {
- arr.forEach((item) => {
- // 添加 hasChildren 属性
- item.hasChildren = item.menuType !== "1"
- })
-}
-const tableList = computed(() => {
+const expandRowKeys = computed(() => {
const list = state.dataList
- if (Array.isArray(list)) {
- setHasChildren(list)
- }
- return list
+ const arr: any[] = []
+ list?.forEach((item) => {
+ if (item.children && item.children.length) {
+ arr.push(item.id)
+ }
+ })
+ return arr
})
+// 根据类型判断是否有子节点
+// const setHasChildren = (arr: any[]) => {
+// arr.forEach((item) => {
+// // 添加 hasChildren 属性
+// item.hasChildren = item.menuType !== "1"
+// })
+// }
+// const tableList = computed(() => {
+// const list = state.dataList
+// // if (Array.isArray(list)) {
+// // setHasChildren(list)
+// // }
+// return list
+// })
+
// 打开新增菜单弹窗
const onOpenAddMenu = (type?: string, row?: any) => {
menuDialogRef.value.openDialog(type, row)
@@ -197,20 +173,20 @@ const resetQuery = () => {
getDataList()
}
-const load = (row: any, treeNode: unknown, resolve: (date: any[]) => void) => {
- const param = {
- parentId: row.id,
- }
- pageList(param).then((res) => {
- const childrenList = res.data
- if (Array.isArray(childrenList)) {
- setHasChildren(childrenList)
- }
- if (childrenList && childrenList.length) {
- resolve(childrenList)
- }
- })
-}
+// const load = (row: any, treeNode: unknown, resolve: (date: any[]) => void) => {
+// const param = {
+// parentId: row.id,
+// }
+// pageList(param).then((res) => {
+// const childrenList = res.data
+// if (Array.isArray(childrenList)) {
+// setHasChildren(childrenList)
+// }
+// if (childrenList && childrenList.length) {
+// resolve(childrenList)
+// }
+// })
+// }
// 删除操作
const handleDelete = async (row: any) => {
@@ -229,11 +205,3 @@ const handleDelete = async (row: any) => {
}
}
-
-