Browse Source

fix: 图片填充模式;工艺时间加小时;图片模式显示

master
guoapeng 2 months ago
parent
commit
f8986580ac
  1. 33
      src/components/craft/AddCraft/index.vue
  2. 1
      src/components/home/Photo/index.vue
  3. 2
      src/components/home/SavePhoto/index.vue
  4. 1
      src/views/home/index.vue
  5. 5
      src/views/taskLog/index.vue

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

@ -32,11 +32,13 @@ onMounted(async () => {
form.value = { ...props.sourceData, stepList: JSON.parse(props.sourceData.steps || '[]') } form.value = { ...props.sourceData, stepList: JSON.parse(props.sourceData.steps || '[]') }
form.value.stepList?.forEach((step: CraftTypes.StepItem) => { form.value.stepList?.forEach((step: CraftTypes.StepItem) => {
if (step.params.second) { if (step.params.second) {
step.params.minutes = Math.floor(step.params.second / 60) || undefined
step.params.hours = Math.floor(step.params.second / 3600) || undefined
step.params.minutes = Math.floor(step.params.second % 3600 / 60) || undefined
step.params.seconds = step.params.second % 60 || undefined step.params.seconds = step.params.second % 60 || undefined
} }
if (step.params.coolingSecond) { if (step.params.coolingSecond) {
step.params.coolingMinutes = Math.floor(step.params.coolingSecond / 60) || undefined
step.params.coolingHours = Math.floor(step.params.coolingSecond / 3600) || undefined
step.params.coolingMinutes = Math.floor(step.params.coolingSecond % 3600 / 60) || undefined
step.params.coolingSeconds = step.params.coolingSecond % 60 || undefined step.params.coolingSeconds = step.params.coolingSecond % 60 || undefined
} }
}) })
@ -82,11 +84,11 @@ const okHandle = async () => {
} }
if (['startHeating', 'shaking', 'delay'].includes(step.method)) { if (['startHeating', 'shaking', 'delay'].includes(step.method)) {
if (step.params.minutes || step.params.seconds) {
step.params.second = (step.params.minutes || 0) * 60 + (step.params.seconds || 0) || undefined
if (step.params.hours || step.params.minutes || step.params.seconds) {
step.params.second = (step.params.hours || 0) * 3600 + (step.params.minutes || 0) * 60 + (step.params.seconds || 0) || undefined
} }
if (step.params.coolingMinutes || step.params.coolingSeconds) {
step.params.coolingSecond = (step.params.coolingMinutes || 0) * 60 + (step.params.coolingSeconds || 0) || undefined
if (step.params.coolingHours || step.params.coolingMinutes || step.params.coolingSeconds) {
step.params.coolingSecond = (step.params.coolingHours || 0) * 3600 + (step.params.coolingMinutes || 0) * 60 + (step.params.coolingSeconds || 0) || undefined
} }
} }
step.params.description = `${index + 1}.` step.params.description = `${index + 1}.`
@ -97,13 +99,13 @@ const okHandle = async () => {
}`).join(';') }`).join(';')
break break
case 'startHeating': case 'startHeating':
step.params.description = `加热: ${step.params.temperature}度, 保持${step.params.minutes || 0}${step.params.seconds || 0}`
step.params.description = `加热: ${step.params.temperature}度, 保持${step.params.hours || 0}小时${step.params.minutes || 0}${step.params.seconds || 0}`
break break
case 'shaking': case 'shaking':
step.params.description = `摇匀: ${step.params.second}`
step.params.description = `摇匀: ${step.params.hours || 0}小时${step.params.minutes || 0}${step.params.seconds || 0}`
break break
case 'delay': case 'delay':
step.params.description = `等待: ${step.params.second}`
step.params.description = `等待: ${step.params.hours || 0}小时${step.params.minutes || 0}${step.params.seconds || 0}`
break break
case 'takePhoto': case 'takePhoto':
step.params.description = `拍照` step.params.description = `拍照`
@ -425,9 +427,14 @@ const addHandle = async () => {
<div> <div>
<span>保持时间</span> <span>保持时间</span>
<el-select v-model="item.params.hours" style="width: 70px" clearable size="small" placeholder="请选择">
<el-option v-for="i in 24" :key="i" :label="i" :value="i" />
</el-select>
<span class="unit-text">小时</span>
<el-select v-model="item.params.minutes" style="width: 70px" clearable size="small" placeholder="分钟"> <el-select v-model="item.params.minutes" style="width: 70px" clearable size="small" placeholder="分钟">
<el-option v-for="i in 60" :key="i" :label="i" :value="i" /> <el-option v-for="i in 60" :key="i" :label="i" :value="i" />
</el-select> </el-select>
<span class="unit-text"></span> <span class="unit-text"></span>
<el-select v-model="item.params.seconds" style="width: 70px" clearable size="small" placeholder="秒"> <el-select v-model="item.params.seconds" style="width: 70px" clearable size="small" placeholder="秒">
<el-option v-for="i in 60" :key="i" :label="i" :value="i" /> <el-option v-for="i in 60" :key="i" :label="i" :value="i" />
@ -436,6 +443,10 @@ const addHandle = async () => {
</div> </div>
<div> <div>
<span>冷却时间</span> <span>冷却时间</span>
<el-select v-model="item.params.coolinghHours" style="width: 70px" clearable size="small" placeholder="请选择">
<el-option v-for="i in 24" :key="i" :label="i" :value="i" />
</el-select>
<span class="unit-text">小时</span>
<el-select v-model="item.params.coolingMinutes" style="width: 70px" clearable size="small" placeholder="分钟"> <el-select v-model="item.params.coolingMinutes" style="width: 70px" clearable size="small" placeholder="分钟">
<el-option v-for="i in 60" :key="i" :label="i" :value="i" /> <el-option v-for="i in 60" :key="i" :label="i" :value="i" />
</el-select> </el-select>
@ -447,6 +458,10 @@ const addHandle = async () => {
</div> </div>
</div> </div>
<template v-else-if="['shaking', 'delay'].includes(item.method)"> <template v-else-if="['shaking', 'delay'].includes(item.method)">
<el-select v-model="item.params.hours" style="width: 70px" clearable size="small" placeholder="请选择">
<el-option v-for="i in 24" :key="i" :label="i" :value="i" />
</el-select>
<span class="unit-text">小时</span>
<el-select v-model="item.params.minutes" style="width: 70px" clearable size="small" placeholder="请选择"> <el-select v-model="item.params.minutes" style="width: 70px" clearable size="small" placeholder="请选择">
<el-option v-for="i in 60" :key="i" :label="i" :value="i" /> <el-option v-for="i in 60" :key="i" :label="i" :value="i" />
</el-select> </el-select>

1
src/components/home/Photo/index.vue

@ -29,6 +29,7 @@ const cancel = () => {
:max-scale="7" :max-scale="7"
:min-scale="0.2" :min-scale="0.2"
:preview-src-list="[data.url]" :preview-src-list="[data.url]"
fit="contain"
> >
<template #error> <template #error>
<div class="image-slot"> <div class="image-slot">

2
src/components/home/SavePhoto/index.vue

@ -84,6 +84,7 @@ const activeTube = ref(Array.from({ length: 16 }).fill(false))
:max-scale="7" :max-scale="7"
:min-scale="0.2" :min-scale="0.2"
:preview-src-list="[url]" :preview-src-list="[url]"
fit="contain"
> >
<template #error> <template #error>
<div class="image-slot"> <div class="image-slot">
@ -130,6 +131,7 @@ const activeTube = ref(Array.from({ length: 16 }).fill(false))
} }
} }
.tube-box { .tube-box {
width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;

1
src/views/home/index.vue

@ -345,6 +345,7 @@ const savePhoto = () => {
:max-scale="7" :max-scale="7"
:min-scale="0.2" :min-scale="0.2"
:preview-src-list="[photoUrl]" :preview-src-list="[photoUrl]"
fit="contain"
> >
<template #error> <template #error>
<div class="image-slot"> <div class="image-slot">

5
src/views/taskLog/index.vue

@ -3,7 +3,7 @@ import { delPhoto, photoList } from 'apis/home'
import Photo from 'components/home/Photo/index.vue' import Photo from 'components/home/Photo/index.vue'
import { ElMessageBox } from 'element-plus' import { ElMessageBox } from 'element-plus'
import { FtMessage } from 'libs/message' import { FtMessage } from 'libs/message'
import { ref, useTemplateRef } from 'vue'
import { h, ref, useTemplateRef } from 'vue'
const btnList = [ const btnList = [
{ {
@ -26,6 +26,9 @@ const columns = [
{ {
title: '模式', title: '模式',
key: 'mode', key: 'mode',
render: (row: any) => {
return h('el-tag', { type: 'primary' }, { default: () => row.mode === 'manual' ? '手动' : '工艺' })
},
}, },
{ {
title: '矿石名称', title: '矿石名称',

Loading…
Cancel
Save