|
|
@ -245,15 +245,17 @@ export default { |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
async loadData() { |
|
|
|
if (this.deviceData.length <= 0) { |
|
|
|
let result = await request({ |
|
|
|
url: `business/device/query?deviceType=2`, |
|
|
|
method: "get", |
|
|
|
}) |
|
|
|
if (result.code != 200) return Message.error(result?.msg); |
|
|
|
async loadData(deviceType = 1) { |
|
|
|
this.deviceData = []; |
|
|
|
let result = await request({ |
|
|
|
url: `business/device/query?deviceType=${deviceType}`, |
|
|
|
method: "get", |
|
|
|
}) |
|
|
|
if (result.code != 200) return Message.error(result?.msg); |
|
|
|
if (deviceType == 1) { |
|
|
|
this.deviceData = result.data.filter(it => it.childType !== '1-1') |
|
|
|
} else { |
|
|
|
this.deviceData = result.data; |
|
|
|
// return result.data; |
|
|
|
} |
|
|
|
return this.deviceData; |
|
|
|
}, |
|
|
@ -312,32 +314,32 @@ export default { |
|
|
|
// this.submitting = false; |
|
|
|
let secondFormTable = this.$refs['secondFormTable'].tableData || []; |
|
|
|
let thirdFormTable = this.$refs['thirdFormTable'].tableData || []; |
|
|
|
let flg = false; |
|
|
|
for (let item of secondFormTable) { |
|
|
|
if (this.areAllValuesEmpty(item)) { flg = true; break }; |
|
|
|
} |
|
|
|
if (flg) return Message.warning('执行操作子项不能为空!'); |
|
|
|
for (let item of thirdFormTable) { |
|
|
|
if (this.areAllValuesEmpty(item)) { flg = true; break }; |
|
|
|
} |
|
|
|
if (flg) return Message.warning('恢复操作子项不能为空!'); |
|
|
|
console.log('12', secondFormTable); |
|
|
|
console.log('34', thirdFormTable); |
|
|
|
// let flg = false; |
|
|
|
// for (let item of secondFormTable) { |
|
|
|
// if (this.areAllValuesEmpty(item)) { flg = true; break }; |
|
|
|
// } |
|
|
|
// if (flg) return Message.warning('执行操作子项不能为空!'); |
|
|
|
// for (let item of thirdFormTable) { |
|
|
|
// if (this.areAllValuesEmpty(item)) { flg = true; break }; |
|
|
|
// } |
|
|
|
// if (flg) return Message.warning('恢复操作子项不能为空!'); |
|
|
|
// console.log('12', secondFormTable); |
|
|
|
// console.log('34', thirdFormTable); |
|
|
|
let dcArr = []; |
|
|
|
// let id = ''; |
|
|
|
// if (this.dialogType == 2) id = this.planId; |
|
|
|
// secondFormTable.forEach(it => { |
|
|
|
// dcArr.push(this.formatData(it, 1, id)); |
|
|
|
// }) |
|
|
|
// thirdFormTable.forEach(it => { |
|
|
|
// dcArr.push(this.formatData(it, 2, id)); |
|
|
|
// }) |
|
|
|
let id = ''; |
|
|
|
if (this.dialogType == 2) id = this.planId; |
|
|
|
secondFormTable.forEach(it => { |
|
|
|
dcArr.push(this.formatData(it, 1, id)); |
|
|
|
}) |
|
|
|
thirdFormTable.forEach(it => { |
|
|
|
dcArr.push(this.formatData(it, 2, id)); |
|
|
|
}) |
|
|
|
|
|
|
|
console.log({ |
|
|
|
...this.formData, |
|
|
|
dcExecuteAction: dcArr |
|
|
|
}) |
|
|
|
return; |
|
|
|
// return; |
|
|
|
if (this.dialogType == 1) {//新增 |
|
|
|
request({ |
|
|
|
url: `/business/plans`, |
|
|
@ -385,7 +387,7 @@ export default { |
|
|
|
|
|
|
|
}, |
|
|
|
areAllValuesEmpty(obj) { |
|
|
|
console.log('ass',obj) |
|
|
|
console.log('ass', obj) |
|
|
|
return Object.keys(obj).every(function (key) { |
|
|
|
const value = obj[key]; |
|
|
|
return ( |
|
|
@ -413,7 +415,7 @@ export default { |
|
|
|
|
|
|
|
.EventAddPlanDialog { |
|
|
|
gap: 9px; |
|
|
|
width: 1080px; |
|
|
|
width: 1280px; |
|
|
|
height: 310px; |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|