From e0a31f7013898540948f4d4d86ade1a5414b44d4 Mon Sep 17 00:00:00 2001
From: pengwei <2071057782@qq.com>
Date: 星期四, 20 三月 2025 17:32:42 +0800
Subject: [PATCH] 优化数据大屏页面

---
 项目代码/client/src/layout/index.vue |  113 +++++++++++++++++++++++++++++++-------------------------
 1 files changed, 62 insertions(+), 51 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/client/src/layout/index.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/client/src/layout/index.vue"
index ce51688..f5a744c 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/client/src/layout/index.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/client/src/layout/index.vue"
@@ -79,12 +79,12 @@
             >
               <div>
                 <span style="color: rgb(255, 255, 255); font-size: 0.88rem"
-                  >瑙掕壊锛氳秴绾х鐞嗗憳</span
+                  >瑙掕壊锛歿{ acountInfo.roleName }}</span
                 >
               </div>
               <div style="margin-left: 2rem">
                 <span style="color: rgb(255, 255, 255); font-size: 0.88rem"
-                  >濮撳悕锛氳秴绾х鐞嗗憳</span
+                  >濮撳悕锛歿{ acountInfo.userTrueName }}</span
                 >
               </div>
               <img
@@ -179,15 +179,14 @@
 @import "./index.less";
 </style>
 <script>
-import { getTreeMenu } from "@/api/menu.js";
+// import { getTreeMenu } from "@/api/menu.js";
 import { baseUrl } from "../utils";
-
-import loading from "@/components/basic/RouterLoading";
-import VolMenu from "@/components/basic/VolElementMenu.vue";
+import loading from "../components/basic/RouterLoading.vue";
+// import VolMenu from "@/components/basic/VolElementMenu.vue";
 import Message from "@/views/index/Message.vue";
-import MessageConfig from "@/views/index/MessageConfig.js";
+// import MessageConfig from "@/views/index/MessageConfig.js";
 
-var imgUrl = require("@/assets/imgs/wms_x.png");
+var imgUrl = new URL("../assets/imgs/wms_x.png", import.meta.url).href;
 var $this;
 var $interval;
 var $indexDate;
@@ -202,9 +201,11 @@
 import { useRouter, useRoute } from "vue-router";
 import store from "../store/index";
 import http from "@/../src/api/http.js";
+import { GetUserInfo } from "@/api/user";
+
 export default defineComponent({
   components: {
-    VolMenu,
+    // VolMenu,
     loading,
     Message,
   },
@@ -256,7 +257,9 @@
       },
     ]);
     const errorImg = ref(
-      'this.src="' + require("@/assets/imgs/error-img.png") + '"'
+      'this.src="' +
+        new URL("../assets/imgs/error-img.png", import.meta.url).href +
+        '"'
     );
     const selectId = ref("1");
     // 銆愰椤点�戞爣绛惧簭鍙�(褰撳墠鍙抽敭閫変腑鐨勮彍鍗�)
@@ -556,53 +559,60 @@
         }
       }
       Object.assign(_config.$tabs, { open: open, close: close });
+      getUser();
 
       //鍒濆鍖栬彍鍗�
-      getTreeMenu().then((res) => {
-        console.log("meanu", res);
-        res.push({ id: "1", name: "棣栭〉", url: "/home" }); // 涓轰簡鑾峰彇閫変腑id浣跨敤
-        res.forEach((d) => {
-          d.path = (d.url || "").replace("/Manager", "");
-          d.to = (d.url || "").replace("/Manager", "");
-          if (!d.icon || d.icon.substring(0, 3) != "el-") {
-            d.icon = "el-icon-menu";
-          }
-        });
+      // getTreeMenu().then((res) => {
+      //   console.log("meanu", res);
+      //   res.push({ id: "1", name: "棣栭〉", url: "/home" }); // 涓轰簡鑾峰彇閫変腑id浣跨敤
+      //   res.forEach((d) => {
+      //     d.path = (d.url || "").replace("/Manager", "");
+      //     d.to = (d.url || "").replace("/Manager", "");
+      //     if (!d.icon || d.icon.substring(0, 3) != "el-") {
+      //       d.icon = "el-icon-menu";
+      //     }
+      //   });
 
-        store.dispatch("setPermission", res);
+      //   store.dispatch("setPermission", res);
 
-        console.log("鏉冮檺", store.state);
-        menuOptions.value = res;
-        permissionInited.value = true;
+      //   console.log("鏉冮檺", store.state);
+      //   menuOptions.value = res;
+      //   permissionInited.value = true;
 
-        //寮�鍚秷鎭帹閫侊紙main.js涓缃槸鍚﹀紑鍚痵ignalR锛�2022.05.05
-        if (_config.$global.signalR) {
-          MessageConfig(http, (result) => {
-            messageList.unshift(result);
-            //    console.log(result)
-          });
-        }
+      //   //寮�鍚秷鎭帹閫侊紙main.js涓缃槸鍚﹀紑鍚痵ignalR锛�2022.05.05
+      //   if (_config.$global.signalR) {
+      //     MessageConfig(http, (result) => {
+      //       messageList.unshift(result);
+      //       //    console.log(result)
+      //     });
+      //   }
 
-        //褰撳墠鍒锋柊鏄笉鏄椤�
-        if (router.currentRoute.value.path != navigation[0].path) {
-          //鏌ユ壘绯荤粺鑿滃崟
-          let item = menuOptions.value.find((x) => {
-            return x.path == router.currentRoute.value.path; //this.$route.path;
-          });
-          if (item) return onSelect(item.id);
-          //鏌ユ壘椤堕儴蹇嵎杩炴帴
-          item = links.value.find((x) => {
-            return x.path == router.currentRoute.value.path; //this.$route.path;
-          });
-          //鏌ユ壘鏈�鍚庝竴娆¤烦杞殑椤甸潰
-          if (!item) {
-            item = getItem();
-          }
-          if (item) {
-            return open(item, false);
-          }
-        }
-        selectId.value = "1";
+      //   //褰撳墠鍒锋柊鏄笉鏄椤�
+      //   if (router.currentRoute.value.path != navigation[0].path) {
+      //     //鏌ユ壘绯荤粺鑿滃崟
+      //     let item = menuOptions.value.find((x) => {
+      //       return x.path == router.currentRoute.value.path; //this.$route.path;
+      //     });
+      //     if (item) return onSelect(item.id);
+      //     //鏌ユ壘椤堕儴蹇嵎杩炴帴
+      //     item = links.value.find((x) => {
+      //       return x.path == router.currentRoute.value.path; //this.$route.path;
+      //     });
+      //     //鏌ユ壘鏈�鍚庝竴娆¤烦杞殑椤甸潰
+      //     if (!item) {
+      //       item = getItem();
+      //     }
+      //     if (item) {
+      //       return open(item, false);
+      //     }
+      //   }
+      //   selectId.value = "1";
+      // });
+    };
+    const acountInfo = ref({});
+    const getUser = () => {
+      GetUserInfo({}).then((res) => {
+        acountInfo.value = res.data;
       });
     };
     created();
@@ -639,6 +649,7 @@
       closeTabs,
       currentMenuId,
       router,
+      acountInfo,
     };
   },
   /**

--
Gitblit v1.9.3