Commit c01846ab7f436e48cb2de52f9ac215eadf1c4d65

Authored by ww
1 parent d702b232

perf: 优化变更场景联动告警输出告警等级与告警配置顺序

@@ -102,6 +102,22 @@ export const getFormSchemas = (hasAlarmNotify: Ref<boolean>): FormSchema[] => { @@ -102,6 +102,22 @@ export const getFormSchemas = (hasAlarmNotify: Ref<boolean>): FormSchema[] => {
102 }, 102 },
103 }, 103 },
104 { 104 {
  105 + field: FormFieldsEnum.ALARM_LEVEL,
  106 + label: '',
  107 + component: 'Select',
  108 + ifShow: ({ model }) => model[FormFieldsEnum.OUT_TARGET] === ExecutionActionEnum.MSG_NOTIFY,
  109 + rules: [{ required: true, message: `请选择${FormFieldsNameEnum.ALARM_LEVEL}` }],
  110 + componentProps: () => {
  111 + return {
  112 + options: Object.keys(AlarmLevelEnum).map((value) => ({
  113 + label: AlarmLevelNameEnum[value],
  114 + value,
  115 + })),
  116 + placeholder: `请选择${FormFieldsNameEnum.ALARM_LEVEL}`,
  117 + };
  118 + },
  119 + },
  120 + {
105 field: FormFieldsEnum.ALARM_PROFILED, 121 field: FormFieldsEnum.ALARM_PROFILED,
106 label: '', 122 label: '',
107 component: 'AlarmProfileSelect', 123 component: 'AlarmProfileSelect',
@@ -115,23 +131,7 @@ export const getFormSchemas = (hasAlarmNotify: Ref<boolean>): FormSchema[] => { @@ -115,23 +131,7 @@ export const getFormSchemas = (hasAlarmNotify: Ref<boolean>): FormSchema[] => {
115 }, 131 },
116 labelField: 'name', 132 labelField: 'name',
117 valueField: 'id', 133 valueField: 'id',
118 - placeholder: `请选择${FormFieldsNameEnum.ALARM_PROFILED}`,  
119 - };  
120 - },  
121 - },  
122 - {  
123 - field: FormFieldsEnum.ALARM_LEVEL,  
124 - label: '',  
125 - component: 'Select',  
126 - ifShow: ({ model }) => model[FormFieldsEnum.OUT_TARGET] === ExecutionActionEnum.MSG_NOTIFY,  
127 - rules: [{ required: true, message: `请选择${FormFieldsEnum.ALARM_LEVEL}` }],  
128 - componentProps: () => {  
129 - return {  
130 - options: Object.keys(AlarmLevelEnum).map((value) => ({  
131 - label: AlarmLevelNameEnum[value],  
132 - value,  
133 - })),  
134 - placeholder: `请选择${FormFieldsNameEnum.ALARM_LEVEL}`, 134 + placeholder: `请选择${FormFieldsNameEnum.ALARM_PROFILED}(可选项)`,
135 }; 135 };
136 }, 136 },
137 }, 137 },