浏览代码

策略配置新增功能优化

zhangkunling 3 年之前
父节点
当前提交
16ff13706c

+ 4 - 0
src/assets/styles/common.css

@@ -544,4 +544,8 @@ textarea.ivu-input {
 }
 .common-date-picker .ivu-time-picker-cells-list {
   border-left: 1px solid #5c7091;
+}
+/* Message 全局提示 设置层级*/
+.ivu-message {
+ z-index: 999999 !important;
 }

+ 2 - 2
src/views/homecomponents/BasicInfomation/DeviceManage.vue

@@ -52,8 +52,8 @@ export default {
       currentStaData: [], // 当前搜索框搜索的站台数组对象,传给子组件,用来判断单选站台名当前选中状态
       showTree: true,// 是否显示树形组件
 		  stationData: [],
-      tabsData: [{label:'设备管理'},{label:'设备类型管理'}],
-      // tabsData: [{label:'设备管理'},{label:'设备类型管理'},{label:'设备监测模型'},{label:'监测模型配置(开发人员专用)'}],
+      // tabsData: [{label:'设备管理'},{label:'设备类型管理'}],
+      tabsData: [{label:'设备管理'},{label:'设备类型管理'},{label:'设备监测模型'},{label:'监测模型配置(开发人员专用)'}],
       currentTabs: '设备管理'
     };
   },

+ 3 - 3
src/views/homecomponents/BasicInfomation/DeviceModelManage.vue

