From 5636ee8eb5d1108668d0abf1e425268bde14922d Mon Sep 17 00:00:00 2001
From: hyingbo <1363390067@qq.com>
Date: 星期一, 01 九月 2025 18:01:02 +0800
Subject: [PATCH] mdc首页开发

---
 src/views/dashboard/Analysis.vue |   83 ++++++++++++++++++++++++++++++++++++++---
 1 files changed, 77 insertions(+), 6 deletions(-)

diff --git a/src/views/dashboard/Analysis.vue b/src/views/dashboard/Analysis.vue
index 1503277..f3a16fb 100644
--- a/src/views/dashboard/Analysis.vue
+++ b/src/views/dashboard/Analysis.vue
@@ -1,25 +1,96 @@
 <template>
-  <div>
-
+  <Component :is="currentSignage"
+             :userType="userType"
+             :productionCode="productionCode"
+             :workshopSectionProductionCode="workshopSectionProductionCode"
+             v-if="[1,2,3,4].includes(userType)"
+             >
+  </Component>
+  <div v-else>  <!-- 涓庣粍浠舵覆鏌撲簰鏂� -->
+    <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'
+
   export default {
     name: "Analysis",
     components: {
-
+      MdcManagerSignage,
+      DncManagerSignage
     },
     data() {
       return {
-
+        currentSignage: '',
+        productionCode: '',
+        branchFactoryProductionCode: '',
+        workshopSectionProductionCode: '',
+        userType: '',
       }
     },
     created() {
-
+      this.showModuleByUserInfo()
     },
     methods: {
+      showModuleByUserInfo() {
+        // 瀹夊叏澶勭悊锛氬厛鍒ゆ柇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 => {
+            this.userType = res.userType // 璧嬪�煎悗鑷姩瑙﹀彂鏉′欢娓叉煋鍒ゆ柇
+            // 鏍规嵁userType鍖归厤瀵瑰簲缁勪欢锛堟仮澶峜ase1鍜宑ase4鐨勯�昏緫锛�
+            switch (this.userType) {
+              // case 1:
+              //   //鍒�鍏风鐞�
+              //   this.currentSignage = 'EquipmentSignage'
+              //   break
+              case 2:
+                // mdc
+                this.currentSignage = 'MdcManagerSignage'
+                break
+              case 3:
+                //dnc
+                this.currentSignage = 'DncManagerSignage'
+                break
+              // case 4:
+              //   //璁惧绠$悊
+              //   this.currentSignage = 'IndexSignage'
+              //   break
+              default:
+                this.currentSignage = ''
+                break
+            }
+          })
+          .catch(err => {
+            // 鎺ュ彛璇锋眰澶辫触鏃讹紝榛樿鏄剧ず鍥剧墖
+            console.error('鑾峰彇鐢ㄦ埛绫诲瀷澶辫触锛�', err)
+            this.userType = ''
+            this.currentSignage = ''
+          })
+      }
     }
   }
-</script>
\ No newline at end of file
+
+
+</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
+}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3