From d78dad29ee493b68dd6ac2e34df08431685c3734 Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期三, 03 九月 2025 17:47:27 +0800
Subject: [PATCH] 设备管理首页按照需求进行样式开发

---
 src/views/dashboard/Analysis.vue |   72 +++++++++++++++++++++++------------
 1 files changed, 47 insertions(+), 25 deletions(-)

diff --git a/src/views/dashboard/Analysis.vue b/src/views/dashboard/Analysis.vue
index 156fa95..da42538 100644
--- a/src/views/dashboard/Analysis.vue
+++ b/src/views/dashboard/Analysis.vue
@@ -1,18 +1,27 @@
 <template>
-  <Component :is="currentSignage" :userType="userType" :productionCode="productionCode"
+  <Component :is="currentSignage"
+             :userType="userType"
+             :productionCode="productionCode"
              :workshopSectionProductionCode="workshopSectionProductionCode"
-             >
+             v-if="userType&&userType!==0">
   </Component>
+  <div v-else-if="userType===0">  <!-- 涓庣粍浠舵覆鏌撲簰鏂� -->
+    <img src="@/assets/index.png" style="width: 100%;height: 785px">
+  </div>
 </template>
 
 <script>
   import signageApi from '@/api/signage'
+  import MdcManagerSignage from './mdcIndex/MdcManagerSignage.vue'
   import DncManagerSignage from './dncIndex/DncManagerSignage.vue'
+  import EamManagerSignage from './eamIndex/EamManagerSignage.vue'
 
   export default {
-    name: "Analysis",
+    name: 'Analysis',
     components: {
-      DncManagerSignage
+      MdcManagerSignage,
+      DncManagerSignage,
+      EamManagerSignage
     },
     data() {
       return {
@@ -28,32 +37,45 @@
     },
     methods: {
       showModuleByUserInfo() {
-        const id = JSON.parse(localStorage.getItem('pro__Login_Userinfo')).value.id
+        // 瀹夊叏澶勭悊锛氬厛鍒ゆ柇localStorage涓槸鍚﹀瓨鍦ㄧ敤鎴蜂俊鎭紝閬垮厤JSON.parse鎶ラ敊
+        const userInfoStr = localStorage.getItem('pro__Login_Userinfo')
+        if (!userInfoStr) {
+          this.currentSignage = '' // 鏃犵敤鎴蜂俊鎭椂涓嶆覆鏌撶粍浠�
+          return
+        }
+
+        const id = JSON.parse(userInfoStr).value.id
         signageApi.getUserByIdApi(id)
           .then(res => {
-            console.log("res", res.userType)
-            this.userType = res.userType
+            this.userType = res.userType // 璧嬪�煎悗鑷姩瑙﹀彂鏉′欢娓叉煋鍒ゆ柇
+            // 鏍规嵁userType鍖归厤瀵瑰簲缁勪欢锛堟仮澶峜ase1鍜宑ase4鐨勯�昏緫锛�
             switch (this.userType) {
               // case 1:
               //   //鍒�鍏风鐞�
               //   this.currentSignage = 'EquipmentSignage'
               //   break
-              // case 2:
-              //   //mdc
-              //   this.currentSignage = 'WorkshopSectionSignage'
-              //   break
+              case 2:
+                // mdc
+                this.currentSignage = 'MdcManagerSignage'
+                break
               case 3:
                 //dnc
                 this.currentSignage = 'DncManagerSignage'
                 break
-              // case 4:
-              //   //璁惧绠$悊
-              //   this.currentSignage = 'IndexSignage'
-              //   break
+              case 4:
+                //璁惧绠$悊
+                this.currentSignage = 'EamManagerSignage'
+                break
               default:
                 this.currentSignage = ''
                 break
             }
+          })
+          .catch(err => {
+            // 鎺ュ彛璇锋眰澶辫触鏃讹紝榛樿鏄剧ず鍥剧墖
+            console.error('鑾峰彇鐢ㄦ埛绫诲瀷澶辫触锛�', err)
+            this.userType = ''
+            this.currentSignage = ''
           })
       }
     }
@@ -62,14 +84,14 @@
 
 </script>
 <style lang="less" scoped>
-/deep/ .back-nav {
-  width: 100px;
-  height: 30px;
-  color: #fff;
-  position: absolute;
-  top: 15px;
-  left: 10px;
-  cursor: pointer;
-  z-index: 9999
-}
+  /deep/ .back-nav {
+    width: 100px;
+    height: 30px;
+    color: #fff;
+    position: absolute;
+    top: 15px;
+    left: 10px;
+    cursor: pointer;
+    z-index: 9999
+  }
 </style>
\ No newline at end of file

--
Gitblit v1.9.3