Browse Source

菜单修改

main
wang 1 month ago
parent
commit
0224ce703e
  1. 13
      smart-flow-web/src/constants/system/home-const.js
  2. 8
      smart-flow-web/src/layout/components/side-menu/recursion-menu.vue
  3. 8
      smart-flow-web/src/layout/components/top-side-menu/recursion-menu.vue
  4. 13
      smart-flow-web/src/store/modules/system/user.js

13
smart-flow-web/src/constants/system/home-const.js

@ -13,3 +13,16 @@ export const HOME_PAGE_NAME = 'SurveyDashboard';
//首页页面路径
export const HOME_PAGE_PATH = '/jwpy/home/dashboard';
// 警务评议与问题处置折叠三级子菜单的静态工作流状态
export const STATIC_WORKFLOW_STATE = [
{ dataValue: 'all', dataLabel: '全部工单' },
{ dataValue: 'to_handle', dataLabel: '待办工单' },
{ dataValue: 'transferred', dataLabel: '已流转工单' },
{ dataValue: 'about_to_expire', dataLabel: '即将超期工单' },
{ dataValue: 'expired', dataLabel: '已超期工单' },
{ dataValue: 'completed', dataLabel: '已办结工单' },
{ dataValue: 'invalid', dataLabel: '已作废工单' }
];

8
smart-flow-web/src/layout/components/side-menu/recursion-menu.vue

@ -34,7 +34,7 @@
import { router } from '/@/router/index';
import { useAppConfigStore } from '/@/store/modules/system/app-config';
import { useUserStore } from '/@/store/modules/system/user';
import { useDictStore } from '/@/store/modules/system/dict';
import { STATIC_WORKFLOW_STATE } from '/@/constants/system/home-const';
const theme = computed(() => useAppConfigStore().$state.sideMenuTheme);
const flatPattern = computed(() => useAppConfigStore().$state.flatPattern);
@ -70,12 +70,10 @@
function updateOpenKeysAndSelectKeys() {
let currentMenuId = _.toNumber(currentRoute.name);
//
//
const tabType = currentRoute.params.tabType;
if (tabType) {
const dictStore = useDictStore();
const statesDict = dictStore.getDictData('WORKFLOW_STATE') || [];
const matchIndex = statesDict.findIndex(item => item.dataValue === tabType);
const matchIndex = STATIC_WORKFLOW_STATE.findIndex(item => item.dataValue === tabType);
if (matchIndex !== -1) {
currentMenuId = currentMenuId * 100 + (matchIndex + 1);
}

8
smart-flow-web/src/layout/components/top-side-menu/recursion-menu.vue

@ -30,7 +30,7 @@
import { router } from '/@/router/index';
import { useAppConfigStore } from '/@/store/modules/system/app-config';
import { useUserStore } from '/@/store/modules/system/user';
import { useDictStore } from '/@/store/modules/system/dict';
import { STATIC_WORKFLOW_STATE } from '/@/constants/system/home-const';
const theme = computed(() => useAppConfigStore().$state.sideMenuTheme);
const flatPattern = computed(() => useAppConfigStore().$state.flatPattern);
@ -64,12 +64,10 @@
function updateOpenKeysAndSelectKeys() {
let currentMenuId = _.toNumber(currentRoute.name);
//
//
const tabType = currentRoute.params.tabType;
if (tabType) {
const dictStore = useDictStore();
const statesDict = dictStore.getDictData('WORKFLOW_STATE') || [];
const matchIndex = statesDict.findIndex(item => item.dataValue === tabType);
const matchIndex = STATIC_WORKFLOW_STATE.findIndex(item => item.dataValue === tabType);
if (matchIndex !== -1) {
currentMenuId = currentMenuId * 100 + (matchIndex + 1);
}

13
smart-flow-web/src/store/modules/system/user.js

@ -10,12 +10,11 @@
import _ from 'lodash';
import { defineStore } from 'pinia';
import localKey from '/@/constants/local-storage-key-const';
import { HOME_PAGE_NAME } from '/@/constants/system/home-const';
import { HOME_PAGE_NAME, STATIC_WORKFLOW_STATE } from '/@/constants/system/home-const';
import { MENU_TYPE_ENUM } from '/@/constants/system/menu-const';
import { messageApi } from '/@/api/support/message-api.js';
import { smartSentry } from '/@/lib/smart-sentry.js';
import { localRead, localSave, localRemove } from '/@/utils/local-util';
import { useDictStore } from '/@/store/modules/system/dict';
export const useUserStore = defineStore({
@ -376,16 +375,8 @@ function injectWorkflowSubMenus(menuNode) {
// 检测组件路径是否为警务评议与问题处置的通用工单列表
if (menuNode.component && (menuNode.component.includes('jwpy/flow/index') || menuNode.component.includes('jwpy/jwpy/flow/index') || menuNode.component.includes('/flow/index'))) {
const dictStore = useDictStore();
// 从数据字典加载流转状态项列表,实现真正的动态插拔
const statesDict = dictStore.getDictData('WORKFLOW_STATE') || [];
if (statesDict.length === 0) {
// 增加防空防丢保护:如果数据字典暂未就绪,直接返回以避免清空或覆盖原菜单项
return;
}
const children = [];
statesDict.forEach((item, index) => {
STATIC_WORKFLOW_STATE.forEach((item, index) => {
children.push({
menuId: menuNode.menuId * 100 + (index + 1), // 生成全局唯一数字 ID
parentId: menuNode.menuId,

Loading…
Cancel
Save