菜单管理:添加刷新菜单缓存按钮,提高易用性

This commit is contained in:
shizhong 2023-06-13 13:41:16 +08:00
parent ecb97e99d0
commit e3dce4ae2e

View File

@ -11,6 +11,7 @@
v-hasPermi="['system:menu:create']"
@click="handleCreate()"
/>
<XButton title="刷新菜单缓存" @click="refreshMenu" />
<XButton title="展开所有" @click="xGrid?.Ref.setAllTreeExpand(true)" />
<XButton title="关闭所有" @click="xGrid?.Ref.clearTreeExpand()" />
</template>
@ -348,4 +349,18 @@ const submitForm = async () => {
const isExternal = (path: string) => {
return /^(https?:|mailto:|tel:)/.test(path)
}
/** 刷新菜单缓存按钮操作 */
const refreshMenu = () => {
ElMessageBox.confirm('即将更新缓存刷新浏览器!', '刷新菜单缓存', {
confirmButtonText: t('common.ok'),
cancelButtonText: t('common.cancel'),
type: 'warning'
}).then(() => {
//
wsCache.delete(CACHE_KEY.ROLE_ROUTERS)
//
location.reload()
})
}
</script>