From 0af0ed8fb39f1b193eed92b6f8699b1b52dc756f Mon Sep 17 00:00:00 2001 From: zhangjiming Date: Sun, 2 Mar 2025 18:59:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=8Estore=E8=AF=BB=E5=8F=96=E5=B7=A5?= =?UTF-8?q?=E8=89=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 36 ++++-- src/services/globalCmd/cmdTypes.ts | 12 +- src/services/globalCmd/globalCmd.ts | 15 ++- src/services/matrix/craft.ts | 28 ++--- src/services/matrix/type.ts | 32 ++++-- src/stores/setting.ts | 16 +++ src/views/SprayView.vue | 218 +++++++++++++++++++++++++----------- 7 files changed, 245 insertions(+), 112 deletions(-) create mode 100644 src/stores/setting.ts diff --git a/src/App.vue b/src/App.vue index 423bd6e..5e3c86e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,20 +1,32 @@ - + diff --git a/src/services/globalCmd/cmdTypes.ts b/src/services/globalCmd/cmdTypes.ts index 9d725f7..60be61e 100644 --- a/src/services/globalCmd/cmdTypes.ts +++ b/src/services/globalCmd/cmdTypes.ts @@ -13,12 +13,14 @@ export type SyringeType = { }; }; type PositionType = { - x: number; - y: number; + x1: number; + y1: number; + x2: number; + y2: number; }; -type PositionListType = PositionType[]; + export type WorkType = { - direction: 1 | 2; + routeType: 1 | 2; space: number; nitrogenFlowVelocity: number; nitrogenAirPressure: number; @@ -27,7 +29,7 @@ export type WorkType = { needPower?: boolean; height: number; movementSpeed: number; - position: PositionListType; + position: PositionType[]; }; export type MachineryType = { diff --git a/src/services/globalCmd/globalCmd.ts b/src/services/globalCmd/globalCmd.ts index 976d171..d266238 100644 --- a/src/services/globalCmd/globalCmd.ts +++ b/src/services/globalCmd/globalCmd.ts @@ -61,6 +61,15 @@ export function stopWork() { return httpRequest>({ url: "/api/cmd/stopWork", method: "POST" }); } -export function rotate(params:any){ - return httpRequest>({ url: "/api/cmd/rotate",params, method: "POST" }); -} \ No newline at end of file +export function rotate(params: any) { + return httpRequest>({ url: "/api/cmd/rotate", params, method: "POST" }); +} + +type SprayParam = { + matrixId: number; + matrixCraftId: number; +} & WorkType; + +export function startSpray(params: SprayParam) { + return httpRequest({ url: "/api/cmd/startWork", params, method: "POST" }); +} diff --git a/src/services/matrix/craft.ts b/src/services/matrix/craft.ts index e0faeb5..e329b93 100644 --- a/src/services/matrix/craft.ts +++ b/src/services/matrix/craft.ts @@ -1,18 +1,18 @@ import httpRequest, { type BaseResponse } from "../httpRequest"; +import type { CraftItem } from "./type"; -export function getList(params:{pageSize:number, pageNum:number}){ - return httpRequest({ - url: "/api/matrixCraft/list", - params: { ...params }, - method: "GET", - }); +export function getList(params: { pageSize: number; pageNum: number }) { + return httpRequest({ + url: "/api/matrixCraft/list", + params: { ...params }, + method: "GET", + }); } - -export function getListByMatrixId(params:{matrixId:number}){ - return httpRequest({ - url: "/api/matrixCraft/getListByMatrixId", - params: { ...params }, - method: "GET", - }); -} \ No newline at end of file +export function getListByMatrixId(params: { matrixId: number }) { + return httpRequest>({ + url: `/api/matrixCraft/getListByMatrixId/${params.matrixId}`, + params: { ...params }, + method: "GET", + }); +} diff --git a/src/services/matrix/type.ts b/src/services/matrix/type.ts index d9f1de5..3880371 100644 --- a/src/services/matrix/type.ts +++ b/src/services/matrix/type.ts @@ -1,20 +1,28 @@ +import type { WorkType } from "../globalCmd/cmdTypes"; + export type ResponseParams = { - pageNum: number; - pageSize: number; -} + pageNum: number; + pageSize: number; +}; export const defaultParams = { - pageNum: 1, - pageSize: 10 -} + pageNum: 1, + pageSize: 10, +}; export type MatrixItem = { - id: number; - name: string; - isSelected?: boolean; + id: number; + name: string; + isSelected?: boolean; }; export type MatrixItemList = { - list:MatrixItem, - total:number -} + list: MatrixItem; + total: number; +}; + +export type CraftItem = { + id: number; + name: string; + matrixId: number; +} & WorkType; diff --git a/src/stores/setting.ts b/src/stores/setting.ts new file mode 100644 index 0000000..69938e5 --- /dev/null +++ b/src/stores/setting.ts @@ -0,0 +1,16 @@ +import { defineStore } from "pinia"; +import { ref } from "vue"; +import * as R from "ramda"; +import type { MatrixItem } from "@/services/matrix/type"; + +export const useSettingStore = defineStore("setting", () => { + const matrixList = ref([]); + const setMatrixList = (data: MatrixItem[]) => { + matrixList.value = data; + }; + + return { + matrixList, + setMatrixList, + }; +}); diff --git a/src/views/SprayView.vue b/src/views/SprayView.vue index c6c93cd..201fc67 100644 --- a/src/views/SprayView.vue +++ b/src/views/SprayView.vue @@ -3,31 +3,67 @@

喷涂路线

- icon - icon - - + icon + icon + +
-
- +
+
+ + + + +
+ + class="flex justify-around mt-3 w-[848px]"> @@ -35,61 +71,82 @@
-
+
-
+
Z轴高度 毫米 氮气流速 毫米/每秒 氮气气压 MPa≥0.35 基质流速 ul/min 是否加电
-
-
+
+
V @@ -97,50 +154,47 @@ 移动速度 毫米/每秒 行间距 毫米 + +
+ +
+ +