<template>
  <el-container>
    <el-header>
      <el-card style="margin-top: -10px">
        <el-row :gutter="1">
          <el-form :inline="true" class="demo-form-inline">
            <el-form-item label="类型">
              <el-select
                v-model="lx"
                @change="check_lx"
                clearable
                placeholder="请选择"
              >
                <el-option
                  v-for="item in lxlist"
                  :key="item.id"
                  :label="item.name"
                  :value="item.id"
                >
                </el-option>
              </el-select>
            </el-form-item>

            <el-form-item label="风场">
              <el-select v-model="fc" clearable placeholder="请选择">
                <el-option
                  v-for="item in list"
                  :key="item.id"
                  :label="item.name"
                  :value="item.id"
                >
                </el-option>
              </el-select>
            </el-form-item>

            <el-form-item label="开始时间">
              <el-date-picker
                v-model="beginDate"
                value-format="yyyy-MM-dd"
                type="date"
                placeholder="选择日期"
                :picker-options="pickerOptions">
              >
              </el-date-picker>
            </el-form-item>

            <el-form-item label="结束时间">
              <el-date-picker
                v-model="endDate"
                value-format="yyyy-MM-dd"
                type="date"
                placeholder="选择日期"
                :picker-options="pickerOptions">
              >
              </el-date-picker>
            </el-form-item>

            <el-form-item>
              <el-button type="primary" @click="query_table" :plain="true"
                >查询</el-button
              >
            </el-form-item>

            <el-form-item>
              <el-button type="primary" :plain="true"
                >导出</el-button
              >
            </el-form-item>
          </el-form>
        </el-row>
      </el-card>
    </el-header>

    <el-main>
      <el-card style=" height: 759px">
        <el-table
          v-loading="loading"
          id="tableData"
          :data="tableData"
          style="width: 100%"
          :cell-style="{ textAlign: 'center' }"
          :header-cell-style="headStyle"
          max-height="739px"
          @selection-change="changeFun"
        >
          >
          <el-table-column label="总发电量排行榜">
            <el-table-column type="index" width="80"> </el-table-column>
            <el-table-column
              type="selection"
              class="selection"
              @selection-change="changeFun"
              width="60"
            >
            </el-table-column>
            <el-table-column sortable prop="windfarm" label="风场" width="310">
            </el-table-column>
            <el-table-column
              sortable
              prop="windturbine"
              label="风机"
              width="310"
            >
            </el-table-column>
            <el-table-column
              sortable
              prop="beginDate"
              :formatter="filter_bdate"
              value-format="yyyy-MM-dd"
              label="起始时间"
              width="310"
            >
            </el-table-column>
            <el-table-column
              sortable
              prop="endDate"
              :formatter="filter_edate"
              value-format="yyyy-MM-dd"
              label="截至日期"
              width="210"
            >
            </el-table-column>
            <el-table-column
              sortable
              prop="speed"
              :formatter="filter_speed"
              label="平均风速"
              width="290"
            >
            </el-table-column>
            <el-table-column
              sortable
              prop="power"
              :formatter="filter_power"
              label="发电量"
              width="280"
            >
            </el-table-column>
          </el-table-column>
        </el-table>
      </el-card>
    </el-main>
  </el-container>
</template>

<script>
  import grossgenerationRank from "@assets/js/normRanking/grossgenerationRank";
  export default grossgenerationRank;
</script>

<style lang="scss" scoped>
 @import "@assets/css/normRanking/grossgenerationRank.scss";
</style>