Commit 8e8ec54bbd49edb5db6d920fe99bae5fa74b3801

Authored by xp.Huang
2 parents f5957601 c01846ab

Merge branch 'perf/linkedage-alarm' into 'main_dev'

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

See merge request yunteng/thingskit-front!1155
... ... @@ -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 121 field: FormFieldsEnum.ALARM_PROFILED,
106 122 label: '',
107 123 component: 'AlarmProfileSelect',
... ... @@ -115,23 +131,7 @@ export const getFormSchemas = (hasAlarmNotify: Ref<boolean>): FormSchema[] => {
115 131 },
116 132 labelField: 'name',
117 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 },
... ...