|
|
@ -81,8 +81,8 @@ const okHandle = async () => { |
|
|
|
step.params.description = `${index + 1}.` |
|
|
|
switch (step.method) { |
|
|
|
case 'addLiquid': |
|
|
|
step.params.description = step.params.list.map(item => `试管[${item.tubeNums.length === 16 ? '全部' : item.tubeNums.join(',')}]: ${ |
|
|
|
item.solutionList.map(s => `添加${solutionList.value.find(ss => ss.id === s.solutionId)?.name}- ${s.volume}ml-偏移量${s.offset}ml`).join(';') |
|
|
|
step.params.description = step.params.list.map(item => `试管${item.tubeNum}: ${ |
|
|
|
item.solutionList.map(s => `添加${solutionList.value.find(ss => ss.id === s.solutionId)?.name}- ${s.volume}mL${s.offset ? `-偏移量${s.offset}mL` : ''}`).join(';') |
|
|
|
}`).join(';') |
|
|
|
break |
|
|
|
case 'startHeating': |
|
|
@ -185,18 +185,29 @@ const addHandle = async () => { |
|
|
|
return |
|
|
|
} |
|
|
|
console.log(addLiquidForm.value) |
|
|
|
// addList.value!.push(addLiquidForm) |
|
|
|
const index = form.value.stepList?.findIndex(item => item.method === 'addLiquid') |
|
|
|
if (index !== -1) { |
|
|
|
form.value.stepList?.[index || 0].params?.list?.push(cloneDeep(addLiquidForm.value)) |
|
|
|
} |
|
|
|
else { |
|
|
|
if (form.value.stepList?.at(-1)?.method !== 'addLiquid') { |
|
|
|
form.value.stepList?.push({ |
|
|
|
name: '加液', |
|
|
|
method: 'addLiquid', |
|
|
|
params: { list: [cloneDeep(addLiquidForm.value)] }, |
|
|
|
} as CraftTypes.StepItem) |
|
|
|
params: { |
|
|
|
list: [], |
|
|
|
}, |
|
|
|
}) |
|
|
|
} |
|
|
|
addLiquidForm.value.tubeNums.forEach((tubeNum: any) => { |
|
|
|
const index = form.value.stepList?.at(-1)?.params?.list?.findIndex(item => item.tubeNum === tubeNum) |
|
|
|
if (index !== -1) { |
|
|
|
form.value.stepList?.at(-1)?.params?.list?.[index].solutionList.push(...cloneDeep(addLiquidForm.value.solutionList)) |
|
|
|
} |
|
|
|
else { |
|
|
|
form.value.stepList?.at(-1)?.params?.list?.push({ |
|
|
|
tubeNum, |
|
|
|
solutionList: [...cloneDeep(addLiquidForm.value.solutionList)], |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log(form.value) |
|
|
|
|
|
|
|
addLiquidForm.value = { |
|
|
|
tubeNums: [], |
|
|
|
solutionList: [ |
|
|
@ -207,6 +218,7 @@ const addHandle = async () => { |
|
|
|
}, |
|
|
|
], |
|
|
|
} |
|
|
|
|
|
|
|
activeTube.value = Array.from({ length: 16 }).fill(false) |
|
|
|
selectVisible.value = false |
|
|
|
addLiquidFormRef.value.resetFields() |
|
|
@ -282,7 +294,7 @@ const addHandle = async () => { |
|
|
|
> |
|
|
|
<el-input v-model.number="s.volume" size="small" type="number" style="width: 100%" placeholder="容量"> |
|
|
|
<template #append> |
|
|
|
ml |
|
|
|
mL |
|
|
|
</template> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
@ -290,14 +302,14 @@ const addHandle = async () => { |
|
|
|
<el-col :span="7"> |
|
|
|
<el-form-item |
|
|
|
label="" :prop="`solutionList.${index}.offset`" :rules="{ |
|
|
|
required: true, |
|
|
|
required: false, |
|
|
|
message: '请输入偏移量', |
|
|
|
trigger: 'blur', |
|
|
|
}" |
|
|
|
> |
|
|
|
<el-input v-model.number="s.offset" size="small" type="number" style="width: 100%" placeholder="偏移量"> |
|
|
|
<template #append> |
|
|
|
ml |
|
|
|
mL |
|
|
|
</template> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
@ -333,15 +345,17 @@ const addHandle = async () => { |
|
|
|
<el-form-item :label="`${index + 1}: ${item.name}`"> |
|
|
|
<div v-if="item.method === 'addLiquid'" class="list-box"> |
|
|
|
<div v-for="(liquid, liquidIndex) in item.params?.list || []" :key="liquidIndex"> |
|
|
|
<span>试管: {{ liquid.tubeNums.length === 16 ? '全部' : liquid.tubeNums.join(',') }} </span> |
|
|
|
<span>试管{{ liquid.tubeNum }} </span> |
|
|
|
<div v-for="(s, sIndex) in liquid.solutionList" :key="sIndex"> |
|
|
|
<span>添加</span> |
|
|
|
<span>{{ solutionList.find(solution => solution.id === s.solutionId)?.name }}</span> |
|
|
|
<span>{{ s.volume }}</span> |
|
|
|
<span>ml-</span> |
|
|
|
<span>偏移量</span> |
|
|
|
<span>{{ s.offset }}</span> |
|
|
|
<span>ml</span> |
|
|
|
<span>mL</span> |
|
|
|
<span v-if="s.offset"> |
|
|
|
<span>-偏移量</span> |
|
|
|
<span>{{ s.offset }}</span> |
|
|
|
<span>mL</span> |
|
|
|
</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|