Commit 2b77c027 authored by 高建强's avatar 高建强

item:剔除电力设备编辑为null的属性

parent e3556ac9
......@@ -276,6 +276,14 @@ class Equipment extends Component {
dataValues.imageUrl3 && formData.append('img3', dataValues.imageUrl3[0]);
dataValues.imageUrl4 && formData.append('img4', dataValues.imageUrl4[0]);
if (dataValues) {
for (var key in dataValues) {
if (dataValues[key] == null || typeof(dataValues[key]) == "undefined") {
delete dataValues[key];
}
}
}
Object.keys(dataValues).map(item => {
if (item === 'chargeDeptId' && dataValues[item] === null) {
formData.append(item, -1);
......@@ -287,7 +295,6 @@ class Equipment extends Component {
formData.append(item, dataValues[item]);
}
});
fetch(updateEquipmentUrl, {
method: 'post',
headers: {
......
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