From bb7e265335a8251eec6b0ac32061e90c0a5af241 Mon Sep 17 00:00:00 2001 From: guoapeng Date: Fri, 13 Jun 2025 15:23:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8B=8D=E7=85=A7=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=92=8C=E5=B7=A5=E8=89=BA=E7=AD=89=E5=BE=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/home.ts | 5 + src/apis/ore.ts | 2 +- src/components/common/FTTable/index.vue | 2 +- src/components/craft/AddCraft/index.vue | 26 +++-- src/components/home/Photo/index.vue | 62 +++++++++++ src/components/home/SavePhoto/index.vue | 182 ++++++++++++++++++++++++++++++++ src/router/index.ts | 3 +- src/router/routes.ts | 2 +- src/stores/systemStore.ts | 2 +- src/views/home/index.vue | 142 ++++++++++++++++--------- src/views/ore/index.vue | 168 ++++++++++++++--------------- src/views/solution/index.vue | 3 - src/views/taskLog/index.vue | 55 +++++----- 13 files changed, 469 insertions(+), 185 deletions(-) create mode 100644 src/components/home/Photo/index.vue create mode 100644 src/components/home/SavePhoto/index.vue diff --git a/src/apis/home.ts b/src/apis/home.ts index 291a15c..96efbd3 100644 --- a/src/apis/home.ts +++ b/src/apis/home.ts @@ -11,3 +11,8 @@ export const getTaskIng = (): Promise => http.get(`${baseUrl}getIngTask`) export const delTask = (params: string): Promise => http.delete(`${baseUrl}${params}`) export const trayIn = (): Promise => http.post('tray/in') export const trayOut = (): Promise => http.post('tray/out') +export const photoList = (params: System.Page): Promise => http.get('/photo/list', { params }) +export const takePhoto = (params?: { lightIntensity: number | null }): Promise => http.post('/photo/take', params) +export const savePhoto = (params: any): Promise => http.post('/photo/save', params) +export const getPhoto = (id: number): Promise => http.get(`/photo/id=${id}`) +export const delPhoto = (ids: string): Promise => http.delete(`/photo/ids=${ids}`) diff --git a/src/apis/ore.ts b/src/apis/ore.ts index 131e795..c69161e 100644 --- a/src/apis/ore.ts +++ b/src/apis/ore.ts @@ -1,6 +1,6 @@ import http from 'libs/http' -export const getOreList = (): Promise> => http.get(`/ores/list`) +export const getOreList = (params: System.Page = { pageNum: 1, pageSize: 999 }): Promise> => http.get(`/ores/list`, { params }) export const saveOre = (params: { name: string }): Promise => http.post(`/ores`, params) diff --git a/src/components/common/FTTable/index.vue b/src/components/common/FTTable/index.vue index d4c1093..51f9cf2 100644 --- a/src/components/common/FTTable/index.vue +++ b/src/components/common/FTTable/index.vue @@ -176,7 +176,7 @@ defineExpose({
- +
diff --git a/src/components/craft/AddCraft/index.vue b/src/components/craft/AddCraft/index.vue index dc014ad..0cc4bf7 100644 --- a/src/components/craft/AddCraft/index.vue +++ b/src/components/craft/AddCraft/index.vue @@ -81,7 +81,7 @@ const okHandle = async () => { }) } - if (['startHeating', 'shaking'].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 } @@ -102,11 +102,14 @@ const okHandle = async () => { case 'shaking': step.params.description = `摇匀: ${step.params.second}秒` break + case 'delay': + step.params.description = `等待: ${step.params.second}秒` + break case 'takePhoto': step.params.description = `拍照` break } - return !allPropertiesDefined(step.params, ['minutes', 'seconds', 'coolingMinutes', 'coolingSeconds', 'description', 'inTemperature']) + return !allPropertiesDefined(step.params, ['minutes', 'seconds', 'coolingMinutes', 'coolingSeconds', 'description', 'inTemperature', 'expand']) }, ) @@ -144,6 +147,7 @@ const stepMap: Record = { startHeating: { name: '加热', method: 'startHeating', params: { temperature: undefined, second: undefined, description: undefined, minutes: undefined, seconds: undefined } }, shaking: { name: '摇匀', method: 'shaking', params: { second: undefined } }, takePhoto: { name: '拍照', method: 'takePhoto', params: { } }, + delay: { name: '等待', method: 'delay', params: { second: undefined } }, } const addStep = (data: CraftTypes.StepItem) => { @@ -168,9 +172,9 @@ const addLiquidRules = { const addLiquidFormRef = ref() -const activeTube = ref(Array.from({ length: 16 }).fill(false)) +const activeTube = ref(Array.from({ length: 16 }).fill(true)) -const selectVisible = ref(false) +const selectVisible = ref(true) const checkChange = () => { activeTube.value = Array.from({ length: 16 }).fill(selectVisible.value) addLiquidForm.value.tubeNums = activeTube.value.map((item, index) => index + 1).filter(item => activeTube.value[item - 1]) @@ -193,6 +197,8 @@ const mousedownHandle = async (e: Event) => { } const addHandle = async () => { + addLiquidForm.value.tubeNums = activeTube.value.map((item, index) => index + 1).filter(item => activeTube.value[item - 1]) + addLiquidFormRef.value.validateField('tubeNums') try { const valid = await addLiquidFormRef.value.validate() if (!valid) { @@ -233,8 +239,8 @@ const addHandle = async () => { ], } - activeTube.value = Array.from({ length: 16 }).fill(false) - selectVisible.value = false + activeTube.value = Array.from({ length: 16 }).fill(true) + selectVisible.value = true addLiquidFormRef.value.resetFields() } catch (error) { @@ -357,12 +363,12 @@ const addHandle = async () => {
-
+
- + - +
@@ -440,7 +446,7 @@ const addHandle = async () => {
-