Parcourir la source

部分页面字段替换、布局结构修改、样式修改、报警气泡模块新增获取历史未处理报警并与最新推送报警合并功能。

Koishi il y a 1 an
Parent
commit
e1266527ed

+ 14 - 8
README.md

@@ -3,26 +3,32 @@
 晋能所用的报警管理后台管理系统,分支 yx 。
 
 ## 当前分支修改点 (以当前系统菜单为准) :
-- 安全运行
+- 综合报警
     - 实时报警
         - 重构页面由原来的三个报警区域改为六个报警区域,新增功能每个报警区域点击后显示弹出层以便更详尽显示报警列表信息。
     - 报警记录
         - 更换页面所用接口、调整表格所用字段。
+    - 停机查询
+        - 新增停机查询模块与接口联调。
     - 数据查询
-        - 无
-- 状态检修
+        - 新增页面中间部分筛选框。
+- 可靠性分析
     - 原始报警分析
         - 替换了部分字段、修改了部分BUG,表格新增列排序功能,点击对应的列将会以次数为基准进行升序或者降序排序。
-- 警配置
-    - 自定义预警
+- 警配置
+    - 预警配置
         - 无
-    - 风机报警
+    - 报警配置
         - 风机报警页面新增与修改报警弹窗模块重构
     - 规则修改日志
         - 无
-- 基础数据
+- 数据模型配置
+    - 设备模型
+        - 替换页面内部分接口。
     - 字典维护
-        - 页面重构、现五个级别可以分别设置自己独立的规则并保存了。
+        - 无
+- 系统管库
+    - 页面重构、现五个级别可以分别设置自己独立的规则并保存了,新增报警弹窗上限数量修改框,可根据自身需求动态修改弹窗弹出的上限值
 - 其他
     - 全局报警提醒
         - 新增全局窗口提醒功能,实时监听 WS 获取报警状态并于系统右下角排列展示,其中危险等级达到要求的部分报警会以播放声音的形式告知用户。

+ 63 - 8
src/components/alarmPopupa/index.vue

@@ -1,11 +1,11 @@
 <template>
   <div class="alarmBox" :class="alarmList?.length ? 'notEmpty' : ''">
     <div
-      :class="`${index < 6 ? item.class + ' alarmItem animate__animated' : ''}`"
+      :class="`${index < $store.state.alarmShowNumber ? item.class + ' alarmItem animate__animated' : ''}`"
       v-for="(item, index) in alarmList"
       :key="index"
     >
-      <template v-if="index < 6">
+      <template v-if="index < $store.state.alarmShowNumber">
         <div class="alarmTitle">{{ item.wpName }}&nbsp;{{ item.code }}</div>
         <div class="alarmContent">
           <div class="contentItem" @click="goToAlertDescPage(item)">
@@ -39,7 +39,8 @@
   </div>
 </template>
 <script>
