Browse Source

fix:预充逻辑修改

master
guoapeng 3 months ago
parent
commit
29e8496a5b
  1. 83
      src/components/home/FillSolution/index.vue
  2. 71
      src/views/debug/index.vue

83
src/components/home/FillSolution/index.vue

@ -1,6 +1,8 @@
<script setup lang="ts">
import { getContainerList } from 'apis/container'
import { getSolsList } from 'apis/solution'
import { useHomeStore } from 'stores/homeStore'
import { useSolutionStore } from 'stores/useSolutionStore'
import { onMounted, ref } from 'vue'
const emits = defineEmits(['ok', 'cancel'])
@ -9,6 +11,7 @@ const homeStore = useHomeStore()
let currentCommandId = ''
onMounted(() => {
queryContainerList()
querySolutionList()
})
const containerList = ref<Container.ContainerItem[]>([])
@ -22,12 +25,6 @@ const form = ref({
})
const formRef = ref()
const rules = {
list: [
{ required: true, message: '请选择容器', trigger: 'change' },
],
}
const okHandle = async () => {
try {
const valid = await formRef.value.validate()
@ -37,7 +34,7 @@ const okHandle = async () => {
currentCommandId = Date.now().toString()
const params = {
commandId: currentCommandId,
command: 'filled_solution',
command: 'filled_solution_start',
params: {
...form.value,
},
@ -52,22 +49,76 @@ const okHandle = async () => {
const cancel = () => {
emits('cancel')
}
const solutionList = ref<Solution.SolutionItem[]>([])
const solutionMap = ref<Record<string | number, string>>({})
const solutionStore = useSolutionStore()
const querySolutionList = async () => {
const res = await getSolsList()
if (res && res.list) {
solutionList.value = res.list
solutionList.value.forEach((item) => {
if (item.id) {
solutionMap.value[item.id] = item.name
}
})
solutionStore.updateSolution(res.list)
}
}
const filled_solution_start = async (id: number) => {
currentCommandId = Date.now().toString()
const params = {
commandId: currentCommandId,
command: 'filled_solution_start',
params: {
list: [id],
},
}
await homeStore.sendControl(params)
}
const filled_solution_stop = async (id: number) => {
currentCommandId = Date.now().toString()
const params = {
commandId: currentCommandId,
command: 'filled_solution_stop',
params: {
list: [id],
},
}
await homeStore.sendControl(params)
}
</script>
<template>
<FtDialog visible title="预充管路" width="40%" :ok-handle="okHandle" @cancel="cancel">
<el-form ref="formRef" label-width="auto" :model="form" :rules="rules">
<el-form-item label="容器" prop="list">
<el-select v-model="form.list" placeholder="请选择容器" multiple>
<el-option v-for="item in containerList.filter(item => item.type === 0)" :key="item.id" :label="item.solutionName" :value="item.id" />
</el-select>
</el-form-item>
</el-form>
<div>
<div v-for="item in containerList.filter((item) => item.type === 0)" :key="item.id" class="item-box">
<span>{{ solutionMap[item.solutionId] }}</span>
<div>
<ft-button type="primary" :click-handle="() => filled_solution_start(item.id)">
开始预充
</ft-button>
<ft-button type="primary" :click-handle="() => filled_solution_stop(item.id)">
停止
</ft-button>
</div>
</div>
</div>
<template #footer>
<ft-button @click="cancel">
关闭
</ft-button>
</template>
</FtDialog>
</template>
<style scoped lang="scss">
.el-tag {
margin-right: 5px;
.item-box {
display: flex;
align-items: center;
justify-content: space-between;
padding: 5px;
}
</style>

71
src/views/debug/index.vue

@ -458,10 +458,62 @@ const debug_door_stop = async () => {
}
await debugStore.sendControl(params)
}
const debug_move_tray_to_solution_area = async () => {
currentCommandId = Date.now().toString()
const params = {
commandId: currentCommandId,
command: 'debug_move_tray_to_solution_area',
params: {
heatId: debugStore.formData.heatArea.index,
},
}
await debugStore.sendControl(params)
}
const debug_move_tray_to_heat_area = async () => {
currentCommandId = Date.now().toString()
const params = {
commandId: currentCommandId,
command: 'debug_move_tray_to_heat_area',
params: {
heatId: debugStore.formData.heatArea.index,
},
}
await debugStore.sendControl(params)
}
const debug_cap_in_heat_area = async () => {
currentCommandId = Date.now().toString()
const params = {
commandId: currentCommandId,
command: 'debug_cap_in_heat_area',
params: {
heatId: debugStore.formData.heatArea.index,
},
}
await debugStore.sendControl(params)
}
const debug_cap_out_heat_area = async () => {
currentCommandId = Date.now().toString()
const params = {
commandId: currentCommandId,
command: 'debug_cap_out_heat_area',
params: {
heatId: debugStore.formData.heatArea.index,
},
}
await debugStore.sendControl(params)
}
</script>
<template>
<div class="debug-content">
<!-- <el-tabs v-model="activeTab" type="card"> -->
<!-- <el-tab-pane label="单步指令" :name="1" /> -->
<!-- <el-tab-pane label="复合指令" :name="2" /> -->
<!-- </el-tabs> -->
<el-row :gutter="10">
<el-col :span="8">
<el-card>
@ -828,6 +880,25 @@ const debug_door_stop = async () => {
</div>
</div>
</template>
<el-divider>复合操作</el-divider>
<div class="card-box">
<el-form>
<el-form-item>
<ft-button size="small" type="primary" :click-handle="debug_move_tray_to_solution_area">
将托盘移至加液区
</ft-button>
<ft-button size="small" type="primary" :click-handle="debug_move_tray_to_heat_area">
将托盘移至加热区
</ft-button>
<ft-button size="small" :click-handle="debug_cap_in_heat_area">
安装拍子
</ft-button>
<ft-button size="small" type="primary" :click-handle="debug_cap_out_heat_area">
拆卸拍子
</ft-button>
</el-form-item>
</el-form>
</div>
<el-divider>升降电机</el-divider>
<div class="card-box">
<el-form>

Loading…
Cancel
Save