|
@@ -74,7 +74,7 @@ import moon_W from "@/assets/images/headerCom/moon_W.png";
|
|
|
import headerMenuImg from "@/assets/images/headerCom/headerMenu.png";
|
|
|
import { Sunny, Moon } from "@element-plus/icons-vue";
|
|
|
import { apiGetpersonalInformation } from "@/api/api";
|
|
|
-import { removeToken } from "@/utils/auth";
|
|
|
+import { removeToken, removeUserKey, getUserKey } from "../utils/auth";
|
|
|
export default {
|
|
|
name: "headerCom",
|
|
|
data() {
|
|
@@ -92,7 +92,34 @@ export default {
|
|
|
leftIndex: "1",
|
|
|
currentTime: "",
|
|
|
showRole: true,
|
|
|
- menuData: [],
|
|
|
+ menuData: [
|
|
|
+ {
|
|
|
+ index: "/home",
|
|
|
+ icon: "Menu",
|
|
|
+ name: "首页",
|
|
|
+ showBac: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ index: "/generatingCap/dataFilter/prepare",
|
|
|
+ icon: "Histogram",
|
|
|
+ name: "发电能力分析",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ index: "/integratedAlarm/realwarning",
|
|
|
+ icon: "Histogram",
|
|
|
+ name: "综合报警",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ index: "/intelligentReport/gkjlb?name=xinzhuang",
|
|
|
+ icon: "PictureFilled",
|
|
|
+ name: "智能报表",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ index: "/powerPrediction/index",
|
|
|
+ icon: "TrendCharts",
|
|
|
+ name: "功率预测",
|
|
|
+ },
|
|
|
+ ],
|
|
|
rainW: false,
|
|
|
userName: "",
|
|
|
switchTheme: false,
|
|
@@ -101,34 +128,33 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.headerReportUrl = this.baseReportUrl;
|
|
|
- this.menuData = [
|
|
|
- {
|
|
|
- index: "/home",
|
|
|
- icon: "Menu",
|
|
|
- name: "首页",
|
|
|
- showBac: true,
|
|
|
- },
|
|
|
- {
|
|
|
- index: "/generatingCap/dataFilter/prepare",
|
|
|
- icon: "Histogram",
|
|
|
- name: "发电能力分析",
|
|
|
- },
|
|
|
- {
|
|
|
- index: "/integratedAlarm/realwarning",
|
|
|
- icon: "Histogram",
|
|
|
- name: "综合报警",
|
|
|
- },
|
|
|
- {
|
|
|
- index: "/intelligentReport/gkjlb?name=xinzhuang",
|
|
|
- icon: "PictureFilled",
|
|
|
- name: "智能报表",
|
|
|
- },
|
|
|
- {
|
|
|
- index: "/powerPrediction/index",
|
|
|
- icon: "TrendCharts",
|
|
|
- name: "功率预测",
|
|
|
- },
|
|
|
- ];
|
|
|
+ console.log("userkey==>>>", this.$store.state.userKey)
|
|
|
+ const userKey = getUserKey()
|
|
|
+ this.$store.commit("changeUserkey", userKey);
|
|
|
+ let menuData = []
|
|
|
+ if (userKey === "zz") {
|
|
|
+ menuData = [
|
|
|
+ {
|
|
|
+ index: "/home",
|
|
|
+ icon: "Menu",
|
|
|
+ name: "首页",
|
|
|
+ showBac: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ index: "/intelligentReport/gkjlb?name=xinzhuang",
|
|
|
+ icon: "PictureFilled",
|
|
|
+ name: "智能报表",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ index: "/powerPrediction/index",
|
|
|
+ icon: "TrendCharts",
|
|
|
+ name: "功率预测",
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ } else {
|
|
|
+ menuData = this.menuData
|
|
|
+ }
|
|
|
+ this.menuData = menuData
|
|
|
},
|
|
|
mounted() {
|
|
|
let that = this;
|
|
@@ -238,6 +264,8 @@ export default {
|
|
|
// },
|
|
|
backLogin() {
|
|
|
window.sessionStorage.clear();
|
|
|
+ removeToken();
|
|
|
+ removeUserKey();
|
|
|
// this.getThemeClass(true);
|
|
|
// this.$emit("swichFn", true);
|
|
|
this.$router.push({
|