From a411e6a6e8baf3a0f0ebf6255f312669903d3754 Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期一, 22 一月 2024 17:38:23 +0800 Subject: [PATCH] 安装适配样式的插件和配置vite+调整页面样式 --- src/views/dashboard/index.vue | 49 +++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 39 insertions(+), 10 deletions(-) diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index 28099f1..fea5c74 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,10 +58,12 @@ <template #middleBlock3> <SubTitle>浠诲姟璇︽儏</SubTitle> <div class="task-detail"> - <TaskControl :task="activeTask" @should-reload="reloadChannel"></TaskControl> + <el-scrollbar always class="scroller"> + <TaskControl :task="activeTask" :workers="currentWorkers" @should-reload="reloadChannel"></TaskControl> + <ColorInfo :type="1"></ColorInfo> + <ColorInfo :type="2"></ColorInfo> + </el-scrollbar> </div> - <ColorInfo :type="1"></ColorInfo> - <ColorInfo :type="2"></ColorInfo> </template> <template #middleBlock4> <SubTitle>浜哄憳淇℃伅</SubTitle> @@ -79,7 +81,11 @@ </template> <template #rightBlock3> <SubTitle>鐭ヨ瘑搴�</SubTitle> - <KnowledgeInfo></KnowledgeInfo> + <div class="task-detail-right-3"> + <el-scrollbar always class="scroller"> + <KnowledgeInfo></KnowledgeInfo> + </el-scrollbar> + </div> <BigButton class="btn" bg-color="red">绾㈢伅鍛煎彨</BigButton> </template> </DashboardLayout> @@ -96,7 +102,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 +130,7 @@ import { updateCraftParams } from '@/api' import { Loading } from '@element-plus/icons-vue' +import { isNumber } from 'lodash-es' defineOptions({ name: 'DashboardView' @@ -154,7 +161,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,11 +172,14 @@ * @param task */ function reloadChannel(task: Task) { - tasksStore.reloadChannel(task.Channel) + tasksStore.reloadChannel(task.Channel).then(() => { + plcStore.startPollingPLC() + }) } function reloadAllData() { tasksStore.reloadAllData() + location.reload() } // 鍚姩plc 杞 const plcStore = usePLCStore() @@ -202,13 +212,14 @@ message: '鏇存柊鎴愬姛锛�', type: 'success' }) + craftModelStore.getCraftModelList() } }, (err) => { console.error(err, '----err') setTimeout(() => { editActive(craftModel) - }, 500) + }, 300) } ) } @@ -234,6 +245,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"> @@ -291,6 +311,15 @@ justify-content: center; } .scroller { - padding: 4px 16px; + padding: 4px 10px; +} +.task-detail { + width: 100%; + height: calc(100% - 32px); + padding-right: 5px; +} +.task-detail-right-3 { + width: 100%; + height: calc(100% - 32px - 50px); } </style> -- Gitblit v1.8.0