From 7ebf9752b95f98865bf94469b58c5abb302a69dd Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期六, 09 十二月 2023 14:45:45 +0800 Subject: [PATCH] 点击当前工序完成的时增加当前时间和任务详情中实际开始时间对比,如果小于60s增加提示并且不请求接口 --- src/views/dashboard/index.vue | 22 +++++++++++++++++----- 1 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index 7b40a2b..e8c7ee5 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -38,7 +38,7 @@ <Loading /> </el-icon> - <div v-if="!craftModelStore.hasMore">鍔犺浇瀹屾垚</div> + <div v-if="!craftModelStore.hasMore && craftModelStore.craftModelList.length > 6">鍔犺浇瀹屾垚</div> </div> </el-scrollbar> </div> @@ -58,7 +58,7 @@ <template #middleBlock3> <SubTitle>浠诲姟璇︽儏</SubTitle> <div class="task-detail"> - <TaskControl :task="activeTask" @should-reload="reloadChannel"></TaskControl> + <TaskControl :task="activeTask" :workers="currentWorkers" @should-reload="reloadChannel"></TaskControl> </div> <ColorInfo :type="1"></ColorInfo> <ColorInfo :type="2"></ColorInfo> @@ -96,7 +96,7 @@ import { computed, ref } from 'vue' import ChannelCollapse from '@/views/dashboard/components/ChannelCollapse.vue' -import type { Worker, Order, Task, Material } from '@/api/task' +import type { Task, Material } from '@/api/task' import type { CraftModel } from '@/api/craftModel' import PersonInfo from '@/views/dashboard/components/PersonInfo.vue' import ProcessInfo from '@/views/dashboard/components/ProcessInfo.vue' @@ -124,6 +124,7 @@ import { updateCraftParams } from '@/api' import { Loading } from '@element-plus/icons-vue' +import { isNumber } from 'lodash-es' defineOptions({ name: 'DashboardView' @@ -154,7 +155,7 @@ const tasksStore = useTasksStore() const { activeTask, channels } = storeToRefs(tasksStore) -tasksStore.getChannels(1) +tasksStore.getChannels(1, true) function changeTab(tab: LabelValue) { tasksStore.getChannels(tab.value) @@ -165,7 +166,9 @@ * @param task */ function reloadChannel(task: Task) { - tasksStore.reloadChannel(task.Channel) + tasksStore.reloadChannel(task.Channel).then(() => { + plcStore.startPollingPLC() + }) } function reloadAllData() { @@ -235,6 +238,15 @@ currentMaterialInfo.value = material showMaterialDetail.value = true } + +const currentWorkers = computed(() => { + const channel = activeTask.value?.Channel + if (isNumber(channel)) { + return channels.value[channel].workers ?? [] + } else { + return [] + } +}) </script> <style scoped lang="scss"> -- Gitblit v1.8.0