Преглед на файлове

五损扇形图信息修改

lizaixun преди 4 години
родител
ревизия
648f2def2b
променени са 2 файла, в които са добавени 27 реда и са изтрити 14 реда
  1. 5 9
      src/views/benchMarking/FiveLossRates.vue
  2. 22 5
      src/views/benchMarking/FiveLossRatesPieChart.vue

+ 5 - 9
src/views/benchMarking/FiveLossRates.vue

@@ -14,12 +14,14 @@
             </el-select>
             </el-form-item>
             <el-form-item label="分类">
-              <el-select v-model="value2"  placeholder="请选择">
+              <el-select v-model="value2"  
+              @change="queryApData()" placeholder="请选择">
               <el-option
                 v-for="item in classification"
                 :key="item.label"
                 :label="item.label"
-                :value="item.id">
+                :value="item.id"
+              >
               </el-option>
             </el-select>
             </el-form-item>
@@ -511,10 +513,6 @@ export default {
     },
     queryApData() {
       this.FiveLossInformation();
-      // if (this.formInline.line == "") {
-      //   this.$message.error("请选择路线!");
-      //   return;
-      // }
     },
     handleEdit(a,b){
       this.wpId = [];
@@ -643,7 +641,6 @@ export default {
         this.beginDate = this.timedate[0];
         this.endDate = this.timedate[1];
       }
-      console.log(this.isAsc)
       var fiveLossData = new URLSearchParams();
         fiveLossData.append('pageNum',this.currentPage2);
         fiveLossData.append('pageSize',this.pagesize);
@@ -654,8 +651,7 @@ export default {
         fiveLossData.append('endDate',this.endDate);
       this.$http.post('/contrast/benchmarkLossList',fiveLossData).then((res) => {
           that.gridData = res.data.data;
-          // console.log(that.gridData);
-          that.$refs.FiveLossRatesPieChart.getPackageData(that.gridData);
+          that.$refs.FiveLossRatesPieChart.getPackageData(that.gridData,that.value2);
           that.$refs.FiveLossRatesHistogramChart.getPackageData2(that.gridData);
       })
     },

+ 22 - 5
src/views/benchMarking/FiveLossRatesPieChart.vue

@@ -10,14 +10,31 @@ export default {
     data(){
         return{
             getChartDataValue:[],
-            getChartDataValue2:[]
+            getChartDataValue2:[],
+            chartsAName2:''
         }
     },
     methods:{
-        getPackageData(gridData){
+        getPackageData(gridData,value2){
+            console.log(value2)
             for(let i=0;i<gridData.length;i++){
-                this.getChartDataValue.push({value:gridData[i].fdl,name:gridData[i].wpName})
-                this.getChartDataValue2.push({value:gridData[i].gzss,name:gridData[i].wpName})
+                this.getChartDataValue.push({value:gridData[i].fdl,name:gridData[i].wpName});
+                if(value2 == 'gz'){
+                    this.chartsAName2 = '故障损失占比';
+                    this.getChartDataValue2.push({value:gridData[i].gzss,name:gridData[i].wpName});
+                }else if(value2 == 'xn'){
+                    this.chartsAName2 = '性能损失占比';
+                    this.getChartDataValue2.push({value:gridData[i].qfss,name:gridData[i].wpName});
+                }else if(value2 == 'qf'){
+                    this.chartsAName2 = '弃风率占比';
+                    this.getChartDataValue2.push({value:gridData[i].qfl,name:gridData[i].wpName});
+                }else if(value2 == 'jx'){
+                    this.chartsAName2 = '检修损失占比';
+                    this.getChartDataValue2.push({value:gridData[i].whss,name:gridData[i].wpName});
+                }else if(value2 == 'sl'){
+                    this.chartsAName2 = '受累损失占比';
+                    this.getChartDataValue2.push({value:gridData[i].slss,name:gridData[i].wpName});
+                }
             }
             this.getChartDataImport();
             this.getChartDataValue = [];
@@ -59,7 +76,7 @@ export default {
         var charts2 = echarts.init(document.getElementById("chartPieRight"))
         let option2 = {
             title: {
-                text: '故障损失占比',
+                text: this.chartsAName2,
                 left: 'center'
             },
             color:['#90ED7D', '#F7A35C', '#7CB5EC','#434348','#8085E9'],