Browse Source

fix:工艺状态

master
guoapeng 2 months ago
parent
commit
09821457a4
  1. 1
      src/components/craft/AddCraftDialog.vue
  2. 25
      src/components/craft/TransferLeft.vue
  3. 17
      src/components/home/Tube/index.vue
  4. 12
      src/stores/systemStore.ts

1
src/components/craft/AddCraftDialog.vue

@ -189,7 +189,6 @@ defineExpose({
<el-input
v-model.trim="craftObj.name"
style="width: 200px"
size="small"
type="text"
placeholder="请输入名称"
class="flex-auto bg-[#f6f6f6] h-11 leading-10 rounded-sm px-4"

25
src/components/craft/TransferLeft.vue

@ -3,8 +3,8 @@ defineProps<{ title: string }>()
</script>
<template>
<div class="transfer-left btn-light">
{{ title }}
<div class="btn-light">
<p>{{ title }}</p>
<img
src="@/assets/images/icon_add_s.svg"
alt="add"
@ -14,27 +14,18 @@ defineProps<{ title: string }>()
</template>
<style lang="scss" scoped>
.transfer-left{
display: flex;
}
.btn-light{
display: flex;
justify-content: center;
justify-content: space-between;
align-items: center;
background-color: transparent;
border-radius: 4px;
color: '#1989fa';
border: solid 1px '#1989fa';
height: 11px;
color: #1989fa;
border: solid 1px #1989fa;
padding: 10px 10px;
width: 130px;
}
.add_icon {
right: 1rem;
width: .875rem;
}
@media (min-width: 56.25rem) {
.add_icon {
right: 1.875rem;
}
width: 15px;
}
</style>

17
src/components/home/Tube/index.vue

@ -62,6 +62,11 @@ const craft = computed(() => {
return systemStore.systemStatus.tray?.find(item => item.heatModuleId === props.data.moduleCode)?.crafts
})
const craftSteps = computed(() => {
const steps = systemStore.systemStatus.tray?.find(item => item.heatModuleId === props.data.moduleCode)?.crafts?.craft?.steps
return steps ? JSON.parse(steps) : undefined
})
const tray = computed(() => {
return systemStore.systemStatus.tray?.find(item => item.heatModuleId === props.data.moduleCode)
})
@ -105,7 +110,7 @@ defineExpose({
<div
v-if="data.trayStatus !== 0 && craft?.state"
class="status" :class="{
'status-success': false,
'status-success': craft?.state === 'FINISHED',
'status-wait': craft?.state === 'READY',
'status-PAUSED': craft?.state === 'PAUSED',
'status-error': craft?.state === 'ERROR',
@ -123,7 +128,9 @@ defineExpose({
<span v-if="craft?.state === 'READY'" class="status-text">工艺等待执行</span>
<span v-if="craft?.state === 'PAUSED'" 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>
<div class="status-operation">
<ft-button v-if="craft?.state === 'RUNNING'" type="primary" size="small" :click-handle="pauseCraftHandle">
暂停
@ -131,9 +138,10 @@ defineExpose({
<ft-button v-if="craft?.state === 'PAUSED'" type="primary" size="small" :click-handle="resumeCraftHandle">
继续
</ft-button>
<ft-button v-if="craft?.state !== 'READY'" size="small" :click-handle="stopCraftHandle">
<ft-button v-if="!['READY', 'ERROR', 'FINISHED'].includes(craft?.state)" size="small" :click-handle="stopCraftHandle">
停止
</ft-button>
<span v-if="craft?.state === 'FINISHED'">请取走托盘</span>
</div>
</div>
<span v-for="item in 16" :key="item" class="tube-inner" :class="{ 'tube-inner-active': tray?.tubes.find(tu => tu.tubeNum === item)?.exists }" :index="item" />
@ -278,6 +286,9 @@ defineExpose({
}
}
}
.status-success {
border: 1px solid #14A656;
}
.status-wait {
background: rgba(242,235,231, 0.9);
border: 1px solid #EE8223;

12
src/stores/systemStore.ts

@ -156,6 +156,11 @@ export const useSystemStore = defineStore('system', {
},
],
crafts: {
craft: {
id: 1,
name: '菱锌矿硫酸溶解法',
steps: '',
},
state: 'READY',
},
},
@ -193,7 +198,12 @@ export const useSystemStore = defineStore('system', {
},
],
crafts: {
state: 'ERROR',
craft: {
id: 1,
name: '菱锌矿硫酸溶解法',
steps: '',
},
state: 'FINISHED',
},
},
{

Loading…
Cancel
Save