Browse Source

修改首页菜单点击逻辑,初步新建首页文件

baiyanting 1 year ago
parent
commit
16450ca151

+ 1 - 0
package.json

@@ -38,6 +38,7 @@
     "jspdf": "^2.3.1",
     "jszip": "^3.7.1",
     "jszip-utils": "^0.1.0",
+    "lib-flexible": "^0.3.2",
     "papaparse": "^5.3.1",
     "pizzip": "^3.1.4",
     "stompjs": "^2.3.3",

+ 23 - 4
src/App.vue

@@ -24,7 +24,7 @@
           >
         </div>
         <div class="header-menu-body">
-          <Header />
+          <Header @changeShowSisView="changeShowSisView" />
         </div>
       </div>
       <div
@@ -84,11 +84,16 @@
     </div>
     <div v-else class="login"><login-page @onLogin="login" /></div>
   </div>
+  <div class="daping-app" v-else>
+    <Home v-if="isLogined" @changeShowSisView="changeShowSisView" />
+    <div v-else class="daping-login"><login-page @onLogin="login" /></div>
+  </div>
 </template>
 
 <script>
 // 导入header.vue文件
 import alarmBadge from "@/components/alarm-badge/index.vue";
+import Home from "@/views/Home/index1.vue";
 import Menu from "@/views/layout/Menu.vue";
 import Header from "@/views/layout/Header.vue";
 import LoginPage from "./views/layout/login-page.vue";
