From c7f3fd5215399b37d0511b3bd555150ff1b13507 Mon Sep 17 00:00:00 2001
From: charles <981744753@qq.com>
Date: 星期一, 29 四月 2024 10:39:30 +0800
Subject: [PATCH] fix:回退原先版本

---
 src/views/dashboard/index.vue |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue
index 8420dff..c301129 100644
--- a/src/views/dashboard/index.vue
+++ b/src/views/dashboard/index.vue
@@ -45,11 +45,11 @@
         </el-tab-pane>
         <el-tab-pane label="鐗╂枡娓呭崟" name="鐗╂枡娓呭崟">
           <InputMaterialsList
-            :material-list="activeTask?.Procedure.procedure.inputMaterials"
+            :material-list="activeTask?.Procedure?.procedure?.inputMaterials"
             @detail-click="showMaterialDetailModal"
           ></InputMaterialsList>
           <OutputMaterialsList
-            :material-list="activeTask?.Procedure.procedure.outputMaterials"
+            :material-list="activeTask?.Procedure?.procedure?.outputMaterials"
             @detail-click="showMaterialDetailModal"
           ></OutputMaterialsList>
         </el-tab-pane>
@@ -77,8 +77,8 @@
     <template #rightBlock2>
       <DeviceStatusInfo :type="1"></DeviceStatusInfo>
       <DeviceStatusInfo :device="deviceStore.deviceInfo" :type="2"></DeviceStatusInfo>
-      <DeviceNumberInfo></DeviceNumberInfo>
-    </template>
+      <DeviceNumberInfo></DeviceNumberInfo> </template
+    >褰撳墠浠诲姟:
     <template #rightBlock3>
       <SubTitle>鐭ヨ瘑搴�</SubTitle>
       <div class="task-detail-right-3">
@@ -131,6 +131,8 @@
 import { updateCraftParams } from '@/api'
 import { Loading } from '@element-plus/icons-vue'
 import { isNumber } from 'lodash-es'
+import { getToken } from '@/common/utils/index'
+const token = getToken()
 
 defineOptions({
   name: 'DashboardView'
@@ -172,9 +174,10 @@
  * @param task
  */
 function reloadChannel(task: Task) {
-  tasksStore.reloadChannel(task.Channel).then(() => {
-    // plcStore.startPollingPLC()
-  })
+  if (token !== null || token !== '' || token !== 'undefined') {
+    tasksStore.reloadChannel(task.Channel)
+    location.reload()
+  }
 }
 
 function reloadAllData() {
@@ -187,6 +190,8 @@
 // 鍚姩 璁惧 杞
 const deviceStore = useDevicesStore()
 deviceStore.startPollingDevice()
+// console.log(deviceStore, '1111')
+// localStorage.setItem('currentDeviceID', deviceStore.deviceInfo.currentDeviceID)
 
 // 鍒囨崲浠诲姟鏃惰幏鍙栧搴斾换鍔$殑宸ヨ壓妯″瀷淇℃伅
 const craftModelStore = useCraftModelStore()
@@ -249,7 +254,9 @@
 const currentWorkers = computed(() => {
   const channel = activeTask.value?.Channel
   if (isNumber(channel)) {
-    return channels.value[channel].workers ?? []
+    console.log(activeTask.value?.Procedure?.procedure?.workers, '99999')
+    // return []
+    return activeTask.value?.Procedure?.procedure?.workers ?? []
   } else {
     return []
   }

--
Gitblit v1.8.0