Commit 0e29512e91b4005c3c4351d837ace794e72ff22c

Authored by ww
1 parent 59bcbf55

fix: 修复部分节点表单

Showing 52 changed files with 762 additions and 433 deletions
1 -import { DeviceInfoItemType, DeviceTypeItem } from './model'; 1 +import { DeviceInfoItemType, DeviceTypeItem, PageParams } from './model';
2 import { TBPaginationResult } from '/#/axios'; 2 import { TBPaginationResult } from '/#/axios';
3 import { defHttp } from '/@/utils/http/axios'; 3 import { defHttp } from '/@/utils/http/axios';
4 4
@@ -8,6 +8,17 @@ enum Api { @@ -8,6 +8,17 @@ enum Api {
8 TENANT_QUEUE = '/tenant/queues', 8 TENANT_QUEUE = '/tenant/queues',
9 } 9 }
10 10
  11 +enum Entity {
  12 + DEVICES = '/tenant/devices',
  13 + ASSETS = '/tenant/assets',
  14 + ENTITY_VIEW = '/tenant/entityViews',
  15 + TENANT = '/tenant',
  16 + CUSTOMER = '/customers',
  17 + DASHBOARD = '/tenant/dashboards',
  18 + USER = '/users',
  19 + EDGE = '/tenant/edges',
  20 +}
  21 +
