Browse Source

fix: 工艺步骤; 溶液选择;

master
guoapeng 2 months ago
parent
commit
ceef7a08ff
  1. 4
      src/components/craft/AddCraft/index.vue
  2. 24
      src/components/home/Tube/index.vue
  3. 17
      src/stores/systemStore.ts
  4. 2
      src/views/home/index.vue

4
src/components/craft/AddCraft/index.vue

@ -72,7 +72,7 @@ const okHandle = async () => {
} }
switch (step.method) { switch (step.method) {
case 'addLiquid': 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 break
case 'startHeating': case 'startHeating':
step.params.description = `加热: ${step.params.temperature}度, 保持${step.params.minutes || 0}${step.params.seconds || 0}` step.params.description = `加热: ${step.params.temperature}度, 保持${step.params.minutes || 0}${step.params.seconds || 0}`
@ -132,7 +132,7 @@ const addStep = (data: CraftTypes.StepItem) => {
<el-row :gutter="30"> <el-row :gutter="30">
<el-col :span="10"> <el-col :span="10">
<el-form-item label="工艺名称" prop="name"> <el-form-item label="工艺名称" prop="name">
<el-input v-model.number="form.name" type="number" placeholder="请输入工艺名称" />
<el-input v-model="form.name" placeholder="请输入工艺名称" />
</el-form-item> </el-form-item>
<el-form-item label="步骤列表"> <el-form-item label="步骤列表">
<div class="button-content"> <div class="button-content">

24
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 const steps = systemStore.systemStatus.tray?.find(item => item.heatModuleId === props.data.moduleCode)?.crafts?.craft?.steps
return steps ? JSON.parse(steps) : undefined return steps ? JSON.parse(steps) : undefined
}) })
console.log(craftSteps.value)
const tray = computed(() => { const tray = computed(() => {
return systemStore.systemStatus.tray?.find(item => item.heatModuleId === props.data.moduleCode) return systemStore.systemStatus.tray?.find(item => item.heatModuleId === props.data.moduleCode)
@ -132,7 +133,12 @@ defineExpose({
<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>
<span v-if="craft?.state === 'RUNNING' && craftSteps"> {{ craftSteps[craft.currentIndex || 0] }}</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">
暂停 暂停
@ -279,8 +285,8 @@ defineExpose({
align-items: center; align-items: center;
border-radius: 10px; border-radius: 10px;
img { img {
width: 30px;
margin: 10px 0;
width: 22px;
margin: 5px 0;
} }
.status-name { .status-name {
font-size: 14px; font-size: 14px;
@ -331,4 +337,16 @@ 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: 2px 0;
}
</style> </style>

17
src/stores/systemStore.ts

@ -157,14 +157,15 @@ export const useSystemStore = defineStore('system', {
exists: true, 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: '', uuid: '',

2
src/views/home/index.vue

@ -300,10 +300,12 @@ const take_photo = async () => {
const trayInHandle = async () => { const trayInHandle = async () => {
await trayIn() await trayIn()
FtMessage.success('设置放入托盘成功')
} }
const trayOutHandle = async () => { const trayOutHandle = async () => {
await trayOut() await trayOut()
FtMessage.success('设置取出托盘成功')
} }
const warmUpStart = async () => { const warmUpStart = async () => {

Loading…
Cancel
Save