Commit 2e4a4ae5f0c67b278cbf6ca726b6a7294e634562

Authored by loveumiko
1 parent 0725716c

fix: 规则链文字修改

... ... @@ -11,9 +11,9 @@ export default {
11 11 description: `根据传入值和上一个值计算增量值并将其添加到消息中。`,
12 12 },
13 13 customerAttributes: {
14   - name: '客户属性',
  14 + name: '客户属性',
15 15 details: `如果已配置属性,则会将服务器范围属性添加到消息元数据中。如果配置了'最新遥测',则将最新遥测添加到元数据中。要访问其他节点中的这些属性,可以使用metadata.temperature访问。`,
16   - description: `将发起者客户属性或最新遥测添加到消息元数据中。`,
  16 + description: `将发起者客户属性或最新遥测添加到消息元数据中。`,
17 17 },
18 18 customerDetails: {
19 19 name: '客户详情',
... ... @@ -51,8 +51,8 @@ export default {
51 51 description: '将发起者租户属性或最新遥测添加到消息元数据中。',
52 52 },
53 53 tenantDetails: {
54   - name: '租户详细信息',
  54 + name: '租户详',
55 55 details: `如果选中:【将选定的详细信息添加到消息元数据】,则现有字段将添加到消息元数据而不是消息数据;注意:只允许设备、资产和实体视图类型;如果原始的消息发件人未分配给Tenant或者不支持原始发件人类型,消息将转发到失败链,否则将使用成功链路。`,
56   - description: '将租户详细信息中的字段添加到消息正文或元数据中。',
  56 + description: '将租户详中的字段添加到消息正文或元数据中。',
57 57 },
58 58 };
... ...
... ... @@ -8,8 +8,8 @@ export default {
8 8 OUTPUT_VALUE_KEY: '输出值键',
9 9 ROUND: '小数',
10 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 13 PERIOD_VALUE_KEY: '期间值键',
14 14 },
15 15 CustomerAttributesFieldsNameEnum: {
... ...
... ... @@ -297,7 +297,6 @@ export const formSchema: FormSchema[] = [
297 297 ifShow: ({ values }) => isDingtalk(Reflect.get(values, 'messageType')),
298 298 required: true,
299 299 componentProps: {
300   - maxLength: 36,
301 300 placeholder: '请输入clientSecret',
302 301 },
303 302 },
... ...
... ... @@ -4,6 +4,12 @@ import { CreateModalDefineExposeType, AwaitPopupWindowReturnDataType } from '../
4 4 import { EdgeData, NodeData } from '../types/node';
5 5 import { DataActionModeEnum } from '/@/enums/toolEnum';
6 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 14 interface OptionsType {
9 15 mode: DataActionModeEnum;
... ... @@ -102,10 +108,25 @@ export function useAwaitPopupWindowBindData(
102 108 );
103 109 };
104 110
  111 + const { createMessage } = useMessage();
  112 +
105 113 const handleSubmit = async (extraData: Recordable = {}) => {
106 114 const { flag } = await validate();
107 115 if (!flag) return;
108 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 130 unref(resolveFn)?.({
110 131 flag: true,
111 132 data: handleSubmitData(extraData, value),
... ...
... ... @@ -46,26 +46,24 @@
46 46 <AttributeConfiguration
47 47 v-model:value="model[field]"
48 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 52 <template #afterForm>
55 53 <div class="text-xs text-gray-500">
56   - Hint: use
  54 + ” 备注: 使用
57 55 <code>
58 56 <span class="text-dark-500">${</span>
59 57 metadataKey
60 58 <span class="text-dark-500">}</span>
61 59 </code>
62   - for value from metadata,
  60 + 表示元数据中的值,
63 61 <code>
64 62 <span class="text-dark-500"> $[</span>
65 63 messageKey
66 64 <span class="text-dark-500">] </span>
67 65 </code>
68   - for value from message body to substitute "Source" and "Target" key names
  66 + 表示消息正文中的值。用“Source”和“Target'键名代替。“
69 67 </div>
70 68 </template>
71 69 </AttributeConfiguration>
... ...
... ... @@ -15,25 +15,6 @@ export const formSchemas: FormSchema[] = [
15 15 helpMessage: `${t(CheckExistenceFieldsNameEnum.MESSAGE_NAMES)}和${t(
16 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 18 componentProps: {
38 19 mode: 'tags',
39 20 open: false,
... ... @@ -48,18 +29,6 @@ export const formSchemas: FormSchema[] = [
48 29 helpMessage: `${t(CheckExistenceFieldsNameEnum.MESSAGE_NAMES)}和${t(
49 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 32 componentProps: {
64 33 mode: 'tags',
65 34 open: false,
... ...