|
|
@ -10,12 +10,11 @@ |
|
|
import _ from 'lodash'; |
|
|
import _ from 'lodash'; |
|
|
import { defineStore } from 'pinia'; |
|
|
import { defineStore } from 'pinia'; |
|
|
import localKey from '/@/constants/local-storage-key-const'; |
|
|
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 { MENU_TYPE_ENUM } from '/@/constants/system/menu-const'; |
|
|
import { messageApi } from '/@/api/support/message-api.js'; |
|
|
import { messageApi } from '/@/api/support/message-api.js'; |
|
|
import { smartSentry } from '/@/lib/smart-sentry.js'; |
|
|
import { smartSentry } from '/@/lib/smart-sentry.js'; |
|
|
import { localRead, localSave, localRemove } from '/@/utils/local-util'; |
|
|
import { localRead, localSave, localRemove } from '/@/utils/local-util'; |
|
|
import { useDictStore } from '/@/store/modules/system/dict'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export const useUserStore = defineStore({ |
|
|
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'))) { |
|
|
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 = []; |
|
|
const children = []; |
|
|
statesDict.forEach((item, index) => { |
|
|
STATIC_WORKFLOW_STATE.forEach((item, index) => { |
|
|
children.push({ |
|
|
children.push({ |
|
|
menuId: menuNode.menuId * 100 + (index + 1), // 生成全局唯一数字 ID
|
|
|
menuId: menuNode.menuId * 100 + (index + 1), // 生成全局唯一数字 ID
|
|
|
parentId: menuNode.menuId, |
|
|
parentId: menuNode.menuId, |
|
|
|