From 7023df5958d7da25e2e9dd812be65bf03e8612e2 Mon Sep 17 00:00:00 2001 From: 陈鑫涛 <10125295+chen-xintao97@user.noreply.gitee.com> Date: Mon, 29 Dec 2025 22:19:32 +0800 Subject: [PATCH] 左侧导航栏权限 --- src/mes/common/commonOperationBarComponent/index.js | 6 +++++- src/mes/indexMes/index.js | 14 ++++++++++---- src/utils/config.js | 2 +- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/mes/common/commonOperationBarComponent/index.js b/src/mes/common/commonOperationBarComponent/index.js index 79b1c38..d5a3c44 100644 --- a/src/mes/common/commonOperationBarComponent/index.js +++ b/src/mes/common/commonOperationBarComponent/index.js @@ -739,7 +739,11 @@ const useCommonOperationBarComponentEvent = props => { } else if (props.bMesBill) { const btnName = sControlName.replace('BtnLeft.', '').replace('BtnRight.', '').toLowerCase(); - if (props.enabled) { + let enabled = props.enabled + if (props.enabled === undefined) { + enabled = true + } + if (enabled) { if (["btnupd", 'btnevent', 'btnsubmit', 'btnsubmitcancel', 'btnexamine', 'btncancelexamine'].includes(btnName)) { defaultProps.disabled = true; } diff --git a/src/mes/indexMes/index.js b/src/mes/indexMes/index.js index 77ce358..ca90ebc 100644 --- a/src/mes/indexMes/index.js +++ b/src/mes/indexMes/index.js @@ -626,7 +626,7 @@ const HeaderConponent = () => { const SiderComponent = () => { const { dispatch, hooksProps, props, ...rest } = useContext(myContext); const { currentContent, menuMap, menuMapOpposite } = hooksProps; - + const {managementData = []} = props?.app || {} const teamInformation = commonFunc.showLocalMessage(props, 'teamInformation', '班组信息'); const scheduledTask = commonFunc.showLocalMessage(props, 'scheduledTask', '计划任务'); @@ -637,7 +637,7 @@ const SiderComponent = () => { const queryTracing = commonFunc.showLocalMessage(props, 'queryTracing', '查询追踪'); - const operationGuide = commonFunc.showLocalMessage(props, 'teamInformation', '操作指南'); + const operationGuide = commonFunc.showLocalMessage(props, 'operationGuide', '操作指南'); const menuList = [ { @@ -683,9 +683,15 @@ const SiderComponent = () => { c_icon: c_guideIcon } ]; - const allowedIds = new Set(Object.values(menuMapOpposite)); + let menuLists = [] + managementData.forEach(item=>{ + const i = menuList.findIndex(x=>x.title === item.sMenuName) + if (i !== -1){ + menuLists.push(menuList[i]) + } + }) const filteredMenuList = [ - ...menuList.filter(item => allowedIds.has(item.id)), + ...menuLists, { id: "operationGuide", title: operationGuide, diff --git a/src/utils/config.js b/src/utils/config.js index 72efcee..d0dfeb8 100644 --- a/src/utils/config.js +++ b/src/utils/config.js @@ -6,7 +6,7 @@ export const webSite = { // faceAddress: isDev ? '//192.168.11.22:8080/xlyFace' : '//' + location.host + '/xlyFace', fileAddress: isDev ? '//km5cjx.gnway.cc:43920/xlyReport/' : '//' + location.host + '/xlyReport/', // 接口地址 faceAddress: isDev ? '//km5cjx.gnway.cc:43920/xlyFace' : '//' + location.host + '/xlyFace', - ipAddress: localStorage.ipAddress ? localStorage.ipAddress : isDev ? '//km5cjx.gnway.cc:47400/xlyEntry/' : '//' + location.host + '/xlyEntry/', + ipAddress: localStorage.ipAddress ? localStorage.ipAddress : isDev ? '//km5cjx.gnway.cc:43920/xlyEntry/' : '//' + location.host + '/xlyEntry/', interfaceAddress: isDev ? '//km5cjx.gnway.cc:43920/xlyApi/' : '//' + location.host + '/xlyApi/', // 接口地址 // ipAddress: isDev ? '//ebc.jinjia.com:8091/xlyEntry/' : '//' + location.host + '/xlyEntry/', // interfaceAddress: isDev ? '//ebc.jinjia.com:8091/xlyApi/' : '//' + location.host + '/xlyApi/', // 接口地址 -- libgit2 0.22.2