From 8d14d6db916c95d5268fed45927e88122a2bdc26 Mon Sep 17 00:00:00 2001 From: Jiale Date: Tue, 27 May 2025 20:52:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3=EF=BC=8C=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=8F=82=E6=95=B0=E7=B1=BB=E5=9E=8B=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=95=B0=E6=8D=AE=E8=A1=A8=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 2 +- package.json | 3 +- pnpm-lock.yaml | 38 +- src/api/alert/exa/index.ts | 6 +- src/api/alert/model/model/models.ts | 6 +- src/api/alert/model/models.ts | 4 +- src/utils/lib/echarts.ts | 2 + src/views/model/list/step/Step3.vue | 3 +- src/views/model/train/data.tsx | 52 ++- src/views/model/train/index.vue | 565 ++++++++++++++++++---------- 10 files changed, 459 insertions(+), 222 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 5c0f4e1..33edcab 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -120,7 +120,7 @@ "source.organizeImports": "never", "source.fixAll.stylelint": "explicit" }, - "editor.defaultFormatter": "stylelint.vscode-stylelint" + "editor.defaultFormatter": "octref.vetur" }, "i18n-ally.localesPaths": ["src/locales/lang"], "i18n-ally.keystyle": "nested", diff --git a/package.json b/package.json index 0900fe8..9b21939 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "cropperjs": "^1.6.1", "crypto-js": "^4.2.0", "dayjs": "^1.11.10", - "echarts": "^5.4.3", + "echarts": "^5.6.0", "lodash-es": "^4.17.21", "moment": "^2.30.1", "nprogress": "^0.2.0", @@ -74,6 +74,7 @@ "vditor": "^3.9.6", "video.js": "^7.21.5", "vue": "^3.3.8", + "vue-echarts": "^7.0.3", "vue-i18n": "^9.6.5", "vue-json-pretty": "^2.2.4", "vue-router": "4.2.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 745594d..35823b4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -54,7 +54,7 @@ dependencies: specifier: ^1.11.10 version: 1.11.13 echarts: - specifier: ^5.4.3 + specifier: ^5.6.0 version: 5.6.0 lodash-es: specifier: ^4.17.21 @@ -98,6 +98,9 @@ dependencies: vue: specifier: ^3.3.8 version: 3.5.13(typescript@5.8.3) + vue-echarts: + specifier: ^7.0.3 + version: 7.0.3(@vue/runtime-core@3.5.13)(echarts@5.6.0)(vue@3.5.13) vue-i18n: specifier: ^9.6.5 version: 9.14.4(vue@3.5.13) @@ -10046,6 +10049,21 @@ packages: fsevents: 2.3.3 dev: true + /vue-demi@0.13.11(vue@3.5.13): + resolution: {integrity: sha512-IR8HoEEGM65YY3ZJYAjMlKygDQn25D5ajNFNoKh9RSDMQtlzCxtfQjdQgv9jjK+m3377SsJXY8ysq8kLCZL25A==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + peerDependencies: + '@vue/composition-api': ^1.0.0-rc.1 + vue: ^3.0.0-0 || ^2.6.0 + peerDependenciesMeta: + '@vue/composition-api': + optional: true + dependencies: + vue: 3.5.13(typescript@5.8.3) + dev: false + /vue-demi@0.14.10(vue@3.5.13): resolution: {integrity: sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==} engines: {node: '>=12'} @@ -10061,6 +10079,24 @@ packages: vue: 3.5.13(typescript@5.8.3) dev: false + /vue-echarts@7.0.3(@vue/runtime-core@3.5.13)(echarts@5.6.0)(vue@3.5.13): + resolution: {integrity: sha512-/jSxNwOsw5+dYAUcwSfkLwKPuzTQ0Cepz1LxCOpj2QcHrrmUa/Ql0eQqMmc1rTPQVrh2JQ29n2dhq75ZcHvRDw==} + peerDependencies: + '@vue/runtime-core': ^3.0.0 + echarts: ^5.5.1 + vue: ^2.7.0 || ^3.1.1 + peerDependenciesMeta: + '@vue/runtime-core': + optional: true + dependencies: + '@vue/runtime-core': 3.5.13 + echarts: 5.6.0 + vue: 3.5.13(typescript@5.8.3) + vue-demi: 0.13.11(vue@3.5.13) + transitivePeerDependencies: + - '@vue/composition-api' + dev: false + /vue-eslint-parser@9.4.3(eslint@8.57.1): resolution: {integrity: sha512-2rYRLWlIpaiN8xbPiDyXZXRgLGOtWxERV7ND5fFAv5qo1D2N9Fu9MNajBNc6o13lZ+24DAWCkQCvj4klgmcITg==} engines: {node: ^14.17.0 || >=16.0.0} diff --git a/src/api/alert/exa/index.ts b/src/api/alert/exa/index.ts index 4660a8c..7137d64 100644 --- a/src/api/alert/exa/index.ts +++ b/src/api/alert/exa/index.ts @@ -8,8 +8,8 @@ export interface EXAPageReqVO extends PageParam { export interface EXAHistoryReqVO { itemName?: string - startTime?: Date - endTime?: Date + startTime?: string + endTime?: string } @@ -77,5 +77,3 @@ export function deletePoint(ItemName: string) { export function importTemplate() { return defHttp.get({ url: '/alert/exa/get-import-template', responseType: 'blob' }) } - - diff --git a/src/api/alert/model/model/models.ts b/src/api/alert/model/model/models.ts index c1ef2dc..0a2dcca 100644 --- a/src/api/alert/model/model/models.ts +++ b/src/api/alert/model/model/models.ts @@ -17,14 +17,10 @@ export interface ModelInfo { id: number btmState: string unitID: string - createName: string + creator: string createTime: string modelName: string - movingWindows: MovingWindows steadyPoint: any[] - targetParameter: any - relationParameter: any[] - boundaryParameter: any[] } export interface ModelQueryParams { diff --git a/src/api/alert/model/models.ts b/src/api/alert/model/models.ts index 33e56cb..29eea36 100644 --- a/src/api/alert/model/models.ts +++ b/src/api/alert/model/models.ts @@ -3,7 +3,7 @@ import { defHttp } from '@/utils/http/axios' enum Api { MODEL_CARD_LIST = '/alert/model/card/list', - MODEL_INFO = '/alert/model/info/', + MODEL_INFO = '/alert/model/info', MODEL_SAVE = '/alert/model/', MODEL_DATA = '/alert/model/data/', CALCULATE_BACK = '/alert/model/data/calculate/', @@ -13,7 +13,7 @@ export function modelCardListApi(params?: ModelQueryParams) { return defHttp.get({ url: Api.MODEL_CARD_LIST, params }) } -export const modelInfoApi = (id: any) => defHttp.get({ url: Api.MODEL_INFO + id }) +export const modelInfoApi = (id: any) => defHttp.get({ url: `${Api.MODEL_INFO}/${id}` }) export function updateModelInfo(params: any) { return defHttp.patch({ url: Api.MODEL_INFO, params }) diff --git a/src/utils/lib/echarts.ts b/src/utils/lib/echarts.ts index 715d08b..dd6782b 100644 --- a/src/utils/lib/echarts.ts +++ b/src/utils/lib/echarts.ts @@ -4,6 +4,7 @@ import { BarChart, GaugeChart, LineChart, MapChart, PictorialBarChart, PieChart, import { AriaComponent, + BrushComponent, CalendarComponent, DataZoomComponent, GraphicComponent, @@ -26,6 +27,7 @@ echarts.use([ TitleComponent, TooltipComponent, GridComponent, + BrushComponent, PolarComponent, AriaComponent, ParallelComponent, diff --git a/src/views/model/list/step/Step3.vue b/src/views/model/list/step/Step3.vue index 3310cc5..9e5eccb 100644 --- a/src/views/model/list/step/Step3.vue +++ b/src/views/model/list/step/Step3.vue @@ -93,7 +93,7 @@ export default defineComponent({ const point = values[key].split('|') const p = { description: point[0], - targetPoint: point[1], + point: point[1], unit: point[2], upperlimit: point[3], lowerlimit: point[4], @@ -102,6 +102,7 @@ export default defineComponent({ } } const modelInfo = toRaw(props.beforeData) + modelInfo.pointInfo = pointInfo const modelId = await modelSaveApi(modelInfo) setProps({ submitButtonOptions: { diff --git a/src/views/model/train/data.tsx b/src/views/model/train/data.tsx index 6263171..6b4098a 100644 --- a/src/views/model/train/data.tsx +++ b/src/views/model/train/data.tsx @@ -1,4 +1,4 @@ -import { BasicColumn } from '/@/components/Table/src/types/table'; +import type { BasicColumn } from '@/components/Table/src/types/table' export const targetTableSchema: BasicColumn[] = [ { @@ -35,7 +35,7 @@ export const targetTableSchema: BasicColumn[] = [ width: 150, dataIndex: 'realTimeValue', }, -]; +] export const boundaryTableSchema: BasicColumn[] = [ { @@ -73,25 +73,23 @@ export const boundaryTableSchema: BasicColumn[] = [ dataIndex: 'gridNumber', edit: true, }, -]; +] export const relationTableSchema: BasicColumn[] = [ { title: '描述', width: 150, dataIndex: 'description', - edit: true, }, { title: '点号', width: 150, - dataIndex: 'targetPoint', + dataIndex: 'point', }, { title: '单位', width: 150, dataIndex: 'unit', - edit: true, }, { title: '上限 ', @@ -105,4 +103,44 @@ export const relationTableSchema: BasicColumn[] = [ dataIndex: 'lowerlimit', edit: true, }, -]; +] + +export const sampleInfoTableSchema: BasicColumn[] = [ + { + title: '开始时间', + width: 180, + dataIndex: 'st', + }, + { + title: '结束时间', + width: 180, + dataIndex: 'et', + }, + { + title: '时长(秒)', + width: 120, + dataIndex: 'duration', + }, + { + title: '采样数量', + width: 120, + dataIndex: 'number', + }, + { + title: '清洗样本数', + width: 120, + dataIndex: 'filter', + }, + { + title: '有效样本数', + width: 120, + dataIndex: 'mode', + }, + { + title: '操作', + width: 100, + dataIndex: 'action', + slots: { customRender: 'action' }, + fixed: 'right', + }, +] diff --git a/src/views/model/train/index.vue b/src/views/model/train/index.vue index 75aca6e..ab37273 100644 --- a/src/views/model/train/index.vue +++ b/src/views/model/train/index.vue @@ -1,24 +1,318 @@ + + -