From 72c3b1f8440a2d1dad27462916b2cbfed321603c Mon Sep 17 00:00:00 2001 From: chenjiale Date: Mon, 1 Dec 2025 20:11:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E5=8F=82=E6=95=B0=E9=80=89=E6=8B=A9=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/alert/model/models.ts | 3 + src/views/model/components/PointTransfer.vue | 163 +++++++++++++++ .../model/components/pointTransferHelper.ts | 26 +++ src/views/model/list/ModelCard.vue | 143 ++++++++----- src/views/model/list/step/Step3.vue | 192 ++++++------------ src/views/model/list/step/data.tsx | 48 +---- src/views/model/train/index.vue | 88 ++------ 7 files changed, 372 insertions(+), 291 deletions(-) create mode 100644 src/views/model/components/PointTransfer.vue create mode 100644 src/views/model/components/pointTransferHelper.ts diff --git a/src/api/alert/model/models.ts b/src/api/alert/model/models.ts index 90d1b33..0de2561 100644 --- a/src/api/alert/model/models.ts +++ b/src/api/alert/model/models.ts @@ -5,6 +5,7 @@ enum Api { MODEL_CARD_LIST = '/alert/model/card/list', MODEL_INFO = '/alert/model/info', MODEL_SAVE = '/alert/model/', + MODEL_DELETE = '/alert/model/', MODEL_DATA = '/alert/model/data/', CALCULATE_BACK = '/alert/model/data/calculate/', OPTIMISTIC = '/alert/optimistic', @@ -28,6 +29,8 @@ export function modelSaveApi(params?: any) { return defHttp.post({ url: Api.MODEL_SAVE, data: params }) } +export const modelDeleteApi = (id: number | string) => defHttp.delete({ url: `${Api.MODEL_DELETE}${id}` }) + export function modelDataApi(id: any, params: any) { return defHttp.get({ url: Api.MODEL_DATA + id, params }) } diff --git a/src/views/model/components/PointTransfer.vue b/src/views/model/components/PointTransfer.vue new file mode 100644 index 0000000..5e962ce --- /dev/null +++ b/src/views/model/components/PointTransfer.vue @@ -0,0 +1,163 @@ + + + diff --git a/src/views/model/components/pointTransferHelper.ts b/src/views/model/components/pointTransferHelper.ts new file mode 100644 index 0000000..763eb0f --- /dev/null +++ b/src/views/model/components/pointTransferHelper.ts @@ -0,0 +1,26 @@ +export interface PointKeyInfo { + description: string + pointId: string + unit?: string + Lower?: string + Upper?: string +} + +export function parsePointKey(key: string | number | undefined | null): PointKeyInfo { + const safeKey = key !== undefined && key !== null ? String(key) : '' + const [description = '', pointId = '', unit = '', Lower = '', Upper = ''] = safeKey.split('|') + return { description, pointId, unit, Lower, Upper } +} + +export function buildPointKeyFromInfo(info: Partial): string { + const { description = '', pointId = '', unit = '', Lower = '', Upper = '' } = info || {} + return [description, pointId, unit, Lower, Upper].join('|') +} + +export function buildPointTitle(info: PointKeyInfo, fallback: string): string { + if (info.description && info.pointId) + return `${info.description} (${info.pointId})` + if (info.description) + return info.description + return fallback +} diff --git a/src/views/model/list/ModelCard.vue b/src/views/model/list/ModelCard.vue index 4eca609..e828e6d 100644 --- a/src/views/model/list/ModelCard.vue +++ b/src/views/model/list/ModelCard.vue @@ -1,14 +1,15 @@