Browse Source

报警预警模块上传

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 4 months ago
parent
commit
d66e637f40
32 changed files with 2574 additions and 968 deletions
  1. 11 3
      .env.development
  2. 7 0
      .env.production
  3. BIN
      public/static/sound/lv4.mp3
  4. BIN
      public/static/sound/lv5.mp3
  5. 404 1
      src/App.vue
  6. 98 65
      src/api/zhbj/index.js
  7. 9 0
      src/router/index.js
  8. 34 0
      src/store/index.js
  9. 374 339
      src/themeDark.less
  10. 2 2
      src/utils/ws.js
  11. 352 8
      src/views/IntegratedAlarm/alarmConfig/components/custom_components.vue
  12. 8 2
      src/views/IntegratedAlarm/alarmConfig/components/windturbine_components.vue
  13. 1 1
      src/views/IntegratedAlarm/alarmConfig/historyConfig/index.vue
  14. 5 5
      src/views/IntegratedAlarm/deviceConfig/components/custom.vue
  15. 69 55
      src/views/IntegratedAlarm/deviceConfig/components/custom_components.vue
  16. 56 50
      src/views/IntegratedAlarm/deviceConfig/components/faultmode.vue
  17. 5 5
      src/views/IntegratedAlarm/deviceConfig/components/message.vue
  18. 4 4
      src/views/IntegratedAlarm/deviceConfig/components/windturbine.vue
  19. 1 1
      src/views/IntegratedAlarm/deviceConfig/components/windturbine_components.vue
  20. 19 19
      src/views/IntegratedAlarm/deviceConfig/components/ycpoint.vue
  21. 21 23
      src/views/IntegratedAlarm/deviceConfig/components/yxpoint.vue
  22. 23 20
      src/views/IntegratedAlarm/deviceConfig/index.vue
  23. 696 0
      src/views/IntegratedAlarm/earlyWarning/index.vue
  24. 75 75
      src/views/IntegratedAlarm/reliability/customAnalyse/index.vue
  25. 55 55
      src/views/IntegratedAlarm/reliability/historyAnalyse/index.vue
  26. 1 1
      src/views/IntegratedAlarm/safe/components/safecomponent.vue
  27. 79 79
      src/views/IntegratedAlarm/safe/customWarning/index.vue
  28. 42 35
      src/views/IntegratedAlarm/safe/dataSearch/index.vue
  29. 84 83
      src/views/IntegratedAlarm/safe/historyWarning/index.vue
  30. 35 34
      src/views/IntegratedAlarm/safe/stopQuery/index.vue
  31. 1 2
      src/views/generatingCapacity/dataFilter/process/index.vue
  32. 3 1
      src/views/generatingCapacity/dataFilter/process/search.vue

+ 11 - 3
.env.development

@@ -18,14 +18,14 @@ VUE_APP_LOGIN_URL = 'http://192.168.0.232:48080'
 # 马力军
 # VUE_APP_GENERAT_URL = 'http://192.168.2.45:9002'
 # 王波
-VUE_APP_GENERAT_URL = 'http://192.168.2.232:9002'
+VUE_APP_GENERAT_URL = 'http://192.168.0.101:9002'
 
 # 智能报表
 # VUE_APP_REPORT_URL = 'http://192.168.0.102:9001'
 # 马力军
 # VUE_APP_REPORT_URL = 'http://192.168.2.45:9001'
 # 王波
-VUE_APP_REPORT_URL = 'http://192.168.2.232:9001'
+VUE_APP_REPORT_URL = 'http://192.168.0.101:9001'
 
 # 功率预测
 # 徐世利
@@ -33,7 +33,15 @@ VUE_APP_REPORT_URL = 'http://192.168.2.232:9001'
 # 马力军
 # VUE_APP_BASE_URL = 'http://192.168.2.45:8086'
 # 王波
-VUE_APP_BASE_URL = 'http://192.168.2.232:8086'
+VUE_APP_BASE_URL = 'http://192.168.0.101:8086'
+
+# 综合报警
+# VUE_APP_ALARM = 'http://10.127.7.241:6015'
+VUE_APP_ALARM = 'http://172.16.12.101:6015'
+# VUE_APP_ALARM = 'http://localhost:6015'
+
+# VUE_APP_ADP_BASE_URL = 'http://10.127.7.241:6015'
+VUE_APP_ADP_BASE_URL = 'http://172.16.12.103'
 
 # 百度地图KEY
 VUE_APP_BAIDU_MAP_KEY = ''

+ 7 - 0
.env.production

@@ -44,5 +44,12 @@ VUE_APP_BASE_URL = 'http://172.16.12.101:8086'
 # VUE_APP_BASE_URL = 'http://192.168.2.231:8086'
 # VUE_APP_BASE_URL = 'http://127.0.0.1:8086'
 
+# 综合报警
+# VUE_APP_ALARM = 'http://10.127.7.241:6015'
+VUE_APP_ALARM = 'http://172.16.12.101:6015'
+
+# VUE_APP_ADP_BASE_URL = 'http://10.127.7.241:6015'
+VUE_APP_ADP_BASE_URL = 'http://172.16.12.101'
+
 # 百度地图KEY
 VUE_APP_BAIDU_MAP_KEY = ''

BIN
public/static/sound/lv4.mp3


BIN
public/static/sound/lv5.mp3


+ 404 - 1
src/App.vue

@@ -185,6 +185,14 @@ import left_B from "@/assets/images/headerCom/left_B.png";
 import right_W from "@/assets/images/headerCom/right_W.png";
 import left_W from "@/assets/images/headerCom/left_W.png";
 
