From 83b51a5a0774ea8ecb9a06304af3b956a21307c8 Mon Sep 17 00:00:00 2001 From: pjb <123456> Date: 星期六, 08 三月 2025 09:06:55 +0800 Subject: [PATCH] CUT库条码T开头,截取后10位 --- zy-asrs-flow/src/utils/common-util.js | 46 +++++++++++++++++++++++----------------------- 1 files changed, 23 insertions(+), 23 deletions(-) diff --git a/zy-asrs-flow/src/utils/common-util.js b/zy-asrs-flow/src/utils/common-util.js index b8939ba..c15c0cc 100644 --- a/zy-asrs-flow/src/utils/common-util.js +++ b/zy-asrs-flow/src/utils/common-util.js @@ -1,24 +1,24 @@ -export const generateColumnsState = (cols) => cols.reduce((acc, { dataIndex, show = true }) => ({ ...acc, [dataIndex]: { show: show } }), {}); - - -export const repairBug = (tabKey, key, val) => { - const stateStr = localStorage.getItem(tabKey); - if (stateStr) { - const state = JSON.parse(stateStr); - const oldVal = state[key]?.show; - let hasVal = false; - if (oldVal === true) { - hasVal = true; - } - if (oldVal === false) { - hasVal = true; - } - if (hasVal) { - return oldVal; - } else { - return val; - } - } else { - return val; - } +export const generateColumnsState = (cols) => cols.reduce((acc, { dataIndex, show = true }) => ({ ...acc, [dataIndex]: { show: show } }), {}); + + +export const repairBug = (tabKey, key, val) => { + const stateStr = localStorage.getItem(tabKey); + if (stateStr) { + const state = JSON.parse(stateStr); + const oldVal = state[key]?.show; + let hasVal = false; + if (oldVal === true) { + hasVal = true; + } + if (oldVal === false) { + hasVal = true; + } + if (hasVal) { + return oldVal; + } else { + return val; + } + } else { + return val; + } } \ No newline at end of file -- Gitblit v1.9.1