import * as echarts from "echarts";
export default {
  data() {
    return {
      pickerOptions: {
        disabledDate(time) {
          return time.getTime() > Date.now();
        },
        },
      tableData: [],
      date_1: "",
      currentPage2: 1,
      pagesize: 10,
      isAsc:'asc',
      orderByColumn:'',
      wpIdslist: {
        name: "",
        id: "",
      },
      fc: "MHS_FDC",
    };
  },
  created() {},
  methods: {
    /**查询数据 */
    query_table(){
      let that = this;
      this.tableData = [];
      var digital = new URLSearchParams();
        digital.append('isAsc',this.isAsc);
        digital.append('wpId',this.fc);
        digital.append('recorddate',this.date_1);
      this.API.post('/goodness/windturbinegoodness',digital).then((res) => {
          that.tableData = res.data.list;
      })
    },
    /**跳转详情或历史 */
    handleEdit(b) {
      this.$router.push({
        path: "/individualPandectinformationdetails",
        query: {
          data: b,
        },
      });
    },
    history(b) {
      this.$router.push({
        path: "/individualHistoryinformation",
        query: {
          data: b,
        },
      });
    },
    // toExcel() {
    //   excelHelper.exportExcel("tableData", "单机信息总览", ".xls", true);
    // },
    query_wpid() {
        this.API.get("powercompare/windfarmAjax?").then((res) => {
        this.wpIdslist = res.data;
      });
    },
    
  },
  mounted() {
    var newData = new Date();
    this.date_1 =  this.BASE.getBzDate(newData.getTime(),-1);
    this.query_wpid();
    this.query_table();
  }
};
