菜单管理
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user