From 61e8db99725a8291ec0fc89f354900ad37038e50 Mon Sep 17 00:00:00 2001 From: LiLongLong <13717757313@163.com> Date: Tue, 6 May 2025 19:53:47 +0800 Subject: [PATCH] rebase master --- src/assets/images/liquied/liquied_bottle.svg | 1 + src/components/craft/AddCraftDialog.vue | 274 +++++++++++++++++++++++++++ src/components/craft/CraftStatus.vue | 170 +++++++++++++++++ src/components/craft/TransferLeft.vue | 40 ++++ src/components/craft/TransferRight.vue | 120 ++++++++++++ src/router/routes.ts | 2 +- src/types/craft.d.ts | 95 ++++++++++ src/views/craft/AddCraftDialog.vue | 243 ------------------------ src/views/craft/CraftStatus.vue | 172 ----------------- src/views/craft/TransferLeft.vue | 40 ---- src/views/craft/TransferRight.vue | 121 ------------ src/views/craft/craftType.ts | 139 -------------- src/views/craft/craft_constant.ts | 34 ++++ src/views/craft/index.vue | 61 +++--- src/views/liquid/index.vue | 46 +++++ src/views/liquid/liquidItem.vue | 128 +++++++++++++ 16 files changed, 931 insertions(+), 755 deletions(-) create mode 100644 src/assets/images/liquied/liquied_bottle.svg create mode 100644 src/components/craft/AddCraftDialog.vue create mode 100644 src/components/craft/CraftStatus.vue create mode 100644 src/components/craft/TransferLeft.vue create mode 100644 src/components/craft/TransferRight.vue create mode 100644 src/types/craft.d.ts delete mode 100644 src/views/craft/AddCraftDialog.vue delete mode 100644 src/views/craft/CraftStatus.vue delete mode 100644 src/views/craft/TransferLeft.vue delete mode 100644 src/views/craft/TransferRight.vue delete mode 100644 src/views/craft/craftType.ts create mode 100644 src/views/craft/craft_constant.ts create mode 100644 src/views/liquid/index.vue create mode 100644 src/views/liquid/liquidItem.vue diff --git a/src/assets/images/liquied/liquied_bottle.svg b/src/assets/images/liquied/liquied_bottle.svg new file mode 100644 index 0000000..bea8fda --- /dev/null +++ b/src/assets/images/liquied/liquied_bottle.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/craft/AddCraftDialog.vue b/src/components/craft/AddCraftDialog.vue new file mode 100644 index 0000000..6803f8d --- /dev/null +++ b/src/components/craft/AddCraftDialog.vue @@ -0,0 +1,274 @@ + + + + + diff --git a/src/components/craft/CraftStatus.vue b/src/components/craft/CraftStatus.vue new file mode 100644 index 0000000..2cb8ca7 --- /dev/null +++ b/src/components/craft/CraftStatus.vue @@ -0,0 +1,170 @@ + + + + + diff --git a/src/components/craft/TransferLeft.vue b/src/components/craft/TransferLeft.vue new file mode 100644 index 0000000..b86521a --- /dev/null +++ b/src/components/craft/TransferLeft.vue @@ -0,0 +1,40 @@ + + + + + diff --git a/src/components/craft/TransferRight.vue b/src/components/craft/TransferRight.vue new file mode 100644 index 0000000..b276a7b --- /dev/null +++ b/src/components/craft/TransferRight.vue @@ -0,0 +1,120 @@ + + + + + diff --git a/src/router/routes.ts b/src/router/routes.ts index 0fbbde0..15cb3c4 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -56,7 +56,7 @@ const authRoutes: RouteRecordRaw[] = [ { path: '/liquid', name: 'liquid', - component: () => import('views/home/index.vue'), + component: () => import('views/liquid/index.vue'), meta: { isDefault: true, title: '加液配置', diff --git a/src/types/craft.d.ts b/src/types/craft.d.ts new file mode 100644 index 0000000..3b91a53 --- /dev/null +++ b/src/types/craft.d.ts @@ -0,0 +1,95 @@ +declare namespace CraftTypes { + interface UpTrayStepStruct { + method: 'upTray' + } + interface DownTrayStepStruct { + method: 'downTray' + } + interface LiquidStruct { + solId: number + volume?: number + } + interface TubeSolStruct { + tubeNum: number + addLiquidList: LiquidStruct[] + }; + interface AddLiquidStepStruct { + method: 'addLiquid' + params: { + solId?: number + volume?: number + tubeSolList?: TubeSolStruct[] + } + } + interface MoveToSolStepStruct { + method: 'moveToSol' + } + interface MoveToHeaterStepStruct { + method: 'moveToHeat' + } + interface ShakingStepStruct { + method: 'shaking' + params: { + second: number + } + } + interface StartHeatingStepStruct { + method: 'startHeating' + params: { + temperature: number + } + } + interface StopHeatingStepStruct { + method: 'stopHeating' + } + interface TakePhotoStepStruct { + method: 'takePhoto' + } + interface DelayStepStruct { + method: 'delay' + params: { + second: number + } + } + export type StepStruct = + | UpTrayStepStruct + | DownTrayStepStruct + | AddLiquidStepStruct + | MoveToSolStepStruct + | MoveToHeaterStepStruct + | ShakingStepStruct + | StartHeatingStepStruct + | StopHeatingStepStruct + | TakePhotoStepStruct + | DelayStepStruct + type StepCmd = StepStruct['method'] + interface AddCraftType { + openDialog: () => void + closeDialog: () => void + editDialog: (params: Craft) => void + } + + interface SaveRef { + setLoading: (isLoading: boolean) => void + } + + interface Craft { + id?: number + name?: string + steps?: string + oresId?: number + } + interface craftStatus { + showDialog: () => void + } + interface CraftState { + craftsId: number + craftsName: string + currentIndex: number + heatId: string + oresId: number + oresName: string + state: string + steps: StepStruct[] + } +} diff --git a/src/views/craft/AddCraftDialog.vue b/src/views/craft/AddCraftDialog.vue deleted file mode 100644 index bff8dd4..0000000 --- a/src/views/craft/AddCraftDialog.vue +++ /dev/null @@ -1,243 +0,0 @@ - - - - - diff --git a/src/views/craft/CraftStatus.vue b/src/views/craft/CraftStatus.vue deleted file mode 100644 index 0f86366..0000000 --- a/src/views/craft/CraftStatus.vue +++ /dev/null @@ -1,172 +0,0 @@ - - - - - diff --git a/src/views/craft/TransferLeft.vue b/src/views/craft/TransferLeft.vue deleted file mode 100644 index b86521a..0000000 --- a/src/views/craft/TransferLeft.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - - - diff --git a/src/views/craft/TransferRight.vue b/src/views/craft/TransferRight.vue deleted file mode 100644 index 471d925..0000000 --- a/src/views/craft/TransferRight.vue +++ /dev/null @@ -1,121 +0,0 @@ - - - - - diff --git a/src/views/craft/craftType.ts b/src/views/craft/craftType.ts deleted file mode 100644 index 35e8b1b..0000000 --- a/src/views/craft/craftType.ts +++ /dev/null @@ -1,139 +0,0 @@ -interface UpTrayStepStruct { - method: 'upTray' -} - -interface DownTrayStepStruct { - method: 'downTray' -} - -interface LiquidStruct { - solId?: number - volume?: number -} - -export interface TubeSolStruct { - tubeNum: number - addLiquidList: LiquidStruct[] -}; - -interface AddLiquidStepStruct { - method: 'addLiquid' - params: { - solId?: number - volume?: number - tubeSolList?: TubeSolStruct[] - } -} -interface MoveToSolStepStruct { - method: 'moveToSol' -} - -interface MoveToHeaterStepStruct { - method: 'moveToHeat' -} - -interface ShakingStepStruct { - method: 'shaking' - params: { - second: number - } -} - -interface StartHeatingStepStruct { - method: 'startHeating' - params: { - temperature: number - } -} - -interface StopHeatingStepStruct { - method: 'stopHeating' -} - -interface TakePhotoStepStruct { - method: 'takePhoto' -} - -interface DelayStepStruct { - method: 'delay' - params: { - second: number - } -} - -export type StepStruct = - | UpTrayStepStruct - | DownTrayStepStruct - | AddLiquidStepStruct - | MoveToSolStepStruct - | MoveToHeaterStepStruct - | ShakingStepStruct - | StartHeatingStepStruct - | StopHeatingStepStruct - | TakePhotoStepStruct - | DelayStepStruct - -export type StepCmd = StepStruct['method'] - -export interface AddCraftType { - openDialog: () => void - closeDialog: () => void - editDialog: (params: Craft) => void -} - -export interface craftStatus { - showDialog: () => void -} - -export const StepCmdDescMap: { [k in StepCmd]: string } = { - upTray: '抬起托盘', - downTray: '降下托盘', - addLiquid: '添加溶液', - moveToSol: '移至加液', - moveToHeat: '移至加热', - shaking: '摇匀', - startHeating: '开始加热', - stopHeating: '停止加热', - takePhoto: '拍照', - delay: '等待', -} - -export interface Craft { - id?: number - name?: string - steps?: string - oresId?: number -} -const list = [] - -for (let i = 0; i < 17; i++) { - let tubeInfo = { - id: 0, - name: '全部试管', - } - if (i === 0) { - tubeInfo = { - id: 0, - name: '全部试管', - } - } - else { - tubeInfo = { - id: i, - name: `${i}号试管`, - } - } - list.push(tubeInfo) -} -export const tubeSolList = list - -export interface CraftState { - craftsId: number - craftsName: string - currentIndex: number - heatId: string - oresId: number - oresName: string - state: string - steps: StepStruct[] -} diff --git a/src/views/craft/craft_constant.ts b/src/views/craft/craft_constant.ts new file mode 100644 index 0000000..ead48b3 --- /dev/null +++ b/src/views/craft/craft_constant.ts @@ -0,0 +1,34 @@ +export const StepCmdDescMap: { [k in CraftTypes.StepCmd]: string } = { + upTray: '抬起托盘', + downTray: '降下托盘', + addLiquid: '添加溶液', + moveToSol: '移至加液', + moveToHeat: '移至加热', + shaking: '摇匀', + startHeating: '开始加热', + stopHeating: '停止加热', + takePhoto: '拍照', + delay: '等待', +} + +const list = [] +for (let i = 0; i < 17; i++) { + let tubeInfo = { + id: 0, + name: '全部试管', + } + if (i === 0) { + tubeInfo = { + id: 0, + name: '全部试管', + } + } + else { + tubeInfo = { + id: i, + name: `${i}号试管`, + } + } + list.push(tubeInfo) +} +export const tubeSolList = list diff --git a/src/views/craft/index.vue b/src/views/craft/index.vue index 82a8368..3fe3214 100644 --- a/src/views/craft/index.vue +++ b/src/views/craft/index.vue @@ -1,19 +1,19 @@ + + + + diff --git a/src/views/liquid/liquidItem.vue b/src/views/liquid/liquidItem.vue new file mode 100644 index 0000000..6a8b40e --- /dev/null +++ b/src/views/liquid/liquidItem.vue @@ -0,0 +1,128 @@ + + + + +