@@ -271,7 +271,7 @@ export default {
     },
     getTableData (keywords,arr,level) {
       if (level) {
-        this.tableParams.name = ''
+        this.tableParams.keywords = ''
         if (level == 2) {
           this.tableParams.applicationId = arr[arr.length-1]
           this.tableParams.equipmentTypeId = ''
@@ -286,9 +286,9 @@ export default {
         this.tableParams.applicationId = ''
         this.tableParams.equipmentTypeId = ''
         if (keywords == '合肥轨道交通' || keywords == '' || keywords == undefined) {
-          this.tableParams.name = ''
+          this.tableParams.keywords = ''
         } else {
-          this.tableParams.name = keywords
+          this.tableParams.keywords = keywords
         }
       }
       this.loading = true

+ 13 - 7
src/views/homecomponents/EquipmentAnalysis/AlarmAcknowledgConfig.vue

@@ -102,24 +102,24 @@
           <Col span="4" :class="{'row-first': index == 0}" class="row-first-es row-second-es">告警等级</Col>
           <Col span="5" :class="{'row-first': index == 0}" class="row-select">
             <FormItem
-              :prop="'alertStrategyAutoConfirmDTOList.'+index+'.rankId'" :rules="{required: true,type: 'number',message: '请选择告警等级',trigger: 'change'}">
+              :prop="'alertStrategyAutoConfirmDTOList.'+index+'.rankId'" :rules="{required: clickbtn==1 ? true: false,type: 'number',message: '请选择告警等级',trigger: 'change'}">
               <Select v-model="item.rankId" style="width: 100%" placeholder="告警等级" transfer @on-change="selectRank(item.rankId,index)" ref="rank">
                 <Option v-for="firstitem in alarmLevelModalData" :value="firstitem.id" :key="firstitem.id">{{ firstitem.name }}</Option>
               </Select>
             </FormItem>
           </Col>
-          <Col span="5" :class="{'row-first': index == 0}" class="row-first-es">自动确认为</Col>
+          <Col span="4" :class="{'row-first': index == 0}" class="row-first-es">自动确认为</Col>
           <Col span="5" :class="{'row-first': index == 0}" class="row-select row-es-last">
             <FormItem
-              :prop="'alertStrategyAutoConfirmDTOList.'+index+'.autoStatus'" :rules="{required: true,message: '请选择确认动作',trigger: 'change'}">
+              :prop="'alertStrategyAutoConfirmDTOList.'+index+'.autoStatus'" :rules="{required: clickbtn==1 ? true: false,message: '请选择确认动作',trigger: 'change'}">
               <Select v-model="item.autoStatus" style="width: 100%" placeholder="确认动作" ref="rank" transfer>
                 <Option v-for="firstitem in confirmActionModalData" :value="firstitem.value" :key="firstitem.value">{{ firstitem.label }}</Option>
               </Select>
             </FormItem>
           </Col>
-          <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.alertStrategyAutoConfirmDTOList.length - 1 &&title=='新增策略'"></i>
-          <i class="iconfont icon-shanchu ivu-col-del" v-if="title=='编辑策略'" @click="handleRemove(index)"></i>
+          <Col span="2" class="ivu-col-btn">
+            <i class="iconfont icon-tianjia" style="cursor:pointer;color:#2DA0F8;padding-left:10px" @click="handleAdd('formDynamic')" v-if="index == formCustom.alertStrategyAutoConfirmDTOList.length - 1 &&title=='新增策略'"></i>
+            <i class="iconfont icon-shanchu ivu-col-del" style="cursor:pointer; color:#BC2020;padding-left:6px" @click="handleRemove(index)"></i>
           </Col>
         </Row>
       </Form>
@@ -407,6 +407,7 @@ export default {
           },
         ],
       },
+      clickbtn: 1, // 1点击策略保存按钮 2点击子策略删除按钮
     };
   },
   mounted() {
@@ -527,6 +528,7 @@ export default {
      this.getTableData()
     },   
     addClick () {
+      this.clickbtn = 1
       this.formOption = JSON.parse(JSON.stringify(defaultFrom))
       this.formCustom.alertStrategyAutoConfirmDTOList = [{
         rankId: '',
@@ -543,6 +545,7 @@ export default {
       })
     },
     editClick (row) {
+      this.clickbtn = 1
       this.getstrategyData(row.id)
       this.rowObj = row
       this.formOption = JSON.parse(JSON.stringify(row));
@@ -579,6 +582,7 @@ export default {
      }
     },
     modalOk () {
+      this.clickbtn = 1
       var params = Object.assign({}, this.formOption, this.formCustom); // 合并对象 注意目标对象自身也会改变。假设目标对象{}是之前里的对象,他的值跟obj一样
       this.$nextTick(()=> {
         // 多个form表单验证
@@ -687,6 +691,7 @@ export default {
       })
     },
     handleAdd(name) {
+      this.clickbtn = 1
       this.$nextTick(()=> {
         this.$refs[name].validate((valid) => {
         if (valid) { 
@@ -699,6 +704,7 @@ export default {
       }) 
     },
     handleRemove(i) {
+      this.clickbtn = 2
       if (this.formCustom.alertStrategyAutoConfirmDTOList.length == 1) {
         this.$Message['error']({
             background: true,
@@ -906,7 +912,7 @@ export default {
   overflow-y: auto;  
 }
 >>> .strategy-form {
-margin-bottom: 20px;
+margin-bottom: 25px;
 }
 >>> .strategy-form .ivu-col{
   position: initial;

+ 2 - 2
src/views/homecomponents/EquipmentAnalysis/AlarmMonitor.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="content-main">
-    <!-- <div class="content-body-wrap">
+    <div class="content-body-wrap">
      <div class="content-body">
          <Row :gutter="8" style="width:100%;height: 100%">
           <i-col span="5" style="height:100%">
@@ -135,7 +135,7 @@
           </i-col>
         </Row>
      </div>
-    </div> -->
+    </div>
   </div>
 </template>
 <script>

+ 10 - 7
src/views/homecomponents/EquipmentAnalysis/AlarmRealLine.vue

@@ -167,17 +167,15 @@
                     <Tooltip placement="top-start" transfer max-width="350" v-if="val.value || val.value===0">
                       <span v-if="val.name == '设备今日告警'">{{val.value+'次'}}</span>
                       <span v-else-if="val.name == '同比'">
-                        <Icon type="md-arrow-down" style="color: #F32F2F;font-size:20px" v-if="val.value>0"/>
-                        <Icon type="md-arrow-up" style="color: #09CB09;font-size:20px" v-if="val.value<0" />
-                        {{val.value+'%'}}
+                        <Icon type="md-arrow-up" style="color: #09CB09;font-size:20px" v-if="val.value>0"/>
+                        <Icon type="md-arrow-down" style="color: #F32F2F;font-size:20px" v-if="val.value<0" />
+                        {{Math.abs(val.value)+'%'}}
                       </span>
                       <span v-else>{{val.value}}</span>
                       <div slot="content">
                         <span v-if="val.name == '设备今日告警'">{{val.value+'次'}}</span>
                         <span v-else-if="val.name == '同比'">
-                          <Icon type="md-arrow-down" style="color: #F32F2F;font-size:20px" v-if="val.value>0"/>
-                          <Icon type="md-arrow-up" style="color: #09CB09;font-size:20px" v-if="val.value<0" />
-                          {{val.value+'%'}}
+                          {{Math.abs(val.value)+'%'}}
                         </span>
                         <span v-else>{{val.value}}</span>
                       </div>
@@ -232,7 +230,7 @@ export default {
         processingStatus: '',
         keywords: '',
         applicationId:'',
-        equipmentTypeId: '',
+        equipmentTypeId: '', 
         oneKeywords: '',
         alertRankId: '',
         beginAlertTime: '',
@@ -438,6 +436,11 @@ export default {
           this.alarmModalStatus = JSON.parse(JSON.stringify(res.data))
           this.alarmStatus = res.data
           this.alarmStatus.unshift({ id: '-1', value: '处理状态' })
+          for(let i = 0; i < this.alarmModalStatus.length; i++){
+            if(this.alarmModalStatus[i].value == '无法判定等级'){
+                this.alarmModalStatus.splice(i,1);
+            }
+          }
         } else {
           this.alarmModalStatus = []
           this.alarmStatus = []

+ 9 - 6
src/views/homecomponents/EquipmentAnalysis/AlarmRealStation.vue

@@ -177,17 +177,15 @@
                     <Tooltip placement="top-start" transfer max-width="350" v-if="val.value || val.value===0">
                       <span v-if="val.name == '设备今日告警'">{{val.value+'次'}}</span>
                       <span v-else-if="val.name == '同比'">
-                        <Icon type="md-arrow-down" style="color: #F32F2F;font-size:20px" v-if="val.value>0"/>
-                        <Icon type="md-arrow-up" style="color: #09CB09;font-size:20px" v-if="val.value<0" />
-                        {{val.value+'%'}}
+                        <Icon type="md-arrow-up" style="color: #09CB09;font-size:20px" v-if="val.value>0"/>
+                        <Icon type="md-arrow-down" style="color: #F32F2F;font-size:20px" v-if="val.value<0" />
+                        {{Math.abs(val.value)+'%'}}
                       </span>
                       <span v-else>{{val.value}}</span>
                       <div slot="content">
                         <span v-if="val.name == '设备今日告警'">{{val.value+'次'}}</span>
                         <span v-else-if="val.name == '同比'">
-                          <Icon type="md-arrow-down" style="color: #F32F2F;font-size:20px" v-if="val.value>0"/>
-                          <Icon type="md-arrow-up" style="color: #09CB09;font-size:20px" v-if="val.value<0" />
-                          {{val.value+'%'}}
+                          {{Math.abs(val.value)+'%'}}
                         </span>
                         <span v-else>{{val.value}}</span>
                       </div>
@@ -450,6 +448,11 @@ export default {
           this.alarmLevelModalData = JSON.parse(JSON.stringify(res.data.data))
           this.alarmLevelData = res.data.data
           this.alarmLevelData.unshift({ id: '-1', name: '告警等级' })
+          for(let i = 0; i < this.alarmModalStatus.length; i++){
+            if(this.alarmModalStatus[i].value == '无法判定等级'){
+                this.alarmModalStatus.splice(i,1);
+            }
+          }
         } else {
           this.alarmLevelData = []
           this.alarmLevelModalData = []

+ 4 - 24
src/views/homecomponents/EquipmentAnalysis/AlarmToday.vue

@@ -18,8 +18,8 @@
           <div>{{item.name}} {{item.alarmNum}}{{item.alarmEquip}} {{item.alarm1}}{{item.alarmEquip1}}</div>
          </div>
        </div> -->
-    <Table :columns="columns1" :data="tableData" class="common-table app-table" no-data-text="" :row-class-name="rowClassName" :loading="loading" @on-cell-click="cellClick">
-       <template slot="loading">
+     <Table :columns="columns1" :data="tableData" class="common-table app-table" no-data-text="" :row-class-name="rowClassName" :loading="loading" @on-cell-click="cellClick">
+        <template slot="loading">
             <Loading-animation></Loading-animation>
         </template>
         <!-- <template slot-scope="{ row,index }" v-for="(item,i) in testColumns" :slot="item.slot" >
@@ -34,7 +34,7 @@
             </span>
           </template>
       </template> -->
-    </Table>
+     </Table>
     </div>
   </div>
 </template>
@@ -49,18 +49,6 @@ export default {
        columns1: [],
       // testColumns: [{title:'设备',key:'name',align: 'center'},{title:'线网',key:'alarmNum',align: 'center'},{title:'1号线',key:'equipmentTypeName',align: 'center'}],
       // testTableData: [{alarmNum:1,alarmEquip: 2,name:'UPS',alarm1:1111111111,alarmEquip1: 22222222,},{alarmNum:67,alarmEquip: 672,name:'UPS2'},{alarmNum:8,alarmEquip: 72,name:'UPS3'}],
-      tableParams: {
-        processingStatus: 38,
-        keywords: '',
-        applicationId:'',
-        equipmentTypeId: '',
-        alertRankId: '',
-        beginAlertTime: '',
-        endAlertTime: '',
-        alertRankEnabled: 1,
-        pageNum: 1,
-        pageSize: 10
-      },
       tableData: [],
       rowObj: {},
       columns: [
@@ -95,7 +83,7 @@ export default {
             ellipsis: true,
             tooltip: true
           },
-           {
+          {
             title: '告警内容',
             key: 'alertContent',
             align: 'center',
@@ -262,12 +250,6 @@ export default {
       }
       this.$emit('skipEquipTabs',skipParams)
     },
-    goEquip (){
-      console.log(12)
-      // this.$router.push({path:'//ApplicationManage'})
-      // this.$router.push({path:'/MainPage/ApplicationManage/2'})
-      // this.$router.push({ name: 'ApplicationManage', params: { type:2 }}) // -> /home/123
-    },
     rowClassName(row, index) {
       if (index % 2 == 0) {
         return "ivu-table-stripe-even";
@@ -291,8 +273,6 @@ export default {
               }
               return {title: item,key: keyName,align: 'center'}
             })
-            // console.log(this.columns1)
-            // this.columns1 = res.data.category
             this.initTableColumn('columns1')
             this.tableData = res.data.data
             this.tableTotal = res.data.count

+ 9 - 6
src/views/homecomponents/EquipmentAnalysis/ClearedAlarm.vue

@@ -130,17 +130,15 @@
                     <Tooltip placement="top-start" transfer max-width="350" v-if="val.value || val.value===0">
                       <span v-if="val.name == '设备今日告警'">{{val.value+'次'}}</span>
                       <span v-else-if="val.name == '同比'">
-                        <Icon type="md-arrow-down" style="color: #F32F2F;font-size:20px" v-if="val.value>0"/>
-                        <Icon type="md-arrow-up" style="color: #09CB09;font-size:20px" v-if="val.value<0" />
-                        {{val.value+'%'}}
+                        <Icon type="md-arrow-up" style="color: #09CB09;font-size:20px" v-if="val.value>0"/>
+                        <Icon type="md-arrow-down" style="color: #F32F2F;font-size:20px" v-if="val.value<0" />
+                        {{Math.abs(val.value)+'%'}}
                       </span>
                       <span v-else>{{val.value}}</span>
                       <div slot="content">
                         <span v-if="val.name == '设备今日告警'">{{val.value+'次'}}</span>
                         <span v-else-if="val.name == '同比'">
-                          <Icon type="md-arrow-down" style="color: #F32F2F;font-size:20px" v-if="val.value>0"/>
-                          <Icon type="md-arrow-up" style="color: #09CB09;font-size:20px" v-if="val.value<0" />
-                          {{val.value+'%'}}
+                          {{Math.abs(val.value)+'%'}}
                         </span>
                         <span v-else>{{val.value}}</span>
                       </div>
@@ -407,6 +405,11 @@ export default {
       this.$get('metroapi/dic/queryDictionary', {name:'告警处理状态'}).then(res=>{
         if (res.httpCode == 1 ){
           this.alarmModalStatus = res.data
+          for(let i = 0; i < this.alarmModalStatus.length; i++){
+            if(this.alarmModalStatus[i].value == '无法判定等级'){
+                this.alarmModalStatus.splice(i,1)
+            }
+          }
         } else {
           this.alarmModalStatus = []
         }

+ 9 - 6
src/views/homecomponents/EquipmentAnalysis/ComprehensiveInfor.vue

@@ -174,17 +174,15 @@
                     <Tooltip placement="top-start" transfer max-width="350" v-if="val.value || val.value===0">
                       <span v-if="val.name == '设备今日告警'">{{val.value+'次'}}</span>
                       <span v-else-if="val.name == '同比'">
-                        <Icon type="md-arrow-down" style="color: #F32F2F;font-size:20px" v-if="val.value>0"/>
-                        <Icon type="md-arrow-up" style="color: #09CB09;font-size:20px" v-if="val.value<0" />
-                        {{val.value+'%'}}
+                        <Icon type="md-arrow-up" style="color: #09CB09;font-size:20px" v-if="val.value>0"/>
+                        <Icon type="md-arrow-down" style="color: #F32F2F;font-size:20px" v-if="val.value<0" />
+                        {{Math.abs(val.value)+'%'}}
                       </span>
                       <span v-else>{{val.value}}</span>
                       <div slot="content">
                         <span v-if="val.name == '设备今日告警'">{{val.value+'次'}}</span>
                         <span v-else-if="val.name == '同比'">
-                          <Icon type="md-arrow-down" style="color: #F32F2F;font-size:20px" v-if="val.value>0"/>
-                          <Icon type="md-arrow-up" style="color: #09CB09;font-size:20px" v-if="val.value<0" />
-                          {{val.value+'%'}}
+                          {{Math.abs(val.value)+'%'}}
                         </span>
                         <span v-else>{{val.value}}</span>
                       </div>
@@ -470,6 +468,11 @@ export default {
           this.alarmModalStatus = JSON.parse(JSON.stringify(res.data))
           this.alarmStatus = res.data
           this.alarmStatus.unshift({ id: '-1', value: '处理状态' })
+          for(let i = 0; i < this.alarmModalStatus.length; i++){
+            if(this.alarmModalStatus[i].value == '无法判定等级'){
+                this.alarmModalStatus.splice(i,1);
+            }
+          }
         } else {
           this.alarmModalStatus = []
           this.alarmStatus = []

+ 3 - 1
src/views/homecomponents/EquipmentAnalysis/ComprehensiveQuery.vue

@@ -314,6 +314,7 @@ export default {
       this.$get('metroapi/dic/queryDictionary', {name:'告警处理状态'}).then(res=>{
         if (res.httpCode == 1 ){
           this.alarmStatus = res.data
+          this.alarmStatus.unshift({ id: '-1', value: '处理状态' })
         } else {
           this.alarmStatus = []
         }
@@ -322,6 +323,7 @@ export default {
       this.$get('metroapi/alert/processing/operationUser').then(res=>{
         if (res.httpCode == 1 ){
           this.operateData = res.data.data
+          this.operateData.unshift({ value: '-1', name: '处理人' })
         } else {
           this.operateData = []
         }
@@ -363,7 +365,7 @@ export default {
       params.alertRankId = params.alertRankId == '-1' ? '':params.alertRankId
       params.applicationId = params.applicationId == '-1' ? '':params.applicationId
       params.equipmentTypeId = params.equipmentTypeId == '-1' ? '':params.equipmentTypeId 
-      params.processingStatusDesc = params.processingStatusDesc == '-1' ? '':params.processingStatusDesc
+      params.processingStatus = params.processingStatus == '-1' ? '':params.processingStatus
       params.operationUserId = params.operationUserId == '-1' ? '':params.operationUserId
       this.loading = true
       this.$get('metroapi/alert/processing/details', params).then(res=>{

+ 9 - 6
src/views/homecomponents/EquipmentAnalysis/ConfirmedAlarm.vue

@@ -132,17 +132,15 @@
                     <Tooltip placement="top-start" transfer max-width="350" v-if="val.value || val.value===0">
                       <span v-if="val.name == '设备今日告警'">{{val.value+'次'}}</span>
                       <span v-else-if="val.name == '同比'">
-                        <Icon type="md-arrow-down" style="color: #F32F2F;font-size:20px" v-if="val.value>0"/>
-                        <Icon type="md-arrow-up" style="color: #09CB09;font-size:20px" v-if="val.value<0" />
-                        {{val.value+'%'}}
+                        <Icon type="md-arrow-up" style="color: #09CB09;font-size:20px" v-if="val.value>0"/>
+                        <Icon type="md-arrow-down" style="color: #F32F2F;font-size:20px" v-if="val.value<0" />
+                        {{Math.abs(val.value)+'%'}}
                       </span>
                       <span v-else>{{val.value}}</span>
                       <div slot="content">
                         <span v-if="val.name == '设备今日告警'">{{val.value+'次'}}</span>
                         <span v-else-if="val.name == '同比'">
-                          <Icon type="md-arrow-down" style="color: #F32F2F;font-size:20px" v-if="val.value>0"/>
-                          <Icon type="md-arrow-up" style="color: #09CB09;font-size:20px" v-if="val.value<0" />
-                          {{val.value+'%'}}
+                          {{Math.abs(val.value)+'%'}}
                         </span>
                         <span v-else>{{val.value}}</span>
                       </div>
@@ -411,6 +409,11 @@ export default {
       this.$get('metroapi/dic/queryDictionary', {name:'告警处理状态'}).then(res=>{
         if (res.httpCode == 1 ){
           this.alarmModalStatus = res.data
+          for(let i = 0; i < this.alarmModalStatus.length; i++){
+            if(this.alarmModalStatus[i].value == '无法判定等级'){
+                this.alarmModalStatus.splice(i,1);
+            }
+          }
         } else {
           this.alarmModalStatus = []
         }

+ 16 - 17
src/views/homecomponents/EquipmentAnalysis/ContinuityMonitorConfig.vue

@@ -52,7 +52,7 @@
     <Modal
       v-model="showModal"
       :title="title"
-      width="40"
+      width="53"
       ref="modalGrag"
       draggable
       reset-drag-position
@@ -96,7 +96,7 @@
               <Col span="2" :class="{'row-first': index == 0}" class="row-first-es">策略{{index + 1}}</Col>
               <Col span="4" :class="{'row-first': index == 0}" class="row-select">
                 <FormItem
-                  :prop="'alertStrategyDurativeDTOList.'+index+'.targetId'" :rules="{required: true,type: 'number',message: '请选择监测指标',trigger: 'change'}">
+                  :prop="'alertStrategyDurativeDTOList.'+index+'.targetId'" :rules="{required: clickbtn==1 ? true: false,type: 'number',message: '请选择监测指标',trigger: 'change'}">
                   <Select v-model="item.targetId" style="width: 100%" placeholder="监测指标" transfer @on-change="selectTarget(item.targetId,index)" ref="targetId">
                     <Option v-for="firstitem in indicatorsModalData" :value="firstitem.id" :key="firstitem.id">{{ firstitem.targetName }}</Option>
                   </Select>
@@ -104,7 +104,7 @@
               </Col>
               <Col span="4" :class="{'row-first': index == 0}" class="row-select">
                 <FormItem
-                  :prop="'alertStrategyDurativeDTOList.'+index+'.exceptionRule'" :rules="{required: true,type: 'number',message: '请选择异常规则',trigger: 'change'}">
+                  :prop="'alertStrategyDurativeDTOList.'+index+'.exceptionRule'" :rules="{required: clickbtn==1 ? true: false,type: 'number',message: '请选择异常规则',trigger: 'change'}">
                   <Select v-model="item.exceptionRule" style="width: 100%" placeholder="异常规则" transfer @on-change="selectExceptionRule(item.exceptionRule,index)" ref="exceptionRule">
                     <Option v-for="firstitem in exceptionRuleData" :value="firstitem.id" :key="firstitem.id">{{ firstitem.value }}</Option>
                   </Select>
@@ -112,19 +112,19 @@
               </Col>
               <Col span="4" :class="{'row-first': index == 0}" class="row-input">
                 <FormItem
-                  :prop="'alertStrategyDurativeDTOList.'+index+'.minValue'" :rules="{required: true,type: 'number',message: '请输入数字',trigger: 'blur'}">
+                  :prop="'alertStrategyDurativeDTOList.'+index+'.minValue'" :rules="{required: clickbtn==1 ? true: false,type: 'number',message: '请输入数字',trigger: 'blur'}">
                  <InputNumber v-model.trim="item.minValue" placeholder="请输入数字" :active-change="false"></InputNumber>
                 </FormItem>
               </Col>
               <Col span="4" :class="{'row-first': index == 0}" class="row-input">
                  <FormItem
-                  :prop="'alertStrategyDurativeDTOList.'+index+'.maxValue'" :rules="{required: true,type: 'number',message: '请输入数字',trigger: 'blur'}">
+                  :prop="'alertStrategyDurativeDTOList.'+index+'.maxValue'" :rules="{required: clickbtn==1 ? true: false,type: 'number',message: '请输入数字',trigger: 'blur'}">
                  <InputNumber v-model.trim="item.maxValue" placeholder="请输入数字" :active-change="false"></InputNumber>
                 </FormItem>
               </Col>
               <Col span="5" :class="{'row-first': index == 0}" class="row-es-last">
                 <FormItem
-                  :prop="'alertStrategyDurativeDTOList.'+index+'.rankId'" :rules="{required: true,type: 'number',message: '请选择告警等级',trigger: 'change'}" style="display:flex">
+                  :prop="'alertStrategyDurativeDTOList.'+index+'.rankId'" :rules="{required: clickbtn==1 ? true: false,type: 'number',message: '请选择告警等级',trigger: 'change'}" style="display:flex">
                   <span class="row-es-last-text">判定为</span>
                   <Select v-model="item.rankId" placeholder="告警等级" transfer style="width: 65%" @on-change="selectRank(item.rankId,index)" ref="rank">
                     <Option v-for="firstitem in alarmLevelModalData" :value="firstitem.id" :key="firstitem.id">{{ firstitem.name }}</Option>
@@ -132,8 +132,8 @@
                 </FormItem>
               </Col>
               <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.alertStrategyDurativeDTOList.length - 1 &&title=='新增策略'"></i>
-              <i class="iconfont icon-shanchu ivu-col-del" style="cursor:pointer; color:#BC2020;padding-left:10px" v-if="title=='编辑策略'" @click="handleRemove(index)"></i>
+                <i class="iconfont icon-tianjia" style="cursor:pointer;color:#2DA0F8;padding-left:10px" @click="handleAdd('formDynamic')" v-if="index == formCustom.alertStrategyDurativeDTOList.length - 1 &&title=='新增策略'"></i>
+                <i class="iconfont icon-shanchu ivu-col-del" style="cursor:pointer; color:#BC2020;padding-left:5px" @click="handleRemove(index)"></i>
               </Col>
             </Row>
           </div>
@@ -443,6 +443,7 @@ export default {
           },
         ],
       },
+      clickbtn: 1, // 1点击策略保存按钮 2点击子策略删除按钮
     };
   },
   mounted() {
@@ -501,14 +502,6 @@ export default {
           this.appModalData = []
         }
       })
-      // 获取监测指标
-      // this.$get('metroapi/dic/queryDictionary', {name:'监测指标'}).then(res=>{
-      //   if (res.httpCode == 1 ){
-      //     this.indicatorsModalData = res.data
-      //   } else {
-      //     this.indicatorsModalData = []
-      //   }
-      // })
       // 获取异常规则
       this.$get('metroapi/dic/queryDictionary', {name:'异常规则'}).then(res=>{
         if (res.httpCode == 1 ){
@@ -620,6 +613,7 @@ export default {
      this.getTableData()
     },   
     addClick () {
+      this.clickbtn = 1
       this.disabledApp = false
       this.disabledEquip = false
       this.formOption = JSON.parse(JSON.stringify(defaultFrom))
@@ -643,6 +637,7 @@ export default {
       })
     },
     editClick (row) {
+      this.clickbtn = 1
       let params = {
         equipmentTypeId: row.equipmentTypeId
       }
@@ -688,6 +683,7 @@ export default {
      }
     },
     modalOk () {
+      this.clickbtn = 1
       let params = Object.assign({}, this.formOption, this.formCustom); // 合并对象 注意目标对象自身也会改变。假设目标对象{}是之前里的对象,他的值跟obj一样
       this.$nextTick(()=> {
         // 多个form表单验证
@@ -803,6 +799,7 @@ export default {
       })
     },
     handleAdd(name) {
+      this.clickbtn = 1
       this.$nextTick(()=> {
         this.$refs[name].validate((valid) => {
         if (valid) { 
@@ -825,6 +822,7 @@ export default {
       }) 
     },
     handleRemove(i) {
+      this.clickbtn = 2
       if (this.formCustom.alertStrategyDurativeDTOList.length == 1) {
         this.$Message['error']({
             background: true,
@@ -1059,7 +1057,7 @@ export default {
   overflow-y: auto;  
 }
 >>> .strategy-form {
-margin-bottom: 20px;
+margin-bottom: 25px;
 }
 >>> .strategy-form .ivu-col{
   color: #2B8EE2;
@@ -1167,6 +1165,7 @@ margin-bottom: 20px;
 }
 >>> .strategy-form .ivu-col-btn {
   display: flex;
+  justify-content: center;
   align-items: center;
   border-top: none;
   border-bottom: none;

+ 9 - 6
src/views/homecomponents/EquipmentAnalysis/FilteredAlarm.vue

@@ -130,17 +130,15 @@
                     <Tooltip placement="top-start" transfer max-width="350" v-if="val.value || val.value===0">
                       <span v-if="val.name == '设备今日告警'">{{val.value+'次'}}</span>
                       <span v-else-if="val.name == '同比'">
-                        <Icon type="md-arrow-down" style="color: #F32F2F;font-size:20px" v-if="val.value>0"/>
-                        <Icon type="md-arrow-up" style="color: #09CB09;font-size:20px" v-if="val.value<0" />
-                        {{val.value+'%'}}
+                        <Icon type="md-arrow-up" style="color: #09CB09;font-size:20px" v-if="val.value>0"/>
+                        <Icon type="md-arrow-down" style="color: #F32F2F;font-size:20px" v-if="val.value<0" />
+                        {{Math.abs(val.value)+'%'}}
                       </span>
                       <span v-else>{{val.value}}</span>
                       <div slot="content">
                         <span v-if="val.name == '设备今日告警'">{{val.value+'次'}}</span>
                         <span v-else-if="val.name == '同比'">
-                          <Icon type="md-arrow-down" style="color: #F32F2F;font-size:20px" v-if="val.value>0"/>
-                          <Icon type="md-arrow-up" style="color: #09CB09;font-size:20px" v-if="val.value<0" />
-                          {{val.value+'%'}}
+                          {{Math.abs(val.value)+'%'}}
                         </span>
                         <span v-else>{{val.value}}</span>
                       </div>
@@ -388,6 +386,11 @@ export default {
       this.$get('metroapi/dic/queryDictionary', {name:'告警处理状态'}).then(res=>{
         if (res.httpCode == 1 ){
           this.alarmModalStatus = res.data
+          for(let i = 0; i < this.alarmModalStatus.length; i++){
+            if(this.alarmModalStatus[i].value == '无法判定等级'){
+                this.alarmModalStatus.splice(i,1);
+            }
+          }
         } else {
           this.alarmModalStatus = []
         }

+ 97 - 22
src/views/homecomponents/EquipmentAnalysis/LevelDeterConfig.vue

@@ -3,16 +3,6 @@
     <div class="search-list">
       <div class="search-left">
         <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">
             <Select v-model="tableParams.targetCount" placeholder="监测指标数量">
                 <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>
                     <Option v-for="subItem in indicatorsModalData" :value="subItem.id" :key="subItem.id">{{ subItem.targetName }}</Option>
                   </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>
               </Col>
               <Col span="4">
@@ -150,7 +137,7 @@
               </Col>
               <Col span="1" class="row-es-del" v-if="i != 0">
                <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"/>
                 </FormItem>
               </Col>
@@ -159,19 +146,30 @@
           <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">
             <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>
                 <Option v-for="firstitem in alarmLevelModalData" :value="firstitem.id" :key="firstitem.id" :disabled="firstitem.disabled">{{ firstitem.name }}</Option>
               </Select>
             </FormItem>
           </Col>
           <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>
-        </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>
            <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>
@@ -781,6 +779,8 @@ export default {
             this.disabledApp = true
             this.disabledEquip = true
           } else if (this.formCustom.alertStrategyRankDTOList.length==1) {
+            this.disabledApp = false
+            this.disabledEquip = false
             if (this.formCustom.alertStrategyRankDTOList[0].alertStrategyDetailList.length>1) {
               this.disabledApp = true
               this.disabledEquip = true
@@ -838,12 +838,12 @@ export default {
       // })
     },
     editClick (row) {
+      this.clickbtn = 1
       let params = {
         equipmentTypeId: row.equipmentTypeId
       }
       this.getMonitorIndex(params)
       this.getstrategyData(row.id)
-      this.clickbtn = 1
       this.rowObj = row
       this.formOption = JSON.parse(JSON.stringify(row));
       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.$nextTick(()=> {
         this.formCustom.alertStrategyRankDTOList[index].alertStrategyDetailList.splice(i, 1) //因为删除选值的下拉框,没选值的下拉框的值会变成undefined 所以加个状态值(clickbtn=3)
@@ -1099,6 +1148,16 @@ export default {
         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) {
       this.formCustom.alertStrategyRankDTOList[index].alertStrategyDetailList[i].targetId = val
       let targetName = ''
@@ -1364,6 +1423,9 @@ export default {
   overflow: hidden;
   overflow-y: auto;
 }
+>>> .strategy-form {
+  margin-bottom: 30px;
+}
 >>> .strategy-form .ivu-col{
   position: initial;
   color: #2B8EE2;
@@ -1441,6 +1503,9 @@ export default {
 >>> .strategy-form .ivu-col-btn {
   border-top: none;
   border-bottom: none;
+  display: flex; 
+  align-items: center;
+  justify-content: center;
 }
 >>> .sub-add {
   display: flex;
@@ -1461,6 +1526,16 @@ export default {
   display: inline-block;
   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 {
   max-height: 350px;
   overflow: hidden;

+ 9 - 7
src/views/homecomponents/EquipmentAnalysis/ToConfirmedAlarm.vue

@@ -162,17 +162,15 @@
                     <Tooltip placement="top-start" transfer max-width="350" v-if="val.value || val.value===0">
                       <span v-if="val.name == '设备今日告警'">{{val.value+'次'}}</span>
                       <span v-else-if="val.name == '同比'">
-                        <Icon type="md-arrow-down" style="color: #F32F2F;font-size:20px" v-if="val.value>0"/>
-                        <Icon type="md-arrow-up" style="color: #09CB09;font-size:20px" v-if="val.value<0" />
-                        {{val.value+'%'}}
+                        <Icon type="md-arrow-up" style="color: #09CB09;font-size:20px" v-if="val.value>0"/>
+                        <Icon type="md-arrow-down" style="color: #F32F2F;font-size:20px" v-if="val.value<0" />
+                        {{Math.abs(val.value)+'%'}}
                       </span>
                       <span v-else>{{val.value}}</span>
                       <div slot="content">
                         <span v-if="val.name == '设备今日告警'">{{val.value+'次'}}</span>
                         <span v-else-if="val.name == '同比'">
-                          <Icon type="md-arrow-down" style="color: #F32F2F;font-size:20px" v-if="val.value>0"/>
-                          <Icon type="md-arrow-up" style="color: #09CB09;font-size:20px" v-if="val.value<0" />
-                          {{val.value+'%'}}
+                          {{Math.abs(val.value)+'%'}}
                         </span>
                         <span v-else>{{val.value}}</span>
                       </div>
@@ -425,6 +423,11 @@ export default {
       this.$get('metroapi/dic/queryDictionary', {name:'告警处理状态'}).then(res=>{
         if (res.httpCode == 1 ){
           this.alarmModalStatus = res.data
+          for(let i = 0; i < this.alarmModalStatus.length; i++){
+            if(this.alarmModalStatus[i].value == '无法判定等级'){
+                this.alarmModalStatus.splice(i,1);
+            }
+          }
         } else {
           this.alarmModalStatus = []
         }
@@ -563,7 +566,6 @@ export default {
       }
     },
     forwardClick (row) {
-
     },
     // editClick (row) {
     //   this.rowObj = row

+ 6 - 8
src/views/homecomponents/EquipmentAnalysis/UnableDeterAlarm.vue

@@ -3,11 +3,11 @@
     <div class="search-list">
       <div class="search-left">
         <Form class="common-form common-form-list" ref="tableParams" :model="tableParams" inline>
-           <FormItem label="" prop="alertRankId">
+           <!-- <FormItem label="" prop="alertRankId">
             <Select v-model="tableParams.alertRankId" placeholder="告警等级">
               <Option v-for="item in alarmLevelData" :value="item.id" :key="item.id">{{ item.name }}</Option>
             </Select>
-          </FormItem>
+          </FormItem> -->
           <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>
@@ -127,17 +127,15 @@
                     <Tooltip placement="top-start" transfer max-width="350" v-if="val.value || val.value===0">
                       <span v-if="val.name == '设备今日告警'">{{val.value+'次'}}</span>
                       <span v-else-if="val.name == '同比'">
-                        <Icon type="md-arrow-down" style="color: #F32F2F;font-size:20px" v-if="val.value>0"/>
-                        <Icon type="md-arrow-up" style="color: #09CB09;font-size:20px" v-if="val.value<0" />
-                        {{val.value+'%'}}
+                        <Icon type="md-arrow-up" style="color: #09CB09;font-size:20px" v-if="val.value>0"/>
+                        <Icon type="md-arrow-down" style="color: #F32F2F;font-size:20px" v-if="val.value<0" />
+                        {{Math.abs(val.value)+'%'}}
                       </span>
                       <span v-else>{{val.value}}</span>
                       <div slot="content">
                         <span v-if="val.name == '设备今日告警'">{{val.value+'次'}}</span>
                         <span v-else-if="val.name == '同比'">
-                          <Icon type="md-arrow-down" style="color: #F32F2F;font-size:20px" v-if="val.value>0"/>
-                          <Icon type="md-arrow-up" style="color: #09CB09;font-size:20px" v-if="val.value<0" />
-                          {{val.value+'%'}}
+                          {{Math.abs(val.value)+'%'}}
                         </span>
                         <span v-else>{{val.value}}</span>
                       </div>

+ 1 - 1
vue.config.js

@@ -7,7 +7,7 @@ module.exports = {
       open: false,//配置自动启动浏览器 
       proxy: { // 设置代理
       '/metroapi': {
-        target: 'http://192.168.20.188:8088',// http://192.168.20.58:8086 http://192.168.20.188:8088
+        target: 'http://192.168.20.58:8088',// http://192.168.20.58:8086 http://192.168.20.188:8088
         changeOrigin: true, //允许跨域
         pathRewrite: {
             '^/metroapi': ''