From 3233d9c3dc44029964808a8cc27f6dde92d58b35 Mon Sep 17 00:00:00 2001 From: chenxt <10125295+chen-xintao97@user.noreply.gitee.com> Date: Thu, 23 Jul 2026 13:12:52 +0800 Subject: [PATCH] 角标数字根据id来 --- src/components/Common/CommonHooks/useCommonBase.js | 2 +- src/mes/common/buttonComponent/index.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/Common/CommonHooks/useCommonBase.js b/src/components/Common/CommonHooks/useCommonBase.js index 0d72e5f..8035570 100644 --- a/src/components/Common/CommonHooks/useCommonBase.js +++ b/src/components/Common/CommonHooks/useCommonBase.js @@ -4096,7 +4096,7 @@ const useLoadSubscriptNum = props => { const { table0 = 0, table1 = 0, table2 = 0, table3 = 0 } = counterRow; props.dispatch({ type: "app/setCounter", - payload: { table0, table1, table2, table3 } + payload: { table0, table1, table2, table3 , counterRow} }); } }); diff --git a/src/mes/common/buttonComponent/index.js b/src/mes/common/buttonComponent/index.js index ccdc54b..b2b3dba 100644 --- a/src/mes/common/buttonComponent/index.js +++ b/src/mes/common/buttonComponent/index.js @@ -15,7 +15,7 @@ const getNavIcon = (bActive, iconName = 2) => { const ButtonComponent = props => { const { app, sModelsId, currentContent, menuMap } = props; const { managementData, userinfo = {} } = app; - const { iTeamType, bManual = false } = userinfo; + const { iTeamType, bManual = false } = userinfo; const [expand, setExpand] = useState(true); const [dataList, setDataList] = useState([]); @@ -114,7 +114,7 @@ const ButtonComponent = props => { }; const counterInfo = props.app.counterInfo || {}; - const { table0 = 0, table1 = 0, table2 = 0, table3 = 0 } = counterInfo; + const { table0 = 0, table1 = 0, table2 = 0, table3 = 0, counterRow = {} } = counterInfo; // 每个item const renderItem = (e, index) => { // (取消)延迟加班按钮 @@ -158,7 +158,10 @@ const ButtonComponent = props => { count = table2; } else if (e.name === "其它机台日报") { count = table3; + } else { + count = counterRow[e.id] ? Number(counterRow[e.id]): 0 } + const workFirst = commonFunc.showLocalMessage(props, 'workFirst!', '请先上班后再操作'); return ( -- libgit2 0.22.2