From 632749f44e29f1475f49c70dc4dacbeec79c3061 Mon Sep 17 00:00:00 2001 From: LiLongLong <13717757313@163.com> Date: Mon, 3 Mar 2025 15:40:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8E=86=E5=8F=B2=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/services/matrix/craft.ts | 22 +++++++- src/utils/index.ts | 27 ++++++++++ src/views/History.vue | 117 ++++++++++++++++++++++++++++++++++++++-- src/views/debug/index.vue | 8 +-- src/views/matrixCraft/index.vue | 5 +- 5 files changed, 169 insertions(+), 10 deletions(-) diff --git a/src/services/matrix/craft.ts b/src/services/matrix/craft.ts index 47f05cf..7570125 100644 --- a/src/services/matrix/craft.ts +++ b/src/services/matrix/craft.ts @@ -1,6 +1,7 @@ import type { WorkType } from "../globalCmd/cmdTypes"; import httpRequest, { type BaseResponse } from "../httpRequest"; import type { CraftItem } from "@/services/matrix/type"; +import { getHistoryInfo } from '../../../../A8000/src/services/Index/history'; export function getList(params: { pageSize: number; pageNum: number }) { return httpRequest({ @@ -38,6 +39,23 @@ export function delCraft(params:CraftItem){ return httpRequest>({ url: `/api/matrixCraft/${params.id}`, params: { ...params }, - method: "PUT", + method: "DELETE", + }); +} + +export function getHistoryList(params:{pageSize:number, pageNum:number}){ + return httpRequest({ + url: `/api/log/list`, + params: { ...params }, + method: "GET", }); -} \ No newline at end of file +} + +export function delHistoryLog(params:CraftItem){ + return httpRequest({ + url: `/api/log/${params.id}`, + params, + method: "DELETE", + }); +} + diff --git a/src/utils/index.ts b/src/utils/index.ts index 64ebd70..622d192 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -7,3 +7,30 @@ export function formatRemainTime(seconds: number) { const sec = (seconds % 60).toFixed(); return min.padStart(2, "0") + ":" + sec.padStart(2, "0"); } + +export function timestampToDate(timestamp:number, format = 'YYYY-MM-DD HH:mm:ss') { + // 创建 Date 对象 + const date = new Date(timestamp); + + // 如果时间戳无效,返回错误信息 + if (isNaN(date.getTime())) { + return '时间戳无效'; + } + + // 提取日期和时间部分 + const year = String(date.getFullYear()) + const month = String(date.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始,需要加 1 + const day = String(date.getDate()).padStart(2, '0'); + const hours = String(date.getHours()).padStart(2, '0'); + const minutes = String(date.getMinutes()).padStart(2, '0'); + const seconds = String(date.getSeconds()).padStart(2, '0'); + + // 根据传入的格式返回日期字符串 + return format + .replace('YYYY', year) + .replace('MM', month) + .replace('DD', day) + .replace('HH', hours) + .replace('mm', minutes) + .replace('ss', seconds); +} \ No newline at end of file diff --git a/src/views/History.vue b/src/views/History.vue index 14ac09f..34661ed 100644 --- a/src/views/History.vue +++ b/src/views/History.vue @@ -1,5 +1,116 @@ - - + + \ No newline at end of file diff --git a/src/views/debug/index.vue b/src/views/debug/index.vue index ddc065d..9f7306a 100644 --- a/src/views/debug/index.vue +++ b/src/views/debug/index.vue @@ -168,9 +168,9 @@ -
喷涂方向
+
喷涂路线
- + 横向 纵向 @@ -252,7 +252,7 @@ SyringeParams, VoltageType, ControlValueType - } from '@/services/globalCmd/cmdTypes' +} from '@/services/globalCmd/cmdTypes' import { moveMotorToPosition, switchThreeWayValve, @@ -273,7 +273,7 @@ import { direction:'1' }) const workForm = ref>({ - direction: 1, + routeType: 1, }) const axis = ref({ index: 0 diff --git a/src/views/matrixCraft/index.vue b/src/views/matrixCraft/index.vue index 4b2201b..1a34fb4 100644 --- a/src/views/matrixCraft/index.vue +++ b/src/views/matrixCraft/index.vue @@ -12,7 +12,8 @@ @@ -67,6 +68,8 @@ import type { CraftItem } from "@/services/matrix/type"; import type { WorkType } from "@/services/globalCmd/cmdTypes"; import { ElMessage, ElMessageBox } from "element-plus"; + import route_v from "@/assets/route_vertical.png"; + import route_h from "@/assets/route_horizontal.png"; let total = ref() const settingStore = useSettingStore() let sprayVisible = ref(false)