菜单管理

This commit is contained in:
仲么了
2024-01-05 16:28:23 +08:00
parent d7a63dcf97
commit 1d4bc5d442
3 changed files with 81 additions and 35 deletions

View File

@@ -17,6 +17,7 @@ import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import popupForm from './popupForm.vue'
import { useNavTabs } from '@/stores/navTabs'
import { delMenu } from '@/api/systerm'
defineOptions({
name: 'auth/menu'
@@ -63,11 +64,27 @@ const tableStore = new TableStore({
confirmButtonType: 'danger',
title: '确定删除该菜单吗?'
},
click: row => {}
click: row => {
delMenu(row.id).then(() => {
tableStore.index()
})
}
}
]
}
]
],
loadCallback:()=>{
// 过滤数组中type等于1的数据children下钻
const filterData = (arr:any[])=>{
return arr.filter((item:any)=>{
if (item.children.length) {
item.children = filterData(item.children)
}
return item.type != 1
})
}
tableStore.table.data = filterData(tableStore.table.data)
}
})
provide('tableStore', tableStore)