|
@@ -156,6 +156,7 @@
|
|
|
<el-form-item label="执行设备:" :prop="'riskPlanHardwareList.'+index+'.hardwareType'" :rules="rules.hardwareType">
|
|
|
<el-select v-model="item.hardwareType" placeholder="选择执行设备" style="width:130px;" @change="(val)=>controlTypeList(val,index)">
|
|
|
<el-option
|
|
|
+ v-show="!optionItem.checkType"
|
|
|
v-for="optionItem in hardwareList"
|
|
|
:key="optionItem.hardwareTypeEnum.code"
|
|
|
:label="optionItem.hardwareTypeEnum.hardwareTypeName"
|
|
@@ -354,16 +355,29 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ //处理选中后的设备是否继续展示
|
|
|
+ actionFiltration(){
|
|
|
+ let self = this;
|
|
|
+ for(let o=0;o<self.hardwareList.length;o++){
|
|
|
+ let num =0;
|
|
|
+ for(let i=0;i<self.dialogForm.riskPlanHardwareList.length;i++){
|
|
|
+ if(self.dialogForm.riskPlanHardwareList[i].hardwareType == self.hardwareList[o].hardwareTypeEnum.code){
|
|
|
+ num++
|
|
|
+ }
|
|
|
+ }
|
|
|
+ self.hardwareList[o].checkType = num != 0;
|
|
|
+ }
|
|
|
+ },
|
|
|
//查询设备功能
|
|
|
controlTypeList(val,index) {
|
|
|
let self = this;
|
|
|
- // self.hardwareList.splice(index,1)
|
|
|
- for(let i=0;i<self.hardwareList.length;i++){
|
|
|
- if(self.hardwareList[i].hardwareTypeEnum.code == val){
|
|
|
- this.$set(self.dialogForm.riskPlanHardwareList[index],'hardwareList',self.hardwareList[i].functionStatusList);
|
|
|
- return
|
|
|
+ for(let i=0;i<self.hardwareList.length;i++){
|
|
|
+ if(self.hardwareList[i].hardwareTypeEnum.code == val){
|
|
|
+ this.$set(self.dialogForm.riskPlanHardwareList[index],'hardwareList',self.hardwareList[i].functionStatusList);
|
|
|
+ this.actionFiltration()
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
},
|
|
|
//查询传感器/设备下啦列表
|
|
|
getOptionData(){
|
|
@@ -431,6 +445,7 @@
|
|
|
overAct:null,
|
|
|
})
|
|
|
}
|
|
|
+ this.actionFiltration();
|
|
|
},
|
|
|
delMinData(type,index){
|
|
|
if(type == 1){
|
|
@@ -438,6 +453,7 @@
|
|
|
}else if (type == 2){
|
|
|
this.dialogForm.riskPlanHardwareList.splice(index,1);
|
|
|
}
|
|
|
+ this.actionFiltration();
|
|
|
},
|
|
|
//提交
|
|
|
submitForm(){
|
|
@@ -651,8 +667,8 @@
|
|
|
this.$set(this,'dialogTitle','新增预案规则');
|
|
|
this.$set(this,'dialogForm',{
|
|
|
riskPlanLevel:a==0?1:(b==0?2:(c==0?3:(d==0?4:''))),
|
|
|
- ifExit:null,
|
|
|
- alarmType:[],
|
|
|
+ ifExit:1,
|
|
|
+ alarmType:['1','2'],
|
|
|
riskAutoOff:'60',
|
|
|
riskPlanSensorList:[],
|
|
|
riskPlanHardwareList:[],
|