+import dayjs from "dayjs";
+import {
+  alarm_history,
+  fetchStationListAll,
+  getAllStation,
+} from "@/api/zhbj/index.js";
+import { ElNotification } from "element-plus";
+
 export default {
   components: {
     commonHeader,
@@ -872,6 +880,10 @@ export default {
               name: "数据查询",
               index: "/integratedAlarm/dataSearch",
             },
+            {
+              name: "预警排查方案",
+              index: "/integratedAlarm/earlyWarning",
+            },
           ],
         },
         {
@@ -896,7 +908,7 @@ export default {
           svg: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="25" height="25"><path fill="#33cab8" d="M389.44 768a96.064 96.064 0 0 1 181.12 0H896v64H570.56a96.064 96.064 0 0 1-181.12 0H128v-64zm192-288a96.064 96.064 0 0 1 181.12 0H896v64H762.56a96.064 96.064 0 0 1-181.12 0H128v-64zm-320-288a96.064 96.064 0 0 1 181.12 0H896v64H442.56a96.064 96.064 0 0 1-181.12 0H128v-64z"></path></svg>`,
           img: gener_fdsjzb,
           name: "报警配置",
-          index: "/integratedAlarm/customConfig",
+          index: "/integratedAlarm/historyConfig",
           children: [
             {
               name: "预警配置",
@@ -924,6 +936,51 @@ export default {
       fixed: false,
       // swichTheme: false,
       swichTheme: true, // 默认白色版本
+      x: null,
+      y: null,
+      alarmConfigArray: [],
+      //请求参数
+      requestAlarmHistoryParams: [
+        {
+          alarmType: "booststation",
+          deviceType: "",
+        },
+        {
+          alarmType: "inverter",
+          deviceType: "",
+        },
+        {
+          alarmType: "windturbine",
+          deviceType: "",
+        },
+        {
+          alarmType: "custom",
+          deviceType: "inverter",
+        },
+        {
+          alarmType: "custom",
+          deviceType: "windturbine",
+        },
+      ],
+      alarmList: [
+        {
+          tsName: "06-11 12:00:00",
+          wpName: "风电场1",
+          deviceName: "#36",
+          description: "变频器报告电网已接入",
+          isClose: true,
+        },
+        {
+          tsName: "06-11 12:00:00",
+          wpName: "风电场2",
+          deviceName: "#58",
+          description: "风机等待运行就绪",
+          isClose: false,
+        },
+      ],
+      dialogList: [],
+      realList: [],
+      audioElement: null,
     };
   },
   watch: {
@@ -939,6 +996,62 @@ export default {
 
   async created() {
     await this.initWebSocket();
+    await this.getAllStation();
+    this.getAlarmConfig();
+    this.x = 80;
+    this.y = 80;
+    let requestResult = [];
+    this.requestAlarmHistoryParams.forEach(({ alarmType, deviceType }) => {
+      requestResult.push(this.getAlarmHistory(alarmType, deviceType));
+    });
+
+    Promise.all(requestResult)
+      .then((promiseResult) => {
+        this.alarmList = [];
+        promiseResult.forEach(({ data }) => {
+          data?.ls?.forEach((ele) => {
+            this.pushALarmItem(ele);
+          });
+        });
+        this.dialogList.sort((a, b) => {
+          return b.ts - a.ts;
+        });
+        this.realList.sort((a, b) => {
+          return b.ts - a.ts;
+        });
+        this.$store.commit("changeAlarmlist", this.alarmList);
+        this.$store.commit("setWarning", this.dialogList);
+        this.$store.commit("setWarningList", this.realList);
+        // if (!this.socketLeaveFlag) {
+        //   // 没有离开——重连
+        //   // websocket重连
+        //   this.socketReconnect1();
+        // }
+      })
+      .catch(() => {
+        requestResult.forEach((ele, index) => {
+          ele
+            .then(({ data }) => {
+              data?.ls?.forEach((ele) => {
+                this.pushALarmItem(ele);
+              });
+            })
+            .catch((error) => {
+              ElNotification({
+                type: "error",
+                title: "查询历史未处理报警请求出错!",
+                dangerouslyUseHTMLString: true,
+                message: `<div class="currentRequestErrorNotification">
+                                <p><span>主要参数:</p>
+                                <p style="color:var(--el-color-primary)"><span class="errorTitle">alarmType:</span><span class="errorDesc">"${this.requestAlarmHistoryParams[index].alarmType}"</span></p>
+                                <p style="color:var(--el-color-primary)"><span class="errorTitle">deviceType:</span><span class="errorDesc">"${this.requestAlarmHistoryParams[index].deviceType}"</span></p>
+                                <p style="color:var(--el-color-danger)"><span class="errorTitle">错误正文:</span><span class="errorDesc">${error}</span></p>
+                             </div>`,
+              });
+              throw error;
+            });
+        });
+      });
   },
 
   mounted() {
@@ -978,6 +1091,296 @@ export default {
     this.$websocket.close();
   },
   methods: {
+    // 获取全部场站(不分风电光伏)
+    async getAllStation() {
+      const { data: datas } = await getAllStation();
+      // const { data: datas } = await fetchStationListAll();
+      if (datas) {
+        this.$store.commit("changeStationAll", datas);
+      } else {
+        this.$store.commit("changeStationAll", []);
+      }
+    },
+
+    //获取报警配置
+    getAlarmConfig() {
+      if (localStorage.getItem("alarmConfigArray")) {
+        this.alarmConfigArray = JSON.parse(
+          localStorage.getItem("alarmConfigArray")
+        );
+      } else {
+        this.alarmConfigArray = [
+          {
+            id: "1",
+            alarmLevel: 1,
+            isAlart: false,
+            isAlarmSound: false,
+            isContinuousAlarm: false,
+          },
+          {
+            id: "2",
+            alarmLevel: 2,
+            isAlart: false,
+            isAlarmSound: false,
+            isContinuousAlarm: false,
+          },
+          {
+            id: "3",
+            alarmLevel: 3,
+            isAlart: false,
+            isAlarmSound: false,
+            isContinuousAlarm: false,
+          },
+          {
+            id: "4",
+            alarmLevel: 4,
+            isAlart: true,
+            isAlarmSound: true,
+            isContinuousAlarm: false,
+          },
+          {
+            id: "5",
+            alarmLevel: 5,
+            isAlart: true,
+            isAlarmSound: true,
+            isContinuousAlarm: true,
+          },
+        ];
+        localStorage.setItem(
+          "alarmConfigArray",
+          JSON.stringify(this.alarmConfigArray)
+        );
+      }
+    },
+
+    pushALarmItem(alarmItem, type) {
+      const configItem = this.getConfigItem(alarmItem.rank);
+      const alarmOption = {
+        id: alarmItem.id ? alarmItem.id : alarmItem.tbname,
+        lv: alarmItem.rank,
+        modelId: alarmItem.modelId,
+        lvName: this.getLvName(alarmItem),
+        rank: alarmItem.rank,
+        confirmed: alarmItem.confirmed,
+        class: `animate__bounceInRight lv${alarmItem.rank}`,
+        deviceId: alarmItem.deviceId,
+        faultCause: alarmItem.faultCause,
+        resolvent: alarmItem.resolvent,
+        characteristic: alarmItem.characteristic,
+        code: alarmItem.code,
+        wpName: alarmItem.stationName
+          ? alarmItem.stationName
+          : alarmItem.wpName,
+        stationId: alarmItem.stationId ? alarmItem.stationId : alarmItem.wpId,
+        isClose: alarmItem.closeTime ? true : alarmItem.endts ? true : false,
+        isCloseName: alarmItem.closeTime
+          ? "已解除"
+          : alarmItem.endts
+          ? "已解除"
+          : "未解除",
+        alarmId: alarmItem.alarmId,
+        alarmType: alarmItem.alarmType,
+        alarmName: this.getAlarmName(alarmItem),
+        description: alarmItem.description,
+        deviceType: alarmItem.deviceType,
+        oval: alarmItem.oval,
+        triggerType: alarmItem.triggerType,
+        ts: alarmItem.ts
+          ? dayjs(alarmItem.ts).valueOf()
+          : dayjs(alarmItem.updateTime).valueOf(),
+        endts: alarmItem.endts
+          ? dayjs(alarmItem.endts).format("YYYY-MM-DD HH:mm:ss")
+          : null,
+        closeTime: alarmItem.closeTime
+          ? dayjs(alarmItem.closeTime).format("YYYY-MM-DD HH:mm:ss")
+          : null,
+        deviceName: alarmItem.deviceName
+          ? alarmItem.deviceName
+          : alarmItem.code,
+        tsName: alarmItem.ts
+          ? new Date(alarmItem.ts).formatDate("MM-dd hh:mm:ss")
+          : new Date(alarmItem.updateTime).formatDate("MM-dd hh:mm:ss"),
+        fullTsName: alarmItem.ts
+          ? new Date(alarmItem.ts).formatDate("yyyy-MM-dd hh:mm:ss")
+          : new Date(alarmItem.updateTime).formatDate("yyyy-MM-dd hh:mm:ss"),
+      };
+      if (
+        alarmOption.alarmType == "booststation" &&
+        alarmOption.deviceType != "custom"
+      ) {
+        if (
+          configItem.isAlarmSound ||
+          configItem.isAlart ||
+          configItem.isContinuousAlarm
+        ) {
+          let a = {};
+          a[`${alarmOption.stationId}`] =
+            alarmOption.closeTime || alarmOption.confirmed ? false : true;
+          this.alarmList.push(a);
+          this.alarmList = [
+            ...new Set(this.alarmList.map((t) => JSON.stringify(t))),
+          ].map((s) => JSON.parse(s));
+        }
+      }
+      if (
+        configItem.isAlarmSound ||
+        configItem.isAlart ||
+        configItem.isContinuousAlarm
+      ) {
+        if (type && type == "ws") {
+          this.dialogList.unshift(alarmOption);
+        } else {
+          this.dialogList.push(alarmOption);
+        }
+      }
+      if (type && type == "ws") {
+        this.realList.unshift(alarmOption);
+      } else {
+        this.realList.push(alarmOption);
+      }
+
+      //    && alarmOption.deviceType != "custom"
+      this.playAudioEffect();
+    },
+
+    playAudioEffect() {
+      const lv1Config = this.getConfigItem(1);
+      let lv1Play = false;
+      if (lv1Config.isAlarmSound) {
+        lv1Play = this.dialogList.some((ele) => {
+          return ele.lv === 1 && !ele.confirm;
+        });
+      }
+      const lv2Config = this.getConfigItem(2);
+      let lv2Play = false;
+      if (lv2Config.isAlarmSound) {
+        lv2Play = this.dialogList.some((ele) => {
+          return ele.lv === 2 && !ele.confirm;
+        });
+      }
+      const lv3Config = this.getConfigItem(3);
+      let lv3Play = false;
+      if (lv3Config.isAlarmSound) {
+        lv3Play = this.dialogList.some((ele) => {
+          return ele.lv === 3 && !ele.confirm;
+        });
+      }
+      const lv4Config = this.getConfigItem(4);
+      let lv4Play = false;
+      if (lv4Config.isAlarmSound) {
+        lv4Play = this.dialogList.some((ele) => {
+          return ele.lv === 4 && !ele.confirm;
+        });
+      }
+      const lv5Config = this.getConfigItem(5);
+      let lv5Play = false;
+      if (lv5Config.isAlarmSound) {
+        lv5Play = this.dialogList.some((ele) => {
+          return ele.lv === 5 && !ele.confirm;
+        });
+      }
+      //   console.log(lv1Play, lv2Play, lv3Play, lv4Play, lv5Play);
+      if (lv5Play && !this.seriousWarning) {
+        this.seriousWarning = true;
+        this.audioElement = new Audio();
+        this.audioElement.src = "./static/sound/lv5.mp3";
+        this.audioElement.loop = true;
+        this.audioElement?.play();
+      } else if (
+        (lv1Play || lv2Play || lv3Play || lv4Play) &&
+        !this.seriousWarning
+      ) {
+        this.audioElement = new Audio();
+        this.audioElement.src = "./static/sound/lv4.mp3";
+        this.audioElement.addEventListener("ended", () => {
+          this.audioElement?.removeEventListener(
+            "ended",
+            this.stopPlayAudioEffect
+          );
+        });
+        this.audioElement?.play();
+      } else {
+        if (!this.seriousWarning) {
+          this.stopPlayAudioEffect();
+        }
+      }
+    },
+
+    stopPlayAudioEffect() {
+      this.seriousWarning = false;
+      if (this.audioElement) {
+        this.audioElement.pause();
+        this.audioElement.currentTime = 0;
+        this.audioElement.loop = false;
+      }
+      this.audioElement = null;
+    },
+
+    //查历史报警
+    getAlarmHistory(alarmType, deviceType) {
+      let params = {
+        pageNum: 1,
+        pageSize: 50,
+        alarmId: "",
+        alarmType,
+        deviceType,
+        stationid: "",
+        deviceid: "",
+        modelId: "",
+        components: "",
+        description: "",
+        isclose: false,
+        begin: dayjs().add(-1, "hour").format("YYYY-MM-DD HH:mm:ss"),
+        end: dayjs().format("YYYY-MM-DD HH:mm:ss"),
+      };
+      if (params.alarmType == "windturbine") {
+        params.stationid = "SXJ_KGDL_DJY_FDC_STA";
+      } else if (params.alarmType == "inverter") {
+        params.stationid = "SXJ_KGDL_JR_GDC_STA";
+      }
+      return alarm_history(params, 12000);
+    },
+
+    getConfigItem(lv) {
+      return (
+        this.alarmConfigArray.find((ele) => {
+          return ele.alarmLevel === lv;
+        }) || {}
+      );
+    },
+
+    getAlarmName(alarmItem) {
+      let alarmName = "";
+      if (alarmItem.deviceType === "booststation") {
+        alarmName = "升压站报警";
+      } else if (alarmItem.deviceType === "inverter") {
+        alarmName = "光伏报警";
+      } else if (alarmItem.deviceType === "windturbine") {
+        alarmName = "设备报警";
+      } else if (alarmItem.deviceType === "station") {
+        alarmName = "场站";
+      }
+
+      if (alarmItem.alarmType === "custom") {
+        alarmName = "自定义报警";
+      }
+      return alarmName;
+    },
+
+    getLvName(alarmItem) {
+      if (alarmItem.rank === 1) {
+        return "低级";
+      } else if (alarmItem.rank === 2) {
+        return "低中级";
+      } else if (alarmItem.rank === 3) {
+        return "中级";
+      } else if (alarmItem.rank === 4) {
+        return "中高级";
+      } else if (alarmItem.rank === 5) {
+        return "高级";
+      }
+    },
+
     progressFormat(value) {
       return `${
         value < 100 ? "数据处理中..." + parseInt(value) + "%" : "数据处理完成"

+ 98 - 65
src/api/zhbj/index.js

@@ -4,15 +4,12 @@ import JSONBIG from "json-bigint";
 export function GetDeviceTableData(data, timeout = 5000) {
   return request({
     baseURL: process.env.VUE_APP_ALARM,
-    url: `/alarminfo/findAlarmlist?begin=${data.begin}&end=${
-      data.end
-    }&alarmType=${data.alarmType}&stationid=${data.stationid}${
-      data.alarmType == "windturbine" || data.alarmType == "inverter"
+    url: `/alarminfo/findAlarmlist?begin=${data.begin}&end=${data.end
+      }&alarmType=${data.alarmType}&stationid=${data.stationid}${data.alarmType == "windturbine" || data.alarmType == "inverter"
         ? `&deviceid=${data.deviceid}`
         : ""
-    }&pageNum=${data.pageNum}&pageSize=${data.pageSize}&description=${
-      data.description
-    }&isclose=${data.isclose}`,
+      }&pageNum=${data.pageNum}&pageSize=${data.pageSize}&description=${data.description
+      }&isclose=${data.isclose}`,
     method: "get",
     timeout,
   });
@@ -21,15 +18,12 @@ export function GetDeviceTableData(data, timeout = 5000) {
 export function GetTableData(data) {
   return request({
     baseURL: process.env.VUE_APP_ALARM,
-    url: `/alarm/history/findAlarmlist?begin=${data.begin}&end=${
-      data.end
-    }&alarmType=${data.alarmType}&stationid=${data.stationid}${
-      data.alarmType == "windturbine" || data.alarmType == "inverter"
+    url: `/alarm/history/findAlarmlist?begin=${data.begin}&end=${data.end
+      }&alarmType=${data.alarmType}&stationid=${data.stationid}${data.alarmType == "windturbine" || data.alarmType == "inverter"
         ? `&deviceid=${data.deviceid}`
         : ""
-    }&pageNum=${data.pageNum}&pageSize=${data.pageSize}&description=${
-      data.description
-    }${data.id ? `&id=${data.id}` : ""}`,
+      }&pageNum=${data.pageNum}&pageSize=${data.pageSize}&description=${data.description
+      }${data.id ? `&id=${data.id}` : ""}`,
     method: "get",
   });
 }
@@ -195,13 +189,10 @@ export const alarm_snap_top = (params) => {
   });
 };
 //数据查询实时数据
-export const getAdapterLatest = (stationId, AIlist, stationType) => {
+export const getAdapterLatest = (stationId, AIlist, stationType, baseURL) => {
   return request({
     url: `ts/latest?uniformCodes=${AIlist}&thingId=${stationId}&thingType=windturbine`,
-    baseURL: `http://10.81.3.162:801${/FDC/.test(stationType) ? "1" : "2"}/`,
-    showLoading: {
-      statu: false,
-    },
+    baseURL: `${baseURL}:801${/FDC/.test(stationType) ? "1" : "2"}/`,
     timeout: 10000,
     transformResponse: [
       function (data) {
@@ -367,9 +358,6 @@ export const getintellList = (query) => {
     params: {
       stationId: query,
     },
-    showLoading: {
-      statu: false,
-    },
   });
 };
 export const getReportList = (params) => {
@@ -377,9 +365,6 @@ export const getReportList = (params) => {
     url: "earlyreport/list",
     method: "get",
     params: params,
-    showLoading: {
-      statu: false,
-    },
   });
 };
 export const getreportReviewList = (query) => {
@@ -395,9 +380,6 @@ export const getHomeOrdercount = (query) => {
   return request({
     url: "home/ordercount",
     method: "get",
-    showLoading: {
-      statu: false,
-    },
   });
 };
 //首页获取机型接口
@@ -406,27 +388,18 @@ export const getHomeAlertrule = (params) => {
     url: "home/alertrule",
     method: "get",
     params: params,
-    showLoading: {
-      statu: false,
-    },
   });
 };
 export const getHomeDangerHidden = (params) => {
   return request({
     url: "home/hidden/danger",
     method: "get",
-    showLoading: {
-      statu: false,
-    },
   });
 };
 export const getHomeDurationTotal = (params) => {
   return request({
     url: "home/total/duration",
     method: "get",
-    showLoading: {
-      statu: false,
-    },
   });
 };
 // 巡检计划
@@ -509,9 +482,6 @@ export const new_alarm_history = (params) => {
       "Content-Type": "application/json",
     },
     responseType: "blob",
-    showLoading: {
-      text: "拼命下载中...",
-    },
     timeout: 99999999,
   });
 };
@@ -530,9 +500,6 @@ export const alarm_fault_recent = (params) => {
   return request({
     url: `fault/recent`,
     params: params,
-    showLoading: {
-      statu: false,
-    },
     transformResponse: [
       function (data) {
         const json = JSONBIG({
@@ -615,13 +582,19 @@ export function point(
 }
 //测点新增
 export function metrics(data) {
-  return request.post(`device/metrics/single`, data);
+  return request({
+    method: "post",
+    url: `device/metrics/single`,
+    data,
+    baseURL: process.env.VUE_APP_ALARM,
+  });
+  // return request.post(`device/metrics/single`, data);
 }
 //测点删除
 export function delmetrics(params) {
   return request({
-    method: "delete",
     baseURL: process.env.VUE_APP_ALARM,
+    method: "delete",
     url: `device/metrics/single/delete/${params}`,
   });
 }
@@ -655,7 +628,7 @@ export const faultmode_windturbine = () => {
   });
 };
 // 根据 structurecode get
-export const faultmode_structurecode = (params) => {
+export const faultmode_structureCode = (params) => {
   return request({
     baseURL: process.env.VUE_APP_ALARM,
     url: `device/faultmode/windturbine/${params}`,
@@ -688,9 +661,6 @@ export function getStationinfo(params) {
   return request({
     url: `info/stationinfo?stationId=${params}`,
     method: "get",
-    showLoading: {
-      statu: false,
-    },
   });
 }
 
@@ -731,22 +701,27 @@ export const fetchElectricDIPointByPointId = (pointId) => {
 };
 
 //根据风场编号获取电气AI测点
-export const fetch_electrical_point_ai = (stationId) => {
+export const fetch_electrical_point_ai = (stationId, modelId) => {
   return request({
-    url: "info/electrical_point_ai",
+    baseURL: process.env.VUE_APP_ALARM,
+    url: "info/testing_point_ai",
     method: "get",
     params: {
-      stationId: stationId,
+      stationId,
+      modelId
     },
   });
 };
+
 //根据风场编号获取电气DI测点
-export const fetch_electrical_point_di = (stationId) => {
+export const fetch_electrical_point_di = (stationId, modelId) => {
   return request({
-    url: "info/electrical_point_di",
+    baseURL: process.env.VUE_APP_ALARM,
+    url: "info/testing_point_di",
     method: "get",
     params: {
-      stationId: stationId,
+      stationId,
+      modelId
     },
   });
 };
@@ -883,9 +858,6 @@ export const getReportDetail = (id) => {
   return request({
     url: `earlyreport/info?id=${id}`,
     method: "get",
-    showLoading: {
-      statu: false,
-    },
   });
 };
 
@@ -969,14 +941,75 @@ export const getStopQueryTableData = (params) => {
 
 export const getWarningCountList = (params) => {
   return request({
-    url: `alarm/history/findCtFeatureStat?timeType=${params.timeType}&begin=${
-      params.begin
-    }&end=${params.end}&stationid=${
-      params.stationid
-    }&components=${params.components.toString()}&modelId=${
-      params.modelId
-    }&alarmIds=${params.alarmIds}&deviceType=${params.deviceType}`,
+    url: `alarm/history/findCtFeatureStat?timeType=${params.timeType}&begin=${params.begin
+      }&end=${params.end}&stationid=${params.stationid
+      }&components=${params.components.toString()}&modelId=${params.modelId
+      }&alarmIds=${params.alarmIds}&deviceType=${params.deviceType}`,
     baseURL: process.env.VUE_APP_ALARM,
     method: "get",
   });
 };
+
+//查询所有场站
+export function getAllStation() {
+  return request({
+    baseURL: process.env.VUE_APP_ALARM,
+    url: `/electricity/czlist`,
+    method: "GET",
+  });
+}
+
+export function getAlarmMap(url = "/alarmplan/queryAlarmPlanMap", params = {}) {
+  return request({
+    baseURL: process.env.VUE_APP_ALARM,
+    url,
+    params,
+    method: "GET",
+  });
+}
+
+export function getAlarmMapById(params) {
+  return request({
+    baseURL: process.env.VUE_APP_ALARM,
+    url: "/alarmplan/alarmPlanlistById",
+    params,
+    method: "GET",
+  });
+}
+
+export function getAlarmTypeList() {
+  return request({
+    baseURL: process.env.VUE_APP_ALARM,
+    url: `/alarmplan/alarmPlanTypelist`,
+    method: "GET",
+  });
+}
+
+export function addAlarmItem(data) {
+  return request({
+    baseURL: process.env.VUE_APP_ALARM,
+    url: `/alarmplan/save`,
+    method: "POST",
+    data
+  });
+}
+
+export function deleteAlarmItem(params) {
+  return request({
+    baseURL: process.env.VUE_APP_ALARM,
+    url: `/alarmplan/delete`,
+    method: "delete",
+    params
+  });
+}
+
+export function getAlarmExcelTemplate() {
+  return request({
+    baseURL: process.env.VUE_APP_ALARM,
+    url: `/alarmplan/importtemplate`,
+    method: "get",
+    responseType: "blob",
+  });
+}
+
+

+ 9 - 0
src/router/index.js

@@ -414,6 +414,15 @@ const routes = [
             import("../views/IntegratedAlarm/safe/dataSearch/index.vue"),
     },
     {
+        path: "/integratedAlarm/earlyWarning",
+        name: "earlyWarning",
+        meta: {
+            title: "预警排查方案",
+        },
+        component: () =>
+            import("../views/IntegratedAlarm/earlyWarning/index.vue"),
+    },
+    {
         path: "/integratedAlarm/customAnalyse",
         name: "customAnalyse",
         meta: {

+ 34 - 0
src/store/index.js

@@ -14,6 +14,12 @@ export default createStore({
     themeName: "dark",
     moreSty: "blueSty",
     readyProgress: 0,
+    alarmList: (localStorage.getItem("alarmList") ? JSON.parse(localStorage.getItem("alarmList")) : []),
+    warnList: [], //弹窗报警列表
+    warningList: [], //实时报警列表
+    stationListAll: [],
+    baseURL: process.env.VUE_APP_ALARM,
+    baseURL1: process.env.VUE_APP_ADP_BASE_URL
   },
   getters: {
   },
@@ -24,6 +30,22 @@ export default createStore({
     setReadyProgress(state, value) {
       state.readyProgress = value;
     },
+    //修改升压站报警列表
+    changeAlarmlist(state, data) {
+      state.alarmList = data;
+      localStorage.setItem("alarmList", JSON.stringify(state.alarmList));
+    },
+    //修改弹窗报警列表事件
+    setWarning(state, data) {
+      state.warnList = data;
+    },
+    //修改实时报警列表事件
+    setWarningList(state, data) {
+      state.warningList = data;
+    },
+    changeStationAll(state, data) {
+      state.stationListAll = data;
+    },
   },
   actions: {
     changeTheme(context, bool) {
@@ -32,6 +54,18 @@ export default createStore({
     setReadyProgress(context, value) {
       context.commit("setReadyProgress", value);
     },
+    actionAlarmList(context, newData) {
+      context.commit("changeAlarmlist", newData);
+    },
+    setWarning(context, data) {
+      context.commit("setWarning", data);
+    },
+    setWarningList(context, data) {
+      context.commit("setWarningList", data);
+    },
+    changeStationAll(context, data) {
+      context.commit("changeStationAll", data);
+    },
   },
   modules: {
     user

+ 374 - 339
src/themeDark.less

@@ -25,23 +25,23 @@
 @jbs5: linear-gradient(to right, #f1880c, #ffd179);
 @jbs6: linear-gradient(to right, #ff293d, #ff9ea7);
 
-@green          : #05bb4c;
-@gray           : #606769;
-@gray-l         : #B3BDC0;
+@green : #05bb4c;
+@gray : #606769;
+@gray-l : #B3BDC0;
 @picker-bg-color: fade(rgb(3, 7, 19), 95);
 
-@primary-color    : #2568c4;
-@border-color     : transparent;
-@text-color       : #fff;
+@primary-color : #2568c4;
+@border-color : transparent;
+@text-color : #fff;
 @placeholder-color: #c0c4cc;
-@disabled-color   : #c0c4cc;
-@disabled-bg      : #000;
+@disabled-color : #c0c4cc;
+@disabled-bg : #000;
 
 .nsfStyle {
     #app {
 
         .themeDarkHome {
-            background: @mc1  !important;
+            background: @mc1 !important;
         }
 
         .themeDark {
@@ -52,11 +52,11 @@
 
                 .proMenu {
                     .defaultBacksty {
-                        color: @fc6  !important;
+                        color: @fc6 !important;
                     }
 
                     .changeBacksty {
-                        color       : @fzs2  !important;
+                        color: @fzs2 !important;
                         border-color: @mc3;
                     }
                 }
@@ -143,7 +143,7 @@
             // 首页点击地图风场后左侧的滑出窗口
             .infoBox {
                 .el-button {
-                    color: @fzs2  !important;
+                    color: @fzs2 !important;
                 }
 
                 p,
@@ -169,7 +169,6 @@
                 color: #c3c3c4;
             }
 
-
             // 菜单
             .elmenuSty {
                 background: @mc1;
@@ -205,7 +204,7 @@
                 .excelDataMain,
                 .tableDataMain {
                     background: @mc2;
-                    padding   : 10px 5px;
+                    padding: 10px 5px;
 
                     .main {
                         background: #13171e;
@@ -214,291 +213,20 @@
                 }
             }
 
-            // el-table
-            .el-table,
-            .custom-table.el-table {
-                background: rgb(3, 7, 19);
-                border    : 0px; // 包裹表格父元素边框
-
-                .el-table__row {
-                    background: transparent; // 表格底色,因表格上层有其他颜色遮挡所以视觉效果看起来仿佛是表格边框
-
-                    & .el-table__cell {
-                        border-bottom: 1px solid rgb(17, 58, 120) !important; // 表格单元格底部边框颜色
-
-                        .el-button {
-                            color: rgb(71, 174, 231) !important;
-
-                            &:active {
-                                color: #70d0f4 !important;
-                            }
-                        }
-                    }
-                }
-
-                &.el-table--border::after,
-                &.el-table--group::after,
-                &::before {
-                    background-color: transparent;
-                }
-
-                tr {
-                    td {
-                        background-color: rgb(3, 7, 19); // 表格基数行背景颜色
-                    }
-
-                    &:hover td {
-                        color           : #67b9ff; // 表格基数行 hover 文字颜色
-                        background-color: rgb(3, 7, 19) !important; // 表格基数行 hover 背景颜色
-                    }
-                }
-
-                td {
-                    border     : 0px; // 表格内部除了最后一行底部以外的上下左右边框
-                    padding    : 0;
-                    height     : 37px;
-                    line-height: 37px;
-                    color      : rgb(194, 225, 255);
-
-                    &.light,
-                    &.always-light {
-                        color: #67b9ff !important;
-                    }
-                }
-
-                th {
-                    border     : 0px;
-                    padding    : 0px;
-                    height     : 37px;
-                    line-height: 37px;
-                    font-weight: normal;
-                    text-align : center;
-                    color      : rgb(85, 113, 166);
-                    cursor     : pointer;
-
-                    &.is-leaf {
-                        border: 0px;
-                    }
-
-                    &.light,
-                    &.always-light {
-                        color: #67b9ff !important;
-                    }
-                }
 
-                th,
-                tr {
-                    background-color: transparent;
-                    border          : 0px;
-                }
-
-                thead {
-                    color      : @gray-l;
-                    font-weight: 500;
-                    font-size  : 14px;
-                    border     : 0px;
-
-                    th,
-                    &.is-group th {
-                        &.el-table__cell {
-                            background  : rgb(19, 35, 71);
-                            border-color: transparent !important;
-                            color       : #bcd2ff;
-                        }
-                    }
-                }
 
-                .el-table__body {
-                    border   : 0px; // 表格最外侧除右边以外边框
-                    font-size: 14px;
-                }
-
-                &.el-table--striped .el-table__body tr.el-table__row--striped {
-                    td {
-                        background-color: rgb(16, 25, 46); // 表格偶数行背景颜色
-                    }
-
-                    &:hover td {
-                        color           : #67b9ff;
-                        background-color: rgb(16, 25, 46) !important; // 表格偶数行 hover 背景颜色
-                    }
-
-
-                }
-
-                &.el-table--border,
-                &.el-table--group {
-                    border: none;
-                }
-
-                .ascending .sort-caret.ascending {
-                    border-bottom-color: #2169c3;
-                }
-
-                .descending .sort-caret.descending {
-                    border-top-color: #2169c3;
-                }
+            .scrollbar-demo-item {
+                background: rgba(83, 98, 104, .2);
+                border-color: #1890ff;
             }
 
-            .warn-table,
-            .df-table {
-
-                .tableData_tit p {
-                    color: #fff !important;
-                }
-
-                .el-table,
-                .custom-table.el-table {
-                    background: rgb(3, 7, 19);
-                    border    : 1px solid rgba(33, 105, 195, 0.5) !important; // 包裹表格父元素边框
+            .el-tree {
+                background: rgba(83, 98, 104, .2);
 
-                    .el-table__row {
-                        background: transparent; // 表格底色,因表格上层有其他颜色遮挡所以视觉效果看起来仿佛是表格边框
-
-                        & .el-table__cell {
-                            border-bottom: 1px solid rgb(17, 58, 120) !important; // 表格单元格底部边框颜色
-
-                            .el-button {
-                                color: rgb(71, 174, 231) !important;
-
-                                &:active {
-                                    color: #70d0f4 !important;
-                                }
-                            }
-                        }
-
-                        &:hover .cell {
-                            color: rgb(71, 174, 231) !important;
-                        }
-                    }
-
-                    &.el-table--border::after,
-                    &.el-table--group::after,
-                    &::before {
-                        background-color: transparent;
-                    }
-
-                    tr {
-                        td {
-                            background-color: rgb(3, 7, 19); // 表格基数行背景颜色
-                        }
-
-                        &:hover td {
-                            color           : #67b9ff; // 表格基数行 hover 文字颜色
-                            background-color: rgb(3, 7, 19) !important; // 表格基数行 hover 背景颜色
-                        }
-                    }
-
-                    td {
-                        border     : 0px; // 表格内部除了最后一行底部以外的上下左右边框
-                        padding    : 0;
-                        height     : 37px;
-                        line-height: 37px;
-                        color      : rgb(194, 225, 255);
-
-                        &.light,
-                        &.always-light {
-                            color: #67b9ff !important;
-                        }
-                    }
-
-                    th {
-                        border     : 0px;
-                        padding    : 0px;
-                        height     : 37px;
-                        line-height: 37px;
-                        font-weight: normal;
-                        text-align : center;
-                        color      : rgb(85, 113, 166);
-                        cursor     : pointer;
-
-                        &.is-leaf {
-                            border: 0px;
-                        }
-
-                        &.light,
-                        &.always-light {
-                            color: #67b9ff !important;
-                        }
-                    }
-
-                    th,
-                    tr {
-                        background-color: transparent;
-                        border          : 0px;
-                    }
-
-                    thead {
-                        color      : @gray-l;
-                        font-weight: 500;
-                        font-size  : 14px;
-                        border     : 0px;
-
-                        th,
-                        &.is-group th {
-                            &.el-table__cell {
-                                background  : rgb(19, 35, 71) !important;
-                                border-color: transparent !important;
-                                color       : #bcd2ff;
-                            }
-                        }
-                    }
-
-                    .el-table__body {
-                        border   : 0px; // 表格最外侧除右边以外边框
-                        font-size: 14px;
-                    }
-
-                    &.el-table--striped .el-table__body tr.el-table__row--striped {
-                        td {
-                            background-color: rgb(16, 25, 46); // 表格偶数行背景颜色
-                        }
-
-                        &:hover td {
-                            color           : #67b9ff;
-                            background-color: rgb(16, 25, 46) !important; // 表格偶数行 hover 背景颜色
-                        }
-
-
-                    }
-
-                    &.el-table--border,
-                    &.el-table--group {
-                        border: none;
-                    }
-
-                    .ascending .sort-caret.ascending {
-                        border-bottom-color: #2169c3;
-                    }
-
-                    .descending .sort-caret.descending {
-                        border-top-color: #2169c3;
-                    }
-                }
-
-                .el-table__expanded-cell {
-                    background: transparent;
-                }
-
-                .el-table__footer-wrapper tbody td {
-                    background: #1a1f2fcc;
+                .el-tree-node__content {
+                    color: #fff;
                 }
             }
-
-            .el-table__expanded-cell {
-                background: transparent;
-            }
-
-            .el-table__footer-wrapper tbody td {
-                background: #1a1f2fcc;
-            }
-
-            // 去除表格顶、左、底部边框
-            .el-table__border-left-patch,
-            .el-table__inner-wrapper::after,
-            .el-table__inner-wrapper::before {
-                background: transparent;
-            }
         }
 
         // el-input
@@ -507,12 +235,12 @@
             // 基本样式
             .el-input__wrapper {
                 background-color: rgba(83, 98, 104, .2);
-                border-radius   : 4px;
-                border          : 1px solid @border-color;
+                border-radius: 4px;
+                border: 1px solid @border-color;
 
                 // 输入框
                 .el-input__inner {
-                    color    : @text-color;
+                    color: @text-color;
                     font-size: 14px;
 
                     &::placeholder {
@@ -528,7 +256,7 @@
                 // 聚焦状态
                 &.is-focus {
                     border-color: @primary-color;
-                    box-shadow  : 0 0 0 2px fade(@primary-color, 20%);
+                    box-shadow: 0 0 0 2px fade(@primary-color, 20%);
                 }
             }
 
@@ -536,7 +264,7 @@
             &.is-disabled {
                 .el-input__wrapper {
                     background-color: @disabled-bg;
-                    border-color    : @border-color;
+                    border-color: @border-color;
 
                     .el-input__inner {
                         color: @disabled-color;
@@ -569,8 +297,8 @@
             // 基本样式
             .el-select__wrapper {
                 background-color: rgba(83, 98, 104, .2);
-                border-radius   : 4px;
-                border          : 1px solid @border-color;
+                border-radius: 4px;
+                border: 1px solid @border-color;
 
                 .el-select__placeholder {
                     color: #fff;
@@ -584,7 +312,7 @@
                 // 聚焦状态
                 &.is-focus {
                     border-color: @primary-color;
-                    box-shadow  : 0 0 0 2px fade(@primary-color, 20%);
+                    box-shadow: 0 0 0 2px fade(@primary-color, 20%);
                 }
             }
 
@@ -592,7 +320,7 @@
             &.is-disabled {
                 .el-input__wrapper {
                     background-color: @disabled-bg;
-                    border-color    : @border-color;
+                    border-color: @border-color;
 
                     .el-input__inner {
                         color: @disabled-color;
@@ -602,7 +330,7 @@
 
             // 下拉箭头
             .el-select__caret {
-                color    : @placeholder-color;
+                color: @placeholder-color;
                 font-size: 14px;
 
                 &.is-reverse {
@@ -635,7 +363,7 @@
             background: #13171e;
 
             .topPsty {
-                color     : #1c99ff;
+                color: #1c99ff;
                 background: #1e2126;
             }
         }
@@ -653,11 +381,297 @@
 
     }
 
+    // el-table
+    .el-table,
+    .custom-table.el-table {
+        background: rgb(3, 7, 19);
+        border: 0px; // 包裹表格父元素边框
+
+        .el-table__row {
+            background: transparent; // 表格底色,因表格上层有其他颜色遮挡所以视觉效果看起来仿佛是表格边框
+
+            & .el-table__cell {
+                border-bottom: 1px solid rgb(17, 58, 120) !important; // 表格单元格底部边框颜色
+
+                .el-button {
+                    color: rgb(71, 174, 231) !important;
+
+                    &:active {
+                        color: #70d0f4 !important;
+                    }
+                }
+            }
+        }
+
+        &.el-table--border::after,
+        &.el-table--group::after,
+        &::before {
+            background-color: transparent;
+        }
+
+        tr {
+            td {
+                background-color: rgb(3, 7, 19); // 表格基数行背景颜色
+            }
+
+            &:hover td {
+                color: #67b9ff; // 表格基数行 hover 文字颜色
+                background-color: rgb(3, 7, 19) !important; // 表格基数行 hover 背景颜色
+            }
+        }
+
+        td {
+            border: 0px; // 表格内部除了最后一行底部以外的上下左右边框
+            padding: 0;
+            height: 37px;
+            line-height: 37px;
+            color: rgb(194, 225, 255);
+
+            &.light,
+            &.always-light {
+                color: #67b9ff !important;
+            }
+        }
+
+        th {
+            border: 0px;
+            padding: 0px;
+            height: 37px;
+            line-height: 37px;
+            font-weight: normal;
+            text-align: center;
+            color: rgb(85, 113, 166);
+            cursor: pointer;
+
+            &.is-leaf {
+                border: 0px;
+            }
+
+            &.light,
+            &.always-light {
+                color: #67b9ff !important;
+            }
+        }
+
+        th,
+        tr {
+            background-color: transparent;
+            border: 0px;
+        }
+
+        thead {
+            color: @gray-l;
+            font-weight: 500;
+            font-size: 14px;
+            border: 0px;
+
+            th,
+            &.is-group th {
+                &.el-table__cell {
+                    background: rgb(19, 35, 71);
+                    border-color: transparent !important;
+                    color: #bcd2ff;
+                }
+            }
+        }
+
+        .el-table__body {
+            border: 0px; // 表格最外侧除右边以外边框
+            font-size: 14px;
+        }
+
+        &.el-table--striped .el-table__body tr.el-table__row--striped {
+            td {
+                background-color: rgb(16, 25, 46); // 表格偶数行背景颜色
+            }
+
+            &:hover td {
+                color: #67b9ff;
+                background-color: rgb(16, 25, 46) !important; // 表格偶数行 hover 背景颜色
+            }
+
+
+        }
+
+        &.el-table--border,
+        &.el-table--group {
+            border: none;
+        }
+
+        .ascending .sort-caret.ascending {
+            border-bottom-color: #2169c3;
+        }
+
+        .descending .sort-caret.descending {
+            border-top-color: #2169c3;
+        }
+    }
+
+    .warn-table,
+    .df-table {
+
+        .tableData_tit p {
+            color: #fff !important;
+        }
+
+        .el-table,
+        .custom-table.el-table {
+            background: rgb(3, 7, 19);
+            border: 1px solid rgba(33, 105, 195, 0.5) !important; // 包裹表格父元素边框
+
+            .el-table__row {
+                background: transparent; // 表格底色,因表格上层有其他颜色遮挡所以视觉效果看起来仿佛是表格边框
+
+                & .el-table__cell {
+                    border-bottom: 1px solid rgb(17, 58, 120) !important; // 表格单元格底部边框颜色
+
+                    .el-button {
+                        color: rgb(71, 174, 231) !important;
+
+                        &:active {
+                            color: #70d0f4 !important;
+                        }
+                    }
+                }
+
+                &:hover .cell {
+                    color: rgb(71, 174, 231) !important;
+                }
+            }
+
+            &.el-table--border::after,
+            &.el-table--group::after,
+            &::before {
+                background-color: transparent;
+            }
+
+            tr {
+                td {
+                    background-color: rgb(3, 7, 19); // 表格基数行背景颜色
+                }
+
+                &:hover td {
+                    color: #67b9ff; // 表格基数行 hover 文字颜色
+                    background-color: rgb(3, 7, 19) !important; // 表格基数行 hover 背景颜色
+                }
+            }
+
+            td {
+                border: 0px; // 表格内部除了最后一行底部以外的上下左右边框
+                padding: 0;
+                height: 37px;
+                line-height: 37px;
+                color: rgb(194, 225, 255);
+
+                &.light,
+                &.always-light {
+                    color: #67b9ff !important;
+                }
+            }
+
+            th {
+                border: 0px;
+                padding: 0px;
+                height: 37px;
+                line-height: 37px;
+                font-weight: normal;
+                text-align: center;
+                color: rgb(85, 113, 166);
+                cursor: pointer;
+
+                &.is-leaf {
+                    border: 0px;
+                }
+
+                &.light,
+                &.always-light {
+                    color: #67b9ff !important;
+                }
+            }
+
+            th,
+            tr {
+                background-color: transparent;
+                border: 0px;
+            }
+
+            thead {
+                color: @gray-l;
+                font-weight: 500;
+                font-size: 14px;
+                border: 0px;
+
+                th,
+                &.is-group th {
+                    &.el-table__cell {
+                        background: rgb(19, 35, 71) !important;
+                        border-color: transparent !important;
+                        color: #bcd2ff;
+                    }
+                }
+            }
+
+            .el-table__body {
+                border: 0px; // 表格最外侧除右边以外边框
+                font-size: 14px;
+            }
+
+            &.el-table--striped .el-table__body tr.el-table__row--striped {
+                td {
+                    background-color: rgb(16, 25, 46); // 表格偶数行背景颜色
+                }
+
+                &:hover td {
+                    color: #67b9ff;
+                    background-color: rgb(16, 25, 46) !important; // 表格偶数行 hover 背景颜色
+                }
+
+
+            }
+
+            &.el-table--border,
+            &.el-table--group {
+                border: none;
+            }
+
+            .ascending .sort-caret.ascending {
+                border-bottom-color: #2169c3;
+            }
+
+            .descending .sort-caret.descending {
+                border-top-color: #2169c3;
+            }
+        }
+
+        .el-table__expanded-cell {
+            background: transparent;
+        }
+
+        .el-table__footer-wrapper tbody td {
+            background: #1a1f2fcc;
+        }
+    }
+
+    .el-table__expanded-cell {
+        background: transparent;
+    }
+
+    .el-table__footer-wrapper tbody td {
+        background: #1a1f2fcc;
+    }
+
+    // 去除表格顶、左、底部边框
+    .el-table__border-left-patch,
+    .el-table__inner-wrapper::after,
+    .el-table__inner-wrapper::before {
+        background: transparent;
+    }
+
     // el-dialog
     .el-dialog.currentDialog,
     .el-dialog[custom-class="windLifeDialog"] {
         background: rgba(3, 7, 19, 0.95);
-        border    : 1px solid rgba(33, 105, 195, 0.5);
+        border: 1px solid rgba(33, 105, 195, 0.5);
         box-shadow: 0px 8px 17px 1px rgba(33, 105, 195, 0.3);
 
         .el-dialog__title {
@@ -694,20 +708,20 @@
 
     .el-select-dropdown__wrap {
         background-color: rgb(10, 23, 42);
-        border          : 1px solid rgb(10, 23, 42);
-        border-radius   : 4px;
-        box-shadow      : 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+        border: 1px solid rgb(10, 23, 42);
+        border-radius: 4px;
+        box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
 
         .el-select-dropdown__item {
-            font-size    : 14px;
-            padding      : 0 20px;
-            position     : relative;
-            white-space  : nowrap;
-            overflow     : hidden;
+            font-size: 14px;
+            padding: 0 20px;
+            position: relative;
+            white-space: nowrap;
+            overflow: hidden;
             text-overflow: ellipsis;
-            color        : @text-color;
-            height       : 34px;
-            line-height  : 34px;
+            color: @text-color;
+            height: 34px;
+            line-height: 34px;
 
             &.hover,
             &.is-hovering,
@@ -716,22 +730,22 @@
             }
 
             &.is-selected {
-                color      : @fzs2;
+                color: @fzs2;
                 font-weight: 400;
 
                 &:hover {
                     background: @fzs2;
-                    color     : #fff;
+                    color: #fff;
                 }
 
                 &.is-hovering {
                     background: @fzs2;
-                    color     : #fff;
+                    color: #fff;
                 }
             }
 
             &.is-disabled {
-                color : @disabled-color;
+                color: @disabled-color;
                 cursor: not-allowed;
             }
         }
@@ -739,19 +753,19 @@
 
     // 多选样式
     .el-select .el-select__selection.is-near {
-        position   : absolute;
+        position: absolute;
         line-height: normal;
         white-space: normal;
-        z-index    : 1;
-        top        : 50%;
-        transform  : translateY(-50%);
-        display    : flex;
+        z-index: 1;
+        top: 50%;
+        transform: translateY(-50%);
+        display: flex;
         align-items: center;
-        flex-wrap  : wrap;
+        flex-wrap: wrap;
 
         .el-tag {
             background: #000;
-            color     : @text-color;
+            color: @text-color;
         }
     }
 
@@ -764,7 +778,7 @@
 
             &.is-checked {
                 .el-radio__inner {
-                    background  : @fzs2;
+                    background: @fzs2;
                     border-color: @fzs2;
                 }
 
@@ -820,7 +834,7 @@
                     td.current:not(.disabled) {
                         .el-date-table-cell__text {
                             background: @fzs2;
-                            color     : #fff;
+                            color: #fff;
                         }
                     }
 
@@ -833,7 +847,7 @@
                 td.current:not(.disabled) {
                     .cell {
                         background: @fzs2;
-                        color     : #fff;
+                        color: #fff;
                     }
                 }
             }
@@ -851,7 +865,7 @@
 
                 &:hover {
                     background: @mc3;
-                    color     : @fc1;
+                    color: @fc1;
                 }
             }
 
@@ -859,7 +873,7 @@
 
         .el-input__wrapper {
             background-color: rgba(83, 98, 104, .2);
-            border          : 1px solid @border-color;
+            border: 1px solid @border-color;
 
             .el-input__inner {
                 color: #fff;
@@ -867,9 +881,9 @@
         }
 
         .el-time-panel {
-            border-color    : #fff;
+            border-color: #fff;
             background-color: rgb(3, 7, 19);
-            box-shadow      : var(--el-box-shadow-light);
+            box-shadow: var(--el-box-shadow-light);
         }
 
         .el-time-spinner__item {
@@ -905,7 +919,7 @@
         }
 
         .el-button.is-plain {
-            color       : #67b9ff;
+            color: #67b9ff;
             border-color: #67b9ff;
         }
     }
@@ -924,7 +938,7 @@
 
     .el-textarea__inner {
         background: rgba(83, 98, 104, .2);
-        color     : @text-color;
+        color: @text-color;
     }
 
     .el-tabs {
@@ -932,11 +946,32 @@
             color: #c2e1ff !important;
 
             &.is-active {
-                color: @fzs2  !important;
+                color: @fzs2 !important;
             }
         }
     }
 
+    .el-tabs.currentTabs {
+
+        .el-tabs__header {
+            background: rgba(3, 7, 19, 0.95);
+        }
+
+        .el-tabs__item {
+            color: #c2e1ff !important;
+
+            &.is-active {
+                color: @fzs2 !important;
+                background: rgba(3, 7, 19, 0.95);
+
+            }
+        }
+
+        .el-tabs__content {
+            background: rgba(3, 7, 19, 0.95);
+        }
+    }
+
     .el-pagination {
 
         button.is-disabled,
@@ -947,7 +982,7 @@
         }
 
         .el-pager .number {
-            color     : #fff;
+            color: #fff;
             background: transparent;
 
             &:hover {
@@ -963,9 +998,9 @@
     .point-popover {
         .el-popper__arrow {
             &:before {
-                border-color      : var(--el-popover-border-color) !important;
+                border-color: var(--el-popover-border-color) !important;
                 border-right-color: transparent !important;
-                border-top-color  : transparent !important;
+                border-top-color: transparent !important;
             }
         }
     }

+ 2 - 2
src/utils/ws.js

@@ -7,7 +7,7 @@ let timeoutObj = null; // 心跳倒计时
 let serverTimeoutObj = null; // 服务心跳倒计时
 let timeoutnum = null; // 断开 重连倒计时
 let reLinkNum = 0;
-let reLinkMaxNum = 10;
+let reLinkMaxNum = 3;
 
 const initWebSocket = async () => {
     if ("WebSocket" in window) {
@@ -100,7 +100,7 @@ const webSocketOnError = (e) => {
 const webSocketOnMessage = (e) => {
     const data = JSON.parse(JSON.parse(e.data));
     reset();
-    console.log(11111, data);
+    // console.log(11111, data);
     // 处理其他类型的消息
     window.dispatchEvent(
         new CustomEvent("onmessageWS", {

+ 352 - 8
src/views/IntegratedAlarm/alarmConfig/components/custom_components.vue

@@ -1,5 +1,18 @@
 <template>
-  <el-dialog v-model="isShow" width="60%" @close="closeDialog" destroy-on-close>
+  <el-dialog
+    v-model="isShow"
+    width="75%"
+    top="50px"
+    @close="closeDialog"
+    destroy-on-close
+    class="alDio"
+    @click="lPopVisible = false"
+    @closed="
+      () => {
+        lPopVisible = false;
+      }
+    "
+  >
     <el-form
       ref="ruleFormRef"
       :model="form"
@@ -136,7 +149,7 @@
           </el-form-item>
         </el-col>
         <el-col :span="9">
-          <el-tabs type="border-card">
+          <el-tabs type="border-card" class="currentTabs">
             <el-tab-pane label="AI测点">
               <el-input v-model="state.AIPointSearch"> </el-input>
               <el-table
@@ -234,16 +247,256 @@
           </el-form-item>
         </el-col>
       </el-row>
+      <el-form-item style="width: 100%">
+        <el-button
+          type="primary"
+          style="margin-right: 16px"
+          ref="buttonRef"
+          size="mini"
+          @click.stop="
+            () => {
+              lPopVisible = !lPopVisible;
+              setTableCheckbox();
+            }
+          "
+          >修改排查方案添\删除</el-button
+        >
+        <el-popover
+          :visible="lPopVisible"
+          placement="right-end"
+          :width="850"
+          trigger="manual"
+          popper-class="alDioPop"
+          :effect="$store.state.theme ? 'light' : 'dark'"
+          :hide-after="0"
+          ref="popoverRef"
+          :virtual-ref="buttonRef"
+        >
+          <el-table
+            ref="multipleTableRef"
+            style="height: 450px"
+            :data="state.alarmMapList"
+            @selection-change="handleSelectionChange"
+            stripe
+            border
+          >
+            <el-table-column type="selection" width="55" align="center" />
+            <el-table-column
+              label="类型"
+              prop="types"
+              align="center"
+              width="120px"
+              show-overflow-tooltip
+              column-key="types"
+              :filters="getFilters('types')"
+              :filter-method="filterHandler"
+            ></el-table-column>
+            <el-table-column
+              label="名称"
+              prop="name"
+              align="center"
+              width="200px"
+              show-overflow-tooltip
+              column-key="name"
+              :filters="getFilters('name')"
+              :filter-method="filterHandler"
+            ></el-table-column>
+            <el-table-column
+              label="排查步骤"
+              prop="troubleMethod"
+              align="left"
+              show-overflow-tooltip
+            >
+              <template #default="scope">
+                <template v-if="Array.isArray(scope.row.troubleMethod)">
+                  <p
+                    v-for="(item, index) in scope.row.troubleMethod"
+                    :key="index"
+                  >
+                    {{ index + 1 }}. {{ item }}
+                  </p>
+                </template>
+                <p v-else>
+                  {{ scope.row.troubleMethod }}
+                </p>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="检修方案"
+              prop="processMethod"
+              align="left"
+              show-overflow-tooltip
+            >
+              <template #default="scope">
+                <template v-if="Array.isArray(scope.row.processMethod)">
+                  <p
+                    v-for="(item, index) in scope.row.processMethod"
+                    :key="index"
+                  >
+                    {{ index + 1 }}. {{ item }}
+                  </p>
+                </template>
+                <p v-else>
+                  {{ scope.row.processMethod }}
+                </p>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="所需工具"
+              prop="tools"
+              align="left"
+              width="120px"
+              show-overflow-tooltip
+            >
+              <template #default="scope">
+                <template v-if="Array.isArray(scope.row.tools)">
+                  <p v-for="(item, index) in scope.row.tools" :key="index">
+                    {{ index + 1 }}. {{ item }}
+                  </p>
+                </template>
+                <p v-else>
+                  {{ scope.row.tools }}
+                </p>
+              </template>
+            </el-table-column>
+            <el-table-column
+              label="备品备件"
+              prop="spareParts"
+              align="left"
+              width="120px"
+              show-overflow-tooltip
+            >
+              <template #default="scope">
+                <template v-if="Array.isArray(scope.row.spareParts)">
+                  <p v-for="(item, index) in scope.row.spareParts" :key="index">
+                    {{ index + 1 }}. {{ item }}
+                  </p>
+                </template>
+                <p v-else>
+                  {{ scope.row.spareParts }}
+                </p>
+              </template>
+            </el-table-column>
+          </el-table>
+        </el-popover>
+        <el-table
+          width="100%"
+          style="height: 200px; margin-top: 10px"
+          :data="state.pcflList"
+          stripe
+          border
+        >
+          <el-table-column
+            label="类型"
+            prop="types"
+            align="center"
+            width="120px"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            label="名称"
+            prop="name"
+            align="center"
+            width="200px"
+            show-overflow-tooltip
+          ></el-table-column>
+          <el-table-column
+            label="排查步骤"
+            prop="troubleMethod"
+            align="left"
+            show-overflow-tooltip
+          >
+            <template #default="scope">
+              <template v-if="Array.isArray(scope.row.troubleMethod)">
+                <p
+                  v-for="(item, index) in scope.row.troubleMethod"
+                  :key="index"
+                >
+                  {{ index + 1 }}. {{ item }}
+                </p>
+              </template>
+              <p v-else>
+                {{ scope.row.troubleMethod }}
+              </p>
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="检修方案"
+            prop="processMethod"
+            align="left"
+            show-overflow-tooltip
+          >
+            <template #default="scope">
+              <template v-if="Array.isArray(scope.row.processMethod)">
+                <p
+                  v-for="(item, index) in scope.row.processMethod"
+                  :key="index"
+                >
+                  {{ index + 1 }}. {{ item }}
+                </p>
+              </template>
+              <p v-else>
+                {{ scope.row.processMethod }}
+              </p>
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="所需工具"
+            prop="tools"
+            align="left"
+            width="120px"
+            show-overflow-tooltip
+          >
+            <template #default="scope">
+              <template v-if="Array.isArray(scope.row.tools)">
+                <p v-for="(item, index) in scope.row.tools" :key="index">
+                  {{ index + 1 }}. {{ item }}
+                </p>
+              </template>
+              <p v-else>
+                {{ scope.row.tools }}
+              </p>
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="备品备件"
+            prop="spareParts"
+            align="left"
+            width="120px"
+            show-overflow-tooltip
+          >
+            <template #default="scope">
+              <template v-if="Array.isArray(scope.row.spareParts)">
+                <p v-for="(item, index) in scope.row.spareParts" :key="index">
+                  {{ index + 1 }}. {{ item }}
+                </p>
+              </template>
+              <p v-else>
+                {{ scope.row.spareParts }}
+              </p>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-form-item>
     </el-form>
     <template #footer>
       <span class="footerButton">
-        <el-button round size="mini" @click="closeDialog">取 消</el-button>
+        <el-button
+          :style="`color:${$store.state.theme ? '#000' : '#fff'}`"
+          round
+          size="mini"
+          @click="closeDialog"
+          >取 消</el-button
+        >
         <el-button round size="mini" @click="submitForm(ruleFormRef)"
           >确 定</el-button
         >
       </span>
     </template>
   </el-dialog>
+  <el-dialog v-model="yjlxDialogVisible" title="修改预警类型" width="500">
+    <span>This is a message</span>
+  </el-dialog>
 </template>
 <script setup>
 import {
@@ -255,8 +508,10 @@ import {
   nextTick,
   defineEmits,
   defineProps,
+  unref,
 } from "vue";
 import { ElMessageBox, ElMessage } from "element-plus";
+import { ClickOutside as vClickOutside } from "element-plus";
 import {
   custombj_postSave,
   fetch_electrical_point_ai,
@@ -264,10 +519,36 @@ import {
   getStationinfo,
   fetchPointList,
   fetchPointListByBootst,
+  getAlarmMap,
+  getAlarmMapById,
 } from "@/api/zhbj/index.js";
 import { useStore } from "vuex";
 const store = useStore();
 const emits = defineEmits(["close"]);
+const buttonRef = ref();
+const popoverRef = ref();
+const multipleTableRef = ref();
+const lPopVisible = ref(false);
+
+const filterHandler = (value, row, column) => {
+  const property = column["property"];
+  return row[property] === value;
+};
+
+const setTableCheckbox = () => {
+  if (lPopVisible.value) {
+    state.pcflList.forEach((ele) => {
+      const findRes = state.alarmMapList.find((findEle) => {
+        return ele.id === findEle.id;
+      });
+      if (findRes) {
+        multipleTableRef?.value?.toggleRowSelection(findRes, true);
+      }
+    });
+    multipleTableRef?.value?.doLayout();
+  }
+};
+
 const props = defineProps({
   //是否显示
   isVisible: {
@@ -291,10 +572,20 @@ const props = defineProps({
     type: Array,
   },
 });
+
 watch(
   () => props.isVisible,
   (val, old) => {
     nextTick(() => {
+      if (val) {
+        getAlarmMap().then((res) => {
+          let alarmMapList = [];
+          for (let key in res.data) {
+            alarmMapList = [].concat(alarmMapList, res.data[key]);
+          }
+          state.alarmMapList = alarmMapList;
+        });
+      }
       isShow.value = val;
     });
   },
@@ -308,6 +599,9 @@ watch(
     nextTick(() => {
       form.value = val;
       if (val.id && val.id != "") {
+        getAlarmMapById({ alarmId: val.id }).then((res) => {
+          state.pcflList = res.data || [];
+        });
         if (val?.stationId.includes("FDC") || val?.stationId.includes("GDC")) {
           getfetchPointList();
         } else {
@@ -362,6 +656,7 @@ const form = ref({
   tag: "",
   uniformCode: "",
 });
+
 const getExtraCharacters = (str1, str2) => {
   let result = "";
   if (str1 && str2) {
@@ -374,11 +669,33 @@ const getExtraCharacters = (str1, str2) => {
 
   return result;
 };
+
+const handleSelectionChange = (value) => {
+  state.pcflList = value;
+};
+
+const getFilters = (key) => {
+  // 提取所有对象的特定键值
+  const values = state.alarmMapList.map((item) => item[key]);
+  // 使用Set去重
+  const uniqueValues = Array.from(new Set(values));
+
+  const result = uniqueValues.reduce((acc, name) => {
+    acc[name] = true;
+    return acc;
+  }, {});
+
+  let out = [];
+
+  for (let key in result) {
+    out.push({ text: key, value: key });
+  }
+  return out;
+};
 const newVal = ref("");
 watch(
   () => form.value.expression,
   (val, old) => {
-    console.log(val, old);
     let a = getExtraCharacters(val, old);
     newVal.value = a;
   },
@@ -404,6 +721,8 @@ const state = reactive({
   DIPointList: [],
   AIPointSearch: "",
   DIPointSearch: "",
+  alarmMapList: [],
+  pcflList: [],
 });
 const operator = [
   "+",
@@ -766,15 +1085,18 @@ const submitForm = async (formEl) => {
   await formEl.validate((valid, fields) => {
     if (valid) {
       save();
-    } else {
-      console.log("error submit!", fields);
     }
   });
 };
 //保存
 const save = async () => {
-  const res = await custombj_postSave(form.value);
-  console.warn(res);
+  let params = Object.assign({}, form.value);
+  let alarmPlan = [];
+  state.pcflList.forEach((ele) => {
+    alarmPlan.push(ele.id);
+  });
+  params.alarmPlan = alarmPlan.toString();
+  const res = await custombj_postSave(params);
   if (res.code != 200) {
     ElMessage.error(res.msg);
   } else {
@@ -840,3 +1162,25 @@ const closeDialog = () => {
   padding: 0;
 }
 </style>
+<style lang="less">
+.alDio {
+  .el-dialog__body {
+    max-height: 700px;
+    overflow-y: scroll;
+  }
+  .el-card__body {
+    padding: 10px;
+    color: #fff;
+    border: 1px solid #999;
+  }
+}
+
+.alDioPop {
+  max-height: 500px;
+  overflow-y: hidden;
+
+  .el-table {
+    margin: 5px 0;
+  }
+}
+</style>

+ 8 - 2
src/views/IntegratedAlarm/alarmConfig/components/windturbine_components.vue

@@ -195,7 +195,13 @@
       </el-form-item>
     </el-form>
     <el-row class="footerButton" style="margin-top: 20px">
-      <el-button size="mini" round @click="cancle">取 消</el-button>
+      <el-button
+        :style="`color:${$store.state.theme ? '#000' : '#fff'}`"
+        size="mini"
+        round
+        @click="cancle"
+        >取 消</el-button
+      >
       <el-button size="mini" round @click="checkData">确 定</el-button>
     </el-row>
   </el-dialog>
@@ -303,7 +309,7 @@ export default {
       categoryArray: [
         { id: "windturbine", label: "风机报警" },
         { id: "booststation", label: "升压站报警" },
-        { id: "inverter", label: "光伏报警" },
+        // { id: "inverter", label: "光伏报警" },
       ],
       wpArray: [],
       modelArray: [],

+ 1 - 1
src/views/IntegratedAlarm/alarmConfig/historyConfig/index.vue

@@ -13,7 +13,7 @@
         >
         <el-upload
           style="display: inline; margin-left: 10px"
-          action="/sharding/warning2/import"
+          :action="`${$store.state.baseURL}/alarmconfiguration/import`"
           :headers="token"
           :show-file-list="false"
           :on-success="handleSuccess"

+ 5 - 5
src/views/IntegratedAlarm/deviceConfig/components/custom.vue

@@ -12,7 +12,7 @@
       >
       <el-upload
         style="display: inline; margin-left: 10px"
-        action="/sharding/alertrule2/import"
+        :action="`${$store.state.baseURL}/alertrule/import`"
         :headers="token"
         :show-file-list="false"
         :on-success="handleSuccess"
@@ -217,11 +217,11 @@
       ></el-pagination>
     </div>
   </div>
-  <!-- <customcomponents
+  <customcomponents
     @close="dialogclose"
     :isVisible="state.visible"
     :form="state.form"
-  /> -->
+  />
 </template>
 <script setup>
 import { custombj_fetchTableData, getWtModel } from "@/api/zhbj/index.js";
@@ -366,8 +366,8 @@ const query = reactive({
 });
 let total = ref(0);
 onMounted(() => {
-  //   getData();
-  //   getequipmentmodel_list();
+    getData();
+    getequipmentmodel_list();
 });
 const dialogclose = () => {
   state.visible = false;

+ 69 - 55
src/views/IntegratedAlarm/deviceConfig/components/custom_components.vue

@@ -30,7 +30,7 @@
                 label="风机"
                 value="windturbine"
               ></el-option>
-              <el-option
+              <!-- <el-option
                 key="inverter"
                 label="逆变器"
                 value="inverter"
@@ -39,7 +39,7 @@
                 key="booststation"
                 label="升压站"
                 value="booststation"
-              ></el-option>
+              ></el-option> -->
             </el-select>
           </el-form-item>
           <el-form-item prop="rank">
@@ -52,10 +52,10 @@
               <el-option key="5" label="高级" value="5" />
             </el-select>
           </el-form-item>
-          <el-form-item prop="enabled">
+          <el-form-item prop="enable">
             <el-tag size="small">是否启用</el-tag>
             <el-switch
-              v-model="form.enabled"
+              v-model="form.enable"
               :active-value="true"
               :inactive-value="false"
               active-color="#13ce66"
@@ -100,8 +100,8 @@
             <el-select v-model="form.relatedParts" style="width: 100%">
               <el-option
                 v-for="i in state.relatePartList"
-                :key="i.partCode"
-                :value="i.partCode"
+                :key="i.nemCode"
+                :value="i.nemCode"
                 :label="i.name"
               />
             </el-select>
@@ -131,7 +131,7 @@
           </el-form-item>
         </el-col>
         <el-col :span="9">
-          <el-tabs type="border-card">
+          <el-tabs type="border-card" class="currentTabs">
             <el-tab-pane label="AI测点">
               <el-input v-model="state.AIPointSearch"> </el-input>
               <el-table
@@ -218,16 +218,22 @@
       </el-row>
       <el-row :gutter="24">
         <el-col :span="24">
-          <el-form-item prop="descriptionShow">
+          <el-form-item prop="description">
             <el-tag size="small">规则描述</el-tag>
-            <el-input type="textarea" rows="4" v-model="form.descriptionShow" />
+            <el-input type="textarea" rows="4" v-model="form.description" />
           </el-form-item>
         </el-col>
       </el-row>
     </el-form>
     <template #footer>
       <span class="footerButton">
-        <el-button round size="mini" @click="closeDialog">取 消</el-button>
+        <el-button
+          :style="`color: #${$store.state.theme ? '000' : 'fff'}`"
+          round
+          size="mini"
+          @click="closeDialog"
+          >取 消</el-button
+        >
         <el-button round size="mini" @click="submitForm(ruleFormRef)"
           >确 定</el-button
         >
@@ -239,9 +245,9 @@
 import { ref, onMounted, reactive, computed, watch, nextTick } from "vue";
 import { ElMessageBox, ElMessage } from "element-plus";
 import {
-  //   fetchAIPointList,
-  //   fetchDIPointList,
-  //   fetchRelatePart,
+  // fetchAIPointList,
+  // fetchDIPointList,
+  fetchRelatePart,
   custombj_postSave,
   fetch_electrical_point_ai,
   fetch_electrical_point_di,
@@ -251,13 +257,26 @@ import {
 import { useStore } from "vuex";
 const store = useStore();
 const stationList = computed(() =>
-  store.state.stationListAll.map((i) => i.windType == -1)
+  store.state.stationListAll.map((i) => {
+    if (i.windType === "-1") {
+      return i;
+    }
+  })
 );
+const props = defineProps({
+  isVisible: {
+    type: Boolean,
+    defaule: false,
+  },
+  form: {
+    type: Object,
+  },
+});
 onMounted(() => {
   getfetchRelatePart();
 });
 watch(
-  () => props.isVisible,
+  () => props?.isVisible,
   (val, old) => {
     isShow.value = val;
   },
@@ -266,24 +285,13 @@ watch(
   }
 );
 watch(
-  () => props.form?.id,
-  (val, old) => {
-    if (val != "") {
-      nextTick(async () => {
-        getfetchAIPointList();
-        getfetchDIPointList();
-      });
-    }
-  },
-  {
-    deep: true,
-  }
-);
-watch(
   () => props.form,
   (val, old) => {
     nextTick(() => {
       form.value = val;
+      if (props.form.stationId && props.form.modelId) {
+        modelIdChange();
+      }
     });
   },
   {
@@ -294,7 +302,7 @@ const isShow = ref(false);
 const form = ref({
   id: "",
   name: "",
-  descriptionShow: "",
+  description: "",
   expression: "",
   tag: "",
   rank: "",
@@ -303,7 +311,7 @@ const form = ref({
   ednaValue: "",
   category: "",
   range: 0,
-  station: "",
+  stationId: "",
   windturbine: "",
   line: "",
   project: "",
@@ -313,15 +321,6 @@ const form = ref({
   userName: "",
 });
 const emits = defineEmits(["close"]);
-const props = defineProps({
-  isVisible: {
-    type: Boolean,
-    defaule: false,
-  },
-  form: {
-    type: Object,
-  },
-});
 const toEmits = () => {
   emits("close"); // 向父组件传递数据
 };
@@ -578,8 +577,8 @@ const rules = reactive({
 });
 
 //stationChange
-const stationChange = async () => {
-  form.value.modelId = "";
+const stationChange = async (id) => {
+  form.value.stationId = id;
   getequipmentmodel_list();
 };
 //modelIdChange
@@ -595,14 +594,24 @@ const getequipmentmodel_list = async () => {
 //所属部件
 const getfetchRelatePart = async () => {
   const res = await fetchRelatePartAndAlarmType();
-  state.relatePartList = res;
+  let relatePartList = [];
+  for (let key in res.data) {
+    res.data[key].forEach((ele) => {
+      ele.disabled = ele.enable === 1;
+      relatePartList.push(ele);
+    });
+  }
+  state.relatePartList = relatePartList;
 };
 // 查询风场AI、DI测点
 const getfetchAIPointList = async () => {
-  //   const res = await fetchAIPointList(form.value.station, form.value.modelId);
-  //   state.AIPointList = res.sort(function (a, b) {
-  //     return a.uniformCode - b.uniformCode;
-  //   });
+  const res = await fetch_electrical_point_ai(
+    form.value.stationId,
+    form.value.modelId
+  );
+  state.AIPointList = res.sort(function (a, b) {
+    return a.uniformCode - b.uniformCode;
+  });
 };
 const filterAIList = computed(() =>
   state.AIPointList?.filter(
@@ -621,7 +630,10 @@ const filterDIList = computed(() =>
   )
 );
 const getfetchDIPointList = async () => {
-  const res = await fetchDIPointList(form.value.station, form.value.modelId);
+  const res = await fetch_electrical_point_di(
+    form.value.stationId,
+    form.value.modelId
+  );
   state.DIPointList = res.sort(function (a, b) {
     return a.uniformCode - b.uniformCode;
   });
@@ -662,8 +674,8 @@ const tabFuncRowClickHandle = (row) => {
   form.value.expression = result; // 赋值给表单中的的字段
 };
 //rowDbclick
-const rowDbclick = (row) => {
-  elInputSplit(row.uniformCode);
+const rowDbclick = async (row) => {
+  await elInputSplit(row.uniformCode);
 };
 // 表达式字符串拼接
 const elInputSplit = async (val) => {
@@ -678,13 +690,17 @@ const elInputSplit = async (val) => {
   elInput.focus();
   elInput.selectionStart = startPos + txtSplit.length;
   elInput.selectionEnd = startPos + txtSplit.length;
+  form.value.expression = result; // 赋值给表单中的的字段
 };
 //保存
 const save = async () => {
   const res = await custombj_postSave(form.value);
-  console.warn(res);
-  ElMessage.success(`保存成功!`);
-  closeDialog();
+  if (res.code === 200) {
+    ElMessage.success(`保存成功`);
+    closeDialog();
+  } else {
+    ElMessage.error(`保存失败`);
+  }
 };
 //提交
 const submitForm = async (formEl) => {
@@ -692,8 +708,6 @@ const submitForm = async (formEl) => {
   await formEl.validate((valid, fields) => {
     if (valid) {
       save();
-    } else {
-      console.log("error submit!", fields);
     }
   });
 };

+ 56 - 50
src/views/IntegratedAlarm/deviceConfig/components/faultmode.vue

@@ -157,7 +157,7 @@
           <el-col :span="12">
             <el-form-item label="结构">
               <el-cascader
-                v-model="editFormData.structurecode"
+                v-model="editFormData.structureCode"
                 :options="cascaderdata"
                 :props="{ checkStrictly: true, emitPath: false }"
                 clearable
@@ -167,7 +167,11 @@
       </el-form>
       <template #footer>
         <span class="footerButton">
-          <el-button size="mini" round @click="editVisible = false"
+          <el-button
+            :style="`color: #${$store.state.theme ? '000' : 'fff'}`"
+            size="mini"
+            round
+            @click="editVisible = false"
             >取 消</el-button
           >
           <el-button size="mini" round type="primary" @click="saveEdit"
@@ -184,7 +188,7 @@ import { ElMessageBox, ElMessage } from "element-plus";
 import { outExportExcel } from "@/tools/excel/exportExcel.js"; //引入文件
 import {
   faultmode_windturbine,
-  faultmode_structurecode,
+  faultmode_structureCode,
   faultmode_delete,
   faultmode_add_edit,
 } from "@/api/zhbj/index.js";
@@ -203,7 +207,7 @@ let treeId = inject("treeId");
 let editVisible = ref(false);
 let editFormData = ref({});
 onMounted(() => {
-  //   getfaultmode(desc.value.code);
+  getfaultmode(desc.value.code);
 });
 const selectV = {
   1: "I",
@@ -249,7 +253,7 @@ let state = reactive({
       severity: 6,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010211",
       models: null,
     },
@@ -263,7 +267,7 @@ let state = reactive({
       severity: 5,
       occurence: 4,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010211",
       models: null,
     },
@@ -278,7 +282,7 @@ let state = reactive({
       severity: 5,
       occurence: 4,
       detection: 3,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010207",
       models: null,
     },
@@ -292,7 +296,7 @@ let state = reactive({
       severity: 5,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010207",
       models: null,
     },
@@ -306,7 +310,7 @@ let state = reactive({
       severity: 5,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010206",
       models: null,
     },
@@ -320,7 +324,7 @@ let state = reactive({
       severity: 5,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010214",
       models: null,
     },
@@ -334,7 +338,7 @@ let state = reactive({
       severity: 5,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010202",
       models: null,
     },
@@ -348,7 +352,7 @@ let state = reactive({
       severity: 5,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010202",
       models: null,
     },
@@ -362,7 +366,7 @@ let state = reactive({
       severity: 5,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010202",
       models: null,
     },
@@ -376,7 +380,7 @@ let state = reactive({
       severity: 5,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010202",
       models: null,
     },
@@ -390,7 +394,7 @@ let state = reactive({
       severity: 5,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010202",
       models: null,
     },
@@ -404,7 +408,7 @@ let state = reactive({
       severity: 5,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010202",
       models: null,
     },
@@ -418,7 +422,7 @@ let state = reactive({
       severity: 5,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010202",
       models: null,
     },
@@ -432,7 +436,7 @@ let state = reactive({
       severity: 5,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010202",
       models: null,
     },
@@ -446,7 +450,7 @@ let state = reactive({
       severity: 5,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010202",
       models: null,
     },
@@ -460,7 +464,7 @@ let state = reactive({
       severity: 5,
       occurence: 4,
       detection: 3,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010202",
       models: null,
     },
@@ -474,7 +478,7 @@ let state = reactive({
       severity: 5,
       occurence: 4,
       detection: 3,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010202",
       models: null,
     },
@@ -488,7 +492,7 @@ let state = reactive({
       severity: 5,
       occurence: 4,
       detection: 3,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010202",
       models: null,
     },
@@ -502,7 +506,7 @@ let state = reactive({
       severity: 5,
       occurence: 4,
       detection: 3,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010202",
       models: null,
     },
@@ -516,7 +520,7 @@ let state = reactive({
       severity: 5,
       occurence: 4,
       detection: 3,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010202",
       models: null,
     },
@@ -532,7 +536,7 @@ let state = reactive({
       severity: 5,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010204",
       models: null,
     },
@@ -548,7 +552,7 @@ let state = reactive({
       severity: 5,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010208",
       models: null,
     },
@@ -564,7 +568,7 @@ let state = reactive({
       severity: 5,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010204",
       models: null,
     },
@@ -580,7 +584,7 @@ let state = reactive({
       severity: 5,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010204",
       models: null,
     },
@@ -594,7 +598,7 @@ let state = reactive({
       severity: 5,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010204",
       models: null,
     },
@@ -609,7 +613,7 @@ let state = reactive({
       severity: 5,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010202",
       models: null,
     },
@@ -625,7 +629,7 @@ let state = reactive({
       severity: 5,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010202",
       models: null,
     },
@@ -640,7 +644,7 @@ let state = reactive({
       severity: 5,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010202",
       models: null,
     },
@@ -656,7 +660,7 @@ let state = reactive({
       severity: 5,
       occurence: 4,
       detection: 3,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010204",
       models: null,
     },
@@ -670,7 +674,7 @@ let state = reactive({
       severity: 5,
       occurence: 5,
       detection: 3,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010207",
       models: null,
     },
@@ -684,7 +688,7 @@ let state = reactive({
       severity: 5,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010208",
       models: null,
     },
@@ -698,7 +702,7 @@ let state = reactive({
       severity: 5,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010204",
       models: null,
     },
@@ -712,7 +716,7 @@ let state = reactive({
       severity: 2,
       occurence: 4,
       detection: 3,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010202",
       models: null,
     },
@@ -726,7 +730,7 @@ let state = reactive({
       severity: 2,
       occurence: 4,
       detection: 3,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010202",
       models: null,
     },
@@ -740,7 +744,7 @@ let state = reactive({
       severity: 2,
       occurence: 4,
       detection: 3,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010202",
       models: null,
     },
@@ -754,7 +758,7 @@ let state = reactive({
       severity: 2,
       occurence: 4,
       detection: 3,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010202",
       models: null,
     },
@@ -768,7 +772,7 @@ let state = reactive({
       severity: 2,
       occurence: 4,
       detection: 3,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010202",
       models: null,
     },
@@ -782,7 +786,7 @@ let state = reactive({
       severity: 2,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010211",
       models: null,
     },
@@ -796,7 +800,7 @@ let state = reactive({
       severity: 7,
       occurence: 4,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010211",
       models: null,
     },
@@ -810,7 +814,7 @@ let state = reactive({
       severity: 7,
       occurence: 3,
       detection: 2,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010211",
       models: null,
     },
@@ -824,7 +828,7 @@ let state = reactive({
       severity: 6,
       occurence: 3,
       detection: 4,
-      deviceid: "windturbine",
+      deviceId: "windturbine",
       structureCode: "101010211",
       models: null,
     },
@@ -838,8 +842,8 @@ let state = reactive({
     severity: null,
     occurence: null,
     detection: null,
-    deviceid: "windturbine",
-    structurecode: "",
+    deviceId: "windturbine",
+    structureCode: "",
     models: null,
   },
 });
@@ -861,7 +865,7 @@ const handleDelete = (row) => {
         ElMessage.success(`删除成功!`);
       } else {
         ElMessage.success("删除失败");
-      }
+      } 
       getfaultmode(desc.value.code);
     })
     .catch(() => {});
@@ -879,7 +883,9 @@ const saveEdit = async () => {
 };
 // getData
 const getfaultmode = async (code) => {
-  const res = await faultmode_structurecode(code);
+  console.log(1111, code);
+  const res = await faultmode_structureCode(code);
+  console.log(2222, res);
   state.faultmodeTableData = res;
 };
 
@@ -909,7 +915,7 @@ const export2Excel = () => {
     "处理方法",
   ];
   const tableKey = [
-    "structurecode",
+    "structureCode",
     "name",
     "code",
     "occurence",

+ 5 - 5
src/views/IntegratedAlarm/deviceConfig/components/message.vue

@@ -6,7 +6,7 @@
       </el-form-item>
       <el-form-item label="上级节点">
         <el-cascader
-          v-model="desc.parentcode"
+          v-model="desc.parentCode"
           :options="cascaderdata"
           :props="{ checkStrictly: true, emitPath: false }"
           :show-all-levels="false"
@@ -14,7 +14,7 @@
         />
       </el-form-item>
       <el-form-item label="设备ID">
-        <el-input v-model="desc.deviceid" disabled></el-input>
+        <el-input v-model="desc.deviceId" disabled></el-input>
       </el-form-item>
       <el-form-item label="结构名称">
         <el-input v-model="desc.name"></el-input>
@@ -34,7 +34,7 @@
         ></el-input>
       </el-form-item>
       <el-form-item label="序号">
-        <el-input v-model="desc.orderno"></el-input>
+        <el-input-number v-model="desc.orderno" :step="1" :min="0" />
       </el-form-item>
       <el-form-item label="是否有效">
         <div style="height: 100%; display: flex; align-items: center">
@@ -50,11 +50,11 @@
     </el-form>
     <el-button
       style="float: right; border: none"
-      :style="
+      :style="`color:#fff;${
         $store.state.moreSty === 'greenSty'
           ? 'background: #05bb4c;'
           : 'background: #2169c3;'
-      "
+      }`"
       @click="savedesc"
       :disabled="desc.code == ''"
       >保存</el-button

+ 4 - 4
src/views/IntegratedAlarm/deviceConfig/components/windturbine.vue

@@ -13,7 +13,7 @@
         >
         <el-upload
           style="display: inline; margin-left: 10px"
-          action="/sharding/warning2/import"
+          :action="`${$store.state.baseURL}/alarmconfiguration/import`"
           :headers="token"
           :show-file-list="false"
           :on-success="handleSuccess"
@@ -691,9 +691,9 @@ const query = reactive({
 });
 let total = ref(0);
 onMounted(() => {
-  //   getStationList();
-  //   getData();
-  //   getequipmentmodel_list();
+    getStationList();
+    getData();
+    getequipmentmodel_list();
 });
 const dialogclose = () => {
   state.visible = false;

+ 1 - 1
src/views/IntegratedAlarm/deviceConfig/components/windturbine_components.vue

@@ -288,7 +288,7 @@ export default {
       categoryArray: [
         { id: "windturbine", label: "风机报警" },
         { id: "booststation", label: "升压站报警" },
-        { id: "inverter", label: "光伏报警" },
+        // { id: "inverter", label: "光伏报警" },
       ],
       wpArray: [],
       modelArray: [],

+ 19 - 19
src/views/IntegratedAlarm/deviceConfig/components/ycpoint.vue

@@ -101,17 +101,17 @@
               max-height="400px"
             >
               <el-table-column
-                property="devicemodel"
+                prop="deviceModel"
                 label="机型"
                 align="center"
               ></el-table-column>
               <el-table-column
-                property="uniformcode"
+                prop="uniformCode"
                 label="统一编码"
                 align="center"
               ></el-table-column>
               <el-table-column
-                property="multiplier"
+                prop="multiplier"
                 label="倍率"
                 align="center"
               ></el-table-column>
@@ -171,7 +171,7 @@
   <el-dialog v-model="editVisible" width="40%">
     <el-form :model="editFormData" label-width="80px">
       <el-form-item label="编码">
-        <el-input v-model="editFormData.metriccode"></el-input>
+        <el-input v-model="editFormData.metricCode"></el-input>
       </el-form-item>
       <el-row :gutter="24">
         <el-col :span="12">
@@ -224,7 +224,7 @@
         <el-col :span="12">
           <el-form-item label="结构">
             <el-cascader
-              v-model="editFormData.structurecode"
+              v-model="editFormData.structureCode"
               :options="cascaderdata"
               :props="{ checkStrictly: true, emitPath: false }"
               clearable
@@ -273,7 +273,7 @@
           style="width: 100%; margin-top: 10px"
           max-height="200px"
         >
-          <el-table-column prop="devicemodel" label="机型" />
+          <el-table-column prop="deviceModel" label="机型" />
           <el-table-column label="倍率">
             <template #default="scope">
               <el-input v-model="scope.row.multiplier" size="mini" />
@@ -281,7 +281,7 @@
           </el-table-column>
           <el-table-column label="统一编码">
             <template #default="scope">
-              <el-input v-model="scope.row.uniformcode" size="mini" />
+              <el-input v-model="scope.row.uniformCode" size="mini" />
             </template>
           </el-table-column>
         </el-table>
@@ -315,9 +315,9 @@ import {
 } from "@/api/zhbj/index.js";
 import { outExportExcel } from "@/tools/excel/exportExcel.js"; //引入文件
 onMounted(() => {
-  //   getPoint(desc.value);
-  //   getDeviceModel();
-  //   getequipmentmodel_list();
+  getPoint(desc.value);
+  getDeviceModel();
+  getequipmentmodel_list();
 });
 let editFormData = ref({});
 let editVisible = ref(false); //传感点
@@ -327,7 +327,7 @@ let cascaderdata = inject("cascaderdata");
 watch(
   () => treeId,
   (newV, old) => {
-    state.addFormData.structurecode = desc.value.code;
+    state.addFormData.structureCode = desc.value.code;
     getPoint(desc.value);
   },
   {
@@ -739,12 +739,12 @@ let state = reactive({
     categorysci: null,
     categorysys: null,
     description: null,
-    deviceid: "windturbine",
+    deviceId: "windturbine",
     enname: null,
     id: null,
-    metriccode: "",
+    metricCode: "",
     name: "",
-    structurecode: "",
+    structureCode: "",
     unitname: null,
     unitnamecn: null,
     deviceModelMetrics: [],
@@ -824,12 +824,12 @@ const handleDelete = (row) => {
 const deviceModelAdd = async () => {
   if (state.deviceModelSel == "") return;
   let obj = {
-    deviceid: editFormData.value.deviceid,
-    devicemodel: state.deviceModelSel,
+    deviceId: editFormData.value.deviceId,
+    deviceModel: state.deviceModelSel,
     id: null,
-    metriccode: editFormData.value.metriccode,
+    metricCode: editFormData.value.metricCode,
     multiplier: 0,
-    uniformcode: "",
+    uniformCode: "",
   };
   editFormData.value.deviceModelMetrics.push(obj);
 };
@@ -879,7 +879,7 @@ const export2Excel = async () => {
   ];
   const tableKey = [
     "structurecode",
-    "metriccode",
+    "metricCode",
     "name",
     "enname",
     "unitname",

+ 21 - 23
src/views/IntegratedAlarm/deviceConfig/components/yxpoint.vue

@@ -21,7 +21,7 @@
       <el-upload
         class="upload-demo"
         :disabled="desc.code == ''"
-        action="/sharding/device/input"
+        :action="`${$store.state.baseURL}/device/input`"
         :show-file-list="false"
         :on-success="handleSuccess"
         :on-progress="handleProgress"
@@ -74,12 +74,12 @@
               max-height="400px"
             >
               <el-table-column
-                property="devicemodel"
+                property="deviceModel"
                 label="机型"
                 align="center"
               ></el-table-column>
               <el-table-column
-                property="uniformcode"
+                property="uniformCode"
                 label="统一编码"
                 align="center"
               ></el-table-column>
@@ -143,7 +143,7 @@
   <el-dialog v-model="editVisible" width="40%">
     <el-form :model="editFormData" label-width="80px">
       <el-form-item label="编码">
-        <el-input v-model="editFormData.metriccode"></el-input>
+        <el-input v-model="editFormData.metricCode"></el-input>
       </el-form-item>
       <el-row :gutter="24">
         <el-col :span="12">
@@ -196,7 +196,7 @@
         <el-col :span="12">
           <el-form-item label="结构">
             <el-cascader
-              v-model="editFormData.structurecode"
+              v-model="editFormData.structureCode"
               :options="cascaderdata"
               :props="{ checkStrictly: true, emitPath: false }"
               clearable
@@ -244,7 +244,7 @@
           style="width: 100%; margin-top: 10px"
           max-height="200px"
         >
-          <el-table-column prop="devicemodel" label="机型" />
+          <el-table-column prop="deviceModel" label="机型" />
           <el-table-column label="倍率">
             <template #default="scope">
               <el-input v-model="scope.row.multiplier" size="mini" />
@@ -252,7 +252,7 @@
           </el-table-column>
           <el-table-column label="统一编码">
             <template #default="scope">
-              <el-input v-model="scope.row.uniformcode" size="mini" />
+              <el-input v-model="scope.row.uniformCode" size="mini" />
             </template>
           </el-table-column>
         </el-table>
@@ -280,9 +280,9 @@ import {
 } from "@/api/zhbj/index.js";
 import { outExportExcel } from "@/tools/excel/exportExcel.js"; //引入文件
 onMounted(() => {
-  //   getPoint(desc.value);
-  //   getDeviceModel();
-  //   getequipmentmodel_list();
+  getPoint(desc.value);
+  getDeviceModel();
+  getequipmentmodel_list();
 });
 let editFormData = ref({});
 let editVisible = ref(false); //传感点
@@ -292,7 +292,7 @@ let cascaderdata = inject("cascaderdata");
 watch(
   () => treeId,
   (newV, old) => {
-    state.addFormData.structurecode = desc.value.code;
+    state.addFormData.structureCode = desc.value.code;
     getPoint(desc.value);
   },
   {
@@ -704,12 +704,12 @@ let state = reactive({
     categorysci: null,
     categorysys: null,
     description: null,
-    deviceid: "windturbine",
+    deviceId: "windturbine",
     enname: null,
     id: null,
-    metriccode: "",
+    metricCode: "",
     name: "",
-    structurecode: "",
+    structureCode: "",
     unitname: null,
     unitnamecn: null,
     deviceModelMetrics: [],
@@ -793,12 +793,12 @@ const handleDelete = (row) => {
 const deviceModelAdd = async () => {
   if (state.deviceModelSel == "") return;
   let obj = {
-    deviceid: editFormData.value.deviceid,
-    devicemodel: state.deviceModelSel,
+    deviceId: editFormData.value.deviceId,
+    deviceModel: state.deviceModelSel,
     id: null,
-    metriccode: editFormData.value.metriccode,
+    metricCode: editFormData.value.metricCode,
     multiplier: 0,
-    uniformcode: "",
+    uniformCode: "",
   };
   editFormData.value.deviceModelMetrics.push(obj);
 };
@@ -847,8 +847,8 @@ const export2Excel = async () => {
     "描述",
   ];
   const tableKey = [
-    "structurecode",
-    "metriccode",
+    "structureCode",
+    "metricCode",
     "name",
     "enname",
     "unitname",
@@ -858,9 +858,7 @@ const export2Excel = async () => {
   ];
   outExportExcel(tableHeader, tableKey, tableData.records, "测点导出excel");
 };
-const handleClick = ({ row }) => {
-  console.log(row.index);
-};
+const handleClick = ({ row }) => {};
 </script>
 <style lang="less" scoped>
 .buttons {

+ 23 - 20
src/views/IntegratedAlarm/deviceConfig/index.vue

@@ -6,7 +6,7 @@
     <div class="device-content">
       <div class="box-card-tree">
         <div class="btns">
-          <el-button size="mini" class="buttons" round @click="handleTreeAdd()"
+          <el-button size="mini" class="buttons" round @click="handleTreeAdd"
             >新增</el-button
           >
           <el-button
@@ -32,22 +32,23 @@
       </div>
       <div class="box-card baseInfoTabs">
         <el-tabs type="card">
-          <el-tab-pane label="遥测点">
+          <el-tab-pane label="遥测点" v-if="1">
             <ycpoint />
           </el-tab-pane>
-          <el-tab-pane label="遥信点">
+          <el-tab-pane label="遥信点" v-if="1">
             <yxpoint />
           </el-tab-pane>
-          <el-tab-pane label="设备报警">
+          <el-tab-pane label="设备报警" v-if="1">
             <windturbine />
           </el-tab-pane>
-          <el-tab-pane label="故障预警">
+          <el-tab-pane label="故障预警" v-if="1">
             <custom />
           </el-tab-pane>
-          <el-tab-pane label="故障原因">
+          <!-- 故障原因模块隐藏,模块内修改与新增接口异常,导入 excel 接口404 -->
+          <el-tab-pane label="故障原因" v-if="0">
             <faultmode />
           </el-tab-pane>
-          <el-tab-pane label="基本信息">
+          <el-tab-pane label="基本信息" v-if="1">
             <message />
           </el-tab-pane>
         </el-tabs>
@@ -66,7 +67,7 @@
             <el-col :span="12">
               <el-form-item label="上级节点" label-width="100px">
                 <el-cascader
-                  v-model="state.treeAddFormData.parentcode"
+                  v-model="state.treeAddFormData.parentCode"
                   :options="state.cascaderdata"
                   :props="{ checkStrictly: true, emitPath: false }"
                   :show-all-levels="false"
@@ -91,9 +92,11 @@
           <el-row :gutter="24">
             <el-col :span="10"
               ><el-form-item label="序号">
-                <el-input
+                <el-input-number
                   v-model="state.treeAddFormData.orderno"
-                ></el-input> </el-form-item
+                  :min="0"
+                  :step="1"
+                /> </el-form-item
             ></el-col>
             <el-col :span="6">
               <el-form-item label="是否有效">
@@ -108,7 +111,7 @@
             <el-col :span="8">
               <el-form-item label="设备ID">
                 <el-input
-                  v-model="state.treeAddFormData.deviceid"
+                  v-model="state.treeAddFormData.deviceId"
                   disabled
                 ></el-input> </el-form-item
             ></el-col>
@@ -148,7 +151,7 @@ const pageTitle = "设备模型配置";
 let treeVisible = ref(false);
 let editFormData = ref({});
 onMounted(async () => {
-  //   await getData();
+  await getData();
 });
 let state = reactive({
   isDel: false, //是否能被删除
@@ -4259,7 +4262,7 @@ let state = reactive({
     categorysci: null,
     categorysys: null,
     description: null,
-    deviceid: "windturbine",
+    deviceId: "windturbine",
     enname: null,
     id: null,
     metriccode: "",
@@ -4271,12 +4274,12 @@ let state = reactive({
   },
   treeAddFormData: {
     code: "",
-    parentcode: "",
-    deviceid: "windturbine",
+    parentCode: "",
+    deviceId: "windturbine",
     name: "",
     enname: "",
     description: "",
-    orderno: "",
+    orderno: 0,
     enabled: true,
   },
   options: [
@@ -4295,12 +4298,12 @@ let state = reactive({
   ],
   desc: {
     code: "",
-    parentcode: "",
-    deviceid: "",
+    parentCode: "",
+    deviceId: "",
     name: "",
     enname: "",
     description: "",
-    orderno: "",
+    orderno: 0,
     enabled: true,
   },
   treeDelVal: "",
@@ -4369,7 +4372,7 @@ const delTreeBtn = async () => {
 //保存tree add
 const saveTreeAdd = async () => {
   const res = await treeAdd(state.treeAddFormData);
-  if (res.status == 20000) {
+  if (res.code == 200) {
     ElMessage.success(`操作成功!`);
     treeVisible.value = false;
     getData();

+ 696 - 0
src/views/IntegratedAlarm/earlyWarning/index.vue

@@ -0,0 +1,696 @@
+<template>
+  <div class="history-warning">
+    <div class="form-wrapper">
+      <div class="search-wrapper">
+        <div class="search-item">
+          <span class="label">类型:</span>
+          <el-select
+            v-model="types"
+            placeholder="请选择"
+            clearable
+            style="width: 120px"
+          >
+            <el-option
+              v-for="item in typeList"
+              :key="item"
+              :label="item"
+              :value="item"
+            />
+          </el-select>
+        </div>
+        <div class="search-item">
+          <span class="label">名称:</span>
+          <div class="search-content"></div>
+          <el-input
+            v-model="name"
+            placeholder="请输入..."
+            size="mini"
+            clearable
+          ></el-input>
+        </div>
+      </div>
+      <div class="btns">
+        <el-button class="buttons" round size="mini" @click="getTableData"
+          >查询</el-button
+        >
+        <el-button size="mini" class="buttons" round @click="getExcelTemplate"
+          >获取模板</el-button
+        >
+        <el-upload
+          style="margin: 0 12px"
+          :action="`${$store.state.baseURL}/alarmplan/import`"
+          :show-file-list="false"
+          :on-success="handleSuccess"
+          :on-error="handleError"
+        >
+          <el-button class="buttons" size="mini" round>导入</el-button>
+        </el-upload>
+        <el-button class="buttons" round size="mini" @click="addEarly"
+          >新增</el-button
+        >
+        <el-button
+          class="buttons"
+          round
+          size="mini"
+          @click="deleteItem"
+          :disabled="!deleteSelectItem?.length"
+          >批量删除</el-button
+        >
+      </div>
+    </div>
+    <div class="table-wrapper">
+      <div class="leftContent" :data-type="$store.state.moreSty">
+        <span>预警排查方案</span>
+      </div>
+      <!-- :span-method="objectSpanMethod" -->
+      <el-table
+        size="mini"
+        :data="tableData"
+        style="width: 100%; height: calc(100% - 35px - 55px)"
+        @selection-change="handleSelectionChange"
+        stripe
+        border
+      >
+        <el-table-column type="selection" width="55" align="center" />
+        <el-table-column
+          label="类型"
+          prop="types"
+          align="center"
+          width="120px"
+          show-overflow-tooltip
+        ></el-table-column>
+        <el-table-column
+          label="名称"
+          prop="name"
+          align="center"
+          width="200px"
+          show-overflow-tooltip
+        ></el-table-column>
+        <!-- <el-table-column
+          label="编号"
+          prop="id"
+          align="center"
+          width="80px"
+          show-overflow-tooltip
+        ></el-table-column> -->
+
+        <el-table-column
+          label="排查步骤"
+          prop="troubleMethod"
+          align="left"
+          show-overflow-tooltip
+        >
+          <template #default="scope">
+            <template v-if="Array.isArray(scope.row.troubleMethod)">
+              <p v-for="(item, index) in scope.row.troubleMethod" :key="index">
+                {{ index + 1 }}. {{ item }}
+              </p>
+            </template>
+            <p v-else>
+              {{ scope.row.troubleMethod }}
+            </p>
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="检修方案"
+          prop="processMethod"
+          align="left"
+          show-overflow-tooltip
+        >
+          <template #default="scope">
+            <template v-if="Array.isArray(scope.row.processMethod)">
+              <p v-for="(item, index) in scope.row.processMethod" :key="index">
+                {{ index + 1 }}. {{ item }}
+              </p>
+            </template>
+            <p v-else>
+              {{ scope.row.processMethod }}
+            </p>
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="所需工具"
+          prop="tools"
+          align="left"
+          width="120px"
+          show-overflow-tooltip
+        >
+          <template #default="scope">
+            <template v-if="Array.isArray(scope.row.tools)">
+              <p v-for="(item, index) in scope.row.tools" :key="index">
+                {{ index + 1 }}. {{ item }}
+              </p>
+            </template>
+            <p v-else>
+              {{ scope.row.tools }}
+            </p>
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="备品备件"
+          prop="spareParts"
+          align="left"
+          width="120px"
+          show-overflow-tooltip
+        >
+          <template #default="scope">
+            <template v-if="Array.isArray(scope.row.spareParts)">
+              <p v-for="(item, index) in scope.row.spareParts" :key="index">
+                {{ index + 1 }}. {{ item }}
+              </p>
+            </template>
+            <p v-else>
+              {{ scope.row.spareParts }}
+            </p>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作" width="80px" align="center">
+          <template #default="scope">
+            <el-button size="small" @click="editItem(scope.row)">
+              编辑
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination-wrapper" v-if="false">
+        <el-pagination
+          layout="total, sizes, prev, pager, next"
+          :current-page="query.page"
+          :page-size="query.limit"
+          :page-sizes="[21, 100, 500, 1000]"
+          :total="query.pageTotal"
+          @size-change="
+            (value) => {
+              query.page = 1;
+              query.limit = value;
+              getAlarmHistoryt();
+            }
+          "
+          @current-change="handlePageChange"
+        ></el-pagination>
+      </div>
+    </div>
+    <el-dialog v-model="dialogVisible" width="40%" @closed="resetForm">
+      <el-form
+        :model="selectItem"
+        :rules="rules"
+        inline
+        label-width="80px"
+        ref="ruleFormRef"
+      >
+        <el-form-item label="类型" prop="types">
+          <el-select
+            v-model="selectItem.types"
+            placeholder="请选择"
+            style="width: 120px"
+          >
+            <el-option
+              v-for="item in typeList"
+              :key="item"
+              :label="item"
+              :value="item"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="名称" prop="name">
+          <el-input
+            v-model="selectItem.name"
+            style="width: 200px"
+            autosize
+            type="textarea"
+            placeholder="请输入"
+            resize="none"
+          />
+        </el-form-item>
+        <el-form-item label="排查步骤">
+          <el-input
+            v-model="selectItem.troubleMethod"
+            style="width: 200px"
+            autosize
+            type="textarea"
+            placeholder="请输入"
+            resize="none"
+          />
+        </el-form-item>
+        <el-form-item label="检修方案">
+          <el-input
+            v-model="selectItem.processMethod"
+            style="width: 200px"
+            autosize
+            type="textarea"
+            placeholder="请输入"
+            resize="none"
+          />
+        </el-form-item>
+        <el-form-item label="所需工具">
+          <el-input
+            v-model="selectItem.tools"
+            style="width: 200px"
+            autosize
+            type="textarea"
+            placeholder="请输入"
+            resize="none"
+          />
+        </el-form-item>
+        <el-form-item label="备品备件">
+          <el-input
+            v-model="selectItem.spareParts"
+            style="width: 200px"
+            autosize
+            type="textarea"
+            placeholder="请输入"
+            resize="none"
+          />
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <span class="footerButton">
+          <el-button
+            size="mini"
+            class="buttons"
+            round
+            @click="editVisible = false"
+            >取 消</el-button
+          >
+          <el-button size="mini" class="buttons" round @click="save"
+            >确 定</el-button
+          >
+        </span>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  getAlarmMap,
+  getAlarmTypeList,
+  addAlarmItem,
+  deleteAlarmItem,
+  getAlarmExcelTemplate,
+} from "@/api/zhbj/index.js";
+import { ElMessageBox } from "element-plus";
+export default {
+  data() {
+    return {
+      types: "",
+      typeList: [],
+      name: "",
+      partRowSpans: {
+        传送链: { start: 0, count: 1 },
+        机舱: { start: 1, count: 1 },
+      },
+      tableData: [
+        {
+          id: "0002",
+          types: "传送链",
+          troubleMethod: [
+            "检查主轴是否有断裂或磨损。 ",
+            "检查联轴器是否有断裂或磨损。 ",
+            "观察传动系统是否有异常声音或卡滞现象。",
+          ],
+          processMethod: ["更换断裂的主轴或联轴器。 ", "维修磨损的部件。"],
+          tools: ["望远镜 ", "扳手 ", "螺丝刀"],
+          spareParts: ["主轴 ", "联轴器"],
+          name: "断轴或联轴打滑",
+          part: "传送链",
+          rowIndex: 0,
+        },
+        {
+          id: "0001",
+          types: "机舱",
+          troubleMethod: [
+            "检查偏航电机运行是否正常,是否有异响或卡滞。 ",
+            "检查偏航齿轮箱油位是否正常,是否有泄漏。 ",
+            "检查偏航液压系统油位是否正常,是否有泄漏。 ",
+            "检查偏航传感器是否正常工作,是否有故障。 ",
+            "观察偏航过程中是否有异常声音或卡滞现象。",
+          ],
+          processMethod: [
+            "更换故障的偏航电机。 ",
+            "更换损坏的偏航齿轮箱。 ",
+            "维修或更换泄漏的偏航液压系统。 ",
+            "更换故障的偏航传感器。",
+          ],
+          tools: ["兆欧表 ", "温度计 ", "油位尺 ", "扳手 ", "螺丝刀"],
+          spareParts: ["偏航电机 ", "偏航齿轮箱 ", "偏航液压泵 ", "偏航传感器"],
+          name: "风机偏航过程震动",
+          part: "机舱",
+          rowIndex: 1,
+        },
+      ],
+      query: {
+        page: 1,
+        limit: 21,
+        pageTotal: null,
+      },
+      selectItem: {
+        id: "",
+        types: "",
+        name: "",
+        troubleMethod: "",
+        processMethod: "",
+        tools: "",
+        spareParts: "",
+      },
+      deleteSelectItem: [],
+      rules: {
+        types: [
+          {
+            required: true,
+            message: "类型不可为空",
+            trigger: "blur",
+          },
+        ],
+        name: [
+          {
+            required: true,
+            message: "名称不可为空",
+            trigger: "blur",
+          },
+        ],
+      },
+      dialogVisible: false,
+      dialogFormData: {
+        metriccode: "",
+      },
+    };
+  },
+
+  created() {
+    this.init();
+  },
+
+  methods: {
+    init() {
+      this.getTableData();
+      getAlarmTypeList().then((res) => {
+        this.typeList = res.data;
+      });
+    },
+
+    getTableData() {
+      let url = "";
+      let data = {};
+      let requestType = 0;
+      // if (!this.types && !this.name) {
+      //   requestType = 1;
+      //   url = `/alarmplan/queryAlarmPlanMap`;
+      // } else {
+      //   requestType = 2;
+      //   url = `/alarmplan/page`;
+      //   data = {
+      //     pageNum: 1,
+      //     pageSize: 200,
+      //     types: this.types || null,
+      //     name: this.name,
+      //   };
+      // }
+      url = `/alarmplan/page`;
+      data = {
+        pageNum: 1,
+        pageSize: 200,
+        types: this.types || null,
+        name: this.name,
+      };
+      getAlarmMap(url, data).then((res) => {
+        let partRowSpans = {};
+        let tableData = [];
+        let rowIndex = 0;
+        let tableSourceData = requestType === 1 ? res.data : res.data.records;
+        if (requestType === 2) {
+          let tempObject = {};
+          tableSourceData.forEach((ele) => {
+            if (Array.isArray(tempObject?.[ele.types])) {
+              tempObject[ele.types].push(ele);
+            } else {
+              tempObject[ele.types] = [ele];
+            }
+          });
+          tableSourceData = tempObject;
+        }
+        Object.keys(tableSourceData).forEach((part) => {
+          const partData = tableSourceData[part];
+          partRowSpans[part] = {
+            start: rowIndex,
+            count: partData.length,
+          };
+          partData.forEach((item) => {
+            item.processMethod = this.splitStr(item.processMethod);
+            item.spareParts = this.splitStr(item.spareParts);
+            item.tools = this.splitStr(item.tools);
+            item.troubleMethod = this.splitStr(item.troubleMethod);
+            tableData.push({
+              ...item,
+              part,
+              rowIndex,
+            });
+            rowIndex++;
+          });
+        });
+        this.partRowSpans = partRowSpans;
+        this.tableData = tableData;
+      });
+    },
+
+    splitStr(str) {
+      if (/(\d+\.\s+)/.test(str)) {
+        return str
+          .split(/(\d+\.\s+)/)
+          .filter(Boolean)
+          .filter((_, index) => index % 2 !== 0);
+      }
+      return str;
+    },
+
+    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
+      if (columnIndex === 0) {
+        // 合并第一列(部件)
+        const part = row.part;
+        const { start, count } = this.partRowSpans[part];
+        if (rowIndex === start) {
+          return {
+            rowspan: count,
+            colspan: 1,
+          };
+        } else {
+          return {
+            rowspan: 0,
+            colspan: 0,
+          };
+        }
+      }
+    },
+
+    addEarly() {
+      this.dialogVisible = true;
+    },
+
+    editItem(selectItem) {
+      this.selectItem = Object.assign({}, selectItem);
+      this.dialogVisible = true;
+    },
+
+    handleSelectionChange(deleteSelectItem) {
+      this.deleteSelectItem = deleteSelectItem;
+    },
+
+    deleteItem() {
+      ElMessageBox.confirm("确定要删除吗?", "提示", {
+        type: "warning",
+      })
+        .then(() => {
+          let ids = [];
+          this.deleteSelectItem.forEach((ele) => {
+            ids.push(ele.id);
+          });
+          deleteAlarmItem({ id: ids.toString() }).then((res) => {
+            if (res.code === 200 && res.data) {
+              this.BASE.showMsg({
+                type: "success",
+                msg: "删除成功",
+              });
+              this.getTableData();
+            } else {
+              this.BASE.showMsg({
+                type: "error",
+                msg: "删除失败",
+              });
+            }
+          });
+        })
+        .catch(() => {});
+    },
+
+    async save() {
+      if (!this.$refs.ruleFormRef) return;
+      await this.$refs.ruleFormRef.validate((valid, fields) => {
+        if (valid) {
+          addAlarmItem(this.selectItem).then((res) => {
+            if (res.code === 200) {
+              this.BASE.showMsg({
+                type: "success",
+                msg: "提交成功",
+              });
+              this.dialogVisible = false;
+              this.getTableData();
+            }
+          });
+        }
+      });
+    },
+
+    resetForm(clearSelectItem = true) {
+      this.$refs.ruleFormRef.resetFields();
+      if (clearSelectItem) {
+        this.selectItem = {
+          id: "",
+          types: "",
+          name: "",
+          troubleMethod: "",
+          processMethod: "",
+          tools: "",
+          spareParts: "",
+        };
+      }
+    },
+
+    getExcelTemplate() {
+      getAlarmExcelTemplate().then((res) => {
+        // 创建一个临时的URL来引用Blob对象
+        const url = window.URL.createObjectURL(
+          new Blob([res], {
+            type: "application/vnd.ms-excel",
+          })
+        );
+
+        // 创建一个隐藏的<a>元素
+        const a = document.createElement("a");
+        a.style.display = "none";
+        a.href = url;
+
+        // 设置文件名
+        const contentDisposition = res?.headers?.["content-disposition"];
+        let filename = "预警排查方案模板.xls"; // 默认文件名
+
+        a.download = filename; // 根据实际情况调整文件名
+
+        // 添加到DOM中
+        document.body.appendChild(a);
+
+        // 模拟点击
+        a.click();
+
+        // 清理
+        window.URL.revokeObjectURL(url);
+        document.body.removeChild(a);
+      });
+    },
+
+    handleSuccess(res) {
+      if (res.code === 200) {
+        this.BASE.showMsg({
+          type: "success",
+          msg: "导入成功",
+        });
+        this.getTableData();
+      }
+    },
+
+    handleError() {
+      this.BASE.showMsg({
+        type: "error",
+        msg: "导入失败",
+      });
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.history-warning {
+  height: calc(100% - 40px);
+  padding: 0 20px;
+  padding-bottom: 10px;
+  .form-wrapper ::v-deep {
+    display: flex;
+    flex-direction: column;
+    padding-top: 10px;
+    position: relative;
+    .search-wrapper {
+      display: flex;
+      align-items: center;
+      font-size: 14px;
+      font-family: Microsoft YaHei;
+      font-weight: 400;
+      color: #b3b3b3;
+      margin-bottom: 10px;
+      .search-item {
+        display: flex;
+        margin-right: 10px;
+        max-width: 450px;
+        align-items: center;
+        .label {
+          margin-right: 10px;
+          text-align: right;
+          white-space: nowrap;
+          // width: 60px;
+        }
+        .search-content {
+          flex: 1;
+        }
+      }
+    }
+
+    .btns {
+      display: flex;
+      justify-content: flex-end;
+      margin-right: 10px;
+      position: absolute;
+      right: 0;
+      // top: 53px;
+      top: 10px;
+    }
+
+    .buttons {
+      background-color: rgba(5, 187, 76, 0.2);
+      border: 1px solid #3b6c53;
+      color: #b3b3b3;
+      font-size: 14px;
+
+      &:hover {
+        background-color: rgba(5, 187, 76, 0.5);
+        color: #ffffff;
+      }
+    }
+  }
+  .table-wrapper {
+    height: calc(100% - 60px);
+    width: calc(100% - 20px);
+    .leftContent[data-type~="greenSty"] {
+      background: url("~@/assets/imgs/title_left_bg1.png") no-repeat;
+    }
+    .leftContent[data-type~="blueSty"] {
+      background: url("~@/assets/imgs/title_left_bg.png") no-repeat;
+    }
+    .leftContent {
+      width: 242px;
+      height: 41px;
+      display: flex;
+      align-items: center;
+
+      span {
+        font-size: 16px;
+        font-family: Microsoft YaHei;
+        font-weight: 400;
+        color: #05bb4c;
+        margin-left: 25px;
+      }
+    }
+    .pagination-wrapper :deep {
+      text-align: right;
+      margin-top: 10px;
+    }
+  }
+}
+</style>

+ 75 - 75
src/views/IntegratedAlarm/reliability/customAnalyse/index.vue

@@ -150,7 +150,7 @@
       <!--     @cell-click="handle" -->
       <el-table
         :data="state.tableData"
-        style="height:calc(100% - 60px)"
+        style="height: calc(100% - 60px)"
         stripe
         @sort-change="handleSort"
       >
@@ -271,7 +271,9 @@ onMounted(() => {
   getWpArray();
   getequipmentmodel_list();
   getfetchRelatePart();
-  //   getTableList();
+  state.tHeard = dataJson.data.data.title;
+  state.tableData = dataJson.data.data.data;
+  // getTableList();
 });
 const pageTitle = "预警分析";
 const store = useStore();
@@ -330,7 +332,7 @@ const getWpArray = async () => {
   changZhanArray.value = data;
 
   state.changZhan =
-    state.typeVal == "windturbine" ? "SXJ_KGDL_DJY_FDC_STA" : data[0]?.id;
+    state.typeVal == "windturbine" ? "GJNY_SXGS_FSG_FDC_STA" : data[0]?.id;
 };
 // 机型
 const getequipmentmodel_list = async () => {
@@ -578,83 +580,81 @@ function changeChangzhan(val) {
   getAlarmId();
 }
 function getAlarmId() {
-  //   GetAlarmIdCustom({
-  //     components: state.components,
-  //     modelId: state.modelId,
-  //     wpId: state.changZhan,
-  //   }).then(({ data }) => {
-  //     state.alarmIdList = data;
-  //     // state.alarmIds = [];
-  //     state.alarmIds =
-  //       data.length <= 5
-  //         ? data.map((item) => item.alarmId)
-  //         : data.slice(0, 5).map((item) => item.alarmId);
+  GetAlarmIdCustom({
+    components: state.components,
+    modelId: state.modelId,
+    wpId: state.changZhan,
+  }).then(({ data }) => {
+    state.alarmIdList = data;
+    // state.alarmIds = [];
+    state.alarmIds =
+      data.length <= 5
+        ? data.map((item) => item.alarmId)
+        : data.slice(0, 5).map((item) => item.alarmId);
 
-  //     getTableList();
-  //   });
-  state.alarmIdList = [
-    {
-      alarmId: "10",
-      description: "发电机转速大于900,并且 任意齿轮箱轴温度每分钟上升超过1.5",
-    },
-  ];
-  getTableList();
+    getTableList();
+  });
+  // state.alarmIdList = [
+  //   {
+  //     alarmId: "10",
+  //     description: "发电机转速大于900,并且 任意齿轮箱轴温度每分钟上升超过1.5",
+  //   },
+  // ];
+  // getTableList();
 }
 // 获取列表数据 调用接口
 function getTableList() {
-  //   if (state.components?.length || state.typeVal === "booststation") {
-  //     getWarningCountList({
-  //       stationid: state.changZhan || "",
-  //       begin: state.starttime,
-  //       end: state.endtime,
-  //       timeType: "m",
-  //       components: state.typeVal === "booststation" ? [] : state.components,
-  //       modelId: state.modelId,
-  //       alarmIds: state.alarmIds,
-  //       deviceType: state.typeVal,
-  //     }).then((res) => {
-  //       if (res.length) {
-  //         let tableData = [];
-  //         let tHeard = [];
-  //         let data = res;
-  //         data.forEach((pEle) => {
-  //           for (let wtId in pEle) {
-  //             let wtItem = data.find((tableItem) => {
-  //               return wtId === tableItem.windturbineId;
-  //             });
-  //             !wtItem && (wtItem = { wtId });
-  //             pEle[wtId].forEach((cEle) => {
-  //               let someRes = tHeard.some((findEle) => {
-  //                 return findEle.label == cEle.alertText;
-  //               });
+  if (state.components?.length || state.typeVal === "booststation") {
+    getWarningCountList({
+      stationid: state.changZhan || "",
+      begin: state.starttime,
+      end: state.endtime,
+      timeType: "m",
+      components: state.typeVal === "booststation" ? [] : state.components,
+      modelId: state.modelId,
+      alarmIds: state.alarmIds,
+      deviceType: state.typeVal,
+    }).then((res) => {
+      if (res.length) {
+        let tableData = [];
+        let tHeard = [];
+        let data = res;
+        data.forEach((pEle) => {
+          for (let wtId in pEle) {
+            let wtItem = data.find((tableItem) => {
+              return wtId === tableItem.windturbineId;
+            });
+            !wtItem && (wtItem = { wtId });
+            pEle[wtId].forEach((cEle) => {
+              let someRes = tHeard.some((findEle) => {
+                return findEle.label == cEle.alertText;
+              });
 
-  //               if (!someRes) {
-  //                 tHeard.push({
-  //                   label: cEle.alertText,
-  //                   code: cEle.alarmid,
-  //                 });
-  //               }
-  //               wtItem[`${cEle.alarmid}_count`] = cEle.count;
-  //               wtItem[`${cEle.alarmid}_time`] = cEle.time;
-  //               wtItem["wtname"] = cEle.windturbineCode;
-  //             });
-  //             tableData.push(wtItem);
-  //           }
-  //         });
-  //         state.tHeard = tHeard;
-  //         state.tableData = tableData;
-  //       } else {
-  //         state.tHeard = [];
-  //         state.tableData = [];
-  //       }
-  //     });
-  //   } else {
-  //     BASE.showMsg({
-  //       msg: "部件至少选择一项才可查询",
-  //     });
-  //   }
-  state.tHeard = dataJson.data.data.title;
-  state.tableData = dataJson.data.data.data;
+              if (!someRes) {
+                tHeard.push({
+                  label: cEle.alertText,
+                  code: cEle.alarmid,
+                });
+              }
+              wtItem[`${cEle.alarmid}_count`] = cEle.count;
+              wtItem[`${cEle.alarmid}_time`] = cEle.time;
+              wtItem["wtname"] = cEle.windturbineCode;
+            });
+            tableData.push(wtItem);
+          }
+        });
+        state.tHeard = tHeard;
+        state.tableData = tableData;
+      } else {
+        state.tHeard = [];
+        state.tableData = [];
+      }
+    });
+  } else {
+    BASE.showMsg({
+      msg: "部件至少选择一项才可查询",
+    });
+  }
 }
 
 const handleSort = function (val) {

+ 55 - 55
src/views/IntegratedAlarm/reliability/historyAnalyse/index.vue

@@ -154,7 +154,7 @@
       <el-table
         :data="state.tableData"
         stripe
-        style="height:calc(100% - 60px)"
+        style="height: calc(100% - 60px)"
         @sort-change="handleSort"
       >
         <el-table-column
@@ -274,7 +274,9 @@ onMounted(() => {
   getWpArray();
   getequipmentmodel_list();
   getfetchRelatePart();
-  //   getTableList();
+  state.tHeard = dataJson.data.data.title;
+  state.tableData = dataJson.data.data.data;
+  // getTableList();
 });
 const pageTitle = "报警分析";
 const store = useStore();
@@ -323,7 +325,7 @@ const getWpArray = async () => {
   changZhanArray.value = data;
   if (state.typeVal != "booststation") {
     state.changZhan =
-      state.typeVal == "windturbine" ? "SXJ_KGDL_DJY_FDC_STA" : "";
+      state.typeVal == "windturbine" ? "GJNY_SXGS_FSG_FDC_STA" : "";
   } else {
     state.changZhan = "";
     state.modelId = "";
@@ -603,59 +605,57 @@ function getAlarmId() {
 }
 // 获取列表数据 调用接口
 function getTableList() {
-  //   if (state.components?.length) {
-  //     getAlarmCountList({
-  //       stationid: state.changZhan || "",
-  //       begin: state.starttime,
-  //       end: state.endtime,
-  //       timeType: "m",
-  //       components: state.typeVal === "booststation" ? "" : state.components,
-  //       modelId: state.modelId,
-  //       alarmIds: state.alarmIds,
-  //       alarmType: state.typeVal,
-  //     }).then((res) => {
-  //       if (res.length) {
-  //         let tableData = [];
-  //         let tHeard = [];
-  //         let data = res;
-  //         data.forEach((pEle) => {
-  //           for (let wtId in pEle) {
-  //             let wtItem = data.find((tableItem) => {
-  //               return wtId === tableItem.windturbineId;
-  //             });
-  //             !wtItem && (wtItem = { wtId });
-  //             pEle[wtId].forEach((cEle) => {
-  //               let someRes = tHeard.some((findEle) => {
-  //                 return findEle.label == cEle.alertText;
-  //               });
+  if (state.components?.length) {
+    getAlarmCountList({
+      stationid: state.changZhan || "",
+      begin: state.starttime,
+      end: state.endtime,
+      timeType: "m",
+      components: state.typeVal === "booststation" ? "" : state.components,
+      modelId: state.modelId,
+      alarmIds: state.alarmIds,
+      alarmType: state.typeVal,
+    }).then((res) => {
+      if (res.length) {
+        let tableData = [];
+        let tHeard = [];
+        let data = res;
+        data.forEach((pEle) => {
+          for (let wtId in pEle) {
+            let wtItem = data.find((tableItem) => {
+              return wtId === tableItem.windturbineId;
+            });
+            !wtItem && (wtItem = { wtId });
+            pEle[wtId].forEach((cEle) => {
+              let someRes = tHeard.some((findEle) => {
+                return findEle.label == cEle.alertText;
+              });
 
-  //               if (!someRes) {
-  //                 tHeard.push({
-  //                   label: cEle.alertText,
-  //                   code: cEle.alarmid,
-  //                 });
-  //               }
-  //               wtItem[`${cEle.alarmid}_count`] = cEle.count;
-  //               wtItem[`${cEle.alarmid}_time`] = cEle.time;
-  //               wtItem["wtname"] = cEle.windturbineCode;
-  //             });
-  //             tableData.push(wtItem);
-  //           }
-  //         });
-  //         state.tHeard = tHeard;
-  //         state.tableData = tableData;
-  //       } else {
-  //         state.tHeard = [];
-  //         state.tableData = [];
-  //       }
-  //     });
-  //   } else {
-  //     BASE.showMsg({
-  //       msg: "部件至少选择一项才可查询",
-  //     });
-  //   }
-  state.tHeard = dataJson.data.data.title;
-  state.tableData = dataJson.data.data.data;
+              if (!someRes) {
+                tHeard.push({
+                  label: cEle.alertText,
+                  code: cEle.alarmid,
+                });
+              }
+              wtItem[`${cEle.alarmid}_count`] = cEle.count;
+              wtItem[`${cEle.alarmid}_time`] = cEle.time;
+              wtItem["wtname"] = cEle.windturbineCode;
+            });
+            tableData.push(wtItem);
+          }
+        });
+        state.tHeard = tHeard;
+        state.tableData = tableData;
+      } else {
+        state.tHeard = [];
+        state.tableData = [];
+      }
+    });
+  } else {
+    BASE.showMsg({
+      msg: "部件至少选择一项才可查询",
+    });
+  }
 }
 
 const handleSort = function (val) {

+ 1 - 1
src/views/IntegratedAlarm/safe/components/safecomponent.vue

@@ -280,7 +280,7 @@ export default {
   },
 
   created() {
-    // this.initWarningList();
+    this.initWarningList();
   },
 
   methods: {

+ 79 - 79
src/views/IntegratedAlarm/safe/customWarning/index.vue

@@ -179,8 +179,7 @@
       <el-table
         size="mini"
         :data="state.tableData"
-        height="calc(100% - 35px - 55px)"
-        style="width: 100%"
+        style="width: 100%; height: calc(100% - 35px - 55px)"
         stripe
       >
         <template v-if="state.isshowwindturbineName">
@@ -349,6 +348,50 @@ onMounted(() => {
   state.deviceId = route.query.deviceId || "";
   state.alarmId = route.query.alarmId || "";
   state.modelId = route.query.modelId || "";
+
+  state.tableData = new Array(5).fill({
+    tbName: null,
+    alarmId: "SQ_0125",
+    alarmType: "windturbine",
+    characteristic: "预警",
+    components: "BPQ",
+    confirmed: false,
+    description: "变频器故障27",
+    deviceId: "SXJ_KGDL_XWT_F_WT_0014_EQ",
+    devicename: "14号风机",
+    deviceType: "windturbine",
+    enabled: true,
+    lineid: "SXJ_KGDL_XWTF01_LN",
+    linename: "一号风机线",
+    modelId: "SEC-W02B-1250kW",
+    projectid: "SXJ_KGDL_XWTF01_EG",
+    projectname: "一期项目",
+    rank: 3,
+    resettable: false,
+    stationid: "SXJ_KGDL_XWT_FDC_STA",
+    stationname: "13风电场",
+    subcomponents: "NULL",
+    suffix: null,
+    tagid: "FD-YYXWT-ShangQi.140623F1412MDL01BF399DB0122SP01RAW00",
+    triggertype: 1463,
+    uniformcode: "BJ0001",
+    superTableName: null,
+    ts: 1718160795000,
+    val: 1,
+    oval: null,
+    endts: 0,
+    timelong: 0,
+    name: null,
+    nemCode: "状态码1463",
+    faultCause: "13.7s>信号<=14.2s",
+    resolvent: "输入端142功率上升延迟300s",
+    wpName: "13风电场",
+    code: "#14",
+    wpId: null,
+    faultType: null,
+    id: "sxj_kgdl_xwt_f_wt_0014_eq_sq_0125",
+  });
+
   getStationList();
   getequipmentmodel_list();
   getfetchRelatePart();
@@ -368,7 +411,7 @@ const getfetchRelatePart = async () => {
 };
 
 const confirmItem = (alarmItem) => {
-  ElMessageBox("您确定要执行此操作吗?", "提示", {
+  ElMessageBox.confirm("您确定要执行此操作吗?", "提示", {
     confirmButtonText: "确定",
     cancelButtonText: "取消",
     type: "warning",
@@ -413,10 +456,10 @@ const state = reactive({
       label: "风机",
       value: "windturbine",
     },
-    {
-      label: "光伏",
-      value: "inverter",
-    },
+    // {
+    //   label: "光伏",
+    //   value: "inverter",
+    // },
   ],
   c: "windturbine",
   stationId: "",
@@ -488,7 +531,7 @@ const getStationList = async () => {
     state.stationId = station?.id;
   } else {
     state.stationId =
-      state.typeVal == "windturbine" ? "SXJ_KGDL_DJY_FDC_STA" : data[0]?.id;
+      state.typeVal == "windturbine" ? "GJNY_SXGS_FSG_FDC_STA" : data[0]?.id;
   }
   if (stationList.value.length) {
     await getWindturbineList();
@@ -562,73 +605,31 @@ const query = reactive({
 const tableLoading = ref(false);
 // 获取历史记录表
 const getAlarmHistoryt = async () => {
-  //   tableLoading.value = true;
-  //   let params = {
-  //     pageNum: query.page,
-  //     pageSize: query.limit,
-  //     alarmId: state.alarmId,
-  //     alarmType: "custom",
-  //     deviceType: state.typeVal,
-  //     stationid: state.stationId,
-  //     deviceid:
-  //       state.deviceId || (state.typeVal == "booststation" ? "" : state.deviceId),
-  //     modelId: state.typeVal == "booststation" ? "" : state.modelId,
-  //     components: state.components,
-  //     description: state.description,
-  //     begin: state.dateTime[0],
-  //     end: state.dateTime[1],
-  //   };
-  //   const { data } = await alarm_history(params);
-  //   tableLoading.value = false;
-  //   query.pageTotal = data?.total;
-  //   data?.ls?.forEach((ele) => {
-  //     ele.isCloseName = ele.endts ? "已解除" : "未解除";
-  //     ele.deviceTypeName = tableFilter(ele.deviceType);
-  //     ele.endtsName = ele.endts > 0 ? formatTime(ele.endts) : "--";
-  //   });
-  //   state.tableData = data?.ls;
-  state.tableData = new Array(5).fill({
-    tbName: null,
-    alarmId: "SQ_0125",
-    alarmType: "windturbine",
-    characteristic: "预警",
-    components: "BPQ",
-    confirmed: false,
-    description: "变频器故障27",
-    deviceId: "SXJ_KGDL_XWT_F_WT_0014_EQ",
-    devicename: "14号风机",
-    deviceType: "windturbine",
-    enabled: true,
-    lineid: "SXJ_KGDL_XWTF01_LN",
-    linename: "一号风机线",
-    modelId: "SEC-W02B-1250kW",
-    projectid: "SXJ_KGDL_XWTF01_EG",
-    projectname: "一期项目",
-    rank: 3,
-    resettable: false,
-    stationid: "SXJ_KGDL_XWT_FDC_STA",
-    stationname: "13风电场",
-    subcomponents: "NULL",
-    suffix: null,
-    tagid: "FD-YYXWT-ShangQi.140623F1412MDL01BF399DB0122SP01RAW00",
-    triggertype: 1463,
-    uniformcode: "BJ0001",
-    superTableName: null,
-    ts: 1718160795000,
-    val: 1,
-    oval: null,
-    endts: 0,
-    timelong: 0,
-    name: null,
-    nemCode: "状态码1463",
-    faultCause: "13.7s>信号<=14.2s",
-    resolvent: "输入端142功率上升延迟300s",
-    wpName: "13风电场",
-    code: "#14",
-    wpId: null,
-    faultType: null,
-    id: "sxj_kgdl_xwt_f_wt_0014_eq_sq_0125",
+  tableLoading.value = true;
+  let params = {
+    pageNum: query.page,
+    pageSize: query.limit,
+    alarmId: state.alarmId,
+    alarmType: "custom",
+    deviceType: state.typeVal,
+    stationid: state.stationId,
+    deviceid:
+      state.deviceId || (state.typeVal == "booststation" ? "" : state.deviceId),
+    modelId: state.typeVal == "booststation" ? "" : state.modelId,
+    components: state.components,
+    description: state.description,
+    begin: state.dateTime[0],
+    end: state.dateTime[1],
+  };
+  const { data } = await alarm_history(params);
+  tableLoading.value = false;
+  query.pageTotal = data?.total;
+  data?.ls?.forEach((ele) => {
+    ele.isCloseName = ele.endts ? "已解除" : "未解除";
+    ele.deviceTypeName = tableFilter(ele.deviceType);
+    ele.endtsName = ele.endts > 0 ? formatTime(ele.endts) : "--";
   });
+  state.tableData = data?.ls;
 };
 //报警类型变化
 const typechange = () => {
@@ -645,8 +646,8 @@ const export2Excel = async () => {
     alarmId: state.alarmId,
     alarmType: "custom",
     deviceType: state.typeVal,
-    stationid: state.stationId,
-    deviceid:
+    stationId: state.stationId,
+    deviceId:
       state.deviceId || (state.typeVal == "booststation" ? "" : state.deviceId),
     modelId: state.typeVal == "booststation" ? "" : state.modelId,
     components: state.components,
@@ -675,7 +676,6 @@ const export2Excel = async () => {
       return ele.id === state.stationId;
     }).name;
     const fileName = `${stationName} ${state.dateTime[0]} ~ ${state.dateTime[1]} 数据表`;
-    console.log(data.ls);
     outExportExcel(
       tableHeader,
       tableKey,
@@ -790,8 +790,8 @@ p {
     }
   }
   .table-wrapper {
-    height: calc(100% - 43px);
-    width: 100%;
+    height: calc(100% - 60px);
+    width: calc(100% - 20px);
     .leftContent[data-type~="greenSty"] {
       background: url("~@/assets/imgs/title_left_bg1.png") no-repeat;
     }

+ 42 - 35
src/views/IntegratedAlarm/safe/dataSearch/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="data-search">
-    <div class="leftContent" :data-type="$store.state.moreSty">
+    <div class="leftContent" :data-type="store.state.moreSty">
       <span>{{ pageTitle }}</span>
     </div>
     <div class="data-content">
@@ -96,9 +96,9 @@
             <template #default="scope">
               <el-tag
                 size="small"
-                color="#133122"
-                style="border-color: #67c23a"
-                type="success"
+                color="rgb(235.9, 245.3, 255)"
+                style="border-color: #1890ff"
+                type="primary"
               >
                 {{ scope.row.value }}
               </el-tag>
@@ -121,7 +121,7 @@
               <el-button
                 type="text"
                 :style="`color: ${
-                  $store.state.theme ? '#1890ff' : '#47aee7'
+                  store.state.theme ? '#1890ff' : '#47aee7'
                 } !important`"
                 size="mini"
                 @click="handleSearch(scope.row)"
@@ -356,29 +356,37 @@ const filterWTList = computed(() =>
   )
 );
 //AI点检索
-const filterAIList = computed(() =>
-  //   state.AIList?.filter(
-  //     (data) => !state.inputAI || data.name.includes(state.inputAI)
-  //   )
-  new Array(15).fill({
-    unitNameCn: "",
-    englishName: null,
-    unitName: "",
-    modelId: "SEC-W02B-1250kW",
-    name: "01号风机风向",
-    valueUnit: null,
-    model: "SEC-W02B-1250kW",
-    typeId: "F",
-    id: "e222918e1e6a4feeba41007be3c85bf7",
-    uniformCode: "AI067",
-    value: "344.00",
-    time: 1718176440000,
-  })
-);
+const filterAIList = computed(() => {
+  if (state?.windturbineList?.length) {
+    return state.AIList?.filter(
+      (data) => !state.inputAI || data.name.includes(state.inputAI)
+    );
+  } else {
+    return new Array(15).fill({
+      unitNameCn: "",
+      englishName: null,
+      unitName: "",
+      modelId: "SEC-W02B-1250kW",
+      name: "01号风机风向",
+      valueUnit: null,
+      model: "SEC-W02B-1250kW",
+      typeId: "F",
+      id: "e222918e1e6a4feeba41007be3c85bf7",
+      uniformCode: "AI067",
+      value: "344.00",
+      time: 1718176440000,
+    });
+  }
+});
 
 // get 实时data
 const getLatest = async (stationId, AIlist) => {
-  const data = await getAdapterLatest(stationId, AIlist, state.stationId);
+  const data = await getAdapterLatest(
+    stationId,
+    AIlist,
+    state.stationId,
+    store.state.baseURL1
+  );
   state.AIList?.forEach((e) => {
     if (e.uniformCode.indexOf("AI") !== -1) {
       e.value = Number(data[e.uniformCode]?.doubleValue).toFixed(2);
@@ -394,7 +402,7 @@ const getLatest = async (stationId, AIlist) => {
 const getHistory = async (stationId, AIpoint) => {
   let startTs = dayjs(state.pickerVal[0]).valueOf();
   let endTs = dayjs(state.pickerVal[1]).valueOf();
-  const baseUrl = `http://10.81.3.162:801${
+  const baseUrl = `${store.state.baseURL1}:801${
     /FDC/.test(state.stationId) ? "1" : "2"
   }/`;
   const data = await getAdapterHistory(
@@ -408,7 +416,7 @@ const getHistory = async (stationId, AIpoint) => {
   option.xAxis.data = [];
   option.series[0].data = [];
   let timeArr = [];
-  data.forEach((e) => {
+  data?.forEach((e) => {
     option.series[0].data.push(e.doubleValue.toFixed(2));
     option.xAxis.data.push(dayjs(e.ts).format("YYYY-MM-DD HH:mm:ss"));
   });
@@ -421,7 +429,7 @@ const getHistory = async (stationId, AIpoint) => {
 const getHistorysnap = async (stationId, AIpoint, interval) => {
   let startTs = dayjs(state.pickerVal[0]).valueOf();
   let endTs = dayjs(state.pickerVal[1]).valueOf();
-  const baseUrl = `http://10.81.3.162:801${
+  const baseUrl = `${store.state.baseURL1}:801${
     /FDC/.test(state.stationId) ? "1" : "2"
   }/`;
   const data = await getAdapterHistorysnap(
@@ -509,16 +517,15 @@ const handleNodeClick = (data) => {
 };
 // gettreeData
 const getTreeData = async () => {
-  // const res = await tree();
-  // let data = res.children[1].children;
-
   let data = [];
   data.unshift({ node: { code: "", name: "全部" } });
-  // data.unshift({ node: { code: "1010102", name: "全部" } });
+  data.unshift({ node: { code: "1010102", name: "全部" } });
+  data.forEach((e) => {
+    delete e.children;
+  });
 
-  // data.forEach((e) => {
-  //   delete e.children;
-  // });
+  const res = await tree();
+  data = res.children[1].children;
   state.treedata = data;
 };
 //

+ 84 - 83
src/views/IntegratedAlarm/safe/historyWarning/index.vue

@@ -173,8 +173,7 @@
       <el-table
         size="mini"
         :data="state.tableData"
-        height="calc(100% - 35px - 55px)"
-        style="width: 100%"
+        style="width: 100%; height: calc(100% - 35px - 55px)"
         stripe
       >
         <template v-if="state.isshowwindturbineName">
@@ -357,7 +356,51 @@ onMounted(() => {
   //       dayjs(Number(route.query.ts)).format("YYYY-MM-DD HH:mm:ss"),
   //     ];
   //   }
-  //   getStationList(); //场站
+
+  state.tableData = new Array(5).fill({
+    tbName: null,
+    alarmId: "SQ_0125",
+    alarmType: "windturbine",
+    characteristic: "报警",
+    components: "BPQ",
+    confirmed: false,
+    description: "变频器故障27",
+    deviceId: "SXJ_KGDL_XWT_F_WT_0014_EQ",
+    devicename: "14号风机",
+    deviceType: "windturbine",
+    enabled: true,
+    lineid: "SXJ_KGDL_XWTF01_LN",
+    linename: "一号风机线",
+    modelId: "SEC-W02B-1250kW",
+    projectid: "SXJ_KGDL_XWTF01_EG",
+    projectname: "一期项目",
+    rank: 3,
+    resettable: false,
+    stationid: "SXJ_KGDL_XWT_FDC_STA",
+    stationname: "13风电场",
+    subcomponents: "NULL",
+    suffix: null,
+    tagid: "FD-YYXWT-ShangQi.140623F1412MDL01BF399DB0122SP01RAW00",
+    triggertype: 1463,
+    uniformcode: "BJ0001",
+    superTableName: null,
+    ts: 1718160795000,
+    val: 1,
+    oval: null,
+    endts: 0,
+    timelong: 0,
+    name: null,
+    nemCode: "状态码1463",
+    faultCause: "13.7s>信号<=14.2s",
+    resolvent: "输入端142功率上升延迟300s",
+    wpName: "13风电场",
+    code: "#14",
+    wpId: null,
+    faultType: null,
+    id: "sxj_kgdl_xwt_f_wt_0014_eq_sq_0125",
+  });
+
+  getStationList(); //场站
   getAlarmHistoryt();
 
   getequipmentmodel_list(); //机型
@@ -375,7 +418,7 @@ const getfetchRelatePart = async () => {
 };
 
 const confirmItem = (alarmItem) => {
-  ElMessageBox("您确定要执行此操作吗?", "提示", {
+  ElMessageBox.confirm("您确定要执行此操作吗?", "提示", {
     confirmButtonText: "确定",
     cancelButtonText: "取消",
     type: "warning",
@@ -420,10 +463,10 @@ const state = reactive({
       label: "风机",
       value: "windturbine",
     },
-    {
-      label: "光伏",
-      value: "inverter",
-    },
+    // {
+    //   label: "光伏",
+    //   value: "inverter",
+    // },
   ],
   typeVal: "windturbine",
   stationId: "",
@@ -589,78 +632,36 @@ const query = reactive({
 
 // 获取历史记录表
 const getAlarmHistoryt = async () => {
-  //   BASE.showLoading();
-  //   let params = {
-  //     pageNum: query.page,
-  //     pageSize: query.limit,
-  //     alarmId: state.alarmId,
-  //     alarmType: state.typeVal,
-  //     stationid: state.stationId,
-  //     deviceid: state.typeVal == "booststation" ? "" : state.deviceId,
-  //     modelId: state.typeVal == "booststation" ? "" : state.modelId,
-  //     components: state.components,
-  //     description: state.description,
-  //     begin: state.dateTime[0],
-  //     end: state.dateTime[1],
-  //   };
-  //   const { data } = await alarm_history(params);
-  //   BASE.closeLoading();
-  //   query.pageTotal = data?.total;
-  //   data?.ls?.forEach((ele) => {
-  //     ele.isCloseName = ele.endts ? "已解除" : "未解除";
-  //     ele.alarmTypeName =
-  //       ele.alarmType === "booststation"
-  //         ? "升压站"
-  //         : ele.alarmType === "windturbine"
-  //         ? "风机"
-  //         : ele.alarmType === "inverter"
-  //         ? "光伏"
-  //         : "";
-  //     ele.endtsName = ele.endts > 0 ? formatTime(ele.endts) : "--";
-  //   });
-  //   state.tableData = data?.ls;
-  state.tableData = new Array(5).fill({
-    tbName: null,
-    alarmId: "SQ_0125",
-    alarmType: "windturbine",
-    characteristic: "报警",
-    components: "BPQ",
-    confirmed: false,
-    description: "变频器故障27",
-    deviceId: "SXJ_KGDL_XWT_F_WT_0014_EQ",
-    devicename: "14号风机",
-    deviceType: "windturbine",
-    enabled: true,
-    lineid: "SXJ_KGDL_XWTF01_LN",
-    linename: "一号风机线",
-    modelId: "SEC-W02B-1250kW",
-    projectid: "SXJ_KGDL_XWTF01_EG",
-    projectname: "一期项目",
-    rank: 3,
-    resettable: false,
-    stationid: "SXJ_KGDL_XWT_FDC_STA",
-    stationname: "13风电场",
-    subcomponents: "NULL",
-    suffix: null,
-    tagid: "FD-YYXWT-ShangQi.140623F1412MDL01BF399DB0122SP01RAW00",
-    triggertype: 1463,
-    uniformcode: "BJ0001",
-    superTableName: null,
-    ts: 1718160795000,
-    val: 1,
-    oval: null,
-    endts: 0,
-    timelong: 0,
-    name: null,
-    nemCode: "状态码1463",
-    faultCause: "13.7s>信号<=14.2s",
-    resolvent: "输入端142功率上升延迟300s",
-    wpName: "13风电场",
-    code: "#14",
-    wpId: null,
-    faultType: null,
-    id: "sxj_kgdl_xwt_f_wt_0014_eq_sq_0125",
+  BASE.showLoading();
+  let params = {
+    pageNum: query.page,
+    pageSize: query.limit,
+    alarmId: state.alarmId,
+    alarmType: state.typeVal,
+    stationid: state.stationId,
+    deviceid: state.typeVal == "booststation" ? "" : state.deviceId,
+    modelId: state.typeVal == "booststation" ? "" : state.modelId,
+    components: state.components,
+    description: state.description,
+    begin: state.dateTime[0],
+    end: state.dateTime[1],
+  };
+  const { data } = await alarm_history(params);
+  BASE.closeLoading();
+  query.pageTotal = data?.total;
+  data?.ls?.forEach((ele) => {
+    ele.isCloseName = ele.endts ? "已解除" : "未解除";
+    ele.alarmTypeName =
+      ele.alarmType === "booststation"
+        ? "升压站"
+        : ele.alarmType === "windturbine"
+        ? "风机"
+        : ele.alarmType === "inverter"
+        ? "光伏"
+        : "";
+    ele.endtsName = ele.endts > 0 ? formatTime(ele.endts) : "--";
   });
+  state.tableData = data?.ls;
 };
 //报警类型变化
 const typechange = () => {
@@ -675,8 +676,8 @@ const export2Excel = async () => {
     pageNum: query.page,
     pageSize: query.pageTotal,
     alarmType: state.typeVal,
-    stationid: state.stationId,
-    deviceid: state.typeVal == "booststation" ? "" : state.deviceId,
+    stationId: state.stationId,
+    deviceId: state.typeVal == "booststation" ? "" : state.deviceId,
     modelId: state.modelId,
     components: state.components,
     description: state.description,
@@ -824,8 +825,8 @@ p {
     }
   }
   .table-wrapper {
-    height: calc(100% - 43px);
-    width: 100%;
+    height: calc(100% - 60px);
+    width: calc(100% - 20px);
     .leftContent[data-type~="greenSty"] {
       background: url("~@/assets/imgs/title_left_bg1.png") no-repeat;
     }

+ 35 - 34
src/views/IntegratedAlarm/safe/stopQuery/index.vue

@@ -234,6 +234,18 @@ export default {
     ];
     this.getWpList();
 
+    this.tableData = new Array(15).fill({
+      code: "01",
+      stopTimeName: "2024-06-12 12:55:03",
+      startTimeName: "",
+      stopHours: 5,
+      lossPower: 24,
+      warningId: "002",
+      handleWay: "",
+      faultView: "",
+      typeName: "故障",
+    });
+
     this.getTableData();
   },
 
@@ -252,39 +264,28 @@ export default {
     },
 
     async getTableData() {
-      //   this.BASE.showLoading();
-      //   const { data } = await getStopQueryTableData({
-      //     wpId: this.wpId,
-      //     wtId: this.wtId,
-      //     type: this.type,
-      //     description: this.description,
-      //     begin: this.dateRange?.[0] || "",
-      //     end: this.dateRange?.[1] || "",
-      //     pageNum: this.pageNum,
-      //     pageSize: this.pageSize,
-      //   });
-      //   this.BASE.closeLoading();
-      //   data?.records?.forEach((ele) => {
-      //     ele.stopTimeName = dayjs(ele.stopTime).format("YYYY-MM-DD HH:mm:ss");
-      //     ele.startTimeName = ele.startTime
-      //       ? dayjs(ele.startTime).format("YYYY-MM-DD HH:mm:ss")
-      //       : "--";
-      //     ele.typeName = ele.stopTypeId === "gz" ? "故障" : "检修";
-      //   });
-
-      //   this.tableData = data?.records || [];
-      //   this.total = data.total || 0;
-      this.tableData = new Array(15).fill({
-        code: "01",
-        stopTimeName: "2024-06-12 12:55:03",
-        startTimeName: "",
-        stopHours: 5,
-        lossPower: 24,
-        warningId: "002",
-        handleWay: "",
-        faultView: "",
-        typeName: "故障",
+      this.BASE.showLoading();
+      const { data } = await getStopQueryTableData({
+        wpId: this.wpId,
+        wtId: this.wtId,
+        type: this.type,
+        description: this.description,
+        begin: this.dateRange?.[0] || "",
+        end: this.dateRange?.[1] || "",
+        pageNum: this.pageNum,
+        pageSize: this.pageSize,
       });
+      this.BASE.closeLoading();
+      data?.records?.forEach((ele) => {
+        ele.stopTimeName = dayjs(ele.stopTime).format("YYYY-MM-DD HH:mm:ss");
+        ele.startTimeName = ele.startTime
+          ? dayjs(ele.startTime).format("YYYY-MM-DD HH:mm:ss")
+          : "--";
+        ele.typeName = ele.stopTypeId === "gz" ? "故障" : "检修";
+      });
+
+      this.tableData = data?.records || [];
+      this.total = data.total || 0;
     },
 
     currentChange(pageNum) {
@@ -341,8 +342,8 @@ export default {
     }
   }
   .table-wrapper {
-    height: calc(100% - 62px);
-    width: 100%;
+    height: calc(100% - 60px);
+    width: calc(100% - 20px);
     .leftContent[data-type~="greenSty"] {
       background: url("~@/assets/imgs/title_left_bg1.png") no-repeat;
     }

+ 1 - 2
src/views/generatingCapacity/dataFilter/process/index.vue

@@ -285,7 +285,6 @@ const funExport = async () => {
 /**table 结束 */
 /**search 开始 */
 const funSubmit = async (query) => {
-  query.xd = query.xd ? 1 : 0;
   if (!excelCheckIds.value.length) {
     ElMessage.error("请勾选要预处理的项");
     return false;
@@ -296,7 +295,7 @@ const funSubmit = async (query) => {
   };
 
   const res = await httpRequest.get("/power/process/data", {
-    params: params,
+    params,
   });
   if (res.code === 200) {
     ElMessage.success(res.msg);

+ 3 - 1
src/views/generatingCapacity/dataFilter/process/search.vue

@@ -77,7 +77,9 @@ export default {
 
   methods: {
     funSubmit() {
-      this.$emit("submit", this.queryForm);
+      const query = Object.assign({}, this.queryForm);
+      query.xd = query.xd ? 1 : 0;
+      this.$emit("submit", query);
     },
   },