|
@@ -3,16 +3,6 @@
|
|
<div class="search-list">
|
|
<div class="search-list">
|
|
<div class="search-left">
|
|
<div class="search-left">
|
|
<Form class="common-form common-form-list" ref="tableParams" :model="tableParams" inline>
|
|
<Form class="common-form common-form-list" ref="tableParams" :model="tableParams" inline>
|
|
- <!-- <FormItem label="" prop="applicationId">
|
|
|
|
- <Select v-model="tableParams.applicationId" placeholder="来源应用" @on-change="selectApp">
|
|
|
|
- <Option v-for="item in appData" :value="item.id" :key="item.id">{{ item.appName }}</Option>
|
|
|
|
- </Select>
|
|
|
|
- </FormItem>
|
|
|
|
- <FormItem label="" prop="equipmentTypeId">
|
|
|
|
- <Select v-model="tableParams.equipmentTypeId" placeholder="设备类型">
|
|
|
|
- <Option v-for="item in equipTypeData" :value="item.equipmentTypeId" :key="item.equipmentTypeId">{{ item.equipmentName }}</Option>
|
|
|
|
- </Select>
|
|
|
|
- </FormItem> -->
|
|
|
|
<FormItem label="" prop="targetCount">
|
|
<FormItem label="" prop="targetCount">
|
|
<Select v-model="tableParams.targetCount" placeholder="监测指标数量">
|
|
<Select v-model="tableParams.targetCount" placeholder="监测指标数量">
|
|
<Option v-for="item in indicatorsNum" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
|
<Option v-for="item in indicatorsNum" :value="item.value" :key="item.value">{{ item.label }}</Option>
|
|
@@ -112,9 +102,6 @@
|
|
<Select v-model="val.targetId" style="width: 75%" placeholder="监测指标" @on-change="selectTarget(val.targetId,index,i)" ref="targetId" transfer>
|
|
<Select v-model="val.targetId" style="width: 75%" placeholder="监测指标" @on-change="selectTarget(val.targetId,index,i)" ref="targetId" transfer>
|
|
<Option v-for="subItem in indicatorsModalData" :value="subItem.id" :key="subItem.id">{{ subItem.targetName }}</Option>
|
|
<Option v-for="subItem in indicatorsModalData" :value="subItem.id" :key="subItem.id">{{ subItem.targetName }}</Option>
|
|
</Select>
|
|
</Select>
|
|
- <!-- <Select v-model="val.targetId" style="width: 75%" placeholder="监测指标" @on-change="selectTarget(val.targetId,index,i)" ref="targetId" transfer>
|
|
|
|
- <Option v-for="subItem in indicatorsModalData" :value="subItem.id" :key="subItem.id">{{ subItem.value }}</Option>
|
|
|
|
- </Select> -->
|
|
|
|
</FormItem>
|
|
</FormItem>
|
|
</Col>
|
|
</Col>
|
|
<Col span="4">
|
|
<Col span="4">
|
|
@@ -150,7 +137,7 @@
|
|
</Col>
|
|
</Col>
|
|
<Col span="1" class="row-es-del" v-if="i != 0">
|
|
<Col span="1" class="row-es-del" v-if="i != 0">
|
|
<FormItem>
|
|
<FormItem>
|
|
- <i class="iconfont icon-shanchu ivu-col-del" v-if="i != 0" @click="handleRemove(index,i)"></i>
|
|
|
|
|
|
+ <i class="iconfont icon-shanchu ivu-col-del" v-if="i != 0" @click="handleSubRemove(index,i)"></i>
|
|
<Input placeholder="请输入" clearable style="opacity: 0;width:0px"/>
|
|
<Input placeholder="请输入" clearable style="opacity: 0;width:0px"/>
|
|
</FormItem>
|
|
</FormItem>
|
|
</Col>
|
|
</Col>
|
|
@@ -159,19 +146,30 @@
|
|
<Col span="2" :class="{'row-first': index == 0}" class="row-es-text">判定为</Col>
|
|
<Col span="2" :class="{'row-first': index == 0}" class="row-es-text">判定为</Col>
|
|
<Col span="3" :class="{'row-first': index == 0}" class="row-es-last">
|
|
<Col span="3" :class="{'row-first': index == 0}" class="row-es-last">
|
|
<FormItem
|
|
<FormItem
|
|
- :prop="'alertStrategyRankDTOList.'+index+'.rankId'" :rules="{required: true,type: 'number',message: '请选择告警等级',trigger: 'change'}">
|
|
|
|
|
|
+ :prop="'alertStrategyRankDTOList.'+index+'.rankId'" :rules="{required: clickbtn==3 ? false: true,type: 'number',message: '请选择告警等级',trigger: 'change'}">
|
|
<Select v-model="item.rankId" style="width: 100%" placeholder="告警等级" @on-change="selectRank(item.rankId,index)" ref="rank" transfer>
|
|
<Select v-model="item.rankId" style="width: 100%" placeholder="告警等级" @on-change="selectRank(item.rankId,index)" ref="rank" transfer>
|
|
<Option v-for="firstitem in alarmLevelModalData" :value="firstitem.id" :key="firstitem.id" :disabled="firstitem.disabled">{{ firstitem.name }}</Option>
|
|
<Option v-for="firstitem in alarmLevelModalData" :value="firstitem.id" :key="firstitem.id" :disabled="firstitem.disabled">{{ firstitem.name }}</Option>
|
|
</Select>
|
|
</Select>
|
|
</FormItem>
|
|
</FormItem>
|
|
</Col>
|
|
</Col>
|
|
<Col span="1" class="ivu-col-btn">
|
|
<Col span="1" class="ivu-col-btn">
|
|
- <i class="iconfont icon-tianjia" style="cursor:pointer;color:#2DA0F8;padding-left:10px" @click="handleAdd('formDynamic')" v-if="index == formCustom.alertStrategyRankDTOList.length - 1 &&title=='新增策略'"></i>
|
|
|
|
- <!-- <Button type="dashed" @click="handleEdit('formDynamic')" icon="md-add" v-if="title == '编辑' && showEdit">编辑</Button> -->
|
|
|
|
- <!-- <Button type="dashed" @click="handleSave('formDynamic')" icon="md-add" v-if="title == '编辑' && !showEdit">保存</Button> -->
|
|
|
|
|
|
+ <i class="iconfont icon-tianjia" style="cursor:pointer;color:#2DA0F8;" @click="handleAdd('formDynamic')" v-if="index == formCustom.alertStrategyRankDTOList.length - 1 &&title=='新增策略'"></i>
|
|
|
|
+ <i class="iconfont icon-shanchu ivu-col-del" style="padding-left:5px" @click="handleRemove(index)"></i>
|
|
</Col>
|
|
</Col>
|
|
- </Row>
|
|
|
|
- <div class="sub-add">
|
|
|
|
|
|
+ <Col span="23" class="ivu-col-edit" v-if="title=='编辑策略'">
|
|
|
|
+ <div class="sub-add">
|
|
|
|
+ <span>新增一条子策略 子策略与现有子策略间为</span>
|
|
|
|
+ <FormItem ref="subLogical" :prop="'alertStrategyRankDTOList.'+index+'.subLogical'" :rules="{required: clickbtn==2 ? true: false, type: 'number',message: '请选择逻辑判断',trigger: 'change'}">
|
|
|
|
+ <Select v-model="item.subLogical" placeholder="逻辑判断" style="width: 200px;padding: 0 6px" @on-change="selectEditSubLogical(item.subLogical,index)" label-in-value transfer>
|
|
|
|
+ <Option v-for="item in logicJudgmentModalData" :value="item.id" :key="item.id">{{ item.value }}</Option>
|
|
|
|
+ </Select>
|
|
|
|
+ </FormItem>
|
|
|
|
+ 关系
|
|
|
|
+ <i class="iconfont icon-tianjia" style="cursor:pointer;color:#43B843;padding-left:10px" @click="handleEditSub('formDynamic',index)"></i>
|
|
|
|
+ </div>
|
|
|
|
+ </Col>
|
|
|
|
+ </Row>
|
|
|
|
+ <div class="sub-add" v-if="title=='新增策略'">
|
|
<span>新增一条子策略 子策略与现有子策略间为</span>
|
|
<span>新增一条子策略 子策略与现有子策略间为</span>
|
|
<FormItem prop="subLogical" :rules="{required: clickbtn==2 ? true: false, type: 'number',message: '请选择逻辑判断',trigger: 'change'}">
|
|
<FormItem prop="subLogical" :rules="{required: clickbtn==2 ? true: false, type: 'number',message: '请选择逻辑判断',trigger: 'change'}">
|
|
<Select v-model="formCustom.subLogical" placeholder="逻辑判断" style="width: 200px;padding: 0 6px" @on-change="selectSubLogical" label-in-value transfer>
|
|
<Select v-model="formCustom.subLogical" placeholder="逻辑判断" style="width: 200px;padding: 0 6px" @on-change="selectSubLogical" label-in-value transfer>
|
|
@@ -781,6 +779,8 @@ export default {
|
|
this.disabledApp = true
|
|
this.disabledApp = true
|
|
this.disabledEquip = true
|
|
this.disabledEquip = true
|
|
} else if (this.formCustom.alertStrategyRankDTOList.length==1) {
|
|
} else if (this.formCustom.alertStrategyRankDTOList.length==1) {
|
|
|
|
+ this.disabledApp = false
|
|
|
|
+ this.disabledEquip = false
|
|
if (this.formCustom.alertStrategyRankDTOList[0].alertStrategyDetailList.length>1) {
|
|
if (this.formCustom.alertStrategyRankDTOList[0].alertStrategyDetailList.length>1) {
|
|
this.disabledApp = true
|
|
this.disabledApp = true
|
|
this.disabledEquip = true
|
|
this.disabledEquip = true
|
|
@@ -838,12 +838,12 @@ export default {
|
|
// })
|
|
// })
|
|
},
|
|
},
|
|
editClick (row) {
|
|
editClick (row) {
|
|
|
|
+ this.clickbtn = 1
|
|
let params = {
|
|
let params = {
|
|
equipmentTypeId: row.equipmentTypeId
|
|
equipmentTypeId: row.equipmentTypeId
|
|
}
|
|
}
|
|
this.getMonitorIndex(params)
|
|
this.getMonitorIndex(params)
|
|
this.getstrategyData(row.id)
|
|
this.getstrategyData(row.id)
|
|
- this.clickbtn = 1
|
|
|
|
this.rowObj = row
|
|
this.rowObj = row
|
|
this.formOption = JSON.parse(JSON.stringify(row));
|
|
this.formOption = JSON.parse(JSON.stringify(row));
|
|
this.appParams.applicationId = this.formOption.appId
|
|
this.appParams.applicationId = this.formOption.appId
|
|
@@ -1075,7 +1075,56 @@ export default {
|
|
})
|
|
})
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- handleRemove(index,i) {
|
|
|
|
|
|
+ handleEditSub (name,index) {
|
|
|
|
+ if (this.formCustom.subLogical) {
|
|
|
|
+ this.clickbtn = 1
|
|
|
|
+ } else {
|
|
|
|
+ this.clickbtn = 2
|
|
|
|
+ }
|
|
|
|
+ this.$nextTick(()=> {
|
|
|
|
+ this.$refs.formDynamic.validateField(`alertStrategyRankDTOList.${index}.subLogical`,(valid)=> {
|
|
|
|
+ if (valid!='请选择逻辑判断') {
|
|
|
|
+ this.disabledApp = true
|
|
|
|
+ this.disabledEquip = true
|
|
|
|
+ this.formCustom.alertStrategyRankDTOList[index].alertStrategyDetailList.push({
|
|
|
|
+ targetId: '',
|
|
|
|
+ targetName: '',
|
|
|
|
+ logical1: '',
|
|
|
|
+ logicalName1: '',
|
|
|
|
+ targetValue1: '',
|
|
|
|
+ connectLogical: '',
|
|
|
|
+ connectLogicalName: '',
|
|
|
|
+ logical2: '',
|
|
|
|
+ logicalName2: '',
|
|
|
|
+ targetValue2: '',
|
|
|
|
+ relation: this.formCustom.alertStrategyRankDTOList[index].subLogical,
|
|
|
|
+ relationName: this.formCustom.alertStrategyRankDTOList[index].subLogicalName
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ handleRemove (index) {
|
|
|
|
+ this.clickbtn = 3
|
|
|
|
+ this.$nextTick(()=> {
|
|
|
|
+ if (this.formCustom.alertStrategyRankDTOList.length == 1) {
|
|
|
|
+ this.$Message['error']({
|
|
|
|
+ background: true,
|
|
|
|
+ content: '请至少保留一条非空策略',
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.formCustom.alertStrategyRankDTOList.splice(index, 1) //因为删除选值的下拉框,没选值的下拉框的值会变成undefined 所以加个状态值(clickbtn=3)
|
|
|
|
+ }
|
|
|
|
+ this.formCustom.alertStrategyRankDTOList.forEach((item,index)=> {
|
|
|
|
+ if (this.formCustom.alertStrategyRankDTOList.length==1 && item.alertStrategyDetailList && item.alertStrategyDetailList.length==1) {
|
|
|
|
+ this.disabledApp = false
|
|
|
|
+ this.disabledEquip = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ // this.formCustom.alertStrategyRankDTOList[this.formCustom.alertStrategyRankDTOList.length - 1].alertStrategyDetailList.splice(i, 1) //因为删除选值的下拉框,没选值的下拉框的值会变成undefined 所以加个状态值(clickbtn=3)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ handleSubRemove(index,i) {
|
|
this.clickbtn = 3
|
|
this.clickbtn = 3
|
|
this.$nextTick(()=> {
|
|
this.$nextTick(()=> {
|
|
this.formCustom.alertStrategyRankDTOList[index].alertStrategyDetailList.splice(i, 1) //因为删除选值的下拉框,没选值的下拉框的值会变成undefined 所以加个状态值(clickbtn=3)
|
|
this.formCustom.alertStrategyRankDTOList[index].alertStrategyDetailList.splice(i, 1) //因为删除选值的下拉框,没选值的下拉框的值会变成undefined 所以加个状态值(clickbtn=3)
|
|
@@ -1099,6 +1148,16 @@ export default {
|
|
this.clickbtn = 1
|
|
this.clickbtn = 1
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ selectEditSubLogical (val,index) {
|
|
|
|
+ this.formCustom.alertStrategyRankDTOList[index].subLogical = val
|
|
|
|
+ let subLogicalName = ''
|
|
|
|
+ this.logicJudgmentModalData.forEach((item)=> {
|
|
|
|
+ if (val == item.id) {
|
|
|
|
+ subLogicalName = item.value
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.formCustom.alertStrategyRankDTOList[index].subLogicalName = subLogicalName
|
|
|
|
+ },
|
|
selectTarget (val,index,i) {
|
|
selectTarget (val,index,i) {
|
|
this.formCustom.alertStrategyRankDTOList[index].alertStrategyDetailList[i].targetId = val
|
|
this.formCustom.alertStrategyRankDTOList[index].alertStrategyDetailList[i].targetId = val
|
|
let targetName = ''
|
|
let targetName = ''
|
|
@@ -1364,6 +1423,9 @@ export default {
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
overflow-y: auto;
|
|
overflow-y: auto;
|
|
}
|
|
}
|
|
|
|
+>>> .strategy-form {
|
|
|
|
+ margin-bottom: 30px;
|
|
|
|
+}
|
|
>>> .strategy-form .ivu-col{
|
|
>>> .strategy-form .ivu-col{
|
|
position: initial;
|
|
position: initial;
|
|
color: #2B8EE2;
|
|
color: #2B8EE2;
|
|
@@ -1441,6 +1503,9 @@ export default {
|
|
>>> .strategy-form .ivu-col-btn {
|
|
>>> .strategy-form .ivu-col-btn {
|
|
border-top: none;
|
|
border-top: none;
|
|
border-bottom: none;
|
|
border-bottom: none;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
}
|
|
}
|
|
>>> .sub-add {
|
|
>>> .sub-add {
|
|
display: flex;
|
|
display: flex;
|
|
@@ -1461,6 +1526,16 @@ export default {
|
|
display: inline-block;
|
|
display: inline-block;
|
|
min-width: 14px;
|
|
min-width: 14px;
|
|
}
|
|
}
|
|
|
|
+>>> .ivu-col-edit {
|
|
|
|
+ border-left: 1px solid #21437b;
|
|
|
|
+ border-bottom: 1px solid #21437b;
|
|
|
|
+ border-right: 1px solid #21437b;
|
|
|
|
+}
|
|
|
|
+>>> .ivu-col-edit .sub-add {
|
|
|
|
+ margin-top: 0;
|
|
|
|
+ padding: 20px 5px;
|
|
|
|
+ padding-left: 10%;
|
|
|
|
+}
|
|
.strategy-form-detail {
|
|
.strategy-form-detail {
|
|
max-height: 350px;
|
|
max-height: 350px;
|
|
overflow: hidden;
|
|
overflow: hidden;
|