diff --git a/components/apolloTable/component/base/_utils/setFormatter.tsx b/components/apolloTable/component/base/_utils/setFormatter.tsx index 21406a7722d4bbc8530fef1359e4029b8eac1efe..e079244e43d99d0bee2b483c861bef6f518c6535 100644 --- a/components/apolloTable/component/base/_utils/setFormatter.tsx +++ b/components/apolloTable/component/base/_utils/setFormatter.tsx @@ -84,10 +84,10 @@ export const SetFormatter = { }, NUMBER: (val, config) => { if (!isNumber(val)) return emptyModel; - const { unit = {} } = config || {}; // 设置单位 + const { unit = {} } = config || {}; // 设置单位 if (unit && unit.code === 'wan') { const newVal = val ? val * 10000 : val; - return [{ value: newVal, text: newVal }] + return [{ value: newVal, text: newVal }]; } return [{ value: val, text: val }]; }, @@ -148,7 +148,7 @@ export const SetFormatter = { } const formateArr = arr .map((ls, index) => { - return ls.format ? ls.format(index === 0 ? setStartFormat : setEndFormat) : ls; + return ls && ls.format ? ls.format(index === 0 ? setStartFormat : setEndFormat) : ls; }) .join('~'); return [ @@ -198,6 +198,19 @@ export const SetFormatter = { textArr.push(ls.label); valueArr.push(ls.value); }); - return [{ text: textArr.filter((ls) => { return ls; }).join('-'), value: valueArr.filter((ls) => { return ls; }).join('-') }]; + return [ + { + text: textArr + .filter((ls) => { + return ls; + }) + .join('-'), + value: valueArr + .filter((ls) => { + return ls; + }) + .join('-'), + }, + ]; }, };