|
|
@ -168,6 +168,49 @@ export default { |
|
|
|
} |
|
|
|
this.tableData = _.cloneDeep(this.tableData) |
|
|
|
}, |
|
|
|
|
|
|
|
formatData(it, value = 1) { |
|
|
|
let data = { ...it, actionType: value, emergencyPlansId: id }; |
|
|
|
if ( |
|
|
|
it.deviceList && |
|
|
|
typeof it.deviceList !== "string" && |
|
|
|
it.deviceList.length > 0 |
|
|
|
) { |
|
|
|
data.deviceList = it.deviceList.join(","); |
|
|
|
} else { |
|
|
|
data.deviceList = ""; |
|
|
|
} |
|
|
|
if (it.content) { |
|
|
|
data.otherConfig = JSON.stringify({ content: it.content }); |
|
|
|
} |
|
|
|
if (it.controlModel) { |
|
|
|
let other = { |
|
|
|
controlModel: it.controlModel, |
|
|
|
controlModelName: inducerModeDic[it.controlModel], |
|
|
|
state: it.state, |
|
|
|
name: inducerWorkTypeDic[it.state], |
|
|
|
}; |
|
|
|
if (it.time && it?.time[0]) { |
|
|
|
other = { |
|
|
|
controlModel: it.controlModel, |
|
|
|
controlModelName: inducerModeDic[it.controlModel], |
|
|
|
state: it.state, |
|
|
|
name: inducerWorkTypeDic[it.state], |
|
|
|
startTime: it.time[0], |
|
|
|
endTime: it.time[1], |
|
|
|
}; |
|
|
|
} |
|
|
|
data.otherConfig = JSON.stringify(other); |
|
|
|
} |
|
|
|
if (it.gzms) { |
|
|
|
data.otherConfig = JSON.stringify({ |
|
|
|
state: it.gzms, |
|
|
|
name: gzmsMap[it.gzms], |
|
|
|
operationDuration: it.operationDuration, |
|
|
|
}); |
|
|
|
} |
|
|
|
return data; |
|
|
|
}, |
|
|
|
handleSubmit(value = 1) { |
|
|
|
let dcArr = []; |
|
|
|
this.tableData.forEach((item) => { |
|
|
@ -179,30 +222,9 @@ export default { |
|
|
|
if (item.devList && item.devList.length > 0) { |
|
|
|
dcData.deviceList = item.devList.join(","); |
|
|
|
} |
|
|
|
let zxData = {}, |
|
|
|
hfData = {}; |
|
|
|
if(item.executeConfig){ |
|
|
|
zxData['executeConfig'] = item.executeConfig |
|
|
|
} |
|
|
|
if(item.recoverConfig){ |
|
|
|
zxData['recoverConfig'] = item.recoverConfig |
|
|
|
} |
|
|
|
Object.keys(item).forEach((key) => { |
|
|
|
if (/^zx_/.test(key)) { |
|
|
|
let keyName = key.substring(3); |
|
|
|
zxData[keyName] = item[key]; |
|
|
|
} |
|
|
|
if (/^hf_/.test(key)) { |
|
|
|
let keyName = key.substring(3); |
|
|
|
hfData[keyName] = item[key]; |
|
|
|
} |
|
|
|
}); |
|
|
|
if (item.deviceType == 12) { |
|
|
|
zxData = this.formatData(zxData); |
|
|
|
hfData = this.formatData(hfData); |
|
|
|
} |
|
|
|
dcData.executeConfig = JSON.stringify(zxData); |
|
|
|
dcData.recoverConfig = JSON.stringify(hfData); |
|
|
|
|
|
|
|
dcData.executeConfig = JSON.stringify(item.executeConfig); |
|
|
|
dcData.recoverConfig = JSON.stringify(item.recoverConfig); |
|
|
|
|
|
|
|
dcArr.push(dcData); |
|
|
|
}); |
|
|
|