liu85600613 3 năm trước cách đây
mục cha
commit
32dd90b11b

+ 0 - 1
ui/src/views/monitor/elec/echart/bottom/bottomLeftChart.vue

@@ -16,7 +16,6 @@ export default {
   mixins: [echartMixins],
   mounted() {
     this.draw();
-    console.log('我是月数据啦啦啦',this.monthData)
   },
   methods: {
     draw() {

+ 0 - 1
ui/src/views/monitor/elec/echart/bottom/bottomRightChart.vue

@@ -17,7 +17,6 @@ export default {
   mounted() {
     this.draw();
     this.charTimg();
-    console.log('weekData:',this.weekData)
   },
   mixins: [echartMixins],
   methods: {

+ 54 - 43
ui/src/views/sems/specanalysis/index.vue

@@ -7,11 +7,7 @@
             <div class="bg-color-spec">
               <div style="text-align: center; padding-top: 0.3rem">
                 <el-select v-model="plantIds"  @change="handleCommand" multiple collapse-tags :placeholder="$t('请选择') + $t('装置')">
-                  <el-option
-                    key="ALL"
-                    label="ALL"
-                    value="ALL">
-                  </el-option>
+                  <el-checkbox v-model="checked" @change="selectAll"> ALL</el-checkbox>
                   <el-option
                     v-for="item in plantList"
                     :key="item.name"
@@ -327,6 +323,7 @@ export default {
   },
   data() {
     return {
+      checked:true,
       waterVisible: true,
       devDatas: {
         ylrqData: {
@@ -388,8 +385,8 @@ export default {
           return obj.name;
         }).join(",").split(',')
         this.plantIds = arrnew
-        this.plantIds.push("ALL")
-        this.oldOptions = this.plantIds
+        // this.plantIds.push("ALL")
+        // this.oldOptions = this.plantIds
         this.getUnitList()
       });
     },
@@ -431,6 +428,16 @@ export default {
         this.devGlPerData()
       });
     },
+    selectAll() {
+      this.plantIds = []
+      if (this.checked) {
+        this.plantList.map((item) => {
+          this.plantIds.push(item.name)
+        })
+      } else {
+        this.plantIds = []
+      }
+    },
     handleCommand(val) {
       this.unitIds = []
       this.getUnitList()
@@ -438,44 +445,48 @@ export default {
         this.plantIds = ['']
       }
       this.devData()
-      let allnames = []
-      //保留所有值
-      for (let item of this.plantList) {
-        allnames.push(item.name)
+      if (val.length === this.plantList.length) {
+        this.checked = true
+      } else {
+        this.checked = false
       }
-      // 用来储存上一次的值,可以进行对比
-      const oldVal = this.oldOptions
-      // 若是全部选择
-      if (val.includes('ALL') && !oldVal.includes('ALL')) {
-        console.log(this.plantList + " -----")
-        this.plantIds = this.plantList.map((obj, index) => {
-          return obj.name;
-        }).join(",").split(',')
-        this.plantIds.push("ALL")
-        this.oldOptions = this.plantIds
-      }
-      // 取消全部选中  上次有 当前没有 表示取消全选
-      if (oldVal.includes('ALL') && !val.includes('ALL')) {
-        this.plantIds = []
-        this.oldOptions = this.plantIds
-      }
-      // 点击非全部选中  需要排除全部选中 以及 当前点击的选项
-      // 新老数据都有全部选中
-      // if (oldVal.includes('ALL') && val.includes('ALL')) {
-      //   const index = val.indexOf('ALL')
-      //   val.splice(index, 1) // 排除全选选项
-      //   this.plantIds = val
-      //   //全选未选 但是其他选项全部选上 则全选选上 上次和当前 都没有全选
-      //   if (!oldVal.includes('ALL') && !val.includes('ALL')) {
-      //     console.log(11)
-      //     if (val.length === allnames.length - 1) {
-      //       this.plantIds = ['ALL'].concat(val)}
-      //   }
-      //   //储存当前最后的结果 作为下次的老数据
-      //   this.oldOptions[0] = this.plantIds
-      // }
-
     },
+    // let allnames = []
+    // //保留所有值
+    // for (let item of this.plantList) {
+    //   allnames.push(item.name)
+    // }
+    // // 用来储存上一次的值,可以进行对比
+    // const oldVal = this.oldOptions
+    // // 若是全部选择
+    // if (val.includes('ALL') && !oldVal.includes('ALL')) {
+    //   console.log(this.plantList + " -----")
+    //   this.plantIds = this.plantList.map((obj, index) => {
+    //     return obj.name;
+    //   }).join(",").split(',')
+    //   this.plantIds.push("ALL")
+    //   this.oldOptions = this.plantIds
+    // }
+    // // 取消全部选中  上次有 当前没有 表示取消全选
+    // if (oldVal.includes('ALL') && !val.includes('ALL')) {
+    //   this.plantIds = []
+    //   this.oldOptions = this.plantIds
+    // }
+    // 点击非全部选中  需要排除全部选中 以及 当前点击的选项
+    // 新老数据都有全部选中
+    // if (oldVal.includes('ALL') && val.includes('ALL')) {
+    //   const index = val.indexOf('ALL')
+    //   val.splice(index, 1) // 排除全选选项
+    //   this.plantIds = val
+    //   //全选未选 但是其他选项全部选上 则全选选上 上次和当前 都没有全选
+    //   if (!oldVal.includes('ALL') && !val.includes('ALL')) {
+    //     console.log(11)
+    //     if (val.length === allnames.length - 1) {
+    //       this.plantIds = ['ALL'].concat(val)}
+    //   }
+    //   //储存当前最后的结果 作为下次的老数据
+    //   this.oldOptions[0] = this.plantIds
+    // }
     handleCommandUnit(unitIds) {
       this.unitIds = unitIds
       if (this.plantIds.length == 0) {