export default {
  data() {
    return {
      getChartDataValue: [],
      getChartDataValue2: [],
      chartsAName2: "",
    };
  },
  methods: {
    getPackageData(gridData, value2) {
      this.getChartDataValue = [];
      this.getChartDataValue2 = [];
      console.log(value2);
      for (let i = 0; i < gridData.length; i++) {
        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();
      
    },
    getChartDataImport() {
      // console.log(this.getChartDataValue)
      this.ECLZX.getFiveLossSectorLeft("chartPie",this.getChartDataValue);
      this.ECLZX.getFiveLossSectorRight("chartPieRight",this.chartsAName2,this.getChartDataValue2);
      
    },
  },
};