Browse Source

feat: update model training functionality and improve point parameter handling

pull/35/head
CJL6015 3 weeks ago
parent
commit
10eac06f11
  1. 2
      .vscode/settings.json
  2. 415
      pnpm-lock.yaml
  3. 5
      src/api/alert/model/models.ts
  4. 6
      src/views/model/list/step/Step3.vue
  5. 14
      src/views/model/train/data.tsx
  6. 175
      src/views/model/train/index.vue

2
.vscode/settings.json

@ -120,7 +120,7 @@
"source.organizeImports": "never", "source.organizeImports": "never",
"source.fixAll.stylelint": "explicit" "source.fixAll.stylelint": "explicit"
}, },
"editor.defaultFormatter": "octref.vetur" "editor.defaultFormatter": "stylelint.vscode-stylelint"
}, },
"i18n-ally.localesPaths": ["src/locales/lang"], "i18n-ally.localesPaths": ["src/locales/lang"],
"i18n-ally.keystyle": "nested", "i18n-ally.keystyle": "nested",

415
pnpm-lock.yaml

@ -4,39 +4,37 @@ settings:
autoInstallPeers: true autoInstallPeers: true
excludeLinksFromLockfile: false excludeLinksFromLockfile: false
importers:
.:
dependencies: dependencies:
'@ant-design/colors': '@ant-design/colors':
specifier: ^7.0.0 specifier: ^7.0.0
version: 7.0.0 version: 7.2.0
'@ant-design/icons-vue': '@ant-design/icons-vue':
specifier: ^7.0.1 specifier: ^7.0.1
version: 7.0.1(vue@3.3.8(typescript@5.2.2)) version: 7.0.1(vue@3.5.13)
'@iconify/iconify': '@iconify/iconify':
specifier: ^3.1.1 specifier: ^3.1.1
version: 3.1.1 version: 3.1.1
'@unocss/eslint-plugin': '@unocss/eslint-plugin':
specifier: 66.1.0-beta.12 specifier: 66.1.0-beta.12
version: 66.1.0-beta.12(eslint@8.53.0)(typescript@5.2.2) version: 66.1.0-beta.12(eslint@8.57.1)(typescript@5.8.3)
'@videojs-player/vue': '@videojs-player/vue':
specifier: ^1.0.0 specifier: ^1.0.0
version: 1.0.0(@types/video.js@7.3.55)(video.js@7.21.5)(vue@3.3.8(typescript@5.2.2)) version: 1.0.0(@types/video.js@7.3.58)(video.js@7.21.7)(vue@3.5.13)
'@vue/runtime-core': '@vue/runtime-core':
specifier: ^3.3.8 specifier: ^3.3.8
version: 3.3.8 version: 3.5.13
'@vueuse/core': '@vueuse/core':
specifier: ^10.6.1 specifier: ^10.6.1
version: 10.6.1(vue@3.3.8(typescript@5.2.2)) version: 10.11.1(vue@3.5.13)
'@zxcvbn-ts/core': '@zxcvbn-ts/core':
specifier: ^3.0.4 specifier: ^3.0.4
version: 3.0.4 version: 3.0.4
ant-design-vue: ant-design-vue:
specifier: ^4.0.7 specifier: ^4.0.7
version: 4.0.7(vue@3.3.8(typescript@5.2.2)) version: 4.2.6(vue@3.5.13)
axios: axios:
specifier: ^1.6.8 specifier: ^1.6.8
version: 1.6.8(debug@4.3.4) version: 1.9.0(debug@4.4.0)
benz-amr-recorder: benz-amr-recorder:
specifier: ^1.1.5 specifier: ^1.1.5
version: 1.1.5 version: 1.1.5
@ -48,13 +46,13 @@ importers:
version: 4.9.0 version: 4.9.0
cropperjs: cropperjs:
specifier: ^1.6.1 specifier: ^1.6.1
version: 1.6.1 version: 1.6.2
crypto-js: crypto-js:
specifier: ^4.2.0 specifier: ^4.2.0
version: 4.2.0 version: 4.2.0
dayjs: dayjs:
specifier: ^1.11.10 specifier: ^1.11.10
version: 1.11.10 version: 1.11.13
echarts: echarts:
specifier: ^5.6.0 specifier: ^5.6.0
version: 5.6.0 version: 5.6.0
@ -69,80 +67,81 @@ importers:
version: 0.2.0 version: 0.2.0
path-to-regexp: path-to-regexp:
specifier: ^6.2.1 specifier: ^6.2.1
version: 6.2.1 version: 6.3.0
pinia: pinia:
specifier: ^2.1.7 specifier: ^2.1.7
version: 2.1.7(typescript@5.2.2)(vue@3.3.8(typescript@5.2.2)) version: 2.3.1(typescript@5.8.3)(vue@3.5.13)
pinia-plugin-persistedstate: pinia-plugin-persistedstate:
specifier: ^3.2.0 specifier: ^3.2.0
version: 3.2.0(pinia@2.1.7(typescript@5.2.2)(vue@3.3.8(typescript@5.2.2))) version: 3.2.3(pinia@2.3.1)
print-js: print-js:
specifier: ^1.6.0 specifier: ^1.6.0
version: 1.6.0 version: 1.6.0
qs: qs:
specifier: ^6.11.2 specifier: ^6.11.2
version: 6.11.2 version: 6.14.0
resize-observer-polyfill: resize-observer-polyfill:
specifier: ^1.5.1 specifier: ^1.5.1
version: 1.5.1 version: 1.5.1
sortablejs: sortablejs:
specifier: ^1.15.0 specifier: ^1.15.0
version: 1.15.0 version: 1.15.6
tinymce: tinymce:
specifier: 5.10.7 specifier: 5.10.7
version: 5.10.7 version: 5.10.7
vditor: vditor:
specifier: ^3.9.6 specifier: ^3.9.6
version: 3.9.6 version: 3.11.0
video.js: video.js:
specifier: ^7.21.5 specifier: ^7.21.5
version: 7.21.5 version: 7.21.7
vue: vue:
specifier: ^3.3.8 specifier: ^3.3.8
version: 3.3.8(typescript@5.2.2) version: 3.5.13(typescript@5.8.3)
vue-echarts: vue-echarts:
specifier: ^7.0.3 specifier: ^7.0.3
version: 7.0.3(@vue/runtime-core@3.3.8)(echarts@5.6.0)(vue@3.3.8(typescript@5.2.2)) version: 7.0.3(@vue/runtime-core@3.5.13)(echarts@5.6.0)(vue@3.5.13)
vue-i18n: vue-i18n:
specifier: ^9.6.5 specifier: ^9.6.5
version: 9.6.5(vue@3.3.8(typescript@5.2.2)) version: 9.14.4(vue@3.5.13)
vue-json-pretty: vue-json-pretty:
specifier: ^2.2.4 specifier: ^2.2.4
version: 2.2.4(vue@3.3.8(typescript@5.2.2)) version: 2.4.0(vue@3.5.13)
vue-router: vue-router:
specifier: 4.2.5 specifier: 4.2.5
version: 4.2.5(vue@3.3.8(typescript@5.2.2)) version: 4.2.5(vue@3.5.13)
vue-types: vue-types:
specifier: ^5.1.1 specifier: ^5.1.1
version: 5.1.1(vue@3.3.8(typescript@5.2.2)) version: 5.1.3(vue@3.5.13)
vuedraggable: vuedraggable:
specifier: ^4.1.0 specifier: ^4.1.0
version: 4.1.0(vue@3.3.8(typescript@5.2.2)) version: 4.1.0(vue@3.5.13)
xlsx: xlsx:
specifier: ^0.18.5 specifier: ^0.18.5
version: 0.18.5 version: 0.18.5
devDependencies: devDependencies:
'@antfu/eslint-config': '@antfu/eslint-config':
specifier: ^1.1.1 specifier: ^1.1.1
version: 1.1.1(eslint@8.53.0)(typescript@5.2.2) version: 1.2.1(eslint@8.57.1)(typescript@5.8.3)
'@commitlint/cli': '@commitlint/cli':
specifier: ^18.4.1 specifier: ^18.4.1
version: 18.4.1(typescript@5.2.2) version: 18.6.1(@types/node@20.17.30)(typescript@5.8.3)
'@commitlint/config-conventional': '@commitlint/config-conventional':
specifier: ^18.4.0 specifier: ^18.4.0
version: 18.4.0 version: 18.6.3
'@iconify/json': '@iconify/json':
specifier: ^2.2.141 specifier: ^2.2.141
version: 2.2.141 version: 2.2.331
'@purge-icons/generated': '@purge-icons/generated':
specifier: ^0.9.0 specifier: ^0.9.0
version: 0.9.0 version: 0.9.0
'@types/codemirror': '@types/codemirror':
specifier: ^5.60.13 specifier: ^5.60.13
version: 5.60.13 version: 5.60.15
'@types/crypto-js': '@types/crypto-js':
specifier: ^4.2.1 specifier: ^4.2.1
version: 4.2.1 version: 4.2.2
'@types/fs-extra': '@types/fs-extra':
specifier: ^11.0.4 specifier: ^11.0.4
version: 11.0.4 version: 11.0.4
@ -151,150 +150,150 @@ importers:
version: 9.0.7 version: 9.0.7
'@types/lodash-es': '@types/lodash-es':
specifier: ^4.17.11 specifier: ^4.17.11
version: 4.17.11 version: 4.17.12
'@types/node': '@types/node':
specifier: ^20.9.0 specifier: ^20.9.0
version: 20.9.0 version: 20.17.30
'@types/nprogress': '@types/nprogress':
specifier: ^0.2.3 specifier: ^0.2.3
version: 0.2.3 version: 0.2.3
'@types/qs': '@types/qs':
specifier: ^6.9.10 specifier: ^6.9.10
version: 6.9.10 version: 6.9.18
'@types/sortablejs': '@types/sortablejs':
specifier: ^1.15.5 specifier: ^1.15.5
version: 1.15.5 version: 1.15.8
'@unocss/eslint-config': '@unocss/eslint-config':
specifier: ^0.57.3 specifier: ^0.57.3
version: 0.57.3(eslint@8.53.0)(typescript@5.2.2) version: 0.57.7(eslint@8.57.1)(typescript@5.8.3)
'@vitejs/plugin-vue': '@vitejs/plugin-vue':
specifier: 4.4.1 specifier: 4.4.1
version: 4.4.1(vite@4.5.0(@types/node@20.9.0)(less@4.2.0)(terser@5.24.0))(vue@3.3.8(typescript@5.2.2)) version: 4.4.1(vite@4.5.13)(vue@3.5.13)
'@vitejs/plugin-vue-jsx': '@vitejs/plugin-vue-jsx':
specifier: ^3.0.2 specifier: ^3.0.2
version: 3.0.2(vite@4.5.0(@types/node@20.9.0)(less@4.2.0)(terser@5.24.0))(vue@3.3.8(typescript@5.2.2)) version: 3.1.0(vite@4.5.13)(vue@3.5.13)
'@vue/compiler-sfc': '@vue/compiler-sfc':
specifier: ^3.3.8 specifier: ^3.3.8
version: 3.3.8 version: 3.5.13
cross-env: cross-env:
specifier: ^7.0.3 specifier: ^7.0.3
version: 7.0.3 version: 7.0.3
cz-git: cz-git:
specifier: ^1.7.1 specifier: ^1.7.1
version: 1.7.1 version: 1.11.1
czg: czg:
specifier: ^1.7.1 specifier: ^1.7.1
version: 1.7.1 version: 1.11.1
dotenv: dotenv:
specifier: ^16.3.1 specifier: ^16.3.1
version: 16.3.1 version: 16.5.0
eslint: eslint:
specifier: ^8.53.0 specifier: ^8.53.0
version: 8.53.0 version: 8.57.1
esno: esno:
specifier: ^4.0.0 specifier: ^4.0.0
version: 4.0.0 version: 4.8.0
fs-extra: fs-extra:
specifier: ^11.1.1 specifier: ^11.1.1
version: 11.1.1 version: 11.3.0
inquirer: inquirer:
specifier: ^9.2.12 specifier: ^9.2.12
version: 9.2.12 version: 9.3.7
less: less:
specifier: ^4.2.0 specifier: ^4.2.0
version: 4.2.0 version: 4.3.0
lint-staged: lint-staged:
specifier: ^15.1.0 specifier: ^15.1.0
version: 15.1.0 version: 15.5.1
picocolors: picocolors:
specifier: ^1.0.0 specifier: ^1.0.0
version: 1.0.0 version: 1.1.1
postcss: postcss:
specifier: ^8.4.31 specifier: ^8.4.31
version: 8.4.31 version: 8.5.3
postcss-html: postcss-html:
specifier: ^1.5.0 specifier: ^1.5.0
version: 1.5.0 version: 1.8.0
postcss-less: postcss-less:
specifier: ^6.0.0 specifier: ^6.0.0
version: 6.0.0(postcss@8.4.31) version: 6.0.0(postcss@8.5.3)
prettier: prettier:
specifier: ^3.1.0 specifier: ^3.1.0
version: 3.1.0 version: 3.5.3
rimraf: rimraf:
specifier: ^5.0.5 specifier: ^5.0.5
version: 5.0.5 version: 5.0.10
rollup: rollup:
specifier: ^4.4.0 specifier: ^4.4.0
version: 4.4.0 version: 4.40.0
rollup-plugin-visualizer: rollup-plugin-visualizer:
specifier: ^5.9.2 specifier: ^5.9.2
version: 5.9.2(rollup@4.4.0) version: 5.14.0(rollup@4.40.0)
stylelint: stylelint:
specifier: ^15.11.0 specifier: ^15.11.0
version: 15.11.0(typescript@5.2.2) version: 15.11.0(typescript@5.8.3)
stylelint-config-recess-order: stylelint-config-recess-order:
specifier: ^4.3.0 specifier: ^4.3.0
version: 4.3.0(stylelint@15.11.0(typescript@5.2.2)) version: 4.6.0(stylelint@15.11.0)
stylelint-config-recommended: stylelint-config-recommended:
specifier: ^13.0.0 specifier: ^13.0.0
version: 13.0.0(stylelint@15.11.0(typescript@5.2.2)) version: 13.0.0(stylelint@15.11.0)
stylelint-config-recommended-vue: stylelint-config-recommended-vue:
specifier: ^1.5.0 specifier: ^1.5.0
version: 1.5.0(postcss-html@1.5.0)(stylelint@15.11.0(typescript@5.2.2)) version: 1.6.0(postcss-html@1.8.0)(stylelint@15.11.0)
stylelint-config-standard: stylelint-config-standard:
specifier: ^34.0.0 specifier: ^34.0.0
version: 34.0.0(stylelint@15.11.0(typescript@5.2.2)) version: 34.0.0(stylelint@15.11.0)
stylelint-order: stylelint-order:
specifier: ^6.0.3 specifier: ^6.0.3
version: 6.0.3(stylelint@15.11.0(typescript@5.2.2)) version: 6.0.4(stylelint@15.11.0)
stylelint-prettier: stylelint-prettier:
specifier: ^4.0.2 specifier: ^4.0.2
version: 4.0.2(prettier@3.1.0)(stylelint@15.11.0(typescript@5.2.2)) version: 4.1.0(prettier@3.5.3)(stylelint@15.11.0)
terser: terser:
specifier: ^5.24.0 specifier: ^5.24.0
version: 5.24.0 version: 5.39.0
typescript: typescript:
specifier: ^5.2.2 specifier: ^5.2.2
version: 5.2.2 version: 5.8.3
unocss: unocss:
specifier: ^0.57.3 specifier: ^0.57.3
version: 0.57.3(postcss@8.4.31)(rollup@4.4.0)(vite@4.5.0(@types/node@20.9.0)(less@4.2.0)(terser@5.24.0)) version: 0.57.7(postcss@8.5.3)(rollup@4.40.0)(vite@4.5.13)
vite: vite:
specifier: ^4.5.0 specifier: ^4.5.0
version: 4.5.0(@types/node@20.9.0)(less@4.2.0)(terser@5.24.0) version: 4.5.13(@types/node@20.17.30)(less@4.3.0)(terser@5.39.0)
vite-plugin-compression: vite-plugin-compression:
specifier: ^0.5.1 specifier: ^0.5.1
version: 0.5.1(vite@4.5.0(@types/node@20.9.0)(less@4.2.0)(terser@5.24.0)) version: 0.5.1(vite@4.5.13)
vite-plugin-mkcert: vite-plugin-mkcert:
specifier: ^1.16.0 specifier: ^1.16.0
version: 1.16.0(vite@4.5.0(@types/node@20.9.0)(less@4.2.0)(terser@5.24.0)) version: 1.17.8(vite@4.5.13)
vite-plugin-progress: vite-plugin-progress:
specifier: ^0.0.7 specifier: ^0.0.7
version: 0.0.7(vite@4.5.0(@types/node@20.9.0)(less@4.2.0)(terser@5.24.0)) version: 0.0.7(vite@4.5.13)
vite-plugin-purge-icons: vite-plugin-purge-icons:
specifier: ^0.9.2 specifier: ^0.9.2
version: 0.9.2(vite@4.5.0(@types/node@20.9.0)(less@4.2.0)(terser@5.24.0)) version: 0.9.2(vite@4.5.13)
vite-plugin-pwa: vite-plugin-pwa:
specifier: ^0.16.7 specifier: ^0.16.7
version: 0.16.7(vite@4.5.0(@types/node@20.9.0)(less@4.2.0)(terser@5.24.0))(workbox-build@7.0.0)(workbox-window@7.0.0) version: 0.16.7(vite@4.5.13)(workbox-build@7.3.0)(workbox-window@7.3.0)
vite-plugin-svg-icons: vite-plugin-svg-icons:
specifier: ^2.0.1 specifier: ^2.0.1
version: 2.0.1(vite@4.5.0(@types/node@20.9.0)(less@4.2.0)(terser@5.24.0)) version: 2.0.1(vite@4.5.13)
vite-vue-plugin-html: vite-vue-plugin-html:
specifier: ^1.0.5 specifier: ^1.0.5
version: 1.0.5(rollup@4.4.0)(vite@4.5.0(@types/node@20.9.0)(less@4.2.0)(terser@5.24.0)) version: 1.0.5(rollup@4.40.0)(vite@4.5.13)
vue-tsc: vue-tsc:
specifier: ^1.8.22 specifier: ^1.8.22
version: 1.8.22(typescript@5.2.2) version: 1.8.27(typescript@5.8.3)
packages: packages:
'@aashutoshrathi/word-wrap@1.2.6': '@aashutoshrathi/word-wrap@1.2.6':
resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
'@ampproject/remapping@2.2.1': /@ampproject/remapping@2.3.0:
resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==}
engines: {node: '>=6.0.0'} engines: {node: '>=6.0.0'}
'@ant-design/colors@6.0.0': '@ant-design/colors@6.0.0':
@ -1371,78 +1370,16 @@ packages:
peerDependenciesMeta: peerDependenciesMeta:
rollup: rollup:
optional: true optional: true
dependencies:
rollup: 2.79.2
serialize-javascript: 6.0.2
smob: 1.5.0
terser: 5.39.0
dev: true
'@rollup/rollup-android-arm-eabi@4.4.0': /@rollup/pluginutils@3.1.0(rollup@2.79.2):
resolution: {integrity: sha512-AD30wtT58hZZsXIeiksytR6Gm2gofUxn5KqrDBdyzekgxXB9bXN9dqWIEcPfYo9lA9MVRm0lC42LuYGsscRxiA==} resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==}
cpu: [arm] engines: {node: '>= 8.0.0'}
os: [android]
'@rollup/rollup-android-arm64@4.4.0':
resolution: {integrity: sha512-PlqvhzFxy5FRTB3wLSsGgPhiakv9jrgfu8tjSojLJFP0CdhfZSRDOFvQ2emWLUEBOSCnjpL63XSuFVMwg59ZtA==}
cpu: [arm64]
os: [android]
'@rollup/rollup-darwin-arm64@4.4.0':
resolution: {integrity: sha512-BYmhn1Hebmkmdyn5mBFy7HptowyjtMALyTpywNSNZYigWwyv4L8WQVr0XvOQE7eE6WoKrupSVxtIcGZW8MgZUA==}
cpu: [arm64]
os: [darwin]
'@rollup/rollup-darwin-x64@4.4.0':
resolution: {integrity: sha512-7GXsMiX/giTDBMs/gL3rePLBRC6gV7DT7JQ0lNqoNDe5hm+Gm4NEWky9fwEmer64fIUbOsTiLUsyQ5fDXUbXPA==}
cpu: [x64]
os: [darwin]
'@rollup/rollup-linux-arm-gnueabihf@4.4.0':
resolution: {integrity: sha512-kavnkaV50Gu6vESlOAwUad92wYY9mUrcaPmhzOQZKlNFnzWAUYyD/uhHmWvY7Z2chtwhWlng0LvCRBF5QiPO7w==}
cpu: [arm]
os: [linux]
'@rollup/rollup-linux-arm64-gnu@4.4.0':
resolution: {integrity: sha512-2hBHEtCjnBTeuLvDAlHRCqsuFQSyAhTQs9vbZEVBTV8ap35pDI1ukPbIVFFCWNvL/KE7xRor5YZFvfyGCfvLnA==}
cpu: [arm64]
os: [linux]
'@rollup/rollup-linux-arm64-musl@4.4.0':
resolution: {integrity: sha512-u7zy0Ygzl7O5Gvr9TSNSQj+DBzvMJC7rXfyQNgZ13KwkhgJ8z0z+gt2AO4RPd01rZioMQ2/TA24XGGg4xqhd0Q==}
cpu: [arm64]
os: [linux]
'@rollup/rollup-linux-x64-gnu@4.4.0':
resolution: {integrity: sha512-VvpAdh5SgewmWo8sa5QPYG8aSKH9hU2Kr5+3of0GzBI/8n8PBqhLyvF0DbO+zDW8j5IM8NDebv82MpHrZaD0Cw==}
cpu: [x64]
os: [linux]
'@rollup/rollup-linux-x64-musl@4.4.0':
resolution: {integrity: sha512-3g6jaXxXVFaDnFoMn2+E3ludGcXFfEr6lDn+S1lh9Qe0JcL9sPt1wGh0g2cKIlb6OakNOFopZqJ5Yub9F7gQlA==}
cpu: [x64]
os: [linux]
'@rollup/rollup-win32-arm64-msvc@4.4.0':
resolution: {integrity: sha512-jnoDRkg5Ve6Y1qx2m1+ehouOLQ4ddc15/iQSfFjcDUL6bqLdJJ5c4CKfUy/C6W1oCU4la+hMkveE9GG7ECN7dg==}
cpu: [arm64]
os: [win32]
'@rollup/rollup-win32-ia32-msvc@4.4.0':
resolution: {integrity: sha512-SoLQmJanozFow8o50ul2a3R+J7nk4pEhrp83PzTSXs5OzOmIZbPSp5kihtQ3f6ypo4MCbmh0V8Ev0bJIEp4Azw==}
cpu: [ia32]
os: [win32]
'@rollup/rollup-win32-x64-msvc@4.4.0':
resolution: {integrity: sha512-Zaz6itfQ5sQF5Cia49YDW1ZTr+YfIKzTSb9npLyvQn346n7ulRDOv2J7GnL0zcOJ3cqW7HzG/ZisyO6fH43J9g==}
cpu: [x64]
os: [win32]
'@simonwep/pickr@1.8.2':
resolution: {integrity: sha512-/l5w8BIkrpP6n1xsetx9MWPWlU6OblN5YgZZphxan0Tq4BByTCETL6lyIeY8lagalS2Nbt4F2W034KHLIiunKA==}
'@stylistic/eslint-plugin-js@1.1.0':
resolution: {integrity: sha512-7yDOvKQvtTXIJMVcKNGfpYSJJhwTbOrDcMDgYqWbtS9LyHmuzxvnR748bQ21pQyi6aZR2E7edwKsdKmZlXc9Rg==}
'@stylistic/eslint-plugin-jsx@1.1.0':
resolution: {integrity: sha512-XMTAYQ9t7ZoWjqciqOy99O0sRCHh/6x/Q4Dm8sCVKzKlsnPzVlXzAD0htNqHG+Fu7qyGblDqb0/7PNJXBdQc5Q==}
'@stylistic/eslint-plugin-ts@1.1.0':
resolution: {integrity: sha512-vqlinwzTNSKoFaVcVKE2iVGKX62NKIJfkhEI+5uuufYcAhfjfOK3KQY0zhdUeshEUkBVR0uRrJzH1/Cj/2Unfg==}
peerDependencies: peerDependencies:
eslint: '*' eslint: '*'
@ -5387,185 +5324,6 @@ packages:
peerDependenciesMeta: peerDependenciesMeta:
vue: vue:
optional: true optional: true
vue@3.3.8:
resolution: {integrity: sha512-5VSX/3DabBikOXMsxzlW8JyfeLKlG9mzqnWgLQLty88vdZL7ZJgrdgBOmrArwxiLtmS+lNNpPcBYqrhE6TQW5w==}
peerDependencies:
typescript: '*'
peerDependenciesMeta:
typescript:
optional: true
vuedraggable@4.1.0:
resolution: {integrity: sha512-FU5HCWBmsf20GpP3eudURW3WdWTKIbEIQxh9/8GE806hydR9qZqRRxRE3RjqX7PkuLuMQG/A7n3cfj9rCEchww==}
peerDependencies:
vue: ^3.0.1
warning@4.0.3:
resolution: {integrity: sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==}
wcwidth@1.0.1:
resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==}
webidl-conversions@3.0.1:
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
webidl-conversions@4.0.2:
resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==}
whatwg-url@5.0.0:
resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==}
whatwg-url@7.1.0:
resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==}
which-boxed-primitive@1.0.2:
resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==}
which-typed-array@1.1.13:
resolution: {integrity: sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==}
engines: {node: '>= 0.4'}
which@1.3.1:
resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==}
hasBin: true
which@2.0.2:
resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==}
engines: {node: '>= 8'}
hasBin: true
wmf@1.0.2:
resolution: {integrity: sha512-/p9K7bEh0Dj6WbXg4JG0xvLQmIadrner1bi45VMJTfnbVHsc7yIajZyoSoK60/dtVBs12Fm6WkUI5/3WAVsNMw==}
engines: {node: '>=0.8'}
word@0.3.0:
resolution: {integrity: sha512-OELeY0Q61OXpdUfTp+oweA/vtLVg5VDOXh+3he3PNzLGG/y0oylSOC1xRVj0+l4vQ3tj/bB1HVHv1ocXkQceFA==}
engines: {node: '>=0.8'}
workbox-background-sync@7.0.0:
resolution: {integrity: sha512-S+m1+84gjdueM+jIKZ+I0Lx0BDHkk5Nu6a3kTVxP4fdj3gKouRNmhO8H290ybnJTOPfBDtTMXSQA/QLTvr7PeA==}
workbox-broadcast-update@7.0.0:
resolution: {integrity: sha512-oUuh4jzZrLySOo0tC0WoKiSg90bVAcnE98uW7F8GFiSOXnhogfNDGZelPJa+6KpGBO5+Qelv04Hqx2UD+BJqNQ==}
workbox-build@7.0.0:
resolution: {integrity: sha512-CttE7WCYW9sZC+nUYhQg3WzzGPr4IHmrPnjKiu3AMXsiNQKx+l4hHl63WTrnicLmKEKHScWDH8xsGBdrYgtBzg==}
engines: {node: '>=16.0.0'}
workbox-cacheable-response@7.0.0:
resolution: {integrity: sha512-0lrtyGHn/LH8kKAJVOQfSu3/80WDc9Ma8ng0p2i/5HuUndGttH+mGMSvOskjOdFImLs2XZIimErp7tSOPmu/6g==}
workbox-core@7.0.0:
resolution: {integrity: sha512-81JkAAZtfVP8darBpfRTovHg8DGAVrKFgHpOArZbdFd78VqHr5Iw65f2guwjE2NlCFbPFDoez3D3/6ZvhI/rwQ==}
workbox-expiration@7.0.0:
resolution: {integrity: sha512-MLK+fogW+pC3IWU9SFE+FRStvDVutwJMR5if1g7oBJx3qwmO69BNoJQVaMXq41R0gg3MzxVfwOGKx3i9P6sOLQ==}
workbox-google-analytics@7.0.0:
resolution: {integrity: sha512-MEYM1JTn/qiC3DbpvP2BVhyIH+dV/5BjHk756u9VbwuAhu0QHyKscTnisQuz21lfRpOwiS9z4XdqeVAKol0bzg==}
deprecated: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained
workbox-navigation-preload@7.0.0:
resolution: {integrity: sha512-juWCSrxo/fiMz3RsvDspeSLGmbgC0U9tKqcUPZBCf35s64wlaLXyn2KdHHXVQrb2cqF7I0Hc9siQalainmnXJA==}
workbox-precaching@7.0.0:
resolution: {integrity: sha512-EC0vol623LJqTJo1mkhD9DZmMP604vHqni3EohhQVwhJlTgyKyOkMrZNy5/QHfOby+39xqC01gv4LjOm4HSfnA==}
workbox-range-requests@7.0.0:
resolution: {integrity: sha512-SxAzoVl9j/zRU9OT5+IQs7pbJBOUOlriB8Gn9YMvi38BNZRbM+RvkujHMo8FOe9IWrqqwYgDFBfv6sk76I1yaQ==}
workbox-recipes@7.0.0:
resolution: {integrity: sha512-DntcK9wuG3rYQOONWC0PejxYYIDHyWWZB/ueTbOUDQgefaeIj1kJ7pdP3LZV2lfrj8XXXBWt+JDRSw1lLLOnww==}
workbox-routing@7.0.0:
resolution: {integrity: sha512-8YxLr3xvqidnbVeGyRGkaV4YdlKkn5qZ1LfEePW3dq+ydE73hUUJJuLmGEykW3fMX8x8mNdL0XrWgotcuZjIvA==}
workbox-strategies@7.0.0:
resolution: {integrity: sha512-dg3qJU7tR/Gcd/XXOOo7x9QoCI9nk74JopaJaYAQ+ugLi57gPsXycVdBnYbayVj34m6Y8ppPwIuecrzkpBVwbA==}
workbox-streams@7.0.0:
resolution: {integrity: sha512-moVsh+5to//l6IERWceYKGiftc+prNnqOp2sgALJJFbnNVpTXzKISlTIsrWY+ogMqt+x1oMazIdHj25kBSq/HQ==}
workbox-sw@7.0.0:
resolution: {integrity: sha512-SWfEouQfjRiZ7GNABzHUKUyj8pCoe+RwjfOIajcx6J5mtgKkN+t8UToHnpaJL5UVVOf5YhJh+OHhbVNIHe+LVA==}
workbox-window@7.0.0:
resolution: {integrity: sha512-j7P/bsAWE/a7sxqTzXo3P2ALb1reTfZdvVp6OJ/uLr/C2kZAMvjeWGm8V4htQhor7DOvYg0sSbFN2+flT5U0qA==}
wrap-ansi@6.2.0:
resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==}
engines: {node: '>=8'}
wrap-ansi@7.0.0:
resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==}
engines: {node: '>=10'}
wrap-ansi@8.1.0:
resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==}
engines: {node: '>=12'}
wrappy@1.0.2:
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
write-file-atomic@5.0.1:
resolution: {integrity: sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==}
engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0}
xlsx@0.18.5:
resolution: {integrity: sha512-dmg3LCjBPHZnQp5/F/+nnTa+miPJxUXB6vtk42YjBBKayDNagxGEeIdWApkYPOf3Z3pm3k62Knjzp7lMeTEtFQ==}
engines: {node: '>=0.8'}
hasBin: true
xml-name-validator@4.0.0:
resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==}
engines: {node: '>=12'}
y18n@5.0.8:
resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}
engines: {node: '>=10'}
yallist@3.1.1:
resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==}
yallist@4.0.0:
resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==}
yaml-eslint-parser@1.2.2:
resolution: {integrity: sha512-pEwzfsKbTrB8G3xc/sN7aw1v6A6c/pKxLAkjclnAyo5g5qOh6eL9WGu0o3cSDQZKrTNk4KL4lQSwZW+nBkANEg==}
engines: {node: ^14.17.0 || >=16.0.0}
yaml@2.3.3:
resolution: {integrity: sha512-zw0VAJxgeZ6+++/su5AFoqBbZbrEakwu+X0M5HmcwUiBL7AzcuPKjj5we4xfQLp78LkEMpD0cOnUhmgOVy3KdQ==}
engines: {node: '>= 14'}
yaml@2.3.4:
resolution: {integrity: sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==}
engines: {node: '>= 14'}
yargs-parser@20.2.9:
resolution: {integrity: sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==}
engines: {node: '>=10'}
yargs-parser@21.1.1:
resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==}
engines: {node: '>=12'}
yargs@17.7.2:
resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==}
engines: {node: '>=12'}
yocto-queue@0.1.0:
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
engines: {node: '>=10'}
zrender@5.6.1:
resolution: {integrity: sha512-OFXkDJKcrlx5su2XbzJvj/34Q3m6PvyCZkVPHGYpcCJ52ek4U/ymZyfuV1nKE23AyBJ51E/6Yr0mhZ7xGTO4ag==}
snapshots:
'@aashutoshrathi/word-wrap@1.2.6': {}
'@ampproject/remapping@2.2.1':
dependencies: dependencies:
'@jridgewell/gen-mapping': 0.3.3 '@jridgewell/gen-mapping': 0.3.3
'@jridgewell/trace-mapping': 0.3.20 '@jridgewell/trace-mapping': 0.3.20
@ -11556,3 +11314,4 @@ snapshots:
zrender@5.6.1: zrender@5.6.1:
dependencies: dependencies:
tslib: 2.3.0 tslib: 2.3.0
dev: false

