Commit 6cb2eb711652049c318def6df388980d09896c78

Authored by xp.Huang
2 parents a5e06577 702734f8

Merge branch 'fix/rule-chain-field' into 'main_dev'

fix: 规则链字段修改

See merge request yunteng/thingskit-front!1062
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 *规则链 变换 中文配置文件 2 *规则链 变换 中文配置文件
3 目前共有3个,分类按名称进行配置 3 目前共有3个,分类按名称进行配置
4 */ 4 */
  5 +
5 export default { 6 export default {
6 title: '变换', 7 title: '变换',
7 description: '更改消息载体和元数据', 8 description: '更改消息载体和元数据',
@@ -16,7 +17,7 @@ export default { @@ -16,7 +17,7 @@ export default {
16 description: '使用JavaScript更改消息有效负载、元数据或消息类型。', 17 description: '使用JavaScript更改消息有效负载、元数据或消息类型。',
17 }, 18 },
18 toEmail: { 19 toEmail: {
19 - name: '发送到电子邮件', 20 + name: '发送到Email',
20 details: `通过使用从元数据派生的值填充电子邮件字段,将消息转换为电子邮件内容并发送。设置SEND_EMAIL输出消息类型。`, 21 details: `通过使用从元数据派生的值填充电子邮件字段,将消息转换为电子邮件内容并发送。设置SEND_EMAIL输出消息类型。`,
21 description: '将消息转换为电子邮件内容并发送。', 22 description: '将消息转换为电子邮件内容并发送。',
22 }, 23 },
@@ -101,7 +101,7 @@ export default { @@ -101,7 +101,7 @@ export default {
101 }, 101 },
102 SaveTimeseriesFieldsNameEnum: { 102 SaveTimeseriesFieldsNameEnum: {
103 DEFAULT_TTL: '默认TTL(秒)', 103 DEFAULT_TTL: '默认TTL(秒)',
104 - SKIP_LATEST_PERSISTENCE: '滑雪最新坚持', 104 + SKIP_LATEST_PERSISTENCE: '跳过更新最新时序数据表(ts kv latest)',
105 USE_SERVER_TS: '使用服务器时间戳', 105 USE_SERVER_TS: '使用服务器时间戳',
106 }, 106 },
107 SaveToCustomTableFieldsNameEnum: { 107 SaveToCustomTableFieldsNameEnum: {
@@ -12,7 +12,7 @@ export default { @@ -12,7 +12,7 @@ export default {
12 }, 12 },
13 ToEmailFieldsNameEnum: { 13 ToEmailFieldsNameEnum: {
14 FROM_TEMPLATE: '来自模板', 14 FROM_TEMPLATE: '来自模板',
15 - TO_TEMPLATE: '发送到Email', 15 + TO_TEMPLATE: '到模板',
16 CC_TEMPLATE: '抄送模板', 16 CC_TEMPLATE: '抄送模板',
17 BCC_TEMPLATE: '密件抄送模板', 17 BCC_TEMPLATE: '密件抄送模板',
18 SUBJECT_TEMPLATE: '主题模板', 18 SUBJECT_TEMPLATE: '主题模板',
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
@@ -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: '',
@@ -23,7 +23,7 @@ export const formSchemas: FormSchema[] = [ @@ -23,7 +23,7 @@ export const formSchemas: FormSchema[] = [
23 component: 'Checkbox', 23 component: 'Checkbox',
24 label: '', 24 label: '',
25 renderComponentContent: () => ({ 25 renderComponentContent: () => ({
26 - default: () => t(SaveTimeseriesFieldsNameEnum.DEFAULT_TTL), 26 + default: () => t(SaveTimeseriesFieldsNameEnum.SKIP_LATEST_PERSISTENCE),
27 }), 27 }),
28 }, 28 },
29 { 29 {
@@ -60,6 +60,7 @@ export const formSchemas: FormSchema[] = [ @@ -60,6 +60,7 @@ export const formSchemas: FormSchema[] = [
60 field: OriginatorAttributesEnum.LATEST_TS_KEY_NAMES, 60 field: OriginatorAttributesEnum.LATEST_TS_KEY_NAMES,
61 component: 'Select', 61 component: 'Select',
62 label: t(OriginatorAttributesNameEnum.LATEST_TS_KEY_NAMES), 62 label: t(OriginatorAttributesNameEnum.LATEST_TS_KEY_NAMES),
  63 + required: true,
63 helpMessage: [ 64 helpMessage: [
64 `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`, 65 `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`,
65 ], 66 ],
@@ -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>