|
@@ -162,6 +162,7 @@
|
|
|
:label="optionItem.hardwareTypeEnum.hardwareTypeName"
|
|
|
:value="optionItem.hardwareTypeEnum.code">
|
|
|
</el-option>
|
|
|
+ <p v-show="hardwareShowType" style="text-align: center;color:#999;font-size:12px;line-height:30px;">暂无更多</p>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="执行办法:" :prop="'riskPlanHardwareList.'+index+'.operate'" :rules="rules.operate">
|
|
@@ -278,6 +279,7 @@
|
|
|
sensorListData:[],
|
|
|
//设备
|
|
|
hardwareList:[],
|
|
|
+ hardwareShowType:false,
|
|
|
//分类
|
|
|
typeList:[],
|
|
|
//分级
|
|
@@ -355,22 +357,52 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ //新增验证是否可继续添加执行设备
|
|
|
+ addFiltration(){
|
|
|
+ let self = this;
|
|
|
+ let num = 0;
|
|
|
+ for(let i=0;i<self.dialogForm.riskPlanHardwareList.length;i++){
|
|
|
+ if(self.dialogForm.riskPlanHardwareList[i].hardwareType){
|
|
|
+ num++
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(num<self.hardwareList.length){
|
|
|
+ return true
|
|
|
+ }else{
|
|
|
+ this.msgError('暂无更多的执行设备可选则')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ },
|
|
|
//处理选中后的设备是否继续展示
|
|
|
actionFiltration(){
|
|
|
let self = this;
|
|
|
+ let age = 0;
|
|
|
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++
|
|
|
+ age++
|
|
|
}
|
|
|
}
|
|
|
self.hardwareList[o].checkType = num != 0;
|
|
|
}
|
|
|
+ //验证
|
|
|
+ if(age < self.hardwareList.length){
|
|
|
+ this.$set(this,'hardwareShowType',false);
|
|
|
+ }else{
|
|
|
+ for(let i=0;i<self.dialogForm.riskPlanHardwareList.length;i++){
|
|
|
+ if(!self.dialogForm.riskPlanHardwareList[i].hardwareType){
|
|
|
+ self.dialogForm.riskPlanHardwareList.splice(i,1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.$set(this,'hardwareShowType',true);
|
|
|
+ }
|
|
|
},
|
|
|
//查询设备功能
|
|
|
controlTypeList(val,index) {
|
|
|
let self = this;
|
|
|
+ console.log('hardwareList',this.hardwareList);
|
|
|
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);
|
|
@@ -386,7 +418,7 @@
|
|
|
this.sensorListData = JSON.parse(JSON.stringify(response.data))
|
|
|
});
|
|
|
optionHardware({}).then(response => {
|
|
|
- this.hardwareList = response.data;
|
|
|
+ this.$set(this,'hardwareList',response.data)
|
|
|
});
|
|
|
listClassifiedAll().then(response=>{
|
|
|
if(response.code==200){
|
|
@@ -426,26 +458,28 @@
|
|
|
|
|
|
},
|
|
|
addMinData(type){
|
|
|
- if(type == 1){
|
|
|
- if(this.dialogForm.riskPlanSensorList.length>8){
|
|
|
- this.msgError('新增失败,最多只能新增九条监测规则')
|
|
|
- return
|
|
|
- }
|
|
|
- this.dialogForm.riskPlanSensorList.push({
|
|
|
- sensorType:null,
|
|
|
- })
|
|
|
- }else if(type == 2){
|
|
|
- if(this.dialogForm.riskPlanHardwareList.length>8){
|
|
|
- this.msgError('新增失败,最多只能新增九条处置规则')
|
|
|
- return
|
|
|
+ if(this.addFiltration()){
|
|
|
+ if(type == 1){
|
|
|
+ if(this.dialogForm.riskPlanSensorList.length>8){
|
|
|
+ this.msgError('新增失败,最多只能新增九条监测规则')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.dialogForm.riskPlanSensorList.push({
|
|
|
+ sensorType:null,
|
|
|
+ })
|
|
|
+ }else if(type == 2){
|
|
|
+ if(this.dialogForm.riskPlanHardwareList.length>8){
|
|
|
+ this.msgError('新增失败,最多只能新增九条处置规则')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.dialogForm.riskPlanHardwareList.push({
|
|
|
+ hardwareType:null,
|
|
|
+ operate:null,
|
|
|
+ overAct:null,
|
|
|
+ })
|
|
|
}
|
|
|
- this.dialogForm.riskPlanHardwareList.push({
|
|
|
- hardwareType:null,
|
|
|
- operate:null,
|
|
|
- overAct:null,
|
|
|
- })
|
|
|
+ this.actionFiltration();
|
|
|
}
|
|
|
- this.actionFiltration();
|
|
|
},
|
|
|
delMinData(type,index){
|
|
|
if(type == 1){
|
|
@@ -667,7 +701,7 @@
|
|
|
this.$set(this,'dialogTitle','新增预案规则');
|
|
|
this.$set(this,'dialogForm',{
|
|
|
riskPlanLevel:a==0?1:(b==0?2:(c==0?3:(d==0?4:''))),
|
|
|
- ifExit:1,
|
|
|
+ ifExit:0,
|
|
|
alarmType:['1','2'],
|
|
|
riskAutoOff:'60',
|
|
|
riskPlanSensorList:[],
|