Commit b68289fb967e64a1e9cc5b86ec421f423e0d84f4

Authored by loveumiko
1 parent f36fd199

fix: 规则链节点字段修改

1 import { CreateAlarmFieldsEnum, CreateAlarmFieldsNameEnum } from '../../../enum/formField/action'; 1 import { CreateAlarmFieldsEnum, CreateAlarmFieldsNameEnum } from '../../../enum/formField/action';
2 import { JavascriptEditorWithTestModal } from '../../../src/components/JavaScriptFilterModal'; 2 import { JavascriptEditorWithTestModal } from '../../../src/components/JavaScriptFilterModal';
  3 +import { findDictItemByCode } from '/@/api/system/dict';
3 import { FormSchema, useComponentRegister } from '/@/components/Form'; 4 import { FormSchema, useComponentRegister } from '/@/components/Form';
4 import { useI18n } from '/@/hooks/web/useI18n'; 5 import { useI18n } from '/@/hooks/web/useI18n';
5 6
@@ -48,7 +49,7 @@ export const formSchemas: FormSchema[] = [ @@ -48,7 +49,7 @@ export const formSchemas: FormSchema[] = [
48 { 49 {
49 field: CreateAlarmFieldsEnum.ALARM_TYPE, 50 field: CreateAlarmFieldsEnum.ALARM_TYPE,
50 component: 'Input', 51 component: 'Input',
51 - label: t(CreateAlarmFieldsNameEnum.ALARM_TYPE), 52 + label: t(CreateAlarmFieldsNameEnum.ALARM_TYPE) + '123',
52 helpMessage: [ 53 helpMessage: [
53 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body', 54 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
54 ], 55 ],
@@ -80,6 +81,22 @@ export const formSchemas: FormSchema[] = [ @@ -80,6 +81,22 @@ export const formSchemas: FormSchema[] = [
80 }, 81 },
81 }, 82 },
82 { 83 {
  84 + field: CreateAlarmFieldsEnum.SEVERITY,
  85 + component: 'ApiSelect',
  86 + label: t(CreateAlarmFieldsNameEnum.SEVERITY),
  87 + show: ({ model }) => !model[CreateAlarmFieldsEnum.USE_MESSAGE_ALARM_DATA],
  88 + ifShow: ({ model }) => !model[CreateAlarmFieldsEnum.DYNAMIC_SEVERITY],
  89 + componentProps: {
  90 + api: findDictItemByCode,
  91 + params: {
  92 + dictCode: 'severity_type',
  93 + },
  94 + labelField: 'itemText',
  95 + valueField: 'itemValue',
  96 + placeholder: `请输入${t(CreateAlarmFieldsNameEnum.SEVERITY)}`,
  97 + },
  98 + },
  99 + {
83 field: CreateAlarmFieldsEnum.PROPAGATE, 100 field: CreateAlarmFieldsEnum.PROPAGATE,
84 component: 'Checkbox', 101 component: 'Checkbox',
85 label: '', 102 label: '',
@@ -18,6 +18,10 @@ @@ -18,6 +18,10 @@
18 return nodeDefinition || {}; 18 return nodeDefinition || {};
19 }); 19 });
20 20
  21 + const getHasInEnabledFlag = computed(() => unref(getNodeDefinition).inEnabled);
  22 +
  23 + const getHasOutEnabledFlag = computed(() => unref(getNodeDefinition).outEnabled);
  24 +
21 const getIcon = computed(() => { 25 const getIcon = computed(() => {
22 const { icon } = unref(getNodeDefinition); 26 const { icon } = unref(getNodeDefinition);
23 const { icon: categoryIcon } = props.categoryConfig || {}; 27 const { icon: categoryIcon } = props.categoryConfig || {};
@@ -87,8 +91,14 @@ @@ -87,8 +91,14 @@
87 {{ config?.name }} 91 {{ config?.name }}
88 </span> 92 </span>
89 </div> 93 </div>
90 - <div class="w-4 h-4 bg-gray-300 rounded-md border absolute -left-3 border-gray-500"></div>  
91 - <div class="w-4 h-4 bg-gray-300 rounded-md border absolute -right-3 border-gray-500"></div> 94 + <div
  95 + v-if="getHasInEnabledFlag"
  96 + class="w-4 h-4 bg-gray-300 rounded-md border absolute -left-3 border-gray-500"
  97 + ></div>
  98 + <div
  99 + v-if="getHasOutEnabledFlag"
  100 + class="w-4 h-4 bg-gray-300 rounded-md border absolute -right-3 border-gray-500"
  101 + ></div>
92 </main> 102 </main>
93 </Tooltip> 103 </Tooltip>
94 </template> 104 </template>