From 997835429a1d66643364091e8437ebbbeb8ff97a Mon Sep 17 00:00:00 2001
From: zenglf <18502938215@163.com>
Date: 星期四, 28 九月 2023 14:09:58 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into develop

---
 src/views/mdc/base/modules/StatisticalAnalysis/StatisticalAnalysisMain.vue |   94 ++++++++++++++++++++++++++++------------------
 1 files changed, 57 insertions(+), 37 deletions(-)

diff --git a/src/views/mdc/base/modules/StatisticalAnalysis/StatisticalAnalysisMain.vue b/src/views/mdc/base/modules/StatisticalAnalysis/StatisticalAnalysisMain.vue
index bdfde0f..64d02ca 100644
--- a/src/views/mdc/base/modules/StatisticalAnalysis/StatisticalAnalysisMain.vue
+++ b/src/views/mdc/base/modules/StatisticalAnalysis/StatisticalAnalysisMain.vue
@@ -14,7 +14,7 @@
               <a-date-picker v-model="queryParams.collectTime" :disabledDate="disabledDate" format='YYYY-MM-DD' @change="dataChange"/>
             </a-form-item>
           </a-col>
-          <a-col :md="3" :sm="3" :xs="3">
+          <a-col :md="2" :sm="2" :xs="2">
             <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button>
           </a-col>
           <a-col :md="2" :sm="2" :xs="2">
@@ -269,7 +269,11 @@
                 textStyle:{
                   color:'#000',
                 },
-                formatter:"鏃堕暱锛歿c}H"
+                // formatter:"鏃堕暱锛歿c}H",
+                formatter:params=>{
+                  const value=String(params.value)
+                  return value.length==2&&value[0]==='0'?`鏃堕暱锛�${value.slice(1)}H`:`鏃堕暱锛�${value}H`
+                }
               },
               itemStyle: {
                 normal: {
@@ -312,7 +316,11 @@
           // },
           tooltip: {
             trigger: 'item',
-            formatter: "{a} <br/>{b} : {c} ({d}%)"
+            // formatter: "{a} <br/>{b} : {c} ({d}%)"锛�
+            formatter:params=>{
+              const value=String(params.value)
+              return value.length==2&&value[0]==='0'?`${params.seriesName}<br/>${params.name}锛�${value.slice(1)}H锛�${params.percent}%锛塦:`${params.seriesName}<br/>${params.name}锛�${value}H锛�${params.percent}%锛塦
+            }
           },
           legend: {
             orient: 'vertical',
@@ -335,7 +343,12 @@
                 label: {
                   show: true,
                   position: 'top',
-                  formatter: '{b}\n{c}'
+                  // formatter: '{b}\n{c}',
+                  // formatter:params=>String(params.value).length==2?params.name+String(params.value).slice(1):params.name+String(params.value)
+                  formatter:params=>{
+                    const value=String(params.value)
+                    return value.length==2&&value[0]==='0'?params.name+' '+value.slice(1)+'H':params.name+' '+value+'H'
+                  }
                 }
               }
             },
@@ -354,7 +367,11 @@
           // },
           tooltip: {
             trigger: 'item',
-            formatter: "{a} <br/>{b} : {c} ({d}%)"
+            // formatter: "{a} <br/>{b} : {c} ({d}%)",
+            formatter:params=>{
+              const value=String(params.value)
+              return value.length==2&&value[0]==='0'?`${params.seriesName}<br/>${params.name}锛�${value.slice(1)}H锛�${params.percent}%锛塦:`${params.seriesName}<br/>${params.name}锛�${value}H锛�${params.percent}%锛塦
+            }
           },
           legend: {
             orient: 'vertical',
@@ -377,7 +394,11 @@
                 label: {
                   show: true,
                   position: 'top',
-                  formatter: '{b}\n{c}'
+                  // formatter: '{b}\n{c}',
+                  formatter:params=>{
+                    const value=String(params.value)
+                    return value.length==2&&value[0]==='0'?params.name+' '+value.slice(1)+'H':params.name+' '+value+'H'
+                  }
                 }
               }
             },
@@ -388,32 +409,38 @@
         StartupLine.setOption(statChartPieOption2);
       },
       queryStatistical(){
-        getAction(this.url.dayStatisticalRate,this.queryParams).then(res =>{
-          if(res.success) {
-            // console.log(res);
-            this.StatCharOpeningRate = res.result.openRate;
-            //鍒╃敤鐜�
-            this.StatCharUsedRate = res.result.utilizationRate;
-            //寮�鏈虹巼
-            this.UtilizationHeight = res.result.openRate;
-            this.StatCharUsedopeningRate = res.result.StartupHeight;
-            this.StartupHeight = res.result.StartupHeight;
-            this.openingLong = this.getTime(res.result.openLong)
-            this.waitingLong = this.getTime(res.result.waitLong);
-            this.processLong = this.getTime(res.result.processLong);
-            this.closedLong = this.getTime(res.result.closeLong);
-            this.totalLong = parseInt(this.openingLong) + parseInt(this.closedLong);
-            this.draw();
-          }else{
-            this.draw()
-          }
-        })
+        if(this.queryParams.collectTime){
+          getAction(this.url.dayStatisticalRate,this.queryParams).then(res =>{
+            if(res.success) {
+              // console.log(res);
+              this.StatCharOpeningRate = res.result.openRate;
+              //鍒╃敤鐜�
+              this.StatCharUsedRate = res.result.utilizationRate;
+              //寮�鏈虹巼
+              this.UtilizationHeight = res.result.openRate;
+              this.StatCharUsedopeningRate = res.result.StartupHeight;
+              this.StartupHeight = res.result.StartupHeight;
+              this.openingLong = this.getTime(res.result.openLong)
+              this.waitingLong = this.getTime(res.result.waitLong);
+              this.processLong = this.getTime(res.result.processLong);
+              this.closedLong = this.getTime(res.result.closeLong);
+              this.totalLong = parseInt(this.openingLong) + parseInt(this.closedLong);
+              this.draw();
+            }
+          })
+        }else{
+          this.$notification.warning({
+            message:'娑堟伅',
+            description:'璇烽�夋嫨鏃堕棿'
+          })
+        }
       },
       dataChange(val) {
         this.queryParam.collectTime1 = "";
-        this.queryParams.dateTime = val.format('YYYYMMDD')
-        this.queryParams.collectTime = val.format('YYYY-MM-DD');
-
+        if(val){
+          this.queryParams.dateTime = val.format('YYYYMMDD')
+          this.queryParams.collectTime = val.format('YYYY-MM-DD');
+        }
       },
       initEquipmentNode() {
         let _this = this
@@ -453,7 +480,7 @@
         this.queryParam = {}
         this.queryParams = {}
         // this.dates = []
-        this.queryStatistical()
+        // this.queryStatistical()
         // this.onClearSelected()
       },
       searchQuery(){
@@ -462,26 +489,19 @@
     },
     watch: {
       equip(val) {
-        // console.log(val);
         if (val && val.equipmentId) {
           this.$set(this.queryParam, 'tierName', val.title)
           this.$set(this.queryParam, 'equipmentId', val.equipmentId)
           this.queryParams.parentId = ''
           this.queryParams.equipmentId = val.equipmentId
-          this.searchQuery()
         }else{
           this.queryParams.parentId = val.key
           this.queryParams.equipmentId = ''
           this.$set(this.queryParam, 'tierName', val.title)
-          this.searchQuery()
         }
         this.searchQuery()
       }
-      // this.searchQuery();
-
-
     }
-
   }
 </script>
 

--
Gitblit v1.9.3