Browse Source

fix: 执行工艺放开试管选择

master
guoapeng 2 months ago
parent
commit
90c660237e
  1. 12
      src/components/craft/AddCraft/index.vue
  2. 11
      src/components/home/SelectCraft/index.vue

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

@ -374,7 +374,17 @@ const addHandle = async () => {
mL mL
</template> </template>
</el-input> </el-input>
<el-icon v-if="liquid.solutionList.length > 1" color="red" @click="liquid.solutionList.splice(sIndex, 1)">
<el-icon
color="red" @click="() => {
if (liquid.solutionList.length === 1) {
item.params?.list.splice(liquidIndex, 1)
}
else {
liquid.solutionList.splice(sIndex, 1)
}
}"
>
<RemoveFilled /> <RemoveFilled />
</el-icon> </el-icon>
</div> </div>

11
src/components/home/SelectCraft/index.vue

@ -3,8 +3,7 @@ import { startCraft } from 'apis/crafts'
import { getOreList } from 'apis/ore' import { getOreList } from 'apis/ore'
import { FtMessage } from 'libs/message' import { FtMessage } from 'libs/message'
import { useHomeStore } from 'stores/homeStore' import { useHomeStore } from 'stores/homeStore'
import { useSystemStore } from 'stores/systemStore'
import { computed, onMounted, ref } from 'vue'
import { onMounted, ref } from 'vue'
const emits = defineEmits(['ok', 'cancel']) const emits = defineEmits(['ok', 'cancel'])
@ -62,7 +61,7 @@ const mousedownHandle = async (e: Event) => {
else { else {
event = e event = e
} }
if (event.target!.classList!.contains('tube-inner') && !event.target!.classList.contains('tube-inner-disable')) {
if (event.target!.classList!.contains('tube-inner')) {
const num = event.target!.getAttribute('index') const num = event.target!.getAttribute('index')
activeTube.value[Number(num) - 1] = !activeTube.value[Number(num) - 1] activeTube.value[Number(num) - 1] = !activeTube.value[Number(num) - 1]
form.value.tubes = activeTube.value.map((item, index) => index + 1).filter(item => activeTube.value[item - 1]) form.value.tubes = activeTube.value.map((item, index) => index + 1).filter(item => activeTube.value[item - 1])
@ -72,10 +71,6 @@ const mousedownHandle = async (e: Event) => {
const activeTube = ref(Array.from({ length: 16 }).fill(false)) const activeTube = ref(Array.from({ length: 16 }).fill(false))
const tubes = computed(() => {
return useSystemStore().systemStatus.tray?.find(item => item.heatModuleId === homeStore.heatAreaList.find(item => item.selected)?.value)?.tubes
})
const selectVisible = ref(false) const selectVisible = ref(false)
const checkChange = () => { const checkChange = () => {
activeTube.value = Array.from({ length: 16 }).fill(selectVisible.value) activeTube.value = Array.from({ length: 16 }).fill(selectVisible.value)
@ -97,7 +92,7 @@ const checkChange = () => {
全选 全选
</el-checkbox> </el-checkbox>
<div class="tube-item" @click.prevent="mousedownHandle" @touch.prevent="mousedownHandle"> <div class="tube-item" @click.prevent="mousedownHandle" @touch.prevent="mousedownHandle">
<span v-for="item in 16" :key="item" class="tube-inner" :class="{ 'tube-inner-active': activeTube[item - 1], 'tube-inner-disable': homeStore.heatAreaList.filter(item => item.selected).length && !tubes?.find(t => t.tubeNum === item)?.exists }" :index="item" />
<span v-for="item in 16" :key="item" class="tube-inner" :class="{ 'tube-inner-active': activeTube[item - 1] }" :index="item" />
</div> </div>
</el-form-item> </el-form-item>
<el-form-item label="工艺" prop="craftId"> <el-form-item label="工艺" prop="craftId">

Loading…
Cancel
Save