Browse Source

完成系统权限功能,新增报警弹窗

baiyanting 1 year ago
parent
commit
4d22c57788

+ 2 - 0
.env.development

@@ -21,5 +21,7 @@ VUE_APP_DIALOG_POINT = contextmenu
 
 # 智慧检修
 VUE_APP_NEW_WISDOM=http://10.81.3.155:8170
+# 综合报警
+VUE_APP_ALARM=http://10.81.3.154:6015
 # 登录
 VUE_APP_VUE_LOGIN_URL=http://10.81.3.153:8190

+ 2 - 0
.env.production

@@ -10,5 +10,7 @@ VUE_APP_DIALOG_NUM = 8
 VUE_APP_DIALOG_POINT = contextmenu
 # 智慧检修
 VUE_APP_NEW_WISDOM=http://10.81.3.155:8170
+# 综合报警
+VUE_APP_ALARM=http://10.81.3.154:6015
 # 登录
 VUE_APP_VUE_LOGIN_URL=http://10.81.3.153:8190

+ 3 - 3
src/App.vue

@@ -24,8 +24,8 @@
         :class="{ hover: isShowMenu }"
         @mouseenter="showMenu"
         @mouseleave="hideMenu"
-        v-show="$store.state.themeName === 'dark'&&$store.state.menuData.length"
-        v-if="hideMenus === '0'"
+        v-show="$store.state.themeName === 'dark'&& $store.state.menuData.length"
+        v-if="hideMenus === '0' "
       >
         <Menu :root="root" />
       </div>
@@ -38,7 +38,7 @@
           active-text-color="#6262a2"
           background-color="#36348e"
           @select="selectMenu"
-          v-if="hideMenus === '0'"
+          v-if="hideMenus === '0' && $store.state.menuData.length"
         >
           <el-sub-menu
             :index="index"

+ 10 - 0
src/api/zhbj/index.js

