From a7dc80523af0b970764df72fb190c80cf7f8527e Mon Sep 17 00:00:00 2001
From: chenzeping <ChenZeping02609@163.com>
Date: 星期日, 25 四月 2021 17:51:43 +0800
Subject: [PATCH] 废水图表问题修改

---
 src/components/BaseNav/WasteWater/DayData.vue |  297 ++++++++++++++++++-----------------------------------------
 1 files changed, 90 insertions(+), 207 deletions(-)

diff --git a/src/components/BaseNav/WasteWater/DayData.vue b/src/components/BaseNav/WasteWater/DayData.vue
index d087100..35f43e5 100644
--- a/src/components/BaseNav/WasteWater/DayData.vue
+++ b/src/components/BaseNav/WasteWater/DayData.vue
@@ -1,31 +1,31 @@
-<!--  鏃ユ暟鎹�  -->
 <template>
-  <div id="Tab">
+  <div class="echarts-box">
     <div class="tab-scroll">
       <PublicDataStandard :dataStandard="dataStandard"></PublicDataStandard>
-      <span class="time-select">{{ formInline.timeStart }}鏃モ�斺�攞{ formInline.timeEnd }}鏃�</span>
+      <span class="time-select">{{ formData.timeStart }}鈥攞{ formData.timeEnd }}</span>
     </div>
-    <div class="form-echrts">
-      <div class="from-search">
-        <div class="pickerMon">
-          <div class="pickerData">
-            <span>寮�濮嬫椂闂�:</span>
-            <span class="pickerTable">
-              <el-date-picker type="datetime" value-format="yyyy-MM-dd" v-model="formInline.timeStart"></el-date-picker>
-            </span>
-          </div>
-          <div class="pickerData">
-            <span>缁撴潫鏃堕棿:</span>
-            <span class="pickerTable">
-              <el-date-picker type="datetime" value-format="yyyy-MM-dd" v-model="formInline.timeEnd"></el-date-picker>
-            </span>
-          </div>
-        </div>
-        <div class="detailbtn hover-bottom">鏌ヨ</div>
-        <div class="detailbtn hover-bottom">鏄庣粏琛�</div>
-      </div>
-      <div style="width:5rem;height:1.5rem;" id="echarts" ref="echartsday">
-      </div>
+    <div class="echarts-form">
+      <span class="demonstration">寮�濮嬫椂闂达細</span>
+      <el-date-picker
+          v-model="formData.timeStart"
+          value-format="yyyy-MM-dd"
+          type="datetime">
+      </el-date-picker>
+      <span class="demonstration">缁撴潫鏃堕棿锛�</span>
+      <el-date-picker
+          v-model="formData.timeEnd"
+          value-format="yyyy-MM-dd"
+          type="datetime">
+      </el-date-picker>
+      <span class="demonstration">閲囨牱鐐规暟锛�</span>
+      <el-select v-model="formData.region" placeholder="璇烽�夋嫨" style="width: 80px">
+        <el-option v-for="(item,index) in formData.regionList" :key="index" :label="item" :value="item"></el-option>
+      </el-select>
+      <el-button @click="querySearch()">鏌ヨ</el-button>
+      <el-button>鏄庣粏琛�</el-button>
+    </div>
+    <div class="echarts-chart">
+      <div style="width:5rem;height:1.5rem;" ref="echartsday"></div>
     </div>
   </div>
 </template>
@@ -85,13 +85,12 @@
             val: null
           }
         }],
