Commit 2e4a4ae5f0c67b278cbf6ca726b6a7294e634562

Authored by loveumiko
1 parent 0725716c

fix: 规则链文字修改

@@ -11,9 +11,9 @@ export default { @@ -11,9 +11,9 @@ export default {
11 description: `根据传入值和上一个值计算增量值并将其添加到消息中。`, 11 description: `根据传入值和上一个值计算增量值并将其添加到消息中。`,
12 }, 12 },
13 customerAttributes: { 13 customerAttributes: {
14 - name: '客户属性', 14 + name: '客户属性',
15 details: `如果已配置属性,则会将服务器范围属性添加到消息元数据中。如果配置了'最新遥测',则将最新遥测添加到元数据中。要访问其他节点中的这些属性,可以使用metadata.temperature访问。`, 15 details: `如果已配置属性,则会将服务器范围属性添加到消息元数据中。如果配置了'最新遥测',则将最新遥测添加到元数据中。要访问其他节点中的这些属性,可以使用metadata.temperature访问。`,
16 - description: `将发起者客户属性或最新遥测添加到消息元数据中。`, 16 + description: `将发起者客户属性或最新遥测添加到消息元数据中。`,
17 }, 17 },
18 customerDetails: { 18 customerDetails: {
19 name: '客户详情', 19 name: '客户详情',
@@ -51,8 +51,8 @@ export default { @@ -51,8 +51,8 @@ export default {
51 description: '将发起者租户属性或最新遥测添加到消息元数据中。', 51 description: '将发起者租户属性或最新遥测添加到消息元数据中。',
52 }, 52 },
53 tenantDetails: { 53 tenantDetails: {
54 - name: '租户详细信息', 54 + name: '租户详',
55 details: `如果选中:【将选定的详细信息添加到消息元数据】,则现有字段将添加到消息元数据而不是消息数据;注意:只允许设备、资产和实体视图类型;如果原始的消息发件人未分配给Tenant或者不支持原始发件人类型,消息将转发到失败链,否则将使用成功链路。`, 55 details: `如果选中:【将选定的详细信息添加到消息元数据】,则现有字段将添加到消息元数据而不是消息数据;注意:只允许设备、资产和实体视图类型;如果原始的消息发件人未分配给Tenant或者不支持原始发件人类型,消息将转发到失败链,否则将使用成功链路。`,
56 - description: '将租户详细信息中的字段添加到消息正文或元数据中。', 56 + description: '将租户详中的字段添加到消息正文或元数据中。',
57 }, 57 },
58 }; 58 };
@@ -8,8 +8,8 @@ export default { @@ -8,8 +8,8 @@ export default {
8 OUTPUT_VALUE_KEY: '输出值键', 8 OUTPUT_VALUE_KEY: '输出值键',
9 ROUND: '小数', 9 ROUND: '小数',
10 USE_CACHE: '使用缓存获取最新值', 10 USE_CACHE: '使用缓存获取最新值',
11 - TELL_FAILURE_IF_DELTA_IS_NEGATIVE: '如果delta为负数,则告知Failure',  
12 - ADD_PERIOD_BETWEEN_MSGS: '在消息之间添加句点', 11 + TELL_FAILURE_IF_DELTA_IS_NEGATIVE: '如果delta为负数,则告知Failure【失败】',
  12 + ADD_PERIOD_BETWEEN_MSGS: '在消息之间添加时间差值{单位:毫秒}',
13 PERIOD_VALUE_KEY: '期间值键', 13 PERIOD_VALUE_KEY: '期间值键',
14 }, 14 },
15 CustomerAttributesFieldsNameEnum: { 15 CustomerAttributesFieldsNameEnum: {
@@ -297,7 +297,6 @@ export const formSchema: FormSchema[] = [ @@ -297,7 +297,6 @@ export const formSchema: FormSchema[] = [
297 ifShow: ({ values }) => isDingtalk(Reflect.get(values, 'messageType')), 297 ifShow: ({ values }) => isDingtalk(Reflect.get(values, 'messageType')),
298 required: true, 298 required: true,
299 componentProps: { 299 componentProps: {
300 - maxLength: 36,  
301 placeholder: '请输入clientSecret', 300 placeholder: '请输入clientSecret',
302 }, 301 },
303 }, 302 },
@@ -4,6 +4,12 @@ import { CreateModalDefineExposeType, AwaitPopupWindowReturnDataType } from '../ @@ -4,6 +4,12 @@ import { CreateModalDefineExposeType, AwaitPopupWindowReturnDataType } from '../
4 import { EdgeData, NodeData } from '../types/node'; 4 import { EdgeData, NodeData } from '../types/node';
5 import { DataActionModeEnum } from '/@/enums/toolEnum'; 5 import { DataActionModeEnum } from '/@/enums/toolEnum';
6 import { ElementsTypeEnum } from '../enum'; 6 import { ElementsTypeEnum } from '../enum';
  7 +import { FilterCategoryComponentEnum } from '../enum/category';
  8 +import { useMessage } from '/@/hooks/web/useMessage';
  9 +import { CheckExistenceFieldsNameEnum } from '../enum/formField/filter';
  10 +import { useI18n } from '/@/hooks/web/useI18n';
  11 +
  12 +const { t } = useI18n();
7 13
8 interface OptionsType { 14 interface OptionsType {
9 mode: DataActionModeEnum; 15 mode: DataActionModeEnum;
@@ -102,10 +108,25 @@ export function useAwaitPopupWindowBindData( @@ -102,10 +108,25 @@ export function useAwaitPopupWindowBindData(
102 ); 108 );
103 }; 109 };
104 110
  111 + const { createMessage } = useMessage();
  112 +
105 const handleSubmit = async (extraData: Recordable = {}) => { 113 const handleSubmit = async (extraData: Recordable = {}) => {
106 const { flag } = await validate(); 114 const { flag } = await validate();
107 if (!flag) return; 115 if (!flag) return;
108 const value = await unref(createComponentEl)?.getFieldsValue?.(); 116 const value = await unref(createComponentEl)?.getFieldsValue?.();
  117 + const { config } = nodeData.value || {};
  118 + if (
  119 + config?.key === FilterCategoryComponentEnum.CHECK_EXISTENCE_FIELDS &&
  120 + !value?.messageNames &&
  121 + !value?.messageNames
  122 + ) {
  123 + createMessage.warning(
  124 + `${t(CheckExistenceFieldsNameEnum.MESSAGE_NAMES)}和${t(
  125 + CheckExistenceFieldsNameEnum.METADATA_NAMES
  126 + )}最少选填一个`
  127 + );
  128 + return false;
  129 + }
109 unref(resolveFn)?.({ 130 unref(resolveFn)?.({
110 flag: true, 131 flag: true,
111 data: handleSubmitData(extraData, value), 132 data: handleSubmitData(extraData, value),
@@ -46,26 +46,24 @@ @@ -46,26 +46,24 @@
46 <AttributeConfiguration 46 <AttributeConfiguration
47 v-model:value="model[field]" 47 v-model:value="model[field]"
48 ref="attributeControlElRef" 48 ref="attributeControlElRef"
49 - :keyLabel="`Source ${  
50 - model[CustomerAttributesFieldsEnum.TELEMETRY] ? 'telemetry' : 'attribute'  
51 - }`"  
52 - valueLabel="Target attribute" 49 + :keyLabel="`原始${model[CustomerAttributesFieldsEnum.TELEMETRY] ? '遥测' : '属性'}`"
  50 + valueLabel="目标属性"
53 > 51 >
54 <template #afterForm> 52 <template #afterForm>
55 <div class="text-xs text-gray-500"> 53 <div class="text-xs text-gray-500">
56 - Hint: use 54 + ” 备注: 使用
57 <code> 55 <code>
58 <span class="text-dark-500">${</span> 56 <span class="text-dark-500">${</span>
59 metadataKey 57 metadataKey
60 <span class="text-dark-500">}</span> 58 <span class="text-dark-500">}</span>
61 </code> 59 </code>
62 - for value from metadata, 60 + 表示元数据中的值,
63 <code> 61 <code>
64 <span class="text-dark-500"> $[</span> 62 <span class="text-dark-500"> $[</span>
65 messageKey 63 messageKey
66 <span class="text-dark-500">] </span> 64 <span class="text-dark-500">] </span>
67 </code> 65 </code>
68 - for value from message body to substitute "Source" and "Target" key names 66 + 表示消息正文中的值。用“Source”和“Target'键名代替。“
69 </div> 67 </div>
70 </template> 68 </template>
71 </AttributeConfiguration> 69 </AttributeConfiguration>
@@ -15,25 +15,6 @@ export const formSchemas: FormSchema[] = [ @@ -15,25 +15,6 @@ export const formSchemas: FormSchema[] = [
15 helpMessage: `${t(CheckExistenceFieldsNameEnum.MESSAGE_NAMES)}和${t( 15 helpMessage: `${t(CheckExistenceFieldsNameEnum.MESSAGE_NAMES)}和${t(
16 CheckExistenceFieldsNameEnum.METADATA_NAMES 16 CheckExistenceFieldsNameEnum.METADATA_NAMES
17 )}最少选填一个`, 17 )}最少选填一个`,
18 - rules: [  
19 - {  
20 - required: true,  
21 - type: 'array',  
22 - message: `请选择${t(CheckExistenceFieldsNameEnum.MESSAGE_NAMES)}`,  
23 - },  
24 - ],  
25 - dynamicRules({ values }) {  
26 - return [  
27 - {  
28 - required: true,  
29 - validator() {  
30 - return values[CheckExistenceFieldsEnum.METADATA_NAMES]  
31 - ? Promise.resolve()  
32 - : Promise.reject(`请选择${t(CheckExistenceFieldsNameEnum.MESSAGE_NAMES)}`);  
33 - },  
34 - },  
35 - ];  
36 - },  
37 componentProps: { 18 componentProps: {
38 mode: 'tags', 19 mode: 'tags',
39 open: false, 20 open: false,
@@ -48,18 +29,6 @@ export const formSchemas: FormSchema[] = [ @@ -48,18 +29,6 @@ export const formSchemas: FormSchema[] = [
48 helpMessage: `${t(CheckExistenceFieldsNameEnum.MESSAGE_NAMES)}和${t( 29 helpMessage: `${t(CheckExistenceFieldsNameEnum.MESSAGE_NAMES)}和${t(
49 CheckExistenceFieldsNameEnum.METADATA_NAMES 30 CheckExistenceFieldsNameEnum.METADATA_NAMES
50 )}最少选填一个`, 31 )}最少选填一个`,
51 - dynamicRules({ values }) {  
52 - return [  
53 - {  
54 - required: true,  
55 - validator() {  
56 - return values[CheckExistenceFieldsEnum.MESSAGE_NAMES]  
57 - ? Promise.resolve()  
58 - : Promise.reject(`请选择${t(CheckExistenceFieldsNameEnum.METADATA_NAMES)}`);  
59 - },  
60 - },  
61 - ];  
62 - },  
63 componentProps: { 32 componentProps: {
64 mode: 'tags', 33 mode: 'tags',
65 open: false, 34 open: false,