浏览代码

完成公司分析对标筛选功能

baiyanting 2 年之前
父节点
当前提交
171144a7a3

+ 8 - 0
src/api/headerNav.js

@@ -77,3 +77,11 @@ export function GetSquareList(ids) {
     method: "get",
   });
 }
+//树形列表
+export function GetTreeList(data) {
+  return request({
+    baseURL: process.env.VUE_APP_Economy,
+    url: `benchmarking/treeByWpid?wpId=${data.wpId}&treeType=${data.treeType}`,
+    method: "get",
+  });
+}

+ 23 - 5
src/assets/css/common.css

@@ -917,12 +917,30 @@ background-color: rgba(30,90,163, .5);
   background: rgba(0, 70, 199, 0.4);
   border: 1px solid #2a374f;
 }
-.el-date-range-picker .el-date-table td.in-range div{
+.el-date-range-picker .el-date-table td.in-range div {
   background-color: #003277;
 }
-.el-date-range-picker .el-date-table td.in-range div:hover{
+.el-date-range-picker .el-date-table td.in-range div:hover {
   background-color: #003277;
 }
-.el-date-range-picker__header .el-picker-panel__icon-btn{
-    color: #bac5d5;
-}
+.el-date-range-picker__header .el-picker-panel__icon-btn {
+  color: #bac5d5;
+}
+.el-date-range-picker .el-date-table td.disabled div {
+  background-color: #30343a;
+}
+.benchRange .el-date-range-picker {
+  width: 450px !important;
+}
+.benchRange .el-date-range-picker .el-picker-panel__body {
+  min-width: 450px !important;
+}
+.benchRange .el-date-range-picker__header div{
+    font-size: 14px;
+}
+.el-dialog.is-fullscreen .el-dialog__body {
+    height:calc(100% - 55px);
+}
+.el-dialog.is-fullscreen .el-dialog__body .dialog-body {
+    height: 100%;
+}

+ 32 - 3
src/views/layout/economicsOperation/benchmarkingManagement/companyBenchmarking/index.vue

@@ -543,6 +543,7 @@ import { GetOrganization } from "@/api/headerNav.js";
 import { getStation, gsdb, details } from "@/api/performance";
 import PieChart from "../../homePage/components/pieChart.vue";
 import BarCharts from "../../homePage/components/barCharts.vue";
+import { GetRegionInfo } from "@/api/home.js";
 import dayinfo from "../compontent/dayinfo.vue";
 export default {
   name: "companyBenchmarking", //公司对标
@@ -587,6 +588,10 @@ export default {
       analyisDialog: [],
       screenHeight: window.innerHeight,
       echartsHeight: "55vh",
+      province: {
+        name: "",
+        code: "",
+      },
     };
   },
   created() {
@@ -602,7 +607,19 @@ export default {
     }
     this.starTime = date.getFullYear() + "-" + month + "-" + day;
     this.endTime = dayjs(new Date().getTime()).format("YYYY-MM-DD");
-    this.initialization();
+
+    let province = JSON.parse(localStorage.getItem("GlobalConfig"));
+    if (!province) {
+      this.getProvinceCode();
+    } else {
+      this.province = {
+        name: province.name,
+        code: province.code,
+      };
+      this.$nextTick(() => {
+        this.initialization();
+      });
+    }
   },
   mounted() {
     if (this.screenHeight > 1100) {
@@ -618,6 +635,16 @@ export default {
     };
   },
   methods: {
+    getProvinceCode() {
+      GetRegionInfo().then((data) => {
+        this.province = {
+          name: data.name,
+          code: data.code,
+        };
+        this.initialization();
+        localStorage.setItem("GlobalConfig", JSON.stringify(data));
+      });
+    },
     tabClick(val) {
       this.tabIndex = val;
       this.initialization();
@@ -634,7 +661,9 @@ export default {
 
     gerGsdb() {
       gsdb({
-        companys: this.company.length ? this.company.join(",") : "JS_RGN",
+        companys: this.company.length
+          ? this.company.join(",")
+          : this.province.code,
         type: this.tabIndex,
         beginDate: this.starTime,
         endDate: this.endTime,
@@ -686,7 +715,7 @@ export default {
       });
     },
     handleCompanyChange(val) {
-      let comp = val.indexOf("JS_RGN");
+      let comp = val.indexOf(this.province.code);
       if (comp == -1) {
         this.company = val;
         this.gerGsdb();

+ 19 - 15
src/views/layout/economicsOperation/benchmarkingManagement/intervalBenchmarking/index.vue

@@ -606,21 +606,13 @@ export default {
       analyisDialog: [],
       screenHeight: window.innerHeight,
       echartsHeight: "55vh",
+      benchComp: "",
+      benchStation: [],
     };
   },
   created() {
-    let date = new Date();
-    date.setDate(1);
-    let month = parseInt(date.getMonth() + 1);
-    let day = date.getDate();
-    if (month < 10) {
-      month = "0" + month;
-    }
-    if (day < 10) {
-      day = "0" + day;
-    }
-    this.starTime = date.getFullYear() + "-" + month + "-" + day;
-    this.endTime = dayjs(new Date().getTime()).format("YYYY-MM-DD");
+    this.starTime = dayjs().startOf("month").format("YYYY-MM-DD");
+    this.endTime = dayjs().format("YYYY-MM-DD");
     this.initialization();
   },
   mounted() {
@@ -637,6 +629,11 @@ export default {
     };
   },
   methods: {
+    init(stationObj, type, company) {
+      this.benchComp = company;
+      this.benchStation = stationObj;
+      this.tabIndex = type;
+    },
     tabClick(val) {
       this.tabIndex = val;
       this.stationObj = [];
@@ -645,9 +642,14 @@ export default {
     initialization() {
       GetOrganization({ type: this.tabIndex }).then((res) => {
         if (res.data) {
-          this.company = res.data[0].id;
+          if (this.benchComp) {
+            this.company = this.benchComp;
+          } else {
+            this.company = res.data[0].id;
+          }
+
           this.companyOptions = res.data;
-          this.getStation(res.data[0].id);
+          this.getStation(this.company);
         }
       });
     },
@@ -658,7 +660,9 @@ export default {
       }).then((res) => {
         if (res.data.length) {
           this.stationList = res.data;
-          //   this.stationObj = [res.data[0].id];
+          if (this.benchStation) {
+            this.stationObj = this.benchStation;
+          }
         } else {
           this.stationList = [];
         }

+ 24 - 3
src/views/layout/economicsOperation/benchmarkingManagement/projectBenchmarking/index.vue

@@ -622,6 +622,9 @@ export default {
       analyisDialog: [],
       screenHeight: window.innerHeight,
       echartsHeight: "55vh",
+      benchComp: "",
+      benchSta: "",
+      benchPro: "",
     };
   },
   created() {
@@ -653,6 +656,12 @@ export default {
     };
   },
   methods: {
+    init(station, project, company, type) {
+      this.benchComp = company;
+      this.benchSta = station;
+      this.benchPro = project;
+      this.tabIndex = type;
+    },
     tabClick(val) {
       this.tabIndex = val;
       this.stationList = [];
@@ -663,9 +672,13 @@ export default {
     initialization() {
       GetOrganization({ type: this.tabIndex }).then((res) => {
         if (res.data) {
-          this.company = res.data[0].id;
+          if (this.benchComp) {
+            this.company = this.benchComp;
+          } else {
+            this.company = res.data[0].id;
+          }
           this.companyOptions = res.data;
-          this.getStation(res.data[0].id);
+          this.getStation(this.company);
         }
       });
     },
@@ -675,7 +688,12 @@ export default {
         type: this.tabIndex,
       }).then((res) => {
         if (res.data.length) {
-          this.stationObj = [res.data[0].id];
+          if (this.benchSta) {
+            this.stationObj = this.benchSta;
+          } else {
+            this.stationObj = [res.data[0].id];
+          }
+
           this.stationList = res.data;
           this.getCmdb();
           this.getProject(this.stationObj);
@@ -687,6 +705,9 @@ export default {
     getProject(stationids) {
       GetProjectList(stationids.join(",")).then((res) => {
         if (res.data.length) {
+          if (this.benchPro) {
+            this.projectObj = this.benchPro;
+          }
           this.projectList = res.data;
         } else {
           this.projectList = [];

+ 42 - 3
src/views/layout/economicsOperation/benchmarkingManagement/quarterBenchmarking/index.vue

@@ -662,6 +662,11 @@ export default {
       analyisDialog: [],
       screenHeight: window.innerHeight,
       echartsHeight: "55vh",
+      benchComp: "",
+      benchSta: "",
+      benchPro: "",
+      benchLine: "",
+      benchQua: "",
     };
   },
   created() {
@@ -693,6 +698,14 @@ export default {
     };
   },
   methods: {
+    init(type, comp, sta, pro, wri, qua) {
+      this.tabIndex = type;
+      this.benchComp = comp;
+      this.benchSta = sta;
+      this.benchPro = pro;
+      this.benchLine = wri;
+      this.benchQua = qua;
+    },
     tabClick(val) {
       this.tabIndex = val;
 
@@ -705,9 +718,14 @@ export default {
     initialization() {
       GetOrganization({ type: this.tabIndex }).then((res) => {
         if (res.data) {
-          this.company = res.data[0].id;
+          if (this.benchComp) {
+            this.company = this.benchComp;
+          } else {
+            this.company = res.data[0].id;
+          }
+
           this.companyOptions = res.data;
-          this.getStation(res.data[0].id);
+          this.getStation(this.company);
         }
       });
     },
@@ -716,8 +734,15 @@ export default {
         companyids: companyids,
         type: this.tabIndex,
       }).then((res) => {
+        this.projectObj = [];
+        this.lineObj = [];
         if (res.data.length) {
-          this.stationObj = [res.data[0].id];
+          if (this.benchSta) {
+            this.stationObj = this.benchSta;
+          } else {
+            this.stationObj = [res.data[0].id];
+          }
+
           this.stationList = res.data;
           this.gerZqdb();
           this.getProject(this.stationObj);
@@ -728,7 +753,13 @@ export default {
     },
     getProject(stationids) {
       GetProjectList(stationids.join(",")).then((res) => {
+        this.projectObj = [];
+        this.lineObj = [];
         if (res.data.length) {
+          if (this.benchPro) {
+            this.projectObj = this.benchPro;
+            this.getLineList(this.projectObj);
+          }
           this.projectList = res.data;
         } else {
           this.projectList = [];
@@ -738,7 +769,12 @@ export default {
     },
     getLineList(projectids) {
       GetLineList(projectids.join(",")).then((res) => {
+        this.lineObj = [];
         if (res.data.length) {
+          if (this.benchLine) {
+            this.lineObj = this.benchLine;
+            this.getSquareList(this.lineObj);
+          }
           this.lineList = res.data;
         } else {
           this.lineList = [];
@@ -749,6 +785,9 @@ export default {
     getSquareList(lineids) {
       GetSquareList(lineids.join(",")).then((res) => {
         if (res.data.length) {
+          if (this.benchQua) {
+            this.squareObj = this.benchQua;
+          }
           this.squareList = res.data;
         } else {
           this.squareList = [];

+ 27 - 11
src/views/layout/economicsOperation/benchmarkingManagement/siteBenchmarking/index.vue

@@ -126,7 +126,7 @@
           :data="tableData"
           ref="multipleTable"
           size="mini"
-          height="calc(100% - 49px)"
+          height="100%"
           :cell-style="{ padding: '4px' }"
           :row-style="{ height: '0' }"
           stripe
@@ -861,21 +861,30 @@ export default {
       windNum5: "",
       tabs: [],
       analyisDialog: [],
-
       //同环比
       thbVisible: false,
       thbData: [],
+      benchComp: "",
+      benchStation: "",
     };
   },
   created() {
-    this.starTime = dayjs(new Date().getTime() - 60000 * 60 * 24 * 7).format(
-      "YYYY-MM-DD"
-    );
-    this.endTime = dayjs(new Date().getTime()).format("YYYY-MM-DD");
+    if (!this.starTime && !this.endTime) {
+      this.starTime = dayjs(new Date().getTime() - 60000 * 60 * 24 * 7).format(
+        "YYYY-MM-DD"
+      );
+      this.endTime = dayjs().format("YYYY-MM-DD");
+    }
+
     this.initialization();
   },
   mounted() {},
   methods: {
+    init(station, type, company) {
+      this.tabIndex = type;
+      this.benchComp = company;
+      this.benchStation = station.id;
+    },
     funthb() {
       thb({
         companys: this.company,
@@ -897,9 +906,14 @@ export default {
     initialization() {
       GetOrganization({ type: this.tabIndex }).then((res) => {
         if (res.data) {
-          this.company = res.data[0].id;
+          if (this.benchComp) {
+            this.company = this.benchComp;
+          } else {
+            this.company = res.data[0].id;
+          }
+
           this.companyOptions = res.data;
-          this.getStation(res.data[0].id);
+          this.getStation(this.company);
         }
       });
     },
@@ -909,8 +923,12 @@ export default {
         type: this.tabIndex,
       }).then((res) => {
         if (res.data.length) {
+          if (this.benchStation) {
+            this.stationObj = this.benchStation;
+          } else {
+            this.stationObj = res.data[0].id;
+          }
           this.stationList = res.data;
-          this.stationObj = res.data[0].id;
         } else {
           this.stationList = [];
         }
@@ -995,7 +1013,6 @@ export default {
     },
     goDetail(row) {
       this.displayDetail = true;
-      console.log(row);
       details({
         id: this.stationObj,
         beginDate: row.date,
@@ -1140,7 +1157,6 @@ export default {
         radarValue.push(data);
       });
       this.radarValue = radarValue;
-      console.log(this.radarValue);
       var analyis = [],
         gzssdl = [],
         jxssdl = [],

+ 32 - 4
src/views/layout/economicsOperation/benchmarkingManagement/wiringBenchmarking/index.vue

@@ -608,7 +608,7 @@ import PieChart from "../../homePage/components/pieChart.vue";
 import BarCharts from "../../homePage/components/barCharts.vue";
 import dayinfo from "../compontent/dayinfo.vue";
 export default {
-  name: "intervalBenchmarking", //场际对标
+  name: "wiringBenchmarking", //线路对标
   components: {
     PieChart,
     BarCharts,
@@ -648,6 +648,10 @@ export default {
       analyisDialog: [],
       screenHeight: window.innerHeight,
       echartsHeight: "53vh",
+      benchComp: "",
+      benchSta: "",
+      benchPro: "",
+      benchLine: "",
     };
   },
   created() {
@@ -679,6 +683,13 @@ export default {
     };
   },
   methods: {
+    init(type, comp, sta, pro, wri) {
+      this.tabIndex = type;
+      this.benchComp = comp;
+      this.benchSta = sta;
+      this.benchPro = pro;
+      this.benchLine = wri;
+    },
     tabClick(val) {
       this.tabIndex = val;
       this.stationList = [];
@@ -690,9 +701,14 @@ export default {
     initialization() {
       GetOrganization({ type: this.tabIndex }).then((res) => {
         if (res.data) {
-          this.company = res.data[0].id;
+          if (this.benchComp) {
+            this.company = this.benchComp;
+          } else {
+            this.company = res.data[0].id;
+          }
+
           this.companyOptions = res.data;
-          this.getStation(res.data[0].id);
+          this.getStation(this.company);
         }
       });
     },
@@ -704,7 +720,12 @@ export default {
         this.projectObj = [];
         this.lineObj = [];
         if (res.data.length) {
-          this.stationObj = [res.data[0].id];
+          if (this.benchSta) {
+            this.stationObj = this.benchSta;
+          } else {
+            this.stationObj = [res.data[0].id];
+          }
+
           this.stationList = res.data;
           this.gerXldb();
           this.getProject(this.stationObj);
@@ -718,6 +739,10 @@ export default {
         this.projectObj = [];
         this.lineObj = [];
         if (res.data.length) {
+          if (this.benchPro) {
+            this.projectObj = this.benchPro;
+            this.getLineList(this.projectObj);
+          }
           this.projectList = res.data;
         } else {
           this.projectList = [];
@@ -729,6 +754,9 @@ export default {
       GetLineList(projectids.join(",")).then((res) => {
         this.lineObj = [];
         if (res.data.length) {
+          if (this.benchLine) {
+            this.lineObj = this.benchLine;
+          }
           this.lineList = res.data;
         } else {
           this.lineList = [];

+ 696 - 13
src/views/layout/economicsOperation/companyHomepage/index.vue

@@ -65,7 +65,7 @@
                 </div>
               </div>
             </div>
-            <p>能利用率(%)</p>
+            <p>能利用率(%)</p>
           </div>
           <ul class="chart-list">
             <li class="statistics-li">
@@ -220,7 +220,7 @@
               :class="themeType === 'maintenance' && 'active-theme'"
             >
               <i class="icon-operate"></i>
-              <span>能利用率</span>
+              <span>能利用率</span>
             </div>
             <div
               class="theme-change"
@@ -230,10 +230,173 @@
               <i class="icon-maintenance"></i>
               <span>损失明细</span>
             </div>
+            <div class="label">对标方式:</div>
+            <el-select
+              style="width: 145px"
+              v-model="benchmarkingVal"
+              placeholder="请选择"
+              clearable
+              size="mini"
+              @change="changeNum"
+            >
+              <el-option
+                @mousedown.native="clickBench(item.value)"
+                v-for="(item, indexe) in benchmarking"
+                :key="indexe"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+            <el-badge
+              v-if="benchNum !== 0 && benchmarkingVal !== ''"
+              @click="hidenBenchList"
+              :value="benchNum"
+              style="margin-left: 20px; cursor: pointer"
+            >
+              <img src="@/assets/img/images/benhNum.png" />
+            </el-badge>
+          </div>
+          <div
+            style="z-index: 999; width: 45%; background: #0c0f15"
+            class="window"
+            v-if="displaycheck === true"
+          >
+            <div class="stitBorder"></div>
+            <p class="ststTit header">
+              <span v-if="benchmarkingVal === 'bench2'"> 场际对标 </span>
+              <span v-if="benchmarkingVal === 'bench3'"> 项目对标 </span>
+              <span v-if="benchmarkingVal === 'bench4'"> 线路对标 </span>
+              <span v-if="benchmarkingVal === 'bench5'"> 阵区对标 </span>
+              <span v-if="benchmarkingVal === 'bench1'"> 场内对标 </span>
+              (<span style="color: #d8d8d9">{{ benchNum }}</span
+              >)
+            </p>
+            <div class="lines"></div>
+            <div
+              class="overHidd"
+              style="padding-top: 10px"
+              v-if="benchmarkingVal === 'bench1'"
+            >
+              <ul
+                v-for="(item, index) in cardBench"
+                :key="index"
+                class="stations"
+              >
+                <li>
+                  {{ stationData?.name }}
+                </li>
+                <li
+                  style="
+                    white-space: nowrap;
+                    overflow: hidden;
+                    text-overflow: ellipsis;
+                  "
+                >
+                  {{ item }}
+                </li>
+                <li @click="removeTable(index)" style="cursor: pointer">
+                  <i class="el-icon-close"></i>
+                </li>
+              </ul>
+            </div>
+            <div class="overHidd" v-if="benchmarkingVal === 'bench2'">
+              <ul
+                v-for="(item, index) in cardBench"
+                :key="index"
+                class="stations"
+              >
+                <li
+                  style="
+                    width: 60%;
+                    white-space: nowrap;
+                    overflow: hidden;
+                    text-overflow: ellipsis;
+                  "
+                >
+                  {{ item }}
+                </li>
+
+                <li @click="removeTable(index)" style="cursor: pointer">
+                  <i class="el-icon-close"></i>
+                </li>
+              </ul>
+            </div>
+            <div
+              class="overHidd"
+              v-if="
+                benchmarkingVal !== 'bench2' && benchmarkingVal !== 'bench1'
+              "
+            >
+              <ul
+                v-for="(item, index) in cardLists"
+                :key="index"
+                class="stations"
+              >
+                <li style="text-overflow: ellipsis">
+                  {{ item }}
+                </li>
+
+                <li @click="removeTable(index)" style="cursor: pointer">
+                  <i class="el-icon-close"></i>
+                </li>
+              </ul>
+            </div>
+            <el-row
+              class="footerButton"
+              v-if="benchmarkingVal === 'bench1'"
+              style="position: absolute; bottom: 19px; left: 15px"
+            >
+              <el-button
+                type="primary"
+                :disabled="cardBench.length < 2"
+                round
+                @click="openCurvDatasedDate"
+                >开始对标</el-button
+              >
+              <div class="footTitle" @click="clearTable">
+                <p>清空</p>
+                <Delete
+                  style="
+                    width: 17px;
+                    height: 17px;
+                    margin-top: 6px;
+                    margin-left: 5px;
+                    color: rgba(255, 102, 0, 1);
+                  "
+                />
+              </div>
+            </el-row>
+            <el-row
+              class="footerButton"
+              v-else
+              style="position: absolute; bottom: 19px; left: 15px"
+            >
+              <el-button
+                type="primary"
+                :disabled="cardLists.length < 2"
+                round
+                @click="openCurvDatased"
+                >开始对标</el-button
+              >
+              <div class="footTitle" @click="clearTable">
+                <p>清空</p>
+                <Delete
+                  style="
+                    width: 17px;
+                    height: 17px;
+                    margin-top: 6px;
+                    margin-left: 5px;
+                    color: rgba(255, 102, 0, 1);
+                  "
+                />
+              </div>
+            </el-row>
           </div>
         </div>
       </div>
-      <!--  <div class="photovoltaic-toggle">
+
+      <!-- 右侧列表卡片切换按钮 <div class="photovoltaic-toggle">
        <div
           class="type-card"
           :class="isActive === 'card' && 'actived-toggle'"
@@ -259,7 +422,15 @@
       </div>-->
     </div>
     <div class="photovoltaic-data">
-      <Card :dataSource="cardData" :typeStr="typeNode" :theme="themeType" :isStation="true"/>
+      <Card
+        ref="childCard"
+        :dataSource="cardData"
+        :benchmarkingVal="benchmarkingVal"
+        :electTarget="electTarget"
+        :typeStr="typeNode"
+        :theme="themeType"
+        :isStation="true"
+      />
       <!-- <Card
         v-if="isActive === 'card'"
         :dataSource="cardData"
@@ -273,6 +444,39 @@
         :theme="themeType"
       /> -->
     </div>
+    <el-dialog
+      class="dialogs"
+      width="100%"
+      fullscreen
+      v-model="displaybench"
+      :show-close="true"
+      :destroy-on-close="true"
+    >
+      <template #title>
+        <div class="dialog-title">
+          <img
+            class="dialog-title-img"
+            src="@assets/img/images/dialog-title.png"
+          />
+          <div v-if="benchmarkingVal === 'bench2'" class="title">场际对标</div>
+          <div v-if="benchmarkingVal === 'bench3'" class="title">项目对标</div>
+          <div v-if="benchmarkingVal === 'bench4'" class="title">线路对标</div>
+          <div v-if="benchmarkingVal === 'bench5'" class="title">阵区对标</div>
+          <div v-if="benchmarkingVal === 'bench1'" class="title">场内对标</div>
+        </div>
+      </template>
+      <div class="dialog-body">
+        <img class="dialog-img" src="@assets/img/images/dialog.png" />
+        <siteBench v-if="benchmarkingVal === 'bench1'" ref="siteBench" />
+        <intervalBench
+          v-if="benchmarkingVal === 'bench2'"
+          ref="intervalBench"
+        />
+        <projectBench v-if="benchmarkingVal === 'bench3'" ref="projectBench" />
+        <wiringBench v-if="benchmarkingVal === 'bench4'" ref="wiringBench" />
+        <quarterBench v-if="benchmarkingVal === 'bench5'" ref="quarterBench" />
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -280,18 +484,25 @@
 import Card from "../homePage/components/card.vue";
 import List from "../homePage/components/list.vue";
 import PieChart from "@/components/chart/pie/dual-pie-chart-econey.vue";
-// import PieChart from "@/components/chart/pie/pie-chart.vue";
-// import PieStationTop5 from "@/components/chart/pie/pie-station-top5.vue";
+import siteBench from "@/views//layout/economicsOperation/benchmarkingManagement/siteBenchmarking/index";
+import intervalBench from "@/views//layout/economicsOperation/benchmarkingManagement/intervalBenchmarking/index";
+import projectBench from "@/views//layout/economicsOperation/benchmarkingManagement/projectBenchmarking/index";
+import wiringBench from "@/views//layout/economicsOperation/benchmarkingManagement/wiringBenchmarking/index";
+import quarterBench from "@/views//layout/economicsOperation/benchmarkingManagement/quarterBenchmarking/index";
 import { homePage } from "@/api/economy-homepage.js";
 import { GetOrganization, GetStationByCompany } from "@/api/econ-headerNav.js";
-
+import { GetRegionInfo } from "@/api/home.js";
 export default {
-  name: "photovoltaicLevelTwoStation", // 公司首页
+  name: "companyHomepage", // 公司分析
   components: {
     Card,
     List,
     PieChart,
-    // PieStationTop5,
+    siteBench,
+    intervalBench,
+    projectBench,
+    wiringBench,
+    quarterBench,
   },
   data() {
     return {
@@ -300,6 +511,10 @@ export default {
         { type: -1, flag: true, id: "F", name: "风电" },
         { type: -2, flag: true, id: "G", name: "光伏" },
       ],
+      province: {
+        name: "",
+        code: "",
+      },
       typeNode: "-1",
       windSpeedRota: null, // 发电统计仪表盘转动角度
       OrganizationLists: [], // 公司列表
@@ -307,7 +522,7 @@ export default {
       stationLists: [], // 场站列表
       timer: null, // 3秒调一次
       checkNode: "", // 选中区域
-      themeType: "maintenance", // 主题模式  能利用率类:maintenance, 损失明细类:operate
+      themeType: "maintenance", // 主题模式  能利用率类:maintenance, 损失明细类:operate
       stationName: [], //选中场站
       isActive: "card", // 切换卡片或列表
       dayWindPieData: {}, //五项损失图表数据
@@ -322,30 +537,354 @@ export default {
         { label: "限电损失", value: "xdssdl" },
         { label: "性能损失", value: "xnssdl" },
         { label: "受累损失", value: "slssdl" },
-        { label: "能利用率", value: "gnlyl" }, //排序条件列表
+        { label: "能利用率", value: "gnlyl" }, //排序条件列表
       ],
       sortCode: "", //排序条件
       sortType: true, //升序降序
       datetype: "r",
       wxssTotal: 0,
       stationTopTotal: 0,
+      benchmarking: [
+        { label: "场内对标", value: "bench1" },
+        { label: "场际对标", value: "bench2" },
+        { label: "项目对标", value: "bench3" },
+        { label: "线路对标", value: "bench4" },
+        { label: "阵区对标", value: "bench5" },
+      ],
+      benchmarkingVal: "",
+      benchNum: 0,
+      displaycheck: false,
+      displaybench: false,
+      benchIndex: "",
+      selectTime: "",
+      benchChang: "",
+      cardBench: [],
+      ListBench: [],
+      ListBenchs: [],
+      didBench: "",
+      benchCode: "",
+      stationData: {},
+      dateTimes: null,
+      timerCurvData: null,
+      eventx: "",
+      eventY: "",
+      stationEg: null,
+      cardVal: [],
+      cardVals: [],
+      cardLists: [],
+      cardListed: [],
+      cardNmeCode: [],
+      cardSta: [],
+      cardPro: [],
+      cardLin: [],
     };
   },
 
   methods: {
     init() {
-      this.checkNode = this.$route.query.companyCode || "JS_RGN";
+      let province = JSON.parse(localStorage.getItem("GlobalConfig"));
+      if (!province) {
+        this.getProvinceCode();
+      } else {
+        this.province = {
+          name: province.name,
+          code: province.code,
+        };
+      }
+      this.checkNode = this.$route.query.companyCode || this.province.code;
       this.typeNode = this.levels1Data[0].type;
       this.getDataDetial();
       this.getOrganizationList();
       this.getStationList();
     },
+    async getProvinceCode() {
+      const data = await GetRegionInfo();
+      this.province = {
+        name: data.name,
+        code: data.code,
+      };
+      localStorage.setItem("GlobalConfig", JSON.stringify(data));
+    },
+    // 打开对标框
+    async hidenBenchList(event) {
+      this.displaycheck = !this.displaycheck;
+    },
+    // 切换对标方式
+    changeNum(val) {
+      // clearInterval(this.timerDetial);
+
+      if (val === "") {
+        this.$confirm("是否清空对标方式?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        })
+          .then(async () => {
+            this.$message({
+              type: "success",
+              message: "已清空!",
+              offset: 200,
+              center: true,
+              customClass: "s",
+            });
+            this.selectTime = "";
+            this.displaycheck = false;
+            this.$refs.childCard.changenums();
+          })
+          .catch((_) => {
+            this.benchChang = this.didBench;
+            this.benchmarkingVal = this.didBench;
+          });
+      }
+
+      this.benchChang = val;
+    },
+    // 点击对标方式
+    clickBench(val) {
+      this.didBench = val;
+      let s = this.benchmarkingVal;
+
+      if (
+        this.benchChang !== "" &&
+        val !== "" &&
+        this.benchmarkingVal !== val &&
+        this.benchNum !== 0
+      ) {
+        this.$confirm("是否切换对标方式?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        })
+          .then(async () => {
+            this.$message({
+              type: "success",
+              message: "切换成功!",
+              offset: 200,
+              center: true,
+              customClass: "s",
+            });
+            this.selectTime = "";
+            this.benchmarkingVal = val;
+            this.$refs.childCard.changenums();
+            this.displaycheck = false;
+          })
+          .catch(() => {
+            this.benchmarkingVal = s;
+          });
+      }
+    },
+    // 删除购物车内容
+    removeTable(index) {
+      if (this.benchmarkingVal === "bench2") {
+        this.cardBench.splice(index, 1);
+        this.benchNum = this.cardBench.length;
+        if (this.cardBench.length === 0) {
+          this.displaycheck = false;
+        }
+        this.$refs.childCard.changenBench(this.cardBench);
+      } else if (this.benchmarkingVal === "bench1") {
+        let stationAname;
+        this.cardBench.splice(index, 1);
+        this.benchNum = this.cardBench.length;
+        if (this.cardBench.length === 0) {
+          this.displaycheck = false;
+          stationAname = "";
+        } else {
+          stationAname = this.stationData;
+        }
+        this.$refs.childCard.changenBenchs(this.cardBench, stationAname);
+      } else if (
+        this.benchmarkingVal === "bench4" ||
+        this.benchmarkingVal === "bench5" ||
+        this.benchmarkingVal === "bench3"
+      ) {
+        this.cardLists.splice(index, 1);
+        this.cardNmeCode.splice(index, 1);
+        let arr = [];
+        this.cardVal.forEach((s) => {
+          this.cardNmeCode.forEach((z) => {
+            if (z === s.nemCode) {
+              arr.push(s);
+            }
+          });
+        });
+        this.cardVals = [...new Set(arr)];
+        this.cardBench = this.cardNmeCode;
+        if (this.cardNmeCode.length === 0) {
+          this.displaycheck = false;
+        }
+        this.$refs.childCard.changenBench(this.cardBench, this.cardVals);
+        this.benchNum = this.cardNmeCode.length;
+      }
+    },
+    // 清空购物车
+    clearTable() {
+      this.cardBench = [];
+      this.benchNum = this.cardBench.length;
+
+      this.displaycheck = false;
+      if (this.benchmarkingVal === "bench1") {
+        this.$refs.childCard.changenBenchs(this.cardBench, "");
+      } else {
+        this.$refs.childCard.changenBench(this.cardBench);
+      }
+    },
+    disBenTable() {
+      this.displaycheck = false;
+    },
+    // 点击确认后添加数据
+    setdata(data) {
+      this.cardBench = data;
+      this.benchNum = data.length;
+      if (data.length === 0) {
+        this.displaycheck = false;
+      }
+    },
+
+    // 点击确认后添加数据
+    setdataed(data, val) {
+      this.cardBench = data;
+      this.benchNum = data.length;
+      this.stationData = val;
+      if (data.length === 0) {
+        this.displaycheck = false;
+      }
+    },
+    setdatas(data, val, sta, pro, lin) {
+      this.cardSta = sta;
+      this.cardPro = pro;
+      this.cardLin = lin;
+      this.cardBench = data;
+      this.cardVal = val;
+      this.benchNum = data.length;
+      if (data.length === 0) {
+        this.displaycheck = false;
+      }
+      this.getList();
+    },
+    getList() {
+      let arr = [];
+      let data = [];
+      if (this.benchmarkingVal === "bench3") {
+        let n = [];
+        this.cardVal.forEach((s) => {
+          this.cardBench.forEach((z) => {
+            if (s.nemCode === z) {
+              arr.push(s.aname);
+              data.push(s.id);
+              n.push(s);
+            }
+          });
+        });
+        this.cardVals = [...new Set(n)];
+      } else if (
+        this.benchmarkingVal === "bench4" ||
+        this.benchmarkingVal === "bench5"
+      ) {
+        let n = [];
+        this.cardVal.forEach((s) => {
+          this.cardBench.forEach((z, index) => {
+            if (s.nemCode === z) {
+              arr.push(s.names);
+              data.push(s.nemCode);
+              n.push(s);
+            }
+          });
+        });
+        this.cardVals = [...new Set(n)];
+      }
+      this.cardNmeCode = [...new Set(data)];
+      this.cardLists = [...new Set(arr)];
+    },
+    // 场内开始对标
+    openCurvDatasedDate() {
+      let arr = [];
+      this.cardBench.forEach((s) => {
+        arr.push(s);
+      });
+      if (arr.length == 2) {
+        this.displaycheck = false;
+        this.displaybench = true;
+        this.$nextTick(() => {
+          if (this.$refs.siteBench) {
+            this.$refs.siteBench.starTime = arr[0];
+            this.$refs.siteBench.endTime = arr[1];
+          }
+          this.$refs.siteBench &&
+            this.$refs.siteBench.init(
+              this.stationData,
+              this.typeNode,
+              this.checkNode
+            );
+        });
+      }
+    },
+    // 开始对标(除场内对标)
+    openCurvDatased() {
+      this.displaycheck = false;
+      this.displaybench = true;
+      this.curvData();
+    },
+    curvData() {
+      if (this.benchmarkingVal === "bench2") {
+        let arr = [];
+        this.cardData.forEach((s) => {
+          this.cardBench.forEach((d) => {
+            if (s.name === d) {
+              arr.push(s.id);
+            }
+          });
+        });
+        this.$nextTick(() => {
+          this.$refs.intervalBench &&
+            this.$refs.intervalBench.init(arr, this.typeNode, this.checkNode);
+        });
+      } else if (this.benchmarkingVal === "bench3") {
+        this.$nextTick(() => {
+          this.$refs.projectBench &&
+            this.$refs.projectBench.init(
+              this.cardSta,
+              this.cardBench,
+              this.checkNode,
+              this.typeNode
+            );
+        });
+      } else if (this.benchmarkingVal === "bench4") {
+        this.$nextTick(() => {
+          this.$refs.wiringBench &&
+            this.$refs.wiringBench.init(
+              this.typeNode,
+              this.checkNode,
+              this.cardSta,
+              this.cardPro,
+              this.cardBench
+            );
+        });
+      } else if (this.benchmarkingVal === "bench5") {
+        this.$nextTick(() => {
+          this.$refs.quarterBench &&
+            this.$refs.quarterBench.init(
+              this.typeNode,
+              this.checkNode,
+              this.cardSta,
+              this.cardPro,
+              this.cardLin,
+              this.cardBench
+            );
+        });
+      }
+    },
+    // 关闭购物车
+    cancel() {
+      this.displaycheck = false;
+    },
     //切换类型
     levels1DataChang() {
       this.checkNode = "";
       this.resetAllFiller();
       this.$router.push({ path: "/economicsOperation/comphomepageGf" });
     },
+    // 获取数据
     async getDataDetial() {
       let { data: res } = await homePage({
         companyId: this.checkNode,
@@ -515,6 +1054,144 @@ export default {
 </script>
 
 <style lang="less" scoped>
+.window {
+  position: absolute;
+  top: 22px;
+  right: -45%;
+  height: 350px;
+  border: 1px solid #094493;
+  border-image: linear-gradient(
+      0deg,
+      rgba(28, 156, 255, 0),
+      rgba(28, 156, 255, 0.6),
+      rgba(28, 156, 255, 0.8)
+    )
+    1 1;
+  background: rgba(29, 34, 43, 0.9) !important;
+  border-radius: 3px;
+  box-shadow: 0 0 22px rgba(0, 70, 199, 0.2) inset !important;
+
+  .stitBorder {
+    position: absolute;
+    width: 70%;
+    height: 2px;
+    top: 0;
+    background-image: linear-gradient(to right, #1c99ff, rgba(0, 70, 199, 0));
+  }
+
+  //box-shadow: 0 0 22px rgb(0 70 199 / 20%) inset !important;
+}
+
+.ststTit {
+  width: 100%;
+  text-align: center;
+  height: 44px;
+  color: #1c99ff;
+  font-size: 16px;
+  line-height: 44px;
+  box-sizing: border-box;
+
+  //cursor: move;
+}
+
+.lines {
+  width: 99%;
+  height: 1px;
+  margin-left: 1px;
+  position: relative;
+  background: #3a3f43;
+
+  &:after {
+    content: "";
+    display: block;
+    width: 9px;
+    height: 1px;
+    background-color: #fff;
+    position: absolute;
+    right: 0;
+  }
+
+  &:before {
+    content: "";
+    display: block;
+    width: 8px;
+    height: 1px;
+    background-color: #fff;
+    position: absolute;
+    left: 0;
+  }
+}
+
+.overHidd {
+  overflow: scroll;
+  height: 70%;
+  width: 100%;
+}
+
+.footerButton {
+  display: flex;
+  justify-content: space-between;
+  width: 90%;
+
+  .footTitle {
+    height: 30px;
+    line-height: 30px;
+    display: flex;
+
+    p {
+      font-size: 14px;
+      font-family: Microsoft YaHei;
+      font-weight: 300;
+      color: #d3d3d3;
+    }
+  }
+
+  .el-button:last-of-type {
+    width: 88px;
+    color: rgba(28, 108, 255, 1);
+    border-radius: 3px;
+    background: rgba(28, 108, 255, 0);
+    border: 1px solid !important;
+    border-image: linear-gradient(0deg, rgba(28, 156, 255, 0), #1d74eb, #1d74eb)
+      1 1 !important;
+  }
+
+  /deep/ .el-button.is-round {
+    padding: 0 10px !important;
+  }
+}
+
+.stations {
+  height: 39px;
+  line-height: 39px;
+  width: 100%;
+  display: flex;
+  border-bottom: 1px solid rgba(76, 85, 90, 1);
+  justify-content: space-between;
+  font-size: 13px;
+  padding-right: 20px;
+  padding-left: 20px;
+  color: rgba(211, 211, 211, 1);
+  white-space: nowrap;
+}
+
+.photovoltaic-filter {
+  /deep/ .el-badge__content--danger {
+    background: #ff6600;
+    border: 1px solid #a5a5a5;
+  }
+
+  /deep/ .el-badge__content.is-fixed {
+    top: 5px;
+    right: 10px;
+  }
+}
+
+.searchColors {
+  background: rgba(0, 70, 199, 0.5) !important;
+  color: #ffffff !important;
+}
+
 :deep(.el-input) {
   .el-input__inner {
     height: 25px !important;
@@ -530,6 +1207,7 @@ export default {
     }
   }
 }
+
 .photovoltaic-filter .status {
   :deep(.el-input) {
     .el-input__inner {
@@ -537,6 +1215,7 @@ export default {
     }
   }
 }
+
 .photovoltaic-filter .station {
   :deep(.el-input) {
     .el-input__inner {
@@ -545,6 +1224,10 @@ export default {
   }
 }
 
+.dialog-body {
+  height: 100%;
+}
+
 .photovoltaicStation {
   display: flex;
   flex-direction: column;
@@ -1066,7 +1749,7 @@ export default {
         display: flex;
         align-items: center;
         margin-left: 10px;
-
+        position: relative;
         .form-box {
           display: flex;
           height: 50px;

+ 306 - 42
src/views/layout/economicsOperation/companyHomepage/indexGf.vue

@@ -258,7 +258,7 @@
             </el-badge>
           </div>
           <div
-            style="z-index: 999; width: 40%; background: #0c0f15"
+            style="z-index: 999; width: 45%; background: #0c0f15"
             class="window"
             v-if="displaycheck === true"
           >
@@ -278,18 +278,6 @@
               style="padding-top: 10px"
               v-if="benchmarkingVal === 'bench1'"
             >
-              <el-time-picker
-                format="HH:mm:ss"
-                value-format="HH:mm:ss"
-                size="mini"
-                v-model="selectTime"
-                placeholder="选择时间"
-                :disabled-hours="disabledHour"
-                :disabled-minutes="disabledMinute"
-                @change="changeTimePick"
-              >
-              </el-time-picker>
-
               <ul
                 v-for="(item, index) in cardBench"
                 :key="index"
@@ -305,12 +293,9 @@
                     text-overflow: ellipsis;
                   "
                 >
-                  {{ item + " " + dateTimes }}
+                  {{ item }}
                 </li>
-
                 <li @click="removeTable(index)" style="cursor: pointer">
-                  <!--                        <el-tooltip class="item" effect="dark" content="删除" placement="right">-->
-                  <!--                        </el-tooltip>-->
                   <i class="el-icon-close"></i>
                 </li>
               </ul>
@@ -333,8 +318,6 @@
                 </li>
 
                 <li @click="removeTable(index)" style="cursor: pointer">
-                  <!--                        <el-tooltip class="item" effect="dark" content="删除" placement="right">-->
-                  <!--                        </el-tooltip>-->
                   <i class="el-icon-close"></i>
                 </li>
               </ul>
@@ -355,18 +338,22 @@
                 </li>
 
                 <li @click="removeTable(index)" style="cursor: pointer">
-                  <!--                        <el-tooltip class="item" effect="dark" content="删除" placement="right">-->
-                  <!--                        </el-tooltip>-->
                   <i class="el-icon-close"></i>
                 </li>
               </ul>
             </div>
             <el-row
               class="footerButton"
-              v-if="benchmarkingVal === 'bench1'"
+              v-if="
+                benchmarkingVal === 'bench1' || benchmarkingVal === 'bench2'
+              "
               style="position: absolute; bottom: 19px; left: 15px"
             >
-              <el-button type="primary" round @click="openCurvDatasedDate"
+              <el-button
+                type="primary"
+                :disabled="cardBench.length < 2"
+                round
+                @click="openCurvData"
                 >开始对标</el-button
               >
               <div class="footTitle" @click="clearTable">
@@ -387,7 +374,11 @@
               v-else
               style="position: absolute; bottom: 19px; left: 15px"
             >
-              <el-button type="primary" round @click="openCurvDatased"
+              <el-button
+                type="primary"
+                :disabled="cardLists.length < 2"
+                round
+                @click="openCurvDatased"
                 >开始对标</el-button
               >
               <div class="footTitle" @click="clearTable">
@@ -455,6 +446,39 @@
         :theme="themeType"
       /> -->
     </div>
+    <el-dialog
+      class="dialogs"
+      width="100%"
+      fullscreen
+      v-model="displaybench"
+      :show-close="true"
+      :destroy-on-close="true"
+    >
+      <template #title>
+        <div class="dialog-title">
+          <img
+            class="dialog-title-img"
+            src="@assets/img/images/dialog-title.png"
+          />
+          <div v-if="benchmarkingVal === 'bench2'" class="title">场际对标</div>
+          <div v-if="benchmarkingVal === 'bench3'" class="title">项目对标</div>
+          <div v-if="benchmarkingVal === 'bench4'" class="title">线路对标</div>
+          <div v-if="benchmarkingVal === 'bench5'" class="title">阵区对标</div>
+          <div v-if="benchmarkingVal === 'bench1'" class="title">场内对标</div>
+        </div>
+      </template>
+      <div class="dialog-body">
+        <img class="dialog-img" src="@assets/img/images/dialog.png" />
+        <siteBench v-if="benchmarkingVal === 'bench1'" ref="siteBench" />
+        <intervalBench
+          v-if="benchmarkingVal === 'bench2'"
+          ref="intervalBench"
+        />
+        <projectBench v-if="benchmarkingVal === 'bench3'" ref="projectBench" />
+        <wiringBench v-if="benchmarkingVal === 'bench4'" ref="wiringBench" />
+        <quarterBench v-if="benchmarkingVal === 'bench5'" ref="quarterBench" />
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -462,18 +486,25 @@
 import Card from "../homePage/components/card.vue";
 import List from "../homePage/components/list.vue";
 import PieChart from "@/components/chart/pie/dual-pie-chart-econey.vue";
-// import PieChart from "@/components/chart/pie/pie-chart.vue";
-// import PieStationTop5 from "@/components/chart/pie/pie-station-top5.vue";
+import siteBench from "@/views//layout/economicsOperation/benchmarkingManagement/siteBenchmarking/index";
+import intervalBench from "@/views//layout/economicsOperation/benchmarkingManagement/intervalBenchmarking/index";
+import projectBench from "@/views//layout/economicsOperation/benchmarkingManagement/projectBenchmarking/index";
+import wiringBench from "@/views//layout/economicsOperation/benchmarkingManagement/wiringBenchmarking/index";
+import quarterBench from "@/views//layout/economicsOperation/benchmarkingManagement/quarterBenchmarking/index";
 import { homePage } from "@/api/economy-homepage.js";
 import { GetOrganization, GetStationByCompany } from "@/api/econ-headerNav.js";
-
+import { GetRegionInfo } from "@/api/home.js";
 export default {
   name: "companyHomepage", // 公司分析
   components: {
     Card,
     List,
     PieChart,
-    // PieStationTop5,
+    siteBench,
+    intervalBench,
+    projectBench,
+    wiringBench,
+    quarterBench,
   },
   data() {
     return {
@@ -482,6 +513,10 @@ export default {
         { type: -1, flag: true, id: "F", name: "风电" },
         { type: -2, flag: true, id: "G", name: "光伏" },
       ],
+      province: {
+        name: "",
+        code: "",
+      },
       typeNode: "-2",
       windSpeedRota: null, // 发电统计仪表盘转动角度
       OrganizationLists: [], // 公司列表
@@ -532,19 +567,54 @@ export default {
       benchCode: "",
       stationData: {},
       dateTimes: null,
+      timerCurvData: null,
+      eventx: "",
+      eventY: "",
+      stationEg: null,
+      cardVal: [],
+      cardVals: [],
+      cardLists: [],
+      cardListed: [],
+      cardNmeCode: [],
+      cardSta: [],
+      cardPro: [],
+      cardLin: [],
     };
   },
 
   methods: {
     init() {
-      this.checkNode = this.$route.query.companyCode || "JS_RGN";
+      let province = JSON.parse(localStorage.getItem("GlobalConfig"));
+      if (!province) {
+        this.getProvinceCode();
+      } else {
+        this.province = {
+          name: province.name,
+          code: province.code,
+        };
+      }
+      this.checkNode = this.$route.query.companyCode || this.province.code;
       this.typeNode = this.levels1Data[1].type;
       this.getDataDetial();
       this.getOrganizationList();
       this.getStationList();
     },
+    async getProvinceCode() {
+      const data = await GetRegionInfo();
+      this.province = {
+        name: data.name,
+        code: data.code,
+      };
+      localStorage.setItem("GlobalConfig", JSON.stringify(data));
+    },
+    // 打开对标框
+    async hidenBenchList(event) {
+      this.displaycheck = !this.displaycheck;
+    },
     // 切换对标方式
     changeNum(val) {
+      // clearInterval(this.timerDetial);
+
       if (val === "") {
         this.$confirm("是否清空对标方式?", "提示", {
           confirmButtonText: "确定",
@@ -559,6 +629,7 @@ export default {
               center: true,
               customClass: "s",
             });
+            this.selectTime = "";
             this.displaycheck = false;
             this.$refs.childCard.changenums();
           })
@@ -567,6 +638,7 @@ export default {
             this.benchmarkingVal = this.didBench;
           });
       }
+
       this.benchChang = val;
     },
     // 点击对标方式
@@ -593,6 +665,7 @@ export default {
               center: true,
               customClass: "s",
             });
+            this.selectTime = "";
             this.benchmarkingVal = val;
             this.$refs.childCard.changenums();
             this.displaycheck = false;
@@ -602,30 +675,216 @@ export default {
           });
       }
     },
-    // 打开对标框
-    async hidenBenchList(event) {
-      this.displaycheck = !this.displaycheck;
+    // 删除购物车内容
+    removeTable(index) {
+      if (this.benchmarkingVal === "bench2") {
+        this.cardBench.splice(index, 1);
+        this.benchNum = this.cardBench.length;
+        if (this.cardBench.length === 0) {
+          this.displaycheck = false;
+        }
+        this.$refs.childCard.changenBench(this.cardBench);
+      } else if (this.benchmarkingVal === "bench1") {
+        let stationAname;
+        this.cardBench.splice(index, 1);
+        this.benchNum = this.cardBench.length;
+        if (this.cardBench.length === 0) {
+          this.displaycheck = false;
+          stationAname = "";
+        } else {
+          stationAname = this.stationData;
+        }
+        this.$refs.childCard.changenBenchs(this.cardBench, stationAname);
+      } else if (
+        this.benchmarkingVal === "bench4" ||
+        this.benchmarkingVal === "bench5" ||
+        this.benchmarkingVal === "bench3"
+      ) {
+        this.cardLists.splice(index, 1);
+        this.cardNmeCode.splice(index, 1);
+        let arr = [];
+        this.cardVal.forEach((s) => {
+          this.cardNmeCode.forEach((z) => {
+            if (z === s.nemCode) {
+              arr.push(s);
+            }
+          });
+        });
+        this.cardVals = [...new Set(arr)];
+        this.cardBench = this.cardNmeCode;
+        if (this.cardNmeCode.length === 0) {
+          this.displaycheck = false;
+        }
+        this.$refs.childCard.changenBench(this.cardBench, this.cardVals);
+        this.benchNum = this.cardNmeCode.length;
+      }
+    },
+    // 清空购物车
+    clearTable() {
+      this.cardBench = [];
+      this.benchNum = this.cardBench.length;
+
+      this.displaycheck = false;
+      if (this.benchmarkingVal === "bench1") {
+        this.$refs.childCard.changenBenchs(this.cardBench, "");
+      } else {
+        this.$refs.childCard.changenBench(this.cardBench);
+      }
+    },
+    disBenTable() {
+      this.displaycheck = false;
     },
     // 点击确认后添加数据
-    setdataed(data, val, dateTime) {
-      this.stationData = val;
+    setdata(data) {
       this.cardBench = data;
       this.benchNum = data.length;
+      if (data.length === 0) {
+        this.displaycheck = false;
+      }
+    },
 
-      if (this.selectTime === "" || this.selectTime === null) {
-        this.dateTimes = dateTime;
-      } else {
-        this.dateTimes = this.selectTime;
+    // 点击确认后添加数据
+    setdataed(data, val) {
+      this.cardBench = data;
+      this.benchNum = data.length;
+      this.stationData = val;
+      if (data.length === 0) {
+        this.displaycheck = false;
       }
     },
-    // 选择数据
-    setdatas(data, val, index) {
-      this.benchIndex = index;
+    setdatas(data, val, sta, pro, lin) {
+      this.cardSta = sta;
+      this.cardPro = pro;
+      this.cardLin = lin;
       this.cardBench = data;
       this.cardVal = val;
       this.benchNum = data.length;
+      if (data.length === 0) {
+        this.displaycheck = false;
+      }
       this.getList();
     },
+    getList() {
+      let arr = [];
+      let data = [];
+      if (this.benchmarkingVal === "bench3") {
+        let n = [];
+        this.cardVal.forEach((s) => {
+          this.cardBench.forEach((z) => {
+            if (s.nemCode === z) {
+              arr.push(s.aname);
+              data.push(s.id);
+              n.push(s);
+            }
+          });
+        });
+        this.cardVals = [...new Set(n)];
+      } else if (
+        this.benchmarkingVal === "bench4" ||
+        this.benchmarkingVal === "bench5"
+      ) {
+        let n = [];
+        this.cardVal.forEach((s) => {
+          this.cardBench.forEach((z, index) => {
+            if (s.nemCode === z) {
+              arr.push(s.names);
+              data.push(s.nemCode);
+              n.push(s);
+            }
+          });
+        });
+        this.cardVals = [...new Set(n)];
+      }
+      this.cardNmeCode = [...new Set(data)];
+      this.cardLists = [...new Set(arr)];
+    },
+    // 场内开始对标
+    openCurvDatasedDate() {
+      let arr = [];
+      this.cardBench.forEach((s) => {
+        arr.push(s);
+      });
+      if (arr.length == 2) {
+        this.displaycheck = false;
+        this.displaybench = true;
+        this.$nextTick(() => {
+          if (this.$refs.siteBench) {
+            this.$refs.siteBench.starTime = arr[0];
+            this.$refs.siteBench.endTime = arr[1];
+          }
+          this.$refs.siteBench &&
+            this.$refs.siteBench.init(
+              this.stationData,
+              this.typeNode,
+              this.checkNode
+            );
+        });
+      }
+    },
+    openCurvData() {
+      this.benchmarkingVal === "bench1"
+        ? this.openCurvDatasedDate()
+        : this.openCurvDatased();
+    },
+    // 开始对标(除场内对标)
+    openCurvDatased() {
+      this.displaycheck = false;
+      this.displaybench = true;
+      this.curvData();
+    },
+    curvData() {
+      if (this.benchmarkingVal === "bench2") {
+        let arr = [];
+        this.cardData.forEach((s) => {
+          this.cardBench.forEach((d) => {
+            if (s.name === d) {
+              arr.push(s.id);
+            }
+          });
+        });
+        this.$nextTick(() => {
+          this.$refs.intervalBench &&
+            this.$refs.intervalBench.init(arr, this.typeNode, this.checkNode);
+        });
+      } else if (this.benchmarkingVal === "bench3") {
+        this.$nextTick(() => {
+          this.$refs.projectBench &&
+            this.$refs.projectBench.init(
+              this.cardSta,
+              this.cardBench,
+              this.checkNode,
+              this.typeNode
+            );
+        });
+      } else if (this.benchmarkingVal === "bench4") {
+        this.$nextTick(() => {
+          this.$refs.wiringBench &&
+            this.$refs.wiringBench.init(
+              this.typeNode,
+              this.checkNode,
+              this.cardSta,
+              this.cardPro,
+              this.cardBench
+            );
+        });
+      } else if (this.benchmarkingVal === "bench5") {
+        this.$nextTick(() => {
+          this.$refs.quarterBench &&
+            this.$refs.quarterBench.init(
+              this.typeNode,
+              this.checkNode,
+              this.cardSta,
+              this.cardPro,
+              this.cardLin,
+              this.cardBench
+            );
+        });
+      }
+    },
+    // 关闭购物车
+    cancel() {
+      this.displaycheck = false;
+    },
     //切换类型
     levels1DataChang() {
       this.checkNode = "";
@@ -805,7 +1064,7 @@ export default {
 .window {
   position: absolute;
   top: 22px;
-  right: -40%;
+  right: -45%;
   height: 350px;
   border: 1px solid #094493;
   border-image: linear-gradient(
@@ -920,6 +1179,7 @@ export default {
   padding-right: 20px;
   padding-left: 20px;
   color: rgba(211, 211, 211, 1);
+  white-space: nowrap;
 }
 
 .photovoltaic-filter {
@@ -971,6 +1231,10 @@ export default {
   }
 }
 
+.dialog-body {
+  height: 100%;
+}
+
 .photovoltaicStation {
   display: flex;
   flex-direction: column;

+ 150 - 94
src/views/layout/economicsOperation/homePage/components/card.vue

@@ -1,5 +1,6 @@
 <template>
-  <div class="jjj" style="width: 100%">
+  <div style="height: 100%; overflow-y: auto">
+    <!--        加入对标弹窗-->
     <!--        加入对标弹窗-->
     <div
       @mouseenter="leaveList(true)"
@@ -27,7 +28,7 @@
           <div>
             <div
               class="overHidd"
-              v-for="(items, index) in stationEG.datas"
+              v-for="(items, index) in stationEG.children"
               :key="index"
             >
               <div class="dots"></div>
@@ -52,7 +53,7 @@
           </div>
           <div
             class="overLeft"
-            v-for="(items, index) in stationEG.datas"
+            v-for="(items, index) in stationEG.children"
             :key="index"
           >
             <div class="overHidd">
@@ -79,7 +80,7 @@
             <div v-if="overIndex === index">
               <div
                 class="overHidden"
-                v-for="(val, index) in items.datas"
+                v-for="(val, index) in items.children"
                 :key="index"
               >
                 <div class="dots"></div>
@@ -109,7 +110,7 @@
           </div>
           <div
             class="overLeft"
-            v-for="(items, index) in stationEG.datas"
+            v-for="(items, index) in stationEG.children"
             :key="index"
           >
             <div class="overHidd">
@@ -136,7 +137,7 @@
             <div v-if="overIndex === index">
               <div
                 class="overHeader"
-                v-for="(val, indexe) in items.datas"
+                v-for="(val, indexe) in items.children"
                 :key="indexe"
               >
                 <div class="overHidds">
@@ -162,7 +163,7 @@
                 <div v-if="overIndexs === indexe">
                   <div
                     class="overHidded"
-                    v-for="(vals, index) in val.datas"
+                    v-for="(vals, index) in val.children"
                     :key="index"
                   >
                     <div class="dots"></div>
@@ -210,12 +211,6 @@
               >
             </el-checkbox-group>
             <div class="card-list">
-              <div class="border-corner">
-                <div class="border-top"></div>
-                <div class="border-right"></div>
-                <div class="border-bottom"></div>
-                <div class="border-left"></div>
-              </div>
               <!--                            加入购物车图标-->
 
               <div
@@ -252,13 +247,16 @@
               <div class="benchIndex" v-if="benchmarkingVal === 'bench1'">
                 <el-date-picker
                   ref="datePicker"
-                  type="dates"
+                  size="mini"
+                  type="daterange"
+                  range-separator="To"
                   v-model="searchObj"
                   :editable="false"
                   format="YYYY-MM-DD"
                   value-format="YYYY-MM-DD"
-                  popper-class="elDatePickers"
                   placeholder=" "
+                  popper-class="benchRange"
+                  @blur="blurDate(item)"
                   @focus="getDate(item)"
                   :disabled-date="pickerOptions"
                   @change="
@@ -483,75 +481,22 @@ export default {
     },
     // 选择日期
     hangDate(val, data) {
-      this.searchObj = this.searchDate;
-      let date = new Date();
-      let hour = date.getHours() > 9 ? date.getHours() : "0" + date.getHours();
-      let min =
-        date.getMinutes() > 9 ? date.getMinutes() : "0" + date.getMinutes();
-      let dateTime = hour + ":" + min + ":00";
-
-      if (val) {
-        this.$parent.setdataed(val, data, dateTime);
-        this.stationName = data.ANAMES;
+      if (val !== [] && val?.length == 2) {
+        this.stationName = data.name;
         this.searchDate = val;
       }
     },
     // 获取焦点
     getDate(val) {
-      console.log(val);
       if (this.stationName !== val.name) {
         this.searchObj = [];
-      }
-    },
-    //转换时间
-    getchangeTime(data) {
-      if (data != undefined && data != "") {
-        var date = new Date(data);
-        var y = date.getFullYear();
-        var m = date.getMonth() + 1;
-        var d = date.getDate();
-        var h = date.getHours();
-        var f = date.getMinutes();
-        var s = date.getSeconds();
-        m = m < 10 ? "0" + m : m;
-        d = d < 10 ? "0" + d : d;
-        h = h < 10 ? "0" + h : h;
-        f = f < 10 ? "0" + f : f;
-        s = s < 10 ? "0" + s : s;
-        return y + "-" + m + "-" + d + " " + h + ":" + f + ":" + s;
       } else {
-        return "--";
+        this.searchObj = this.searchDate;
       }
     },
-    // 点击状态 打开对比曲线图
-    showCurve(item) {
-      const param = [
-        {
-          statiomName: "场站状态",
-          stse: item.NAME,
-          sts: item.curveData.curveCZZT,
-        },
-      ];
-      // const param = [
-      //   {statiomName: '实时功率', stse: item.NAME, sts: item.curveData.curveSSZGL},
-      //   {statiomName: '日发电量', stse: item.NAME, sts: item.curveData.curveRFDL},
-      //   {statiomName: '月发电量', stse: item.NAME, sts: item.curveData.curveYFDL},
-      //   {statiomName: '总辐射量', stse: item.NAME, sts: item.curveData.curveZFSL},
-      //   {statiomName: '日等效小时', stse: item.NAME, sts: item.curveData.curveRLYXS},
-      // ]
-      this.$refs.child.openCurvDatas(param);
-    },
-    calcPercentage(arr, index) {
-      let total = 0;
-      arr.forEach((num) => {
-        if (typeof num == "number") {
-          total += num;
-        }
-      });
-      if (typeof arr[index] == "number") {
-        return ((arr[index] / total) * 100).toFixed(2) + "%";
-      } else {
-        return arr[index];
+    blurDate(vales) {
+      if (this.searchObj !== [] && this.searchObj?.length > 0) {
+        this.$parent.setdataed(this.searchObj, vales);
       }
     },
     jumpLevelTwo(param) {
@@ -586,10 +531,6 @@ export default {
         }
       }
     },
-    dataFix(num) {
-      let str = typeof num == "number" ? Number(num).toFixed(0) : num;
-      return str;
-    },
     deepClone(ob) {
       var obj = JSON.stringify(ob);
       var objClone = JSON.parse(obj);
@@ -623,11 +564,129 @@ export default {
     handleCheckAllChange(val) {
       this.$parent.setdata(val);
     },
+    // 购物车添加期数
+    handChangeChouse(val) {
+      this.stationEG.children.forEach((s) => {
+        this.stationGan.push(s);
+      });
+      let srd = [];
+      let sta = [];
+      this.stationGan.forEach((n) => {
+        val.forEach((z) => {
+          if (z === n.id) {
+            srd.push(n.aname);
+            sta.push(n.parentCode);
+          }
+        });
+      });
+      this.stationName = srd;
+      this.$parent.setdatas(val, this.stationGan, [...new Set(sta)]);
+    },
+    // 购物车添加线路
+    handChangeChouses(val) {
+      this.stationEG.children.forEach((s) => {
+        s.children.forEach((z) => {
+          this.stationGans.push(z);
+        });
+      });
+      let srd = [];
+      let sta = [];
+      let pro = [];
+      this.stationGans.forEach((n) => {
+        val.forEach((z) => {
+          if (z === n.id) {
+            srd.push(n.aname);
+            pro.push(n.parentCode);
+          }
+        });
+      });
+      this.stationEG.children.forEach((s) => {
+        pro.forEach((p) => {
+          if (s.id == p) {
+            sta.push(s.parentCode);
+          }
+        });
+      });
+      this.stationName = srd;
+      this.$parent.setdatas(
+        val,
+        this.stationGans,
+        [...new Set(sta)],
+        [...new Set(pro)]
+      );
+    },
+    // 购物车添加阵区
+    handChangeChoused(val, vals) {
+      this.stationEG.children.forEach((s) => {
+        s.children.forEach((z) => {
+          z.children.forEach((vals) => {
+            this.stationGansd.push(vals);
+          });
+        });
+      });
+      let srd = [];
+      let sta = [];
+      let pro = [];
+      let lin = [];
+      this.stationGansd.forEach((n) => {
+        val.forEach((z) => {
+          if (z === n.nemCode) {
+            srd.push(n.stationName);
+            lin.push(n.parentCode);
+          }
+        });
+      });
+      this.stationEG.children.forEach((s) => {
+        s.children.forEach((p) => {
+          lin.forEach((l) => {
+            if (p.id == l) {
+              pro.push(p.parentCode);
+              sta.push(s.parentCode);
+            }
+          });
+        });
+      });
+      this.stationName = srd;
+
+      this.$parent.setdatas(
+        val,
+        this.stationGansd,
+        [...new Set(sta)],
+        [...new Set(pro)],
+        [...new Set(lin)]
+      );
+    },
+    // 点击修改线路阵区名加场站
+    changeCheck(val) {
+      this.stationEG.children.forEach((s) => {
+        s.stationName = this.stationEG.aname;
+        s.children.forEach((n) => {
+          n.names = this.stationEG.aname + n.aname;
+          n.stationName = this.stationEG.aname;
+          n.children.forEach((z) => {
+            z.names = this.stationEG.aname + z.aname;
+            z.stationName = this.stationEG.aname;
+          });
+        });
+      });
+    },
+    // 鼠标移出加入对标弹窗消失
+    leaveList(val) {
+      this.disBenchList = val;
+    },
+    // 加入对标弹框期次点击收合
+    handOverIndex(index) {
+      if (this.overIndex == index) {
+        this.overIndex = -1;
+      } else {
+        this.overIndex = index;
+      }
+      this.overIndexs = 0;
+    },
     // 添加对标数据
     async addBenchmarking(val, index, event) {
       this.stationEG = [];
       let eveent = event || window.event;
-      let dom = document.getElementsByClassName("jjj")[0];
       this.eventx = eveent.pageX;
       this.eventY = eveent.pageY;
       this.benchIndex = index;
@@ -646,7 +705,7 @@ export default {
     },
     // 获取对应树型结构
     async getTreeList(val, orgType) {
-      const data = await GetTreeList({
+      const { data } = await GetTreeList({
         wpId: val.id,
         treeType: orgType,
       });
@@ -665,15 +724,20 @@ export default {
       this.stationName = [];
       this.$parent.setdata(this.benchVal);
     },
+
     changenBenchs(data, val) {
       this.searchObj = data;
       this.searchDate = data;
       if (val === "") {
         this.stationName = [];
       } else {
-        this.stationName = val?.ANAMES;
+        this.stationName = val?.name;
       }
     },
+    changenDate(data) {
+      this.searchObj = data;
+      this.searchDate = data;
+    },
     // 购物车删除
     changenBench(data, val) {
       if (val != undefined) {
@@ -980,7 +1044,7 @@ export default {
 .el-checkbox_tit {
   width: 60px;
   position: absolute;
-  right: 30px;
+  right: -10px;
   top: 15px;
   z-index: 9;
 
@@ -1009,6 +1073,7 @@ export default {
     margin-left: 10px;
   }
 }
+
 ::v-deep .el-input--mini .el-input__inner {
   background: #212933 !important;
 }
@@ -1036,23 +1101,14 @@ export default {
       padding: 25px;
       overflow: hidden;
       margin-bottom: 15px;
-      .benchIndex {
+      .benchIndex ::v-deep {
         position: absolute;
         right: 20px;
-        background: #409eff;
+        // background: #409eff;
         z-index: 1;
-        /deep/ .el-input {
+        .el-date-editor--daterange {
           opacity: 0;
           cursor: pointer;
-          position: absolute;
-          width: 20px;
-          top: -8px;
-          right: 38px;
-          height: 19px;
-
-          .el-input__inner {
-            cursor: pointer;
-          }
         }
       }