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