Sfoglia il codice sorgente

Merge branch 'baiyanting' of http://124.70.43.205:3000/xieshengjie/jn_sis_zhfx into baiyanting1

baiyanting 1 anno fa
parent
commit
d314df11a9

+ 13 - 13
src/views/economicsOperation/windAnalyse/monthlyAnalysis/reportDialog.vue

@@ -529,47 +529,47 @@ export default {
     //五项损失
     makeFiveBarEchart(res) {
       let arrwslegend = [
-        "限电损失电量",
-        "性能未达标损失电量",
         "检修损失电量",
         "故障损失电量",
+        "限电损失电量",
         "受累损失电量",
+        "性能未达标损失电量",
       ];
       let arrwsdata = [
         {
-          name: "限电损失电量",
+          name: "检修损失电量",
           type: "bar",
           stack: "one",
           barWidth: "25",
-          data: res.ws.map((i) => i.xdss),
+          data: res.ws.map((i) => i.jxss),
         },
         {
-          name: "性能未达标损失电量",
+          name: "故障损失电量",
           type: "bar",
           stack: "one",
           barWidth: "25",
-          data: res.ws.map((i) => i.xnss),
+          data: res.ws.map((i) => i.gzss),
         },
         {
-          name: "检修损失电量",
+          name: "限电损失电量",
           type: "bar",
           stack: "one",
           barWidth: "25",
-          data: res.ws.map((i) => i.jxss),
+          data: res.ws.map((i) => i.xdss),
         },
         {
-          name: "故障损失电量",
+          name: "受累损失电量",
           type: "bar",
           stack: "one",
           barWidth: "25",
-          data: res.ws.map((i) => i.gzss),
+          data: res.ws.map((i) => i.slss),
         },
         {
-          name: "受累损失电量",
+          name: "性能未达标损失电量",
           type: "bar",
           stack: "one",
           barWidth: "25",
-          data: res.ws.map((i) => i.slss),
+          data: res.ws.map((i) => i.xnss),
         },
       ];
 
@@ -580,7 +580,7 @@ export default {
     getFiveBarEchart(xAxis, lenged, series) {
       let option = {
         backgroundColor: this.showWhite ? "#fff" : "",
-        color: ["#c531c7", "#05bb4c", "#e17e23", "#ba3237", "#000"],
+        color: [ "#e17e23", "#ba3237", "#c531c7", "#000","#05bb4c",],
         title: {
           text: "损失电量分析",
           textStyle: {

+ 104 - 27
src/views/economicsOperation/windAnalyse/singleWindAnasyle/windDetailDialog.vue

@@ -148,7 +148,35 @@
       </panel>
       <div class="table-info">
         <panel class="table-panel" :title="'当日报警记录'" :showLine="false">
-          <Table :data="warnTableData" :canScroll="true" :height="'100%'" />
+          <el-table
+            :data="warnTableData.data"
+            height="calc(100% - 33px)"
+            stripe
+            size="mini"
+          >
+            <el-table-column
+              v-for="(item, index) in warnTableData.column"
+              :key="index"
+              align="center"
+              :label="item.name"
+              :prop="item.field"
+            />
+          </el-table>
+          <el-pagination
+            v-if="warnPage.total > 0"
+            hide-on-single-page
+            style="text-align: center"
+            @current-change="
+              (val) => {
+                warnPage.pageNum = val;
+                getWarnTableData();
+              }
+            "
+            :current-page="warnPage.pageNum"
+            :page-size="warnPage.pageSize"
+            layout="total,  prev, pager, next, jumper"
+            :total="warnPage.total"
+          ></el-pagination>
         </panel>
         <panel class="table-panel" :title="'当日故障记录'" :showLine="false">
           <Table :data="stopTableData" :canScroll="true" :height="'100%'" />
@@ -382,7 +410,35 @@
             :title="'当日报警记录'"
             :showLine="false"
           >
-            <Table :data="warnTableData" :canScroll="true" :height="'23vh'" />
+            <el-table
+              :data="warnTableData.data"
+              height="calc(100% - 33px)"
+              stripe
+              size="mini"
+            >
+              <el-table-column
+                v-for="(item, index) in warnTableData.column"
+                :key="index"
+                align="center"
+                :label="item.name"
+                :prop="item.field"
+              />
+            </el-table>
+            <el-pagination
+              v-if="warnPage.total > 0"
+              hide-on-single-page
+              style="text-align: center"
+              @current-change="
+                (val) => {
+                  warnPage.pageNum = val;
+                  getWarnTableData();
+                }
+              "
+              :current-page="warnPage.pageNum"
+              :page-size="warnPage.pageSize"
+              layout="total,  prev, pager, next, jumper"
+              :total="warnPage.total"
+            ></el-pagination>
           </panel>
           <panel
             class="table-panel outline"
@@ -879,7 +935,8 @@ import RadarChart from "@/components/chart/radar/radar-chart.vue";
 import panel from "@/components/coms/panel/panel.vue";
 import Table from "@/components/coms/table/table.vue";
 import randerNewChart from "./raderswithhart.vue";
-
+import dayjs from "dayjs";
+import { alarm_history } from "@/api/zhbj/index.js";
 import {
   getApifindWtRealPowerChar,
   getApigetplotBands,
@@ -969,26 +1026,26 @@ export default {
         column: [
           {
             name: "风机",
-            field: "windturbineid",
+            field: "code",
             is_num: false,
             is_light: false,
           },
           {
             name: "描述",
-            field: "warnDesc",
+            field: "description",
             is_num: false,
             is_light: false,
           },
           {
             name: "报警时间",
-            field: "warningtime",
+            field: "ts",
             is_num: false,
             is_light: false,
           },
         ],
         data: [],
       },
-
+      warnPage: { pageSize: 5, pageNum: 1, total: 0 },
       stopTableData: {
         column: [
           {
@@ -1355,23 +1412,42 @@ export default {
       }
     },
     // tab1 - 获取当日报警数据
-    async getWarnData() {
-      let that = this;
+    async getWarnTableData() {
       let params = {
-        wtId: that.wtId,
-        recorddate: that.recorddate,
-        pageNum: "1",
-        pageSize: "5",
+        pageNum: this.warnPage.pageNum,
+        pageSize: this.warnPage.pageSize,
+        alarmId: "",
+        alarmType: "windturbine",
+        stationid: this.wpId,
+        deviceid: this.wtId,
+        modelId: "",
+        components: "",
+        description: "",
+        begin:
+          dayjs(this.recorddate).format("YYYY-MM-DD") !=
+          dayjs(new Date()).format("YYYY-MM-DD")
+            ? dayjs(this.recorddate)
+                .startOf("day")
+                .format("YYYY-MM-DD HH:mm:ss")
+            : dayjs(new Date()).startOf("day").format("YYYY-MM-DD HH:mm:ss"),
+        end:
+          dayjs(this.recorddate).format("YYYY-MM-DD") !=
+          dayjs(new Date()).format("YYYY-MM-DD")
+            ? dayjs(this.recorddate).endOf("day").format("YYYY-MM-DD HH:mm:ss")
+            : dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss"),
       };
-      //   const { data: datas } = await getApibjjllist(params);
-      //   if (datas && datas.data && datas.data.records.length > 0) {
-      //     datas.data.records.forEach((ele) => {
-      //       ele.warningtime = new Date(ele.warningtime).formatDate(
-      //         "yyyy-MM-dd hh:mm:ss"
-      //       );
-      //     });
-      //     that.warnTableData.data = datas.data.records;
-      //   }
+      const { data: datas } = await alarm_history(params);
+
+      if (datas && datas.ls && datas.ls.length > 0) {
+        datas.ls.forEach((ele) => {
+          ele.ts = dayjs(ele.ts).format("YYYY-MM-DD HH:mm:ss");
+        });
+        this.warnTableData.data = datas.ls;
+        this.warnPage.total = datas.total;
+      } else {
+        this.warnTableData.data = [];
+        this.warnPage.total = 0;
+      }
     },
     // tab1 - 获取当日故障数据
     async getStopData() {
@@ -1752,11 +1828,11 @@ export default {
       if (this.tabIndex === 0) {
         this.getLostChartData();
         this.getPowerChartData();
-        this.getWarnData();
+        this.getWarnTableData();
         this.getStopData();
         this.getXdData();
       } else if (this.tabIndex === 1) {
-        this.getWarnData();
+        this.getWarnTableData();
         this.getStopData();
         this.getDayPowerInfo();
         this.getMonthWarnRecord();
@@ -1893,6 +1969,7 @@ export default {
       flex-wrap: wrap;
       justify-content: space-between;
       height: 100%;
+      color: #05bb4c;
       &.month-3 {
         .info-item {
           height: calc((100% - 8px * 4) / 5);
@@ -1939,7 +2016,7 @@ export default {
 
         .value {
           font-size: 16px;
-          color: #1c99ff;
+          color: #05bb4c;
         }
       }
     }
@@ -1987,7 +2064,7 @@ export default {
         .dot {
           width: 7px;
           height: 7px;
-          background: #0046c7;
+          background: #05bb4c;
           display: inline-block;
           margin-right: 8px;
         }
@@ -2023,7 +2100,7 @@ export default {
         .dot {
           width: 7px;
           height: 7px;
-          background: #0046c7;
+          background: #05bb4c;
           display: inline-block;
           margin-right: 8px;
         }