From 3b8024bf9714786011cbfee3ca06268f042e33e1 Mon Sep 17 00:00:00 2001 From: guoapeng Date: Sat, 17 May 2025 19:44:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=8C=89=E9=92=AE=E7=8A=B6=E6=80=81;?= =?UTF-8?q?=E9=A2=84=E5=85=85=E6=8C=87=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.vue | 2 +- src/components/common/FTStream/index.vue | 22 +++++----- src/libs/utils.ts | 1 + src/views/home/index.vue | 69 +++++++++++++++++++++++++++++++- 4 files changed, 81 insertions(+), 13 deletions(-) diff --git a/src/app.vue b/src/app.vue index 096fda3..1feb441 100644 --- a/src/app.vue +++ b/src/app.vue @@ -8,7 +8,7 @@ const systemStore = useSystemStore() onMounted(async () => { const res = await getStatus() console.log(res) - systemStore.updateSystemStatus(res) + // systemStore.updateSystemStatus(res) startProgress() }) diff --git a/src/components/common/FTStream/index.vue b/src/components/common/FTStream/index.vue index 13e4739..7ae681e 100644 --- a/src/components/common/FTStream/index.vue +++ b/src/components/common/FTStream/index.vue @@ -156,17 +156,17 @@ const handleMouseUp = () => { } /* 定义过渡效果 */ -.mask-fade-enter-active, .mask-fade-leave-active { - transition: transform 0.5s ease; -} - -.mask-fade-enter-from { - transform: translateX(100%); -} - -.mask-fade-leave-to { - transform: translateX(100%); -} +//.mask-fade-enter-active, .mask-fade-leave-active { +// transition: transform 0.5s ease; +//} +// +//.mask-fade-enter-from { +// transform: translateX(100%); +//} +// +//.mask-fade-leave-to { +// transform: translateX(100%); +//} :deep(.el-timeline-item__timestamp.is-bottom) { white-space: pre-wrap; /* 保留空格和换行符,允许自动换行 */ word-wrap: break-word; /* 允许长单词或URL强制断行 */ diff --git a/src/libs/utils.ts b/src/libs/utils.ts index 4f31685..d830a63 100644 --- a/src/libs/utils.ts +++ b/src/libs/utils.ts @@ -51,6 +51,7 @@ export const cmdNameMap = { cap_lifting_origin: '拍子电机回原点', tray_lifting_origin: '加热区托盘电机回原点', door_origin: '门电机回原点', + filled_solution: '预充管路', } export const generateColors = (count: number): string[] => { diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 170973d..2f0eb76 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -68,7 +68,37 @@ const setTemperature = (id: string) => { } const addLiquidVisible = ref(false) + +const filled_solution = async () => { + if (!systemStore.systemStatus.solutionModule.idle) { + FtMessage.warning('加液区正在工作,请稍后操作') + return + } + currentCommandId = Date.now().toString() + const params = { + commandId: currentCommandId, + command: 'filled_solution', + params: { }, + } + await homeStore.sendControl(params) +} + const addLiquid = async () => { + if (!systemStore.systemStatus.solutionModule.idle) { + FtMessage.warning('加液区正在工作,请稍后操作') + return + } + await ElMessageBox.confirm( + '管路是否已预充?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + showClose: false, + closeOnClickModal: false, + type: 'warning', + }, + ) await ElMessageBox.confirm( '请确认加液区是否有托盘?', '提示', @@ -125,6 +155,10 @@ const move_to_heat_area = async () => { FtMessage.warning('请选择一个加热区') return } + if (systemStore.systemStatus.heatModule.find(item => item.moduleCode === selectedHeatAreas[0].value)?.trayStatus === 1) { + FtMessage.warning('所选加热区有托盘') + return + } await ElMessageBox.confirm( '请确认加液区是否有托盘?', '提示', @@ -154,6 +188,10 @@ const move_to_solution_area = async () => { FtMessage.warning('请选择一个加热区') return } + if (systemStore.systemStatus.heatModule.find(item => item.moduleCode === selectedHeatAreas[0].value)?.trayStatus === 0) { + FtMessage.warning('所选加热区无托盘') + return + } await ElMessageBox.confirm( '请确认加液区无托盘?', '提示', @@ -190,6 +228,10 @@ const heat_start = async () => { FtMessage.warning('请先设置温度') return } + if (systemStore.systemStatus.heatModule.find(item => item.moduleCode === selectedHeatAreas[0].value)?.heating) { + FtMessage.warning('已经在加热了') + return + } currentCommandId = Date.now().toString() const params = { commandId: currentCommandId, @@ -208,6 +250,10 @@ const heat_stop = async () => { FtMessage.warning('请选择一个加热区') return } + if (!systemStore.systemStatus.heatModule.find(item => item.moduleCode === selectedHeatAreas[0].value)?.heating) { + FtMessage.warning('加热区未加热') + return + } currentCommandId = Date.now().toString() const params = { commandId: currentCommandId, @@ -225,6 +271,10 @@ const tray_up = async () => { FtMessage.warning('请选择一个加热区') return } + if (systemStore.systemStatus.heatModule.find(item => item.moduleCode === selectedHeatAreas[0].value)?.trayUp === 1) { + FtMessage.warning('托盘已抬起') + return + } currentCommandId = Date.now().toString() const params = { commandId: currentCommandId, @@ -242,6 +292,10 @@ const tray_down = async () => { FtMessage.warning('请选择一个加热区') return } + if (systemStore.systemStatus.heatModule.find(item => item.moduleCode === selectedHeatAreas[0].value)?.trayUp === 0) { + FtMessage.warning('托盘已降下') + return + } currentCommandId = Date.now().toString() const params = { commandId: currentCommandId, @@ -254,6 +308,10 @@ const tray_down = async () => { } const shake_start = async () => { + if (systemStore.systemStatus.solutionModule.shaking) { + FtMessage.warning('已经在摇匀了') + return + } currentCommandId = Date.now().toString() const params = { commandId: currentCommandId, @@ -265,6 +323,10 @@ const shake_start = async () => { } const shake_stop = async () => { + if (!systemStore.systemStatus.solutionModule.shaking) { + FtMessage.warning('加液区没有在摇匀') + return + } currentCommandId = Date.now().toString() const params = { commandId: currentCommandId, @@ -341,7 +403,12 @@ const take_photo = async () => { - + + + 预充管路 + + + 添加溶液