feat(menu): 添加菜单缓存刷新功能和拖拽排序支持

- 在SysMenuController中添加refreshCache和refreshCurrentUserMenuCache接口
- 实现菜单缓存的按需刷新和用户级别缓存清理功能
- 优化菜单列表查询的缓存key策略,支持更精确的缓存命中
- 为菜单树查询添加缓存注解提升性能
- 在菜单增删改操作中完善缓存清理逻辑
- 添加allocateMenuToRole方法实现菜单角色分配功能
- 在前端DictTag组件中修复标签类型验证逻辑
- 为首页配置页面添加拖拽排序功能,支持快捷功能重新排列
- 集成Sortable.js实现拖拽交互和排序保存
- 优化菜单管理页面的缓存刷新机制和数据展示
- 完善配置更新事件处理,支持实时配置同步
This commit is contained in:
2026-02-05 23:07:31 +08:00
parent cd6c015d8f
commit f3d56bff45
8 changed files with 356 additions and 24 deletions

View File

@@ -13,7 +13,7 @@
:disable-transitions="true"
:key="item.value + ''"
:index="index"
:type="item.elTagType === 'primary' ? '' : item.elTagType"
:type="getValidTagType(item.elTagType)"
:class="item.elTagClass"
>{{ item.label + " " }}</el-tag>
</template>
@@ -67,6 +67,26 @@ const unmatch = computed(() => {
return unmatch // 返回标志的值
});
// 验证并返回有效的tag类型
function getValidTagType(tagType) {
// 定义有效的tag类型
const validTypes = ['', 'success', 'warning', 'danger', 'info', 'primary'];
// 如果tagType为null、undefined或不在有效类型中则返回默认值('')
if (tagType === null || tagType === undefined || !validTypes.includes(tagType)) {
// 如果是primary类型转换为空字符串默认样式
if (tagType === 'primary') {
return '';
}
// 其他无效类型统一返回空字符串(默认样式)
return '';
}
// 如果是primary类型也转换为空字符串默认样式
if (tagType === 'primary') {
return '';
}
return tagType;
}
function handleArray(array) {
if (array.length === 0) return "";
return array.reduce((pre, cur) => {