feat(menu): 添加菜单缓存刷新功能和拖拽排序支持
- 在SysMenuController中添加refreshCache和refreshCurrentUserMenuCache接口 - 实现菜单缓存的按需刷新和用户级别缓存清理功能 - 优化菜单列表查询的缓存key策略,支持更精确的缓存命中 - 为菜单树查询添加缓存注解提升性能 - 在菜单增删改操作中完善缓存清理逻辑 - 添加allocateMenuToRole方法实现菜单角色分配功能 - 在前端DictTag组件中修复标签类型验证逻辑 - 为首页配置页面添加拖拽排序功能,支持快捷功能重新排列 - 集成Sortable.js实现拖拽交互和排序保存 - 优化菜单管理页面的缓存刷新机制和数据展示 - 完善配置更新事件处理,支持实时配置同步
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user