@@ -0,0 +1,10 @@
+import request from "@/tools/request";
+
+//获取报警列表数据
+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}&deviceid=${data.deviceid}&pageNum=${data.pageNum}&pageSize=${data.pageSize}`,
+    method: "get",
+  });
+}

File diff suppressed because it is too large
+ 1 - 0
src/assets/icon/svg/alarm-center.svg


+ 148 - 0
src/components/alarm/index.vue

@@ -0,0 +1,148 @@
+<template>
+  <el-dialog v-model="dialogVisible" width="80%" top="4vh">
+    <template #title>
+      <div class="dialog-title">
+        <img class="dialog-title-img" src="@/assets/imgs/dialog-title.png" />
+        <div class="title">设备报警信息</div>
+      </div>
+    </template>
+    <div class="dialog-body">
+      <img class="dialog-img" src="@/assets/imgs/dialog.png" />
+      <div class="dialog-table">
+        <el-table
+          :data="tableData"
+          stripe
+          size="mini"
+          height="48vh"
+          ref="fitting_table"
+          style="width: 100%"
+        >
+          <el-table-column
+            v-for="(item, index) in tableHeader"
+            :key="index"
+            sortable
+            :prop="item.code"
+            :label="item.title"
+            align="center"
+          >
+          </el-table-column>
+        </el-table>
+        <el-pagination
+          @current-change="handleCurrentChange"
+          :current-page="page.currentPage"
+          :page-size="page.pagesize"
+          layout="total, prev, pager, next, jumper"
+          :total="page.total"
+        >
+        </el-pagination>
+      </div>
+    </div>
+    <template #footer>
+      <span class="dialog-footer">
+        <el-button size="mini" round @click="cancel">关闭</el-button>
+      </span>
+    </template>
+  </el-dialog>
+</template>
+<script>
+import { GetTableData } from "@/api/zhbj/index.js";
+import dayjs from "dayjs";
+export default {
+  name: "alarm", //
+  components: {},
+  props: {},
+  data() {
+    return {
+      dialogVisible: false,
+      tableData: [],
+      tableHeader: [
+        { title: "时间", code: "ts" },
+        { title: "场站名称", code: "stationname" },
+        { title: "设备名称", code: "devicename" },
+        { title: "是否确认", code: "confirmed" },
+        { title: "报警描述显示", code: "description" },
+      ],
+      page: {
+        pagesize: 10,
+        currentPage: 1,
+        total: 0,
+      },
+      wtid: "",
+      wpid: "",
+    };
+  },
+  created() {},
+  methods: {
+    // 初始化弹窗数据
+    openDialog(wtid, wpid) {
+      this.wtid = wtid;
+      this.wpid = wpid;
+      if (wtid && wpid) {
+        this.getTableData();
+        this.dialogVisible = true;
+      }
+    },
+    getTableData() {
+      GetTableData({
+        begin: dayjs().format("YYYY-MM-DD"),
+        end: dayjs().add(1, "day").format("YYYY-MM-DD"),
+        alarmType: "windturbine",
+        stationid: this.wpid,
+        deviceid: this.wtid,
+        pageNum: this.page.currentPage,
+        pageSize: this.page.pagesize,
+      }).then(({ data }) => {
+        this.tableData = data.map((item) => {
+          return {
+            ...item,
+            confirmed: item.confirmed ? "是" : "否",
+            ts: dayjs(item.ts).format("YYYY-MM-DD HH:mm:ss"),
+          };
+        });
+        this.page.total = data.length;
+      });
+    },
+    // 取消操作
+    cancel() {
+      this.wtid = "";
+      this.wpid = "";
+      this.dialogVisible = false;
+    },
+
+    handleCurrentChange(val) {
+      this.page.currentPage = val;
+      this.getTableData();
+    },
+  },
+  mounted() {},
+  computed: {},
+};
+</script>
+<style lang="less" scoped>
+.dialog-footer button:first-child {
+  border-color: transparent;
+  margin-right: 10px;
+  background-color: rgba(0, 70, 199, 0.2) !important;
+  color: #b3b3b3;
+}
+.el-dialog {
+  .el-dialog__body {
+    height: calc(100vh - 320px);
+  }
+}
+.footerButton {
+  justify-content: right;
+
+  .el-button:first-child {
+    width: 108px;
+  }
+
+  .el-button:last-of-type {
+    width: 108px;
+    background: rgba(0, 70, 199, 0.4) !important;
+  }
+}
+.el-pagination {
+  text-align: right;
+}
+</style>

+ 82 - 4
src/components/lightDetial/index.vue

@@ -1,8 +1,26 @@
 <template>
   <div style="height: 100%">
-    <div class="wtname">
-      <!--:class="colorList[wtInfo.status]" <div class="wt-status"></div> -->
+    <!-- <div class="wtname">
+      :class="colorList[wtInfo.status]" <div class="wt-status"></div> 
       <div class="wt-text">{{ wtname }}</div>
+    </div>-->
+    <div
+      class="wt-top"
+      :class="colorFlag ? colorList1[wtInfo.status] : colorList[wtInfo.status]"
+    >
+      <div class="wt-text">设备名称:{{ wtname }}</div>
+      <div class="wt-alarm" @click="handleAlarm(wtInfo)">
+        <i
+          class="svg-icon svg-icon-sm"
+          :class="
+            'svg-icon-' +
+            (colorFlag ? colorList1[wtInfo.status] : colorList[wtInfo.status])
+          "
+        >
+          <svgIcon svgid="svg-station-surveillance"></svgIcon>
+        </i>
+        <span>设备报警</span>
+      </div>
     </div>
     <div class="part-info">
       <div class="part-body">
@@ -52,15 +70,17 @@
         </div>
       </div>
     </div>
+    <alarmDialog ref="alarmDialog" />
   </div>
 </template>
 <script>
 import { GetWtTelemeteryInfo } from "@/api/factoryMonitor/index.js";
 import { GetWtPoints, GetPointsData } from "@/api/points/index.js";
-
+import svgIcon from "@/components/coms/icon/svg-icon.vue";
+import alarmDialog from "@/components/alarm";
 export default {
   name: "lightDetail",
-  components: {},
+  components: { svgIcon, alarmDialog },
   props: {
     stationName: {
       type: String,
@@ -106,6 +126,7 @@ export default {
         "gray",
         "gray",
       ],
+      colorList1: ["blue", "green", "red", "orange", "pink", "write", "gray"],
       partAInfo: [],
       partDInfo: [],
       partAInfos: [],
@@ -123,6 +144,8 @@ export default {
       squareTelecommandData: null,
       inverterData: null,
       timer: "",
+      colorFlag: false,
+      wpid: "",
     };
   },
   mounted() {
@@ -142,6 +165,16 @@ export default {
         }
       },
     },
+    $route: {
+      handler(val) {
+        if (
+          val.path.includes("lightmatrix") || val.path.includes("photovoltaicFacility")
+        ) {
+          this.colorFlag = true;
+        }
+      },
+      immediate: true,
+    },
   },
   methods: {
     clear() {
@@ -163,6 +196,7 @@ export default {
     start(wt) {
       if (Object.keys(wt).length) {
         this.wtInfo = wt;
+        this.wpid = wt.wpid;
         this.wtname = wt.wtname;
         this.getPartInfo(wt.wtid);
       } else {
@@ -293,6 +327,11 @@ export default {
           console.log("error", e);
         });
     },
+    //打开报警页面
+    handleAlarm(wtInfo) {
+      this.$refs.alarmDialog &&
+        this.$refs.alarmDialog.openDialog(wtInfo.wtid, this.wpid);
+    },
   },
 };
 </script>
@@ -371,6 +410,45 @@ export default {
     }
   }
 }
+.wt-top {
+  height: 60px;
+  background: rgba(96, 103, 105, 0.2);
+  border-radius: 5px;
+  display: flex;
+  align-items: center;
+  padding-left: 20px;
+  color: #fff;
+  .wt-text {
+    margin-right: 50px;
+  }
+  .wt-alarm {
+    cursor: pointer;
+    span {
+      margin-left: 5px;
+    }
+  }
+  &.green {
+    color: #05bb4c;
+  }
+  &.blue {
+    color: #3c88f7;
+  }
+  &.pink {
+    color: #c530c8;
+  }
+  &.red {
+    color: #ba3237;
+  }
+  &.orange {
+    color: #e17d24;
+  }
+  &.white {
+    color: #fff;
+  }
+  &.gray {
+    color: #606769;
+  }
+}
 .part-info {
   width: 100%;
   height: calc(100% - 60px);

+ 84 - 20
src/components/windDetail/index.vue

@@ -2,18 +2,27 @@
   <div class="bodys" :style="{ height: showHeight }">
     <div class="edge" v-if="Object.keys(monitorInfo).length">
       <div class="info" style="position: relative">
-        <div class="info-title">
-         设备名称: {{ windname }}
-          <i
-            class="svg-icon svg-icon-sm svg-icon-green"
-          >
-            <SvgIcon svgid="svg-wind-site"></SvgIcon>
-          </i>
-          <i  class="svg-icon svg-icon-sm svg-icon-orange">
-            <SvgIcon svgid="svg-photovoltaic"></SvgIcon>
-          </i>
+        <div
+          style="
+            display: flex;
+            width: 100%;
+            align-items: center;
+            margin-top: 10px;
+          "
+        >
+          <div class="info-title" :class="colorList[monitorInfo.status]">
+            <span class="text">设备名称: {{ windname }}</span>
+          </div>
+          <div class="wt-alarm" @click="handleAlarm(wtid)">
+            <i
+              class="svg-icon svg-icon-sm"
+              :class="'svg-icon-' + colorList[monitorInfo.status]"
+            >
+              <svgIcon svgid="svg-station-surveillance"></svgIcon>
+            </i>
+            <span :class="colorList[monitorInfo.status]">设备报警</span>
+          </div>
         </div>
-
         <div class="info-item">日发电量</div>
         <div class="info-value">
           {{ Number(monitorInfo?.rfdl).toFixed(2) || "0" }}
@@ -311,6 +320,7 @@
         </ul>
       </div>
     </el-dialog>
+    <alarmDialog ref="alarmDialog" />
   </div>
 </template>
 <script>
@@ -320,7 +330,8 @@ import {
   GetWtMonitorInfo,
   GetWtTelemeteryInfo,
 } from "@/api/factoryMonitor/index.js";
-
+import svgIcon from "@/components/coms/icon/svg-icon.vue";
+import alarmDialog from "@/components/alarm";
 export default {
   name: "windDetail",
   data() {
@@ -328,6 +339,7 @@ export default {
       current: "fdj",
       windname: "",
       wtid: "",
+      wpid: "",
       windInfo: {},
       monitorInfo: {},
       partAInfo: [],
@@ -345,12 +357,12 @@ export default {
       colorList: ["blue", "green", "red", "orange", "pink", "write", "gray"],
       path: ["camera.png", "camera2.png"],
       count: 0,
-
+      colorFlag: false,
       timer: "",
       times: "",
     };
   },
-  components: {},
+  components: { svgIcon, alarmDialog },
   apiUrl: "",
   props: {
     wind: {
@@ -422,6 +434,18 @@ export default {
         }
       },
     },
+    $route: {
+      handler(val) {
+        if (
+          val.path.includes("lightmatrix") ||
+          val.path.includes("detailmatrix") ||
+          val.path.includes("draughtFan")
+        ) {
+          this.colorFlag = true;
+        }
+      },
+      immediate: true,
+    },
   },
   methods: {
     cancle() {
@@ -445,6 +469,7 @@ export default {
         this.windInfo = val;
         this.windname = val.wtname;
         this.wtid = val.wtid;
+        this.wpid = val.wpid;
         this.current = "fdj";
         this.getWtMonitorInfo(val);
         this.handleClick("fdj");
@@ -598,6 +623,11 @@ export default {
           console.log("error", e);
         });
     },
+    //打开报警页面
+    handleAlarm(id) {
+      this.$refs.alarmDialog &&
+        this.$refs.alarmDialog.openDialog(id, this.wpid);
+    },
     clickVideo(index) {
       this.indexe = index;
     },
@@ -644,19 +674,20 @@ export default {
       align-items: center;
 
       .info-title {
-        width: 75%;
+        width: 50%;
         height: 25px;
         font-size: 16px;
         font-family: Microsoft YaHei;
         font-weight: 400;
-        color:#606769;
-        margin-top: 10px;
         display: flex;
         flex-direction: row;
         align-items: center;
-        margin-left: -40px;
-        padding-left: 20px;
-
+        margin-left: 20px;
+        padding-left: 15px;
+        margin-right: 20px;
+        .text {
+          margin-left: 10px;
+        }
         &.green {
           background-color: rgba(5, 187, 76, 0.2);
           border: 1px solid #05bb4c;
@@ -699,7 +730,40 @@ export default {
           color: #606769;
         }
       }
+      .wt-alarm {
+        font-family: Microsoft YaHei;
+        font-weight: 400;
+        span {
+          margin-left: 5px;
+          &.green {
+            color: #05bb4c;
+          }
+
+          &.blue {
+            color: #1c99ff;
+          }
+
+          &.pink {
+            color: #c530c8;
+          }
+
+          &.red {
+            color: #ba3237;
+          }
+
+          &.orange {
+            color: #e17d24;
+          }
+
+          &.write {
+            color: #ffffff;
+          }
 
+          &.gray {
+            color: #606769;
+          }
+        }
+      }
       .info-item {
         width: 90%;
         font-size: 24px;

+ 89 - 79
src/router/index.js

@@ -17,15 +17,15 @@ export const asyncRoutes = [
     meta: {
       title: "首页",
       icon: "",
-      permissions: ["jn_sy"],
+      permissions: ["jn_sy", "*:*:*"],
     },
   },
-  {
-    path: "/monitor/about",
-    name: "About",
-    component: () =>
-      import(/* webpackChunkName: "about" */ "../views/About.vue"),
-  },
+  //   {
+  //     path: "/monitor/about",
+  //     name: "About",
+  //     component: () =>
+  //       import(/* webpackChunkName: "about" */ "../views/About.vue"),
+  //   },
 
   //   {
   //     path: "/sisView",
@@ -57,7 +57,7 @@ export const asyncRoutes = [
     meta: {
       title: "安全监视",
       icon: "",
-      permissions: ["jn_stateMonitor"],
+      permissions: ["jn_stateMonitor", "*:*:*"],
     },
     children: [
       {
@@ -67,7 +67,7 @@ export const asyncRoutes = [
         meta: {
           title: "基础矩阵",
           icon: "svg-matrix",
-          permissions: ["jn_jcjz"],
+          permissions: ["jn_jcjz", "*:*:*"],
         },
       },
       {
@@ -77,7 +77,7 @@ export const asyncRoutes = [
         meta: {
           title: "明细矩阵",
           icon: "svg-mx-matrix",
-          permissions: ["jn_mxjz"],
+          permissions: ["jn_mxjz", "*:*:*"],
         },
       },
       {
@@ -90,7 +90,7 @@ export const asyncRoutes = [
         meta: {
           title: "综合指标",
           icon: "svg-自定制报表管理",
-          permissions: ["jn_zhzb"],
+          permissions: ["jn_zhzb", "*:*:*"],
         },
       },
       {
@@ -101,7 +101,7 @@ export const asyncRoutes = [
         meta: {
           title: "厂站监视",
           icon: "svg-single-station-surveillance",
-          permissions: ["jn_czjs"],
+          permissions: ["jn_czjs", "*:*:*"],
         },
         children: [
           {
@@ -113,7 +113,7 @@ export const asyncRoutes = [
             meta: {
               title: "风电场站",
               icon: "",
-              permissions: ["jn_fdcz"],
+              permissions: ["jn_fdcz", "*:*:*"],
             },
             children: [
               {
@@ -126,7 +126,7 @@ export const asyncRoutes = [
                 meta: {
                   title: "场站监视",
                   icon: "svg-station-surveillance",
-                  permissions: ["jn_fdcz_czjs"],
+                  permissions: ["jn_fdcz_czjs", "*:*:*"],
                 },
               },
               {
@@ -139,7 +139,7 @@ export const asyncRoutes = [
                 meta: {
                   title: "数据指标",
                   icon: "svg-s指标列表",
-                  permissions: ["jn_fdcz_sjzb"],
+                  permissions: ["jn_fdcz_sjzb", "*:*:*"],
                 },
               },
               {
@@ -152,7 +152,7 @@ export const asyncRoutes = [
                 meta: {
                   title: "矩阵监视",
                   icon: "svg-matrix",
-                  permissions: ["jn_fdcz_jzjs"],
+                  permissions: ["jn_fdcz_jzjs", "*:*:*"],
                 },
               },
               {
@@ -165,7 +165,7 @@ export const asyncRoutes = [
                 meta: {
                   title: "风机设备",
                   icon: "svg-wind-site",
-                  permissions: ["jn_fdcz_fjsb"],
+                  permissions: ["jn_fdcz_fjsb", "*:*:*"],
                 },
               },
               {
@@ -178,7 +178,7 @@ export const asyncRoutes = [
                 meta: {
                   title: "升压站",
                   icon: "svg-s升压站",
-                  permissions: ["jn_fdcz_syz"],
+                  permissions: ["jn_fdcz_syz", "*:*:*"],
                 },
               },
               {
@@ -190,7 +190,7 @@ export const asyncRoutes = [
                 name: "windPower",
                 meta: {
                   title: "测风塔",
-                  permissions: ["jn_fdcz_cft"],
+                  permissions: ["jn_fdcz_cft", "*:*:*"],
                   icon: "svg-s测风塔",
                 },
               },
@@ -203,7 +203,7 @@ export const asyncRoutes = [
                 name: "geomorphologicMap",
                 meta: {
                   title: "地貌图",
-                  permissions: ["jn_fdcz_dmt"],
+                  permissions: ["jn_fdcz_dmt", "*:*:*"],
                   icon: "svg-s地图",
                 },
               },
@@ -218,7 +218,7 @@ export const asyncRoutes = [
             meta: {
               title: "光伏场站",
               icon: "",
-              permissions: ["jn_gfcz"],
+              permissions: ["jn_gfcz", "*:*:*"],
             },
             children: [
               {
@@ -231,7 +231,7 @@ export const asyncRoutes = [
                 meta: {
                   title: "场站监视",
                   icon: "svg-station-surveillance",
-                  permissions: ["jn_gfcz_czjs"],
+                  permissions: ["jn_gfcz_czjs", "*:*:*"],
                 },
               },
               {
@@ -243,7 +243,7 @@ export const asyncRoutes = [
                 name: "lightDataTarget",
                 meta: {
                   title: "数据指标",
-                  permissions: ["jn_gfcz_sjzb"],
+                  permissions: ["jn_gfcz_sjzb", "*:*:*"],
                   icon: "svg-s指标列表",
                 },
               },
@@ -256,7 +256,7 @@ export const asyncRoutes = [
                 name: "lightMatrixMonitor",
                 meta: {
                   title: "矩阵监视",
-                  permissions: ["jn_gfcz_jzjs"],
+                  permissions: ["jn_gfcz_jzjs", "*:*:*"],
                   icon: "svg-matrix",
                 },
               },
@@ -269,7 +269,7 @@ export const asyncRoutes = [
                 name: "photovoltaicFacility",
                 meta: {
                   title: "光伏设备",
-                  permissions: ["jn_gfcz_gfsb"],
+                  permissions: ["jn_gfcz_gfsb", "*:*:*"],
                   icon: "svg-photovoltaic",
                 },
               },
@@ -282,7 +282,7 @@ export const asyncRoutes = [
                 name: "lightBoosterStation",
                 meta: {
                   title: "升压站",
-                  permissions: ["jn_gfcz_syz"],
+                  permissions: ["jn_gfcz_syz", "*:*:*"],
                   icon: "svg-s升压站",
                 },
               },
@@ -295,7 +295,7 @@ export const asyncRoutes = [
                 name: "lightGeomorphologicMap",
                 meta: {
                   title: "地貌图",
-                  permissions: ["jn_gfcz_dmt"],
+                  permissions: ["jn_gfcz_dmt", "*:*:*"],
                   icon: "svg-s地图",
                 },
               },
@@ -303,6 +303,16 @@ export const asyncRoutes = [
           },
         ],
       },
+      //   {
+      //     path: "alarm", // 报警列表
+      //     name: "alarm",
+      //     component: () => import("@/views/stateMonitor/alarmlist"),
+      //     meta: {
+      //       title: "报警列表",
+      //       icon: "svg-alarm-center",
+      //       permissions: ["jn_alarm"],
+      //     },
+      //   },
     ],
   },
   //   经济运行
@@ -316,7 +326,7 @@ export const asyncRoutes = [
     meta: {
       title: "经济运行",
       icon: "",
-      permissions: ["jn_economicsOperation"],
+      permissions: ["jn_economicsOperation", "*:*:*"],
     },
     children: [
       //   {
@@ -337,7 +347,7 @@ export const asyncRoutes = [
         meta: {
           title: "对标管理",
           icon: "svg-dbgl",
-          permissions: ["jn_dbgl"],
+          permissions: ["jn_dbgl", "*:*:*"],
         },
         children: [
           {
@@ -350,7 +360,7 @@ export const asyncRoutes = [
             meta: {
               title: "风机绩效榜",
               icon: "",
-              permissions: ["jn_dbgl_jxb"],
+              permissions: ["jn_dbgl_jxb", "*:*:*"],
             },
           },
           {
@@ -363,7 +373,7 @@ export const asyncRoutes = [
             meta: {
               title: "风机绩效榜明细",
               icon: "",
-              permissions: ["jn_dbgl_jxb"],
+              permissions: ["jn_dbgl_jxb", "*:*:*"],
             },
           },
           {
@@ -376,7 +386,7 @@ export const asyncRoutes = [
             meta: {
               title: "五项损失率",
               icon: "",
-              permissions: ["jn_dbgl_wxssl"],
+              permissions: ["jn_dbgl_wxssl", "*:*:*"],
             },
           },
           {
@@ -389,7 +399,7 @@ export const asyncRoutes = [
             meta: {
               title: "公司对标",
               icon: "",
-              permissions: ["jn_dbgl_gsdb"],
+              permissions: ["jn_dbgl_gsdb", "*:*:*"],
             },
           },
           {
@@ -402,7 +412,7 @@ export const asyncRoutes = [
             meta: {
               title: "场内对标",
               icon: "",
-              permissions: ["jn_dbgl_cndb"],
+              permissions: ["jn_dbgl_cndb", "*:*:*"],
             },
           },
           {
@@ -415,7 +425,7 @@ export const asyncRoutes = [
             meta: {
               title: "场际对标",
               icon: "",
-              permissions: ["jn_dbgl_cjdb"],
+              permissions: ["jn_dbgl_cjdb", "*:*:*"],
             },
           },
           //   {
@@ -440,7 +450,7 @@ export const asyncRoutes = [
             meta: {
               title: "项目对标",
               icon: "",
-              permissions: ["jn_dbgl_xmdb"],
+              permissions: ["jn_dbgl_xmdb", "*:*:*"],
             },
           },
           {
@@ -453,7 +463,7 @@ export const asyncRoutes = [
             meta: {
               title: "线路对标",
               icon: "",
-              permissions: ["jn_dbgl_xldb"],
+              permissions: ["jn_dbgl_xldb", "*:*:*"],
             },
           },
           //   {
@@ -478,7 +488,7 @@ export const asyncRoutes = [
         meta: {
           title: "三率",
           icon: "svg-slgl",
-          permissions: ["jn_slgl"],
+          permissions: ["jn_slgl", "*:*:*"],
         },
         children: [
           {
@@ -491,7 +501,7 @@ export const asyncRoutes = [
             meta: {
               title: "复位及时率",
               icon: "",
-              permissions: ["jn_slgl_fwjsl"],
+              permissions: ["jn_slgl_fwjsl", "*:*:*"],
             },
           },
           {
@@ -502,7 +512,7 @@ export const asyncRoutes = [
             meta: {
               title: "消缺及时率",
               icon: "",
-              permissions: ["jn_slgl_xqjsl"],
+              permissions: ["jn_slgl_xqjsl", "*:*:*"],
             },
           },
           {
@@ -513,7 +523,7 @@ export const asyncRoutes = [
             meta: {
               title: "状态转换率",
               icon: "",
-              permissions: ["jn_slgl_ztzhl"],
+              permissions: ["jn_slgl_ztzhl", "*:*:*"],
             },
           },
         ],
@@ -526,7 +536,7 @@ export const asyncRoutes = [
         meta: {
           title: "性能分析",
           icon: "svg-dimension-new",
-          permissions: ["jn_xnfx"],
+          permissions: ["jn_xnfx", "*:*:*"],
         },
         children: [
           {
@@ -537,7 +547,7 @@ export const asyncRoutes = [
             meta: {
               title: "单机性能分析",
               icon: "",
-              permissions: ["jn_xnfx_djxnfx"],
+              permissions: ["jn_xnfx_djxnfx", "*:*:*"],
             },
           },
           {
@@ -548,7 +558,7 @@ export const asyncRoutes = [
             meta: {
               title: "单机月度分析",
               icon: "",
-              permissions: ["jn_xnfx_djydfx"],
+              permissions: ["jn_xnfx_djydfx", "*:*:*"],
             },
           },
         ],
@@ -562,7 +572,7 @@ export const asyncRoutes = [
         meta: {
           title: "性能评估",
           icon: "svg-fjfx",
-          permissions: ["jn_xndjpg"],
+          permissions: ["jn_xndjpg", "*:*:*"],
         },
         children: [
           {
@@ -575,7 +585,7 @@ export const asyncRoutes = [
             meta: {
               title: "性能等级评估",
               icon: "",
-              permissions: ["jn_xndjpg"],
+              permissions: ["jn_xndjpg", "*:*:*"],
             },
           },
         ],
@@ -588,7 +598,7 @@ export const asyncRoutes = [
         meta: {
           title: "功率曲线",
           icon: "svg-power-curve",
-          permissions: ["jn_glqx"],
+          permissions: ["jn_glqx", "*:*:*"],
         },
         children: [
           {
@@ -599,7 +609,7 @@ export const asyncRoutes = [
             meta: {
               title: "功率曲线拟合",
               icon: "",
-              permissions: ["jn_glqx_glqxnh"],
+              permissions: ["jn_glqx_glqxnh", "*:*:*"],
             },
           },
           {
@@ -612,7 +622,7 @@ export const asyncRoutes = [
             meta: {
               title: "切入切出分析",
               icon: "",
-              permissions: ["jn_glqx_qrqcfx"],
+              permissions: ["jn_glqx_qrqcfx", "*:*:*"],
             },
           },
         ],
@@ -625,7 +635,7 @@ export const asyncRoutes = [
         meta: {
           title: "专题分析",
           icon: "svg-ztfx",
-          permissions: ["jn_ztfx"],
+          permissions: ["jn_ztfx", "*:*:*"],
         },
         children: [
           {
@@ -638,7 +648,7 @@ export const asyncRoutes = [
             meta: {
               title: "综合分析",
               icon: "",
-              permissions: ["jn_ztfx_zhfx"],
+              permissions: ["jn_ztfx_zhfx", "*:*:*"],
             },
           },
           {
@@ -649,7 +659,7 @@ export const asyncRoutes = [
             meta: {
               title: "风能利用率",
               icon: "",
-              permissions: ["jn_ztfx_fnlyl"],
+              permissions: ["jn_ztfx_fnlyl", "*:*:*"],
             },
           },
           {
@@ -660,7 +670,7 @@ export const asyncRoutes = [
             meta: {
               title: "五项损失率",
               icon: "",
-              permissions: ["jn_ztfx_wxssl"],
+              permissions: ["jn_ztfx_wxssl", "*:*:*"],
             },
           },
           {
@@ -671,7 +681,7 @@ export const asyncRoutes = [
             meta: {
               title: "三率分析",
               icon: "",
-              permissions: ["jn_ztfx_fwjsl"],
+              permissions: ["jn_ztfx_fwjsl", "*:*:*"],
             },
           },
           {
@@ -682,7 +692,7 @@ export const asyncRoutes = [
             meta: {
               title: "可靠性分析",
               icon: "",
-              permissions: ["jn_ztfx_kkxfx"],
+              permissions: ["jn_ztfx_kkxfx", "*:*:*"],
             },
           },
           {
@@ -693,7 +703,7 @@ export const asyncRoutes = [
             meta: {
               title: "发电量分析",
               icon: "",
-              permissions: ["jn_ztfx_dlfx"],
+              permissions: ["jn_ztfx_dlfx", "*:*:*"],
             },
           },
         ],
@@ -761,7 +771,7 @@ export const asyncRoutes = [
     meta: {
       title: "智慧检修",
       icon: "",
-      permissions: ["jn_health"],
+      permissions: ["jn_health", "*:*:*"],
     },
     children: [
       {
@@ -772,7 +782,7 @@ export const asyncRoutes = [
         meta: {
           title: "健康管理",
           icon: "svg-健康管理",
-          permissions: ["jn_jkgl"],
+          permissions: ["jn_jkgl", "*:*:*"],
         },
         children: [
           {
@@ -783,7 +793,7 @@ export const asyncRoutes = [
             meta: {
               title: "健康推荐",
               icon: "",
-              permissions: ["jn_jkgl_jktj"],
+              permissions: ["jn_jkgl_jktj", "*:*:*"],
             },
           },
           {
@@ -796,7 +806,7 @@ export const asyncRoutes = [
             meta: {
               title: "健康首页",
               icon: "",
-              permissions: ["jn_jkgl_jksy"],
+              permissions: ["jn_jkgl_jksy", "*:*:*"],
             },
           },
           {
@@ -807,7 +817,7 @@ export const asyncRoutes = [
             meta: {
               title: "场站健康管理",
               icon: "",
-              permissions: ["jn_jkgl_czjk"],
+              permissions: ["jn_jkgl_czjk", "*:*:*", "*:*:*"],
             },
           },
           {
@@ -820,7 +830,7 @@ export const asyncRoutes = [
             meta: {
               title: "健康总览",
               icon: "",
-              permissions: ["jn_jkgl_jkzl"],
+              permissions: ["jn_jkgl_jkzl", "*:*:*", "*:*:*"],
             },
           },
           {
@@ -833,7 +843,7 @@ export const asyncRoutes = [
             meta: {
               title: "健康矩阵",
               icon: "",
-              permissions: ["jn_jkgl_jkjz"],
+              permissions: ["jn_jkgl_jkjz", "*:*:*", "*:*:*"],
             },
           },
           {
@@ -846,7 +856,7 @@ export const asyncRoutes = [
             meta: {
               title: "健康列表",
               icon: "",
-              permissions: ["jn_jkgl_jklb"],
+              permissions: ["jn_jkgl_jklb", "*:*:*", "*:*:*"],
             },
           },
           {
@@ -859,7 +869,7 @@ export const asyncRoutes = [
             meta: {
               title: "劣化状态分析",
               icon: "",
-              permissions: ["jn_jkgl_lhztfx"],
+              permissions: ["jn_jkgl_lhztfx", "*:*:*", "*:*:*"],
             },
           },
         ],
@@ -873,7 +883,7 @@ export const asyncRoutes = [
         meta: {
           title: "能效分析",
           icon: "svg-能效分析",
-          permissions: ["jn_nxfx"],
+          permissions: ["jn_nxfx", "*:*:*"],
         },
         children: [
           {
@@ -886,7 +896,7 @@ export const asyncRoutes = [
             meta: {
               title: "功率曲线拟合",
               icon: "",
-              permissions: ["jn_nxfx_glqxnh"],
+              permissions: ["jn_nxfx_glqxnh", "*:*:*"],
             },
           },
           {
@@ -899,7 +909,7 @@ export const asyncRoutes = [
             meta: {
               title: "曲线偏差率分析",
               icon: "",
-              permissions: ["jn_nxfx_qxpcl"],
+              permissions: ["jn_nxfx_qxpcl", "*:*:*"],
             },
           },
           {
@@ -912,7 +922,7 @@ export const asyncRoutes = [
             meta: {
               title: "单机饱和度",
               icon: "",
-              permissions: ["jn_nxfx_djbhd"],
+              permissions: ["jn_nxfx_djbhd", "*:*:*"],
             },
           },
           {
@@ -925,7 +935,7 @@ export const asyncRoutes = [
             meta: {
               title: "部件温度分析",
               icon: "",
-              permissions: ["jn_nxfx_bjwd"],
+              permissions: ["jn_nxfx_bjwd", "*:*:*"],
             },
           },
           {
@@ -938,7 +948,7 @@ export const asyncRoutes = [
             meta: {
               title: "预警评判分析",
               icon: "",
-              permissions: ["jn_nxfx_yjpp"],
+              permissions: ["jn_nxfx_yjpp", "*:*:*"],
             },
           },
           {
@@ -951,7 +961,7 @@ export const asyncRoutes = [
             meta: {
               title: "故障评判分析",
               icon: "",
-              permissions: ["jn_nxfx_gzpp"],
+              permissions: ["jn_nxfx_gzpp", "*:*:*"],
             },
           },
           {
@@ -964,7 +974,7 @@ export const asyncRoutes = [
             meta: {
               title: "部件功率分析",
               icon: "",
-              permissions: ["jn_nxfx_gzpp"],
+              permissions: ["jn_nxfx_gzpp", "*:*:*"],
             },
           },
         ],
@@ -1011,7 +1021,7 @@ export const asyncRoutes = [
             meta: {
               title: "劣化状态分析曲线",
               icon: "",
-              permissions: ["jn_jkgl_jktj", "jn_jkgl_jksy", "jn_jkgl_jkjz"],
+              //   permissions: ["jn_jkgl_jktj", "jn_jkgl_jksy", "jn_jkgl_jkjz"],
             },
           },
         ],
@@ -1026,7 +1036,7 @@ export const asyncRoutes = [
     meta: {
       title: "综合报表",
       icon: "",
-      permissions: ["jn_zhbb"],
+      permissions: ["jn_zhbb", "*:*:*"],
     },
     component: () => import("@/views/report"),
     children: [
@@ -1037,7 +1047,7 @@ export const asyncRoutes = [
         meta: {
           title: "自定制报表管理",
           icon: "svg-自定制报表管理",
-          permissions: ["jn_zdz"],
+          permissions: ["jn_zdz", "*:*:*"],
         },
         component: () => import("@/views/report/stationReport"),
         children: [
@@ -1048,7 +1058,7 @@ export const asyncRoutes = [
             meta: {
               title: "日报表",
               icon: "",
-              permissions: ["jn_zdz_rbb"],
+              permissions: ["jn_zdz_rbb", "*:*:*"],
             },
           },
           {
@@ -1058,7 +1068,7 @@ export const asyncRoutes = [
             meta: {
               title: "风电场站自定义",
               icon: "",
-              permissions: ["jn_zdz_fdcz"],
+              permissions: ["jn_zdz_fdcz", "*:*:*"],
             },
           },
           {
@@ -1068,7 +1078,7 @@ export const asyncRoutes = [
             meta: {
               title: "风电项目自定义",
               icon: "",
-              permissions: ["jn_zdz_fdxm"],
+              permissions: ["jn_zdz_fdxm", "*:*:*"],
             },
           },
         ],

+ 1 - 1
src/tools/request.js

@@ -48,7 +48,7 @@ service.interceptors.response.use(
           type: "warning",
           callback: () => {
             store.dispatch("user/LogOut").then(() => {
-              location.href = "/home";
+              location.href = "/";
             });
           },
         }

+ 41 - 44
src/utills/handleRoutes.js

@@ -20,52 +20,49 @@ function hasPermission(permissions, route) {
  */
 export function filterAsyncRoutes(routes, permissions) {
   const finallyRoutes = [];
-  if (permissions[0] == "*:*:*") {
-    return routes;
-  } else {
-    routes.forEach((route) => {
-      const item = { ...route };
-      if (hasPermission(permissions, item)) {
-        if (item.children) {
-          item.children = filterAsyncRoutes(item.children, permissions);
-        }
-        finallyRoutes.push(item);
+
+  routes.forEach((route) => {
+    const item = { ...route };
+    if (hasPermission(permissions, item)) {
+      if (item.children) {
+        item.children = filterAsyncRoutes(item.children, permissions);
       }
-    });
-    finallyRoutes.forEach((route) => {
-      if (route.children) {
-        if (route.children[0].children) {
-          route.redirect =
-            route.path +
-            "/" +
-            route.children[0].path +
-            "/" +
-            route.children[0].children[0].path;
-        } else {
-          route.redirect = route.path + "/" + route.children[0].path;
-        }
-        route.children.forEach((croute) => {
-          if (croute.children) {
-            croute.redirect =
-              route.path + "/" + croute.path + "/" + croute.children[0].path;
-            croute.children.forEach((i) => {
-              if (i.children) {
-                i.redirect =
-                  route.path +
-                  "/" +
-                  croute.path +
-                  "/" +
-                  i.path +
-                  "/" +
-                  i.children[0].path;
-              }
-            });
-          }
-        });
+      finallyRoutes.push(item);
+    }
+  });
+  finallyRoutes.forEach((route) => {
+    if (route.children) {
+      if (route.children[0].children) {
+        route.redirect =
+          route.path +
+          "/" +
+          route.children[0].path +
+          "/" +
+          route.children[0].children[0].path;
+      } else {
+        route.redirect = route.path + "/" + route.children[0].path;
       }
-    });
-    return finallyRoutes;
-  }
+      route.children.forEach((croute) => {
+        if (croute.children) {
+          croute.redirect =
+            route.path + "/" + croute.path + "/" + croute.children[0].path;
+          croute.children.forEach((i) => {
+            if (i.children) {
+              i.redirect =
+                route.path +
+                "/" +
+                croute.path +
+                "/" +
+                i.path +
+                "/" +
+                i.children[0].path;
+            }
+          });
+        }
+      });
+    }
+  });
+  return finallyRoutes;
 }
 function hasRoute(i, arr) {
   if (i && arr.length) {

+ 11 - 0
src/views/alarmCenter/index.vue

@@ -0,0 +1,11 @@
+<template>
+  <router-view />
+</template>
+
+<script>
+export default {
+  name: "alarmCenter", //综合报警
+};
+</script>
+
+<style></style>

+ 12 - 12
src/views/layout/Header.vue

@@ -94,11 +94,11 @@ export default {
         //   path: "/znbb/reportPandect",
         //   isActive: false,
         // },
-        {
-          id: "zhbj",
-          text: "综合报警",
-          path: "",
-        },
+        // {
+        //   id: "zhbj",
+        //   text: "综合报警",
+        //   path: "",
+        // },
         // {
         //   id: "fdnlpt",
         //   text: "发电能力分析",
@@ -171,13 +171,13 @@ export default {
             });
           }
         });
-        currMenu.push(
-          {
-            id: "zhbj",
-            text: "综合报警",
-            path: "",
-          },
-        );
+        // currMenu.push(
+        //   {
+        //     id: "zhbj",
+        //     text: "综合报警",
+        //     path: "",
+        //   },
+        // );
         return currMenu;
       } else {
         return [];

+ 5 - 3
src/views/layout/Menu.vue

@@ -615,7 +615,7 @@ export default {
           (i) => i.path == "/" + this.currRoot
         );
         let currData = [];
-        if (routeObj) {
+        if (Object.keys(routeObj).length) {
           let a = JSON.parse(JSON.stringify(routeObj));
           if (a.children) {
             a.children.forEach((path) => {
@@ -680,19 +680,21 @@ export default {
               this.currRoot = element.id;
               this.$nextTick(() => {
                 this.currentMenu.some((element, index) => {
-                  if (val.path == element.path || val.path == element.path) {
+                  if (val.path == element.path) {
                     this.activeIndex = index;
                   }
                 });
               });
             });
             return true;
+          } else {
+            this.currRoot = "home";
+            this.activeIndex = 0;
           }
         });
       },
       //深度观察监听
       deep: true,
-      immediate: true,
     },
   },
 };

+ 3 - 3
src/views/stateMonitor/DetailMatrix/index.vue

@@ -177,7 +177,7 @@
                   <!-- wtname + 状态 -->
                   <div
                     class="card-left"
-                    @click="handleLeftClick(val, value.czlx)"
+                    @click="handleLeftClick(val, value.czlx, value.wpid)"
                   >
                     <div class="card-name">{{ val.wtname }}</div>
                     <i
@@ -926,11 +926,11 @@ export default {
       }
     },
     // 点击左侧数据弹出曲线
-    handleLeftClick(wt, type) {
+    handleLeftClick(wt, type, wpid) {
       this.displayMatrix = true;
       this.wtType = type;
       this.$nextTick(() => {
-        this.wind = { ...wt, wtType: type };
+        this.wind = { ...wt, wtType: type, wpid };
         this.flag = true;
       });
       //   this.$refs.windDetail.start(wt);

+ 3 - 3
src/views/stateMonitor/LightMatrix/index.vue

@@ -367,7 +367,7 @@
             v-for="(subItem, index) in item.wtlist"
             :class="getColor(subItem?.status)"
             :key="index"
-            @click="goDetails(subItem, item.czlx)"
+            @click="goDetails(subItem, item.czlx, item.wpid)"
             >{{ subItem.wtname }}</span
           >
         </div>
@@ -560,11 +560,11 @@ export default {
       this.$refs.child.openCurvDatas(y, 1, wpid);
     },
     // 查看风机详情
-    goDetails(wt, type) {
+    goDetails(wt, type, wpid) {
       this.displayMatrix = true;
       this.wtType = type;
       this.$nextTick(() => {
-        this.wind = { ...wt, wtType: type };
+        this.wind = { ...wt, wtType: type, wpid };
         this.flag = true;
       });
     },

+ 20 - 0
src/views/stateMonitor/alarmlist/index.vue

@@ -0,0 +1,20 @@
+<template>
+  <div class="alarm-body">报警列表</div>
+</template>
+<script>
+export default {
+  name: "alarm",
+  components: {},
+  data() {
+    return {};
+  },
+  created() {},
+  methods: {},
+};
+</script>
+<style scoped>
+.alarm-body {
+  height: 100%;
+  padding: 20px 20px 20px 40px;
+}
+</style>

+ 7 - 4
src/views/stateMonitor/factoryMonitor/photovoltaic/lightMatrixMonitor/index.vue

@@ -177,13 +177,16 @@
                   class="matrix-card"
                   style="cursor: pointer"
                   :class="
-                    val.status !== '' && colorList[Number(val.status)]
+                    val.status !== '' && colorList[val.status]
                       ? colorList[Number(val.status)]
                       : 'gray'
                   "
                 >
                   <div class="info">
-                    <div class="card-left" @click="handleLeftClick(val)">
+                    <div
+                      class="card-left"
+                      @click="handleLeftClick(val, value.id)"
+                    >
                       <div class="card-name">{{ val.wtname }}</div>
                       <i
                         class="svg-icon svg-icon-sm"
@@ -702,10 +705,10 @@ export default {
       }
     },
     // 点击左侧数据弹出曲线
-    handleLeftClick(wt) {
+    handleLeftClick(wt, wpid) {
       this.displayMatrix = true;
       this.$nextTick(() => {
-        this.wind = { ...wt, wtType: this.wtType };
+        this.wind = { ...wt, wtType: this.wtType, wpid };
         this.flag = true;
       });
       //   this.$refs.windDetail.start(wt);

+ 6 - 1
src/views/stateMonitor/factoryMonitor/photovoltaic/photovoltaicFacility/index.vue

@@ -63,11 +63,16 @@ export default {
         this.$refs.lightDetial.start({
           ...this.lightList[0]?.lns[0]?.wts[0],
           wtType: -2,
+          wpid: this.stationCode,
         });
       }
     },
     clickMenu(item) {
-      this.$refs.lightDetial.start({ ...item, wtType: -2 });
+      this.$refs.lightDetial.start({
+        ...item,
+        wtType: -2,
+        wpid: this.stationCode,
+      });
     },
   },
 };

+ 6 - 1
src/views/stateMonitor/factoryMonitor/windPowerPlant/draughtFan/index.vue

@@ -64,11 +64,16 @@ export default {
         this.$refs.windDetail.start({
           ...this.windterList[0]?.lns[0]?.wts[0],
           wtType: -1,
+          wpid: this.stationCode,
         });
       }
     },
     clickMenu(item) {
-      this.$refs.windDetail.start({ ...item, wtType: -1 });
+      this.$refs.windDetail.start({
+        ...item,
+        wtType: -1,
+        wpid: this.stationCode,
+      });
     },
   },
 };

+ 6 - 3
src/views/stateMonitor/factoryMonitor/windPowerPlant/matrixMonitor/index.vue

@@ -183,7 +183,10 @@
                   "
                 >
                   <div class="info">
-                    <div class="card-left" @click="handleLeftClick(val)">
+                    <div
+                      class="card-left"
+                      @click="handleLeftClick(val, value.id)"
+                    >
                       <div class="card-name">{{ val.wtname }}</div>
                       <i
                         class="svg-icon svg-icon-sm"
@@ -711,10 +714,10 @@ export default {
       }
     },
     // 点击左侧数据弹出曲线
-    handleLeftClick(wt) {
+    handleLeftClick(wt, wpid) {
       this.displayMatrix = true;
       this.$nextTick(() => {
-        this.wind = { ...wt, wtType: this.wtType };
+        this.wind = { ...wt, wtType: this.wtType, wpid };
         this.flag = true;
       });
       //   this.$refs.windDetail.start(wt);