|
|
@ -409,14 +409,16 @@ export default { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
handleCheckAllChange(val) { |
|
|
|
this.checkedDeviceIds = val ? this.getAllDeviceIds() : []; |
|
|
|
|
|
|
|
this.checkedDeviceIds = this.boardSizeDic[this.selectedSize].list.filter(itm => itm.iotDeviceId && !itm.iotDeviceId.includes('null') && !(itm.deviceState === "0" || itm.deviceState === null)).map(itm => itm.iotDeviceId); |
|
|
|
console.log(this.checkedDeviceIds) |
|
|
|
console.log(this.checkedDeviceIds.length) |
|
|
|
this.isIndeterminate = false; |
|
|
|
}, |
|
|
|
getAllDeviceIds() { |
|
|
|
// 使用 Object.values 遍历对象 |
|
|
|
return Object.values(this.boardSizeDic).reduce((acc, item) => { |
|
|
|
acc.push(...item.list.filter(itm => itm.iotDeviceId && !itm.iotDeviceId.includes('null') && !(itm.deviceState === 0 || itm.deviceState === null)).map(itm => itm.iotDeviceId)); |
|
|
|
acc.push(...item.list.filter(itm => itm.iotDeviceId && !itm.iotDeviceId.includes('null') && !(itm.deviceState === "0" || itm.deviceState === null)).map(itm => itm.iotDeviceId)); |
|
|
|
return acc; |
|
|
|
}, []); |
|
|
|
}, |
|
|
|