diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue
index a15cdc4..1e831e3 100644
--- a/src/views/system/dict/index.vue
+++ b/src/views/system/dict/index.vue
@@ -24,11 +24,11 @@
-
+
新增
-
+
清除缓存
@@ -46,9 +46,9 @@
- 修改
+ 修改
+
+
+
+
重置
@@ -110,11 +114,15 @@ const {
} = useTable(() => listMenu(queryForm), { immediate: true })
// 过滤树
-const searchData = (title: string) => {
+const searchData = (title: string, path: string, permission: string) => {
const loop = (data: MenuResp[]) => {
const result = [] as MenuResp[]
data.forEach((item: MenuResp) => {
- if (item.title?.toLowerCase().includes(title.toLowerCase())) {
+ if (
+ (!title || item.title?.toLowerCase().includes(title.toLowerCase()))
+ && (!path || item.path?.toLowerCase().includes(path.toLowerCase()))
+ && (!permission || item.permission?.toLowerCase().includes(permission.toLowerCase()))
+ ) {
result.push({ ...item })
} else if (item.children) {
const filterData = loop(item.children)
@@ -132,9 +140,11 @@ const searchData = (title: string) => {
}
const title = ref('')
+const path = ref('')
+const permission = ref('')
const dataList = computed(() => {
- if (!title.value) return tableData.value
- return searchData(title.value)
+ if (!title.value && !path.value && !permission.value) return tableData.value
+ return searchData(title.value, path.value, permission.value)
})
const columns: TableInstance['columns'] = [