<template>
  <div class="box">
    <div class="searchBar">
      <el-form :inline="true" :model="formInline" class="demo-form-inline" style="margin-left:33px">
        <el-row :gutter="1">
          <el-form-item label="风场">
            <el-select v-model="value" multiple placeholder="请选择">
              <el-option
                v-for="item in options"
                :key="item.name"
                :label="item.name"
                :value="item.id"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="分类">
            <el-select
              v-model="value2"
              @change="queryApData()"
              placeholder="请选择"
            >
              <el-option
                v-for="item in classification"
                :key="item.label"
                :label="item.label"
                :value="item.id"
              >
              </el-option>
            </el-select>
          </el-form-item>
          <!-- <el-form-item label="项目">
              <el-input
                v-model="formInline.project"
                id="project"
                placeholder="项目"
                @focus="checkwindfarm"
              ></el-input>
            </el-form-item>

            <el-form-item label="线路">
              <el-input
                v-model="formInline.line"
                id="line"
                placeholder="线路"
                @focus="checkproject"
              ></el-input>
            </el-form-item> -->

          <el-form-item label="选择时间：">
            <el-date-picker
              v-model="timedate"
              value-format="yyyy-MM-dd"
              type="daterange"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              :picker-options="pickerOptions">
            >
            </el-date-picker>
          </el-form-item>

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

          <el-form-item>
            <el-button type="primary" @click="querycheck"
              >对标分析</el-button
            >
          </el-form-item>
        </el-row>
      </el-form>
      <el-table
        :data="gridData"
        :row-style="{ height: '10px' }"
        :cell-style="{ textAlign: 'center'}"
        :header-cell-style="headStyle"
        @selection-change="handleSelectionChange"
        @sort-change="changeTableSort"
        v-if="value2 == 'xn'"
      >
        <el-table-column label="损失率对标列表">
          <el-table-column type="index" width="30"> </el-table-column>
          <el-table-column type="selection" width="45"> </el-table-column>
          <el-table-column prop="wpName" label="风机" width="300">
          </el-table-column>
          <el-table-column
            :sortable="'custom'"
            prop="qfssnum"
            label="性能损失电量排名"
            width="300"
          >
          </el-table-column>
          <el-table-column
            :sortable="'custom'"
            prop="qfss"
            label="性能损失电量"
            width="300"
          >
          </el-table-column>
          <el-table-column
            :sortable="'custom'"
            prop="xnsslnum"
            label="性能损失率排名"
            width="300"
          >
          </el-table-column>
          <el-table-column
            :sortable="'custom'"
            prop="xnssl"
            label="性能损失率(%)"
            width="300"
          >
          </el-table-column>
          <el-table-column prop="address" label="操作" width="300">
            <template slot-scope="scope">
              <el-button
                size="mini"
                @click="handleEdit(scope.$index, scope.row)"
                >详情</el-button
              >
            </template>
          </el-table-column>
        </el-table-column>
      </el-table>
      <el-table
        :data="gridData"
        :row-style="{ height: '10px' }"
        :cell-style="{ textAlign: 'center'}"
        :header-cell-style="headStyle"
        @selection-change="handleSelectionChange"
        @sort-change="changeTableSort"
        v-if="value2 == 'qf'"
        style="margin-bottom:21px"
      >
        <el-table-column label="损失率对标列表">
          <el-table-column type="index" width="30"> </el-table-column>
          <el-table-column type="selection" width="45"> </el-table-column>
          <el-table-column prop="wpName" label="风机" width="300">
          </el-table-column>
          <el-table-column
            :sortable="'custom'"
            prop="qfl"
            label="弃风率"
            width="300"
          >
          </el-table-column>
          <el-table-column
            :sortable="'custom'"
            prop="qflnum"
            label="弃风率排名"
            width="300"
          >
          </el-table-column>
          <el-table-column
            :sortable="'custom'"
            prop="xdssnum"
            label="限电损失电量排名"
            width="300"
          >
          </el-table-column>
          <el-table-column
            :sortable="'custom'"
            prop="xdss"
            label="限电损失电量"
            width="300"
          >
          </el-table-column>
          <el-table-column prop="address" label="操作" width="300">
            <template slot-scope="scope">
              <el-button
                size="mini"
                @click="handleEdit(scope.$index, scope.row)"
                >详情</el-button
              >
            </template>
          </el-table-column>
        </el-table-column>
      </el-table>
      <el-table
        :data="gridData"
        :row-style="{ height: '10px' }"
        :cell-style="{ textAlign: 'center' }"
        :header-cell-style="headStyle"
        @selection-change="handleSelectionChange"
        @sort-change="changeTableSort"
        v-if="value2 == 'gz'"
        style="margin-bottom:21px"
      >
        <el-table-column label="损失率对标列表">
          <el-table-column type="index" width="30"> </el-table-column>
          <el-table-column type="selection" width="45"> </el-table-column>
          <el-table-column prop="wpName" label="风机" width="300">
          </el-table-column>
          <el-table-column
            :sortable="'custom'"
            prop="gzssnum"
            label="故障损失电量排名"
            width="300"
          >
          </el-table-column>
          <el-table-column
            :sortable="'custom'"
            prop="gzss"
            label="故障损失电量"
            width="300"
          >
          </el-table-column>
          <el-table-column
            :sortable="'custom'"
            prop="gzsslnum"
            label="故障损失率排名"
            width="300"
          >
          </el-table-column>
          <el-table-column
            :sortable="'custom'"
            prop="gzssl"
            label="故障损失率(%)"
            width="300"
          >
          </el-table-column>
          <el-table-column prop="address" label="操作" width="300">
            <template slot-scope="scope">
              <el-button
                size="mini"
                @click="handleEdit(scope.$index, scope.row)"
                >详情</el-button
              >
            </template>
          </el-table-column>
        </el-table-column>
      </el-table>
      <el-table
        :data="gridData"
        :row-style="{ height: '10px' }"
        :cell-style="{ textAlign: 'center' }"
        :header-cell-style="headStyle"
        @selection-change="handleSelectionChange"
        @sort-change="changeTableSort"
        v-if="value2 == 'jx'"
        style="margin-bottom:21px"
      >
        <el-table-column label="损失率对标列表">
          <el-table-column type="index" width="30"> </el-table-column>
          <el-table-column type="selection" width="45"> </el-table-column>
          <el-table-column prop="wpName" label="风机" width="300">
          </el-table-column>
          <el-table-column
            :sortable="'custom'"
            prop="whssnum"
            label="检修损失电量排名"
            width="300"
          >
          </el-table-column>
          <el-table-column
            :sortable="'custom'"
            prop="whss"
            label="检修损失电量"
            width="300"
          >
          </el-table-column>
          <el-table-column
            :sortable="'custom'"
            prop="jxsslnum"
            label="检修损失率排名"
            width="300"
          >
          </el-table-column>
          <el-table-column
            :sortable="'custom'"
            prop="jxssl"
            label="检修损失率(%)"
            width="300"
          >
          </el-table-column>
          <el-table-column prop="address" label="操作" width="300">
            <template slot-scope="scope">
              <el-button
                size="mini"
                @click="handleEdit(scope.$index, scope.row)"
                >详情</el-button
              >
            </template>
          </el-table-column>
        </el-table-column>
      </el-table>
      <el-table
        :data="gridData"
        :row-style="{ height: '10px' }"
        :cell-style="{ textAlign: 'center'}"
        :header-cell-style="headStyle"
        @selection-change="handleSelectionChange"
        @sort-change="changeTableSort"
        v-if="value2 == 'sl'"
        style="margin-bottom:21px"
      >
        <el-table-column label="损失率对标列表">
          <el-table-column type="index" width="30"> </el-table-column>
          <el-table-column type="selection" width="45"> </el-table-column>
          <el-table-column prop="wpName" label="风机" width="300">
          </el-table-column>
          <el-table-column
            :sortable="'custom'"
            prop="slssnum"
            label="受累损失电量排名"
            width="300"
          >
          </el-table-column>
          <el-table-column
            :sortable="'custom'"
            prop="slss"
            label="受累损失电量"
            width="300"
          >
          </el-table-column>
          <el-table-column
            :sortable="'custom'"
            prop="slsslnum"
            label="受累损失率排名"
            width="300"
          >
          </el-table-column>
          <el-table-column
            :sortable="'custom'"
            prop="fwjsl"
            label="受累损失率(%)"
            width="300"
          >
          </el-table-column>
          <el-table-column prop="address" label="操作" width="300">
            <template slot-scope="scope">
              <el-button
                size="mini"
                @click="handleEdit(scope.$index, scope.row)"
                >详情</el-button
              >
            </template>
          </el-table-column>
        </el-table-column>
      </el-table>
      <el-dialog
        width="65%"
        title="对标信息分析"
        :visible.sync="dialogTableVisible"
        :modal-append-to-body="false"
      >
        <el-row>
          <el-col :span="12">
            <div id="leiDatu6" style="width: 600px; height: 350px"></div>
            <div id="leiDaTu8" style="width: 600px; height: 350px"></div>
          </el-col>
          <el-col :span="12">
            <el-table :data="getTableData">
              <el-table-column prop="index" label="指标"> </el-table-column>
              <el-table-column prop="data1" :label="fdcName1">
              </el-table-column>
              <el-table-column prop="data2" :label="fdcName2">
              </el-table-column>
            </el-table>
          </el-col>
        </el-row>
      </el-dialog>
      <!-- <div style="text-align: center;">
					<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="currentPage2"
					 :page-sizes="[10, 50, 100, 1000]"
					 :page-size="pagesize" layout="sizes, prev, pager, next" :total="1000">
					</el-pagination>
				</div> -->
      <el-row>
        <el-col :span="12"
          ><div
            id="chartPie"
            style="width: 800px; height: 400px; margin: auto"
          ></div>
        </el-col>
        <el-col :span="12">
          <div
            id="chartPieRight"
            style="width: 800px; height: 400px; margin: auto"
          ></div
        ></el-col>
      </el-row>
      <!-- <div class="histogramChart">
        <FiveLossRatesHistogramChart
          ref="FiveLossRatesHistogramChart"
        ></FiveLossRatesHistogramChart>
      </div> -->
    </div>
  </div>
</template>

<script>
import propertBenchmark from "@assets/js/benchmarkingSys/propertBenchmark";
export default propertBenchmark;
</script>

<style lang="scss" scoped>
 @import "@assets/css/benchmarkingSys/propertBenchmark.scss";
</style>
