Commit bc6819ae4c2e7e4215c7b20ea6c2e48cb4c087de

Authored by loveumiko
1 parent ba4a9c35

fix: 规则链文字修改

... ... @@ -3,7 +3,7 @@
3 3 目前共有10个,分类按名称进行配置
4 4 */
5 5 export default {
6   - title: '属性',
  6 + title: '属性',
7 7 description: '向消息元数据中添加附加信息',
8 8 calculateDelta: {
9 9 name: '计算增量',
... ...
... ... @@ -3,7 +3,7 @@
3 3 目前共有11个,分类按名称进行配置
4 4 */
5 5 export default {
6   - title: '外部',
  6 + title: '外部',
7 7 description: '与外部系统交互',
8 8 alarmNotice: {
9 9 name: '告警通知',
... ...
... ... @@ -3,15 +3,15 @@
3 3 目前共有11个,分类按名称进行配置
4 4 */
5 5 export default {
6   - title: '筛选器',
  6 + title: '过滤',
7 7 description: '使用配置条件筛选传入消息',
8 8 checkAlarmStatus: {
9   - name: '检测报警状态',
  9 + name: '检查告警状态',
10 10 details: '如果警报状态与指定的状态匹配,则消息成功;如果不匹配,则消息失败。',
11   - description: '检测报警状态',
  11 + description: '检查告警状态',
12 12 },
13 13 checkExistenceFields: {
14   - name: '检字段是否存在',
  14 + name: '检字段是否存在',
15 15 details: `如果选中【检查所有选择的键是否存在】 ,就必选满足Message data中配置的字段和Message metadata中配置的字段,都必须存在才会返回true发送消息,否则返回false。
16 16 如果未选中,Message data中配置的字段或者Message metadata中配置的字段至少有一个键存在返回true,否则返回false。`,
17 17 description: '检查消息中的字段数据和消息元数据中所选择的键是否都存在。',
... ... @@ -22,27 +22,27 @@ export default {
22 22 description: `检查关系是按类型和方向将所选实体发送给消息的发起者;如果“检查单个实体”设置为true,否则规则节点将按类型和方向检查是否存在与消息发起者的任何关系。`,
23 23 },
24 24 gpsGeofencingFilter: {
25   - name: 'GPS地理围栏过滤',
  25 + name: 'GPS地理围栏过滤',
26 26 details: `从传入消息中提取纬度和经度参数,如果它们位于配置的周界内,则返回'True',否则返回'False'。`,
27 27 description: '通过基于GPS的地理围栏过滤传入消息。',
28 28 },
29 29 messageType: {
30   - name: '消息类型',
  30 + name: '消息类型过滤',
31 31 details: `如果需要传入消息类型通过,则'True'链发送消息,否则使用'False'链路。`,
32   - description: '按消息类型筛选传入消息。',
  32 + description: '按消息类型传入消息。',
33 33 },
34 34 messageTypeSwitch: {
35   - name: '消息类型换',
  35 + name: '消息类型换',
36 36 details: `通过相应链发送消息类型为'属性上报','遥测上报','RPC请求'等的消息,否则使用其他链。`,
37 37 description: '按消息类型路由传入消息。',
38 38 },
39 39 originatorType: {
40   - name: '发起者类型',
  40 + name: '实体类型过滤',
41 41 details: `如果预期传入消息的发起者类型,通过则True链发送消息,否则使用False链路。`,
42 42 description: '按消息发起者类型过滤传入消息。',
43 43 },
44 44 originatorTypeSwitch: {
45   - name: '发起者类型转换',
  45 + name: '实体类型转换',
46 46 details: `根据发起方类型(设备、资产等)将消息路由到链。`,
47 47 description: '按消息发起者类型路由传入消息。',
48 48 },
... ... @@ -52,9 +52,9 @@ export default {
52 52 description: '基于业务场景,实现设备的交互控制。',
53 53 },
54 54 script: {
55   - name: 'JS脚本',
  55 + name: '脚本',
56 56 details: `使用配置的JS匹配条件传入消息。如果为True,则通过True链发送消息,否则使用False链。可以通过msg属性访问消息负载。 例如 msg.temperature < 10 ;可以通过metadata属性访问消息元数据。例如metadata.customerName === 'John';可以通过msgType属性访问消息类型。`,
57   - description: '使用JS脚本过滤传入消息。',
  57 + description: '使用脚本过滤传入消息。',
58 58 },
59 59 switch: {
60 60 name: '转换器',
... ...
... ... @@ -3,7 +3,7 @@
3 3 目前共有4个,分类按名称进行配置
4 4 */
5 5 export default {
6   - title: '流',
  6 + title: '流',
7 7 description: '组织消息流',
8 8 acknowledge: {
9 9 name: '确认消息',
... ...
... ... @@ -18,15 +18,15 @@ export default {
18 18 RELEATION_TYPE: '关联类型',
19 19 },
20 20 GpsGeofencingFilterFieldsNameEnum: {
21   - LATITUDE_KEY_NAME: '纬度键名称',
22   - LONGITUDE_KEY_NAME: '经度键名称',
23   - PERIMETER_TYPE: '周长类型',
24   - FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA: '从消息元数据中获取周边信息',
  21 + LATITUDE_KEY_NAME: '纬度标识符',
  22 + LONGITUDE_KEY_NAME: '经度标识符',
  23 + PERIMETER_TYPE: '周界类型',
  24 + FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA: '从消息元数据中获取周界信息',
25 25 CENTER_LATITUDE: '中心纬度',
26 26 CENTER_LONGITUDE: '中心经度',
27   - RANGE: '范围',
  27 + RANGE: '圆半径范围',
28 28 RANGE_UNIT: '范围的单位',
29   - PERIMETER_KEY_NAME: '周界密钥名称',
  29 + PERIMETER_KEY_NAME: '周界标识符名称',
30 30 POLYGONS_DEFINITION: '多边形定义',
31 31 },
32 32 MessageTypeFieldsNameEnum: {
... ...
... ... @@ -229,7 +229,6 @@ export function useBasicDataTransform() {
229 229
230 230 if (resultNode.additionalInfo.layoutX < offsetX) offsetX = resultNode.additionalInfo.layoutX;
231 231 if (resultNode.additionalInfo.layoutY < offsetY) offsetY = resultNode.additionalInfo.layoutY;
232   -
233 232 nodes.push(resultNode);
234 233 }
235 234
... ...
... ... @@ -317,7 +317,6 @@ export function useContextMenuAction() {
317 317 const selectedEdges = unref(flowActionType?.getSelectedEdges);
318 318 const { firstNodeIndex, connections, nodes, outputEdgesId, inputEdgesId } =
319 319 transformToRuleChain(selectedNodes, selectedEdges);
320   -
321 320 await saveRuleChainData({
322 321 firstNodeIndex,
323 322 connections: connections.filter(
... ...
... ... @@ -82,7 +82,6 @@ export function useSaveAndRedo() {
82 82 ruleChainDetail.value = detail;
83 83 ruleChainId = detail.id.id;
84 84 }
85   -
86 85 const data = await saveRuleChainData({
87 86 connections,
88 87 nodes,
... ...
... ... @@ -12,6 +12,9 @@ export const formSchemas: FormSchema[] = [
12 12 field: CheckExistenceFieldsEnum.MESSAGE_NAMES,
13 13 component: 'Select',
14 14 label: t(CheckExistenceFieldsNameEnum.MESSAGE_NAMES),
  15 + helpMessage: `${t(CheckExistenceFieldsNameEnum.MESSAGE_NAMES)}和${t(
  16 + CheckExistenceFieldsNameEnum.METADATA_NAMES
  17 + )}最少选填一个`,
15 18 rules: [
16 19 {
17 20 required: true,
... ... @@ -19,6 +22,18 @@ export const formSchemas: FormSchema[] = [
19 22 message: `请选择${t(CheckExistenceFieldsNameEnum.MESSAGE_NAMES)}`,
20 23 },
21 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 + },
22 37 componentProps: {
23 38 mode: 'tags',
24 39 open: false,
... ... @@ -30,13 +45,21 @@ export const formSchemas: FormSchema[] = [
30 45 field: CheckExistenceFieldsEnum.METADATA_NAMES,
31 46 component: 'Select',
32 47 label: t(CheckExistenceFieldsNameEnum.METADATA_NAMES),
33   - rules: [
34   - {
35   - required: true,
36   - type: 'array',
37   - message: `请选择${t(CheckExistenceFieldsNameEnum.METADATA_NAMES)}`,
38   - },
39   - ],
  48 + helpMessage: `${t(CheckExistenceFieldsNameEnum.MESSAGE_NAMES)}和${t(
  49 + CheckExistenceFieldsNameEnum.METADATA_NAMES
  50 + )}最少选填一个`,
  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 + },
40 63 componentProps: {
41 64 mode: 'tags',
42 65 open: false,
... ...
... ... @@ -118,7 +118,7 @@ export const formSchemas: FormSchema[] = [
118 118 },
119 119 {
120 120 field: CheckRelationFieldsEnum.RELEATION_TYPE,
121   - component: 'Select',
  121 + component: 'AutoComplete',
122 122 label: t(CheckRelationFieldsNameEnum.RELEATION_TYPE),
123 123 defaultValue: RelationTypeEnum.CONTAINS,
124 124 componentProps: {
... ...
... ... @@ -16,11 +16,23 @@ export const formSchemas: FormSchema[] = [
16 16 componentProps: {
17 17 placeholder: `请输入${t(GpsGeofencingFilterFieldsNameEnum.LATITUDE_KEY_NAME)}`,
18 18 },
  19 + rules: [
  20 + {
  21 + required: true,
  22 + message: `请输入${t(GpsGeofencingFilterFieldsNameEnum.LATITUDE_KEY_NAME)}`,
  23 + },
  24 + ],
19 25 },
20 26 {
21 27 field: GpsGeofencingFilterFieldsEnum.LONGITUDE_KEY_NAME,
22 28 component: 'Input',
23 29 label: t(GpsGeofencingFilterFieldsNameEnum.LONGITUDE_KEY_NAME),
  30 + rules: [
  31 + {
  32 + required: true,
  33 + message: `请输入${t(GpsGeofencingFilterFieldsNameEnum.LONGITUDE_KEY_NAME)}`,
  34 + },
  35 + ],
24 36 componentProps: {
25 37 placeholder: `请输入${t(GpsGeofencingFilterFieldsNameEnum.LONGITUDE_KEY_NAME)}`,
26 38 },
... ... @@ -47,6 +59,7 @@ export const formSchemas: FormSchema[] = [
47 59 field: GpsGeofencingFilterFieldsEnum.PERIMETER_KEY_NAME,
48 60 component: 'Input',
49 61 label: t(GpsGeofencingFilterFieldsNameEnum.PERIMETER_KEY_NAME),
  62 + helpMessage: '根据周界类型',
50 63 show: ({ model }) =>
51 64 model[GpsGeofencingFilterFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA],
52 65 componentProps: {
... ...
... ... @@ -15,7 +15,7 @@ export const formSchemas: FormSchema[] = [
15 15 label: MessageTypesNameEnum[value],
16 16 value,
17 17 })),
18   - mode: 'multiple',
  18 + mode: 'tags',
19 19 placeholder: `请选择${t(MessageTypeFieldsNameEnum.MESSAGE_TYPES)}`,
20 20 getPopupContainer: () => document.body,
21 21 },
... ...
... ... @@ -79,7 +79,7 @@
79 79 <template>
80 80 <BasicDrawer
81 81 v-model:visible="visible"
82   - width="40%"
  82 + :width="nodeData?.created ? '50%' : '40%'"
83 83 showFooter
84 84 showCancelBtn
85 85 showOkBtn
... ...