浏览代码

'改自定义规则'

魏志佳 4 年之前
父节点
当前提交
d0e6abf90c

+ 1 - 1
src/views/modules/Statistics/components/Treeselect.vue

@@ -90,7 +90,7 @@ export default {
             if (this.multiple) {
               this.value = []
             } else {
-              this.value = ''
+              this.value = undefined
             }
           }else{
             this.value=this.appId

+ 35 - 30
src/views/modules/autoRules/autoRulesList.vue

@@ -3,7 +3,7 @@
         <div class="tabBody">
             <a-tabs v-model="tabKey" @change="tabChange">
                 <a-tab-pane key="1" tab="规则管理"></a-tab-pane>
-                <!-- <a-tab-pane key="2" tab="运行记录" ></a-tab-pane> -->
+                <a-tab-pane key="2" tab="运行记录" ></a-tab-pane>
             </a-tabs>
         </div>
         <div class="tableBody">
@@ -92,11 +92,10 @@ let existColumns=[
     },
     {
         title: '创建者',
-        dataIndex: 'userName',
-        align: 'center',
-        
-        key: 'userName',
-        scopedSlots: { customRender: 'userName' }
+        dataIndex: 'createrName',
+        align: 'center',      
+        key: 'createrName',
+        scopedSlots: { customRender: 'createrName' }
     },
     {
         title: '操作',
@@ -113,39 +112,39 @@ let recordsColumns=[
    
     {
         title: '规则名称',
-        dataIndex: 'name',
+        dataIndex: 'eventRuleName',
         align: 'center',
         
-        key: 'name',
-        scopedSlots: { customRender: 'name' }
+        key: 'eventRuleName',
+        scopedSlots: { customRender: 'eventRuleName' }
     },
     {
         title: '运行时间',
-        dataIndex: 'time',
+        dataIndex: 'runningTime',
         align: 'center',
-        key: 'time',
-        scopedSlots: { customRender: 'time' }
+        key: 'runningTime',
+        scopedSlots: { customRender: 'runningTime' }
     },
     {
         title: '运行对象',
-        dataIndex: 'runObject',
+        dataIndex: 'accountName',
         align: 'center',
-        key: 'runObject',
-        scopedSlots: { customRender: 'runObject' }
+        key: 'accountName',
+        scopedSlots: { customRender: 'accountName' }
     },
     {
         title: '满足条件',
-        dataIndex: 'meetCondition',
+        dataIndex: 'alarmCondition',
         align: 'center',      
-        key: 'meetCondition',
-        scopedSlots: { customRender: 'meetCondition' }
+        key: 'alarmCondition',
+        scopedSlots: { customRender: 'alarmCondition' }
     },
     {
         title: '运行结果',
-        dataIndex: 'result',
+        dataIndex: 'processMethod',
         align: 'center',       
-        key: 'result',
-        scopedSlots: { customRender: 'result' }
+        key: 'processMethod',
+        scopedSlots: { customRender: 'processMethod' }
     },
 ]
 
@@ -179,9 +178,9 @@ export default {
                 }
             },
             url:{
-                OverTime:'/oa/wechatNoList/selectOverTimePage',
-                abnormal:'/oa/wechatNoList/selectNoListPage',
-                allData:'/oa/wechatCheckinData/queryPageList'
+                
+                existUrl:'/alarm/alarmEventRule/list',
+                resultRecordUrl:'/alarm/alarmEventRule/getRunningRecords'
             },
         }
     },