-      formInline: {
-        region: '',
+      formData: {
+        region: '25',
+        regionList: [25, 50, 75, 100],
         timeStart: dayjs().subtract(1, 'month').format('YYYY-MM-DD'),
         timeEnd: dayjs().format('YYYY-MM-DD')
       },
-      timeStart: '',
-      timeEnd: '',
       chart: null,
       dataType: 1,
       jcdID: 1,
@@ -105,15 +104,15 @@
     })
   },
   methods: {
+    querySearch () {
+
+    },
     async draw24Chart () {
-      // 鐢ㄤ簬鎺ュ彛鏁版嵁璇锋眰鐨勫弬鏁� 寮�濮�/缁撴潫鏃堕棿 || 鍙�夋嫨鏌ヨ鐨勫紑濮�/缁撴潫鏃堕棿
-      this.formInline.timeEnd = dayjs().format('YYYY-MM-DD')
-      this.formInline.timeStart = dayjs().subtract(24, 'hours').format('YYYY-MM-DD')
       const data = {
         onLineMonEmissPointId: 23,
         monItemId: 28,
-        beginTime: this.formInline.timeStart,
-        endTime: this.formInline.timeEnd,
+        beginTime: this.formData.timeStart,
+        endTime: this.formData.timeEnd,
         dataType: this.dataType
       }
       const result = (await mapApi.getQueryOnlineMonData(data)).Result.DataInfo
@@ -287,6 +286,7 @@
     },
     effChartShow (divid, title, legend, xdata, ydatas, yname, jcdID, datatype) {
       this.chart = this.$echarts.init(this.$refs.echartsday)
+      this.chart.clear()
       // console.log(this.chart)
       this.chart.clear()
       var dataUnit = ''
@@ -295,9 +295,10 @@
       } else {
         dataUnit = '娴侀噺(m鲁/h)'
       }
+      const bzzList = this.bzzList
       var serLists = []
       for (var i = 0; i < ydatas.length; i++) {
-        // var zdcbcolor = ydatas[i].zdcbcolor
+        var zdcbcolor = ydatas[i].zxcolor
         var bz = ydatas[i].bzz
         var obj
         if (bz) {
@@ -306,34 +307,34 @@
             symbol: 'circle', // 鎶樼偣褰㈢姸
             symbolSize: 10, // 澶у皬
             smooth: false, // 鐩寸嚎 锛宼rue 涓烘洸绾�
-            // itemStyle: {
-            //   normal: {
-            //     color: function (c) { // 鏍规嵁value 鏄剧ず涓嶅悓鐨勬姌鐐归鑹�
-            //       // var biaozhuiz
-            //       let bzlist = this.bzzList
-            //       for (let i = 0; i < this.bzzList.length; i++) {
-            //         if (this.bzzList[i].name === c.seriesName) {
-            //           this.bz = this.bzzList[i].bzhui
-            //         }
-            //       }
-            //       if (c.value > this.bz) {
-            //         return zdcbcolor
-            //       } else if (c.value > this.bz * 0.9) {
-            //         return '#FFA500'
-            //       } else {
-            //         return '#33c95f'
-            //       }
-            //     },
-            //     lineStyle: { // 鎶樼嚎鐨勯鑹�
-            //       color: ydatas[i].zxcolor,
-            //       width: 5
-            //     },
-            //     borderColor: 'black', // 鎶樼偣杈规鐨勯鑹�
-            //     label: { // 鏄剧ず鍊�
-            //       show: false
-            //     }
-            //   }
-            // },
+            itemStyle: {
+              normal: {
+                // color: function (c) { // 鏍规嵁value 鏄剧ず涓嶅悓鐨勬姌鐐归鑹�
+                //   // var biaozhuiz
+                //   let bzlist = this.bzzList
+                //   for (let i = 0; i < this.bzzList.length; i++) {
+                //     if (this.bzzList[i].name === c.seriesName) {
+                //       this.bz = this.bzzList[i].bzhui
+                //     }
+                //   }
+                //   if (c.value > this.bz) {
+                //     return zdcbcolor
+                //   } else if (c.value > this.bz * 0.9) {
+                //     return '#FFA500'
+                //   } else {
+                //     return '#33c95f'
+                //   }
+                // },
+                lineStyle: { // 鎶樼嚎鐨勯鑹�
+                  color: ydatas[i].zxcolor,
+                  width: 5
+                },
+                borderColor: 'black', // 鎶樼偣杈规鐨勯鑹�
+                label: { // 鏄剧ず鍊�
+                  show: false
+                }
+              }
+            },
             type: 'line',
             data: ydatas[i].data,
             markLine: { // 骞冲潎鍊� 锛� 鍜� 鎸囨爣涓婇檺
@@ -363,31 +364,33 @@
             symbolSize: 10, // 澶у皬
             smooth: false, // 鐩寸嚎 锛宼rue 涓烘洸绾�
             yAxisIndex: 1,
-            // itemStyle: {
-            //   normal: {
-            //     color: function (c) { // 鏍规嵁value 鏄剧ず涓嶅悓鐨勬姌鐐归鑹�
-            //       // var biaozhuiz
-            //       for (let i = 0; i < this.bzzList.length; i++) {
-            //         if (this.bzzList[i].name === c.seriesName) {
-            //           this.bz = this.bzzList[i].bzhui
-            //         }
-            //       }
-            //       if (c.value > 9999999) {
-            //         return zdcbcolor
-            //       } else {
-            //         return '#33c95f'
-            //       }
-            //     },
-            //     lineStyle: { // 鎶樼嚎鐨勯鑹�
-            //       color: ydatas[i].zxcolor,
-            //       width: 5
-            //     },
-            //     borderColor: 'black', // 鎶樼偣杈规鐨勯鑹�
-            //     label: { // 鏄剧ず鍊�
-            //       show: false
-            //     }
-            //   }
-            // },
+            itemStyle: {
+              normal: {
+                color: function (c) { // 鏍规嵁value 鏄剧ず涓嶅悓鐨勬姌鐐归鑹�
+                  let biaozhuiz
+                  for (let i = 0; i < bzzList.length; i++) {
+                    if (bzzList[i].name === c.seriesName) {
+                      biaozhuiz = bzzList[i].bzhui
+                    }
+                  }
+                  if (c.value[1] > biaozhuiz) {
+                    return zdcbcolor
+                  } else if (c.value[1] > biaozhuiz * 0.9) {
+                    return '#FFA500'
+                  } else {
+                    return '#33c95f'
+                  }
+                },
+                lineStyle: { // 鎶樼嚎鐨勯鑹�
+                  color: ydatas[i].zxcolor,
+                  width: 5
+                },
+                borderColor: 'black', // 鎶樼偣杈规鐨勯鑹�
+                label: { // 鏄剧ず鍊�
+                  show: false
+                }
+              }
+            },
             type: 'line',
             data: ydatas[i].data
           }
@@ -563,124 +566,4 @@
 
 <style scoped lang="less">
 
-.animation {
-  .infomation {
-    padding: 0.02rem 0.04rem;
-
-    .grid-content {
-      font-size: 0.08rem;
-      background-color: #2e4967;
-      text-align: center;
-      border-radius: 0.01rem;
-      height: 0.15rem;
-      line-height: 0.15rem;
-      margin-right: 0.04rem;
-      padding: 0 0.04rem
-    }
-  }
-}
-
-.tab-scroll {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-
-  .time-select {
-    cursor: pointer;
-    padding: 5px;
-    border: 1px solid #2b87c8;
-    border-radius: 4px;
-    text-align: center;
-    color: #fff;
-    font-size: 11px;
-    width: 280px;
-  }
-}
-
-.form-echrts {
-  width: 100%;
-  border-top: 1px solid #396d83;
-  //margin: 10px 10px 10px 10px;
-  .from-search {
-    display: flex;
-    padding: 15px 0;
-
-    > div {
-      margin-left: 10px
-    }
-
-    .pickerMon {
-      display: flex;
-
-      > div:first-child {
-        margin-right: 10px;
-      }
-
-      .pickerData {
-        flex: 1;
-        display: flex;
-
-        > span {
-          line-height: 22px;
-          margin-right: 15px;
-        }
-
-        .pickerTable {
-          margin-left: 3px;
-        }
-      }
-    }
-
-    /deep/ .el-date-editor--datetime {
-      width: 100%;
-    }
-
-    /deep/ .el-input__inner {
-      position: relative;
-      width: 1rem;
-      background-color: #2e4967;
-      color: #fff;
-      font-size: 0.08rem;
-      height: 0.15rem;
-      padding: 0;
-      border: none;
-      text-align: center;
-      z-index: 9999;
-      //padding-left:20px ;
-      //padding: 0!important;
-    }
-
-    /deep/ .el-input__icon {
-      display: block;
-      width: 1rem;
-      height: 0.15rem;
-      line-height: 0.15rem;
-      cursor: pointer;
-      font-size: 0;
-    }
-
-    input::-webkit-calendar-picker-indicator {
-      opacity: 100;
-    }
-
-    .detailbtn {
-      background-color: #2e4967;
-      text-align: center;
-      padding: 0 7px;
-      height: 0.15rem;
-      line-height: 0.15rem;
-      border-radius: 4px;
-      margin-right: 6px;
-    }
-  }
-
-  .el-dialog-div {
-    overflow: auto;
-  }
-
-  #echarts {
-    margin: 0;
-    padding: 0;
-  }
-}
 </style>

--
Gitblit v1.8.0