From 3a8223b71d18205d40b894fd0b4c0fa1ca773e86 Mon Sep 17 00:00:00 2001
From: Lius <Lius2225@163.com>
Date: 星期一, 13 十一月 2023 10:44:11 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/mdc-test' into mdc-test

---
 src/views/mdc/base/modules/StatisticsChart/StatisticsLegend.vue |  187 ++++++++++++++++++++++++++++------------------
 1 files changed, 112 insertions(+), 75 deletions(-)

diff --git a/src/views/mdc/base/modules/StatisticsChart/StatisticsLegend.vue b/src/views/mdc/base/modules/StatisticsChart/StatisticsLegend.vue
index 050ac85..f861422 100644
--- a/src/views/mdc/base/modules/StatisticsChart/StatisticsLegend.vue
+++ b/src/views/mdc/base/modules/StatisticsChart/StatisticsLegend.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">
@@ -230,26 +230,25 @@
               containLabel: true
             },
           legend:{
-            //璁剧疆榛樿涓嶆樉绀�
-            selected:{
-                "鏇茬嚎":false,
-            },
+            // selected:{
+            //     "鏇茬嚎":false,
+            // },
             top:'0',
             right:'10',
             //璁剧疆鍗曢�夊閫夋ā寮�
-            selectedMode:'single',
+            // selectedMode:'single',
             icon:"pin",
             data:[
-              {
-                name:'鏇茬嚎',
-                textStyle:{
-                  padding:4,
-                  color:'#e957ff',
-                  // borderWidth:1,
-                  fontSize:16,
-                  // borderColor:'#50E6D7'
-                }
-              },
+              // {
+              //   name:'鏇茬嚎',
+              //   textStyle:{
+              //     padding:4,
+              //     color:'#e957ff',
+              //     // borderWidth:1,
+              //     fontSize:16,
+              //     // borderColor:'#50E6D7'
+              //   }
+              // },
               {
                 name:'鏌辩姸鍥�',
                 textStyle:{
@@ -306,52 +305,53 @@
               }
             },
             series:[
-              {
-              name:'鏇茬嚎',
-              type: 'line',
-              smooth:true,
-              symbol: 'circle',
-              symbolSize: 8,
-              label:{
-                show:true,
-                position:"top",
-                textStyle:{
-                  color:'#000',
-                },
-                formatter:"鏃堕暱锛歿c}H"
-              },
-              itemStyle: {
-                color: "rgb(87, 120, 225)",
-                borderColor: "#fff",
-                borderWidth: 2,
-                shadowColor: 'rgba(0, 0, 0, .3)',
-              },
-              lineStyle: {
-                normal: {
-                  color:"rgb(87, 120, 225)",
-                  shadowColor: 'rgba(87, 120, 225, .4)',
-                  shadowBlur: 8,
-                  shadowOffsetY: 10,
-                  shadowOffsetX: 0,
-                },
-              },
-              areaStyle: {
-                normal: {
-                  color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
-                    offset: 0,
-                    color: 'rgba(87, 120, 225, .6)'
-                  }, {
-                    offset: 1,
-                    color: 'rgba(87, 120, 225, .3)'
-                  }]),
-                }
-              },
-              data: [this.openingLong, this.closedLong, this.processLong,this.waitingLong],
-            },
+            //   {
+            //   name:'鏇茬嚎',
+            //   type: 'line',
+            //   smooth:true,
+            //   symbol: 'circle',
+            //   symbolSize: 8,
+            //   label:{
+            //     show:true,
+            //     position:"top",
+            //     textStyle:{
+            //       color:'#000',
+            //     },
+            //     formatter:"鏃堕暱锛歿c}H"
+            //   },
+            //   itemStyle: {
+            //     color: "rgb(87, 120, 225)",
+            //     borderColor: "#fff",
+            //     borderWidth: 2,
+            //     shadowColor: 'rgba(0, 0, 0, .3)',
+            //   },
+            //   lineStyle: {
+            //     normal: {
+            //       color:"rgb(87, 120, 225)",
+            //       shadowColor: 'rgba(87, 120, 225, .4)',
+            //       shadowBlur: 8,
+            //       shadowOffsetY: 10,
+            //       shadowOffsetX: 0,
+            //     },
+            //   },
+            //   areaStyle: {
+            //     normal: {
+            //       color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
+            //         offset: 0,
+            //         color: 'rgba(87, 120, 225, .6)'
+            //       }, {
+            //         offset: 1,
+            //         color: 'rgba(87, 120, 225, .3)'
+            //       }]),
+            //     }
+            //   },
+            //   data: [this.openingLong, this.closedLong, this.processLong,this.waitingLong],
+            // },
               {
                 name:'鏌辩姸鍥�',
                 type: 'bar',
                 data: [this.openingLong, this.closedLong, this.processLong,this.waitingLong],
+                // data:[22,3,5,6],
                 barWidth: 25,
                 label:{
                   show:true,
@@ -359,16 +359,21 @@
                   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: {
                     color: function(params) {
                       let colorList = [
                         ["#6496e9","#6bded3"],
-                        ["#ffbb65","#fdc68b"],
+                        ["#849db8","#b4b8cc"],
                         ["#4fe1c5","#4ecee1"],
-                        ["#9978fa","#88a1fa"],
+                        // ["#9978fa","#88a1fa"],
+                        ["#ffbb65","#fdc68b"],
                       ];
                       // return colorList[params.dataIndex];
                       let colorItem = colorList[params.dataIndex];
@@ -447,13 +452,26 @@
             {
             type: 'bar',
             data: [this.openingLong,this.totalLong],
+              // data:[22,22],
             barWidth: 25,
+              label:{
+                show:true,
+                position:"top",
+                textStyle:{
+                  color:'#000',
+                },
+                // 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: {
                 color: function(params) {
                   let colorList = [
                     ["#6496e9","#6bded3"],
-                    ["#ffbb65","#fdc68b"],
+                    ["#9978fa","#88a1fa"],
                   ];
                   // return colorList[params.dataIndex];
                   let colorItem = colorList[params.dataIndex];
@@ -531,13 +549,26 @@
           series: [{
             type: 'bar',
             data: [this.processLong,this.openingLong],
+            // data:[22,22],
             barWidth: 25,
+            label:{
+              show:true,
+              position:"top",
+              textStyle:{
+                color:'#000',
+              },
+              // 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: {
                 color: function(params) {
                   let colorList = [
                     ["#4fe1c5","#4ecee1"],
-                    ["#9978fa","#88a1fa"],
+                    ["#6496e9","#6bded3"],
                   ];
                   // return colorList[params.dataIndex];
                   let colorItem = colorList[params.dataIndex];
@@ -558,14 +589,14 @@
         StartupLine.setOption(StartupLine_option);
       },
       queryStatistical(){
+        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.StatCharUsedopeningRate = res.result.usedOpenRate;
+              this.StartupHeight = res.result.usedOpenRate;
               this.openingLong = this.getTime(res.result.openLong)
               this.waitingLong = this.getTime(res.result.waitLong);
               this.processLong = this.getTime(res.result.processLong);
@@ -574,19 +605,29 @@
               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(id) {
         let _this = this
         getAction(this.url.getBaseTree).then((res) => {
           if (res.success) {
+            if(res.result[0]){
+              _this.$set(this.queryParam, 'tierName', res.result[0].title)
+            }
             // console.log(res.result[0].entity.tierName)
-            _this.$set(this.queryParam, 'tierName', res.result[0].title)
+
           } else {
             // this.$message.warn(res.message)
             this.$notification.warning({
@@ -615,7 +656,7 @@
         this.queryParam = {}
         this.queryParams = {}
         // this.dates = []
-        this.queryStatistical()
+        // this.queryStatistical()
         // this.onClearSelected()
       },
       searchQuery(){
@@ -630,18 +671,14 @@
             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();
-
-
       }
 
   }

--
Gitblit v1.9.3