Browse Source

fix: 工艺步骤

master
guoapeng 2 months ago
parent
commit
d87c67b005
  1. 34
      src/components/home/Tube/index.vue
  2. 8
      src/stores/systemStore.ts
  3. 5
      src/views/craft/index.vue

34
src/components/home/Tube/index.vue

@ -52,13 +52,18 @@ const hearInfo = computed(() => {
console.log(hearInfo.value) console.log(hearInfo.value)
const craft = computed(() => { const craft = computed(() => {
return systemStore.systemStatus.tray?.find(item => item.heatModuleId === props.data.moduleCode)?.crafts
return systemStore.systemStatus.trays?.find(item => item.heatModuleCode === props.data.moduleCode)?.crafts
}) })
const tray = computed(() => { const tray = computed(() => {
return systemStore.systemStatus.trays?.find(item => item.heatModuleCode === props.data.moduleCode) return systemStore.systemStatus.trays?.find(item => item.heatModuleCode === props.data.moduleCode)
}) })
const craftSteps = computed(() => {
const steps = systemStore.systemStatus.trays?.find(item => item.heatModuleCode === props.data.moduleCode)?.crafts?.craft?.steps
return steps ? JSON.parse(steps) : undefined
})
const setTemperature = () => { const setTemperature = () => {
emits('setTemperature', props.data.moduleCode) emits('setTemperature', props.data.moduleCode)
} }
@ -121,6 +126,12 @@ defineExpose({
<span v-if="craft?.state === 'PAUSED'" class="status-text">预设已暂停</span> <span v-if="craft?.state === 'PAUSED'" class="status-text">预设已暂停</span>
<span v-if="craft?.state === 'ERROR'" class="status-text">预设执行错误</span> <span v-if="craft?.state === 'ERROR'" class="status-text">预设执行错误</span>
<span v-if="craft?.state === 'FINISHED'" class="status-text">预设执行成功</span> <span v-if="craft?.state === 'FINISHED'" class="status-text">预设执行成功</span>
<el-tooltip v-if="craft?.state === 'RUNNING' && craftSteps && craftSteps[craft.currentIndex || 0]?.params?.description" :content="`${(craft.currentIndex || 0) + 1}.${craftSteps[craft.currentIndex || 0].params.description}`" placement="top" trigger="click">
<div class="status-description">
{{ (craft.currentIndex || 0) + 1 }}.
{{ craftSteps[craft.currentIndex || 0].params.description }}
</div>
</el-tooltip>
<div class="status-operation"> <div class="status-operation">
<ft-button v-if="craft?.state === 'RUNNING'" type="primary" size="small" :click-handle="pauseCraftHandle"> <ft-button v-if="craft?.state === 'RUNNING'" type="primary" size="small" :click-handle="pauseCraftHandle">
暂停 暂停
@ -151,10 +162,10 @@ defineExpose({
<span>{{ data.temperature || '--' }}</span> <span>{{ data.temperature || '--' }}</span>
<span></span> <span></span>
</span> </span>
<span v-show="data.fanOpen" style="color: #FE0A0A ">降温中</span>
<span v-show="data.heatingType === 'heating'" style="color: #1677FF ">加热中</span>
<span v-show="data.heatingType === 'drying'" style="color: #F2652D ">烘干中</span>
<span v-show="data.heatingType === 'annealing'" style="color: #14A656 ">退火中</span>
<span v-show="data.fanOpen" style="color: #1677FF;font-weight: bold">降温中</span>
<span v-show="data.heatingType === 'heating'" style="color: #FE0A0A;font-weight: bold ">加热中</span>
<span v-show="data.heatingType === 'drying'" style="color: #F2652D;font-weight: bold ">烘干中</span>
<span v-show="data.heatingType === 'annealing'" style="color: #14A656;font-weight: bold ">退火中</span>
</div> </div>
<div class="footer"> <div class="footer">
<div class="tem-box" @click="setTemperature"> <div class="tem-box" @click="setTemperature">
@ -270,7 +281,7 @@ defineExpose({
z-index: 1; z-index: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: flex-start;
justify-content: center;
align-items: center; align-items: center;
border-radius: 10px; border-radius: 10px;
img { img {
@ -323,4 +334,15 @@ defineExpose({
margin-left: 5px; 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-top: auto;
}
</style> </style>

8
src/stores/systemStore.ts

@ -139,7 +139,13 @@ export const useSystemStore = defineStore('system', {
}, },
], ],
crafts: { crafts: {
state: 'READY',
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,
}, },
}, },
{ {

5
src/views/craft/index.vue

@ -44,6 +44,8 @@ const queryCrafList = () => {
}).catch(() => { }).catch(() => {
}) })
} }
const sourceData = ref<CraftTypes.Craft | null>(null)
const addCraftVisible = ref(false)
const onAddCraft = () => { const onAddCraft = () => {
// if (addCraftRef.value) { // if (addCraftRef.value) {
@ -53,7 +55,6 @@ const onAddCraft = () => {
addCraftVisible.value = true addCraftVisible.value = true
} }
const sourceData = ref<CraftTypes.Craft | null>(null)
const onEditCraft = () => { const onEditCraft = () => {
// if (multipleSelection.value && multipleSelection.value.length !== 1) { // if (multipleSelection.value && multipleSelection.value.length !== 1) {
// ElMessage.warning('') // ElMessage.warning('')
@ -140,8 +141,6 @@ const onStart = () => {
const returnOre = () => { const returnOre = () => {
router.push('/ore') router.push('/ore')
} }
const addCraftVisible = ref(false)
</script> </script>
<template> <template>

Loading…
Cancel
Save