From ceef7a08ff18bcc75c510c1fef75a8e507144dc9 Mon Sep 17 00:00:00 2001 From: guoapeng Date: Thu, 5 Jun 2025 19:09:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B7=A5=E8=89=BA=E6=AD=A5=E9=AA=A4;=20?= =?UTF-8?q?=E6=BA=B6=E6=B6=B2=E9=80=89=E6=8B=A9;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/craft/AddCraft/index.vue | 4 ++-- src/components/home/Tube/index.vue | 24 +++++++++++++++++++++--- src/stores/systemStore.ts | 17 +++++++++-------- src/views/home/index.vue | 2 ++ 4 files changed, 34 insertions(+), 13 deletions(-) diff --git a/src/components/craft/AddCraft/index.vue b/src/components/craft/AddCraft/index.vue index bd38f90..c6e197a 100644 --- a/src/components/craft/AddCraft/index.vue +++ b/src/components/craft/AddCraft/index.vue @@ -72,7 +72,7 @@ const okHandle = async () => { } switch (step.method) { case 'addLiquid': - step.params.description = step.params.addLiquidList.map(liquid => `添加${solutionList.value.find(s => s.id === containerList.value.find(c => c.id === liquid.containerId)?.solutionId)?.name}-${liquid.volume}ml; `) + step.params.description = step.params.addLiquidList.map((liquid: { containerId: number, volume: number }) => `添加${solutionList.value.find(s => s.id === containerList.value.find(c => c.id === liquid.containerId)?.solutionId)?.name}-${liquid.volume}ml `).join(';') break case 'startHeating': step.params.description = `加热: ${step.params.temperature}度, 保持${step.params.minutes || 0}分${step.params.seconds || 0}秒` @@ -132,7 +132,7 @@ const addStep = (data: CraftTypes.StepItem) => { - +
diff --git a/src/components/home/Tube/index.vue b/src/components/home/Tube/index.vue index 0b22cc2..625ab61 100644 --- a/src/components/home/Tube/index.vue +++ b/src/components/home/Tube/index.vue @@ -68,6 +68,7 @@ const craftSteps = computed(() => { const steps = systemStore.systemStatus.tray?.find(item => item.heatModuleId === props.data.moduleCode)?.crafts?.craft?.steps return steps ? JSON.parse(steps) : undefined }) +console.log(craftSteps.value) const tray = computed(() => { return systemStore.systemStatus.tray?.find(item => item.heatModuleId === props.data.moduleCode) @@ -132,7 +133,12 @@ defineExpose({ 工艺执行错误 工艺执行完毕 - {{ craftSteps[craft.currentIndex || 0] }} + +
+ {{ (craft.currentIndex || 0) + 1 }}. + {{ craftSteps[craft.currentIndex || 0].params.description }} +
+
暂停 @@ -279,8 +285,8 @@ defineExpose({ align-items: center; border-radius: 10px; img { - width: 30px; - margin: 10px 0; + width: 22px; + margin: 5px 0; } .status-name { font-size: 14px; @@ -331,4 +337,16 @@ defineExpose({ margin-left: 5px; } } + +.status-description { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 95%; + padding: 0 3px; + display: inline-block; + background: #fff; + border-radius: 2px; + margin: 2px 0; +} diff --git a/src/stores/systemStore.ts b/src/stores/systemStore.ts index 1acf491..72baaa3 100644 --- a/src/stores/systemStore.ts +++ b/src/stores/systemStore.ts @@ -157,14 +157,15 @@ export const useSystemStore = defineStore('system', { exists: true, }, ], - // crafts: { - // craft: { - // id: 1, - // name: '菱锌矿硫酸溶解法', - // steps: '', - // }, - // state: 'READY', - // }, + crafts: { + craft: { + id: 1, + name: '菱锌矿硫酸溶解法', + steps: '[{"name":"加液","method":"addLiquid","params":{"addLiquidList":[{"containerId":1,"volume":3},{"containerId":4,"volume":4},{"containerId":3,"volume":5}],"description":["添加硫酸-3ml; ","添加氢氟酸-4ml; ","添加硝酸-5ml; "]}},{"name":"加热","method":"startHeating","params":{"temperature":4,"second":123,"description":"加热: 4度, 保持2分3秒","minutes":2,"seconds":3}},{"name":"摇匀","method":"shaking","params":{"second":122,"seconds":2,"minutes":2,"description":"摇匀: 122秒"}},{"name":"拍照","method":"takePhoto","params":{"description":"拍照"}}]', + }, + state: 'RUNNING', + currentIndex: 1, + }, }, { uuid: '', diff --git a/src/views/home/index.vue b/src/views/home/index.vue index 63e58e6..2235fd0 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -300,10 +300,12 @@ const take_photo = async () => { const trayInHandle = async () => { await trayIn() + FtMessage.success('设置放入托盘成功') } const trayOutHandle = async () => { await trayOut() + FtMessage.success('设置取出托盘成功') } const warmUpStart = async () => {