From 1176fc3029bd0ae92afd62650fce29c828a52142 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 17:09:55 +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/views/warn/alarm/alarm.data.ts | 42 +++++++++++++++++++++--------- src/views/warn/alarm/index.vue | 4 +-- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/src/views/warn/alarm/alarm.data.ts b/src/views/warn/alarm/alarm.data.ts index c422f8b..cc6c8f6 100644 --- a/src/views/warn/alarm/alarm.data.ts +++ b/src/views/warn/alarm/alarm.data.ts @@ -14,14 +14,16 @@ export const searchFormSchema: FormSchema[] = [ label: '机组', field: 'unit', component: 'Select', - defaultValue: optionList.units[0].id || null, - colProps: { span: 5 }, + // defaultValue: optionList.units[0].id || null, + defaultValue: null, + + colProps: { span: 4 }, componentProps: ({ schema, tableAction, formActionType, formModel }) => { return { // xxxx props allowClear: false, - placeholder: '请选择机组', + placeholder: '全部机组', options: optionList.units.map(unit => ({ value: unit.id, label: unit.name })), onChange: async (e: any) => { // const { reload } = tableAction @@ -32,8 +34,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 }, } }, @@ -42,12 +49,14 @@ export const searchFormSchema: FormSchema[] = [ label: '系统', field: 'type', component: 'Select', - defaultValue: optionList.types[0].id || null, - colProps: { span: 5 }, + // defaultValue: optionList.types[0].id || null, + defaultValue: null, + + colProps: { span: 4 }, componentProps: ({ formModel }) => { return { allowClear: false, - placeholder: '请选择系统', + placeholder: '全部系统', options: optionList.types.map(type => ({ value: type.id, label: type.name })), onChange: async (e: any) => { // const { reload } = tableAction @@ -58,6 +67,11 @@ export const searchFormSchema: FormSchema[] = [ unitId: formModel.unit, typeId: e, } + //如果typeId是空,则不设置system'Options + if (!param.typeId) { + systemOptions.value = [] + return + } systemOptions.value = await subSystemListApi(param) }, } @@ -67,12 +81,13 @@ export const searchFormSchema: FormSchema[] = [ label: '子系统', field: 'system', component: 'Select', - defaultValue: systemOptions.value[0].id || null, - colProps: { span: 5 }, + // defaultValue: systemOptions.value[0].id || null, + defaultValue: null, + colProps: { span: 4 }, componentProps: () => { return { allowClear: false, - placeholder: '请选择子系统', + placeholder: '全部子系统', options: systemOptions.value.map(system => ({ value: system.id, label: system.name })), } }, @@ -82,10 +97,11 @@ export const searchFormSchema: FormSchema[] = [ label: '模型实例名称', field: 'mpName', component: 'Input', - labelWidth: 120, + labelWidth: 100, + defaultValue: '', - colProps: { span: 6 }, - } + colProps: { span: 5 }, + }, ] export const columns: BasicColumn[] = [ diff --git a/src/views/warn/alarm/index.vue b/src/views/warn/alarm/index.vue index 2015c22..13791e8 100644 --- a/src/views/warn/alarm/index.vue +++ b/src/views/warn/alarm/index.vue @@ -79,8 +79,8 @@ async function handleTrend(record: Recordable) { } onMounted(async () => { - const { setFieldsValue } = getForm() - await setFieldsValue({ system: null }) + // const { setFieldsValue } = getForm() + // await setFieldsValue({ system: null }) }) -- 2.30.2