@@ -105,6 +110,7 @@ export default {
     LoginPage,
     alarmBadge,
     SvgIcon,
+    Home,
   },
 
   data() {
@@ -113,7 +119,7 @@ export default {
       // 当前子系统
       root: "",
       //   isLogined: localStorage.getItem("loginState") || false,
-      showSisView: false,
+      showSisView: true,
       memuCloseTimeout: null,
       menuData: [],
       hideMenus: "0",
@@ -150,6 +156,9 @@ export default {
     console.log("离开标记", this.socketLeaveFlag);
   },
   methods: {
+    changeShowSisView(val) {
+      this.showSisView = val;
+    },
     getScale() {
       const w = window.innerWidth / this.style.width;
       const h = window.innerHeight / this.style.height;
@@ -263,7 +272,17 @@ export default {
     z-index: 3;
   }
 }
-
+.daping-app {
+  width: 100vw;
+  height: 100vh;
+  .daping-login {
+    width: 100%;
+    height: 100%;
+    background: url("~@/assets/login-bg.png") no-repeat;
+    background-size: 100% 100%;
+    position: relative;
+  }
+}
 * {
   box-sizing: border-box;
 
@@ -405,7 +424,7 @@ body {
   width: 100%;
   height: 100%;
   background: url("~@/assets/login-bg.png") no-repeat;
-  background-size: cover;
+  background-size: 100% 100%;
   position: relative;
 }
 .el-badge {

File diff suppressed because it is too large
+ 1 - 2
src/assets/icon/svg/co2.svg


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


BIN
src/assets/map/header-title.png


BIN
src/assets/map/homeBackground.png


BIN
src/assets/map/voltaic-all.png


BIN
src/assets/map/wind-all.png


BIN
src/assets/map/wind-jr.png


BIN
src/assets/png/sy-sun.png


+ 11 - 11
src/router/index.js

@@ -13,7 +13,7 @@ export const asyncRoutes = [
   {
     path: "/home", // 驾驶舱
     name: "home",
-    component: () => import("@/views/Home"),
+    component: () => import("@/views/Home/index1.vue"),
     meta: {
       title: "首页",
       icon: "",
@@ -1464,16 +1464,16 @@ export const asyncRoutes = [
               permissions: ["jn_zdz_scrb"],
             },
           },
-        //   {
-        //     path: "gjyrbb",
-        //     name: "gjyrbb",
-        //     component: () => import("@/views/report/stationReport/rbb"),
-        //     meta: {
-        //       title: "日报表",
-        //       icon: "",
-        //       permissions: ["jn_zdz_rbb"],
-        //     },
-        //   },
+          //   {
+          //     path: "gjyrbb",
+          //     name: "gjyrbb",
+          //     component: () => import("@/views/report/stationReport/rbb"),
+          //     meta: {
+          //       title: "日报表",
+          //       icon: "",
+          //       permissions: ["jn_zdz_rbb"],
+          //     },
+          //   },
 
           {
             path: "fczybb",

File diff suppressed because it is too large
+ 1803 - 0
src/views/Home/components/home/SX.vue


+ 400 - 0
src/views/Home/components/home/dash-pie-chart.vue

@@ -0,0 +1,400 @@
+<template>
+  <div class="chart" :id="id"></div>
+</template>
+
+<script>
+import util from "@/helper/util.js";
+import partten from "@/helper/partten.js";
+import * as echarts from "echarts";
+import $ from "jquery";
+
+export default {
+  name: "dsah-pie",
+  componentName: "dsah-pie",
+  props: {
+    // 宽度 默认9.722vh
+    width: {
+      type: String,
+      default: "85%",
+    },
+    // 高度 默认9.722vh
+    height: {
+      type: String,
+      default: "7.4074vh",
+    },
+    // 标题
+    title: {
+      type: String,
+      default: "标题",
+    },
+    unit: {
+      type: String,
+      default: "",
+    },
+    // 值
+    value: {
+      type: Number,
+      default: 0,
+    },
+    // 最小值
+    min: {
+      type: Number,
+      default: 0,
+    },
+    // 最大值
+    max: {
+      type: Number,
+      default: 100,
+    },
+    // 颜色 传入 green yellow等 (partten中支持的颜色)
+    color: {
+      type: String,
+      default: "green",
+    },
+  },
+  data() {
+    return {
+      id: "",
+      chart: null,
+    };
+  },
+  computed: {
+    colorValue() {
+      return partten.getColor(this.color);
+    },
+  },
+  methods: {
+    resize() {},
+    initChart() {
+      let chart = echarts.init(this.$el);
+      let option = {
+        title: {
+          show: true,
+          text: this.unit,
+          subtext: this.title,
+          subtextStyle: {
+            fontSize: 12,
+            color: "#fff",
+          },
+          x: "45%",
+          y: "56%",
+          z: 8,
+          textAlign: "center",
+          textStyle: {
+            color: "#999",
+            fontSize: 12,
+            fontWeight: "normal",
+          },
+        },
+        series: [
+          // 进度条
+          {
+            z: 1,
+            name: "内部(环形)进度条",
+            type: "gauge",
+            radius: "85%",
+            splitNumber: 5,
+            axisLine: {
+              lineStyle: {
+                color: [
+                  [
+                    (this.value < 0 ? 0 : this.value) / this.max,
+                    new echarts.graphic.LinearGradient(0, 0, 1, 0, [
+                      {
+                        offset: 0,
+                        color: $("#appBody").is(".dark")
+                          ? partten.getColor(this.color) + "01"
+                          : "rgb(57, 54, 143)",
+                      },
+                      {
+                        offset: 1,
+                        color: $("#appBody").is(".dark")
+                          ? partten.getColor(this.color) + "ff"
+                          : "rgb(57, 54, 143)",
+                      },
+                    ]),
+                  ],
+                  [1, "transparent"],
+                ],
+                width: 12,
+              },
+            },
+            axisLabel: {
+              show: false,
+            },
+            axisTick: {
+              show: false,
+            },
+            splitLine: {
+              show: false,
+            },
+            pointer: {
+              show: false,
+            },
+          },
+          // 指针
+          {
+            name: "指针",
+            type: "gauge",
+            z: 2,
+            min: this.min,
+            max: this.max,
+            radius: "90%",
+            axisLine: {
+              show: false,
+            },
+            tooltip: {
+              show: false,
+            },
+            axisLabel: {
+              show: false,
+            },
+            axisTick: {
+              show: false,
+            },
+            splitLine: {
+              show: false,
+            },
+            detail: {
+              show: false,
+            },
+            title: {
+              //标题
+              show: false,
+            },
+            data: [
+              {
+                value: this.value < 0 ? 0 : this.value,
+              },
+            ],
+            itemStyle: {
+              normal: {
+                color: $("#appBody").is(".dark") ? "#fff" : "#000",
+              },
+            },
+            pointer: {
+              show: true,
+              length: "30%",
+              radius: "20%",
+              width: 1, //指针粗细
+              offsetCenter: ["0%", "-40%"],
+            },
+            animationDuration: 0,
+          },
+          // 刻度
+          {
+            name: "外部刻度",
+            type: "gauge",
+            center: ["50%", "50%"],
+            radius: "85%",
+            min: this.min, //最小刻度
+            max: this.max, //最大刻度
+            splitNumber: 10, //刻度数量
+            startAngle: 225,
+            endAngle: -45,
+            axisLine: {
+              show: true,
+              // 仪表盘刻度线
+              lineStyle: {
+                width: 1,
+                color: [
+                  [
+                    1,
+                    $("#appBody").is(".dark")
+                      ? partten.getColor(this.color)
+                      : "rgb(57, 54, 143)",
+                  ],
+                ],
+              },
+            },
+            //仪表盘文字
+            axisLabel: {
+              show: false,
+            },
+            //刻度标签。
+            axisTick: {
+              show: true,
+              distance: 6,
+              splitNumber: 2,
+              lineStyle: {
+                color: $("#appBody").is(".dark")
+                  ? partten.getColor(this.color)
+                  : "rgb(57, 54, 143)", //用颜色渐变函数不起作用
+                width: 1,
+              },
+              length: 4,
+            }, //刻度样式
+            splitLine: {
+              show: false,
+            }, //分隔线样式
+            detail: {
+              show: false,
+            },
+            pointer: {
+              show: false,
+            },
+          },
+          // 显示数字
+          {
+            type: "pie",
+            radius: ["0", "65%"],
+            center: ["50%", "50%"],
+            z: 8,
+            animation: false,
+            hoverAnimation: false,
+            data: [
+              {
+                value: this.value < 0 ? 0 : this.value,
+                itemStyle: {
+                  normal: {
+                    color: "transition",
+                    fontSize: 12,
+                  },
+                },
+                label: {
+                  normal: {
+                    formatter: function (params) {
+                      return params.value;
+                    },
+                    color: $("#appBody").is(".dark")
+                      ? partten.getColor(this.color)
+                      : "rgb(57, 54, 143)",
+                    fontSize: 12,
+                    fontWeight: "bold",
+                    position: "center",
+                    show: true,
+                  },
+                },
+                labelLine: {
+                  show: false,
+                },
+              },
+            ],
+          },
+          {
+            name: "内部阴影",
+            type: "gauge",
+            radius: "50%",
+            splitNumber: 10,
+            axisLine: {
+              lineStyle: {
+                color: [
+                  // [
+                  //   1,
+                  //   new echarts.graphic.LinearGradient(0, 1, 0, 0, [
+                  //     {
+                  //       offset: 0,
+                  //       color: "rgba(45,230,150,0)",
+                  //     },
+                  //     {
+                  //       offset: 0.5,
+                  //       color: "rgba(45,230,150,0.2)",
+                  //     },
+                  //     {
+                  //       offset: 1,
+                  //       color: "rgba(45,230,150,1)",
+                  //     },
+                  //   ]),
+                  // ],
+                  [
+                    1,
+                    this.color == "green"
+                      ? "rgba(45,230,150,0.1)"
+                      : "rgba(255, 131, 0, 0.1)",
+                  ],
+                  // [1, "rgba(45,230,150,0)"],
+                ],
+                width: 3,
+              },
+            },
+            axisLabel: {
+              show: false,
+            },
+            axisTick: {
+              show: false,
+            },
+            splitLine: {
+              show: false,
+            },
+            itemStyle: {
+              show: false,
+            },
+          },
+          // 光环
+          {
+            type: "pie",
+            radius: "45%",
+            center: ["50%", "50%"],
+            animationType: "scale",
+            animation: false,
+            label: {
+              show: false,
+            },
+            labelLine: {
+              show: false,
+            },
+            emphasis: {
+              scale: false,
+            },
+            data: [
+              {
+                value: 1,
+                itemStyle: {
+                  color: "transparent",
+                  borderColor: $("#appBody").is(".dark")
+                    ? partten.getColor(this.color)
+                    : "rgb(57, 54, 143)",
+                  opacity: 0.3,
+                  shadowColor: $("#appBody").is(".dark")
+                    ? partten.getColor(this.color)
+                    : "rgb(57, 54, 143)",
+                  shadowBlur: 20,
+                },
+              },
+            ],
+          },
+        ],
+      };
+
+      chart.clear();
+      chart.setOption(option);
+
+      this.resize = function () {
+        chart.resize();
+      };
+
+      window.removeEventListener("resize", this.resize);
+      window.addEventListener("resize", this.resize);
+    },
+  },
+  created() {
+    this.id = "pie-chart-" + util.newGUID();
+  },
+  mounted() {
+    this.$el.style.width = this.width;
+    this.$el.style.height = this.height;
+    this.initChart();
+  },
+  updated() {
+    this.initChart();
+  },
+  unmounted() {
+    window.removeEventListener("resize", this.resize);
+  },
+
+  watch: {
+    "$store.state.themeName"() {
+      this.initChart();
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.chart {
+  width: 100%;
+  height: 100%;
+  display: block;
+  margin: auto;
+}
+</style>

+ 157 - 0
src/views/Home/components/home/gjzb-pie-chart.vue

@@ -0,0 +1,157 @@
+<template>
+  <!-- 功率复核 PowerLoad -->
+  <div
+    v-for="item in PowerLoad"
+    :key="item"
+    style="width: 30%; height: 100%"
+    class="power-item"
+  >
+    <dash-pie-chart
+      :title="item.title"
+      :unit="item.unit"
+      :value="item.value"
+      :max="item.max"
+      height="100%"
+      width="100%"
+      :color="type == 0 || type == -1 ? 'green' : 'orange'"
+      @click="openDialog(item.dialogTitle, item.unit)"
+    />
+  </div>
+</template>
+
+<script>
+import Col from "@/components/coms/grid/col.vue";
+// import Row from "../../../components/coms/grid/row.vue";
+import DashPieChart from "@/views/Home/components/home/dash-pie-chart.vue";
+import { FindGroupRealtime } from "@/api/home/home.js";
+import dayjs from "dayjs";
+export default {
+  components: {
+    // Row,
+    Col,
+    DashPieChart,
+  },
+
+  data() {
+    return {
+      // 功率复核数据
+      PowerLoad: [],
+      valuelist: [
+        {
+          value: "SSZGL",
+          name: "清洁能源实时功率详情",
+          code: "value1",
+          sign: 1,
+        },
+        {
+          value: "SSZGL",
+          name: "风电实时功率详情",
+          code: "value2",
+          sign: 1,
+        },
+        {
+          value: "SSZGL",
+          name: "光伏实时功率详情",
+          code: "value3",
+          sign: 1,
+        },
+        {
+          value: "SSPJFS",
+          name: "实时风速",
+          code: "value4",
+        },
+        {
+          value: "RPJGZD",
+          name: "光照强度",
+          code: "value6",
+        },
+        {
+          value: "SSZGL",
+          name: "实际功率",
+          code: "value1",
+        },
+        {
+          value: "FNLYL",
+          name: "风能利用率",
+          code: "value7",
+        },
+        {
+          value: "FNLYL",
+          name: "光能利用率",
+          code: "value7",
+        },
+      ],
+      wpId: "",
+    };
+  },
+
+  props: {
+    type: {
+      type: Number,
+      default: 0,
+    },
+    data: {
+      type: Array,
+      default: () => [],
+    },
+    id: {
+      type: String,
+      defaylt: "",
+    },
+  },
+
+  mounted() {
+    this.PowerLoad = this.data;
+    this.wpId = this.id;
+  },
+
+  methods: {
+    openDialog(dialogTitle, unit) {
+      let obj = this.valuelist.find((item) => item.name == dialogTitle);
+      let params = {
+        wpId: this.wpId,
+        uniformCode: obj.value,
+      };
+
+      FindGroupRealtime(params).then(({ data }) => {
+        this.$emit("chartClick", {
+          dialogTitle,
+          //   dialogType,
+          data: data.map((item) => {
+            return {
+              dateTime: dayjs(item.time).format("MM-DD HH:mm"),
+              value: item[obj.code],
+            };
+          }),
+          chartName: obj.sign ? "实际功率" : obj.dialogTitle,
+          unit,
+        });
+      });
+    },
+  },
+
+  watch: {
+    data(res) {
+      this.PowerLoad = res;
+    },
+    id(res) {
+      this.wpId = res;
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.power-item {
+  flex: 1;
+}
+.power-item + .power-item {
+  margin-left: 0.3vw; //10px
+}
+.power-review {
+  padding: 15px 10px 10px 10px;
+}
+.col + .col {
+  margin-left: 0px;
+}
+</style>

File diff suppressed because it is too large
+ 2115 - 0
src/views/Home/components/home/index.vue


File diff suppressed because it is too large
+ 4577 - 0
src/views/Home/components/home/svg-map-nx.vue


+ 37 - 0
src/views/Home/index1.vue

@@ -0,0 +1,37 @@
+<template>
+  <div class="home-wrapper">
+    <!-- 头部 -->
+    <HeaderD @changeShowSisView="changeShowSisView" />
+    <dapingHome />
+  </div>
+</template>
+
+<script>
+import HeaderD from "@/views/layout/HeaderD.vue";
+import dapingHome from "./components/home/index.vue";
+
+export default {
+  name: "Home",
+  data() {
+    return {};
+  },
+  components: {
+    dapingHome,
+    HeaderD,
+  },
+  methods: {
+    changeShowSisView(val) {
+      this.$emit("changeShowSisView", val);
+    },
+  },
+};
+</script>
+
+<style lang="less" scoped>
+.home-wrapper {
+  height: 100%;
+  width: 100%;
+  background: url("~@/assets/map/homeBackground.png") no-repeat;
+  background-size: 100% 100%;
+}
+</style>

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

@@ -38,18 +38,7 @@
           </template>
         </el-dropdown>
       </li>
-      <li class="header-menu-user-title">
-        <el-tooltip
-          effect="dark"
-          content="后台管理系统"
-          placement="bottom"
-          popper-class="admin-set-tooltip"
-        >
-          <i class="svg-icon svg-icon-white" @click="goToAdmin">
-            <SvgIcon svgid="svg-admin-set"></SvgIcon>
-          </i>
-        </el-tooltip>
-      </li>
+      <li class="header-menu-user-title"></li>
     </ul>
   </div>
 </template>
@@ -227,6 +216,17 @@ export default {
         )}&jiami=${jiami}`;
         window.open(url);
         return;
+      } else if (data.id === "home") {
+        this.$emit("changeShowSisView", true);
+        this.activeIndex = index;
+        this.$router.push(data.path);
+        const ActiveModule = this.currMenu.find((ele) => {
+          return ele.path === data.path;
+        });
+        if (ActiveModule) {
+          this.$store.dispatch("changeModuleName", ActiveModule.text);
+        }
+        return;
       }
       this.activeIndex = index;
       this.$router.push(data.path);
@@ -365,7 +365,6 @@ export default {
 
       i {
         margin: 0 5px;
-
         font-size: 16px;
       }
       .el-dropdown-link {

+ 355 - 0
src/views/layout/HeaderD.vue

@@ -0,0 +1,355 @@
+<template>
+  <div class="header-wrapper">
+    <div class="home-title">
+      <img src="@/assets/map/header-title.png" alt="" />
+    </div>
+    <div class="home-menu">
+      <div class="menus">
+        <div
+          class="menu-item"
+          v-for="(menu, index) of currMenu"
+          :key="menu"
+          @click="click(index, menu)"
+          :class="{ active: activeIndex == index }"
+        >
+          {{ menu.text }}
+        </div>
+      </div>
+      <div class="settings">
+        <el-dropdown
+          size="small"
+          trigger="click"
+          :hide-on-click="true"
+          popper-class="dropdown"
+          @command="handleCommand"
+        >
+          <span class="el-dropdown-link">
+            <i class="fa fa-user"></i>{{ userName }}
+          </span>
+          <template #dropdown>
+            <el-dropdown-menu>
+              <el-dropdown-item command="logout"> 退出登录 </el-dropdown-item>
+            </el-dropdown-menu>
+          </template>
+        </el-dropdown>
+        <el-tooltip
+          effect="dark"
+          content="后台管理系统"
+          placement="bottom"
+          popper-class="admin-set-tooltip"
+        >
+          <i class="svg-icon svg-icon-white svg-icon-sm" @click="goToAdmin">
+            <SvgIcon svgid="svg-admin-set"></SvgIcon>
+          </i>
+        </el-tooltip>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+import $ from "jquery";
+import { getCookie } from "@/utills/auth";
+import tools from "../../tools/encryption.js";
+import { logout } from "@/api/common.js";
+import { encrypt, decrypt } from "@/utills/jsencrypt.js";
+import SvgIcon from "@/components/coms/icon/svg-icon.vue";
+export default {
+  data() {
+    return {
+      themeName: false,
+      menus: [
+        {
+          id: "home",
+          text: "首页",
+          path: "/home",
+          isActive: true,
+        },
+        {
+          id: "stateMonitor",
+          text: "监视中心",
+          path: "/stateMonitor",
+          isActive: true,
+        },
+        {
+          id: "economicsOperation",
+          text: "经济运行",
+          path: "/economicsOperation",
+          isActive: false,
+        },
+        {
+          id: "health",
+          text: "智慧检修",
+          // path: '/sandtable',
+          path: "/health",
+          isActive: false,
+        },
+        // {
+        //   id: "decision",
+        //   text: "决策支持",
+        //   path: "/decision/decision1",
+        //   isActive: false,
+        // },
+        // {
+        //   id: "save",
+        //   text: "安全管控",
+        //   path: "/save",
+        //   isActive: false,
+        // },
+        // {
+        //   id: "znbb",
+        //   text: "智能报表",
+        //   path: "/znbb/reportPandect",
+        //   isActive: false,
+        // },
+        // {
+        //   id: "zhbj",
+        //   text: "综合报警",
+        //   path: "",
+        // },
+        // {
+        //   id: "fdnlpt",
+        //   text: "发电能力分析",
+        //   path: "",
+        // },
+        {
+          id: "others",
+          text: "智能报表",
+          path: "/others",
+          isActive: false,
+        },
+      ],
+      activeIndex: 0,
+      menuUrl: "",
+    };
+  },
+  components: { SvgIcon },
+  mounted() {},
+  computed: {
+    userName() {
+      return getCookie("username") || this.$store.state.user.username;
+    },
+    // activeClass(data) {
+    //   return data.isActive ? "active" : "";
+    // },
+    currMenu() {
+      let stateRoutes = this.$store.state.routes.routes;
+      let currMenu = [];
+      if (stateRoutes.length) {
+        stateRoutes.forEach((route) => {
+          if (route.path !== "/login") {
+            currMenu.push({
+              id: route.name,
+              text: route.meta.title,
+              path: route.path,
+              isActive: false,
+            });
+          }
+        });
+        currMenu.splice(2, 0, {
+          id: "zhbj",
+          text: "综合报警",
+          path: "",
+        });
+        currMenu.splice(5, 0, {
+          id: "fdfx",
+          text: "发电能力分析",
+          path: "",
+        });
+        // currMenu.push();
+        return currMenu;
+      } else {
+        return [];
+      }
+    },
+  },
+  methods: {
+    click(index, data) {
+      if (data.id === "zhbj") {
+        let jiami = encrypt(getCookie("jiami")).replace(/\+/g, " ");
+
+        // let url = `http://192.168.1.117:3002/#/check?username=${getCookie(
+        //   "username"
+        // )}&jiami=${jiami}`;
+        let url = `http://10.81.3.154:8083/#/check?username=${getCookie(
+          "username"
+        )}&jiami=${jiami}`;
+        window.open(url);
+        return;
+      } else if (data.id === "fdfx") {
+        let jiami = encrypt(getCookie("jiami")).replace(/\+/g, " ");
+
+        // let url = `http://192.168.1.117:3002/#/check?username=${getCookie(
+        //   "username"
+        // )}&jiami=${jiami}`;
+        let url = `http://10.81.3.155:8083/dlfx/#/check?username=${getCookie(
+          "username"
+        )}&jiami=${jiami}`;
+        window.open(url);
+        return;
+      } else if (data.id === "stateMonitor") {
+        this.$emit("changeShowSisView", false);
+        this.menuUrl = "/stateMonitor/factoryMonitor/windPowerPlant/windhome";
+      } else if (data.id === "economicsOperation") {
+        this.$emit("changeShowSisView", false);
+        this.menuUrl =
+          "/economicsOperation/benchmarkingManagement/performanceRankingList";
+      } else if (data.id === "health") {
+        this.$emit("changeShowSisView", false);
+        this.menuUrl = "/health/healthManagement/first";
+      }
+      this.activeIndex = index;
+      this.$router.push(this.menuUrl);
+      const ActiveModule = this.currMenu.find((ele) => {
+        return ele.path === data.path;
+      });
+      if (ActiveModule) {
+        this.$store.dispatch("changeModuleName", ActiveModule.text);
+      }
+    },
+    clickSubMenu(index, code) {},
+    clickMenu() {
+      this.dropdown = !this.dropdown;
+    },
+    changeTheme() {
+      $("#appBody").toggleClass("dark light");
+      this.$store.dispatch("changeTheme", $("#appBody").attr("class"));
+      this.$store.state.themeName === "dark"
+        ? (this.themeName = false)
+        : (this.themeName = true);
+      localStorage.setItem("themeName", this.$store.state.themeName);
+    },
+    handleCommand(command) {
+      if (command == "logout") {
+        logout({
+          token: getCookie("authToken"),
+          userId: getCookie("userId"),
+        }).then((res) => {
+          this.$store.commit("user/REMOVE_TOKEN");
+          this.$router.push("/login");
+        });
+      }
+    },
+    // 跳转到管理系统
+    goToAdmin() {
+      let jiami = encrypt(getCookie("jiami")).replace(/\+/g, " ");
+
+      // let url = `http://192.168.1.104:80/#/check?username=${getCookie(
+      let url = `http://10.81.3.127:8083/#/check?username=${getCookie(
+        "username"
+      )}&jiami=${jiami}`;
+      window.open(url);
+    },
+  },
+
+  watch: {
+    $route: {
+      handler: function (val, oldVal) {
+        if (this.currMenu.length) {
+          this.currMenu.some((t, index) => {
+            if (val.path.includes(t.id)) {
+              this.activeIndex = index;
+              const ActiveModule = this.currMenu.find((ele) => {
+                return ele.path === t.path;
+              });
+              if (ActiveModule) {
+                this.$store.dispatch("changeModuleName", ActiveModule.text);
+              }
+            }
+          });
+        }
+      },
+      //深度观察监听
+      deep: true,
+    },
+  },
+};
+</script>
+<style lang="less" scoped>
+.header-wrapper {
+  height: 4.17vh; //45px
+  width: 100%;
+  padding-left: 0.91vw; //30px
+  padding-right: 0.91vw; //30px
+  display: flex;
+  align-items: center;
+  border-bottom: 0.09vh solid #142b29;
+  justify-content: space-between;
+  .home-title {
+    width: 30%;
+    display: flex;
+    align-items: center;
+    img {
+      width: 100%;
+      height: 100%;
+    }
+  }
+  .home-menu {
+    height: 100%;
+    font-size: 1.48vh; //16px
+    display: flex;
+    .menus {
+      display: flex;
+      height: 100%;
+      .menu-item {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        padding: 0 0.82vw; //27px
+        height: 100%;
+        color: @font-color;
+        cursor: pointer;
+        transition: color 0.2s ease-in-out;
+
+        &.active {
+          color: @green;
+          position: relative;
+          background: @greenLinearTop;
+          transition: color 0.2s ease-in-out;
+
+          &::after {
+            content: "";
+            position: absolute;
+            width: 100%;
+            height: 0.19vh; //2px
+            background: @green;
+            left: 0;
+            bottom: 0;
+            box-sizing: border-box;
+          }
+        }
+      }
+    }
+    .settings::v-deep {
+      display: flex;
+      height: 100%;
+      align-items: center;
+      .el-dropdown {
+        color: #05bb4c !important;
+        font-size: 1.48vh !important; //16px
+        margin-right: 0.3vw;
+        .el-dropdown-link {
+          .fa {
+            margin-right: 0.15vw;
+          }
+        }
+      }
+    }
+  }
+}
+.dropdown {
+  .el-dropdown-menu {
+    background: #111d1c;
+    border-radius: 0.46vh;
+    .el-dropdown-menu__item {
+      color: #dfeef1;
+      font-size: 1.48vh !important; //16px
+      &:hover {
+        color: #05bb4c;
+      }
+    }
+  }
+}
+.admin-set-tooltip {
+  font-size: 0.43vw !important;
+}
+</style>