Commit 4c53a538 authored by zhangwenshuai's avatar zhangwenshuai

修改日期format判空

parent f607fbf8
......@@ -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('-'),
},
];
},
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment