|
|
@ -300,7 +300,6 @@ export default { |
|
|
|
handleSelSmartType (ruleIndex, item) { |
|
|
|
let oneData = this.smartRuleList[ruleIndex] |
|
|
|
|
|
|
|
// if (item.value === 'house') { |
|
|
|
oneData.houseRule = { |
|
|
|
ruleDesc: '', |
|
|
|
queryType: '', |
|
|
@ -336,65 +335,61 @@ export default { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// } else { |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
this.$set(this.smartRuleList, ruleIndex, oneData) |
|
|
|
console.log(this.smartRuleList) |
|
|
|
}, |
|
|
|
// async setRule (smartRuleList, smartRuleList) { |
|
|
|
// // this.startLoading() |
|
|
|
// if (this.groupList.length == 0 || this.houseItemList.length === 0) { |
|
|
|
// setTimeout(() => { |
|
|
|
// this.setRule(smartRuleList, smartRuleList); |
|
|
|
// }, 500); |
|
|
|
// return false |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
// this.smartRuleList = smartRuleList |
|
|
|
// if (this.smartRuleList && this.smartRuleList.length > 0) { |
|
|
|
// this.personChecked = true |
|
|
|
// for (let i = 0; i < this.smartRuleList.length; i++) { |
|
|
|
// let element = this.smartRuleList[i] |
|
|
|
|
|
|
|
// let selGroup = this.groupList.filter((item) => |
|
|
|
// element.itemGroupId === item.id |
|
|
|
// ); |
|
|
|
// console.log(selGroup) |
|
|
|
|
|
|
|
// if (selGroup.length > 0) { |
|
|
|
// await this.handleSelGroup(i, selGroup[0], true) |
|
|
|
|
|
|
|
|
|
|
|
// let selItem = element.itemList.filter((item) => |
|
|
|
// element.itemId === item.itemId); |
|
|
|
// if (selItem.length > 0) { |
|
|
|
// await this.handleSelGroupItem(i, selItem[0], true) |
|
|
|
// } |
|
|
|
|
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
|
|
|
|
// this.smartRuleList = smartRuleList |
|
|
|
// if (this.smartRuleList && this.smartRuleList.length > 0) { |
|
|
|
// this.houseChecked = true |
|
|
|
// this.smartRuleList.forEach((element, index) => { |
|
|
|
|
|
|
|
// let selHouseItem = this.houseItemList.filter((item) => |
|
|
|
// element.colKey === item.colKey |
|
|
|
// ); |
|
|
|
|
|
|
|
// if (selHouseItem.length > 0) { |
|
|
|
// this.handleSelHouseItem(index, selHouseItem[0], true) |
|
|
|
// } |
|
|
|
|
|
|
|
// }); |
|
|
|
// } |
|
|
|
|
|
|
|
// }, |
|
|
|
async setRule (ruleList) { |
|
|
|
// this.startLoading() |
|
|
|
if (this.groupList.length == 0 || this.houseItemList.length === 0) { |
|
|
|
setTimeout(() => { |
|
|
|
this.setRule(ruleList); |
|
|
|
}, 500); |
|
|
|
return false |
|
|
|
} |
|
|
|
|
|
|
|
this.smartRuleList = ruleList |
|
|
|
if (this.smartRuleList && this.smartRuleList.length > 0) { |
|
|
|
|
|
|
|
for (let i = 0; i < this.smartRuleList.length; i++) { |
|
|
|
|
|
|
|
let element = this.smartRuleList[i] |
|
|
|
if (element.selSmartType === 'house') { |
|
|
|
|
|
|
|
let selHouseItem = this.houseItemList.filter((item) => |
|
|
|
element.houseRule.colKey === item.colKey |
|
|
|
); |
|
|
|
|
|
|
|
if (selHouseItem.length > 0) { |
|
|
|
await this.handleSelHouseItem(i, selHouseItem[0], true) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (element.selSmartType === 'person') { |
|
|
|
|
|
|
|
let selGroup = this.groupList.filter((item) => |
|
|
|
element.personRule.itemGroupId === item.id |
|
|
|
); |
|
|
|
console.log(selGroup) |
|
|
|
|
|
|
|
if (selGroup.length > 0) { |
|
|
|
await this.handleSelGroup(i, selGroup[0], true) |
|
|
|
|
|
|
|
|
|
|
|
let selItem = element.personRule.itemList.filter((item) => |
|
|
|
element.personRule.itemId === item.itemId); |
|
|
|
if (selItem.length > 0) { |
|
|
|
await this.handleSelGroupItem(i, selItem[0], true) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getRule () { |
|
|
|
this.okflag = false |
|
|
|