Browse Source

优化工艺加热步骤

feature/three
LiLongLong 3 months ago
parent
commit
70ba8aa1df
  1. 1
      src/views/craft/AddCraftDialog.vue
  2. 27
      src/views/craft/CraftStatus.vue
  3. 12
      src/views/craft/TransferRight.vue
  4. 4
      src/views/craft/index.vue

1
src/views/craft/AddCraftDialog.vue

@ -64,7 +64,6 @@ function onConfirm() {
ElMessage.warning('请输入工艺名称')
return
}
for (const step of stepStructs.value) {
if (step.method === 'addLiquid') {
const list = step.params.tubeSolList

27
src/views/craft/CraftStatus.vue

@ -1,5 +1,5 @@
<script lang="ts" setup>
import type { CraftState } from './craftType'
import type { CraftState, StepStruct } from './craftType'
import { craftstatus } from '@/apis/crafts'
import { ref } from 'vue'
import TransferRight from './TransferRight.vue'
@ -16,6 +16,11 @@ const stateMap: any = {
const queryCraftStatus = () => {
intervalTimes.value = setInterval(() => {
craftstatus().then((res) => {
console.log('res---', res)
if (res && res.length === 0) {
clearInterval(intervalTimes.value)
return
}
const craftStateList: CraftState[] = res
const uniqueData: CraftState[] = []
const idMap: any = {}
@ -58,7 +63,7 @@ const onCloseDialog = () => {
stateList.value = []
}
const currentSteps = ref()
const currentSteps = ref<StepStruct[]>([])
const onSelectChange = (value: string | number) => {
const list = craftList.value.filter(item => item.craftsId === value)
list.forEach((item) => {
@ -94,13 +99,20 @@ defineExpose({
</el-select>
</div>
</div>
<div class="state-log">
<div v-if="currentSteps.length" class="state-log">
<TransferRight v-for="(step, idx) in currentSteps" :key="idx" :order="idx + 1" :step="step" type="showlog" @del="() => {}" @transfer-change="() => {}" />
</div>
<div v-else class="state-log">
<el-empty description="description" style="height:30vh">
<template #description>
<span style="color:#c2c2c2">没有正在执行的工艺</span>
</template>
</el-empty>
</div>
</div>
<div class="item2">
<div>工艺执行状态</div>
<div class="state-log">
<div v-if="stateList.length" class="state-log">
<div v-for="item in stateList" :key="item.state">
<span class="state-span"><label class="state-log-label">矿石名称</label><span class="state-log-text">{{ item.oresName }}</span></span>
<span class="state-span"><label class="state-log-label">工艺名称</label><span class="state-log-text">{{ item.craftsName }}</span></span>
@ -108,6 +120,13 @@ defineExpose({
<span class="state-span"><label class="state-log-label">执行状态</label><span class="state-log-text">{{ stateMap[item.state] }}</span></span>
</div>
</div>
<div v-else class="state-log">
<el-empty description="description" style="height:30vh">
<template #description>
<span style="color:#c2c2c2">没有正在执行的工艺</span>
</template>
</el-empty>
</div>
</div>
</div>
</el-dialog>

12
src/views/craft/TransferRight.vue

@ -1,7 +1,7 @@
<script lang="ts" setup>
import type { StepStruct } from './craftType'
import { useLiquidStore } from '@/stores/useLiquidsStore'
import { onMounted, ref, watch } from 'vue'
import { ref, watch } from 'vue'
import { StepCmdDescMap, tubeSolList } from './craftType'
const props = defineProps<{
@ -17,12 +17,8 @@ const $emit = defineEmits<{
const liquidStore = useLiquidStore()
const stepInfo = ref(props.step)
onMounted(() => {
console.log('liquidStore---', props.step)
})
watch(stepInfo, (newVal) => {
console.log('newVale === ', newVal)
$emit('transferChange', newVal, props.order)
}, {
deep: true,
@ -66,6 +62,12 @@ watch(stepInfo, (newVal) => {
<span class="ml-2"></span>
</div>
</section>
<section v-if="stepInfo.method === 'startHeating'" class="right-shaking">
<div class="flex items-center right-base">
加热温度<el-input v-model.number="stepInfo.params.temperature" style="width: 100px" size="small" />
<span class="ml-2">°C</span>
</div>
</section>
</template>
</div>
<div style="height:5px;background: white;" />

4
src/views/craft/index.vue

@ -171,12 +171,12 @@ const onStart = () => {
<el-dialog v-model="heatVisible" title="执行工艺" width="30vw">
<div style="display: flex; justify-content: center;align-items: center;">
<label>选择加热区</label>
<el-select v-model="heatId" style="width:200px">
<el-select v-model="heatId" style="width:200px" size="small">
<el-option v-for="el in 6" :key="el" :label="`加热区${el}`" :value="el" />
</el-select>
</div>
<div style="display: flex; justify-content: center;align-items: center; height:100px">
<el-button type="primary" @click="onStart">
<el-button type="primary" @click="onStart" size="small">
开始执行
</el-button>
</div>

Loading…
Cancel
Save