mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2026-01-15 02:57:09 +08:00
feat(system): 添加字典和菜单缓存清除功能
- 在字典管理页面添加清除缓存按钮,用于清除单个字典的缓存 - 在菜单管理页面添加清除缓存按钮,用于清除全部菜单缓存 - 新增清除字典缓存和菜单缓存的 API 接口 - 优化字典树组件,增加选中字典的信息传递
This commit is contained in:
@@ -30,14 +30,20 @@
|
||||
<template #icon><icon-plus /></template>
|
||||
<template #default>新增</template>
|
||||
</a-button>
|
||||
<a-tooltip content="展开/折叠">
|
||||
<a-button @click="onExpanded">
|
||||
<template #icon>
|
||||
<icon-list v-if="!isExpanded" />
|
||||
<icon-mind-mapping v-else />
|
||||
</template>
|
||||
</a-button>
|
||||
</a-tooltip>
|
||||
<a-button v-permission="['system:menu:clearCache']" type="outline" status="warning" @click="onClearCache">
|
||||
<template #icon><icon-delete /></template>
|
||||
<template #default>清除缓存</template>
|
||||
</a-button>
|
||||
<a-button @click="onExpanded">
|
||||
<template #icon>
|
||||
<icon-list v-if="isExpanded" />
|
||||
<icon-mind-mapping v-else />
|
||||
</template>
|
||||
<template #default>
|
||||
<span v-if="!isExpanded">展开</span>
|
||||
<span v-else>折叠</span>
|
||||
</template>
|
||||
</a-button>
|
||||
</template>
|
||||
<template #title="{ record }">
|
||||
<GiSvgIcon :name="record.icon" :size="15" />
|
||||
@@ -84,8 +90,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Message, Modal } from '@arco-design/web-vue'
|
||||
import MenuAddModal from './MenuAddModal.vue'
|
||||
import { type MenuQuery, type MenuResp, deleteMenu, listMenu } from '@/apis/system/menu'
|
||||
import { type MenuQuery, type MenuResp, clearMenuCache, deleteMenu, listMenu } from '@/apis/system/menu'
|
||||
import type { TableInstanceColumns } from '@/components/GiTable/type'
|
||||
import type GiTable from '@/components/GiTable/index.vue'
|
||||
import { useTable } from '@/hooks'
|
||||
@@ -171,6 +178,20 @@ const onDelete = (record: MenuResp) => {
|
||||
})
|
||||
}
|
||||
|
||||
// 清除缓存
|
||||
const onClearCache = () => {
|
||||
Modal.warning({
|
||||
title: '提示',
|
||||
content: `是否确定清除全部菜单缓存?`,
|
||||
hideCancel: false,
|
||||
maskClosable: false,
|
||||
onOk: async () => {
|
||||
await clearMenuCache()
|
||||
Message.success('清除成功')
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
const isExpanded = ref(false)
|
||||
const tableRef = ref<InstanceType<typeof GiTable>>()
|
||||
// 展开/折叠
|
||||
|
||||
Reference in New Issue
Block a user