charles
2024-04-29 c7f3fd5215399b37d0511b3bd555150ff1b13507
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 []
  }