-import { confirmAlart, getAlartConfig } from "@api/api.js";
+import { confirmAlart, getAlartConfig, alarm_history } from "@api/api.js";
+import dayJs from "dayjs";
 export default {
   data() {
     return {
@@ -50,6 +51,32 @@ export default {
       ws: null,
       timeConnect: 0,
       limitConnect: 5,
+      requestAlarmHistoryParams: [
+        {
+          alarmType: "booststation",
+          deviceType: "",
+        },
+        {
+          alarmType: "inverter",
+          deviceType: "",
+        },
+        {
+          alarmType: "windturbine",
+          deviceType: "",
+        },
+        {
+          alarmType: "custom",
+          deviceType: "booststation",
+        },
+        {
+          alarmType: "custom",
+          deviceType: "inverter",
+        },
+        {
+          alarmType: "custom",
+          deviceType: "windturbine",
+        },
+      ],
     };
   },
 
@@ -57,9 +84,21 @@ export default {
     getAlartConfig()
       .then((res) => {
         this.alarmConfigArray = res.data;
-        this.webSocketInit(
-          `ws://10.81.3.154:6014/websocket/${this.$store.state.user.userId}`
-        );
+        let requestResult = [];
+        this.requestAlarmHistoryParams.forEach(({ alarmType, deviceType }) => {
+          requestResult.push(this.getAlarmHistory(alarmType, deviceType));
+        });
+
+        Promise.all(requestResult).then((promiseResult) => {
+          promiseResult.forEach(({ data }) => {
+            data?.ls?.forEach((ele) => {
+              this.pushALarmItem(ele);
+            });
+          });
+          this.webSocketInit(
+            `ws://10.81.3.154:6014/websocket/${this.$store.state.user.userId}`
+          );
+        });
       })
       .catch(() => {
         this.BASE.showMsg({
@@ -241,6 +280,24 @@ export default {
       this.audioElement = null;
     },
 
+    getAlarmHistory(alarmType, deviceType) {
+      return alarm_history({
+        pageNum: 1,
+        pageSize: 10,
+        alarmId: "",
+        alarmType,
+        deviceType,
+        stationid: "",
+        deviceid: "",
+        modelId: "",
+        components: "",
+        description: "",
+        begin: `${dayJs().format("YYYY-MM-DD")} 00:00:00`,
+        end: dayJs().format("YYYY-MM-DD HH:mm:ss"),
+        isclose: false,
+      });
+    },
+
     webSocketInit(serveIP) {
       if ("WebSocket" in window) {
         this.ws = new WebSocket(serveIP);
@@ -291,7 +348,6 @@ export default {
         tsName: new Date(alarmItem.ts).formatDate("MM-dd hh:mm:ss"),
         fullTsName: new Date(alarmItem.ts).formatDate("yyyy-MM-dd hh:mm:ss"),
         deviceId: alarmItem.deviceId,
-        deviceType: alarmItem.deviceType,
         faultCause: alarmItem.faultCause,
         resolvent: alarmItem.resolvent,
         characteristic: alarmItem.characteristic,
@@ -347,7 +403,6 @@ export default {
     "$store.state.alarmResetFlg"() {
       getAlartConfig()
         .then((res) => {
-          console.log(2222, res.data);
           this.alarmConfigArray = res.data;
         })
         .catch(() => {

+ 2 - 2
src/pages/safe/historywaring.vue

@@ -311,7 +311,7 @@ const state = reactive({
     { title: "故障解决方法", code: "resolvent" },
     { title: "报警信息", code: "description", width: "180" },
     { title: "级别", code: "rank", width: "80" },
-    { title: "类型", code: "alarmtype", width: "80" },
+    { title: "类型", code: "alarmType", width: "80" },
     {
       title: "状态",
       code: "isCloseName",
@@ -325,7 +325,7 @@ const state = reactive({
     { title: "升压站", code: "stationname", width: "150" },
     { title: "报警信息", code: "description" },
     { title: "级别", code: "rank", width: "80" },
-    { title: "类型", code: "alarmtype", width: "80" },
+    { title: "类型", code: "alarmType", width: "80" },
     {
       title: "状态",
       code: "isCloseName",

+ 17 - 3
src/pages/safe/safecomponent.vue

@@ -22,7 +22,12 @@
         show-overflow-tooltip
       />
       <el-table-column prop="wpName" label="场站" show-overflow-tooltip />
-      <el-table-column prop="code" label="风机" width="50" show-overflow-tooltip />
+      <el-table-column
+        prop="code"
+        label="风机"
+        width="50"
+        show-overflow-tooltip
+      />
       <el-table-column
         prop="description"
         label="报警信息"
@@ -91,7 +96,12 @@
             show-overflow-tooltip
           />
 
-          <el-table-column prop="code" label="报警设备" width="100" show-overflow-tooltip />
+          <el-table-column
+            prop="code"
+            label="报警设备"
+            width="100"
+            show-overflow-tooltip
+          />
           <el-table-column
             prop="characteristic"
             label="报警特征"
@@ -133,7 +143,11 @@
               >
             </template>
           </el-table-column>
-          <el-table-column label="报警是否解除" width="100" show-overflow-tooltip>
+          <el-table-column
+            label="报警是否解除"
+            width="100"
+            show-overflow-tooltip
+          >
             <template #default="scope">
               <span
                 :style="`color:${

+ 23 - 2
src/pages/stopQuery/index.vue

@@ -47,6 +47,21 @@
           </el-select>
         </div>
         <div>
+          <span>停机类型:</span>
+          <el-select
+            v-model="type"
+            clearable
+            size="mini"
+            style="width: 150px"
+            placeholder="全部"
+            popper-class="select"
+            @change="() => {}"
+          >
+            <el-option value="gz" label="故障" />
+            <el-option value="wh" label="检修" />
+          </el-select>
+        </div>
+        <div>
           <span>故障描述:</span>
           <el-input
             v-model="description"
@@ -130,6 +145,7 @@ export default {
       wtId: "",
       wtArray: [],
       dateRange: [],
+      type: "",
       description: "",
       pageNum: 1,
       pageSize: 15,
@@ -168,6 +184,10 @@ export default {
           label: "故障现象",
           prop: " aultView",
         },
+        {
+          label: "故障类型",
+          prop: " typeName",
+        },
       ],
     };
   },
@@ -183,8 +203,7 @@ export default {
   methods: {
     async getWpList() {
       const { data } = await getWpList("windturbine");
-      //   this.wpId = data?.[0]?.id || "";
-      this.wpId = "SXJ_KGDL_GJY_FDC_STA";
+        this.wpId = data?.[0]?.id || "";
       this.wpArray = data || [];
       this.getWtList();
     },
@@ -199,6 +218,7 @@ export default {
       const { data } = await getStopQueryTableData({
         wpId: this.wpId,
         wtId: this.wtId,
+        type: this.type,
         description: this.description,
         begin: this.dateRange?.[0] || "",
         end: this.dateRange?.[1] || "",
@@ -209,6 +229,7 @@ export default {
       data?.records?.forEach((ele) => {
         ele.stopTimeName = dayJS(ele.stopTime).format("YYYY-MM-DD HH:mm:ss");
         ele.startTimeName = dayJS(ele.startTime).format("YYYY-MM-DD HH:mm:ss");
+        ele.typeName = ele.type === "gz" ? "故障" : "检修";
       });
 
       this.tableData = data?.records || [];

+ 36 - 4
src/pages/systemManage/systemManage.vue

@@ -42,6 +42,18 @@
         </el-form>
       </el-tab-pane>
     </el-tabs>
+    <div class="alarmNumBox">
+      <span>右下报警弹窗数量上限:</span>
+      <el-input-number
+        style="margin: 0 10px"
+        size="small"
+        v-model="alarmShowNumber"
+        :step="1"
+        :min="alarmMinNumber"
+        :max="alarmMaxNumber"
+      />
+      <span>个</span>
+    </div>
     <div class="btnBox">
       <el-button type="primary" @click="save">保存规则</el-button>
     </div>
@@ -54,12 +66,17 @@ export default {
     return {
       activeTab: "",
       alarmConfigArray: [],
+      alarmShowNumber: 0,
+      alarmMinNumber: 0,
+      alarmMaxNumber: 100,
     };
   },
 
   created() {
+    this.alarmShowNumber = this.$store.state.alarmShowNumber;
     this.getConfigArray();
   },
+
   methods: {
     getConfigArray() {
       this.alarmConfigArray = [];
@@ -110,10 +127,18 @@ export default {
           msg: "修改成功",
         });
         this.$store.commit("changeAlarmResetFlg");
+        this.$store.commit("changeAlarmShowNumber", this.alarmShowNumber);
+        localStorage.setItem("alarmShowNumber", this.alarmShowNumber);
         this.getConfigArray();
       });
     },
   },
+
+  watch: {
+    "$store.state.alarmShowNumber"(value) {
+      this.alarmShowNumber = value;
+    },
+  },
 };
 </script>
 <style lang="scss" scoped>
@@ -130,14 +155,21 @@ export default {
   }
 }
 
+.alarmNumBox {
+  width: calc(100% - 30px);
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  color: var(--el-text-color-regular);
+  font-size: var(--el-form-label-font-size);
+  margin: 12px 0;
+  padding: 0 15px;
+}
+
 .badgeWork {
   background: var(--el-color-success);
 }
 .badgeNotworK {
   background: var(--el-color-error);
 }
-
-.btnBox {
-  margin-top: 12px;
-}
 </style>

+ 5 - 5
src/router/index.js

@@ -45,7 +45,7 @@ const routes = [
         name: "safe",
         redirect: "/safe/realwaring",
         meta: {
-          title: "安全运行",
+          title: "综合报警",
         },
         component: () => import("../pages/routerView.vue"),
         children: [
@@ -112,7 +112,7 @@ const routes = [
         isshow: "super_admin,common",
         redirect: "/faultDiagnosis/warning",
         meta: {
-          title: "状态检修",
+          title: "可靠性分析",
           permission: true,
         },
         component: () =>
@@ -263,7 +263,7 @@ const routes = [
         isshow: "super_admin,common",
         redirect: "/alarmconfig/station",
         meta: {
-          title: "警配置",
+          title: "警配置",
         },
         component: () =>
           import(
@@ -277,7 +277,7 @@ const routes = [
             isshow: "super_admin,common",
             name: "alarmConfigcustom",
             meta: {
-              title: "自定义预警",
+              title: "预警配置",
             },
             component: () =>
               import(
@@ -324,7 +324,7 @@ const routes = [
         isshow: "super_admin",
         redirect: "/basedata/station",
         meta: {
-          title: "基础数据",
+          title: "数据模型配置",
         },
         component: () =>
           import(

+ 9 - 2
src/store/index.js

@@ -21,7 +21,8 @@ export default createStore({
         //报警弹窗持续时间
         warnTime: 5,
         alarmResetFlg: 1,
-        replaceRouteName: ["safehistorywaring"]
+        replaceRouteName: ["safehistorywaring"],
+        alarmShowNumber: (localStorage.getItem("alarmShowNumber") ? parseInt(localStorage.getItem("alarmShowNumber")) : 6),
     },
     mutations: {
         delTagsItem(state, data) {
@@ -132,7 +133,10 @@ export default createStore({
         },
         changeAlarmResetFlg(state, data) {
             state.alarmResetFlg += 1;
-        }
+        },
+        changeAlarmShowNumber(state, data) {
+            state.alarmShowNumber = data;
+        },
     },
     actions: {
         actionsWarning(context, newData) {
@@ -161,6 +165,9 @@ export default createStore({
         changeAlarmResetFlg(context) {
             context.commit("changeAlarmResetFlg");
         },
+        changeAlarmShowNumber(context, newData) {
+            context.commit("changeAlarmShowNumber", newData);
+        },
     },
     modules: { user, },
     getters: getter,