Commit 0ef2dfb6 authored by 陈龙's avatar 陈龙

fix: 兼容日期为null的情况

parent 2a45393f
...@@ -35,11 +35,12 @@ const ReportEditForm = ({ reportDetails, reportData, onCancel, reportName }) => ...@@ -35,11 +35,12 @@ const ReportEditForm = ({ reportDetails, reportData, onCancel, reportName }) =>
span: 16, span: 16,
}, },
}; };
// 数值类的后端会处理再返回,故无序处理精度问题
const handleDate = (reportDetails, data) => { const handleDate = (reportDetails, data) => {
let _data = { ...data }; let _data = { ...data };
reportDetails.forEach((item) => { reportDetails.forEach((item) => {
if (DATE_TYPE.includes(item.type)) { if (DATE_TYPE.includes(item.type)) {
_data[item.fieldAlias] = moment(data[item.fieldAlias]); _data[item.fieldAlias] = data[item.fieldAlias] ? moment(data[item.fieldAlias]) : moment();
} }
}); });
return _data; return _data;
......
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