<template>
  <div class="box">
    <div class="searchBar">
      <el-form :inline="true"  class="demo-form-inline" style="margin-left:1%">
        <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="fc"
              clearable
              placeholder="请选择"
              @change="query_xml()"
            >
              <el-option
                v-for="item in wpIdslist"
                :key="item.id"
                :label="item.name"
                :value="item.id"
              >
              </el-option>
            </el-select>
          </el-form-item>

          <el-form-item label="项目一">
            <el-select v-model="pj" multiple clearable placeholder="请选择">
              <el-option
                v-for="item in projectlist"
                :key="item.id"
                :label="item.name"
                :value="item.id"
              >
              </el-option>
            </el-select>
          </el-form-item>

          <!-- <el-form-item label="风场二">
              <el-select v-model="value2" 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="fc2"
              clearable
              placeholder="请选择"
              @change="query_xml2()"
            >
              <el-option
                v-for="item in wpIdslist"
                :key="item.id"
                :label="item.name"
                :value="item.id"
              >
              </el-option>
            </el-select>
          </el-form-item>

          <el-form-item label="项目二">
            <el-select v-model="pj2" multiple clearable placeholder="请选择">
              <el-option
                v-for="item in projectlist2"
                :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="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-form-item>
            <el-button type="primary" @click="goReturn">返回</el-button>
          </el-form-item>
        </el-row>
      </el-form>
      <el-card>
        <el-table
           v-loading="loading"
          :data="fdcLineData"
          :row-style="{ height: '10px' }"
          :cell-style="{ textAlign: 'center'}"
          :header-cell-style="headStyle"
          @selection-change="handleSelectionChange"
          @sort-change="changeTableSort"
          max-height="399px"
          style="widht: 100%"
        >
          <el-table-column label="风机对标列表明细一">
            <el-table-column fixed type="index" width="45"> </el-table-column>
            <el-table-column type="selection" width="45"> </el-table-column>

            <el-table-column prop="wpName" label="风机名称" width="110">
            </el-table-column>

            <el-table-column prop="pjName" label="风机名称" width="150">
            </el-table-column>
            
            <el-table-column
              :sortable="'custom'"
              prop="ordernum"
              label="排名"
              width="90"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="scadafdlnum"
              label="发电量排名"
              width="130"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="scadafdl"
              :formatter="filter_fdl"
              label="发电量"
              width="110"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="gzssnum"
              label="故障排名"
              width="110"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="gzss"
              label="故障损失"
              width="110"
            >
              <template slot-scope="scope">
                <span>{{ scope.row.gzss | rounding }}</span>
              </template>
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="whssnum"
              label="检修排名"
              width="110"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="whss"
              label="检修损失"
              width="110"
            >
              <template slot-scope="scope">
                <span>{{ scope.row.whss | rounding }}</span>
              </template>
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="qfssnum"
              label="性能排名"
              width="110"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="qfss"
              label="性能损失"
              width="110"
            >
              <template slot-scope="scope">
                <span>{{ scope.row.qfss | rounding }}</span>
              </template>
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="xdssnum"
              label="限电排名"
              width="110"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="xdss"
              label="限电损失"
              width="110"
            >
              <template slot-scope="scope">
                <span>{{ scope.row.xdss | rounding }}</span>
              </template>
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="slssnum"
              label="受累排名"
              width="110"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="slss"
              label="受累损失"
              width="110"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="fnlyl"
              label="风能利用率"
              width="130"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="gzsslnum"
              label="故障损失率排名"
              width="150"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="gzssl"
              label="故障损失率"
              width="130"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="jxsslnum"
              label="检修损失率排名"
              width="150"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="jxssl"
              label="检修损失率"
              width="130"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="qflnum"
              label="弃风率排名"
              width="130"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="qfl"
              label="弃风率"
              width="110"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="xnsslnum"
              label="性能损失率排名"
              width="150"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="xnssl"
              label="性能损失率"
              width="130"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="slsslnum"
              label="受累损失率排名"
              width="150"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="slssl"
              label="受累损失率"
              width="139"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="fwjsl"
              label="复位及时率"
              width="139"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="xqjsl"
              label="消缺及时率"
              width="139"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="ztzhjsl"
              label="状态转换率"
              width="139"
            >
            </el-table-column>
          </el-table-column>
        </el-table>
      </el-card>

      <el-card>
        <el-table
          v-loading="loading2"
          :data="fdcLineData2"
          :row-style="{ height: '10px' }"
          :cell-style="{ textAlign: 'center'}"
          :header-cell-style="headStyle"
          @selection-change="handleSelectionChange2"
          @sort-change="changeTableSort"
          style="widht: 100%"
          max-height="399px"
          v-if="tb2"
        >
          <el-table-column label="风机对标列表明细二">
            <el-table-column fixed type="index" width="45"> </el-table-column>
            <el-table-column type="selection" width="45"> </el-table-column>

            <el-table-column prop="wpName" label="风机名称" width="110">
            </el-table-column>

            <el-table-column prop="pjName" label="风机名称" width="150">
            </el-table-column>
            
            <el-table-column
              :sortable="'custom'"
              prop="ordernum"
              label="排名"
              width="90"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="scadafdlnum"
              label="发电量排名"
              width="130"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="scadafdl"
              :formatter="filter_fdl"
              label="发电量"
              width="110"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="gzssnum"
              label="故障排名"
              width="110"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="gzss"
              label="故障损失"
              width="110"
            >
              <template slot-scope="scope">
                <span>{{ scope.row.gzss | rounding }}</span>
              </template>
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="whssnum"
              label="检修排名"
              width="110"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="whss"
              label="检修损失"
              width="110"
            >
              <template slot-scope="scope">
                <span>{{ scope.row.whss | rounding }}</span>
              </template>
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="qfssnum"
              label="性能排名"
              width="110"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="qfss"
              label="性能损失"
              width="110"
            >
              <template slot-scope="scope">
                <span>{{ scope.row.qfss | rounding }}</span>
              </template>
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="xdssnum"
              label="限电排名"
              width="110"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="xdss"
              label="限电损失"
              width="110"
            >
              <template slot-scope="scope">
                <span>{{ scope.row.xdss | rounding }}</span>
              </template>
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="slssnum"
              label="受累排名"
              width="110"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="slss"
              label="受累损失"
              width="110"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="fnlyl"
              label="风能利用率"
              width="130"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="gzsslnum"
              label="故障损失率排名"
              width="150"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="gzssl"
              label="故障损失率"
              width="130"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="jxsslnum"
              label="检修损失率排名"
              width="150"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="jxssl"
              label="检修损失率"
              width="130"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="qflnum"
              label="弃风率排名"
              width="130"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="qfl"
              label="弃风率"
              width="110"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="xnsslnum"
              label="性能损失率排名"
              width="150"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="xnssl"
              label="性能损失率"
              width="130"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="slsslnum"
              label="受累损失率排名"
              width="150"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="slssl"
              label="受累损失率"
              width="139"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="fwjsl"
              label="复位及时率"
              width="139"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="xqjsl"
              label="消缺及时率"
              width="139"
            >
            </el-table-column>
            <el-table-column
              :sortable="'custom'"
              prop="ztzhjsl"
              label="状态转换率"
              width="139"
            >
            </el-table-column>
          </el-table-column>
        </el-table>
      </el-card>
      <el-dialog
        width="65%"
        title="对标信息分析"
        :visible.sync="dialogTableVisible"
        :modal-append-to-body="false"
        append-to-body
      >
       <el-row>
          <el-col :span="12">
            <div id="leiDaTu3" style="width: 600px; height: 300px"></div>
            <div id="leiDaTu4" style="width: 600px; height: 300px"></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="pjName1">
              </el-table-column>
              <el-table-column prop="data2" :label="pjName2">
              </el-table-column>
            </el-table>
          </el-col>
        </el-row>
      </el-dialog>
    </div>
  </div>
</template>
<script>
import projectBenchmarkParticulars from "@assets/js/benchmarkingSys/projectBenchmarkParticulars";
export default projectBenchmarkParticulars;
</script>

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