From d9cd5ff067ba980c47f4f04d36a378d2b76465fe Mon Sep 17 00:00:00 2001 From: chenxt <10125295+chen-xintao97@user.noreply.gitee.com> Date: Thu, 29 Jan 2026 13:55:28 +0800 Subject: [PATCH] 简化代码 --- src/mes/common/siderInfoComponent/index.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/mes/common/siderInfoComponent/index.js b/src/mes/common/siderInfoComponent/index.js index d2ef03b..b02e225 100644 --- a/src/mes/common/siderInfoComponent/index.js +++ b/src/mes/common/siderInfoComponent/index.js @@ -635,10 +635,13 @@ const DeviceTargetInfoComponent = () => { const equipmentTargetInformation = commonFunc.showLocalMessage(props, 'equipmentTargetInformation', '设备及目标信息'); const { workOrderInfoData = [] } = props; const sColumnConfig = JSON.parse(workOrderInfoData[0]?.sColumnConfig || '[]'); - const [first] = sColumnConfig - const otherList = sColumnConfig.slice(1).filter(item => item.bVisible === 1); - const sNamesInArr2 = new Set(otherList.map(item => item.sName)); // 或 item.sname - const result = showConfig.filter(item => sNamesInArr2.has(item.sName)); // 或 item.sname + const visibleFieldNames = new Set( + sColumnConfig + .slice(1) + .filter(col => col?.bVisible === 1) + .map(col => col.sName) + ); + const result = showConfig.filter(field => visibleFieldNames.has(field.sName)); // 筛选数据 return (
-- libgit2 0.22.2