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..610079b 100644 --- a/src/views/model/list/ModelCard.vue +++ b/src/views/model/list/ModelCard.vue @@ -1,14 +1,15 @@