5
src/api/alert/model/models.ts

@ -8,12 +8,13 @@ enum Api {
MODEL_DATA = '/alert/model/data/', MODEL_DATA = '/alert/model/data/',
CALCULATE_BACK = '/alert/model/data/calculate/', CALCULATE_BACK = '/alert/model/data/calculate/',
OPTIMISTIC = '/alert/optimistic', OPTIMISTIC = '/alert/optimistic',
TRAIN_MODEL = '/alert/model/train',
} }
export function modelCardListApi(params?: ModelQueryParams) { export function modelCardListApi(params?: ModelQueryParams) {
return defHttp.get<ModelCardItem[]>({ url: Api.MODEL_CARD_LIST, params }) return defHttp.get<ModelCardItem[]>({ url: Api.MODEL_CARD_LIST, params })
} }
export const modelInfoApi = (id: any) => defHttp.get<ModelInfo>({ url: `${Api.MODEL_INFO}/${id}` }) export const modelInfoApi = (id: any) => defHttp.get<any>({ url: `${Api.MODEL_INFO}/${id}` })
export function updateModelInfo(params: any) { export function updateModelInfo(params: any) {
return defHttp.patch<boolean>({ url: Api.MODEL_INFO, params }) return defHttp.patch<boolean>({ url: Api.MODEL_INFO, params })
@ -31,3 +32,5 @@ export function calculateBackApi(id: any, params: any) {
return defHttp.post<boolean>({ url: Api.CALCULATE_BACK + id, params }) return defHttp.post<boolean>({ url: Api.CALCULATE_BACK + id, params })
} }
export const getOptimisticApi = (params: any) => defHttp.get<any>({ url: Api.OPTIMISTIC, params }) export const getOptimisticApi = (params: any) => defHttp.get<any>({ url: Api.OPTIMISTIC, params })
export const trainModelApi = (params: any) => defHttp.post<any>({ url: Api.TRAIN_MODEL, data: params })

6
src/views/model/list/step/Step3.vue

@ -93,10 +93,10 @@ export default defineComponent({
const point = values[key].split('|') const point = values[key].split('|')
const p = { const p = {
description: point[0], description: point[0],
point: point[1], pointId: point[1],
unit: point[2], unit: point[2],
upperlimit: point[3], Lower: point[3],
lowerlimit: point[4], Upper: point[4],
} }
pointInfo.push(p) pointInfo.push(p)
} }

14
src/views/model/train/data.tsx

@ -75,7 +75,7 @@ export const boundaryTableSchema: BasicColumn[] = [
}, },
] ]
export const relationTableSchema: BasicColumn[] = [ export const pointTableSchema: BasicColumn[] = [
{ {
title: '描述', title: '描述',
width: 150, width: 150,
@ -84,7 +84,7 @@ export const relationTableSchema: BasicColumn[] = [
{ {
title: '点号', title: '点号',
width: 150, width: 150,
dataIndex: 'point', dataIndex: 'pointId',
}, },
{ {
title: '单位', title: '单位',
@ -94,15 +94,21 @@ export const relationTableSchema: BasicColumn[] = [
{ {
title: '上限 ', title: '上限 ',
width: 150, width: 150,
dataIndex: 'upperlimit', dataIndex: 'Upper',
edit: true, edit: true,
}, },
{ {
title: '下限', title: '下限',
width: 150, width: 150,
dataIndex: 'lowerlimit', dataIndex: 'Lower',
edit: true, edit: true,
}, },
{
title: '编辑',
width: 100,
dataIndex: 'action',
slots: { customRender: 'action' },
},
] ]
export const sampleInfoTableSchema: BasicColumn[] = [ export const sampleInfoTableSchema: BasicColumn[] = [

175
src/views/model/train/index.vue

@ -7,19 +7,23 @@ import { computed, defineComponent, onMounted, ref, watch } from 'vue'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import { import {
Card, Card,
Checkbox,
Descriptions, Descriptions,
Divider, Divider,
Form, Form,
FormItem, FormItem,
Input,
InputNumber,
Modal,
RangePicker, RangePicker,
Steps, Steps,
Tabs, Tabs,
} from 'ant-design-vue' } from 'ant-design-vue'
import VueECharts from 'vue-echarts' import VueECharts from 'vue-echarts'
import { relationTableSchema, sampleInfoTableSchema } from './data' import { pointTableSchema, sampleInfoTableSchema } from './data'
import { BasicTable, useTable } from '@/components/Table' import { BasicTable, useTable } from '@/components/Table'
import { PageWrapper } from '@/components/Page' import { PageWrapper } from '@/components/Page'
import { modelInfoApi, updateModelInfo } from '@/api/alert/model/models' import { modelInfoApi, trainModelApi, updateModelInfo } from '@/api/alert/model/models'
import { getExaHistorys } from '@/api/alert/exa/index' import { getExaHistorys } from '@/api/alert/exa/index'
import { useECharts } from '@/hooks/web/useECharts' import { useECharts } from '@/hooks/web/useECharts'
@ -39,6 +43,10 @@ export default defineComponent({
AForm: Form, AForm: Form,
AFormItem: FormItem, AFormItem: FormItem,
VueECharts, VueECharts,
AModal: Modal,
AInput: Input,
ACheckbox: Checkbox,
AInputNumber: InputNumber,
}, },
setup() { setup() {
const route = useRoute() const route = useRoute()
@ -54,7 +62,7 @@ export default defineComponent({
const pointData = computed(() => model.value?.pointInfo || []) const pointData = computed(() => model.value?.pointInfo || [])
const [pointTable] = useTable({ const [pointTable] = useTable({
columns: relationTableSchema, columns: pointTableSchema,
pagination: false, pagination: false,
dataSource: pointData, dataSource: pointData,
scroll: { y: 300 }, scroll: { y: 300 },
@ -72,7 +80,7 @@ export default defineComponent({
type RangeValue = [Dayjs, Dayjs] type RangeValue = [Dayjs, Dayjs]
const currentDate: Dayjs = dayjs() const currentDate: Dayjs = dayjs()
const lastMonthDate: Dayjs = currentDate.subtract(1, 'day') const lastMonthDate: Dayjs = currentDate.subtract(1, 'day')
const rangeValue: RangeValue = [lastMonthDate, currentDate] const rangeValue: RangeValue = [dayjs('2023-10-28 00:00:00'), dayjs('2023-10-28 23:59:59')]
const historyTime = ref<RangeValue>(rangeValue) const historyTime = ref<RangeValue>(rangeValue)
const historyList = ref<any[]>([]) const historyList = ref<any[]>([])
const echartsRefs = ref<any[]>([]) const echartsRefs = ref<any[]>([])
@ -83,29 +91,44 @@ export default defineComponent({
const params = { const params = {
startTime: historyTime.value[0].format('YYYY-MM-DD HH:mm:ss'), startTime: historyTime.value[0].format('YYYY-MM-DD HH:mm:ss'),
endTime: historyTime.value[1].format('YYYY-MM-DD HH:mm:ss'), endTime: historyTime.value[1].format('YYYY-MM-DD HH:mm:ss'),
itemName: model.value?.pointInfo.map(item => item.point).join(','), itemName: model.value?.pointInfo.map(item => item.pointId).join(','),
} }
console.log(params) console.log(params)
const history = await getExaHistorys(params) const history = await getExaHistorys(params)
historyList.value = history historyList.value = history.map((item, index) => {
const point = model.value?.pointInfo[index]
return {
data: item,
name: `${index}.${point?.description}(${point?.pointId})`,
}
})
echartsRefs.value = Array.from({ length: historyList.value.length }) echartsRefs.value = Array.from({ length: historyList.value.length })
console.log('echartsRefs', echartsRefs.value) console.log('echartsRefs', echartsRefs.value)
brushActivated.value = new Set() brushActivated.value = new Set()
} }
function getOption(item: any) { function getOption(item: any) {
console.log('getOption', item)
return { return {
xAxis: { xAxis: {
type: 'time', type: 'time',
}, },
yAxis: { type: 'value' }, yAxis: { type: 'value' },
series: [{ data: item, type: 'line', smooth: true, symbol: 'none' }], series: [{ data: item.data, type: 'line', smooth: true, symbol: 'none' }],
dataZoom: [{}], dataZoom: [{}],
brush: { brush: {
toolbox: ['lineX'], toolbox: ['lineX'],
xAxisIndex: 0, xAxisIndex: 0,
brushType: 'lineX', brushType: 'lineX',
}, },
grid: [
{
left: 60,
right: 50,
bottom: 50,
top: 30,
},
],
} }
} }
@ -239,8 +262,11 @@ export default defineComponent({
// model // model
watch( watch(
model, model,
(val) => { (newVal, oldVal) => {
updateModelInfoDebounced(val) console.log('model changed:', newVal, oldVal)
if (oldVal === null)
return
updateModelInfoDebounced(newVal)
}, },
{ deep: true }, { deep: true },
) )
@ -270,6 +296,83 @@ export default defineComponent({
}) })
} }
async function trainModel() {
const modelInfo = model.value
if (!modelInfo || !modelInfo.id) {
console.error('模型信息不完整,无法训练')
return
}
const pointInfo = modelInfo.pointInfo || []
if (pointInfo.length === 0) {
console.error('模型参数点信息为空,无法训练')
return
}
const params = {
condition: '1==1',
Hyper_para: {
percent: modelInfo.rate,
},
Train_Data: {
points: pointInfo.map(item => item.pointId).join(','),
dead: pointInfo.map(item => item.dead ? '1' : '0').join(','),
limit: pointInfo.map(item => item.limit ? '1' : '0').join(','),
uplow: pointInfo.map(item => `${item.Upper},${item.Lower}`).join(';'),
interval: modelInfo.sampling * 1000,
time: modelInfo.trainTime.map(item => `${item.st},${item.et}`).join(';'),
},
type: 'PCA',
smote_config: '[]',
smote: true,
}
const response = await trainModelApi(params)
console.log('模型训练结果:', response)
}
const editForm = ref({
index: -1,
Upper: '',
Lower: '',
lowerBound: '',
upperBound: '',
dead: false,
limit: true,
})
const openEditPointModal = ref<boolean>(false)
let pointEditRecord = null
function editPoint() {
//
console.log('编辑点')
model.value.pointInfo[editForm.value.index] = {
...model.value.pointInfo[editForm.value.index],
Upper: editForm.value.Upper,
Lower: editForm.value.Lower,
lowerBound: editForm.value.lowerBound,
upperBound: editForm.value.upperBound,
dead: editForm.value.dead,
limit: editForm.value.limit,
}
pointEditRecord.Upper = editForm.value.Upper
pointEditRecord.Lower = editForm.value.Lower
pointEditRecord.lowerBound = editForm.value.lowerBound
pointEditRecord.upperBound = editForm.value.upperBound
pointEditRecord.dead = editForm.value.dead
pointEditRecord.limit = editForm.value.limit
openEditPointModal.value = false
}
function openPointModal(index, record) {
openEditPointModal.value = true
pointEditRecord = record
editForm.value = {
index,
Upper: record?.Upper ?? '',
Lower: record?.Lower ?? '',
lowerBound: record?.lowerBound ?? '',
upperBound: record?.upperBound ?? '',
dead: record?.dead ?? false,
limit: record?.limit ?? true,
}
}
return { return {
pointTable, pointTable,
model, model,
@ -285,6 +388,11 @@ export default defineComponent({
onBrushSelected, onBrushSelected,
trainTimeTable, trainTimeTable,
handleDeleteTrainTime, handleDeleteTrainTime,
openEditPointModal,
editPoint,
openPointModal,
editForm,
trainModel,
} }
}, },
}) })
@ -302,7 +410,7 @@ export default defineComponent({
</template> </template>
<a-descriptions size="small" :column="4" bordered> <a-descriptions size="small" :column="4" bordered>
<a-descriptions-item label="模型名称"> <a-descriptions-item label="模型名称">
{{ model?.modelName }} {{ model?.name }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="描述"> <a-descriptions-item label="描述">
{{ model?.description || '暂无描述' }} {{ model?.description || '暂无描述' }}
@ -314,13 +422,13 @@ export default defineComponent({
暂无 暂无
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="创建人"> <a-descriptions-item label="创建人">
{{ model?.creator }} {{ model?.founder }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="创建时间"> <a-descriptions-item label="创建时间">
{{ model?.createTime }} {{ model?.creatTime }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="最近修改人"> <a-descriptions-item label="最近修改人">
{{ model?.modifier || '暂无' }} {{ model?.Modifier || '暂无' }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="最近修改时间"> <a-descriptions-item label="最近修改时间">
{{ model?.modifiedTime || '暂无' }} {{ model?.modifiedTime || '暂无' }}
@ -347,7 +455,7 @@ export default defineComponent({
{{ model?.precision }} {{ model?.precision }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="训练总时长(h)"> <a-descriptions-item label="训练总时长(h)">
{{ model?.principal }} {{ (model?.trainTime.reduce((total, item) => total + item.duration, 0) / 3600).toFixed(2) || '暂无' }}
</a-descriptions-item> </a-descriptions-item>
<a-descriptions-item label="有效样本数"> <a-descriptions-item label="有效样本数">
{{ model?.principal }} {{ model?.principal }}
@ -367,7 +475,13 @@ export default defineComponent({
</BasicTable> </BasicTable>
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="2" tab="测点参数"> <a-tab-pane key="2" tab="测点参数">
<BasicTable @register="pointTable" /> <BasicTable @register="pointTable">
<template #action="{ record, index }">
<a-button type="primary" @click="openPointModal(index, record)">
编辑
</a-button>
</template>
</BasicTable>
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</a-card> </a-card>
@ -379,20 +493,49 @@ export default defineComponent({
<a-range-picker v-model:value="historyTime" show-time @change="getHistory" /> <a-range-picker v-model:value="historyTime" show-time @change="getHistory" />
</a-form-item> </a-form-item>
</a-form> </a-form>
<a-button type="primary" style="margin-left: auto;"> <a-button type="primary" style="margin-left: auto;" @click="trainModel">
模型训练 模型训练
</a-button> </a-button>
</div> </div>
<a-divider /> <a-divider />
<div v-for="(item, index) in historyList" :key="index" class="echart-box"> <div v-for="(item, index) in historyList" :key="index" class="echart-box">
<a-card :bordered="false" style="margin-bottom: 16px;">
<template #title>
<span style="font-size: 20px;">{{ item.name }}</span>
</template>
<VueECharts <VueECharts
:ref="(el) => setEchartsRef(el, index)" :option="getOption(item)" autoresize :ref="(el) => setEchartsRef(el, index)" :option="getOption(item)" autoresize
style="width: 100%; height: 300px" @finished="() => onChartFinished(index)" style="width: 100%; height: 300px" @finished="() => onChartFinished(index)"
@brush-selected="onBrushSelected" @brush-selected="onBrushSelected"
/> />
</a-card>
</div> </div>
</a-card> </a-card>
</div> </div>
<a-modal v-model:open="openEditPointModal" title="更改上下限" @ok="editPoint">
<a-form :model="editForm" :label-col="{ span: 7 }" :wrapper-col="{ span: 15 }">
<a-form-item label="上限">
<a-input-number v-model:value="editForm.Upper" placeholder="请输入上限" />
</a-form-item>
<a-form-item label="下限">
<a-input-number v-model:value="editForm.Lower" placeholder="请输入下限" />
</a-form-item>
<a-form-item label="残差上限">
<a-input-number v-model:value="editForm.upperBound" placeholder="请输入残差上限" />
</a-form-item>
<a-form-item label="残差下限">
<a-input-number v-model:value="editForm.lowerBound" placeholder="请输入残差下限" />
</a-form-item>
<a-form-item label="清洗方式" style="margin-top: 16px;">
<a-checkbox v-model:checked="editForm.dead">
死区清洗
</a-checkbox>
<a-checkbox v-model:checked="editForm.limit">
限值清洗
</a-checkbox>
</a-form-item>
</a-form>
</a-modal>
</PageWrapper> </PageWrapper>
</template> </template>

Loading…
Cancel
Save