11 export const getDeviceInfos = () => { 22 export const getDeviceInfos = () => {
12 return defHttp.get<TBPaginationResult<DeviceInfoItemType>>( 23 return defHttp.get<TBPaginationResult<DeviceInfoItemType>>(
13 { 24 {
@@ -35,3 +46,99 @@ export const getTenantQueue = (params: Recordable) => { @@ -35,3 +46,99 @@ export const getTenantQueue = (params: Recordable) => {
35 { joinPrefix: false } 46 { joinPrefix: false }
36 ); 47 );
37 }; 48 };
  49 +
  50 +export const getEntityDevice = (params: PageParams) => {
  51 + return defHttp.get(
  52 + {
  53 + url: Entity.DEVICES,
  54 + params,
  55 + },
  56 + {
  57 + joinPrefix: false,
  58 + }
  59 + );
  60 +};
  61 +
  62 +export const getEntityAssets = (params: PageParams) => {
  63 + return defHttp.get(
  64 + {
  65 + url: Entity.ASSETS,
  66 + params,
  67 + },
  68 + {
  69 + joinPrefix: false,
  70 + }
  71 + );
  72 +};
  73 +
  74 +export const getEntityViews = (params: PageParams) => {
  75 + return defHttp.get(
  76 + {
  77 + url: Entity.ENTITY_VIEW,
  78 + params,
  79 + },
  80 + {
  81 + joinPrefix: false,
  82 + }
  83 + );
  84 +};
  85 +
  86 +export const getEntityTenant = (params: Record<'tenantId', string>) => {
  87 + return defHttp.get(
  88 + {
  89 + url: `${Entity.TENANT}/${params.tenantId}`,
  90 + params,
  91 + },
  92 + {
  93 + joinPrefix: false,
  94 + }
  95 + );
  96 +};
  97 +
  98 +export const getEntityCustomer = (params: PageParams) => {
  99 + return defHttp.get(
  100 + {
  101 + url: Entity.CUSTOMER,
  102 + params,
  103 + },
  104 + {
  105 + joinPrefix: false,
  106 + }
  107 + );
  108 +};
  109 +
  110 +export const getEntityUser = (params: PageParams) => {
  111 + return defHttp.get(
  112 + {
  113 + url: Entity.USER,
  114 + params,
  115 + },
  116 + {
  117 + joinPrefix: false,
  118 + }
  119 + );
  120 +};
  121 +
  122 +export const getEntityDashboard = (params: PageParams) => {
  123 + return defHttp.get(
  124 + {
  125 + url: Entity.DASHBOARD,
  126 + params,
  127 + },
  128 + {
  129 + joinPrefix: false,
  130 + }
  131 + );
  132 +};
  133 +
  134 +export const getEntityEdge = (params: PageParams) => {
  135 + return defHttp.get(
  136 + {
  137 + url: Entity.EDGE,
  138 + params,
  139 + },
  140 + {
  141 + joinPrefix: false,
  142 + }
  143 + );
  144 +};
@@ -44,3 +44,11 @@ export interface DeviceTypeItem { @@ -44,3 +44,11 @@ export interface DeviceTypeItem {
44 entityType: string; 44 entityType: string;
45 type: string; 45 type: string;
46 } 46 }
  47 +
  48 +export interface PageParams {
  49 + pageSize?: number;
  50 + page?: number;
  51 + textSearch?: string;
  52 + sortProperty?: string;
  53 + sortOrder?: string;
  54 +}
  1 +import { RuleChainPaginationItemType } from './model/type';
  2 +import { TBPaginationResult } from '/#/axios';
1 import { defHttp } from '/@/utils/http/axios'; 3 import { defHttp } from '/@/utils/http/axios';
2 import { RuleChainType } from '/@/views/rule/designer/types/ruleNode'; 4 import { RuleChainType } from '/@/views/rule/designer/types/ruleNode';
3 5
@@ -26,7 +28,7 @@ export const saveRuleChainData = (data: RuleChainType) => { @@ -26,7 +28,7 @@ export const saveRuleChainData = (data: RuleChainType) => {
26 }; 28 };
27 29
28 export const getRuleChains = (params: Recordable) => { 30 export const getRuleChains = (params: Recordable) => {
29 - return defHttp.get( 31 + return defHttp.get<TBPaginationResult<RuleChainPaginationItemType>>(
30 { 32 {
31 url: Api.GET_RULE_CHAINES, 33 url: Api.GET_RULE_CHAINES,
32 params, 34 params,
  1 +export interface RuleChainPaginationItemType {
  2 + id: Id;
  3 + createdTime: number;
  4 + additionalInfo?: AdditionalInfo;
  5 + tenantId: Id;
  6 + name: string;
  7 + type: string;
  8 + firstRuleNodeId: Id;
  9 + root: boolean;
  10 + debugMode: boolean;
  11 + configuration: any;
  12 +}
  13 +
  14 +export interface Id {
  15 + entityType: string;
  16 + id: string;
  17 +}
  18 +
  19 +export interface AdditionalInfo {
  20 + description: string;
  21 +}
@@ -28,6 +28,7 @@ @@ -28,6 +28,7 @@
28 labelField?: string; 28 labelField?: string;
29 valueField?: string; 29 valueField?: string;
30 immediate?: boolean; 30 immediate?: boolean;
  31 + searchField?: string;
31 queryEmptyDataAgin?: boolean; 32 queryEmptyDataAgin?: boolean;
32 onChangeHook?: ({ options }: OnChangeHookParams) => void; 33 onChangeHook?: ({ options }: OnChangeHookParams) => void;
33 dropdownVisibleChangeHook?: ({ options }: OnChangeHookParams) => void; 34 dropdownVisibleChangeHook?: ({ options }: OnChangeHookParams) => void;
@@ -36,6 +37,7 @@ @@ -36,6 +37,7 @@
36 resultField: '', 37 resultField: '',
37 labelField: 'label', 38 labelField: 'label',
38 valueField: 'value', 39 valueField: 'value',
  40 + searchField: 'text',
39 immediate: true, 41 immediate: true,
40 queryEmptyDataAgin: true, 42 queryEmptyDataAgin: true,
41 } 43 }
@@ -55,16 +57,26 @@ @@ -55,16 +57,26 @@
55 return unref(options).reduce((prev, next: Recordable) => { 57 return unref(options).reduce((prev, next: Recordable) => {
56 if (next) { 58 if (next) {
57 const value = get(next, valueField); 59 const value = get(next, valueField);
  60 + const label = get(next, labelField);
58 prev.push({ 61 prev.push({
59 - label: next[labelField],  
60 - value: numberToString ? `${value}` : value,  
61 ...omit(next, [labelField, valueField]), 62 ...omit(next, [labelField, valueField]),
  63 + label,
  64 + value: numberToString ? `${value}` : value,
62 }); 65 });
63 } 66 }
64 return prev; 67 return prev;
65 }, [] as OptionsItem[]); 68 }, [] as OptionsItem[]);
66 }); 69 });
67 70
  71 + const getBindProps = computed(() => {
  72 + const { searchApi } = props;
  73 + return {
  74 + ...attrs,
  75 + showSearch: true,
  76 + filterOption: !searchApi,
  77 + };
  78 + });
  79 +
68 watchEffect(() => { 80 watchEffect(() => {
69 props.immediate && fetch(); 81 props.immediate && fetch();
70 }); 82 });
@@ -125,7 +137,7 @@ @@ -125,7 +137,7 @@
125 137
126 const debounceSearchFunction = useDebounceFn(handleSearch, 300); 138 const debounceSearchFunction = useDebounceFn(handleSearch, 300);
127 async function handleSearch(params?: string) { 139 async function handleSearch(params?: string) {
128 - let { searchApi, api } = props; 140 + let { searchApi, api, searchField } = props;
129 if (!searchApi || !isFunction(searchApi)) { 141 if (!searchApi || !isFunction(searchApi)) {
130 if (!api || !isFunction(api)) return; 142 if (!api || !isFunction(api)) return;
131 searchApi = api; 143 searchApi = api;
@@ -133,7 +145,7 @@ @@ -133,7 +145,7 @@
133 options.value = []; 145 options.value = [];
134 try { 146 try {
135 loading.value = true; 147 loading.value = true;
136 - const res = await searchApi({ ...props.params, text: params }); 148 + const res = await searchApi({ ...props.params, [searchField]: params });
137 if (Array.isArray(res)) { 149 if (Array.isArray(res)) {
138 options.value = res; 150 options.value = res;
139 emitChange(); 151 emitChange();
@@ -154,8 +166,7 @@ @@ -154,8 +166,7 @@
154 <template> 166 <template>
155 <Select 167 <Select
156 @dropdownVisibleChange="handleFetch" 168 @dropdownVisibleChange="handleFetch"
157 - v-bind="attrs"  
158 - show-search 169 + v-bind="getBindProps"
159 @change="handleChange" 170 @change="handleChange"
160 :options="getOptions" 171 :options="getOptions"
161 @search="debounceSearchFunction" 172 @search="debounceSearchFunction"
@@ -45,7 +45,7 @@ export enum EntityTypeNameEnum { @@ -45,7 +45,7 @@ export enum EntityTypeNameEnum {
45 CUSTOMER = '客户', 45 CUSTOMER = '客户',
46 USER = '用户', 46 USER = '用户',
47 DASHBOARD = '仪表板', 47 DASHBOARD = '仪表板',
48 - EDGE = 'Edge', 48 + EDGE = '边缘',
49 } 49 }
50 50
51 /** 51 /**
@@ -56,30 +56,11 @@ export enum PerimeterTypeEnum { @@ -56,30 +56,11 @@ export enum PerimeterTypeEnum {
56 CIRCLE = 'CIRCLE', 56 CIRCLE = 'CIRCLE',
57 } 57 }
58 58
59 -/**  
60 - * @description Filter Range util  
61 - */  
62 -export enum RangeUtilEnum {  
63 - METER = 'METER',  
64 - KILOMETER = 'KILOMETER',  
65 - FOOT = 'FOOT',  
66 - MILE = 'MILE',  
67 - NAUTICAL_MILE = 'NAUTICAL_MILE',  
68 -}  
69 -  
70 -export enum RangeUtilNameEnum {  
71 - METER = 'Meter',  
72 - KILOMETER = 'Kilometer',  
73 - FOOT = 'Foot',  
74 - MILE = 'Mile',  
75 - NAUTICAL_MILE = 'Nautical mile',  
76 -}  
77 -  
78 -export enum MessageTypesFilterEnum {  
79 - POST_ATTRIBUTES = 'POST_ATTRIBUTES',  
80 - POST_TELEMETRY = 'POST_TELEMETRY',  
81 - RPC_REQUEST_FROM_DEVICE = 'RPC_REQUEST_FROM_DEVICE',  
82 - RPC_REQUEST_TO_DEVICE = 'RPC_REQUEST_TO_DEVICE', 59 +export enum MessageTypesEnum {
  60 + POST_ATTRIBUTES_REQUEST = 'POST_ATTRIBUTES_REQUEST',
  61 + POST_TELEMETRY_REQUEST = 'POST_TELEMETRY_REQUEST',
  62 + TO_SERVER_RPC_REQUEST = 'TO_SERVER_RPC_REQUEST',
  63 + RPC_CALL_FROM_SERVER_TO_DEVICE = 'RPC_CALL_FROM_SERVER_TO_DEVICE',
83 ACTIVITY_EVENT = 'ACTIVITY_EVENT', 64 ACTIVITY_EVENT = 'ACTIVITY_EVENT',
84 INACTIVITY_EVENT = 'INACTIVITY_EVENT', 65 INACTIVITY_EVENT = 'INACTIVITY_EVENT',
85 CONNECT_EVENT = 'CONNECT_EVENT', 66 CONNECT_EVENT = 'CONNECT_EVENT',
@@ -100,11 +81,11 @@ export enum MessageTypesFilterEnum { @@ -100,11 +81,11 @@ export enum MessageTypesFilterEnum {
100 RPC_FAILED = 'RPC_FAILED', 81 RPC_FAILED = 'RPC_FAILED',
101 } 82 }
102 83
103 -export enum MessageTypesFilterNameEnum {  
104 - POST_ATTRIBUTES = 'Post attributes',  
105 - POST_TELEMETRY = 'Post telemetry',  
106 - RPC_REQUEST_FROM_DEVICE = 'RPC Request from Device',  
107 - RPC_REQUEST_TO_DEVICE = 'RPC Request to Device', 84 +export enum MessageTypesNameEnum {
  85 + POST_ATTRIBUTES_REQUEST = 'Post attributes',
  86 + POST_TELEMETRY_REQUEST = 'Post telemetry',
  87 + TO_SERVER_RPC_REQUEST = 'RPC Request from Device',
  88 + RPC_CALL_FROM_SERVER_TO_DEVICE = 'RPC Request to Device',
108 ACTIVITY_EVENT = 'Activity Event', 89 ACTIVITY_EVENT = 'Activity Event',
109 INACTIVITY_EVENT = 'Inactivity Event', 90 INACTIVITY_EVENT = 'Inactivity Event',
110 CONNECT_EVENT = 'Connect Event', 91 CONNECT_EVENT = 'Connect Event',
@@ -124,6 +105,24 @@ export enum MessageTypesFilterNameEnum { @@ -124,6 +105,24 @@ export enum MessageTypesFilterNameEnum {
124 RPC_TIMEOUT = 'RPC Timeout', 105 RPC_TIMEOUT = 'RPC Timeout',
125 RPC_FAILED = 'RPC Failed', 106 RPC_FAILED = 'RPC Failed',
126 } 107 }
  108 +/**
  109 + * @description Filter Range util
  110 + */
  111 +export enum RangeUtilEnum {
  112 + METER = 'METER',
  113 + KILOMETER = 'KILOMETER',
  114 + FOOT = 'FOOT',
  115 + MILE = 'MILE',
  116 + NAUTICAL_MILE = 'NAUTICAL_MILE',
  117 +}
  118 +
  119 +export enum RangeUtilNameEnum {
  120 + METER = 'Meter',
  121 + KILOMETER = 'Kilometer',
  122 + FOOT = 'Foot',
  123 + MILE = 'Mile',
  124 + NAUTICAL_MILE = 'Nautical mile',
  125 +}
127 126
128 // Enrichment Customer details 127 // Enrichment Customer details
129 export enum DetailsListEnum { 128 export enum DetailsListEnum {
@@ -85,7 +85,7 @@ export enum DelayDeprecatedFieldsEnum { @@ -85,7 +85,7 @@ export enum DelayDeprecatedFieldsEnum {
85 export enum DelayDeprecatedFieldsNameEnum { 85 export enum DelayDeprecatedFieldsNameEnum {
86 USE_METADATA_PERIOD_IN_SECONDS_PATTERNS = 'Use period in seconds pattern', 86 USE_METADATA_PERIOD_IN_SECONDS_PATTERNS = 'Use period in seconds pattern',
87 PERIOD_IN_SECONDS = 'Period in seconds', 87 PERIOD_IN_SECONDS = 'Period in seconds',
88 - PERIOD_IN_SECONDS_PATTERN = 'Period in seconds', 88 + PERIOD_IN_SECONDS_PATTERN = 'Period in seconds pattern',
89 MAX_PENDING_MSGS = 'Maximum pending messages', 89 MAX_PENDING_MSGS = 'Maximum pending messages',
90 } 90 }
91 91
@@ -131,8 +131,8 @@ export enum GeneratorFieldsNameEnum { @@ -131,8 +131,8 @@ export enum GeneratorFieldsNameEnum {
131 MSG_COUNT = 'Message count(0 - unlimited)', 131 MSG_COUNT = 'Message count(0 - unlimited)',
132 PERIOD_IN_SECONDS = 'Period in seconds', 132 PERIOD_IN_SECONDS = 'Period in seconds',
133 JS_SCRIPT = 'Generate', 133 JS_SCRIPT = 'Generate',
134 - // ORIGINATOR_ID = 'Originator',  
135 - ORIGINATOR_TYPE = 'Originator', 134 + // ORIGINATOR_ID = '资产',
  135 + ORIGINATOR_TYPE = '类型',
136 } 136 }
137 137
138 // Gps geofencing events 138 // Gps geofencing events
@@ -71,6 +71,7 @@ export enum OriginatorFieldsNameEnum { @@ -71,6 +71,7 @@ export enum OriginatorFieldsNameEnum {
71 71
72 // Enrichment originator telemetry 72 // Enrichment originator telemetry
73 export enum OriginatorTelemetryFieldsEnum { 73 export enum OriginatorTelemetryFieldsEnum {
  74 + LATEST_TS_KEY_NAMES = 'latestTsKeyNames',
74 AGGREGATION = 'aggregation', 75 AGGREGATION = 'aggregation',
75 FETCH_MODE = 'fetchMode', 76 FETCH_MODE = 'fetchMode',
76 ORDER_BY = 'orderBy', 77 ORDER_BY = 'orderBy',
@@ -85,6 +86,7 @@ export enum OriginatorTelemetryFieldsEnum { @@ -85,6 +86,7 @@ export enum OriginatorTelemetryFieldsEnum {
85 } 86 }
86 87
87 export enum OriginatorTelemetryFieldsNameEnum { 88 export enum OriginatorTelemetryFieldsNameEnum {
  89 + LATEST_TS_KEY_NAMES = 'Latest timeseries',
88 AGGREGATION = '数据聚合功能', 90 AGGREGATION = '数据聚合功能',
89 FETCH_MODE = 'Fetch Mode', 91 FETCH_MODE = 'Fetch Mode',
90 ORDER_BY = 'Order by', 92 ORDER_BY = 'Order by',
@@ -102,11 +104,13 @@ export enum OriginatorTelemetryFieldsNameEnum { @@ -102,11 +104,13 @@ export enum OriginatorTelemetryFieldsNameEnum {
102 export enum RelatedAttributesFieldsEnum { 104 export enum RelatedAttributesFieldsEnum {
103 RELATIONS_QUERY = 'relationsQuery', 105 RELATIONS_QUERY = 'relationsQuery',
104 ATTR_MAPPING = 'attrMapping', 106 ATTR_MAPPING = 'attrMapping',
  107 + TELEMETRY = 'telemetry',
105 } 108 }
106 109
107 -export enum RelatedAttributesFieldNameEnum { 110 +export enum RelatedAttributesFieldsNameEnum {
108 RELATIONS_QUERY = 'Relations query', 111 RELATIONS_QUERY = 'Relations query',
109 ATTR_MAPPING = 'Attributes mapping', 112 ATTR_MAPPING = 'Attributes mapping',
  113 + TELEMETRY = 'Latest telemetry',
110 } 114 }
111 115
112 // Enrichment Related device Attributes 116 // Enrichment Related device Attributes
@@ -144,6 +148,17 @@ export enum RelatedDeviceAttributeFieldsNameEnum { @@ -144,6 +148,17 @@ export enum RelatedDeviceAttributeFieldsNameEnum {
144 DEVICE_TYPES = '设备类型', 148 DEVICE_TYPES = '设备类型',
145 } 149 }
146 150
  151 +// Tenant attributes
  152 +export enum TenantAttributesFieldsEnum {
  153 + ATTR_MAPING = 'attrMapping',
  154 + TELEMETRY = 'telemetry',
  155 +}
  156 +
  157 +export enum TenantAttributesFieldsNameEnum {
  158 + ATTR_MAPING = 'attrMapping',
  159 + TELEMETRY = 'Latest telemetry',
  160 +}
  161 +
147 // Enrichment Tenant details 162 // Enrichment Tenant details
148 export enum TenantDetailsFieldsEnum { 163 export enum TenantDetailsFieldsEnum {
149 DETAILS_LIST = 'detailsList', 164 DETAILS_LIST = 'detailsList',
@@ -154,29 +169,3 @@ export enum TenantDetailsFieldsNameEnum { @@ -154,29 +169,3 @@ export enum TenantDetailsFieldsNameEnum {
154 DETAILS_LIST = 'Add selected details to message metadata', 169 DETAILS_LIST = 'Add selected details to message metadata',
155 ADD_TO_METADATA = 'Select entity details', 170 ADD_TO_METADATA = 'Select entity details',
156 } 171 }
157 -  
158 -export const EnrichmentCategoryFormFields = {  
159 - ...CalculateDeltaFieldsEnum,  
160 - ...CustomerAttributesFieldsEnum,  
161 - ...CustomerDetailsFieldsEnum,  
162 - ...OriginatorAttributesEnum,  
163 - ...OriginatorFieldsEnum,  
164 - ...OriginatorTelemetryFieldsEnum,  
165 - ...RelatedAttributesFieldsEnum,  
166 - ...RelatedDeviceAttributeFieldsEnum,  
167 - ...TenantDetailsFieldsEnum,  
168 -};  
169 -  
170 -export const EnrichmentCategoryFormFieldsName = {  
171 - ...CalculateDeltaFieldsNameEnum,  
172 - ...CustomerAttributesFieldsNameEnum,  
173 - ...CustomerDetailsFieldsNameEnum,  
174 - ...OriginatorAttributesNameEnum,  
175 - ...OriginatorFieldsNameEnum,  
176 - ...OriginatorTelemetryFieldsNameEnum,  
177 - ...RelatedAttributesFieldNameEnum,  
178 - ...RelatedDeviceAttributeFieldsNameEnum,  
179 - ...TenantDetailsFieldsNameEnum,  
180 -};  
181 -  
182 -export type EnrichmentCategoryType = typeof EnrichmentCategoryFormFields;  
@@ -244,23 +244,23 @@ export enum RestApiCallFieldsEnum { @@ -244,23 +244,23 @@ export enum RestApiCallFieldsEnum {
244 244
245 export enum RestApiCallFieldsNameEnum { 245 export enum RestApiCallFieldsNameEnum {
246 REST_ENDPOINT_URL_PATTERN = 'Endpoint URL pattern', 246 REST_ENDPOINT_URL_PATTERN = 'Endpoint URL pattern',
247 - REQUEST_METHOD = 'requestMethod',  
248 - USE_SIMPLE_CLIENT_HTTP_FACTORY = 'useSimpleClientHttpFactory',  
249 - IGNORE_REQUEST_BODY = 'ignoreRequestBody',  
250 - ENABLE_PROXY = 'enableProxy',  
251 - USE_SYSTEM_PROXY_PROPERTIES = 'useSystemProxyProperties',  
252 - PROXY_SCHEME = 'proxyScheme',  
253 - PROXY_HOST = 'proxyHost',  
254 - PROXY_PORT = 'proxyPort',  
255 - PROXY_USER = 'proxyUser',  
256 - PROXY_PASSWORD = 'proxyPassword',  
257 - READ_TIMEOUT_MS = 'readTimeoutMs',  
258 - MAX_PARALLEL_REQUESTS_COUNT = 'maxParallelRequestsCount',  
259 - HEADERS = 'headers',  
260 - USE_REDIS_QUEUE_FOR_MSG_PERSISTENCE = 'useRedisQueueForMsgPersistence',  
261 - TRIM_QUEUE = 'trimQueue',  
262 - MAX_QUEUE_SIZE = 'maxQueueSize',  
263 - CREDENTIALS = 'credentials', 247 + REQUEST_METHOD = 'Request method',
  248 + USE_SIMPLE_CLIENT_HTTP_FACTORY = 'Use simple client HTTP factory',
  249 + IGNORE_REQUEST_BODY = 'Without request body',
  250 + ENABLE_PROXY = 'Enable proxy',
  251 + USE_SYSTEM_PROXY_PROPERTIES = 'Use system proxy properties',
  252 + PROXY_SCHEME = 'Proxy scheme',
  253 + PROXY_HOST = 'Proxy host',
  254 + PROXY_PORT = 'Proxy port',
  255 + PROXY_USER = 'Proxy user',
  256 + PROXY_PASSWORD = 'Proxy password',
  257 + READ_TIMEOUT_MS = 'Read timeout in millis',
  258 + MAX_PARALLEL_REQUESTS_COUNT = 'Max number of parallel request',
  259 + HEADERS = 'Header',
  260 + USE_REDIS_QUEUE_FOR_MSG_PERSISTENCE = 'Use redis queue for message persistence',
  261 + TRIM_QUEUE = 'Trim redis queue',
  262 + MAX_QUEUE_SIZE = 'Redis queue max size',
  263 + CREDENTIALS = 'Credentials',
264 264
265 TYPE = 'Credentials type', 265 TYPE = 'Credentials type',
266 PASSWORD = 'Password', 266 PASSWORD = 'Password',
1 // Filter Check Alarm Status Fields 1 // Filter Check Alarm Status Fields
2 -export enum FilterCheckAlarmStatusFieldEnum { 2 +export enum CheckAlarmStatusFieldEnum {
3 ALARM_STATUS_LIST = 'alarmStatusList', 3 ALARM_STATUS_LIST = 'alarmStatusList',
4 } 4 }
5 5
6 -export enum FilterCheckAlarmStatusFieldNameEnum { 6 +export enum CheckAlarmStatusFieldNameEnum {
7 ALARM_STATUS_LIST = 'Alarm status filter', 7 ALARM_STATUS_LIST = 'Alarm status filter',
8 } 8 }
9 9
@@ -90,24 +90,11 @@ export enum ScriptFieldsNameEnum { @@ -90,24 +90,11 @@ export enum ScriptFieldsNameEnum {
90 JS_SCRIPT = 'Filter', 90 JS_SCRIPT = 'Filter',
91 } 91 }
92 92
93 -export const FilterCategoryFormFields = {  
94 - ...FilterCheckAlarmStatusFieldEnum,  
95 - ...CheckExistenceFieldsEnum,  
96 - ...CheckRelationFieldsEnum,  
97 - ...GpsGeofencingFilterFieldsEnum,  
98 - ...MessageTypeFieldsEnum,  
99 - ...OriginatorTypeFieldsEnum,  
100 - ...ScriptFieldsEnum,  
101 -};  
102 -  
103 -export const FilterCategoryFormFieldsName = {  
104 - ...FilterCheckAlarmStatusFieldNameEnum,  
105 - ...CheckExistenceFieldsNameEnum,  
106 - ...CheckRelationFieldsNameEnum,  
107 - ...GpsGeofencingFilterFieldsNameEnum,  
108 - ...MessageTypeFieldsNameEnum,  
109 - ...OriginatorTypeFieldsNameEnum,  
110 - ...ScriptFieldsNameEnum,  
111 -}; 93 +// Filter Switch
  94 +export enum SwitchFieldsEnum {
  95 + JS_SCRIPT = 'jsScript',
  96 +}
112 97
113 -export type FilterCategoryFormType = typeof FilterCategoryFormFields; 98 +export enum SwitchFieldsNameEnum {
  99 + JS_SCRIPT = 'Filter',
  100 +}
1 import { CommonFields, CommonFieldsName } from './formField/common'; 1 import { CommonFields, CommonFieldsName } from './formField/common';
2 -import {  
3 - EnrichmentCategoryFormFields,  
4 - EnrichmentCategoryFormFieldsName,  
5 -} from './formField/enrichment';  
6 -import { FilterCategoryFormFields, FilterCategoryFormFieldsName } from './formField/filter';  
7 2
8 export enum FetchNodeComFlagTypeENum { 3 export enum FetchNodeComFlagTypeENum {
9 CONNECTION_MODAL = 'CONNECTION_MODAL', 4 CONNECTION_MODAL = 'CONNECTION_MODAL',
@@ -20,12 +15,8 @@ export enum EdgeBindDataFieldNameEnum { @@ -20,12 +15,8 @@ export enum EdgeBindDataFieldNameEnum {
20 15
21 export const NodeBindDataFieldEnum = { 16 export const NodeBindDataFieldEnum = {
22 ...CommonFields, 17 ...CommonFields,
23 - ...FilterCategoryFormFields,  
24 - ...EnrichmentCategoryFormFields,  
25 }; 18 };
26 19
27 export const NodeBindDataFieldNameEnum = { 20 export const NodeBindDataFieldNameEnum = {
28 ...CommonFieldsName, 21 ...CommonFieldsName,
29 - ...FilterCategoryFormFieldsName,  
30 - ...EnrichmentCategoryFormFieldsName,  
31 }; 22 };
@@ -14,7 +14,7 @@ export function useInputNode() { @@ -14,7 +14,7 @@ export function useInputNode() {
14 description: '规则链的逻辑输入,将传入消息转发到下一个相关规则节点。', 14 description: '规则链的逻辑输入,将传入消息转发到下一个相关规则节点。',
15 }, 15 },
16 }, 16 },
17 - { id, draggable: false } 17 + { id, draggable: false, selectable: false }
18 ); 18 );
19 19
20 return newNode; 20 return newNode;
@@ -36,6 +36,7 @@ export const formSchemas: FormSchema[] = [ @@ -36,6 +36,7 @@ export const formSchemas: FormSchema[] = [
36 label: EntityTypeNameEnum[value], 36 label: EntityTypeNameEnum[value],
37 value, 37 value,
38 })), 38 })),
  39 + getPopupContainer: () => document.body,
39 placeholder: `请选择${CreateRelationFieldsNameEnum.ENTITY_TYPE}`, 40 placeholder: `请选择${CreateRelationFieldsNameEnum.ENTITY_TYPE}`,
40 }, 41 },
41 }, 42 },
@@ -49,7 +50,7 @@ export const formSchemas: FormSchema[] = [ @@ -49,7 +50,7 @@ export const formSchemas: FormSchema[] = [
49 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body', 50 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
50 ], 51 ],
51 componentProps: { 52 componentProps: {
52 - placeholder: `请选择${CreateRelationFieldsNameEnum.ENTITY_NAME_PATTERN}`, 53 + placeholder: `请输入${CreateRelationFieldsNameEnum.ENTITY_NAME_PATTERN}`,
53 }, 54 },
54 }, 55 },
55 { 56 {
@@ -83,33 +84,31 @@ export const formSchemas: FormSchema[] = [ @@ -83,33 +84,31 @@ export const formSchemas: FormSchema[] = [
83 { 84 {
84 field: CreateRelationFieldsEnum.CREATE_ENTITY_IF_NOT_EXISTS, 85 field: CreateRelationFieldsEnum.CREATE_ENTITY_IF_NOT_EXISTS,
85 component: 'Checkbox', 86 component: 'Checkbox',
86 - label: '',  
87 - helpMessage: 'Create a new entity set above if it does not exist.', 87 + label: CreateRelationFieldsNameEnum.CREATE_ENTITY_IF_NOT_EXISTS,
  88 + helpMessage: '',
88 show: ({ model }) => { 89 show: ({ model }) => {
89 const type = model[CreateRelationFieldsEnum.ENTITY_TYPE]; 90 const type = model[CreateRelationFieldsEnum.ENTITY_TYPE];
90 return [EntityTypeEnum.ASSET, EntityTypeEnum.DEVICE, EntityTypeEnum.CUSTOMER].includes(type); 91 return [EntityTypeEnum.ASSET, EntityTypeEnum.DEVICE, EntityTypeEnum.CUSTOMER].includes(type);
91 }, 92 },
92 renderComponentContent: () => ({ 93 renderComponentContent: () => ({
93 - default: () => CreateRelationFieldsNameEnum.CREATE_ENTITY_IF_NOT_EXISTS, 94 + default: () => 'Create a new entity set above if it does not exist.',
94 }), 95 }),
95 }, 96 },
96 { 97 {
97 field: CreateRelationFieldsEnum.REMOVE_CURRENT_RELATIONS, 98 field: CreateRelationFieldsEnum.REMOVE_CURRENT_RELATIONS,
98 component: 'Checkbox', 99 component: 'Checkbox',
99 - label: '',  
100 - helpMessage:  
101 - 'Removes current relations from the originator of the incoming message based on direction and type.', 100 + label: CreateRelationFieldsNameEnum.REMOVE_CURRENT_RELATIONS,
102 renderComponentContent: () => ({ 101 renderComponentContent: () => ({
103 - default: () => CreateRelationFieldsNameEnum.REMOVE_CURRENT_RELATIONS, 102 + default: () =>
  103 + 'Removes current relations from the originator of the incoming message based on direction and type.',
104 }), 104 }),
105 }, 105 },
106 { 106 {
107 field: CreateRelationFieldsEnum.CHANGE_ORIGINATOR_TO_RELATED_ENTITY, 107 field: CreateRelationFieldsEnum.CHANGE_ORIGINATOR_TO_RELATED_ENTITY,
108 component: 'Checkbox', 108 component: 'Checkbox',
109 - label: '',  
110 - helpMessage: 'Used to process submitted message as a message from another entity.', 109 + label: CreateRelationFieldsNameEnum.CHANGE_ORIGINATOR_TO_RELATED_ENTITY,
111 renderComponentContent: () => ({ 110 renderComponentContent: () => ({
112 - default: () => CreateRelationFieldsNameEnum.CHANGE_ORIGINATOR_TO_RELATED_ENTITY, 111 + default: () => 'Used to process submitted message as a message from another entity.',
113 }), 112 }),
114 }, 113 },
115 { 114 {
@@ -19,7 +19,7 @@ export const formSchemas: FormSchema[] = [ @@ -19,7 +19,7 @@ export const formSchemas: FormSchema[] = [
19 component: 'Input', 19 component: 'Input',
20 label: DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS_PATTERN, 20 label: DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS_PATTERN,
21 required: true, 21 required: true,
22 - show: ({ model }) => model[DelayDeprecatedFieldsEnum.USE_METADATA_PERIOD_IN_SECONDS_PATTERNS], 22 + ifShow: ({ model }) => model[DelayDeprecatedFieldsEnum.USE_METADATA_PERIOD_IN_SECONDS_PATTERNS],
23 componentProps: { 23 componentProps: {
24 min: 0, 24 min: 0,
25 placeholder: `请输入${DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS_PATTERN}`, 25 placeholder: `请输入${DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS_PATTERN}`,
@@ -30,7 +30,8 @@ export const formSchemas: FormSchema[] = [ @@ -30,7 +30,8 @@ export const formSchemas: FormSchema[] = [
30 component: 'InputNumber', 30 component: 'InputNumber',
31 label: DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS, 31 label: DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS,
32 required: true, 32 required: true,
33 - show: ({ model }) => !model[DelayDeprecatedFieldsEnum.USE_METADATA_PERIOD_IN_SECONDS_PATTERNS], 33 + ifShow: ({ model }) =>
  34 + !model[DelayDeprecatedFieldsEnum.USE_METADATA_PERIOD_IN_SECONDS_PATTERNS],
34 componentProps: { 35 componentProps: {
35 min: 0, 36 min: 0,
36 placeholder: `请输入${DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS}`, 37 placeholder: `请输入${DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS}`,
1 -import { DirectionEnum, DirectionNameEnum } from '../../../enum/form'; 1 +import {
  2 + DirectionEnum,
  3 + DirectionNameEnum,
  4 + EntityTypeEnum,
  5 + EntityTypeNameEnum,
  6 +} from '../../../enum/form';
2 import { 7 import {
3 DeleteRelationFieldsEnum, 8 DeleteRelationFieldsEnum,
4 DeleteRelationFieldsNameEnum, 9 DeleteRelationFieldsNameEnum,
@@ -20,7 +25,6 @@ export const formSchemas: FormSchema[] = [ @@ -20,7 +25,6 @@ export const formSchemas: FormSchema[] = [
20 component: 'Select', 25 component: 'Select',
21 label: DeleteRelationFieldsNameEnum.DIRECTION, 26 label: DeleteRelationFieldsNameEnum.DIRECTION,
22 required: true, 27 required: true,
23 - colProps: { span: 12 },  
24 show: ({ model }) => model[DeleteRelationFieldsEnum.DELETE_FOR_SINGLE_ENTITY], 28 show: ({ model }) => model[DeleteRelationFieldsEnum.DELETE_FOR_SINGLE_ENTITY],
25 componentProps: { 29 componentProps: {
26 options: Object.keys(DirectionEnum).map((value) => ({ 30 options: Object.keys(DirectionEnum).map((value) => ({
@@ -32,6 +36,21 @@ export const formSchemas: FormSchema[] = [ @@ -32,6 +36,21 @@ export const formSchemas: FormSchema[] = [
32 }, 36 },
33 }, 37 },
34 { 38 {
  39 + field: DeleteRelationFieldsEnum.ENTITY_TYPE,
  40 + component: 'Select',
  41 + label: DeleteRelationFieldsNameEnum.ENTITY_TYPE,
  42 + required: true,
  43 + colProps: { span: 12 },
  44 + componentProps: {
  45 + options: Object.keys(EntityTypeEnum).map((value) => ({
  46 + label: EntityTypeNameEnum[value],
  47 + value,
  48 + })),
  49 + getPopupContainer: () => document.body,
  50 + placeholder: `请选择${DeleteRelationFieldsNameEnum.ENTITY_TYPE}`,
  51 + },
  52 + },
  53 + {
35 field: DeleteRelationFieldsEnum.ENTITY_NAME_PATTERN, 54 field: DeleteRelationFieldsEnum.ENTITY_NAME_PATTERN,
36 component: 'Input', 55 component: 'Input',
37 label: DeleteRelationFieldsNameEnum.ENTITY_NAME_PATTERN, 56 label: DeleteRelationFieldsNameEnum.ENTITY_NAME_PATTERN,
1 import { EntityTypeEnum, EntityTypeNameEnum } from '../../../enum/form'; 1 import { EntityTypeEnum, EntityTypeNameEnum } from '../../../enum/form';
2 import { GeneratorFieldsEnum, GeneratorFieldsNameEnum } from '../../../enum/formField/action'; 2 import { GeneratorFieldsEnum, GeneratorFieldsNameEnum } from '../../../enum/formField/action';
3 import { JavascriptEditorWithTestModal } from '../../../src/components/JavaScriptFilterModal'; 3 import { JavascriptEditorWithTestModal } from '../../../src/components/JavaScriptFilterModal';
  4 +import { getEntityIdSelect } from '../../Filter/CheckRelation/create.config';
4 import { FormSchema, useComponentRegister } from '/@/components/Form'; 5 import { FormSchema, useComponentRegister } from '/@/components/Form';
5 6
6 useComponentRegister('JavascriptEditorWithTestModal', JavascriptEditorWithTestModal); 7 useComponentRegister('JavascriptEditorWithTestModal', JavascriptEditorWithTestModal);
@@ -37,13 +38,18 @@ export const formSchemas: FormSchema[] = [ @@ -37,13 +38,18 @@ export const formSchemas: FormSchema[] = [
37 value, 38 value,
38 })), 39 })),
39 placeholder: `请选择${GeneratorFieldsNameEnum.ORIGINATOR_TYPE}`, 40 placeholder: `请选择${GeneratorFieldsNameEnum.ORIGINATOR_TYPE}`,
  41 + getPopupContainer: () => document.body,
40 }, 42 },
41 }, 43 },
42 { 44 {
43 field: GeneratorFieldsEnum.ORIGINATOR_ID, 45 field: GeneratorFieldsEnum.ORIGINATOR_ID,
44 - component: 'Select',  
45 - label: GeneratorFieldsNameEnum.ORIGINATOR_TYPE, 46 + component: 'ApiSearchSelect',
  47 + label: ' ',
46 colProps: { span: 16 }, 48 colProps: { span: 16 },
  49 + componentProps: ({ formModel }) => {
  50 + const type = formModel[GeneratorFieldsEnum.ORIGINATOR_TYPE];
  51 + return getEntityIdSelect(type);
  52 + },
47 }, 53 },
48 { 54 {
49 field: GeneratorFieldsEnum.JS_SCRIPT, 55 field: GeneratorFieldsEnum.JS_SCRIPT,
@@ -47,7 +47,7 @@ export const formSchemas: FormSchema[] = [ @@ -47,7 +47,7 @@ export const formSchemas: FormSchema[] = [
47 component: 'Input', 47 component: 'Input',
48 label: GpsGeofencingEventsFieldsNameEnum.PERIMETER_KEY_NAME, 48 label: GpsGeofencingEventsFieldsNameEnum.PERIMETER_KEY_NAME,
49 required: true, 49 required: true,
50 - show: ({ model }) => 50 + ifShow: ({ model }) =>
51 model[GpsGeofencingEventsFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.POLYGON && 51 model[GpsGeofencingEventsFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.POLYGON &&
52 model[GpsGeofencingEventsFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA], 52 model[GpsGeofencingEventsFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA],
53 componentProps: { 53 componentProps: {
@@ -61,7 +61,7 @@ export const formSchemas: FormSchema[] = [ @@ -61,7 +61,7 @@ export const formSchemas: FormSchema[] = [
61 helpMessage: 61 helpMessage:
62 'Please, use the following format for manual definition of polygon: [[lat1,lon1],[lat2,lon2], ... ,[latN,lonN]].', 62 'Please, use the following format for manual definition of polygon: [[lat1,lon1],[lat2,lon2], ... ,[latN,lonN]].',
63 required: true, 63 required: true,
64 - show: ({ model }) => 64 + ifShow: ({ model }) =>
65 model[GpsGeofencingEventsFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.POLYGON && 65 model[GpsGeofencingEventsFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.POLYGON &&
66 !model[GpsGeofencingEventsFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA], 66 !model[GpsGeofencingEventsFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA],
67 componentProps: { 67 componentProps: {
@@ -74,7 +74,7 @@ export const formSchemas: FormSchema[] = [ @@ -74,7 +74,7 @@ export const formSchemas: FormSchema[] = [
74 label: GpsGeofencingEventsFieldsNameEnum.CENTER_LATITUDE, 74 label: GpsGeofencingEventsFieldsNameEnum.CENTER_LATITUDE,
75 colProps: { span: 12 }, 75 colProps: { span: 12 },
76 required: true, 76 required: true,
77 - show: ({ model }) => 77 + ifShow: ({ model }) =>
78 model[GpsGeofencingEventsFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.CIRCLE && 78 model[GpsGeofencingEventsFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.CIRCLE &&
79 !model[GpsGeofencingEventsFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA], 79 !model[GpsGeofencingEventsFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA],
80 componentProps: { 80 componentProps: {
@@ -86,7 +86,7 @@ export const formSchemas: FormSchema[] = [ @@ -86,7 +86,7 @@ export const formSchemas: FormSchema[] = [
86 component: 'InputNumber', 86 component: 'InputNumber',
87 label: GpsGeofencingEventsFieldsNameEnum.CENTER_LONGITUDE, 87 label: GpsGeofencingEventsFieldsNameEnum.CENTER_LONGITUDE,
88 colProps: { span: 12 }, 88 colProps: { span: 12 },
89 - show: ({ model }) => 89 + ifShow: ({ model }) =>
90 model[GpsGeofencingEventsFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.CIRCLE && 90 model[GpsGeofencingEventsFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.CIRCLE &&
91 !model[GpsGeofencingEventsFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA], 91 !model[GpsGeofencingEventsFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA],
92 componentProps: { 92 componentProps: {
@@ -99,7 +99,7 @@ export const formSchemas: FormSchema[] = [ @@ -99,7 +99,7 @@ export const formSchemas: FormSchema[] = [
99 label: GpsGeofencingEventsFieldsNameEnum.RANGE, 99 label: GpsGeofencingEventsFieldsNameEnum.RANGE,
100 colProps: { span: 12 }, 100 colProps: { span: 12 },
101 required: true, 101 required: true,
102 - show: ({ model }) => 102 + ifShow: ({ model }) =>
103 model[GpsGeofencingEventsFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.CIRCLE && 103 model[GpsGeofencingEventsFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.CIRCLE &&
104 !model[GpsGeofencingEventsFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA], 104 !model[GpsGeofencingEventsFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA],
105 componentProps: { 105 componentProps: {
@@ -112,7 +112,7 @@ export const formSchemas: FormSchema[] = [ @@ -112,7 +112,7 @@ export const formSchemas: FormSchema[] = [
112 label: GpsGeofencingEventsFieldsNameEnum.RANGE_UNIT, 112 label: GpsGeofencingEventsFieldsNameEnum.RANGE_UNIT,
113 colProps: { span: 12 }, 113 colProps: { span: 12 },
114 required: true, 114 required: true,
115 - show: ({ model }) => 115 + ifShow: ({ model }) =>
116 model[GpsGeofencingEventsFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.CIRCLE && 116 model[GpsGeofencingEventsFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.CIRCLE &&
117 !model[GpsGeofencingEventsFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA], 117 !model[GpsGeofencingEventsFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA],
118 componentProps: { 118 componentProps: {
@@ -21,6 +21,7 @@ export const formSchemas: FormSchema[] = [ @@ -21,6 +21,7 @@ export const formSchemas: FormSchema[] = [
21 field: SaveAttributesFieldsEnum.NOTIFY_DEVICE, 21 field: SaveAttributesFieldsEnum.NOTIFY_DEVICE,
22 component: 'Checkbox', 22 component: 'Checkbox',
23 label: SaveAttributesFieldsNameEnum.NOTIFY_DEVICE, 23 label: SaveAttributesFieldsNameEnum.NOTIFY_DEVICE,
  24 + ifShow: ({ model }) => model[SaveAttributesFieldsEnum.SCOPE] === ScopeEnum.SHARED_SCOPE,
24 renderComponentContent: () => ({ 25 renderComponentContent: () => ({
25 default: () => 26 default: () =>
26 'If the message arrives from the device, we will push it back to the device by default.', 27 'If the message arrives from the device, we will push it back to the device by default.',
  1 +import { h } from 'vue';
1 import { SaveEventFieldsEnum, SaveEventFieldsNameEnum } from '../../../enum/formField/action'; 2 import { SaveEventFieldsEnum, SaveEventFieldsNameEnum } from '../../../enum/formField/action';
2 import { FormSchema } from '/@/components/Form'; 3 import { FormSchema } from '/@/components/Form';
3 4
4 export const formSchemas: FormSchema[] = [ 5 export const formSchemas: FormSchema[] = [
5 { 6 {
  7 + field: 'content',
  8 + label: '',
  9 + component: 'Input',
  10 + renderColContent: () =>
  11 + h(
  12 + 'div',
  13 + { style: { color: 'red' } },
  14 + `定义的配置指令 'tkMsgEventNodeConfiguration' 不可用。`
  15 + ),
  16 + },
  17 + {
6 field: SaveEventFieldsEnum.CONFIGURATION, 18 field: SaveEventFieldsEnum.CONFIGURATION,
7 component: 'JSONEditor', 19 component: 'JSONEditor',
8 label: SaveEventFieldsNameEnum.CONFIGURATION, 20 label: SaveEventFieldsNameEnum.CONFIGURATION,
@@ -28,7 +28,6 @@ export const formSchemas: FormSchema[] = [ @@ -28,7 +28,6 @@ export const formSchemas: FormSchema[] = [
28 { 28 {
29 required: true, 29 required: true,
30 validator(_rule, value) { 30 validator(_rule, value) {
31 - console.log(value);  
32 if (!isObject(value) || !Object.keys(value).length) 31 if (!isObject(value) || !Object.keys(value).length)
33 return Promise.reject('至少应该指定一个字段映射。'); 32 return Promise.reject('至少应该指定一个字段映射。');
34 return Promise.resolve(); 33 return Promise.resolve();
1 -import { NodeBindDataFieldEnum, NodeBindDataFieldNameEnum } from '../../../enum/node'; 1 +import {
  2 + CalculateDeltaFieldsEnum,
  3 + CalculateDeltaFieldsNameEnum,
  4 +} from '../../../enum/formField/enrichment';
2 import { FormSchema } from '/@/components/Form'; 5 import { FormSchema } from '/@/components/Form';
3 6
4 export const formSchemas: FormSchema[] = [ 7 export const formSchemas: FormSchema[] = [
5 { 8 {
6 - field: NodeBindDataFieldEnum.INPUT_VALUE_KEY, 9 + field: CalculateDeltaFieldsEnum.INPUT_VALUE_KEY,
7 component: 'Input', 10 component: 'Input',
8 - label: NodeBindDataFieldNameEnum.INPUT_VALUE_KEY, 11 + label: CalculateDeltaFieldsNameEnum.INPUT_VALUE_KEY,
9 required: true, 12 required: true,
10 colProps: { span: 8 }, 13 colProps: { span: 8 },
  14 + componentProps: {
  15 + placeholder: `请输入${CalculateDeltaFieldsNameEnum.INPUT_VALUE_KEY}`,
  16 + },
11 }, 17 },
12 { 18 {
13 - field: NodeBindDataFieldEnum.OUTPUT_VALUE_KEY, 19 + field: CalculateDeltaFieldsEnum.OUTPUT_VALUE_KEY,
14 component: 'Input', 20 component: 'Input',
15 - label: NodeBindDataFieldNameEnum.OUTPUT_VALUE_KEY, 21 + label: CalculateDeltaFieldsNameEnum.OUTPUT_VALUE_KEY,
16 required: true, 22 required: true,
17 colProps: { span: 8 }, 23 colProps: { span: 8 },
  24 + componentProps: {
  25 + placeholder: `请输入${CalculateDeltaFieldsNameEnum.OUTPUT_VALUE_KEY}`,
  26 + },
18 }, 27 },
19 { 28 {
20 - field: NodeBindDataFieldEnum.ROUND, 29 + field: CalculateDeltaFieldsEnum.ROUND,
21 component: 'InputNumber', 30 component: 'InputNumber',
22 - label: NodeBindDataFieldNameEnum.ROUND, 31 + label: CalculateDeltaFieldsNameEnum.ROUND,
23 colProps: { span: 8 }, 32 colProps: { span: 8 },
24 componentProps: { 33 componentProps: {
25 step: 1, 34 step: 1,
26 max: 15, 35 max: 15,
  36 + placeholder: `请输入${CalculateDeltaFieldsNameEnum.ROUND}`,
27 }, 37 },
28 }, 38 },
29 { 39 {
30 - field: NodeBindDataFieldEnum.USE_CACHE, 40 + field: CalculateDeltaFieldsEnum.USE_CACHE,
31 component: 'Checkbox', 41 component: 'Checkbox',
32 label: '', 42 label: '',
33 renderComponentContent: () => { 43 renderComponentContent: () => {
34 return { 44 return {
35 - default: () => NodeBindDataFieldNameEnum.USE_CACHE, 45 + default: () => CalculateDeltaFieldsNameEnum.USE_CACHE,
36 }; 46 };
37 }, 47 },
38 }, 48 },
39 { 49 {
40 - field: NodeBindDataFieldEnum.TELL_FAILURE_IF_DELTA_IS_NEGATIVE, 50 + field: CalculateDeltaFieldsEnum.TELL_FAILURE_IF_DELTA_IS_NEGATIVE,
41 component: 'Checkbox', 51 component: 'Checkbox',
42 label: '', 52 label: '',
43 renderComponentContent: () => { 53 renderComponentContent: () => {
44 return { 54 return {
45 - default: () => NodeBindDataFieldNameEnum.TELL_FAILURE_IF_DELTA_IS_NEGATIVE, 55 + default: () => CalculateDeltaFieldsNameEnum.TELL_FAILURE_IF_DELTA_IS_NEGATIVE,
46 }; 56 };
47 }, 57 },
48 }, 58 },
49 { 59 {
50 - field: NodeBindDataFieldEnum.ADD_PERIOD_BETWEEN_MSGS, 60 + field: CalculateDeltaFieldsEnum.ADD_PERIOD_BETWEEN_MSGS,
51 component: 'Checkbox', 61 component: 'Checkbox',
52 label: '', 62 label: '',
53 renderComponentContent: () => { 63 renderComponentContent: () => {
54 return { 64 return {
55 - default: () => NodeBindDataFieldNameEnum.ADD_PERIOD_BETWEEN_MSGS, 65 + default: () => CalculateDeltaFieldsNameEnum.ADD_PERIOD_BETWEEN_MSGS,
56 }; 66 };
57 }, 67 },
58 }, 68 },
59 { 69 {
60 - field: NodeBindDataFieldEnum.PERIOD_VALUE_KEY, 70 + field: CalculateDeltaFieldsEnum.PERIOD_VALUE_KEY,
61 component: 'Input', 71 component: 'Input',
62 - label: NodeBindDataFieldNameEnum.PERIOD_VALUE_KEY, 72 + label: CalculateDeltaFieldsNameEnum.PERIOD_VALUE_KEY,
63 required: true, 73 required: true,
64 - ifShow: ({ model }) => model[NodeBindDataFieldEnum.ADD_PERIOD_BETWEEN_MSGS], 74 + ifShow: ({ model }) => model[CalculateDeltaFieldsEnum.ADD_PERIOD_BETWEEN_MSGS],
  75 + componentProps: {
  76 + placeholder: `请输入${CalculateDeltaFieldsNameEnum.PERIOD_VALUE_KEY}`,
  77 + },
65 }, 78 },
66 ]; 79 ];
1 -import { NodeBindDataFieldEnum, NodeBindDataFieldNameEnum } from '../../../enum/node'; 1 +import {
  2 + CustomerAttributesFieldsEnum,
  3 + CustomerAttributesFieldsNameEnum,
  4 +} from '../../../enum/formField/enrichment';
2 import { FormSchema, useComponentRegister } from '/@/components/Form'; 5 import { FormSchema, useComponentRegister } from '/@/components/Form';
3 import { AttributeConfiguration } from '/@/views/rule/designer/src/components/AttributeConfiguration'; 6 import { AttributeConfiguration } from '/@/views/rule/designer/src/components/AttributeConfiguration';
4 7
@@ -6,20 +9,20 @@ useComponentRegister('AttributeConfiguration', AttributeConfiguration); @@ -6,20 +9,20 @@ useComponentRegister('AttributeConfiguration', AttributeConfiguration);
6 9
7 export const formSchemas: FormSchema[] = [ 10 export const formSchemas: FormSchema[] = [
8 { 11 {
9 - field: NodeBindDataFieldEnum.TELEMETRY, 12 + field: CustomerAttributesFieldsEnum.TELEMETRY,
10 component: 'Checkbox', 13 component: 'Checkbox',
11 label: '', 14 label: '',
12 renderComponentContent: () => { 15 renderComponentContent: () => {
13 return { 16 return {
14 - default: () => NodeBindDataFieldNameEnum.TELEMETRY, 17 + default: () => CustomerAttributesFieldsNameEnum.TELEMETRY,
15 }; 18 };
16 }, 19 },
17 }, 20 },
18 { 21 {
19 - field: NodeBindDataFieldEnum.ATTR_MAPING, 22 + field: CustomerAttributesFieldsEnum.ATTR_MAPING,
20 component: 'AttributeConfiguration', 23 component: 'AttributeConfiguration',
21 - label: NodeBindDataFieldNameEnum.ATTR_MAPING,  
22 - slot: NodeBindDataFieldEnum.ATTR_MAPING, 24 + label: CustomerAttributesFieldsNameEnum.ATTR_MAPING,
  25 + slot: CustomerAttributesFieldsEnum.ATTR_MAPING,
23 valueField: 'value', 26 valueField: 'value',
24 changeEvent: 'update:value', 27 changeEvent: 'update:value',
25 }, 28 },
1 import { DetailsListEnum, DetailsListNameEnum } from '../../../enum/form'; 1 import { DetailsListEnum, DetailsListNameEnum } from '../../../enum/form';
2 -import { NodeBindDataFieldEnum, NodeBindDataFieldNameEnum } from '../../../enum/node'; 2 +import {
  3 + CustomerDetailsFieldsEnum,
  4 + CustomerDetailsFieldsNameEnum,
  5 +} from '../../../enum/formField/enrichment';
3 import { FormSchema } from '/@/components/Form'; 6 import { FormSchema } from '/@/components/Form';
4 7
5 export const formSchemas: FormSchema[] = [ 8 export const formSchemas: FormSchema[] = [
6 { 9 {
7 - field: NodeBindDataFieldEnum.DETAILS_LIST, 10 + field: CustomerDetailsFieldsEnum.DETAILS_LIST,
8 component: 'Select', 11 component: 'Select',
9 - label: NodeBindDataFieldNameEnum.DETAILS_LIST, 12 + label: CustomerDetailsFieldsNameEnum.DETAILS_LIST,
10 componentProps: { 13 componentProps: {
11 mode: 'multiple', 14 mode: 'multiple',
12 options: Object.keys(DetailsListEnum).map((item) => ({ 15 options: Object.keys(DetailsListEnum).map((item) => ({
13 label: DetailsListNameEnum[item], 16 label: DetailsListNameEnum[item],
14 value: item, 17 value: item,
15 - getPopupContainer: () => document.body,  
16 })), 18 })),
  19 + getPopupContainer: () => document.body,
17 }, 20 },
18 }, 21 },
19 { 22 {
20 - field: NodeBindDataFieldEnum.ADD_TO_METADATA, 23 + field: CustomerDetailsFieldsEnum.ADD_TO_METADATA,
21 component: 'Checkbox', 24 component: 'Checkbox',
22 label: '', 25 label: '',
23 renderComponentContent: () => { 26 renderComponentContent: () => {
24 return { 27 return {
25 - default: () => NodeBindDataFieldNameEnum.ADD_TO_METADATA, 28 + default: () => CustomerDetailsFieldsNameEnum.ADD_TO_METADATA,
26 }; 29 };
27 }, 30 },
28 }, 31 },
1 -import { NodeBindDataFieldEnum, NodeBindDataFieldNameEnum } from '../../../enum/node'; 1 +import {
  2 + OriginatorAttributesEnum,
  3 + OriginatorAttributesNameEnum,
  4 +} from '../../../enum/formField/enrichment';
2 import { FormSchema } from '/@/components/Form'; 5 import { FormSchema } from '/@/components/Form';
3 6
4 export const formSchemas: FormSchema[] = [ 7 export const formSchemas: FormSchema[] = [
5 { 8 {
6 - field: NodeBindDataFieldEnum.TELL_FAILURE_IF_ABSENT, 9 + field: OriginatorAttributesEnum.TELL_FAILURE_IF_ABSENT,
7 component: 'Checkbox', 10 component: 'Checkbox',
8 - label: '',  
9 - // helpMessage: [  
10 - // 'If at least one selected key doesn\'t exist the outbound message will report "Failure".',  
11 - // ], 11 + label: OriginatorAttributesNameEnum.TELL_FAILURE_IF_ABSENT,
12 renderComponentContent: () => ({ 12 renderComponentContent: () => ({
13 - default: () => NodeBindDataFieldNameEnum.TELL_FAILURE_IF_ABSENT, 13 + default: () =>
  14 + 'If at least one selected key doesn\'t exist the outbound message will report "Failure".',
14 }), 15 }),
15 }, 16 },
16 { 17 {
17 - field: NodeBindDataFieldEnum.CLIENT_ATTRIBUTE_NAMES, 18 + field: OriginatorAttributesEnum.CLIENT_ATTRIBUTE_NAMES,
18 component: 'Select', 19 component: 'Select',
19 - label: NodeBindDataFieldNameEnum.CLIENT_ATTRIBUTE_NAMES, 20 + label: OriginatorAttributesNameEnum.CLIENT_ATTRIBUTE_NAMES,
20 helpMessage: [ 21 helpMessage: [
21 `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`, 22 `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`,
22 ], 23 ],
23 componentProps: { 24 componentProps: {
24 mode: 'tags', 25 mode: 'tags',
25 open: false, 26 open: false,
  27 + placeholder: `请输入${OriginatorAttributesNameEnum.CLIENT_ATTRIBUTE_NAMES}`,
26 }, 28 },
27 }, 29 },
28 { 30 {
29 - field: NodeBindDataFieldEnum.SHARED_ATTRIBUTE_NAMES, 31 + field: OriginatorAttributesEnum.SHARED_ATTRIBUTE_NAMES,
30 component: 'Select', 32 component: 'Select',
31 - label: NodeBindDataFieldNameEnum.SHARED_ATTRIBUTE_NAMES, 33 + label: OriginatorAttributesNameEnum.SHARED_ATTRIBUTE_NAMES,
32 helpMessage: [ 34 helpMessage: [
33 `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`, 35 `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`,
34 ], 36 ],
35 componentProps: { 37 componentProps: {
36 mode: 'tags', 38 mode: 'tags',
37 open: false, 39 open: false,
  40 + placeholder: `请输入${OriginatorAttributesNameEnum.SHARED_ATTRIBUTE_NAMES}`,
38 }, 41 },
39 }, 42 },
40 { 43 {
41 - field: NodeBindDataFieldEnum.SERVER_ATTRIBUTE_NAMES, 44 + field: OriginatorAttributesEnum.SERVER_ATTRIBUTE_NAMES,
42 component: 'Select', 45 component: 'Select',
43 - label: NodeBindDataFieldNameEnum.SERVER_ATTRIBUTE_NAMES, 46 + label: OriginatorAttributesNameEnum.SERVER_ATTRIBUTE_NAMES,
44 helpMessage: [ 47 helpMessage: [
45 `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`, 48 `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`,
46 ], 49 ],
47 componentProps: { 50 componentProps: {
48 mode: 'tags', 51 mode: 'tags',
49 open: false, 52 open: false,
  53 + placeholder: `请输入${OriginatorAttributesNameEnum.SERVER_ATTRIBUTE_NAMES}`,
50 }, 54 },
51 }, 55 },
52 { 56 {
53 - field: NodeBindDataFieldEnum.LATEST_TS_KEY_NAMES, 57 + field: OriginatorAttributesEnum.LATEST_TS_KEY_NAMES,
54 component: 'Select', 58 component: 'Select',
55 - label: NodeBindDataFieldNameEnum.LATEST_TS_KEY_NAMES, 59 + label: OriginatorAttributesNameEnum.LATEST_TS_KEY_NAMES,
56 helpMessage: [ 60 helpMessage: [
57 `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`, 61 `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`,
58 ], 62 ],
59 componentProps: { 63 componentProps: {
60 mode: 'tags', 64 mode: 'tags',
61 open: false, 65 open: false,
  66 + placeholder: `请输入${OriginatorAttributesNameEnum.LATEST_TS_KEY_NAMES}`,
62 }, 67 },
63 }, 68 },
64 { 69 {
65 - field: NodeBindDataFieldEnum.GET_LATEST_VALUE_WITH_TS, 70 + field: OriginatorAttributesEnum.GET_LATEST_VALUE_WITH_TS,
66 component: 'Checkbox', 71 component: 'Checkbox',
67 - label: '',  
68 - // helpMessage: [  
69 - // 'If selected, latest telemetry values will be added to the outbound message metadata with timestamp, e.g: "temp": "{"ts":1574329385897, "value":42}"',  
70 - // ], 72 + label: OriginatorAttributesNameEnum.GET_LATEST_VALUE_WITH_TS,
71 renderComponentContent: () => ({ 73 renderComponentContent: () => ({
72 - default: () => NodeBindDataFieldNameEnum.GET_LATEST_VALUE_WITH_TS, 74 + default: () =>
  75 + 'If selected, latest telemetry values will be added to the outbound message metadata with timestamp, e.g: "temp": "{"ts":1574329385897, "value":42}"',
73 }), 76 }),
74 }, 77 },
75 ]; 78 ];
1 -import { NodeBindDataFieldEnum, NodeBindDataFieldNameEnum } from '../../../enum/node'; 1 +import { OriginatorFieldsEnum, OriginatorFieldsNameEnum } from '../../../enum/formField/enrichment';
2 import { FormSchema, useComponentRegister } from '/@/components/Form'; 2 import { FormSchema, useComponentRegister } from '/@/components/Form';
3 import { AttributeConfiguration } from '/@/views/rule/designer/src/components/AttributeConfiguration'; 3 import { AttributeConfiguration } from '/@/views/rule/designer/src/components/AttributeConfiguration';
4 4
@@ -6,10 +6,10 @@ useComponentRegister('AttributeConfiguration', AttributeConfiguration); @@ -6,10 +6,10 @@ useComponentRegister('AttributeConfiguration', AttributeConfiguration);
6 6
7 export const formSchemas: FormSchema[] = [ 7 export const formSchemas: FormSchema[] = [
8 { 8 {
9 - field: NodeBindDataFieldEnum.FIELDS_MAPPING, 9 + field: OriginatorFieldsEnum.FIELDS_MAPPING,
10 component: 'AttributeConfiguration', 10 component: 'AttributeConfiguration',
11 - label: NodeBindDataFieldNameEnum.FIELDS_MAPPING,  
12 - slot: NodeBindDataFieldEnum.FIELDS_MAPPING, 11 + label: OriginatorFieldsNameEnum.FIELDS_MAPPING,
  12 + slot: OriginatorFieldsEnum.FIELDS_MAPPING,
13 valueField: 'value', 13 valueField: 'value',
14 changeEvent: 'update:value', 14 changeEvent: 'update:value',
15 }, 15 },
@@ -6,155 +6,169 @@ import { @@ -6,155 +6,169 @@ import {
6 TimeIntervalUnitEnum, 6 TimeIntervalUnitEnum,
7 TimeIntervalUnitNameEnum, 7 TimeIntervalUnitNameEnum,
8 } from '../../../enum/form'; 8 } from '../../../enum/form';
9 -import { NodeBindDataFieldEnum, NodeBindDataFieldNameEnum } from '../../../enum/node'; 9 +import {
  10 + OriginatorTelemetryFieldsEnum,
  11 + OriginatorTelemetryFieldsNameEnum,
  12 +} from '../../../enum/formField/enrichment';
10 import { FormSchema } from '/@/components/Form'; 13 import { FormSchema } from '/@/components/Form';
11 14
12 export const formSchemas: FormSchema[] = [ 15 export const formSchemas: FormSchema[] = [
13 { 16 {
14 - field: NodeBindDataFieldEnum.LATEST_TS_KEY_NAMES, 17 + field: OriginatorTelemetryFieldsEnum.LATEST_TS_KEY_NAMES,
15 component: 'Select', 18 component: 'Select',
16 - label: NodeBindDataFieldNameEnum.LATEST_TS_KEY_NAMES, 19 + label: OriginatorTelemetryFieldsNameEnum.LATEST_TS_KEY_NAMES,
17 componentProps: { 20 componentProps: {
18 mode: 'tags', 21 mode: 'tags',
19 open: false, 22 open: false,
  23 + placeholder: `请输入${OriginatorTelemetryFieldsNameEnum.LATEST_TS_KEY_NAMES}`,
  24 + getPopupContainer: () => document.body,
20 }, 25 },
21 }, 26 },
22 { 27 {
23 - field: NodeBindDataFieldEnum.FETCH_MODE, 28 + field: OriginatorTelemetryFieldsEnum.FETCH_MODE,
24 component: 'Select', 29 component: 'Select',
25 - label: NodeBindDataFieldNameEnum.FETCH_MODE, 30 + label: OriginatorTelemetryFieldsNameEnum.FETCH_MODE,
26 required: true, 31 required: true,
27 componentProps: { 32 componentProps: {
28 options: Object.keys(FetchModeEnum).map((value) => ({ label: value, value })), 33 options: Object.keys(FetchModeEnum).map((value) => ({ label: value, value })),
  34 + placeholder: `请选择${OriginatorTelemetryFieldsNameEnum.FETCH_MODE}`,
  35 + getPopupContainer: () => document.body,
29 }, 36 },
30 }, 37 },
31 { 38 {
32 - field: NodeBindDataFieldEnum.AGGREGATION, 39 + field: OriginatorTelemetryFieldsEnum.AGGREGATION,
33 component: 'Select', 40 component: 'Select',
34 - label: NodeBindDataFieldNameEnum.AGGREGATION, 41 + label: OriginatorTelemetryFieldsNameEnum.AGGREGATION,
35 required: true, 42 required: true,
36 - show: ({ model }) => model[NodeBindDataFieldEnum.FETCH_MODE] === FetchModeEnum.ALL, 43 + show: ({ model }) => model[OriginatorTelemetryFieldsEnum.FETCH_MODE] === FetchModeEnum.ALL,
37 componentProps: { 44 componentProps: {
38 options: Object.keys(AggregationEnum).map((value) => ({ 45 options: Object.keys(AggregationEnum).map((value) => ({
39 label: AggregationNameEnum[value], 46 label: AggregationNameEnum[value],
40 value, 47 value,
41 })), 48 })),
  49 + placeholder: `请选择${OriginatorTelemetryFieldsNameEnum.AGGREGATION}`,
  50 + getPopupContainer: () => document.body,
42 }, 51 },
43 }, 52 },
44 { 53 {
45 - field: NodeBindDataFieldEnum.ORDER_BY,  
46 - component: 'Select',  
47 - label: NodeBindDataFieldNameEnum.ORDER_BY,  
48 - required: true,  
49 - show: ({ model }) => model[NodeBindDataFieldEnum.FETCH_MODE] === FetchModeEnum.ALL,  
50 - componentProps: {  
51 - options: Object.keys(OrderByEnum).map((value) => ({ label: value, value })),  
52 - },  
53 - },  
54 - {  
55 - field: NodeBindDataFieldEnum.ORDER_BY, 54 + field: OriginatorTelemetryFieldsEnum.ORDER_BY,
56 component: 'Select', 55 component: 'Select',
57 - label: NodeBindDataFieldNameEnum.ORDER_BY, 56 + label: OriginatorTelemetryFieldsNameEnum.ORDER_BY,
58 required: true, 57 required: true,
59 helpMessage: ['Select to choose telemetry sampling order.'], 58 helpMessage: ['Select to choose telemetry sampling order.'],
60 - show: ({ model }) => model[NodeBindDataFieldEnum.FETCH_MODE] === FetchModeEnum.ALL, 59 + show: ({ model }) => model[OriginatorTelemetryFieldsEnum.FETCH_MODE] === FetchModeEnum.ALL,
61 componentProps: { 60 componentProps: {
62 options: Object.keys(OrderByEnum).map((value) => ({ label: value, value })), 61 options: Object.keys(OrderByEnum).map((value) => ({ label: value, value })),
  62 + placeholder: `请选择${OriginatorTelemetryFieldsNameEnum.FETCH_MODE}`,
  63 + getPopupContainer: () => document.body,
63 }, 64 },
64 }, 65 },
65 { 66 {
66 - field: NodeBindDataFieldEnum.LIMIT, 67 + field: OriginatorTelemetryFieldsEnum.LIMIT,
67 component: 'InputNumber', 68 component: 'InputNumber',
68 - label: NodeBindDataFieldNameEnum.LIMIT, 69 + label: OriginatorTelemetryFieldsNameEnum.LIMIT,
69 required: true, 70 required: true,
70 helpMessage: [ 71 helpMessage: [
71 "Min limit value is 2, max - 1000. In case you want to fetch a single entry, select fetch mode 'FIRST' or 'LAST'.", 72 "Min limit value is 2, max - 1000. In case you want to fetch a single entry, select fetch mode 'FIRST' or 'LAST'.",
72 ], 73 ],
73 - show: ({ model }) => model[NodeBindDataFieldEnum.FETCH_MODE] === FetchModeEnum.ALL, 74 + show: ({ model }) => model[OriginatorTelemetryFieldsEnum.FETCH_MODE] === FetchModeEnum.ALL,
74 componentProps: { 75 componentProps: {
75 min: 2, 76 min: 2,
76 max: 1000, 77 max: 1000,
77 step: 1, 78 step: 1,
  79 + placeholder: `请输入${OriginatorTelemetryFieldsNameEnum.LIMIT}`,
78 }, 80 },
79 }, 81 },
80 { 82 {
81 - field: NodeBindDataFieldEnum.USE_METADATA_INTERVAL_PATTERNS, 83 + field: OriginatorTelemetryFieldsEnum.USE_METADATA_INTERVAL_PATTERNS,
82 component: 'Checkbox', 84 component: 'Checkbox',
83 label: '', 85 label: '',
84 renderComponentContent: () => ({ 86 renderComponentContent: () => ({
85 - default: () => NodeBindDataFieldNameEnum.USE_METADATA_INTERVAL_PATTERNS, 87 + default: () => OriginatorTelemetryFieldsNameEnum.USE_METADATA_INTERVAL_PATTERNS,
86 }), 88 }),
87 }, 89 },
88 { 90 {
89 - field: NodeBindDataFieldEnum.START_INTERVAL, 91 + field: OriginatorTelemetryFieldsEnum.START_INTERVAL,
90 component: 'InputNumber', 92 component: 'InputNumber',
91 - label: NodeBindDataFieldNameEnum.START_INTERVAL, 93 + label: OriginatorTelemetryFieldsNameEnum.START_INTERVAL,
92 colProps: { span: 12 }, 94 colProps: { span: 12 },
93 required: true, 95 required: true,
94 - show: ({ model }) => !model[NodeBindDataFieldEnum.USE_METADATA_INTERVAL_PATTERNS], 96 + show: ({ model }) => !model[OriginatorTelemetryFieldsEnum.USE_METADATA_INTERVAL_PATTERNS],
95 componentProps: { 97 componentProps: {
96 step: 1, 98 step: 1,
97 min: 0, 99 min: 0,
  100 + placeholder: `请输入${OriginatorTelemetryFieldsNameEnum.START_INTERVAL}`,
98 }, 101 },
99 }, 102 },
100 { 103 {
101 - field: NodeBindDataFieldEnum.START_INTERVAL_TIME_UNIT, 104 + field: OriginatorTelemetryFieldsEnum.START_INTERVAL_TIME_UNIT,
102 component: 'Select', 105 component: 'Select',
103 - label: NodeBindDataFieldNameEnum.START_INTERVAL_TIME_UNIT, 106 + label: OriginatorTelemetryFieldsNameEnum.START_INTERVAL_TIME_UNIT,
104 colProps: { span: 12 }, 107 colProps: { span: 12 },
105 required: true, 108 required: true,
106 - show: ({ model }) => !model[NodeBindDataFieldEnum.USE_METADATA_INTERVAL_PATTERNS], 109 + show: ({ model }) => !model[OriginatorTelemetryFieldsEnum.USE_METADATA_INTERVAL_PATTERNS],
107 componentProps: { 110 componentProps: {
108 options: Object.keys(TimeIntervalUnitEnum).map((value) => ({ 111 options: Object.keys(TimeIntervalUnitEnum).map((value) => ({
109 label: TimeIntervalUnitNameEnum[value], 112 label: TimeIntervalUnitNameEnum[value],
110 value, 113 value,
111 })), 114 })),
  115 + placeholder: `请选择${OriginatorTelemetryFieldsNameEnum.START_INTERVAL_TIME_UNIT}`,
  116 + getPopupContainer: () => document.body,
112 }, 117 },
113 }, 118 },
114 { 119 {
115 - field: NodeBindDataFieldEnum.END_INTERVAL, 120 + field: OriginatorTelemetryFieldsEnum.END_INTERVAL,
116 component: 'InputNumber', 121 component: 'InputNumber',
117 - label: NodeBindDataFieldNameEnum.END_INTERVAL, 122 + label: OriginatorTelemetryFieldsNameEnum.END_INTERVAL,
118 colProps: { span: 12 }, 123 colProps: { span: 12 },
119 required: true, 124 required: true,
120 - show: ({ model }) => !model[NodeBindDataFieldEnum.USE_METADATA_INTERVAL_PATTERNS], 125 + show: ({ model }) => !model[OriginatorTelemetryFieldsEnum.USE_METADATA_INTERVAL_PATTERNS],
121 componentProps: { 126 componentProps: {
122 step: 1, 127 step: 1,
123 min: 0, 128 min: 0,
  129 + placeholder: `请输入${OriginatorTelemetryFieldsNameEnum.END_INTERVAL}`,
124 }, 130 },
125 }, 131 },
126 { 132 {
127 - field: NodeBindDataFieldEnum.END_INTERVAL_TIME_UNIT, 133 + field: OriginatorTelemetryFieldsEnum.END_INTERVAL_TIME_UNIT,
128 component: 'Select', 134 component: 'Select',
129 - label: NodeBindDataFieldNameEnum.END_INTERVAL_TIME_UNIT, 135 + label: OriginatorTelemetryFieldsNameEnum.END_INTERVAL_TIME_UNIT,
130 colProps: { span: 12 }, 136 colProps: { span: 12 },
131 required: true, 137 required: true,
132 - show: ({ model }) => !model[NodeBindDataFieldEnum.USE_METADATA_INTERVAL_PATTERNS], 138 + show: ({ model }) => !model[OriginatorTelemetryFieldsEnum.USE_METADATA_INTERVAL_PATTERNS],
133 componentProps: { 139 componentProps: {
134 options: Object.keys(TimeIntervalUnitEnum).map((value) => ({ 140 options: Object.keys(TimeIntervalUnitEnum).map((value) => ({
135 label: TimeIntervalUnitNameEnum[value], 141 label: TimeIntervalUnitNameEnum[value],
136 value, 142 value,
137 })), 143 })),
  144 + placeholder: `请选择${OriginatorTelemetryFieldsNameEnum.END_INTERVAL_TIME_UNIT}`,
  145 + getPopupContainer: () => document.body,
138 }, 146 },
139 }, 147 },
140 { 148 {
141 - field: NodeBindDataFieldEnum.START_INTERVAL_PATTERN, 149 + field: OriginatorTelemetryFieldsEnum.START_INTERVAL_PATTERN,
142 component: 'Input', 150 component: 'Input',
143 - label: NodeBindDataFieldNameEnum.START_INTERVAL_PATTERN, 151 + label: OriginatorTelemetryFieldsNameEnum.START_INTERVAL_PATTERN,
144 required: true, 152 required: true,
145 helpMessage: [ 153 helpMessage: [
146 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body', 154 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
147 ], 155 ],
148 - show: ({ model }) => model[NodeBindDataFieldEnum.USE_METADATA_INTERVAL_PATTERNS], 156 + ifShow: ({ model }) => model[OriginatorTelemetryFieldsEnum.USE_METADATA_INTERVAL_PATTERNS],
  157 + componentProps: {
  158 + placeholder: `请输入${OriginatorTelemetryFieldsNameEnum.START_INTERVAL_PATTERN}`,
  159 + },
149 }, 160 },
150 { 161 {
151 - field: NodeBindDataFieldEnum.END_INTERVAL_PATTERN, 162 + field: OriginatorTelemetryFieldsEnum.END_INTERVAL_PATTERN,
152 component: 'Input', 163 component: 'Input',
153 - label: NodeBindDataFieldNameEnum.END_INTERVAL_PATTERN, 164 + label: OriginatorTelemetryFieldsNameEnum.END_INTERVAL_PATTERN,
154 required: true, 165 required: true,
155 helpMessage: [ 166 helpMessage: [
156 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body', 167 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
157 ], 168 ],
158 - show: ({ model }) => model[NodeBindDataFieldEnum.USE_METADATA_INTERVAL_PATTERNS], 169 + ifShow: ({ model }) => model[OriginatorTelemetryFieldsEnum.USE_METADATA_INTERVAL_PATTERNS],
  170 + componentProps: {
  171 + placeholder: `请输入${OriginatorTelemetryFieldsNameEnum.END_INTERVAL_PATTERN}`,
  172 + },
159 }, 173 },
160 ]; 174 ];
1 -import { NodeBindDataFieldEnum, NodeBindDataFieldNameEnum } from '../../../enum/node';  
2 import { AttributeConfiguration } from '/@/views/rule/designer/src/components/AttributeConfiguration'; 1 import { AttributeConfiguration } from '/@/views/rule/designer/src/components/AttributeConfiguration';
3 import { FormSchema, useComponentRegister } from '/@/components/Form'; 2 import { FormSchema, useComponentRegister } from '/@/components/Form';
4 import { RelationsQuery } from '/@/views/rule/designer/src/components/RelationsQuery'; 3 import { RelationsQuery } from '/@/views/rule/designer/src/components/RelationsQuery';
  4 +import {
  5 + RelatedAttributesFieldsEnum,
  6 + RelatedAttributesFieldsNameEnum,
  7 +} from '../../../enum/formField/enrichment';
5 8
6 useComponentRegister('RelationsQuery', RelationsQuery); 9 useComponentRegister('RelationsQuery', RelationsQuery);
7 useComponentRegister('AttributeConfiguration', AttributeConfiguration); 10 useComponentRegister('AttributeConfiguration', AttributeConfiguration);
8 11
9 export const formSchemas: FormSchema[] = [ 12 export const formSchemas: FormSchema[] = [
10 { 13 {
11 - field: NodeBindDataFieldEnum.RELATIONS_QUERY, 14 + field: RelatedAttributesFieldsEnum.RELATIONS_QUERY,
12 component: 'RelationsQuery', 15 component: 'RelationsQuery',
13 - label: NodeBindDataFieldNameEnum.RELATIONS_QUERY, 16 + label: RelatedAttributesFieldsNameEnum.RELATIONS_QUERY,
14 changeEvent: 'update:value', 17 changeEvent: 'update:value',
15 valueField: 'value', 18 valueField: 'value',
16 - slot: NodeBindDataFieldEnum.RELATIONS_QUERY, 19 + slot: RelatedAttributesFieldsEnum.RELATIONS_QUERY,
17 }, 20 },
18 { 21 {
19 - field: NodeBindDataFieldEnum.TELEMETRY, 22 + field: RelatedAttributesFieldsEnum.TELEMETRY,
20 component: 'Checkbox', 23 component: 'Checkbox',
21 label: '', 24 label: '',
22 renderComponentContent: () => ({ 25 renderComponentContent: () => ({
23 - default: () => NodeBindDataFieldNameEnum.TELEMETRY, 26 + default: () => RelatedAttributesFieldsNameEnum.TELEMETRY,
24 }), 27 }),
25 }, 28 },
26 { 29 {
27 - field: NodeBindDataFieldEnum.ATTR_MAPING, 30 + field: RelatedAttributesFieldsEnum.ATTR_MAPPING,
28 component: 'AttributeConfiguration', 31 component: 'AttributeConfiguration',
29 label: '', 32 label: '',
30 - slot: NodeBindDataFieldEnum.ATTR_MAPING, 33 + slot: RelatedAttributesFieldsEnum.ATTR_MAPPING,
31 }, 34 },
32 ]; 35 ];
@@ -5,8 +5,8 @@ @@ -5,8 +5,8 @@
5 import { NodeData } from '../../../types/node'; 5 import { NodeData } from '../../../types/node';
6 import { RelationsQuery } from '/@/views/rule/designer/src/components/RelationsQuery'; 6 import { RelationsQuery } from '/@/views/rule/designer/src/components/RelationsQuery';
7 import { ref, unref } from 'vue'; 7 import { ref, unref } from 'vue';
8 - import { NodeBindDataFieldEnum } from '../../../enum/node';  
9 import { AttributeConfiguration } from '/@/views/rule/designer/src/components/AttributeConfiguration'; 8 import { AttributeConfiguration } from '/@/views/rule/designer/src/components/AttributeConfiguration';
  9 + import { RelatedAttributesFieldsEnum } from '../../../enum/formField/enrichment';
10 10
11 defineProps<{ 11 defineProps<{
12 config: NodeData; 12 config: NodeData;
@@ -30,8 +30,8 @@ @@ -30,8 +30,8 @@
30 const attrMapping = unref(attributeControlElRef)?.getFieldsValue(); 30 const attrMapping = unref(attributeControlElRef)?.getFieldsValue();
31 return { 31 return {
32 ...value, 32 ...value,
33 - [NodeBindDataFieldEnum.RELATIONS_QUERY]: queryValue,  
34 - [NodeBindDataFieldEnum.ATTR_MAPING]: attrMapping, 33 + [RelatedAttributesFieldsEnum.RELATIONS_QUERY]: queryValue,
  34 + [RelatedAttributesFieldsEnum.ATTR_MAPPING]: attrMapping,
35 }; 35 };
36 }; 36 };
37 37
@@ -39,9 +39,9 @@ @@ -39,9 +39,9 @@
39 resetFields(); 39 resetFields();
40 setFieldsValue(value); 40 setFieldsValue(value);
41 unref(relationsQueryElRef)?.setFieldsValue( 41 unref(relationsQueryElRef)?.setFieldsValue(
42 - value?.[NodeBindDataFieldEnum.RELATIONS_QUERY] as Recordable 42 + value?.[RelatedAttributesFieldsEnum.RELATIONS_QUERY] as Recordable
43 ); 43 );
44 - unref(attributeControlElRef)?.setFieldsValue(value?.[NodeBindDataFieldEnum.ATTR_MAPING]); 44 + unref(attributeControlElRef)?.setFieldsValue(value?.[RelatedAttributesFieldsEnum.ATTR_MAPPING]);
45 }; 45 };
46 46
47 defineExpose({ 47 defineExpose({
@@ -59,7 +59,9 @@ @@ -59,7 +59,9 @@
59 <AttributeConfiguration 59 <AttributeConfiguration
60 v-model:value="model[field]" 60 v-model:value="model[field]"
61 ref="attributeControlElRef" 61 ref="attributeControlElRef"
62 - :keyLabel="`Source ${model[NodeBindDataFieldEnum.TELEMETRY] ? 'telemetry' : 'attribute'}`" 62 + :keyLabel="`Source ${
  63 + model[RelatedAttributesFieldsEnum.TELEMETRY] ? 'telemetry' : 'attribute'
  64 + }`"
63 valueLabel="Target attribute" 65 valueLabel="Target attribute"
64 > 66 >
65 <template #afterForm> 67 <template #afterForm>
@@ -4,7 +4,11 @@ import { @@ -4,7 +4,11 @@ import {
4 RelationTypeEnum, 4 RelationTypeEnum,
5 RelationTypeNameEnum, 5 RelationTypeNameEnum,
6 } from '../../../enum/form'; 6 } from '../../../enum/form';
7 -import { NodeBindDataFieldEnum, NodeBindDataFieldNameEnum } from '../../../enum/node'; 7 +import {
  8 + RelatedDeviceAttributeFieldsEnum,
  9 + RelatedDeviceAttributeFieldsNameEnum,
  10 +} from '../../../enum/formField/enrichment';
  11 +
8 import { getDeviceTypes } from '/@/api/ruleChainDesigner'; 12 import { getDeviceTypes } from '/@/api/ruleChainDesigner';
9 import { FormSchema } from '/@/components/Form'; 13 import { FormSchema } from '/@/components/Form';
10 14
@@ -28,17 +32,17 @@ export interface DeviceRelationsQuery { @@ -28,17 +32,17 @@ export interface DeviceRelationsQuery {
28 32
29 export const formSchemas: FormSchema[] = [ 33 export const formSchemas: FormSchema[] = [
30 { 34 {
31 - field: NodeBindDataFieldEnum.FETCH_LAST_LEVEL_ONLY, 35 + field: RelatedDeviceAttributeFieldsEnum.FETCH_LAST_LEVEL_ONLY,
32 component: 'Checkbox', 36 component: 'Checkbox',
33 label: '', 37 label: '',
34 renderComponentContent: () => ({ 38 renderComponentContent: () => ({
35 - default: () => NodeBindDataFieldNameEnum.FETCH_LAST_LEVEL_ONLY, 39 + default: () => RelatedDeviceAttributeFieldsNameEnum.FETCH_LAST_LEVEL_ONLY,
36 }), 40 }),
37 }, 41 },
38 { 42 {
39 - field: NodeBindDataFieldEnum.DIRECTION, 43 + field: RelatedDeviceAttributeFieldsEnum.DIRECTION,
40 component: 'Select', 44 component: 'Select',
41 - label: NodeBindDataFieldNameEnum.DIRECTION, 45 + label: RelatedDeviceAttributeFieldsNameEnum.DIRECTION,
42 required: true, 46 required: true,
43 colProps: { span: 12 }, 47 colProps: { span: 12 },
44 componentProps: { 48 componentProps: {
@@ -46,99 +50,100 @@ export const formSchemas: FormSchema[] = [ @@ -46,99 +50,100 @@ export const formSchemas: FormSchema[] = [
46 label: DirectionNameEnum[value], 50 label: DirectionNameEnum[value],
47 value, 51 value,
48 })), 52 })),
49 - placeholder: `请选择${NodeBindDataFieldNameEnum.DIRECTION}`, 53 + placeholder: `请选择${RelatedDeviceAttributeFieldsNameEnum.DIRECTION}`,
50 getPopupContainer: () => document.body, 54 getPopupContainer: () => document.body,
51 }, 55 },
52 }, 56 },
53 { 57 {
54 - field: NodeBindDataFieldEnum.MAX_LEVEL, 58 + field: RelatedDeviceAttributeFieldsEnum.MAX_LEVEL,
55 component: 'InputNumber', 59 component: 'InputNumber',
56 - label: NodeBindDataFieldNameEnum.MAX_LEVEL, 60 + label: RelatedDeviceAttributeFieldsNameEnum.MAX_LEVEL,
57 colProps: { span: 12 }, 61 colProps: { span: 12 },
58 componentProps: { 62 componentProps: {
59 min: 1, 63 min: 1,
  64 + placeholder: `请输入${RelatedDeviceAttributeFieldsNameEnum.MAX_LEVEL}`,
60 }, 65 },
61 }, 66 },
62 { 67 {
63 - field: NodeBindDataFieldEnum.RELATION_TYPE, 68 + field: RelatedDeviceAttributeFieldsEnum.RELATION_TYPE,
64 component: 'Select', 69 component: 'Select',
65 - label: NodeBindDataFieldNameEnum.RELATION_TYPE, 70 + label: RelatedDeviceAttributeFieldsNameEnum.RELATION_TYPE,
66 componentProps: { 71 componentProps: {
67 options: Object.keys(RelationTypeEnum).map((value) => ({ 72 options: Object.keys(RelationTypeEnum).map((value) => ({
68 label: RelationTypeNameEnum[value], 73 label: RelationTypeNameEnum[value],
69 value, 74 value,
70 })), 75 })),
71 - placeholder: `请选择${NodeBindDataFieldNameEnum.RELATION_TYPE}`, 76 + placeholder: `请选择${RelatedDeviceAttributeFieldsNameEnum.RELATION_TYPE}`,
72 getPopupContainer: () => document.body, 77 getPopupContainer: () => document.body,
73 }, 78 },
74 }, 79 },
75 { 80 {
76 - field: NodeBindDataFieldEnum.DEVICE_TYPES, 81 + field: RelatedDeviceAttributeFieldsEnum.DEVICE_TYPES,
77 component: 'ApiSelect', 82 component: 'ApiSelect',
78 - label: NodeBindDataFieldNameEnum.DEVICE_TYPES, 83 + label: RelatedDeviceAttributeFieldsNameEnum.DEVICE_TYPES,
79 componentProps: { 84 componentProps: {
80 mode: 'multiple', 85 mode: 'multiple',
81 api: getDeviceTypes, 86 api: getDeviceTypes,
82 labelField: 'type', 87 labelField: 'type',
83 valueField: 'type', 88 valueField: 'type',
84 getPopupContainer: () => document.body, 89 getPopupContainer: () => document.body,
85 - placeholder: `请选择${NodeBindDataFieldNameEnum.DEVICE_TYPES}`, 90 + placeholder: `请选择${RelatedDeviceAttributeFieldsNameEnum.DEVICE_TYPES}`,
86 }, 91 },
87 }, 92 },
88 { 93 {
89 - field: NodeBindDataFieldEnum.TELL_FAILURE_IF_ABSENT, 94 + field: RelatedDeviceAttributeFieldsEnum.TELL_FAILURE_IF_ABSENT,
90 component: 'Checkbox', 95 component: 'Checkbox',
91 label: '', 96 label: '',
92 renderComponentContent: () => ({ 97 renderComponentContent: () => ({
93 - default: () => NodeBindDataFieldNameEnum.TELL_FAILURE_IF_ABSENT, 98 + default: () => RelatedDeviceAttributeFieldsNameEnum.TELL_FAILURE_IF_ABSENT,
94 }), 99 }),
95 }, 100 },
96 { 101 {
97 - field: NodeBindDataFieldEnum.CLIENT_ATTRIBUTE_NAMES, 102 + field: RelatedDeviceAttributeFieldsEnum.CLIENT_ATTRIBUTE_NAMES,
98 component: 'Select', 103 component: 'Select',
99 - label: NodeBindDataFieldNameEnum.CLIENT_ATTRIBUTE_NAMES, 104 + label: RelatedDeviceAttributeFieldsNameEnum.CLIENT_ATTRIBUTE_NAMES,
100 componentProps: { 105 componentProps: {
101 open: false, 106 open: false,
102 mode: 'tags', 107 mode: 'tags',
103 - placeholder: NodeBindDataFieldNameEnum.CLIENT_ATTRIBUTE_NAMES, 108 + placeholder: RelatedDeviceAttributeFieldsNameEnum.CLIENT_ATTRIBUTE_NAMES,
104 }, 109 },
105 }, 110 },
106 { 111 {
107 - field: NodeBindDataFieldEnum.SHARED_ATTRIBUTE_NAMES, 112 + field: RelatedDeviceAttributeFieldsEnum.SHARED_ATTRIBUTE_NAMES,
108 component: 'Select', 113 component: 'Select',
109 - label: NodeBindDataFieldNameEnum.SHARED_ATTRIBUTE_NAMES, 114 + label: RelatedDeviceAttributeFieldsNameEnum.SHARED_ATTRIBUTE_NAMES,
110 componentProps: { 115 componentProps: {
111 open: false, 116 open: false,
112 mode: 'tags', 117 mode: 'tags',
113 - placeholder: NodeBindDataFieldNameEnum.SHARED_ATTRIBUTE_NAMES, 118 + placeholder: RelatedDeviceAttributeFieldsNameEnum.SHARED_ATTRIBUTE_NAMES,
114 }, 119 },
115 }, 120 },
116 { 121 {
117 - field: NodeBindDataFieldEnum.SERVER_ATTRIBUTE_NAMES, 122 + field: RelatedDeviceAttributeFieldsEnum.SERVER_ATTRIBUTE_NAMES,
118 component: 'Select', 123 component: 'Select',
119 - label: NodeBindDataFieldNameEnum.SERVER_ATTRIBUTE_NAMES, 124 + label: RelatedDeviceAttributeFieldsNameEnum.SERVER_ATTRIBUTE_NAMES,
120 componentProps: { 125 componentProps: {
121 open: false, 126 open: false,
122 mode: 'tags', 127 mode: 'tags',
123 - placeholder: NodeBindDataFieldNameEnum.SERVER_ATTRIBUTE_NAMES, 128 + placeholder: RelatedDeviceAttributeFieldsNameEnum.SERVER_ATTRIBUTE_NAMES,
124 }, 129 },
125 }, 130 },
126 { 131 {
127 - field: NodeBindDataFieldEnum.LATEST_TS_KEY_NAMES, 132 + field: RelatedDeviceAttributeFieldsEnum.LATEST_TS_KEY_NAMES,
128 component: 'Select', 133 component: 'Select',
129 - label: NodeBindDataFieldNameEnum.LATEST_TS_KEY_NAMES, 134 + label: RelatedDeviceAttributeFieldsNameEnum.LATEST_TS_KEY_NAMES,
130 componentProps: { 135 componentProps: {
131 open: false, 136 open: false,
132 mode: 'tags', 137 mode: 'tags',
133 - placeholder: NodeBindDataFieldNameEnum.LATEST_TS_KEY_NAMES, 138 + placeholder: RelatedDeviceAttributeFieldsNameEnum.LATEST_TS_KEY_NAMES,
134 }, 139 },
135 }, 140 },
136 { 141 {
137 - field: NodeBindDataFieldEnum.GET_LATEST_VALUE_WITH_TS, 142 + field: RelatedDeviceAttributeFieldsEnum.GET_LATEST_VALUE_WITH_TS,
138 component: 'Checkbox', 143 component: 'Checkbox',
139 label: '', 144 label: '',
140 renderComponentContent: () => ({ 145 renderComponentContent: () => ({
141 - default: () => NodeBindDataFieldNameEnum.GET_LATEST_VALUE_WITH_TS, 146 + default: () => RelatedDeviceAttributeFieldsNameEnum.GET_LATEST_VALUE_WITH_TS,
142 }), 147 }),
143 }, 148 },
144 ]; 149 ];
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 import { BasicForm, useForm } from '/@/components/Form'; 3 import { BasicForm, useForm } from '/@/components/Form';
4 import { DeviceRelationsQuery, formSchemas, ValueType } from './create.config'; 4 import { DeviceRelationsQuery, formSchemas, ValueType } from './create.config';
5 import { NodeData } from '../../../types/node'; 5 import { NodeData } from '../../../types/node';
6 - import { NodeBindDataFieldEnum } from '../../../enum/node'; 6 + import { RelatedDeviceAttributeFieldsEnum } from '../../../enum/formField/enrichment';
7 7
8 defineProps<{ 8 defineProps<{
9 config: NodeData; 9 config: NodeData;
@@ -18,32 +18,40 @@ @@ -18,32 +18,40 @@
18 await validate(); 18 await validate();
19 const value = getFieldsValue() || {}; 19 const value = getFieldsValue() || {};
20 return { 20 return {
21 - [NodeBindDataFieldEnum.DEVICE_RELATIONS_QUERY]: {  
22 - [NodeBindDataFieldEnum.FETCH_LAST_LEVEL_ONLY]:  
23 - value[NodeBindDataFieldEnum.FETCH_LAST_LEVEL_ONLY],  
24 - [NodeBindDataFieldEnum.DEVICE_TYPES]: value[NodeBindDataFieldEnum.DEVICE_TYPES],  
25 - [NodeBindDataFieldEnum.DIRECTION]: value[NodeBindDataFieldEnum.DIRECTION],  
26 - [NodeBindDataFieldEnum.MAX_LEVEL]: value[NodeBindDataFieldEnum.MAX_LEVEL],  
27 - [NodeBindDataFieldEnum.RELATION_TYPE]: value[NodeBindDataFieldEnum.RELATION_TYPE], 21 + [RelatedDeviceAttributeFieldsEnum.DEVICE_RELATIONS_QUERY]: {
  22 + [RelatedDeviceAttributeFieldsEnum.FETCH_LAST_LEVEL_ONLY]:
  23 + value[RelatedDeviceAttributeFieldsEnum.FETCH_LAST_LEVEL_ONLY],
  24 + [RelatedDeviceAttributeFieldsEnum.DEVICE_TYPES]:
  25 + value[RelatedDeviceAttributeFieldsEnum.DEVICE_TYPES],
  26 + [RelatedDeviceAttributeFieldsEnum.DIRECTION]:
  27 + value[RelatedDeviceAttributeFieldsEnum.DIRECTION],
  28 + [RelatedDeviceAttributeFieldsEnum.MAX_LEVEL]:
  29 + value[RelatedDeviceAttributeFieldsEnum.MAX_LEVEL],
  30 + [RelatedDeviceAttributeFieldsEnum.RELATION_TYPE]:
  31 + value[RelatedDeviceAttributeFieldsEnum.RELATION_TYPE],
28 } as DeviceRelationsQuery, 32 } as DeviceRelationsQuery,
29 - [NodeBindDataFieldEnum.CLIENT_ATTRIBUTE_NAMES]:  
30 - value[NodeBindDataFieldEnum.CLIENT_ATTRIBUTE_NAMES],  
31 - [NodeBindDataFieldEnum.GET_LATEST_VALUE_WITH_TS]:  
32 - value[NodeBindDataFieldEnum.GET_LATEST_VALUE_WITH_TS],  
33 - [NodeBindDataFieldEnum.LATEST_TS_KEY_NAMES]: value[NodeBindDataFieldEnum.LATEST_TS_KEY_NAMES],  
34 - [NodeBindDataFieldEnum.SERVER_ATTRIBUTE_NAMES]:  
35 - value[NodeBindDataFieldEnum.SERVER_ATTRIBUTE_NAMES],  
36 - [NodeBindDataFieldEnum.SHARED_ATTRIBUTE_NAMES]:  
37 - value[NodeBindDataFieldEnum.SHARED_ATTRIBUTE_NAMES],  
38 - [NodeBindDataFieldEnum.TELL_FAILURE_IF_ABSENT]:  
39 - value[NodeBindDataFieldEnum.TELL_FAILURE_IF_ABSENT], 33 + [RelatedDeviceAttributeFieldsEnum.CLIENT_ATTRIBUTE_NAMES]:
  34 + value[RelatedDeviceAttributeFieldsEnum.CLIENT_ATTRIBUTE_NAMES],
  35 + [RelatedDeviceAttributeFieldsEnum.GET_LATEST_VALUE_WITH_TS]:
  36 + value[RelatedDeviceAttributeFieldsEnum.GET_LATEST_VALUE_WITH_TS],
  37 + [RelatedDeviceAttributeFieldsEnum.LATEST_TS_KEY_NAMES]:
  38 + value[RelatedDeviceAttributeFieldsEnum.LATEST_TS_KEY_NAMES],
  39 + [RelatedDeviceAttributeFieldsEnum.SERVER_ATTRIBUTE_NAMES]:
  40 + value[RelatedDeviceAttributeFieldsEnum.SERVER_ATTRIBUTE_NAMES],
  41 + [RelatedDeviceAttributeFieldsEnum.SHARED_ATTRIBUTE_NAMES]:
  42 + value[RelatedDeviceAttributeFieldsEnum.SHARED_ATTRIBUTE_NAMES],
  43 + [RelatedDeviceAttributeFieldsEnum.TELL_FAILURE_IF_ABSENT]:
  44 + value[RelatedDeviceAttributeFieldsEnum.TELL_FAILURE_IF_ABSENT],
40 } as ValueType; 45 } as ValueType;
41 }; 46 };
42 47
43 const setValue: CreateModalDefineExposeType['setFieldsValue'] = (value) => { 48 const setValue: CreateModalDefineExposeType['setFieldsValue'] = (value) => {
44 resetFields(); 49 resetFields();
45 console.log(value); 50 console.log(value);
46 - setFieldsValue({ ...value, ...(value?.[NodeBindDataFieldEnum.DEVICE_RELATIONS_QUERY] || {}) }); 51 + setFieldsValue({
  52 + ...value,
  53 + ...(value?.[RelatedDeviceAttributeFieldsEnum.DEVICE_RELATIONS_QUERY] || {}),
  54 + });
47 }; 55 };
48 56
49 defineExpose({ 57 defineExpose({
1 -import { NodeBindDataFieldEnum, NodeBindDataFieldNameEnum } from '../../../enum/node'; 1 +import {
  2 + TenantAttributesFieldsEnum,
  3 + TenantAttributesFieldsNameEnum,
  4 +} from '../../../enum/formField/enrichment';
2 import { FormSchema, useComponentRegister } from '/@/components/Form'; 5 import { FormSchema, useComponentRegister } from '/@/components/Form';
3 import { AttributeConfiguration } from '/@/views/rule/designer/src/components/AttributeConfiguration'; 6 import { AttributeConfiguration } from '/@/views/rule/designer/src/components/AttributeConfiguration';
4 7
@@ -6,20 +9,20 @@ useComponentRegister('AttributeConfiguration', AttributeConfiguration); @@ -6,20 +9,20 @@ useComponentRegister('AttributeConfiguration', AttributeConfiguration);
6 9
7 export const formSchemas: FormSchema[] = [ 10 export const formSchemas: FormSchema[] = [
8 { 11 {
9 - field: NodeBindDataFieldEnum.TELEMETRY, 12 + field: TenantAttributesFieldsEnum.TELEMETRY,
10 component: 'Checkbox', 13 component: 'Checkbox',
11 label: '', 14 label: '',
12 renderComponentContent: () => { 15 renderComponentContent: () => {
13 return { 16 return {
14 - default: () => NodeBindDataFieldNameEnum.TELEMETRY, 17 + default: () => TenantAttributesFieldsNameEnum.TELEMETRY,
15 }; 18 };
16 }, 19 },
17 }, 20 },
18 { 21 {
19 - field: NodeBindDataFieldEnum.ATTR_MAPING, 22 + field: TenantAttributesFieldsEnum.ATTR_MAPING,
20 component: 'AttributeConfiguration', 23 component: 'AttributeConfiguration',
21 - label: NodeBindDataFieldNameEnum.ATTR_MAPING,  
22 - slot: NodeBindDataFieldEnum.ATTR_MAPING, 24 + label: TenantAttributesFieldsNameEnum.ATTR_MAPING,
  25 + slot: TenantAttributesFieldsEnum.ATTR_MAPING,
23 valueField: 'value', 26 valueField: 'value',
24 changeEvent: 'update:value', 27 changeEvent: 'update:value',
25 }, 28 },
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 import { credentialsTypeOptions, FileItemType, formSchemas } from './config'; 4 import { credentialsTypeOptions, FileItemType, formSchemas } from './config';
5 import { ref, watch } from 'vue'; 5 import { ref, watch } from 'vue';
6 import { buildUUID } from '/@/utils/uuid'; 6 import { buildUUID } from '/@/utils/uuid';
7 - import { CredentialsTypeEnum, CredentialsTypeNameEnum } from '../../../../enum/form'; 7 + import { CredentialsTypeEnum, CredentialsTypeNameEnum } from './config';
8 import { AzureIotHubFieldsEnum } from '../../../../enum/formField/external'; 8 import { AzureIotHubFieldsEnum } from '../../../../enum/formField/external';
9 9
10 const props = withDefaults( 10 const props = withDefaults(
@@ -59,7 +59,7 @@ @@ -59,7 +59,7 @@
59 value, 59 value,
60 AzureIotHubFieldsEnum.CA_CERT_FILE_NAME 60 AzureIotHubFieldsEnum.CA_CERT_FILE_NAME
61 ), 61 ),
62 - [AzureIotHubFieldsEnum.CA_CERT]: getFileValue(value?.[AzureIotHubFieldsEnum.CERT]), 62 + [AzureIotHubFieldsEnum.CERT]: getFileValue(value?.[AzureIotHubFieldsEnum.CERT]),
63 [AzureIotHubFieldsEnum.CERT_FILE_NAME]: getValueByKey( 63 [AzureIotHubFieldsEnum.CERT_FILE_NAME]: getValueByKey(
64 value, 64 value,
65 AzureIotHubFieldsEnum.CERT_FILE_NAME 65 AzureIotHubFieldsEnum.CERT_FILE_NAME
1 import { GcpPubsubFieldsEnum, GcpPubsubFieldsNameEnum } from '../../../enum/formField/external'; 1 import { GcpPubsubFieldsEnum, GcpPubsubFieldsNameEnum } from '../../../enum/formField/external';
2 import { AttributeConfiguration } from '/@/views/rule/designer/src/components/AttributeConfiguration'; 2 import { AttributeConfiguration } from '/@/views/rule/designer/src/components/AttributeConfiguration';
3 -import { FileItemType, getFileData } from '../../../src/components/CredentialsCard/config'; 3 +import { FileItemType, getFileData } from '../AzureIotHub/CredentialsCard/config';
4 import { FormSchema, useComponentRegister } from '/@/components/Form'; 4 import { FormSchema, useComponentRegister } from '/@/components/Form';
5 5
6 useComponentRegister('AttributeConfiguration', AttributeConfiguration); 6 useComponentRegister('AttributeConfiguration', AttributeConfiguration);
@@ -27,6 +27,7 @@ export const formSchemas: FormSchema[] = [ @@ -27,6 +27,7 @@ export const formSchemas: FormSchema[] = [
27 allowClear: true, 27 allowClear: true,
28 options: Object.keys(MessagePropertiesEnum).map((value) => ({ label: value, value })), 28 options: Object.keys(MessagePropertiesEnum).map((value) => ({ label: value, value })),
29 placeholder: `请选择${RabbitmqFieldsNameEnum.ROUTING_KEY_PATTERN}`, 29 placeholder: `请选择${RabbitmqFieldsNameEnum.ROUTING_KEY_PATTERN}`,
  30 + getPopupContainer: () => document.body,
30 }, 31 },
31 }, 32 },
32 { 33 {
@@ -80,8 +80,7 @@ export const formSchemas: FormSchema[] = [ @@ -80,8 +80,7 @@ export const formSchemas: FormSchema[] = [
80 component: 'Select', 80 component: 'Select',
81 required: true, 81 required: true,
82 ifShow: ({ model }) => 82 ifShow: ({ model }) =>
83 - model[SendEmailFieldsEnum.TLS_VERSION] &&  
84 - !model[SendEmailFieldsEnum.USE_SYSTEM_SMTP_SETTINGS], 83 + model[SendEmailFieldsEnum.ENABLE_TLS] && !model[SendEmailFieldsEnum.USE_SYSTEM_SMTP_SETTINGS],
85 componentProps: { 84 componentProps: {
86 options: Object.keys(TSLVersionEnum).map((value) => ({ 85 options: Object.keys(TSLVersionEnum).map((value) => ({
87 label: TSLVersionNameEnum[value], 86 label: TSLVersionNameEnum[value],
@@ -107,7 +106,8 @@ export const formSchemas: FormSchema[] = [ @@ -107,7 +106,8 @@ export const formSchemas: FormSchema[] = [
107 required: true, 106 required: true,
108 colProps: { span: 12 }, 107 colProps: { span: 12 },
109 ifShow: ({ model }) => 108 ifShow: ({ model }) =>
110 - !model[SendEmailFieldsEnum.USE_SYSTEM_SMTP_SETTINGS] && model[SendEmailFieldsEnum.PROXY_HOST], 109 + !model[SendEmailFieldsEnum.USE_SYSTEM_SMTP_SETTINGS] &&
  110 + model[SendEmailFieldsEnum.ENABLE_PROXY],
111 componentProps: { 111 componentProps: {
112 placeholder: `请输入${SendEmailFieldsNameEnum.PROXY_HOST}`, 112 placeholder: `请输入${SendEmailFieldsNameEnum.PROXY_HOST}`,
113 }, 113 },
@@ -119,7 +119,8 @@ export const formSchemas: FormSchema[] = [ @@ -119,7 +119,8 @@ export const formSchemas: FormSchema[] = [
119 required: true, 119 required: true,
120 colProps: { span: 12 }, 120 colProps: { span: 12 },
121 ifShow: ({ model }) => 121 ifShow: ({ model }) =>
122 - !model[SendEmailFieldsEnum.USE_SYSTEM_SMTP_SETTINGS] && model[SendEmailFieldsEnum.PROXY_PORT], 122 + !model[SendEmailFieldsEnum.USE_SYSTEM_SMTP_SETTINGS] &&
  123 + model[SendEmailFieldsEnum.ENABLE_PROXY],
123 componentProps: { 124 componentProps: {
124 placeholder: `请输入${SendEmailFieldsNameEnum.PROXY_PORT}`, 125 placeholder: `请输入${SendEmailFieldsNameEnum.PROXY_PORT}`,
125 }, 126 },
@@ -129,7 +130,8 @@ export const formSchemas: FormSchema[] = [ @@ -129,7 +130,8 @@ export const formSchemas: FormSchema[] = [
129 label: SendEmailFieldsNameEnum.PROXY_USER, 130 label: SendEmailFieldsNameEnum.PROXY_USER,
130 component: 'Input', 131 component: 'Input',
131 ifShow: ({ model }) => 132 ifShow: ({ model }) =>
132 - !model[SendEmailFieldsEnum.USE_SYSTEM_SMTP_SETTINGS] && model[SendEmailFieldsEnum.PROXY_USER], 133 + !model[SendEmailFieldsEnum.USE_SYSTEM_SMTP_SETTINGS] &&
  134 + model[SendEmailFieldsEnum.ENABLE_PROXY],
133 componentProps: { 135 componentProps: {
134 placeholder: `请输入${SendEmailFieldsNameEnum.PROXY_USER}`, 136 placeholder: `请输入${SendEmailFieldsNameEnum.PROXY_USER}`,
135 }, 137 },
@@ -138,7 +140,9 @@ export const formSchemas: FormSchema[] = [ @@ -138,7 +140,9 @@ export const formSchemas: FormSchema[] = [
138 field: SendEmailFieldsEnum.PROXY_PASSWORD, 140 field: SendEmailFieldsEnum.PROXY_PASSWORD,
139 label: SendEmailFieldsNameEnum.PROXY_PASSWORD, 141 label: SendEmailFieldsNameEnum.PROXY_PASSWORD,
140 component: 'Input', 142 component: 'Input',
141 - ifShow: ({ model }) => !model[SendEmailFieldsEnum.USE_SYSTEM_SMTP_SETTINGS], 143 + ifShow: ({ model }) =>
  144 + !model[SendEmailFieldsEnum.USE_SYSTEM_SMTP_SETTINGS] &&
  145 + model[SendEmailFieldsEnum.ENABLE_PROXY],
142 componentProps: { 146 componentProps: {
143 placeholder: `请输入${SendEmailFieldsNameEnum.PROXY_PASSWORD}`, 147 placeholder: `请输入${SendEmailFieldsNameEnum.PROXY_PASSWORD}`,
144 }, 148 },
@@ -58,7 +58,7 @@ export const formSchemas: FormSchema[] = [ @@ -58,7 +58,7 @@ export const formSchemas: FormSchema[] = [
58 !model[SendSMSFieldsEnum.USE_SYSTEM_SMS_SETTINGS] && 58 !model[SendSMSFieldsEnum.USE_SYSTEM_SMS_SETTINGS] &&
59 model[SendSMSFieldsEnum.TYPE] === SMSServiceProviderEnum.TWILIO, 59 model[SendSMSFieldsEnum.TYPE] === SMSServiceProviderEnum.TWILIO,
60 componentProps: { 60 componentProps: {
61 - placeholder: `请输入${SendSMSFieldsEnum.NUMBER_FROM}`, 61 + placeholder: `请输入${SendSMSFieldsNameEnum.NUMBER_FROM}`,
62 }, 62 },
63 }, 63 },
64 { 64 {
1 -import { NodeBindDataFieldEnum, NodeBindDataFieldNameEnum } from '../../../enum/node'; 1 +import {
  2 + CheckAlarmStatusFieldEnum,
  3 + CheckAlarmStatusFieldNameEnum,
  4 +} from '../../../enum/formField/filter';
2 import { FormSchema } from '/@/components/Form'; 5 import { FormSchema } from '/@/components/Form';
3 import { AlarmStatus, AlarmStatusMean } from '/@/enums/alarmEnum'; 6 import { AlarmStatus, AlarmStatusMean } from '/@/enums/alarmEnum';
4 7
5 export const formSchemas: FormSchema[] = [ 8 export const formSchemas: FormSchema[] = [
6 { 9 {
7 - field: NodeBindDataFieldEnum.ALARM_STATUS_LIST, 10 + field: CheckAlarmStatusFieldEnum.ALARM_STATUS_LIST,
8 component: 'Select', 11 component: 'Select',
9 - label: NodeBindDataFieldNameEnum.ALARM_STATUS_LIST, 12 + label: CheckAlarmStatusFieldNameEnum.ALARM_STATUS_LIST,
10 required: true, 13 required: true,
11 componentProps: { 14 componentProps: {
12 mode: 'multiple', 15 mode: 'multiple',
13 getPopupContainer: () => document.body, 16 getPopupContainer: () => document.body,
14 - placeholder: `请选择${NodeBindDataFieldNameEnum.ALARM_STATUS_LIST}`, 17 + placeholder: `请选择${CheckAlarmStatusFieldNameEnum.ALARM_STATUS_LIST}`,
15 options: [ 18 options: [
16 { 19 {
17 label: AlarmStatusMean[AlarmStatus.CLEARED_UN_ACK], 20 label: AlarmStatusMean[AlarmStatus.CLEARED_UN_ACK],
1 -import { NodeBindDataFieldEnum, NodeBindDataFieldNameEnum } from '../../../enum/node'; 1 +import {
  2 + CheckExistenceFieldsEnum,
  3 + CheckExistenceFieldsNameEnum,
  4 +} from '../../../enum/formField/filter';
2 import { FormSchema } from '/@/components/Form'; 5 import { FormSchema } from '/@/components/Form';
3 6
4 export const formSchemas: FormSchema[] = [ 7 export const formSchemas: FormSchema[] = [
5 { 8 {
6 - field: NodeBindDataFieldEnum.MESSAGE_NAMES, 9 + field: CheckExistenceFieldsEnum.MESSAGE_NAMES,
7 component: 'Select', 10 component: 'Select',
8 - label: NodeBindDataFieldNameEnum.MESSAGE_NAMES, 11 + label: CheckExistenceFieldsNameEnum.MESSAGE_NAMES,
9 componentProps: { 12 componentProps: {
10 mode: 'tags', 13 mode: 'tags',
11 open: false, 14 open: false,
12 getPopupContainer: () => document.body, 15 getPopupContainer: () => document.body,
  16 + placeholder: `请选择${CheckExistenceFieldsNameEnum.MESSAGE_NAMES}`,
13 }, 17 },
14 }, 18 },
15 { 19 {
16 - field: NodeBindDataFieldEnum.METADATA_NAMES, 20 + field: CheckExistenceFieldsEnum.METADATA_NAMES,
17 component: 'Select', 21 component: 'Select',
18 - label: NodeBindDataFieldNameEnum.METADATA_NAMES, 22 + label: CheckExistenceFieldsNameEnum.METADATA_NAMES,
19 componentProps: { 23 componentProps: {
20 mode: 'tags', 24 mode: 'tags',
21 open: false, 25 open: false,
22 getPopupContainer: () => document.body, 26 getPopupContainer: () => document.body,
  27 + placeholder: `请选择${CheckExistenceFieldsNameEnum.METADATA_NAMES}`,
23 }, 28 },
24 }, 29 },
25 { 30 {
26 - field: NodeBindDataFieldEnum.CHECK_ALL_KEYS, 31 + field: CheckExistenceFieldsEnum.CHECK_ALL_KEYS,
27 component: 'Checkbox', 32 component: 'Checkbox',
28 - label: NodeBindDataFieldNameEnum.CHECK_ALL_KEYS,  
29 - labelWidth: 200, 33 + label: '',
  34 + renderComponentContent: () => ({
  35 + default: () => CheckExistenceFieldsNameEnum.CHECK_ALL_KEYS,
  36 + }),
30 }, 37 },
31 ]; 38 ];
@@ -6,70 +6,115 @@ import { @@ -6,70 +6,115 @@ import {
6 RelationTypeEnum, 6 RelationTypeEnum,
7 RelationTypeNameEnum, 7 RelationTypeNameEnum,
8 } from '../../../enum/form'; 8 } from '../../../enum/form';
9 -import { NodeBindDataFieldEnum, NodeBindDataFieldNameEnum } from '../../../enum/node';  
10 -import { deviceProfilePage } from '/@/api/device/deviceManager'; 9 +import {
  10 + CheckRelationFieldsEnum,
  11 + CheckRelationFieldsNameEnum,
  12 +} from '../../../enum/formField/filter';
11 import { FormSchema } from '/@/components/Form'; 13 import { FormSchema } from '/@/components/Form';
  14 +import {
  15 + getEntityDevice,
  16 + getEntityAssets,
  17 + getEntityViews,
  18 + getEntityTenant,
  19 + getEntityCustomer,
  20 + getEntityUser,
  21 + getEntityDashboard,
  22 + getEntityEdge,
  23 +} from '/@/api/ruleChainDesigner';
  24 +import { useUserStore } from '/@/store/modules/user';
  25 +
  26 +export const getEntityIdSelect = (type: EntityTypeEnum) => {
  27 + const method = {
  28 + [EntityTypeEnum.DEVICE]: getEntityDevice,
  29 + [EntityTypeEnum.ASSET]: getEntityAssets,
  30 + [EntityTypeEnum.ENTITY_VIEW]: getEntityViews,
  31 + [EntityTypeEnum.TENANT]: async () => {
  32 + const userInfo = useUserStore();
  33 + const params = { tenantId: userInfo.getUserInfo.tenantId! };
  34 + const result = await getEntityTenant(params);
  35 + return Array.isArray(result) ? result : [result];
  36 + },
  37 + [EntityTypeEnum.CUSTOMER]: getEntityCustomer,
  38 + [EntityTypeEnum.USER]: getEntityUser,
  39 + [EntityTypeEnum.DASHBOARD]: getEntityDashboard,
  40 + [EntityTypeEnum.EDGE]: getEntityEdge,
  41 + };
  42 +
  43 + const params: Recordable = {
  44 + page: 0,
  45 + pageSize: 50,
  46 + };
  47 +
  48 + return {
  49 + placeholder: `请选择${EntityTypeNameEnum[type] ?? ''}`,
  50 + resultField: 'data',
  51 + labelField: 'name',
  52 + valueField: 'id.id',
  53 + searchField: 'textSearch',
  54 + params,
  55 + api: method[type],
  56 + searchApi: method[type],
  57 + };
  58 +};
12 59
13 export const formSchemas: FormSchema[] = [ 60 export const formSchemas: FormSchema[] = [
14 { 61 {
15 - field: NodeBindDataFieldEnum.NAME,  
16 - component: 'Input',  
17 - label: NodeBindDataFieldNameEnum.NAME,  
18 - },  
19 - {  
20 - field: NodeBindDataFieldEnum.CHECK_FOR_SINGLE_ENTITY, 62 + field: CheckRelationFieldsEnum.CHECK_FOR_SINGLE_ENTITY,
21 component: 'Checkbox', 63 component: 'Checkbox',
22 label: '', 64 label: '',
23 renderComponentContent: () => ({ 65 renderComponentContent: () => ({
24 - default: () => NodeBindDataFieldNameEnum.CHECK_FOR_SINGLE_ENTITY, 66 + default: () => CheckRelationFieldsNameEnum.CHECK_FOR_SINGLE_ENTITY,
25 }), 67 }),
26 }, 68 },
27 { 69 {
28 - field: NodeBindDataFieldEnum.DIRECTION, 70 + field: CheckRelationFieldsEnum.DIRECTION,
29 component: 'Select', 71 component: 'Select',
30 - label: NodeBindDataFieldEnum.DIRECTION, 72 + label: CheckRelationFieldsNameEnum.DIRECTION,
31 componentProps: { 73 componentProps: {
32 options: [ 74 options: [
33 { label: DirectionNameEnum.FROM, value: DirectionEnum.FROM }, 75 { label: DirectionNameEnum.FROM, value: DirectionEnum.FROM },
34 { label: DirectionNameEnum.TO, value: DirectionEnum.TO }, 76 { label: DirectionNameEnum.TO, value: DirectionEnum.TO },
35 ], 77 ],
  78 + placeholder: `请选择${CheckRelationFieldsNameEnum.DIRECTION}`,
  79 + getPopupContainer: () => document.body,
36 }, 80 },
37 }, 81 },
38 { 82 {
39 - field: NodeBindDataFieldEnum.ENTITY_TYPE, 83 + field: CheckRelationFieldsEnum.ENTITY_TYPE,
40 component: 'Select', 84 component: 'Select',
41 - label: NodeBindDataFieldNameEnum.ENTITY_TYPE, 85 + label: CheckRelationFieldsNameEnum.ENTITY_TYPE,
42 colProps: { span: 8 }, 86 colProps: { span: 8 },
43 - componentProps: {  
44 - options: Object.keys(EntityTypeEnum).map((key) => ({  
45 - label: EntityTypeNameEnum[key],  
46 - value: key,  
47 - })), 87 + componentProps: ({ formActionType }) => {
  88 + const { setFieldsValue } = formActionType;
  89 + return {
  90 + options: Object.keys(EntityTypeEnum).map((key) => ({
  91 + label: EntityTypeNameEnum[key],
  92 + value: key,
  93 + })),
  94 + placeholder: `请选择${CheckRelationFieldsNameEnum.ENTITY_TYPE}`,
  95 + getPopupContainer: () => document.body,
  96 + onChange: () => {
  97 + setFieldsValue({ [CheckRelationFieldsEnum.ENTITY_ID]: null });
  98 + },
  99 + };
48 }, 100 },
49 }, 101 },
50 { 102 {
51 - field: NodeBindDataFieldEnum.ENTITY_ID,  
52 - component: 'ApiSelectScrollLoad', 103 + field: CheckRelationFieldsEnum.ENTITY_ID,
  104 + component: 'ApiSearchSelect',
53 label: ' ', 105 label: ' ',
54 colProps: { span: 16 }, 106 colProps: { span: 16 },
55 - show: ({ model }) => model[NodeBindDataFieldEnum.ENTITY_TYPE], 107 + show: ({ model }) => model[CheckRelationFieldsEnum.ENTITY_TYPE],
56 componentProps: ({ formModel }) => { 108 componentProps: ({ formModel }) => {
57 - const entityType = formModel[NodeBindDataFieldEnum.ENTITY_TYPE]; 109 + const entityType = formModel[CheckRelationFieldsEnum.ENTITY_TYPE];
58 110
59 - return {  
60 - showSearch: true,  
61 - api: deviceProfilePage,  
62 - resultField: 'items',  
63 - labelField: 'name',  
64 - valueField: 'id',  
65 - placeholder: `请选择${EntityTypeNameEnum[entityType]}`,  
66 - }; 111 + return getEntityIdSelect(entityType);
67 }, 112 },
68 }, 113 },
69 { 114 {
70 - field: NodeBindDataFieldEnum.RELEATION_TYPE, 115 + field: CheckRelationFieldsEnum.RELEATION_TYPE,
71 component: 'Select', 116 component: 'Select',
72 - label: NodeBindDataFieldNameEnum.RELEATION_TYPE, 117 + label: CheckRelationFieldsNameEnum.RELEATION_TYPE,
73 defaultValue: RelationTypeEnum.CONTAINS, 118 defaultValue: RelationTypeEnum.CONTAINS,
74 componentProps: { 119 componentProps: {
75 options: Object.keys(RelationTypeEnum).map((value) => ({ 120 options: Object.keys(RelationTypeEnum).map((value) => ({
1 import { PerimeterTypeEnum, RangeUtilEnum, RangeUtilNameEnum } from '../../../enum/form'; 1 import { PerimeterTypeEnum, RangeUtilEnum, RangeUtilNameEnum } from '../../../enum/form';
2 -import { NodeBindDataFieldEnum, NodeBindDataFieldNameEnum } from '../../../enum/node'; 2 +import {
  3 + GpsGeofencingFilterFieldsEnum,
  4 + GpsGeofencingFilterFieldsNameEnum,
  5 +} from '../../../enum/formField/filter';
3 import { FormSchema } from '/@/components/Form'; 6 import { FormSchema } from '/@/components/Form';
4 7
5 export const formSchemas: FormSchema[] = [ 8 export const formSchemas: FormSchema[] = [
6 { 9 {
7 - field: NodeBindDataFieldEnum.LATITUDE_KEY_NAME, 10 + field: GpsGeofencingFilterFieldsEnum.LATITUDE_KEY_NAME,
8 component: 'Input', 11 component: 'Input',
9 - label: NodeBindDataFieldNameEnum.LATITUDE_KEY_NAME, 12 + label: GpsGeofencingFilterFieldsNameEnum.LATITUDE_KEY_NAME,
10 }, 13 },
11 { 14 {
12 - field: NodeBindDataFieldEnum.LONGITUDE_KEY_NAME, 15 + field: GpsGeofencingFilterFieldsEnum.LONGITUDE_KEY_NAME,
13 component: 'Input', 16 component: 'Input',
14 - label: NodeBindDataFieldNameEnum.LONGITUDE_KEY_NAME, 17 + label: GpsGeofencingFilterFieldsNameEnum.LONGITUDE_KEY_NAME,
15 }, 18 },
16 { 19 {
17 - field: NodeBindDataFieldEnum.PERIMETER_TYPE, 20 + field: GpsGeofencingFilterFieldsEnum.PERIMETER_TYPE,
18 component: 'Select', 21 component: 'Select',
19 - label: NodeBindDataFieldNameEnum.PERIMETER_TYPE, 22 + label: GpsGeofencingFilterFieldsNameEnum.PERIMETER_TYPE,
20 componentProps: { 23 componentProps: {
21 options: Object.keys(PerimeterTypeEnum).map((value) => ({ label: value, value })), 24 options: Object.keys(PerimeterTypeEnum).map((value) => ({ label: value, value })),
22 }, 25 },
23 }, 26 },
24 { 27 {
25 - field: NodeBindDataFieldEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA, 28 + field: GpsGeofencingFilterFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA,
26 component: 'Checkbox', 29 component: 'Checkbox',
27 label: '', 30 label: '',
28 renderComponentContent: () => ({ 31 renderComponentContent: () => ({
29 - default: () => NodeBindDataFieldNameEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA, 32 + default: () => GpsGeofencingFilterFieldsNameEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA,
30 }), 33 }),
31 }, 34 },
32 { 35 {
33 - field: NodeBindDataFieldEnum.PERIMETER_KEY_NAME, 36 + field: GpsGeofencingFilterFieldsEnum.PERIMETER_KEY_NAME,
34 component: 'Input', 37 component: 'Input',
35 - label: NodeBindDataFieldNameEnum.PERIMETER_KEY_NAME,  
36 - show: ({ model }) => model[NodeBindDataFieldEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA], 38 + label: GpsGeofencingFilterFieldsNameEnum.PERIMETER_KEY_NAME,
  39 + show: ({ model }) =>
  40 + model[GpsGeofencingFilterFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA],
37 }, 41 },
38 { 42 {
39 - field: NodeBindDataFieldEnum.POLYGONS_DEFINITION, 43 + field: GpsGeofencingFilterFieldsEnum.POLYGONS_DEFINITION,
40 component: 'Input', 44 component: 'Input',
41 - label: NodeBindDataFieldNameEnum.POLYGONS_DEFINITION, 45 + label: GpsGeofencingFilterFieldsNameEnum.POLYGONS_DEFINITION,
42 helpMessage: 46 helpMessage:
43 'Please, use the following format for manual definition of polygon: [[lat1,lon1],[lat2,lon2], ... ,[latN,lonN]].', 47 'Please, use the following format for manual definition of polygon: [[lat1,lon1],[lat2,lon2], ... ,[latN,lonN]].',
44 show: ({ model }) => 48 show: ({ model }) =>
45 - !model[NodeBindDataFieldEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA] &&  
46 - model[NodeBindDataFieldEnum.PERIMETER_TYPE] === PerimeterTypeEnum.POLYGON, 49 + !model[GpsGeofencingFilterFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA] &&
  50 + model[GpsGeofencingFilterFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.POLYGON,
47 }, 51 },
48 { 52 {
49 - field: NodeBindDataFieldEnum.CENTER_LATITUDE, 53 + field: GpsGeofencingFilterFieldsEnum.CENTER_LATITUDE,
50 component: 'InputNumber', 54 component: 'InputNumber',
51 - label: NodeBindDataFieldNameEnum.CENTER_LATITUDE, 55 + label: GpsGeofencingFilterFieldsNameEnum.CENTER_LATITUDE,
52 colProps: { span: 12 }, 56 colProps: { span: 12 },
53 show: ({ model }) => 57 show: ({ model }) =>
54 - model[NodeBindDataFieldEnum.PERIMETER_TYPE] === PerimeterTypeEnum.CIRCLE &&  
55 - !model[NodeBindDataFieldEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA], 58 + model[GpsGeofencingFilterFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.CIRCLE &&
  59 + !model[GpsGeofencingFilterFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA],
56 }, 60 },
57 { 61 {
58 - field: NodeBindDataFieldEnum.CENTER_LONGITUDE, 62 + field: GpsGeofencingFilterFieldsEnum.CENTER_LONGITUDE,
59 component: 'InputNumber', 63 component: 'InputNumber',
60 - label: NodeBindDataFieldNameEnum.CENTER_LONGITUDE, 64 + label: GpsGeofencingFilterFieldsNameEnum.CENTER_LONGITUDE,
61 colProps: { span: 12 }, 65 colProps: { span: 12 },
62 show: ({ model }) => 66 show: ({ model }) =>
63 - model[NodeBindDataFieldEnum.PERIMETER_TYPE] === PerimeterTypeEnum.CIRCLE &&  
64 - !model[NodeBindDataFieldEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA], 67 + model[GpsGeofencingFilterFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.CIRCLE &&
  68 + !model[GpsGeofencingFilterFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA],
65 }, 69 },
66 { 70 {
67 - field: NodeBindDataFieldEnum.RANGE, 71 + field: GpsGeofencingFilterFieldsEnum.RANGE,
68 component: 'InputNumber', 72 component: 'InputNumber',
69 - label: NodeBindDataFieldNameEnum.RANGE, 73 + label: GpsGeofencingFilterFieldsNameEnum.RANGE,
70 colProps: { span: 12 }, 74 colProps: { span: 12 },
71 show: ({ model }) => 75 show: ({ model }) =>
72 - model[NodeBindDataFieldEnum.PERIMETER_TYPE] === PerimeterTypeEnum.CIRCLE &&  
73 - !model[NodeBindDataFieldEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA], 76 + model[GpsGeofencingFilterFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.CIRCLE &&
  77 + !model[GpsGeofencingFilterFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA],
74 }, 78 },
75 { 79 {
76 - field: NodeBindDataFieldEnum.RANGE_UNIT, 80 + field: GpsGeofencingFilterFieldsEnum.RANGE_UNIT,
77 component: 'Select', 81 component: 'Select',
78 - label: NodeBindDataFieldNameEnum.RANGE_UNIT, 82 + label: GpsGeofencingFilterFieldsNameEnum.RANGE_UNIT,
79 colProps: { span: 12 }, 83 colProps: { span: 12 },
80 show: ({ model }) => 84 show: ({ model }) =>
81 - model[NodeBindDataFieldEnum.PERIMETER_TYPE] === PerimeterTypeEnum.CIRCLE &&  
82 - !model[NodeBindDataFieldEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA], 85 + model[GpsGeofencingFilterFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.CIRCLE &&
  86 + !model[GpsGeofencingFilterFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA],
83 componentProps: { 87 componentProps: {
84 options: Object.keys(RangeUtilEnum).map((value) => ({ 88 options: Object.keys(RangeUtilEnum).map((value) => ({
85 label: RangeUtilNameEnum[value], 89 label: RangeUtilNameEnum[value],
1 -import { NodeBindDataFieldEnum, NodeBindDataFieldNameEnum } from '../../../enum/node';  
2 -import { findDictItemByCode } from '/@/api/system/dict'; 1 +import { MessageTypesEnum, MessageTypesNameEnum } from '../../../enum/form';
  2 +import { MessageTypeFieldsEnum, MessageTypeFieldsNameEnum } from '../../../enum/formField/filter';
3 import { FormSchema } from '/@/components/Form'; 3 import { FormSchema } from '/@/components/Form';
4 -import { DictEnum } from '/@/enums/dictEnum';  
5 4
6 export const formSchemas: FormSchema[] = [ 5 export const formSchemas: FormSchema[] = [
7 { 6 {
8 - field: NodeBindDataFieldEnum.MESSAGE_TYPES,  
9 - component: 'ApiSelect',  
10 - label: NodeBindDataFieldNameEnum.MESSAGE_TYPES, 7 + field: MessageTypeFieldsEnum.MESSAGE_TYPES,
  8 + component: 'Select',
  9 + label: MessageTypeFieldsNameEnum.MESSAGE_TYPES,
11 componentProps: { 10 componentProps: {
12 - api: findDictItemByCode,  
13 - params: {  
14 - dictCode: DictEnum.MESSAGE_TYPES_FILTER,  
15 - }, 11 + options: Object.keys(MessageTypesEnum).map((value) => ({
  12 + label: MessageTypesNameEnum[value],
  13 + value,
  14 + })),
16 mode: 'multiple', 15 mode: 'multiple',
17 - labelField: 'itemText',  
18 - valueField: 'itemValue', 16 + placeholder: `请选择${MessageTypeFieldsNameEnum.MESSAGE_TYPES}`,
19 getPopupContainer: () => document.body, 17 getPopupContainer: () => document.body,
20 }, 18 },
21 }, 19 },
1 -import { NodeBindDataFieldEnum, NodeBindDataFieldNameEnum } from '../../../enum/node'; 1 +import {
  2 + OriginatorTypeFieldsEnum,
  3 + OriginatorTypeFieldsNameEnum,
  4 +} from '../../../enum/formField/filter';
2 import { findDictItemByCode } from '/@/api/system/dict'; 5 import { findDictItemByCode } from '/@/api/system/dict';
3 import { FormSchema } from '/@/components/Form'; 6 import { FormSchema } from '/@/components/Form';
4 import { DictEnum } from '/@/enums/dictEnum'; 7 import { DictEnum } from '/@/enums/dictEnum';
5 8
6 export const formSchemas: FormSchema[] = [ 9 export const formSchemas: FormSchema[] = [
7 { 10 {
8 - field: NodeBindDataFieldEnum.ORIGINATOR_TYPES, 11 + field: OriginatorTypeFieldsEnum.ORIGINATOR_TYPES,
9 component: 'ApiSelect', 12 component: 'ApiSelect',
10 - label: NodeBindDataFieldNameEnum.ORIGINATOR_TYPES, 13 + label: OriginatorTypeFieldsNameEnum.ORIGINATOR_TYPES,
11 componentProps: { 14 componentProps: {
12 api: findDictItemByCode, 15 api: findDictItemByCode,
13 params: { 16 params: {
1 import { h } from 'vue'; 1 import { h } from 'vue';
2 -import { NodeBindDataFieldEnum, NodeBindDataFieldNameEnum } from '../../../enum/node';  
3 import { FormSchema, useComponentRegister } from '/@/components/Form'; 2 import { FormSchema, useComponentRegister } from '/@/components/Form';
4 import HelpMessage from './HelpMessage.vue'; 3 import HelpMessage from './HelpMessage.vue';
5 import { JavascriptEditorWithTestModal } from '/@/views/rule/designer/src/components/JavaScriptFilterModal'; 4 import { JavascriptEditorWithTestModal } from '/@/views/rule/designer/src/components/JavaScriptFilterModal';
  5 +import { ScriptFieldsEnum, ScriptFieldsNameEnum } from '../../../enum/formField/filter';
6 6
7 useComponentRegister('JavascriptEditorWithTestModal', JavascriptEditorWithTestModal); 7 useComponentRegister('JavascriptEditorWithTestModal', JavascriptEditorWithTestModal);
8 8
9 export const formSchemas: FormSchema[] = [ 9 export const formSchemas: FormSchema[] = [
10 { 10 {
11 - field: NodeBindDataFieldEnum.JS_SCRIPT, 11 + field: ScriptFieldsEnum.JS_SCRIPT,
12 component: 'JavascriptEditorWithTestModal', 12 component: 'JavascriptEditorWithTestModal',
13 - label: NodeBindDataFieldNameEnum.JS_SCRIPT, 13 + label: ScriptFieldsNameEnum.JS_SCRIPT,
14 changeEvent: 'update:value', 14 changeEvent: 'update:value',
15 valueField: 'value', 15 valueField: 'value',
16 renderComponentContent: () => { 16 renderComponentContent: () => {
1 -import { NodeBindDataFieldEnum, NodeBindDataFieldNameEnum } from '../../../enum/node'; 1 +import { SwitchFieldsEnum, SwitchFieldsNameEnum } from '../../../enum/formField/filter';
2 import { FormSchema, useComponentRegister } from '/@/components/Form'; 2 import { FormSchema, useComponentRegister } from '/@/components/Form';
3 import { JavascriptEditorWithTestModal } from '/@/views/rule/designer/src/components/JavaScriptFilterModal'; 3 import { JavascriptEditorWithTestModal } from '/@/views/rule/designer/src/components/JavaScriptFilterModal';
4 4
@@ -6,9 +6,9 @@ useComponentRegister('JavascriptEditorWithTestModal', JavascriptEditorWithTestMo @@ -6,9 +6,9 @@ useComponentRegister('JavascriptEditorWithTestModal', JavascriptEditorWithTestMo
6 6
7 export const formSchemas: FormSchema[] = [ 7 export const formSchemas: FormSchema[] = [
8 { 8 {
9 - field: NodeBindDataFieldEnum.JS_SCRIPT, 9 + field: SwitchFieldsEnum.JS_SCRIPT,
10 component: 'JavascriptEditorWithTestModal', 10 component: 'JavascriptEditorWithTestModal',
11 - label: NodeBindDataFieldNameEnum.JS_SCRIPT, 11 + label: SwitchFieldsNameEnum.JS_SCRIPT,
12 changeEvent: 'update:value', 12 changeEvent: 'update:value',
13 valueField: 'value', 13 valueField: 'value',
14 componentProps: { 14 componentProps: {
@@ -2,6 +2,17 @@ import { RuleChainFieldsEnum, RuleChainFieldsNameEnum } from '../../../enum/form @@ -2,6 +2,17 @@ import { RuleChainFieldsEnum, RuleChainFieldsNameEnum } from '../../../enum/form
2 import { getRuleChains } from '/@/api/ruleDesigner'; 2 import { getRuleChains } from '/@/api/ruleDesigner';
3 import { FormSchema } from '/@/components/Form'; 3 import { FormSchema } from '/@/components/Form';
4 4
  5 +const fetch = async (params: Recordable) => {
  6 + try {
  7 + const result = await getRuleChains(params);
  8 + const data = result.data.map((item) => ({ label: item.name, value: item.id.id }));
  9 + return data;
  10 + } catch (err) {
  11 + console.error(err);
  12 + return [];
  13 + }
  14 +};
  15 +
5 export const formSchemas: FormSchema[] = [ 16 export const formSchemas: FormSchema[] = [
6 { 17 {
7 field: RuleChainFieldsEnum.RULE_CHAIN_ID, 18 field: RuleChainFieldsEnum.RULE_CHAIN_ID,
@@ -11,16 +22,13 @@ export const formSchemas: FormSchema[] = [ @@ -11,16 +22,13 @@ export const formSchemas: FormSchema[] = [
11 return { 22 return {
12 placeholder: '请选择所属产品', 23 placeholder: '请选择所属产品',
13 showSearch: true, 24 showSearch: true,
14 - resultField: 'data',  
15 - labelField: 'name',  
16 - valueField: 'id.id',  
17 params: { 25 params: {
18 pageSize: 50, 26 pageSize: 50,
19 page: 0, 27 page: 0,
20 type: 'CORE', 28 type: 'CORE',
21 }, 29 },
22 - api: getRuleChains,  
23 - searchApi: getRuleChains, 30 + api: fetch,
  31 + searchApi: fetch,
24 getPopupContainer: () => document.body, 32 getPopupContainer: () => document.body,
25 }; 33 };
26 }, 34 },
@@ -28,5 +28,7 @@ export const formSchemas: FormSchema[] = [ @@ -28,5 +28,7 @@ export const formSchemas: FormSchema[] = [
28 component: 'RelationsQuery', 28 component: 'RelationsQuery',
29 label: ChangeOriginatorFieldsNameEnum.RELATIONS_QUERY, 29 label: ChangeOriginatorFieldsNameEnum.RELATIONS_QUERY,
30 slot: ChangeOriginatorFieldsEnum.RELATIONS_QUERY, 30 slot: ChangeOriginatorFieldsEnum.RELATIONS_QUERY,
  31 + ifShow: ({ model }) =>
  32 + model[ChangeOriginatorFieldsEnum.ORIGINATOR_SOURCE] === OriginatorSourceEnum.RELATED,
31 }, 33 },
32 ]; 34 ];
1 -<script lang="ts" setup></script> 1 +<script lang="ts" setup>
  2 + import { EdgeBindDataFieldEnum, EdgeBindDataFieldNameEnum } from '../../../enum/node';
  3 + import { ConnectionModalDefineExposeType } from '../../../types';
  4 + import { NodeData } from '../../../types/node';
  5 + import { BasicForm, FormSchema, useForm } from '/@/components/Form';
  6 +
  7 + defineProps<{
  8 + config: NodeData;
  9 + }>();
  10 +
  11 + const getSchemas = (): FormSchema[] => {
  12 + return [
  13 + {
  14 + field: EdgeBindDataFieldEnum.TYPE,
  15 + component: 'Select',
  16 + label: EdgeBindDataFieldNameEnum.TYPE,
  17 + componentProps: {
  18 + mode: 'tags',
  19 + open: false,
  20 + getPopupContainer: () => document.body,
  21 + placeholder: '请输入链接标签',
  22 + },
  23 + },
  24 + ];
  25 + };
  26 +
  27 + const [register, { setFieldsValue, getFieldsValue }] = useForm({
  28 + showActionButtonGroup: false,
  29 + schemas: getSchemas(),
  30 + });
  31 +
  32 + const getValue: ConnectionModalDefineExposeType['getFieldsValue'] = async () => {
  33 + return getFieldsValue();
  34 + };
  35 +
  36 + const setValue: ConnectionModalDefineExposeType['setFieldsValue'] = async (value) => {
  37 + const { type } = value || {};
  38 + setFieldsValue(type);
  39 + };
  40 +
  41 + defineExpose({
  42 + getFieldsValue: getValue,
  43 + setFieldsValue: setValue,
  44 + } as ConnectionModalDefineExposeType);
  45 +</script>
2 46
3 <template> 47 <template>
4 - <div>自定义</div> 48 + <BasicForm @register="register" />
5 </template> 49 </template>
@@ -16,8 +16,8 @@ export const TopFormSchemas: FormSchema[] = [ @@ -16,8 +16,8 @@ export const TopFormSchemas: FormSchema[] = [
16 }, 16 },
17 { 17 {
18 field: NodeBindDataFieldEnum.DEBUG_MODE, 18 field: NodeBindDataFieldEnum.DEBUG_MODE,
19 - component: 'Checkbox',  
20 - label: '', 19 + component: 'Switch',
  20 + label: NodeBindDataFieldNameEnum.DEBUG_MODE,
21 colProps: { 21 colProps: {
22 offset: 2, 22 offset: 2,
23 span: 6, 23 span: 6,
1 <script lang="ts" setup> 1 <script lang="ts" setup>
2 import { Card, Select, Tag, Form, Button } from 'ant-design-vue'; 2 import { Card, Select, Tag, Form, Button } from 'ant-design-vue';
3 import { ref, toRaw, unref, watch } from 'vue'; 3 import { ref, toRaw, unref, watch } from 'vue';
4 - import { MessageTypesFilterEnum, MessageTypesFilterNameEnum } from '../../../enum/form'; 4 + import { MessageTypesEnum, MessageTypesNameEnum } from '../../../enum/form';
5 import { JSONEditor } from '/@/components/CodeEditor'; 5 import { JSONEditor } from '/@/components/CodeEditor';
6 import { Icon } from '/@/components/Icon'; 6 import { Icon } from '/@/components/Icon';
7 import { JavaScriptFunctionEditor } from '/@/components/Form'; 7 import { JavaScriptFunctionEditor } from '/@/components/Form';
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 interface Value { 12 interface Value {
13 msg: Recordable; 13 msg: Recordable;
14 metadata: Recordable; 14 metadata: Recordable;
15 - msgType: MessageTypesFilterEnum; 15 + msgType: MessageTypesEnum;
16 javascriptFunction: string; 16 javascriptFunction: string;
17 } 17 }
18 18
@@ -35,9 +35,9 @@ @@ -35,9 +35,9 @@
35 (eventName: 'save', value: Value): void; 35 (eventName: 'save', value: Value): void;
36 }>(); 36 }>();
37 37
38 - const messageType = ref(MessageTypesFilterEnum.POST_TELEMETRY);  
39 - const messageTypeOptions = Object.keys(MessageTypesFilterEnum).map((value) => ({  
40 - label: MessageTypesFilterNameEnum[value], 38 + const messageType = ref(MessageTypesEnum.POST_TELEMETRY_REQUEST);
  39 + const messageTypeOptions = Object.keys(MessageTypesEnum).map((value) => ({
  40 + label: MessageTypesNameEnum[value],
41 value, 41 value,
42 })); 42 }));
43 43
1 <script lang="ts" setup> 1 <script lang="ts" setup>
2 import { BasicModal, useModalInner } from '/@/components/Modal'; 2 import { BasicModal, useModalInner } from '/@/components/Modal';
3 import JavaScriptFilterTest from './JavaScriptFilterTest.vue'; 3 import JavaScriptFilterTest from './JavaScriptFilterTest.vue';
4 - import { MessageTypesFilterEnum } from '../../../enum/form'; 4 + import { MessageTypesEnum } from '../../../enum/form';
5 import { ref } from 'vue'; 5 import { ref } from 'vue';
6 import { JavaScriptFunctionEditor } from '/@/components/Form'; 6 import { JavaScriptFunctionEditor } from '/@/components/Form';
7 7
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 interface SaveValueType { 15 interface SaveValueType {
16 msg: Recordable; 16 msg: Recordable;
17 metadata: Recordable; 17 metadata: Recordable;
18 - msgType: MessageTypesFilterEnum; 18 + msgType: MessageTypesEnum;
19 javascriptFunction: string; 19 javascriptFunction: string;
20 } 20 }
21 21
@@ -56,8 +56,8 @@ @@ -56,8 +56,8 @@
56 placement="left" 56 placement="left"
57 color="#fff" 57 color="#fff"
58 trigger="hover" 58 trigger="hover"
59 - :mouse-enter-delay="0.3"  
60 - overlay-class-name="!max-w-72" 59 + :mouse-enter-delay="0.5"
  60 + overlay-class-name="!max-w-90"
61 > 61 >
62 <template #title> 62 <template #title>
63 <section class="text-dark-900"> 63 <section class="text-dark-900">
@@ -42,6 +42,7 @@ export interface UserInfo { @@ -42,6 +42,7 @@ export interface UserInfo {
42 plainRoles?: PlainRoleInfo[]; 42 plainRoles?: PlainRoleInfo[];
43 phoneNumber?: string; 43 phoneNumber?: string;
44 email?: string; 44 email?: string;
  45 + tenantId?: string;
45 } 46 }
46 47
47 export interface BeforeMiniState { 48 export interface BeforeMiniState {