From f236164a6dd496b8660c06336bdcc91d1489c7e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=82=96=E6=99=8B=E9=A3=9E?= <378266566@qq.com> Date: Tue, 23 Dec 2025 12:10:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=9C=BA=E7=BB=84=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=AD=90=E7=B3=BB=E7=BB=9F=E4=B8=8B=E6=8B=89=E6=A1=86=E7=A9=BA?= =?UTF-8?q?=E5=88=99=E5=85=A8=E9=83=A8=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/alert/run/instant/index.ts | 2 +- src/views/run/instant/index.vue | 5 +++- src/views/run/instant/instant.data.ts | 40 ++++++++++++++++++++++----- 3 files changed, 38 insertions(+), 9 deletions(-) diff --git a/src/api/alert/run/instant/index.ts b/src/api/alert/run/instant/index.ts index fccbb4e..1ffaacd 100644 --- a/src/api/alert/run/instant/index.ts +++ b/src/api/alert/run/instant/index.ts @@ -3,7 +3,7 @@ import { defHttp } from '@/utils/http/axios' export interface InstantPageReqVO extends PageParam { mpName?: string - + algorithmId?: number } export interface InstantVO { diff --git a/src/views/run/instant/index.vue b/src/views/run/instant/index.vue index 8dccb3e..8733918 100644 --- a/src/views/run/instant/index.vue +++ b/src/views/run/instant/index.vue @@ -35,7 +35,10 @@ const [registerTable, { getForm, reload, getDataSource, updateTableDataRecord }] schemas: searchFormSchema, showResetButton: false, actionColOptions: { - span: 5 + span: 3, + style: { + marginLeft: '5px', + }, }, }, diff --git a/src/views/run/instant/instant.data.ts b/src/views/run/instant/instant.data.ts index 34c28e9..f51552b 100644 --- a/src/views/run/instant/instant.data.ts +++ b/src/views/run/instant/instant.data.ts @@ -6,6 +6,7 @@ import { DICT_TYPE, getDictOptions } from '@/utils/dict' import { getModelVersionList } from '@/api/alert/run/model/index' import { optionListApi, subSystemListApi } from '@/api/alert/model/select' import type { systemSelectParams } from '@/api/alert/model/model/optionsModel' +import {setObjToUrlParams} from "@/utils"; export const columns: BasicColumn[] = [ { @@ -96,13 +97,15 @@ export const columns: BasicColumn[] = [ const optionList = await optionListApi() const systemOptions = ref([]) -systemOptions.value = optionList.systems +// systemOptions.value = optionList.systems export const searchFormSchema: FormSchema[] = [ { label: '机组', field: 'unit', component: 'Select', - defaultValue: optionList.units[0].id || null, + // defaultValue: optionList.units[0].id || null, + defaultValue: null, + colProps: { span: 4 }, componentProps: ({ schema, tableAction, formActionType, formModel }) => { @@ -120,8 +123,13 @@ export const searchFormSchema: FormSchema[] = [ unitId: e, typeId: formModel.type, } + //如果typeId是空,则不设置system'Options + if (!param.typeId) { + systemOptions.value = [] + return + } systemOptions.value = await subSystemListApi(param) - formModel.system = systemOptions.value[0].id + // formModel.system = systemOptions.value[0].id }, } }, @@ -130,7 +138,9 @@ export const searchFormSchema: FormSchema[] = [ label: '系统', field: 'type', component: 'Select', - defaultValue: optionList.types[0].id || null, + // defaultValue: optionList.types[0].id || null, + defaultValue: null, + colProps: { span: 4 }, componentProps: ({ formModel }) => { return { @@ -146,6 +156,11 @@ export const searchFormSchema: FormSchema[] = [ unitId: formModel.unit, typeId: e, } + //如果typeId是空,则不设置system'Options + if (!param.typeId) { + systemOptions.value = [] + return + } systemOptions.value = await subSystemListApi(param) }, } @@ -155,7 +170,8 @@ export const searchFormSchema: FormSchema[] = [ label: '子系统', field: 'system', component: 'Select', - defaultValue: systemOptions.value[0].id || null, + // defaultValue: systemOptions.value[0].id || null, + defaultValue: null, colProps: { span: 4 }, componentProps: () => { return { @@ -170,10 +186,20 @@ export const searchFormSchema: FormSchema[] = [ label: '模型实例名称', field: 'mpName', component: 'Input', - labelWidth: 120, + labelWidth: 100, defaultValue: '', - colProps: { span: 7 }, + colProps: { span: 5 }, + }, { + label: '算法', + field: 'algorithmId', + component: 'Select', + labelWidth: 40, + componentProps: { + options: [{ value: 1, label: "主成分分析(PCA)" }, { value: 2, label: "神经网络(ANN)" }], + }, + defaultValue: null, + colProps: { span: 3 }, }, { label: '状态1',