@@ -192,11 +191,15 @@ export default {
         },
         tabChange(key){
             console.log(key);
+            let url=''
             if(key=='1'){
                 this.columns=[...existColumns]
+                url=this.url.existUrl
             }else{
                  this.columns=[...recordsColumns]
+                 url=this.url.resultRecordUrl
             }
+            this.getTableListHttp(url)
         },
         createNewRule(){
             this.$router.push('/newBlankRule')
@@ -206,7 +209,9 @@ export default {
             this.ipagination.current=pagination.current;
 
             this.ipagination.pageSize=pagination.pageSize;
-            this.search()
+            let url=this.tabKey=='1'?this.url.existUrl:this.url.resultRecordUrl
+            
+            this.getTableListHttp(url)
         },
         editRule(record){
             console.log(record);
@@ -223,7 +228,7 @@ export default {
             }).then(res=>{
                 console.log(res);
                 if(res.success){
-                    this.getTableListHttp()
+                    this.getTableListHttp(this.url.existUrl)
                 }else{
                     this.$message.error('删除失败')
                 }
@@ -262,10 +267,10 @@ export default {
             })
         },
 
-        getTableListHttp(){
+        getTableListHttp(url){
             this.data=[];
             this.loading=true;
-            let url='/alarm/alarmEventRule/list'
+            // let url='/alarm/alarmEventRule/list'
             getAction(url,{
                 pageNo:this.ipagination.current,
                 pageSize:this.ipagination.pageSize
@@ -287,10 +292,10 @@ export default {
     },
 
     mounted(){
-        this.getTableListHttp()
+        this.getTableListHttp(this.url.existUrl)
     },
     activated(){
-        this.getTableListHttp()
+        this.getTableListHttp(this.url.existUrl)
     }
 }
 

+ 5 - 4
src/views/modules/autoRules/newBlankRule.vue

@@ -188,11 +188,11 @@
                                                 <span style="margin-left:8px;line-height:32px">元</span>
                                             </div> -->
                                             
-                                            <div class="rules-list-item-subject" v-if="item.judgeMethod=='BETWEEN'">
+                                            <div class="rules-list-item-subject" v-if="item.judgeMethod=='BETWEEN'" style="margin-right:5px">
                                                 <a-input-number :min="0" style="width:100%" :max="9999999.99" :step="1" v-model="item.minThreshold" placeholder="请输入" @blur="inputCheck" />
-                                                <span style="margin-left:8px;line-height:32px">{{item.metricValueCode | handlerDANWEI }}</span>
+                                                <!-- <span style="margin-left:8px;line-height:32px">{{item.metricValueCode | handlerDANWEI }}</span> -->
                                             </div>
-                                            <span style="margin-right:20px" v-if="item.judgeMethod=='BETWEEN'">-</span>
+                                            <span style="margin-right:5px" v-if="item.judgeMethod=='BETWEEN'">~</span>
                                             <div class="rules-list-item-subject" >
                                                <a-input-number :min="0" style="width:100%" :max="9999999.99" :step="1" v-model="item.threshold" placeholder="请输入" />
                                                <span style="margin-left:8px;line-height:32px">{{item.metricValueCode | handlerDANWEI }}</span>
@@ -557,7 +557,7 @@ export default {
             rulesList=this.rulesFieldList.filter(item=>{
                 return item.metricValueCode==value
             })[0]
-            console.log(rulesList);rulesList
+            console.log(rulesList);
             this.rulesList=[]
             rulesList.childs.forEach((ele,index)=>{
                 this.rulesList.push({
@@ -640,6 +640,7 @@ export default {
                 if (valid) {
                     // this.form.rulesList=this.rulesList;
                     console.log(valid,this.form);
+                    
                     this.saveLoading=true;
                     let params ={accountId:this.form.applyAccount,alarmEventMetric:this.rulesList,...this.form}
                     if(this.currentRuleId){

+ 2 - 2
vue.config.js

@@ -74,12 +74,12 @@ module.exports = {
         // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目  祚云
 
         // target: 'http://192.168.1.74:8098', //请求本地 需要jeecg-boot后台项目  毕洁泉
-        target: 'http://192.168.1.43:8088', //请求本地 需要jeecg-boot后台项目  毕洁泉
+        // target: 'http://192.168.1.43:8088', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.0.252:8098', //请求本地 需要jeecg-boot后台项目  毕洁泉
         
         // target: 'http://192.168.0.170:8088', //请求本地 需要jeecg-boot后台项目  毕洁泉
 
-        // target: 'http://192.168.1.219:8080', //请求本地 需要jeecg-boot后台项目  赵西安
+        target: 'http://192.168.1.219:8080', //请求本地 需要jeecg-boot后台项目  赵西安
 
 
         //  target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目