From ec73a6bf6f26325dd9462de9b3a463c58a7a1683 Mon Sep 17 00:00:00 2001 From: LiLongLong <13717757313@163.com> Date: Wed, 30 Apr 2025 10:02:54 +0800 Subject: [PATCH] =?UTF-8?q?rebase=20=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 - src/apis/crafts.ts | 22 ++++ src/assets/images/icon_add_s.svg | 1 + src/assets/images/icon_arr_s.svg | 1 + src/assets/images/icon_del_s.svg | 1 + src/assets/styles/tailwind.css | 36 ------ src/main.ts | 1 + src/stores/useLiquidsStore.ts | 18 +++ src/views/craft/AddCraftDialog.vue | 217 +++++++++++++++++++++++++++++++++++++ src/views/craft/TransferLeft.vue | 40 +++++++ src/views/craft/TransferRight.vue | 118 ++++++++++++++++++++ src/views/craft/craftType.ts | 114 +++++++++++++++++++ src/views/craft/index.vue | 148 +++++++++++++++++++++++-- vite.config.ts | 2 +- 14 files changed, 672 insertions(+), 48 deletions(-) create mode 100644 src/apis/crafts.ts create mode 100644 src/assets/images/icon_add_s.svg create mode 100644 src/assets/images/icon_arr_s.svg create mode 100644 src/assets/images/icon_del_s.svg delete mode 100644 src/assets/styles/tailwind.css create mode 100644 src/stores/useLiquidsStore.ts create mode 100644 src/views/craft/AddCraftDialog.vue create mode 100644 src/views/craft/TransferLeft.vue create mode 100644 src/views/craft/TransferRight.vue create mode 100644 src/views/craft/craftType.ts diff --git a/package.json b/package.json index eb9f497..ef6708b 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,6 @@ "postcss-url": "^10.1.3", "postcss-viewport-units": "^0.1.6", "postcss-write-svg": "^3.0.1", - "tailwindcss": "^4.1.4", "vue": "^3.5.13", "vue-router": "^4.5.0", "ws": "^8.18.1" diff --git a/src/apis/crafts.ts b/src/apis/crafts.ts new file mode 100644 index 0000000..eb38389 --- /dev/null +++ b/src/apis/crafts.ts @@ -0,0 +1,22 @@ +import http from 'libs/http' + +interface Craft { + id?: number + name?: string + steps?: string + oresId?: number +} + +export const getCraftList = (params: any): Promise => http.get(`/crafts/list/${params.oresId}`) + +export const createCraft = (params: Craft): Promise => http.post('/crafts', params) + +export const updateCraft = (params: Craft): Promise => http.put(`/crafts`, params) + +export const delCraft = (ids: string): Promise => http.delete(`/crafts/${ids}`) + +// 开始执行工艺 +export const startCraft = (params: { heatId: string }): Promise => http.post(`/crafts/start`, params) + +// 加热区配置工艺 +export const setCraft = (params: { heatId?: string | number, craftId?: string | number }): Promise => http.post(`/crafts/set`, params) diff --git a/src/assets/images/icon_add_s.svg b/src/assets/images/icon_add_s.svg new file mode 100644 index 0000000..01e459a --- /dev/null +++ b/src/assets/images/icon_add_s.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/images/icon_arr_s.svg b/src/assets/images/icon_arr_s.svg new file mode 100644 index 0000000..b0d97d8 --- /dev/null +++ b/src/assets/images/icon_arr_s.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/images/icon_del_s.svg b/src/assets/images/icon_del_s.svg new file mode 100644 index 0000000..89fe347 --- /dev/null +++ b/src/assets/images/icon_del_s.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/styles/tailwind.css b/src/assets/styles/tailwind.css deleted file mode 100644 index 5bb2778..0000000 --- a/src/assets/styles/tailwind.css +++ /dev/null @@ -1,36 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; - -@layer utilities { - .btn-dark { - display: flex; - justify-content: center; - align-items: center; - background: var(--primaryColor); - border: solid 1px var(--primaryColor); - border-radius: 4px; - color: white; - } - .btn-light { - display: flex; - justify-content: center; - align-items: center; - background-color: transparent; - border-radius: 4px; - color: var(--primaryColor); - border: solid 1px var(--primaryColor); - } - .btn-light:active { - background-color: #e5e5e5; - } - .btn-light-disabled { - color: #d6d6d6; - border: solid 1px #d6d6d6; - } - .component-page { - height: calc(100vh - var(--headerHeight) - var(--footerHeight)); - width: calc(100vw - var(--menuAreaWidth)); - background-color: #fff; - } -} diff --git a/src/main.ts b/src/main.ts index 6d0810a..d192ce9 100644 --- a/src/main.ts +++ b/src/main.ts @@ -11,6 +11,7 @@ import App from './app.vue' import router from './router' import 'element-plus/dist/index.css' import 'assets/styles/main.scss' +import 'assets/styles/tailwind.css' const app = createApp(App) for (const [key, component] of Object.entries(ElementPlusIconsVue)) { diff --git a/src/stores/useLiquidsStore.ts b/src/stores/useLiquidsStore.ts new file mode 100644 index 0000000..9061cae --- /dev/null +++ b/src/stores/useLiquidsStore.ts @@ -0,0 +1,18 @@ +import { defineStore } from 'pinia' + +interface liquids { + id: number + name: string +} +export const useLiquidStore = defineStore('liquid', () => { + const liquids: liquids[] = [{ + id: 1, + name: '硫酸', + },{ + id: 2, + name: '硝酸', + }] + return { + liquids, + } +}) diff --git a/src/views/craft/AddCraftDialog.vue b/src/views/craft/AddCraftDialog.vue new file mode 100644 index 0000000..eaf41e3 --- /dev/null +++ b/src/views/craft/AddCraftDialog.vue @@ -0,0 +1,217 @@ + + + + + diff --git a/src/views/craft/TransferLeft.vue b/src/views/craft/TransferLeft.vue new file mode 100644 index 0000000..b86521a --- /dev/null +++ b/src/views/craft/TransferLeft.vue @@ -0,0 +1,40 @@ + + + + + diff --git a/src/views/craft/TransferRight.vue b/src/views/craft/TransferRight.vue new file mode 100644 index 0000000..fd01666 --- /dev/null +++ b/src/views/craft/TransferRight.vue @@ -0,0 +1,118 @@ + + + + + diff --git a/src/views/craft/craftType.ts b/src/views/craft/craftType.ts new file mode 100644 index 0000000..b9b778c --- /dev/null +++ b/src/views/craft/craftType.ts @@ -0,0 +1,114 @@ +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 TransferRightType { + getstepInfo: () => 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 < 16; i++) { + list.push({ + id: i + 1, + name: `${i + 1}号试管`, + }) +} +export const tubeSolList = list diff --git a/src/views/craft/index.vue b/src/views/craft/index.vue index 1feff49..05283d0 100644 --- a/src/views/craft/index.vue +++ b/src/views/craft/index.vue @@ -1,44 +1,172 @@ diff --git a/vite.config.ts b/vite.config.ts index dc56826..549e038 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -107,4 +107,4 @@ export default defineConfig(({ mode }) => { }, }, } -}) +}) \ No newline at end of file