<template>
  <div class="box">
    <div class="searchBar">
      <el-form :inline="true" class="demo-form-inline" style="margin-left:33px">
        <el-row :gutter="1">
          <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-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
        v-loading="loading"
        :data="gridData"
        :row-style="{ height: '10px' }"
        :cell-style="{ textAlign: 'center'}"
        :header-cell-style="headStyle"
        @selection-change="handleSelectionChange"
        @sort-change="changeTableSort"
        max-height="388px"
        style="margin-bottom:30px"
      >
          <el-table-column type="index" width="50"> </el-table-column>
          <el-table-column
            type="selection"
            class="selection"
            @selection-change="changeFun"
            width="50"
          >
          </el-table-column>
          <el-table-column sortable prop="wpName" label="风电场名称" width="130">
          </el-table-column>
          <el-table-column sortable prop="pjName" label="项目名称" width="150">
          </el-table-column>
          <el-table-column sortable prop="ordernum" label="综合排名" width="110">
          </el-table-column>
          <el-table-column
            sortable
            prop="scadafdlnum"
            label="发电量排名"
            width="130"
          >
          </el-table-column>
          <el-table-column sortable prop="fdl" :formatter="filter_fdl" label="发电量" width="110">
          </el-table-column>
          <el-table-column
            sortable
            prop="gzssnum"
            label="故障损失排名"
            width="150"
          >
          </el-table-column>
          <el-table-column sortable prop="gzss" label="故障损失" width="130">
          </el-table-column>
          <el-table-column
            sortable
            prop="whssnum"
            label="检修损失排名"
            width="139"
          >
          </el-table-column>
          <el-table-column sortable prop="whss" label="检修损失" width="130">
          </el-table-column>
          <el-table-column
            sortable
            prop="qfssnum"
            label="性能损失排名"
            width="139"
          >
          </el-table-column>
          <el-table-column sortable prop="qfss" label="性能损失" width="110">
          </el-table-column>
          <el-table-column
            sortable
            prop="xdssnum"
            label="限电损失排名"
            width="130"
          >
          </el-table-column>
          <el-table-column sortable prop="xdss" label="限电损失" width="110">
          </el-table-column>
          <el-table-column
            sortable
            prop="slssnum"
            label="受累损失排名"
            width="150"
          >
          </el-table-column>
          <el-table-column sortable prop="slss" label="受累损失" width="110">
          </el-table-column>
          <el-table-column
            sortable
            prop="fnlylnum"
            label="风能利用率排名"
            width="150"
          >
          </el-table-column>
          <el-table-column
            sortable
            prop="fnlyl"
            label="风能利用率(%)"
            width="150"
          >
          </el-table-column>
          <el-table-column
            sortable
            prop="gzsslnum"
            label="故障损失率排名"
            width="150"
          >
          </el-table-column>
          <el-table-column
            sortable
            prop="gzssl"
            label="故障损失率(%)"
            width="150"
          >
          </el-table-column>
          <el-table-column
            sortable
            prop="jxsslnum"
            label="检修损失率排名"
            width="150"
          >
          </el-table-column>
          <el-table-column
            sortable
            prop="jxssl"
            label="检修损失率(%)"
            width="150"
          >
          </el-table-column>
          <el-table-column sortable prop="qflnum" label="弃风率排名" width="130">
          </el-table-column>
          <el-table-column sortable prop="qfl" label="弃风率(%)" width="130">
          </el-table-column>
          <el-table-column
            sortable
            prop="xnsslnum"
            label="性能损失率排名"
            width="150"
          >
          </el-table-column>
          <el-table-column
            sortable
            prop="xnssl"
            label="性能损失率(%)"
            width="150"
          >
          </el-table-column>
          <el-table-column
            sortable
            prop="slsslnum"
            label="受累损失率排名"
            width="150"
          >
          </el-table-column>
          <el-table-column
            sortable
            prop="slssl"
            label="受累损失率(%)"
            width="150"
          >
          </el-table-column>
          <el-table-column
            sortable
            prop="fwjslnum"
            label="复位及时率排名"
            width="150"
          >
          </el-table-column>
          <el-table-column
            sortable
            prop="fwjsl"
            label="复位及时率(%)"
            width="150"
          >
          </el-table-column>
          <el-table-column
            sortable
            prop="ztzhjslnum"
            label="状态转换率排名"
            width="150"
          >
          </el-table-column>
          <el-table-column
            sortable
            prop="ztzhjsl"
            label="状态转换率(%)"
            width="150"
          >
          </el-table-column>
          <el-table-column fixed="right" prop="address" label="操作" width="70">
            <template slot-scope="scope">
              <el-button
                size="medium"
                type="text"
                @click="handleEdit(scope.$index, scope.row)"
                >详情</el-button
              >
            </template>
          </el-table-column>
      </el-table>

      <el-dialog
        class="el-dialog_body"
        width="60%"
        title="对标信息分析"
        :visible.sync="dialogTableVisible"
        :modal-append-to-body="false"
        append-to-body
      >
        <div class="margin">
          <el-row>
            <el-col :span="12">
          
            <el-row>
            <div id="leiDaTu" class="echart" style="width: 100%; height: 280px"></div></el-row>
            <el-row>
            <div id="leiDaTu2" class="echart" style="width: 100%; height: 280px"></div></el-row>
          
          </el-col>
          <el-col :span="12">
          
            <el-table
              :data="getTableData"
              height="618"
              :row-style="{ height: '10px' }"
              border
              :header-cell-style="headStyle"
              :cell-style="{ textAlign: 'center', padding: '7px' }"
              style="width: 100%; font-size: 10px"
            >
              <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>
        </div>
      </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-left: 99px ;margin-top:-13px"
          ></div>
        </el-col>
        <el-col :span="12">
          <div
            id="chartPieRight"
            style="width: 800px; height: 400px; margin-left: 99px ;margin-top:-13px"
          ></div
        ></el-col>
      </el-row>

      <el-row>
        <div class="box">
          <div
            id="chartHistogram"
            style="width: 90%; height: 300px; margin-bottom:33px;"
          ></div>
        </div>
      </el-row>
    </div>
  </div>
</template>
<script>
import projectBenchmark from "@assets/js/benchmarkingSys/projectBenchmark";
export default projectBenchmark;
</script>

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