|
@@ -115,12 +115,22 @@
|
|
<!--</el-radio-group>-->
|
|
<!--</el-radio-group>-->
|
|
<!--</el-form-item>-->
|
|
<!--</el-form-item>-->
|
|
</div>
|
|
</div>
|
|
- <el-form-item label="报警通知方式:" prop="expandType">
|
|
|
|
- <el-checkbox-group v-model="dialogForm.alarmType">
|
|
|
|
|
|
+ <el-form-item label="报警通知方式:" prop="alarmType">
|
|
|
|
+ <el-checkbox-group v-model="dialogForm.alarmType" @change="alarmChange">
|
|
<el-checkbox label="1">电话报警</el-checkbox>
|
|
<el-checkbox label="1">电话报警</el-checkbox>
|
|
<el-checkbox label="2">短信报警</el-checkbox>
|
|
<el-checkbox label="2">短信报警</el-checkbox>
|
|
</el-checkbox-group>
|
|
</el-checkbox-group>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="短信模板:" prop="msgTempId" v-if="businessType">
|
|
|
|
+ <el-select placeholder="请选择短信模板" v-model="dialogForm.msgTempId" style="width:300px;">
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="item in businessOptions"
|
|
|
|
+ :key="item.templateId"
|
|
|
|
+ :label="item.templateName"
|
|
|
|
+ :value="item.templateId">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
<div class="autoClose">
|
|
<div class="autoClose">
|
|
<p class="autoClose_l">自动关闭:</p>
|
|
<p class="autoClose_l">自动关闭:</p>
|
|
<p class="autoClose_l2">传感器监测数值恢复正常</p>
|
|
<p class="autoClose_l2">传感器监测数值恢复正常</p>
|
|
@@ -229,6 +239,7 @@
|
|
import { laboratoryMusicFindByType,laboratoryRiskDeviceTypeGetList,laboratoryRiskPlanLevelGetRiskPlanLeveList,
|
|
import { laboratoryMusicFindByType,laboratoryRiskDeviceTypeGetList,laboratoryRiskPlanLevelGetRiskPlanLeveList,
|
|
laboratoryPlanUpdate,laboratoryRiskPlanLevelAdd,laboratoryRiskPlanLevelUpdate,laboratoryRiskPlanLevelDelete } from "@/api/emergencyManagement/index";
|
|
laboratoryPlanUpdate,laboratoryRiskPlanLevelAdd,laboratoryRiskPlanLevelUpdate,laboratoryRiskPlanLevelDelete } from "@/api/emergencyManagement/index";
|
|
import { iotAttributeGetByTypeId } from "@/api/iotDevice/index";
|
|
import { iotAttributeGetByTypeId } from "@/api/iotDevice/index";
|
|
|
|
+ import { iotAlarmTemplateFindList } from "@/api/commonality/permission";
|
|
export default {
|
|
export default {
|
|
name: "newAddPlan",
|
|
name: "newAddPlan",
|
|
props:{
|
|
props:{
|
|
@@ -251,8 +262,10 @@
|
|
dialogTitle:'',
|
|
dialogTitle:'',
|
|
dialogIndex:null,
|
|
dialogIndex:null,
|
|
dialogOpen:false,
|
|
dialogOpen:false,
|
|
- dialogForm:{
|
|
|
|
- },
|
|
|
|
|
|
+ dialogForm:{},
|
|
|
|
+ //短信开关条件
|
|
|
|
+ businessType:false,
|
|
|
|
+ businessOptions:[],
|
|
// 表单校验
|
|
// 表单校验
|
|
rules: {
|
|
rules: {
|
|
name: [
|
|
name: [
|
|
@@ -264,6 +277,9 @@
|
|
{ required: true, message: "请选择疏散音乐", trigger: "change" },
|
|
{ required: true, message: "请选择疏散音乐", trigger: "change" },
|
|
{ required: true, message: "请选择疏散音乐", validator: this.spaceJudgment, trigger: "change" },
|
|
{ required: true, message: "请选择疏散音乐", validator: this.spaceJudgment, trigger: "change" },
|
|
],
|
|
],
|
|
|
|
+ msgTempId: [
|
|
|
|
+ { required: true, message: "请选择短信模板", trigger: "change" },
|
|
|
|
+ ],
|
|
riskPlanLevel: [
|
|
riskPlanLevel: [
|
|
{ required: true, message: "请选择预案等级", trigger: "change" },
|
|
{ required: true, message: "请选择预案等级", trigger: "change" },
|
|
],
|
|
],
|
|
@@ -326,6 +342,7 @@
|
|
methods: {
|
|
methods: {
|
|
//初始化
|
|
//初始化
|
|
initialization(){
|
|
initialization(){
|
|
|
|
+ this.iotAlarmTemplateFindList();
|
|
this.laboratoryMusicFindByType();
|
|
this.laboratoryMusicFindByType();
|
|
this.iotAttributeGetByTypeId();
|
|
this.iotAttributeGetByTypeId();
|
|
this.laboratoryRiskDeviceTypeGetList();
|
|
this.laboratoryRiskDeviceTypeGetList();
|
|
@@ -427,6 +444,20 @@
|
|
this.$set(this,'hardwareShowType',true);
|
|
this.$set(this,'hardwareShowType',true);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ //报警通知方式变更
|
|
|
|
+ alarmChange(val){
|
|
|
|
+ let num = 0;
|
|
|
|
+ val.forEach((item)=>{
|
|
|
|
+ if(item == '2'){
|
|
|
|
+ num++
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ if(num != 0){
|
|
|
|
+ this.$set(this,'businessType',true);
|
|
|
|
+ }else{
|
|
|
|
+ this.$set(this,'businessType',false);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
//查询设备功能
|
|
//查询设备功能
|
|
controlTypeList(val,index) {
|
|
controlTypeList(val,index) {
|
|
let self = this;
|
|
let self = this;
|
|
@@ -629,6 +660,7 @@
|
|
let obj = JSON.parse(JSON.stringify(this.dialogForm))
|
|
let obj = JSON.parse(JSON.stringify(this.dialogForm))
|
|
obj.riskAutoOff =Number(obj.riskAutoOff);
|
|
obj.riskAutoOff =Number(obj.riskAutoOff);
|
|
obj.alarmType =obj.alarmType.toString();
|
|
obj.alarmType =obj.alarmType.toString();
|
|
|
|
+ obj.msgTempId =this.businessType?obj.msgTempId:null;
|
|
obj.startCondition = text+'';
|
|
obj.startCondition = text+'';
|
|
obj.bindingSensor = obj.bindingSensor[0]?JSON.stringify(obj.bindingSensor):'';
|
|
obj.bindingSensor = obj.bindingSensor[0]?JSON.stringify(obj.bindingSensor):'';
|
|
obj.bindingDevice = obj.bindingDevice[0]?JSON.stringify(obj.bindingDevice):'';
|
|
obj.bindingDevice = obj.bindingDevice[0]?JSON.stringify(obj.bindingDevice):'';
|
|
@@ -662,6 +694,7 @@
|
|
let obj = JSON.parse(JSON.stringify(this.dialogForm))
|
|
let obj = JSON.parse(JSON.stringify(this.dialogForm))
|
|
obj.riskAutoOff =Number(obj.riskAutoOff);
|
|
obj.riskAutoOff =Number(obj.riskAutoOff);
|
|
obj.alarmType =obj.alarmType.toString();
|
|
obj.alarmType =obj.alarmType.toString();
|
|
|
|
+ obj.msgTempId =this.businessType?obj.msgTempId:null;
|
|
obj.riskPlanId = this.addPlanData.id;
|
|
obj.riskPlanId = this.addPlanData.id;
|
|
obj.startCondition = text+'';
|
|
obj.startCondition = text+'';
|
|
obj.bindingSensor = obj.bindingSensor[0]?JSON.stringify(obj.bindingSensor):'';
|
|
obj.bindingSensor = obj.bindingSensor[0]?JSON.stringify(obj.bindingSensor):'';
|
|
@@ -706,10 +739,12 @@
|
|
riskPlanLevel:a==0?1:(b==0?2:(c==0?3:(d==0?4:''))),
|
|
riskPlanLevel:a==0?1:(b==0?2:(c==0?3:(d==0?4:''))),
|
|
ifExit:true,
|
|
ifExit:true,
|
|
alarmType:['1','2'],
|
|
alarmType:['1','2'],
|
|
|
|
+ msgTempId:null,
|
|
riskAutoOff:'60',
|
|
riskAutoOff:'60',
|
|
bindingSensor:[],
|
|
bindingSensor:[],
|
|
bindingDevice:[],
|
|
bindingDevice:[],
|
|
});
|
|
});
|
|
|
|
+ this.$set(this,'businessType',true);
|
|
this.$set(this,'dialogOpen',true);
|
|
this.$set(this,'dialogOpen',true);
|
|
}else if(type == 2){
|
|
}else if(type == 2){
|
|
this.$set(this,'dialogTitle','编辑预案规则');
|
|
this.$set(this,'dialogTitle','编辑预案规则');
|
|
@@ -721,10 +756,12 @@
|
|
riskPlanLevel:obj.riskPlanLevel,
|
|
riskPlanLevel:obj.riskPlanLevel,
|
|
ifExit:obj.ifExit,
|
|
ifExit:obj.ifExit,
|
|
alarmType:obj.alarmType.split(','),
|
|
alarmType:obj.alarmType.split(','),
|
|
|
|
+ msgTempId:obj.msgTempId,
|
|
riskAutoOff:obj.riskAutoOff+'',
|
|
riskAutoOff:obj.riskAutoOff+'',
|
|
bindingSensor:obj.bindingSensor,
|
|
bindingSensor:obj.bindingSensor,
|
|
bindingDevice:obj.bindingDevice,
|
|
bindingDevice:obj.bindingDevice,
|
|
});
|
|
});
|
|
|
|
+ this.alarmChange(obj.alarmType.split(','));
|
|
let list = [];
|
|
let list = [];
|
|
for(let i=0;i<self.form.labRiskPlanLevels.length;i++){
|
|
for(let i=0;i<self.form.labRiskPlanLevels.length;i++){
|
|
if(i!=index){
|
|
if(i!=index){
|
|
@@ -767,6 +804,12 @@
|
|
}).catch(() => {});
|
|
}).catch(() => {});
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ //按类型查询模板消息下拉列表
|
|
|
|
+ iotAlarmTemplateFindList(){
|
|
|
|
+ iotAlarmTemplateFindList({businessType:1}).then(response => {
|
|
|
|
+ this.$set(this,'businessOptions',response.data)
|
|
|
|
+ });
|
|
|
|
+ },
|
|
//音乐列表
|
|
//音乐列表
|
|
laboratoryMusicFindByType(){
|
|
laboratoryMusicFindByType(){
|
|
laboratoryMusicFindByType({musicType:1}).then(response => {
|
|
laboratoryMusicFindByType({musicType:1}).then(response => {
|