Commit 94ab22ef742859abccf43b15fe3bea6cedde22ff

Authored by xp.Huang
2 parents 5534bf94 f684e5aa

Merge branch 'fix/rule-chain-i18n-usage' into 'main_dev'

Fix/rule chain i18n usage

See merge request yunteng/thingskit-front!1038
Showing 141 changed files with 1188 additions and 1186 deletions
... ... @@ -12,7 +12,7 @@ export default {
12 12 },
13 13 script: {
14 14 name: 'JS脚本',
15   - details: `JavaScript函数接收3个输入参数:- metadata:一条消息的元数据;- msg:一条消息的有效负载;- msgType:一条消息的类型。应返回以下结构:{ msg: new payload,<br/> metadata: new metadata,<br/>msgType: new msgType };结果对象中的所有字段都是可选的,如果没有指定,将使用原始消息中的字段。`,
  15 + details: `JavaScript函数接收3个输入参数: \n - metadata:一条消息的元数据; \n - msg:一条消息的有效负载; \n - msgType:一条消息的类型。 \n 应返回以下结构:{ '{ msg: new payload, metadata: new metadata, msgType: new msgType }' }; \n 结果对象中的所有字段都是可选的,如果没有指定,将使用原始消息中的字段。`,
16 16 description: '使用JavaScript更改消息有效负载、元数据或消息类型。',
17 17 },
18 18 toEmail: {
... ...
... ... @@ -4,7 +4,7 @@ import { getMenuListResultModel } from '/@/api/sys/model/menuModel';
4 4 import { useI18n } from '/@/hooks/web/useI18n';
5 5
6 6 export function listToTree(lists: getMenuListResultModel): getMenuListResultModel {
7   - const { t } = useI18n(); //加载国际化
  7 + const { t } = useI18n(); // 加载国际化
8 8 lists.forEach((goods) => {
9 9 goods['menuName'] = t(goods.meta.title); // 为goods添加属性menuName
10 10
... ...
1   -import { useI18n } from '/@/hooks/web/useI18n';
2   -
3   -const { t } = useI18n() as any; //加载国际化
4   -
5 1 // Assign to customer
6 2 export enum AssignToCustomerFieldsEnum {
7 3 CUSTOMER_NAME_PATTERN = 'customerNamePattern',
... ... @@ -10,15 +6,9 @@ export enum AssignToCustomerFieldsEnum {
10 6 }
11 7
12 8 export enum AssignToCustomerFieldsNameEnum {
13   - CUSTOMER_NAME_PATTERN = t(
14   - 'designer_form_label.actions.index.AssignToCustomerFieldsNameEnum.CUSTOMER_NAME_PATTERN'
15   - ),
16   - CREATE_CUSTOMER_IF_NOT_EXISTS = t(
17   - 'designer_form_label.actions.index.AssignToCustomerFieldsNameEnum.CREATE_CUSTOMER_IF_NOT_EXISTS'
18   - ),
19   - CUSTOMER_CACHE_EXPIRATION = t(
20   - 'designer_form_label.actions.index.AssignToCustomerFieldsNameEnum.CUSTOMER_CACHE_EXPIRATION'
21   - ),
  9 + CUSTOMER_NAME_PATTERN = 'designer_form_label.actions.index.AssignToCustomerFieldsNameEnum.CUSTOMER_NAME_PATTERN',
  10 + CREATE_CUSTOMER_IF_NOT_EXISTS = 'designer_form_label.actions.index.AssignToCustomerFieldsNameEnum.CREATE_CUSTOMER_IF_NOT_EXISTS',
  11 + CUSTOMER_CACHE_EXPIRATION = 'designer_form_label.actions.index.AssignToCustomerFieldsNameEnum.CUSTOMER_CACHE_EXPIRATION',
22 12 }
23 13
24 14 // clear alarm
... ... @@ -28,10 +18,8 @@ export enum ClearAlarmFieldsEnum {
28 18 }
29 19
30 20 export enum ClearAlarmFieldsNameEnum {
31   - ALARM_TYPE = t('designer_form_label.actions.index.ClearAlarmFieldsNameEnum.ALARM_TYPE'),
32   - ALARM_DETAILS_BUILD_JS = t(
33   - 'designer_form_label.actions.index.ClearAlarmFieldsNameEnum.ALARM_DETAILS_BUILD_JS'
34   - ),
  21 + ALARM_TYPE = 'designer_form_label.actions.index.ClearAlarmFieldsNameEnum.ALARM_TYPE',
  22 + ALARM_DETAILS_BUILD_JS = 'designer_form_label.actions.index.ClearAlarmFieldsNameEnum.ALARM_DETAILS_BUILD_JS',
35 23 }
36 24
37 25 // Create alarm
... ... @@ -49,28 +37,16 @@ export enum CreateAlarmFieldsEnum {
49 37 }
50 38
51 39 export enum CreateAlarmFieldsNameEnum {
52   - ALARM_DETAILS_BUILD_JS = t(
53   - 'designer_form_label.actions.index.CreateAlarmFieldsNameEnum.ALARM_DETAILS_BUILD_JS'
54   - ),
55   - USE_MESSAGE_ALARM_DATA = t(
56   - 'designer_form_label.actions.index.CreateAlarmFieldsNameEnum.USE_MESSAGE_ALARM_DATA'
57   - ),
58   - OVERWRITE_ALARM_DETAILS = t(
59   - 'designer_form_label.actions.index.CreateAlarmFieldsNameEnum.OVERWRITE_ALARM_DETAILS'
60   - ),
61   - ALARM_TYPE = t('designer_form_label.actions.index.CreateAlarmFieldsNameEnum.ALARM_TYPE'),
62   - SEVERITY = t('designer_form_label.actions.index.CreateAlarmFieldsNameEnum.SEVERITY'),
63   - PROPAGATE = t('designer_form_label.actions.index.CreateAlarmFieldsNameEnum.PROPAGATE'),
64   - RELATION_TYPES = t('designer_form_label.actions.index.CreateAlarmFieldsNameEnum.RELATION_TYPES'),
65   - PROPAGATE_TO_OWNER = t(
66   - 'designer_form_label.actions.index.CreateAlarmFieldsNameEnum.PROPAGATE_TO_OWNER'
67   - ),
68   - PROPAGATE_TO_TENANT = t(
69   - 'designer_form_label.actions.index.CreateAlarmFieldsNameEnum.PROPAGATE_TO_TENANT'
70   - ),
71   - DYNAMIC_SEVERITY = t(
72   - 'designer_form_label.actions.index.CreateAlarmFieldsNameEnum.DYNAMIC_SEVERITY'
73   - ),
  40 + ALARM_DETAILS_BUILD_JS = 'designer_form_label.actions.index.CreateAlarmFieldsNameEnum.ALARM_DETAILS_BUILD_JS',
  41 + USE_MESSAGE_ALARM_DATA = 'designer_form_label.actions.index.CreateAlarmFieldsNameEnum.USE_MESSAGE_ALARM_DATA',
  42 + OVERWRITE_ALARM_DETAILS = 'designer_form_label.actions.index.CreateAlarmFieldsNameEnum.OVERWRITE_ALARM_DETAILS',
  43 + ALARM_TYPE = 'designer_form_label.actions.index.CreateAlarmFieldsNameEnum.ALARM_TYPE',
  44 + SEVERITY = 'designer_form_label.actions.index.CreateAlarmFieldsNameEnum.SEVERITY',
  45 + PROPAGATE = 'designer_form_label.actions.index.CreateAlarmFieldsNameEnum.PROPAGATE',
  46 + RELATION_TYPES = 'designer_form_label.actions.index.CreateAlarmFieldsNameEnum.RELATION_TYPES',
  47 + PROPAGATE_TO_OWNER = 'designer_form_label.actions.index.CreateAlarmFieldsNameEnum.PROPAGATE_TO_OWNER',
  48 + PROPAGATE_TO_TENANT = 'designer_form_label.actions.index.CreateAlarmFieldsNameEnum.PROPAGATE_TO_TENANT',
  49 + DYNAMIC_SEVERITY = 'designer_form_label.actions.index.CreateAlarmFieldsNameEnum.DYNAMIC_SEVERITY',
74 50 }
75 51
76 52 // Create relation
... ... @@ -87,27 +63,15 @@ export enum CreateRelationFieldsEnum {
87 63 }
88 64
89 65 export enum CreateRelationFieldsNameEnum {
90   - DIRECTION = t('designer_form_label.actions.index.CreateRelationFieldsNameEnum.DIRECTION'),
91   - ENTITY_TYPE = t('designer_form_label.actions.index.CreateRelationFieldsNameEnum.ENTITY_TYPE'),
92   - ENTITY_NAME_PATTERN = t(
93   - 'designer_form_label.actions.index.CreateRelationFieldsNameEnum.ENTITY_NAME_PATTERN'
94   - ),
95   - ENTITY_TYPE_PATTERN = t(
96   - 'designer_form_label.actions.index.CreateRelationFieldsNameEnum.ENTITY_TYPE_PATTERN'
97   - ),
98   - RELATION_TYPE = t('designer_form_label.actions.index.CreateRelationFieldsNameEnum.RELATION_TYPE'),
99   - CREATE_ENTITY_IF_NOT_EXISTS = t(
100   - 'designer_form_label.actions.index.CreateRelationFieldsNameEnum.CREATE_ENTITY_IF_NOT_EXISTS'
101   - ),
102   - REMOVE_CURRENT_RELATIONS = t(
103   - 'designer_form_label.actions.index.CreateRelationFieldsNameEnum.REMOVE_CURRENT_RELATIONS'
104   - ),
105   - CHANGE_ORIGINATOR_TO_RELATED_ENTITY = t(
106   - 'designer_form_label.actions.index.CreateRelationFieldsNameEnum.CHANGE_ORIGINATOR_TO_RELATED_ENTITY'
107   - ),
108   - ENTITY_CACHE_EXPIRATION = t(
109   - 'designer_form_label.actions.index.CreateRelationFieldsNameEnum.ENTITY_CACHE_EXPIRATION'
110   - ),
  66 + DIRECTION = 'designer_form_label.actions.index.CreateRelationFieldsNameEnum.DIRECTION',
  67 + ENTITY_TYPE = 'designer_form_label.actions.index.CreateRelationFieldsNameEnum.ENTITY_TYPE',
  68 + ENTITY_NAME_PATTERN = 'designer_form_label.actions.index.CreateRelationFieldsNameEnum.ENTITY_NAME_PATTERN',
  69 + ENTITY_TYPE_PATTERN = 'designer_form_label.actions.index.CreateRelationFieldsNameEnum.ENTITY_TYPE_PATTERN',
  70 + RELATION_TYPE = 'designer_form_label.actions.index.CreateRelationFieldsNameEnum.RELATION_TYPE',
  71 + CREATE_ENTITY_IF_NOT_EXISTS = 'designer_form_label.actions.index.CreateRelationFieldsNameEnum.CREATE_ENTITY_IF_NOT_EXISTS',
  72 + REMOVE_CURRENT_RELATIONS = 'designer_form_label.actions.index.CreateRelationFieldsNameEnum.REMOVE_CURRENT_RELATIONS',
  73 + CHANGE_ORIGINATOR_TO_RELATED_ENTITY = 'designer_form_label.actions.index.CreateRelationFieldsNameEnum.CHANGE_ORIGINATOR_TO_RELATED_ENTITY',
  74 + ENTITY_CACHE_EXPIRATION = 'designer_form_label.actions.index.CreateRelationFieldsNameEnum.ENTITY_CACHE_EXPIRATION',
111 75 }
112 76
113 77 // Delay deprecated
... ... @@ -119,18 +83,10 @@ export enum DelayDeprecatedFieldsEnum {
119 83 }
120 84
121 85 export enum DelayDeprecatedFieldsNameEnum {
122   - USE_METADATA_PERIOD_IN_SECONDS_PATTERNS = t(
123   - 'designer_form_label.actions.index.DelayDeprecatedFieldsNameEnum.USE_METADATA_PERIOD_IN_SECONDS_PATTERNS'
124   - ),
125   - PERIOD_IN_SECONDS = t(
126   - 'designer_form_label.actions.index.DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS'
127   - ),
128   - PERIOD_IN_SECONDS_PATTERN = t(
129   - 'designer_form_label.actions.index.DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS_PATTERN'
130   - ),
131   - MAX_PENDING_MSGS = t(
132   - 'designer_form_label.actions.index.DelayDeprecatedFieldsNameEnum.MAX_PENDING_MSGS'
133   - ),
  86 + USE_METADATA_PERIOD_IN_SECONDS_PATTERNS = 'designer_form_label.actions.index.DelayDeprecatedFieldsNameEnum.USE_METADATA_PERIOD_IN_SECONDS_PATTERNS',
  87 + PERIOD_IN_SECONDS = 'designer_form_label.actions.index.DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS',
  88 + PERIOD_IN_SECONDS_PATTERN = 'designer_form_label.actions.index.DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS_PATTERN',
  89 + MAX_PENDING_MSGS = 'designer_form_label.actions.index.DelayDeprecatedFieldsNameEnum.MAX_PENDING_MSGS',
134 90 }
135 91
136 92 export enum DeleteRelationFieldsEnum {
... ... @@ -143,18 +99,12 @@ export enum DeleteRelationFieldsEnum {
143 99 }
144 100
145 101 export enum DeleteRelationFieldsNameEnum {
146   - DELETE_FOR_SINGLE_ENTITY = t(
147   - 'designer_form_label.actions.index.DeleteRelationFieldsNameEnum.DELETE_FOR_SINGLE_ENTITY'
148   - ),
149   - DIRECTION = t('designer_form_label.actions.index.DeleteRelationFieldsNameEnum.DIRECTION'),
150   - ENTITY_TYPE = t('designer_form_label.actions.index.DeleteRelationFieldsNameEnum.ENTITY_TYPE'),
151   - ENTITY_NAME_PATTERN = t(
152   - 'designer_form_label.actions.index.DeleteRelationFieldsNameEnum.ENTITY_NAME_PATTERN'
153   - ),
154   - RELATION_TYPE = t('designer_form_label.actions.index.DeleteRelationFieldsNameEnum.RELATION_TYPE'),
155   - ENTITY_CACHE_EXPIRATION = t(
156   - 'designer_form_label.actions.index.DeleteRelationFieldsNameEnum.ENTITY_CACHE_EXPIRATION'
157   - ),
  102 + DELETE_FOR_SINGLE_ENTITY = 'designer_form_label.actions.index.DeleteRelationFieldsNameEnum.DELETE_FOR_SINGLE_ENTITY',
  103 + DIRECTION = 'designer_form_label.actions.index.DeleteRelationFieldsNameEnum.DIRECTION',
  104 + ENTITY_TYPE = 'designer_form_label.actions.index.DeleteRelationFieldsNameEnum.ENTITY_TYPE',
  105 + ENTITY_NAME_PATTERN = 'designer_form_label.actions.index.DeleteRelationFieldsNameEnum.ENTITY_NAME_PATTERN',
  106 + RELATION_TYPE = 'designer_form_label.actions.index.DeleteRelationFieldsNameEnum.RELATION_TYPE',
  107 + ENTITY_CACHE_EXPIRATION = 'designer_form_label.actions.index.DeleteRelationFieldsNameEnum.ENTITY_CACHE_EXPIRATION',
158 108 }
159 109
160 110 // device profile
... ... @@ -164,12 +114,8 @@ export enum DeviceProfileFieldsEnum {
164 114 }
165 115
166 116 export enum DeviceProfileFieldsNameEnum {
167   - PERSIST_ALARM_RULES_STATE = t(
168   - 'designer_form_label.actions.index.DeviceProfileFieldsNameEnum.PERSIST_ALARM_RULES_STATE'
169   - ),
170   - FETCH_ALARM_RULES_STATE_ON_START = t(
171   - 'designer_form_label.actions.index.DeviceProfileFieldsNameEnum.FETCH_ALARM_RULES_STATE_ON_START'
172   - ),
  117 + PERSIST_ALARM_RULES_STATE = 'designer_form_label.actions.index.DeviceProfileFieldsNameEnum.PERSIST_ALARM_RULES_STATE',
  118 + FETCH_ALARM_RULES_STATE_ON_START = 'designer_form_label.actions.index.DeviceProfileFieldsNameEnum.FETCH_ALARM_RULES_STATE_ON_START',
173 119 }
174 120
175 121 // Generator
... ... @@ -182,13 +128,11 @@ export enum GeneratorFieldsEnum {
182 128 }
183 129
184 130 export enum GeneratorFieldsNameEnum {
185   - MSG_COUNT = t('designer_form_label.actions.index.GeneratorFieldsNameEnum.MSG_COUNT'),
186   - PERIOD_IN_SECONDS = t(
187   - 'designer_form_label.actions.index.GeneratorFieldsNameEnum.PERIOD_IN_SECONDS'
188   - ),
189   - JS_SCRIPT = t('designer_form_label.actions.index.GeneratorFieldsNameEnum.JS_SCRIPT'),
  131 + MSG_COUNT = 'designer_form_label.actions.index.GeneratorFieldsNameEnum.MSG_COUNT',
  132 + PERIOD_IN_SECONDS = 'designer_form_label.actions.index.GeneratorFieldsNameEnum.PERIOD_IN_SECONDS',
  133 + JS_SCRIPT = 'designer_form_label.actions.index.GeneratorFieldsNameEnum.JS_SCRIPT',
190 134 // ORIGINATOR_ID = '资产',
191   - ORIGINATOR_TYPE = t('designer_form_label.actions.index.GeneratorFieldsNameEnum.ORIGINATOR_TYPE'),
  135 + ORIGINATOR_TYPE = 'designer_form_label.actions.index.GeneratorFieldsNameEnum.ORIGINATOR_TYPE',
192 136 }
193 137
194 138 // Gps geofencing events
... ... @@ -210,44 +154,20 @@ export enum GpsGeofencingEventsFieldsEnum {
210 154 }
211 155
212 156 export enum GpsGeofencingEventsFieldsNameEnum {
213   - LATITUDE_KEY_NAME = t(
214   - 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.LATITUDE_KEY_NAME'
215   - ),
216   - LONGITUDE_KEY_NAME = t(
217   - 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.LONGITUDE_KEY_NAME'
218   - ),
219   - PERIMETER_TYPE = t(
220   - 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.PERIMETER_TYPE'
221   - ),
222   - FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA = t(
223   - 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA'
224   - ),
225   - PERIMETER_KEY_NAME = t(
226   - 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.PERIMETER_KEY_NAME'
227   - ),
228   - CENTER_LATITUDE = t(
229   - 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.CENTER_LATITUDE'
230   - ),
231   - CENTER_LONGITUDE = t(
232   - 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.CENTER_LONGITUDE'
233   - ),
234   - RANGE = t('designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.RANGE'),
235   - RANGE_UNIT = t('designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.RANGE_UNIT'),
236   - POLYGONS_DEFINITION = t(
237   - 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.POLYGONS_DEFINITION'
238   - ),
239   - MIN_INSIDE_DURATION = t(
240   - 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.MIN_INSIDE_DURATION'
241   - ),
242   - MIN_INSIDE_DURATION_TIME_UNIT = t(
243   - 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.MIN_INSIDE_DURATION_TIME_UNIT'
244   - ),
245   - MIN_OUTSIDE_DURATION = t(
246   - 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.MIN_OUTSIDE_DURATION'
247   - ),
248   - MIN_OUTSIDE_DURATION_TIME_UNIT = t(
249   - 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.MIN_OUTSIDE_DURATION_TIME_UNIT'
250   - ),
  157 + LATITUDE_KEY_NAME = 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.LATITUDE_KEY_NAME',
  158 + LONGITUDE_KEY_NAME = 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.LONGITUDE_KEY_NAME',
  159 + PERIMETER_TYPE = 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.PERIMETER_TYPE',
  160 + FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA = 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA',
  161 + PERIMETER_KEY_NAME = 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.PERIMETER_KEY_NAME',
  162 + CENTER_LATITUDE = 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.CENTER_LATITUDE',
  163 + CENTER_LONGITUDE = 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.CENTER_LONGITUDE',
  164 + RANGE = 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.RANGE',
  165 + RANGE_UNIT = 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.RANGE_UNIT',
  166 + POLYGONS_DEFINITION = 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.POLYGONS_DEFINITION',
  167 + MIN_INSIDE_DURATION = 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.MIN_INSIDE_DURATION',
  168 + MIN_INSIDE_DURATION_TIME_UNIT = 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.MIN_INSIDE_DURATION_TIME_UNIT',
  169 + MIN_OUTSIDE_DURATION = 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.MIN_OUTSIDE_DURATION',
  170 + MIN_OUTSIDE_DURATION_TIME_UNIT = 'designer_form_label.actions.index.GpsGeofencingEventsFieldsNameEnum.MIN_OUTSIDE_DURATION_TIME_UNIT',
251 171 }
252 172
253 173 // Log
... ... @@ -256,7 +176,7 @@ export enum LogFieldsEnum {
256 176 }
257 177
258 178 export enum LogFieldsNameEnum {
259   - JS_SCRIPT = t('designer_form_label.actions.index.LogFieldsNameEnum.JS_SCRIPT'),
  179 + JS_SCRIPT = 'designer_form_label.actions.index.LogFieldsNameEnum.JS_SCRIPT',
260 180 }
261 181
262 182 // Message Count
... ... @@ -266,10 +186,8 @@ export enum MessageCountFieldsEnum {
266 186 }
267 187
268 188 export enum MessageCountFieldsNameEnum {
269   - INTERVAL = t('designer_form_label.actions.index.MessageCountFieldsNameEnum.INTERVAL'),
270   - TELEMETRY_PREFIX = t(
271   - 'designer_form_label.actions.index.MessageCountFieldsNameEnum.TELEMETRY_PREFIX'
272   - ),
  189 + INTERVAL = 'designer_form_label.actions.index.MessageCountFieldsNameEnum.INTERVAL',
  190 + TELEMETRY_PREFIX = 'designer_form_label.actions.index.MessageCountFieldsNameEnum.TELEMETRY_PREFIX',
273 191 }
274 192
275 193 // Push to edge
... ... @@ -278,7 +196,7 @@ export enum PushToEdgeFieldsEnum {
278 196 }
279 197
280 198 export enum PushToEdgeFieldsNameEnum {
281   - SCOPE = t('designer_form_label.actions.index.PushToEdgeFieldsNameEnum.SCOPE'),
  199 + SCOPE = 'designer_form_label.actions.index.PushToEdgeFieldsNameEnum.SCOPE',
282 200 }
283 201 // Rpc call reply
284 202 export enum RpcCallReplyFieldsEnum {
... ... @@ -286,9 +204,7 @@ export enum RpcCallReplyFieldsEnum {
286 204 }
287 205
288 206 export enum RpcCallReplyFieldsNameEnum {
289   - REQUEST_ID_META_DATA_ATTRIBUTE = t(
290   - 'designer_form_label.actions.index.RpcCallReplyFieldsNameEnum.REQUEST_ID_META_DATA_ATTRIBUTE'
291   - ),
  207 + REQUEST_ID_META_DATA_ATTRIBUTE = 'designer_form_label.actions.index.RpcCallReplyFieldsNameEnum.REQUEST_ID_META_DATA_ATTRIBUTE',
292 208 }
293 209
294 210 // Rpc call request
... ... @@ -297,9 +213,7 @@ export enum RpcCallRequestFieldsEnum {
297 213 }
298 214
299 215 export enum RpcCallRequestFieldsNameEnum {
300   - TIMEOUT_IN_SECONDS = t(
301   - 'designer_form_label.actions.index.RpcCallRequestFieldsNameEnum.TIMEOUT_IN_SECONDS'
302   - ),
  216 + TIMEOUT_IN_SECONDS = 'designer_form_label.actions.index.RpcCallRequestFieldsNameEnum.TIMEOUT_IN_SECONDS',
303 217 }
304 218
305 219 // Save attribute
... ... @@ -309,8 +223,8 @@ export enum SaveAttributesFieldsEnum {
309 223 }
310 224
311 225 export enum SaveAttributesFieldsNameEnum {
312   - NOTIFY_DEVICE = t('designer_form_label.actions.index.SaveAttributesFieldsNameEnum.NOTIFY_DEVICE'),
313   - SCOPE = t('designer_form_label.actions.index.SaveAttributesFieldsNameEnum.SCOPE'),
  226 + NOTIFY_DEVICE = 'designer_form_label.actions.index.SaveAttributesFieldsNameEnum.NOTIFY_DEVICE',
  227 + SCOPE = 'designer_form_label.actions.index.SaveAttributesFieldsNameEnum.SCOPE',
314 228 }
315 229
316 230 // Save event
... ... @@ -319,7 +233,7 @@ export enum SaveEventFieldsEnum {
319 233 }
320 234
321 235 export enum SaveEventFieldsNameEnum {
322   - CONFIGURATION = t('designer_form_label.actions.index.SaveEventFieldsNameEnum.CONFIGURATION'),
  236 + CONFIGURATION = 'designer_form_label.actions.index.SaveEventFieldsNameEnum.CONFIGURATION',
323 237 }
324 238
325 239 // Save timeseries
... ... @@ -330,11 +244,9 @@ export enum SaveTimeseriesFieldsEnum {
330 244 }
331 245
332 246 export enum SaveTimeseriesFieldsNameEnum {
333   - DEFAULT_TTL = t('designer_form_label.actions.index.SaveTimeseriesFieldsNameEnum.DEFAULT_TTL'),
334   - SKIP_LATEST_PERSISTENCE = t(
335   - 'designer_form_label.actions.index.SaveTimeseriesFieldsNameEnum.SKIP_LATEST_PERSISTENCE'
336   - ),
337   - USE_SERVER_TS = t('designer_form_label.actions.index.SaveTimeseriesFieldsNameEnum.USE_SERVER_TS'),
  247 + DEFAULT_TTL = 'designer_form_label.actions.index.SaveTimeseriesFieldsNameEnum.DEFAULT_TTL',
  248 + SKIP_LATEST_PERSISTENCE = 'designer_form_label.actions.index.SaveTimeseriesFieldsNameEnum.SKIP_LATEST_PERSISTENCE',
  249 + USE_SERVER_TS = 'designer_form_label.actions.index.SaveTimeseriesFieldsNameEnum.USE_SERVER_TS',
338 250 }
339 251
340 252 // save to custom table
... ... @@ -344,10 +256,8 @@ export enum SaveToCustomTableFieldsEnum {
344 256 }
345 257
346 258 export enum SaveToCustomTableFieldsNameEnum {
347   - FIELDS_MAPPING = t(
348   - 'designer_form_label.actions.index.SaveToCustomTableFieldsNameEnum.FIELDS_MAPPING'
349   - ),
350   - TABLE_NAME = t('designer_form_label.actions.index.SaveToCustomTableFieldsNameEnum.TABLE_NAME'),
  259 + FIELDS_MAPPING = 'designer_form_label.actions.index.SaveToCustomTableFieldsNameEnum.FIELDS_MAPPING',
  260 + TABLE_NAME = 'designer_form_label.actions.index.SaveToCustomTableFieldsNameEnum.TABLE_NAME',
351 261 }
352 262
353 263 // Unassign from customer
... ... @@ -357,10 +267,6 @@ export enum UnassignFromCustomerFieldsEnum {
357 267 }
358 268
359 269 export enum UnassignFromCustomerFieldsNameEnum {
360   - CUSTOMER_NAME_PATTERN = t(
361   - 'designer_form_label.actions.index.UnassignFromCustomerFieldsNameEnum.CUSTOMER_NAME_PATTERN'
362   - ),
363   - CUSTOMER_CACHE_EXPIRATION = t(
364   - 'designer_form_label.actions.index.UnassignFromCustomerFieldsNameEnum.CUSTOMER_CACHE_EXPIRATION'
365   - ),
  270 + CUSTOMER_NAME_PATTERN = 'designer_form_label.actions.index.UnassignFromCustomerFieldsNameEnum.CUSTOMER_NAME_PATTERN',
  271 + CUSTOMER_CACHE_EXPIRATION = 'designer_form_label.actions.index.UnassignFromCustomerFieldsNameEnum.CUSTOMER_CACHE_EXPIRATION',
366 272 }
... ...
1   -import { useI18n } from '/@/hooks/web/useI18n';
2   -
3   -const { t } = useI18n() as any; //加载国际化
4   -
5 1 export enum CommonFieldsEnum {
6 2 NAME = 'name',
7 3 DESCRIPTION = 'description',
... ... @@ -9,9 +5,9 @@ export enum CommonFieldsEnum {
9 5 }
10 6
11 7 export enum CommonFieldsNameEnum {
12   - NAME = t('designer_form_label.common.index.CommonFieldsNameEnum.NAME'),
13   - DESCRIPTION = t('designer_form_label.common.index.CommonFieldsNameEnum.DESCRIPTION'),
14   - DEBUG_MODE = t('designer_form_label.common.index.CommonFieldsNameEnum.DEBUG_MODE'),
  8 + NAME = 'designer_form_label.common.index.CommonFieldsNameEnum.NAME',
  9 + DESCRIPTION = 'designer_form_label.common.index.CommonFieldsNameEnum.DESCRIPTION',
  10 + DEBUG_MODE = 'designer_form_label.common.index.CommonFieldsNameEnum.DEBUG_MODE',
15 11 }
16 12
17 13 export const CommonFields = { ...CommonFieldsEnum };
... ...
1   -import { useI18n } from '/@/hooks/web/useI18n';
2   -
3   -const { t } = useI18n() as any; //加载国际化
4   -
5 1 // Enrichment Calculate delta
6 2 export enum CalculateDeltaFieldsEnum {
7 3 INPUT_VALUE_KEY = 'inputValueKey',
... ... @@ -14,23 +10,13 @@ export enum CalculateDeltaFieldsEnum {
14 10 }
15 11
16 12 export enum CalculateDeltaFieldsNameEnum {
17   - INPUT_VALUE_KEY = t(
18   - 'designer_form_label.enrichments.index.CalculateDeltaFieldsNameEnum.INPUT_VALUE_KEY'
19   - ),
20   - OUTPUT_VALUE_KEY = t(
21   - 'designer_form_label.enrichments.index.CalculateDeltaFieldsNameEnum.OUTPUT_VALUE_KEY'
22   - ),
23   - ROUND = t('designer_form_label.enrichments.index.CalculateDeltaFieldsNameEnum.ROUND'),
24   - USE_CACHE = t('designer_form_label.enrichments.index.CalculateDeltaFieldsNameEnum.USE_CACHE'),
25   - TELL_FAILURE_IF_DELTA_IS_NEGATIVE = t(
26   - 'designer_form_label.enrichments.index.CalculateDeltaFieldsNameEnum.TELL_FAILURE_IF_DELTA_IS_NEGATIVE'
27   - ),
28   - ADD_PERIOD_BETWEEN_MSGS = t(
29   - 'designer_form_label.enrichments.index.CalculateDeltaFieldsNameEnum.ADD_PERIOD_BETWEEN_MSGS'
30   - ),
31   - PERIOD_VALUE_KEY = t(
32   - 'designer_form_label.enrichments.index.CalculateDeltaFieldsNameEnum.PERIOD_VALUE_KEY'
33   - ),
  13 + INPUT_VALUE_KEY = 'designer_form_label.enrichments.index.CalculateDeltaFieldsNameEnum.INPUT_VALUE_KEY',
  14 + OUTPUT_VALUE_KEY = 'designer_form_label.enrichments.index.CalculateDeltaFieldsNameEnum.OUTPUT_VALUE_KEY',
  15 + ROUND = 'designer_form_label.enrichments.index.CalculateDeltaFieldsNameEnum.ROUND',
  16 + USE_CACHE = 'designer_form_label.enrichments.index.CalculateDeltaFieldsNameEnum.USE_CACHE',
  17 + TELL_FAILURE_IF_DELTA_IS_NEGATIVE = 'designer_form_label.enrichments.index.CalculateDeltaFieldsNameEnum.TELL_FAILURE_IF_DELTA_IS_NEGATIVE',
  18 + ADD_PERIOD_BETWEEN_MSGS = 'designer_form_label.enrichments.index.CalculateDeltaFieldsNameEnum.ADD_PERIOD_BETWEEN_MSGS',
  19 + PERIOD_VALUE_KEY = 'designer_form_label.enrichments.index.CalculateDeltaFieldsNameEnum.PERIOD_VALUE_KEY',
34 20 }
35 21
36 22 // Enrichment Customer Attributes
... ... @@ -40,10 +26,8 @@ export enum CustomerAttributesFieldsEnum {
40 26 }
41 27
42 28 export enum CustomerAttributesFieldsNameEnum {
43   - ATTR_MAPING = t(
44   - 'designer_form_label.enrichments.index.CustomerAttributesFieldsNameEnum.ATTR_MAPING'
45   - ),
46   - TELEMETRY = t('designer_form_label.enrichments.index.CustomerAttributesFieldsNameEnum.TELEMETRY'),
  29 + ATTR_MAPING = 'designer_form_label.enrichments.index.CustomerAttributesFieldsNameEnum.ATTR_MAPING',
  30 + TELEMETRY = 'designer_form_label.enrichments.index.CustomerAttributesFieldsNameEnum.TELEMETRY',
47 31 }
48 32
49 33 // Enrichment Customer details
... ... @@ -53,12 +37,8 @@ export enum CustomerDetailsFieldsEnum {
53 37 }
54 38
55 39 export enum CustomerDetailsFieldsNameEnum {
56   - DETAILS_LIST = t(
57   - 'designer_form_label.enrichments.index.CustomerDetailsFieldsNameEnum.DETAILS_LIST'
58   - ),
59   - ADD_TO_METADATA = t(
60   - 'designer_form_label.enrichments.index.CustomerDetailsFieldsNameEnum.ADD_TO_METADATA'
61   - ),
  40 + DETAILS_LIST = 'designer_form_label.enrichments.index.CustomerDetailsFieldsNameEnum.DETAILS_LIST',
  41 + ADD_TO_METADATA = 'designer_form_label.enrichments.index.CustomerDetailsFieldsNameEnum.ADD_TO_METADATA',
62 42 }
63 43
64 44 // Enrichment Originator attributes
... ... @@ -72,24 +52,12 @@ export enum OriginatorAttributesEnum {
72 52 }
73 53
74 54 export enum OriginatorAttributesNameEnum {
75   - TELL_FAILURE_IF_ABSENT = t(
76   - 'designer_form_label.enrichments.index.OriginatorAttributesNameEnum.TELL_FAILURE_IF_ABSENT'
77   - ),
78   - CLIENT_ATTRIBUTE_NAMES = t(
79   - 'designer_form_label.enrichments.index.OriginatorAttributesNameEnum.CLIENT_ATTRIBUTE_NAMES'
80   - ),
81   - SHARED_ATTRIBUTE_NAMES = t(
82   - 'designer_form_label.enrichments.index.OriginatorAttributesNameEnum.SHARED_ATTRIBUTE_NAMES'
83   - ),
84   - SERVER_ATTRIBUTE_NAMES = t(
85   - 'designer_form_label.enrichments.index.OriginatorAttributesNameEnum.SERVER_ATTRIBUTE_NAMES'
86   - ),
87   - LATEST_TS_KEY_NAMES = t(
88   - 'designer_form_label.enrichments.index.OriginatorAttributesNameEnum.LATEST_TS_KEY_NAMES'
89   - ),
90   - GET_LATEST_VALUE_WITH_TS = t(
91   - 'designer_form_label.enrichments.index.OriginatorAttributesNameEnum.GET_LATEST_VALUE_WITH_TS'
92   - ),
  55 + TELL_FAILURE_IF_ABSENT = 'designer_form_label.enrichments.index.OriginatorAttributesNameEnum.TELL_FAILURE_IF_ABSENT',
  56 + CLIENT_ATTRIBUTE_NAMES = 'designer_form_label.enrichments.index.OriginatorAttributesNameEnum.CLIENT_ATTRIBUTE_NAMES',
  57 + SHARED_ATTRIBUTE_NAMES = 'designer_form_label.enrichments.index.OriginatorAttributesNameEnum.SHARED_ATTRIBUTE_NAMES',
  58 + SERVER_ATTRIBUTE_NAMES = 'designer_form_label.enrichments.index.OriginatorAttributesNameEnum.SERVER_ATTRIBUTE_NAMES',
  59 + LATEST_TS_KEY_NAMES = 'designer_form_label.enrichments.index.OriginatorAttributesNameEnum.LATEST_TS_KEY_NAMES',
  60 + GET_LATEST_VALUE_WITH_TS = 'designer_form_label.enrichments.index.OriginatorAttributesNameEnum.GET_LATEST_VALUE_WITH_TS',
93 61 }
94 62
95 63 // Enrichment Originator Fields
... ... @@ -98,9 +66,7 @@ export enum OriginatorFieldsEnum {
98 66 }
99 67
100 68 export enum OriginatorFieldsNameEnum {
101   - FIELDS_MAPPING = t(
102   - 'designer_form_label.enrichments.index.OriginatorFieldsNameEnum.FIELDS_MAPPING'
103   - ),
  69 + FIELDS_MAPPING = 'designer_form_label.enrichments.index.OriginatorFieldsNameEnum.FIELDS_MAPPING',
104 70 }
105 71
106 72 // Enrichment originator telemetry
... ... @@ -120,38 +86,18 @@ export enum OriginatorTelemetryFieldsEnum {
120 86 }
121 87
122 88 export enum OriginatorTelemetryFieldsNameEnum {
123   - LATEST_TS_KEY_NAMES = t(
124   - 'designer_form_label.enrichments.index.OriginatorTelemetryFieldsNameEnum.LATEST_TS_KEY_NAMES'
125   - ),
126   - AGGREGATION = t(
127   - 'designer_form_label.enrichments.index.OriginatorTelemetryFieldsNameEnum.AGGREGATION'
128   - ),
129   - FETCH_MODE = t(
130   - 'designer_form_label.enrichments.index.OriginatorTelemetryFieldsNameEnum.FETCH_MODE'
131   - ),
132   - ORDER_BY = t('designer_form_label.enrichments.index.OriginatorTelemetryFieldsNameEnum.ORDER_BY'),
133   - LIMIT = t('designer_form_label.enrichments.index.OriginatorTelemetryFieldsNameEnum.LIMIT'),
134   - USE_METADATA_INTERVAL_PATTERNS = t(
135   - 'designer_form_label.enrichments.index.OriginatorTelemetryFieldsNameEnum.USE_METADATA_INTERVAL_PATTERNS'
136   - ),
137   - START_INTERVAL = t(
138   - 'designer_form_label.enrichments.index.OriginatorTelemetryFieldsNameEnum.START_INTERVAL'
139   - ),
140   - START_INTERVAL_TIME_UNIT = t(
141   - 'designer_form_label.enrichments.index.OriginatorTelemetryFieldsNameEnum.START_INTERVAL_TIME_UNIT'
142   - ),
143   - END_INTERVAL = t(
144   - 'designer_form_label.enrichments.index.OriginatorTelemetryFieldsNameEnum.END_INTERVAL'
145   - ),
146   - END_INTERVAL_TIME_UNIT = t(
147   - 'designer_form_label.enrichments.index.OriginatorTelemetryFieldsNameEnum.END_INTERVAL_TIME_UNIT'
148   - ),
149   - START_INTERVAL_PATTERN = t(
150   - 'designer_form_label.enrichments.index.OriginatorTelemetryFieldsNameEnum.START_INTERVAL_PATTERN'
151   - ),
152   - END_INTERVAL_PATTERN = t(
153   - 'designer_form_label.enrichments.index.OriginatorTelemetryFieldsNameEnum.END_INTERVAL_PATTERN'
154   - ),
  89 + LATEST_TS_KEY_NAMES = 'designer_form_label.enrichments.index.OriginatorTelemetryFieldsNameEnum.LATEST_TS_KEY_NAMES',
  90 + AGGREGATION = 'designer_form_label.enrichments.index.OriginatorTelemetryFieldsNameEnum.AGGREGATION',
  91 + FETCH_MODE = 'designer_form_label.enrichments.index.OriginatorTelemetryFieldsNameEnum.FETCH_MODE',
  92 + ORDER_BY = 'designer_form_label.enrichments.index.OriginatorTelemetryFieldsNameEnum.ORDER_BY',
  93 + LIMIT = 'designer_form_label.enrichments.index.OriginatorTelemetryFieldsNameEnum.LIMIT',
  94 + USE_METADATA_INTERVAL_PATTERNS = 'designer_form_label.enrichments.index.OriginatorTelemetryFieldsNameEnum.USE_METADATA_INTERVAL_PATTERNS',
  95 + START_INTERVAL = 'designer_form_label.enrichments.index.OriginatorTelemetryFieldsNameEnum.START_INTERVAL',
  96 + START_INTERVAL_TIME_UNIT = 'designer_form_label.enrichments.index.OriginatorTelemetryFieldsNameEnum.START_INTERVAL_TIME_UNIT',
  97 + END_INTERVAL = 'designer_form_label.enrichments.index.OriginatorTelemetryFieldsNameEnum.END_INTERVAL',
  98 + END_INTERVAL_TIME_UNIT = 'designer_form_label.enrichments.index.OriginatorTelemetryFieldsNameEnum.END_INTERVAL_TIME_UNIT',
  99 + START_INTERVAL_PATTERN = 'designer_form_label.enrichments.index.OriginatorTelemetryFieldsNameEnum.START_INTERVAL_PATTERN',
  100 + END_INTERVAL_PATTERN = 'designer_form_label.enrichments.index.OriginatorTelemetryFieldsNameEnum.END_INTERVAL_PATTERN',
155 101 }
156 102
157 103 // Enrichment Related attributes
... ... @@ -162,13 +108,9 @@ export enum RelatedAttributesFieldsEnum {
162 108 }
163 109
164 110 export enum RelatedAttributesFieldsNameEnum {
165   - RELATIONS_QUERY = t(
166   - 'designer_form_label.enrichments.index.RelatedAttributesFieldsNameEnum.RELATIONS_QUERY'
167   - ),
168   - ATTR_MAPPING = t(
169   - 'designer_form_label.enrichments.index.RelatedAttributesFieldsNameEnum.ATTR_MAPPING'
170   - ),
171   - TELEMETRY = t('designer_form_label.enrichments.index.RelatedAttributesFieldsNameEnum.TELEMETRY'),
  111 + RELATIONS_QUERY = 'designer_form_label.enrichments.index.RelatedAttributesFieldsNameEnum.RELATIONS_QUERY',
  112 + ATTR_MAPPING = 'designer_form_label.enrichments.index.RelatedAttributesFieldsNameEnum.ATTR_MAPPING',
  113 + TELEMETRY = 'designer_form_label.enrichments.index.RelatedAttributesFieldsNameEnum.TELEMETRY',
172 114 }
173 115
174 116 // Enrichment Related device Attributes
... ... @@ -190,44 +132,20 @@ export enum RelatedDeviceAttributeFieldsEnum {
190 132 }
191 133
192 134 export enum RelatedDeviceAttributeFieldsNameEnum {
193   - DEVICE_RELATIONS_QUERY = t(
194   - 'designer_form_label.enrichments.index.RelatedDeviceAttributeFieldsNameEnum.DEVICE_RELATIONS_QUERY'
195   - ),
196   - TELL_FAILURE_IF_ABSENT = t(
197   - 'designer_form_label.enrichments.index.RelatedDeviceAttributeFieldsNameEnum.TELL_FAILURE_IF_ABSENT'
198   - ),
199   - CLIENT_ATTRIBUTE_NAMES = t(
200   - 'designer_form_label.enrichments.index.RelatedDeviceAttributeFieldsNameEnum.CLIENT_ATTRIBUTE_NAMES'
201   - ),
202   - SHARED_ATTRIBUTE_NAMES = t(
203   - 'designer_form_label.enrichments.index.RelatedDeviceAttributeFieldsNameEnum.SHARED_ATTRIBUTE_NAMES'
204   - ),
205   - SERVER_ATTRIBUTE_NAMES = t(
206   - 'designer_form_label.enrichments.index.RelatedDeviceAttributeFieldsNameEnum.SERVER_ATTRIBUTE_NAMES'
207   - ),
208   - LATEST_TS_KEY_NAMES = t(
209   - 'designer_form_label.enrichments.index.RelatedDeviceAttributeFieldsNameEnum.LATEST_TS_KEY_NAMES'
210   - ),
211   - GET_LATEST_VALUE_WITH_TS = t(
212   - 'designer_form_label.enrichments.index.RelatedDeviceAttributeFieldsNameEnum.GET_LATEST_VALUE_WITH_TS'
213   - ),
214   - FETCH_LAST_LEVEL_ONLY = t(
215   - 'designer_form_label.enrichments.index.RelatedDeviceAttributeFieldsNameEnum.FETCH_LAST_LEVEL_ONLY'
216   - ),
  135 + DEVICE_RELATIONS_QUERY = 'designer_form_label.enrichments.index.RelatedDeviceAttributeFieldsNameEnum.DEVICE_RELATIONS_QUERY',
  136 + TELL_FAILURE_IF_ABSENT = 'designer_form_label.enrichments.index.RelatedDeviceAttributeFieldsNameEnum.TELL_FAILURE_IF_ABSENT',
  137 + CLIENT_ATTRIBUTE_NAMES = 'designer_form_label.enrichments.index.RelatedDeviceAttributeFieldsNameEnum.CLIENT_ATTRIBUTE_NAMES',
  138 + SHARED_ATTRIBUTE_NAMES = 'designer_form_label.enrichments.index.RelatedDeviceAttributeFieldsNameEnum.SHARED_ATTRIBUTE_NAMES',
  139 + SERVER_ATTRIBUTE_NAMES = 'designer_form_label.enrichments.index.RelatedDeviceAttributeFieldsNameEnum.SERVER_ATTRIBUTE_NAMES',
  140 + LATEST_TS_KEY_NAMES = 'designer_form_label.enrichments.index.RelatedDeviceAttributeFieldsNameEnum.LATEST_TS_KEY_NAMES',
  141 + GET_LATEST_VALUE_WITH_TS = 'designer_form_label.enrichments.index.RelatedDeviceAttributeFieldsNameEnum.GET_LATEST_VALUE_WITH_TS',
  142 + FETCH_LAST_LEVEL_ONLY = 'designer_form_label.enrichments.index.RelatedDeviceAttributeFieldsNameEnum.FETCH_LAST_LEVEL_ONLY',
217 143
218 144 // DEVICE_RELATIONS_QUERY
219   - DIRECTION = t(
220   - 'designer_form_label.enrichments.index.RelatedDeviceAttributeFieldsNameEnum.DIRECTION'
221   - ),
222   - MAX_LEVEL = t(
223   - 'designer_form_label.enrichments.index.RelatedDeviceAttributeFieldsNameEnum.MAX_LEVEL'
224   - ),
225   - RELATION_TYPE = t(
226   - 'designer_form_label.enrichments.index.RelatedDeviceAttributeFieldsNameEnum.RELATION_TYPE'
227   - ),
228   - DEVICE_TYPES = t(
229   - 'designer_form_label.enrichments.index.RelatedDeviceAttributeFieldsNameEnum.DEVICE_TYPES'
230   - ),
  145 + DIRECTION = 'designer_form_label.enrichments.index.RelatedDeviceAttributeFieldsNameEnum.DIRECTION',
  146 + MAX_LEVEL = 'designer_form_label.enrichments.index.RelatedDeviceAttributeFieldsNameEnum.MAX_LEVEL',
  147 + RELATION_TYPE = 'designer_form_label.enrichments.index.RelatedDeviceAttributeFieldsNameEnum.RELATION_TYPE',
  148 + DEVICE_TYPES = 'designer_form_label.enrichments.index.RelatedDeviceAttributeFieldsNameEnum.DEVICE_TYPES',
231 149 }
232 150
233 151 // Tenant attributes
... ... @@ -237,10 +155,8 @@ export enum TenantAttributesFieldsEnum {
237 155 }
238 156
239 157 export enum TenantAttributesFieldsNameEnum {
240   - ATTR_MAPING = t(
241   - 'designer_form_label.enrichments.index.TenantAttributesFieldsNameEnum.ATTR_MAPING'
242   - ),
243   - TELEMETRY = t('designer_form_label.enrichments.index.TenantAttributesFieldsNameEnum.TELEMETRY'),
  158 + ATTR_MAPING = 'designer_form_label.enrichments.index.TenantAttributesFieldsNameEnum.ATTR_MAPING',
  159 + TELEMETRY = 'designer_form_label.enrichments.index.TenantAttributesFieldsNameEnum.TELEMETRY',
244 160 }
245 161
246 162 // Enrichment Tenant details
... ... @@ -250,10 +166,6 @@ export enum TenantDetailsFieldsEnum {
250 166 }
251 167
252 168 export enum TenantDetailsFieldsNameEnum {
253   - DETAILS_LIST = t(
254   - 'designer_form_label.enrichments.index.TenantDetailsFieldsNameEnum.DETAILS_LIST'
255   - ),
256   - ADD_TO_METADATA = t(
257   - 'designer_form_label.enrichments.index.TenantDetailsFieldsNameEnum.ADD_TO_METADATA'
258   - ),
  169 + DETAILS_LIST = 'designer_form_label.enrichments.index.TenantDetailsFieldsNameEnum.DETAILS_LIST',
  170 + ADD_TO_METADATA = 'designer_form_label.enrichments.index.TenantDetailsFieldsNameEnum.ADD_TO_METADATA',
259 171 }
... ...
1   -import { useI18n } from '/@/hooks/web/useI18n';
2   -
3   -const { t } = useI18n() as any; //加载国际化
4   -
5 1 // Alarm notice
6 2 export enum AlarmNoticeFieldsEnum {
7 3 CONFIGURATION = 'CONFIGURATION',
8 4 }
9 5
10 6 export enum AlarmNoticeFieldsNameEnum {
11   - CONFIGURATION = t('designer_form_label.externals.index.AlarmNoticeFieldsNameEnum.CONFIGURATION'),
  7 + CONFIGURATION = 'designer_form_label.externals.index.AlarmNoticeFieldsNameEnum.CONFIGURATION',
12 8 }
13 9
14 10 // aws sns
... ... @@ -20,14 +16,10 @@ export enum AwsSnsFieldsEnum {
20 16 }
21 17
22 18 export enum AwsSnsFieldsNameEnum {
23   - TOPIC_ARN_PATTERN = t(
24   - 'designer_form_label.externals.index.AwsSnsFieldsNameEnum.TOPIC_ARN_PATTERN'
25   - ),
26   - ACCESS_KEY_ID = t('designer_form_label.externals.index.AwsSnsFieldsNameEnum.ACCESS_KEY_ID'),
27   - SECRET_ACCESS_KEY = t(
28   - 'designer_form_label.externals.index.AwsSnsFieldsNameEnum.SECRET_ACCESS_KEY'
29   - ),
30   - REGION = t('designer_form_label.externals.index.AwsSnsFieldsNameEnum.REGION'),
  19 + TOPIC_ARN_PATTERN = 'designer_form_label.externals.index.AwsSnsFieldsNameEnum.TOPIC_ARN_PATTERN',
  20 + ACCESS_KEY_ID = 'designer_form_label.externals.index.AwsSnsFieldsNameEnum.ACCESS_KEY_ID',
  21 + SECRET_ACCESS_KEY = 'designer_form_label.externals.index.AwsSnsFieldsNameEnum.SECRET_ACCESS_KEY',
  22 + REGION = 'designer_form_label.externals.index.AwsSnsFieldsNameEnum.REGION',
31 23 }
32 24
33 25 // Aws sqs
... ... @@ -42,19 +34,13 @@ export enum AwsSqsFieldsEnum {
42 34 }
43 35
44 36 export enum AwsSqsFieldsNameEnum {
45   - QUEUE_TYPE = t('designer_form_label.externals.index.AwsSqsFieldsNameEnum.QUEUE_TYPE'),
46   - QUEUE_URL_PATTERN = t(
47   - 'designer_form_label.externals.index.AwsSqsFieldsNameEnum.QUEUE_URL_PATTERN'
48   - ),
49   - DELAY_SECONDS = t('designer_form_label.externals.index.AwsSqsFieldsNameEnum.DELAY_SECONDS'),
50   - MESSAGE_ATTRIBUTES = t(
51   - 'designer_form_label.externals.index.AwsSqsFieldsNameEnum.MESSAGE_ATTRIBUTES'
52   - ),
53   - ACCESS_KEY_ID = t('designer_form_label.externals.index.AwsSqsFieldsNameEnum.ACCESS_KEY_ID'),
54   - SECRET_ACCESS_KEY = t(
55   - 'designer_form_label.externals.index.AwsSqsFieldsNameEnum.SECRET_ACCESS_KEY'
56   - ),
57   - REGION = t('designer_form_label.externals.index.AwsSqsFieldsNameEnum.REGION'),
  37 + QUEUE_TYPE = 'designer_form_label.externals.index.AwsSqsFieldsNameEnum.QUEUE_TYPE',
  38 + QUEUE_URL_PATTERN = 'designer_form_label.externals.index.AwsSqsFieldsNameEnum.QUEUE_URL_PATTERN',
  39 + DELAY_SECONDS = 'designer_form_label.externals.index.AwsSqsFieldsNameEnum.DELAY_SECONDS',
  40 + MESSAGE_ATTRIBUTES = 'designer_form_label.externals.index.AwsSqsFieldsNameEnum.MESSAGE_ATTRIBUTES',
  41 + ACCESS_KEY_ID = 'designer_form_label.externals.index.AwsSqsFieldsNameEnum.ACCESS_KEY_ID',
  42 + SECRET_ACCESS_KEY = 'designer_form_label.externals.index.AwsSqsFieldsNameEnum.SECRET_ACCESS_KEY',
  43 + REGION = 'designer_form_label.externals.index.AwsSqsFieldsNameEnum.REGION',
58 44 }
59 45
60 46 // Azure iot hub
... ... @@ -80,32 +66,24 @@ export enum AzureIotHubFieldsEnum {
80 66 }
81 67
82 68 export enum AzureIotHubFieldsNameEnum {
83   - TOPIC_PATTERN = t('designer_form_label.externals.index.AzureIotHubFieldsNameEnum.TOPIC_PATTERN'),
84   - HOST = t('designer_form_label.externals.index.AzureIotHubFieldsNameEnum.HOST'),
85   - PORT = t('designer_form_label.externals.index.AzureIotHubFieldsNameEnum.PORT'),
86   - CONNECT_TIMEOUT_SEC = t(
87   - 'designer_form_label.externals.index.AzureIotHubFieldsNameEnum.CONNECT_TIMEOUT_SEC'
88   - ),
89   - CLIENT_ID = t('designer_form_label.externals.index.AzureIotHubFieldsNameEnum.CLIENT_ID'),
90   - CLEAN_SESSION = t('designer_form_label.externals.index.AzureIotHubFieldsNameEnum.CLEAN_SESSION'),
91   - SSL = t('designer_form_label.externals.index.AzureIotHubFieldsNameEnum.SSL'),
92   - CREDENTIALS = t('designer_form_label.externals.index.AzureIotHubFieldsNameEnum.CREDENTIALS'),
  69 + TOPIC_PATTERN = 'designer_form_label.externals.index.AzureIotHubFieldsNameEnum.TOPIC_PATTERN',
  70 + HOST = 'designer_form_label.externals.index.AzureIotHubFieldsNameEnum.HOST',
  71 + PORT = 'designer_form_label.externals.index.AzureIotHubFieldsNameEnum.PORT',
  72 + CONNECT_TIMEOUT_SEC = 'designer_form_label.externals.index.AzureIotHubFieldsNameEnum.CONNECT_TIMEOUT_SEC',
  73 + CLIENT_ID = 'designer_form_label.externals.index.AzureIotHubFieldsNameEnum.CLIENT_ID',
  74 + CLEAN_SESSION = 'designer_form_label.externals.index.AzureIotHubFieldsNameEnum.CLEAN_SESSION',
  75 + SSL = 'designer_form_label.externals.index.AzureIotHubFieldsNameEnum.SSL',
  76 + CREDENTIALS = 'designer_form_label.externals.index.AzureIotHubFieldsNameEnum.CREDENTIALS',
93 77
94   - TYPE = t('designer_form_label.externals.index.AzureIotHubFieldsNameEnum.TYPE'),
95   - SAS_KEY = t('designer_form_label.externals.index.AzureIotHubFieldsNameEnum.SAS_KEY'),
96   - CA_CERT = t('designer_form_label.externals.index.AzureIotHubFieldsNameEnum.CA_CERT'),
97   - CA_CERT_FILE_NAME = t(
98   - 'designer_form_label.externals.index.AzureIotHubFieldsNameEnum.CA_CERT_FILE_NAME'
99   - ),
100   - PRIVATE_KEY = t('designer_form_label.externals.index.AzureIotHubFieldsNameEnum.PRIVATE_KEY'),
101   - PRIVATE_KEY_FILE_NAME = t(
102   - 'designer_form_label.externals.index.AzureIotHubFieldsNameEnum.PRIVATE_KEY_FILE_NAME'
103   - ),
104   - CERT = t('designer_form_label.externals.index.AzureIotHubFieldsNameEnum.CERT'),
105   - CERT_FILE_NAME = t(
106   - 'designer_form_label.externals.index.AzureIotHubFieldsNameEnum.CERT_FILE_NAME'
107   - ),
108   - PASSWORD = t('designer_form_label.externals.index.AzureIotHubFieldsNameEnum.PASSWORD'),
  78 + TYPE = 'designer_form_label.externals.index.AzureIotHubFieldsNameEnum.TYPE',
  79 + SAS_KEY = 'designer_form_label.externals.index.AzureIotHubFieldsNameEnum.SAS_KEY',
  80 + CA_CERT = 'designer_form_label.externals.index.AzureIotHubFieldsNameEnum.CA_CERT',
  81 + CA_CERT_FILE_NAME = 'designer_form_label.externals.index.AzureIotHubFieldsNameEnum.CA_CERT_FILE_NAME',
  82 + PRIVATE_KEY = 'designer_form_label.externals.index.AzureIotHubFieldsNameEnum.PRIVATE_KEY',
  83 + PRIVATE_KEY_FILE_NAME = 'designer_form_label.externals.index.AzureIotHubFieldsNameEnum.PRIVATE_KEY_FILE_NAME',
  84 + CERT = 'designer_form_label.externals.index.AzureIotHubFieldsNameEnum.CERT',
  85 + CERT_FILE_NAME = 'designer_form_label.externals.index.AzureIotHubFieldsNameEnum.CERT_FILE_NAME',
  86 + PASSWORD = 'designer_form_label.externals.index.AzureIotHubFieldsNameEnum.PASSWORD',
109 87 }
110 88
111 89 // GCP pubsub
... ... @@ -118,17 +96,11 @@ export enum GcpPubsubFieldsEnum {
118 96 }
119 97
120 98 export enum GcpPubsubFieldsNameEnum {
121   - PROJECT_ID = t('designer_form_label.externals.index.GcpPubsubFieldsNameEnum.PROJECT_ID'),
122   - TOPIC_NAME = t('designer_form_label.externals.index.GcpPubsubFieldsNameEnum.TOPIC_NAME'),
123   - SERVICE_ACCOUNT_KEY = t(
124   - 'designer_form_label.externals.index.GcpPubsubFieldsNameEnum.SERVICE_ACCOUNT_KEY'
125   - ),
126   - SERVICE_ACCOUNT_KEY_FILE_NAME = t(
127   - 'designer_form_label.externals.index.GcpPubsubFieldsNameEnum.SERVICE_ACCOUNT_KEY_FILE_NAME'
128   - ),
129   - MESSAGE_ATTRIBUTES = t(
130   - 'designer_form_label.externals.index.GcpPubsubFieldsNameEnum.MESSAGE_ATTRIBUTES'
131   - ),
  99 + PROJECT_ID = 'designer_form_label.externals.index.GcpPubsubFieldsNameEnum.PROJECT_ID',
  100 + TOPIC_NAME = 'designer_form_label.externals.index.GcpPubsubFieldsNameEnum.TOPIC_NAME',
  101 + SERVICE_ACCOUNT_KEY = 'designer_form_label.externals.index.GcpPubsubFieldsNameEnum.SERVICE_ACCOUNT_KEY',
  102 + SERVICE_ACCOUNT_KEY_FILE_NAME = 'designer_form_label.externals.index.GcpPubsubFieldsNameEnum.SERVICE_ACCOUNT_KEY_FILE_NAME',
  103 + MESSAGE_ATTRIBUTES = 'designer_form_label.externals.index.GcpPubsubFieldsNameEnum.MESSAGE_ATTRIBUTES',
132 104 }
133 105
134 106 // Kafka
... ... @@ -148,24 +120,18 @@ export enum KafkaFieldsEnum {
148 120 }
149 121
150 122 export enum KafkaFieldsNameEnum {
151   - TOPIC_PATTERN = t('designer_form_label.externals.index.KafkaFieldsNameEnum.TOPIC_PATTERN'),
152   - BOOTSTRAP_SERVERS = t(
153   - 'designer_form_label.externals.index.KafkaFieldsNameEnum.BOOTSTRAP_SERVERS'
154   - ),
155   - RETRIES = t('designer_form_label.externals.index.KafkaFieldsNameEnum.RETRIES'),
156   - BATCH_SIZE = t('designer_form_label.externals.index.KafkaFieldsNameEnum.BATCH_SIZE'),
157   - LINGER = t('designer_form_label.externals.index.KafkaFieldsNameEnum.LINGER'),
158   - BUFFER_MEMORY = t('designer_form_label.externals.index.KafkaFieldsNameEnum.BUFFER_MEMORY'),
159   - ACKS = t('designer_form_label.externals.index.KafkaFieldsNameEnum.ACKS'),
160   - KEY_SERIALIZER = t('designer_form_label.externals.index.KafkaFieldsNameEnum.KEY_SERIALIZER'),
161   - VALUE_SERIALIZER = t('designer_form_label.externals.index.KafkaFieldsNameEnum.VALUE_SERIALIZER'),
162   - OTHER_PROPERTIES = t('designer_form_label.externals.index.KafkaFieldsNameEnum.OTHER_PROPERTIES'),
163   - ADD_METADATA_KEY_VALUES_AS_KAFKA_HEADERS = t(
164   - 'designer_form_label.externals.index.KafkaFieldsNameEnum.ADD_METADATA_KEY_VALUES_AS_KAFKA_HEADERS'
165   - ),
166   - KAFKA_HEADERS_CHARSET = t(
167   - 'designer_form_label.externals.index.KafkaFieldsNameEnum.KAFKA_HEADERS_CHARSET'
168   - ),
  123 + TOPIC_PATTERN = 'designer_form_label.externals.index.KafkaFieldsNameEnum.TOPIC_PATTERN',
  124 + BOOTSTRAP_SERVERS = 'designer_form_label.externals.index.KafkaFieldsNameEnum.BOOTSTRAP_SERVERS',
  125 + RETRIES = 'designer_form_label.externals.index.KafkaFieldsNameEnum.RETRIES',
  126 + BATCH_SIZE = 'designer_form_label.externals.index.KafkaFieldsNameEnum.BATCH_SIZE',
  127 + LINGER = 'designer_form_label.externals.index.KafkaFieldsNameEnum.LINGER',
  128 + BUFFER_MEMORY = 'designer_form_label.externals.index.KafkaFieldsNameEnum.BUFFER_MEMORY',
  129 + ACKS = 'designer_form_label.externals.index.KafkaFieldsNameEnum.ACKS',
  130 + KEY_SERIALIZER = 'designer_form_label.externals.index.KafkaFieldsNameEnum.KEY_SERIALIZER',
  131 + VALUE_SERIALIZER = 'designer_form_label.externals.index.KafkaFieldsNameEnum.VALUE_SERIALIZER',
  132 + OTHER_PROPERTIES = 'designer_form_label.externals.index.KafkaFieldsNameEnum.OTHER_PROPERTIES',
  133 + ADD_METADATA_KEY_VALUES_AS_KAFKA_HEADERS = 'designer_form_label.externals.index.KafkaFieldsNameEnum.ADD_METADATA_KEY_VALUES_AS_KAFKA_HEADERS',
  134 + KAFKA_HEADERS_CHARSET = 'designer_form_label.externals.index.KafkaFieldsNameEnum.KAFKA_HEADERS_CHARSET',
169 135 }
170 136
171 137 // Mqtt
... ... @@ -192,31 +158,25 @@ export enum MqttFieldsEnum {
192 158 }
193 159
194 160 export enum MqttFieldsNameEnum {
195   - TOPIC_PATTERN = t('designer_form_label.externals.index.MqttFieldsNameEnum.TOPIC_PATTERN'),
196   - HOST = t('designer_form_label.externals.index.MqttFieldsNameEnum.HOST'),
197   - PORT = t('designer_form_label.externals.index.MqttFieldsNameEnum.PORT'),
198   - CONNECT_TIMEOUT_SEC = t(
199   - 'designer_form_label.externals.index.MqttFieldsNameEnum.CONNECT_TIMEOUT_SEC'
200   - ),
201   - CLIENT_ID = t('designer_form_label.externals.index.MqttFieldsNameEnum.CLIENT_ID'),
202   - APPEND_CLIENT_ID_SUFFIX = t(
203   - 'designer_form_label.externals.index.MqttFieldsNameEnum.APPEND_CLIENT_ID_SUFFIX'
204   - ),
205   - CLEAN_SESSION = t('designer_form_label.externals.index.MqttFieldsNameEnum.CLEAN_SESSION'),
206   - SSL = t('designer_form_label.externals.index.MqttFieldsNameEnum.SSL'),
207   - CREDENTIALS = t('designer_form_label.externals.index.MqttFieldsNameEnum.CREDENTIALS'),
  161 + TOPIC_PATTERN = 'designer_form_label.externals.index.MqttFieldsNameEnum.TOPIC_PATTERN',
  162 + HOST = 'designer_form_label.externals.index.MqttFieldsNameEnum.HOST',
  163 + PORT = 'designer_form_label.externals.index.MqttFieldsNameEnum.PORT',
  164 + CONNECT_TIMEOUT_SEC = 'designer_form_label.externals.index.MqttFieldsNameEnum.CONNECT_TIMEOUT_SEC',
  165 + CLIENT_ID = 'designer_form_label.externals.index.MqttFieldsNameEnum.CLIENT_ID',
  166 + APPEND_CLIENT_ID_SUFFIX = 'designer_form_label.externals.index.MqttFieldsNameEnum.APPEND_CLIENT_ID_SUFFIX',
  167 + CLEAN_SESSION = 'designer_form_label.externals.index.MqttFieldsNameEnum.CLEAN_SESSION',
  168 + SSL = 'designer_form_label.externals.index.MqttFieldsNameEnum.SSL',
  169 + CREDENTIALS = 'designer_form_label.externals.index.MqttFieldsNameEnum.CREDENTIALS',
208 170
209   - TYPE = t('designer_form_label.externals.index.MqttFieldsNameEnum.TYPE'),
210   - PASSWORD = t('designer_form_label.externals.index.MqttFieldsNameEnum.PASSWORD'),
211   - CA_CERT = t('designer_form_label.externals.index.MqttFieldsNameEnum.CA_CERT'),
212   - CA_CERT_FILE_NAME = t('designer_form_label.externals.index.MqttFieldsNameEnum.CA_CERT_FILE_NAME'),
213   - PRIVATE_KEY = t('designer_form_label.externals.index.MqttFieldsNameEnum.PRIVATE_KEY'),
214   - PRIVATE_KEY_FILE_NAME = t(
215   - 'designer_form_label.externals.index.MqttFieldsNameEnum.PRIVATE_KEY_FILE_NAME'
216   - ),
217   - CERT = t('designer_form_label.externals.index.MqttFieldsNameEnum.CERT'),
218   - CERT_FILE_NAME = t('designer_form_label.externals.index.MqttFieldsNameEnum.CERT_FILE_NAME'),
219   - USERNAME = t('designer_form_label.externals.index.MqttFieldsNameEnum.USERNAME'),
  171 + TYPE = 'designer_form_label.externals.index.MqttFieldsNameEnum.TYPE',
  172 + PASSWORD = 'designer_form_label.externals.index.MqttFieldsNameEnum.PASSWORD',
  173 + CA_CERT = 'designer_form_label.externals.index.MqttFieldsNameEnum.CA_CERT',
  174 + CA_CERT_FILE_NAME = 'designer_form_label.externals.index.MqttFieldsNameEnum.CA_CERT_FILE_NAME',
  175 + PRIVATE_KEY = 'designer_form_label.externals.index.MqttFieldsNameEnum.PRIVATE_KEY',
  176 + PRIVATE_KEY_FILE_NAME = 'designer_form_label.externals.index.MqttFieldsNameEnum.PRIVATE_KEY_FILE_NAME',
  177 + CERT = 'designer_form_label.externals.index.MqttFieldsNameEnum.CERT',
  178 + CERT_FILE_NAME = 'designer_form_label.externals.index.MqttFieldsNameEnum.CERT_FILE_NAME',
  179 + USERNAME = 'designer_form_label.externals.index.MqttFieldsNameEnum.USERNAME',
220 180 }
221 181
222 182 // Rabbitmq
... ... @@ -236,32 +196,18 @@ export enum RabbitmqFieldsEnum {
236 196 }
237 197
238 198 export enum RabbitmqFieldsNameEnum {
239   - EXCHANGE_NAME_PATTERN = t(
240   - 'designer_form_label.externals.index.RabbitmqFieldsNameEnum.EXCHANGE_NAME_PATTERN'
241   - ),
242   - ROUTING_KEY_PATTERN = t(
243   - 'designer_form_label.externals.index.RabbitmqFieldsNameEnum.ROUTING_KEY_PATTERN'
244   - ),
245   - MESSAGE_PROPERTIES = t(
246   - 'designer_form_label.externals.index.RabbitmqFieldsNameEnum.MESSAGE_PROPERTIES'
247   - ),
248   - HOST = t('designer_form_label.externals.index.RabbitmqFieldsNameEnum.HOST'),
249   - PORT = t('designer_form_label.externals.index.RabbitmqFieldsNameEnum.PORT'),
250   - VIRTUAL_HOST = t('designer_form_label.externals.index.RabbitmqFieldsNameEnum.VIRTUAL_HOST'),
251   - USERNAME = t('designer_form_label.externals.index.RabbitmqFieldsNameEnum.USERNAME'),
252   - PASSWORD = t('designer_form_label.externals.index.RabbitmqFieldsNameEnum.PASSWORD'),
253   - AUTOMATIC_RECOVERY_ENABLED = t(
254   - 'designer_form_label.externals.index.RabbitmqFieldsNameEnum.AUTOMATIC_RECOVERY_ENABLED'
255   - ),
256   - CONNECTION_TIMEOUT = t(
257   - 'designer_form_label.externals.index.RabbitmqFieldsNameEnum.CONNECTION_TIMEOUT'
258   - ),
259   - HANDSHAKE_TIMEOUT = t(
260   - 'designer_form_label.externals.index.RabbitmqFieldsNameEnum.HANDSHAKE_TIMEOUT'
261   - ),
262   - CLIENT_PROPERTIES = t(
263   - 'designer_form_label.externals.index.RabbitmqFieldsNameEnum.CLIENT_PROPERTIES'
264   - ),
  199 + EXCHANGE_NAME_PATTERN = 'designer_form_label.externals.index.RabbitmqFieldsNameEnum.EXCHANGE_NAME_PATTERN',
  200 + ROUTING_KEY_PATTERN = 'designer_form_label.externals.index.RabbitmqFieldsNameEnum.ROUTING_KEY_PATTERN',
  201 + MESSAGE_PROPERTIES = 'designer_form_label.externals.index.RabbitmqFieldsNameEnum.MESSAGE_PROPERTIES',
  202 + HOST = 'designer_form_label.externals.index.RabbitmqFieldsNameEnum.HOST',
  203 + PORT = 'designer_form_label.externals.index.RabbitmqFieldsNameEnum.PORT',
  204 + VIRTUAL_HOST = 'designer_form_label.externals.index.RabbitmqFieldsNameEnum.VIRTUAL_HOST',
  205 + USERNAME = 'designer_form_label.externals.index.RabbitmqFieldsNameEnum.USERNAME',
  206 + PASSWORD = 'designer_form_label.externals.index.RabbitmqFieldsNameEnum.PASSWORD',
  207 + AUTOMATIC_RECOVERY_ENABLED = 'designer_form_label.externals.index.RabbitmqFieldsNameEnum.AUTOMATIC_RECOVERY_ENABLED',
  208 + CONNECTION_TIMEOUT = 'designer_form_label.externals.index.RabbitmqFieldsNameEnum.CONNECTION_TIMEOUT',
  209 + HANDSHAKE_TIMEOUT = 'designer_form_label.externals.index.RabbitmqFieldsNameEnum.HANDSHAKE_TIMEOUT',
  210 + CLIENT_PROPERTIES = 'designer_form_label.externals.index.RabbitmqFieldsNameEnum.CLIENT_PROPERTIES',
265 211 }
266 212
267 213 // Rest api call
... ... @@ -297,60 +243,34 @@ export enum RestApiCallFieldsEnum {
297 243 }
298 244
299 245 export enum RestApiCallFieldsNameEnum {
300   - REST_ENDPOINT_URL_PATTERN = t(
301   - 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.REST_ENDPOINT_URL_PATTERN'
302   - ),
303   - REQUEST_METHOD = t(
304   - 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.REQUEST_METHOD'
305   - ),
306   - USE_SIMPLE_CLIENT_HTTP_FACTORY = t(
307   - 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.USE_SIMPLE_CLIENT_HTTP_FACTORY'
308   - ),
309   - IGNORE_REQUEST_BODY = t(
310   - 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.IGNORE_REQUEST_BODY'
311   - ),
312   - ENABLE_PROXY = t('designer_form_label.externals.index.RestApiCallFieldsNameEnum.ENABLE_PROXY'),
313   - USE_SYSTEM_PROXY_PROPERTIES = t(
314   - 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.USE_SYSTEM_PROXY_PROPERTIES'
315   - ),
316   - PROXY_SCHEME = t('designer_form_label.externals.index.RestApiCallFieldsNameEnum.PROXY_SCHEME'),
317   - PROXY_HOST = t('designer_form_label.externals.index.RestApiCallFieldsNameEnum.PROXY_HOST'),
318   - PROXY_PORT = t('designer_form_label.externals.index.RestApiCallFieldsNameEnum.PROXY_PORT'),
319   - PROXY_USER = t('designer_form_label.externals.index.RestApiCallFieldsNameEnum.PROXY_USER'),
320   - PROXY_PASSWORD = t(
321   - 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.PROXY_PASSWORD'
322   - ),
323   - READ_TIMEOUT_MS = t(
324   - 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.READ_TIMEOUT_MS'
325   - ),
326   - MAX_PARALLEL_REQUESTS_COUNT = t(
327   - 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.MAX_PARALLEL_REQUESTS_COUNT'
328   - ),
329   - HEADERS = t('designer_form_label.externals.index.RestApiCallFieldsNameEnum.HEADERS'),
330   - USE_REDIS_QUEUE_FOR_MSG_PERSISTENCE = t(
331   - 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.USE_REDIS_QUEUE_FOR_MSG_PERSISTENCE'
332   - ),
333   - TRIM_QUEUE = t('designer_form_label.externals.index.RestApiCallFieldsNameEnum.TRIM_QUEUE'),
334   - MAX_QUEUE_SIZE = t(
335   - 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.MAX_QUEUE_SIZE'
336   - ),
337   - CREDENTIALS = t('designer_form_label.externals.index.RestApiCallFieldsNameEnum.CREDENTIALS'),
  246 + REST_ENDPOINT_URL_PATTERN = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.REST_ENDPOINT_URL_PATTERN',
  247 + REQUEST_METHOD = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.REQUEST_METHOD',
  248 + USE_SIMPLE_CLIENT_HTTP_FACTORY = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.USE_SIMPLE_CLIENT_HTTP_FACTORY',
  249 + IGNORE_REQUEST_BODY = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.IGNORE_REQUEST_BODY',
  250 + ENABLE_PROXY = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.ENABLE_PROXY',
  251 + USE_SYSTEM_PROXY_PROPERTIES = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.USE_SYSTEM_PROXY_PROPERTIES',
  252 + PROXY_SCHEME = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.PROXY_SCHEME',
  253 + PROXY_HOST = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.PROXY_HOST',
  254 + PROXY_PORT = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.PROXY_PORT',
  255 + PROXY_USER = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.PROXY_USER',
  256 + PROXY_PASSWORD = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.PROXY_PASSWORD',
  257 + READ_TIMEOUT_MS = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.READ_TIMEOUT_MS',
  258 + MAX_PARALLEL_REQUESTS_COUNT = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.MAX_PARALLEL_REQUESTS_COUNT',
  259 + HEADERS = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.HEADERS',
  260 + USE_REDIS_QUEUE_FOR_MSG_PERSISTENCE = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.USE_REDIS_QUEUE_FOR_MSG_PERSISTENCE',
  261 + TRIM_QUEUE = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.TRIM_QUEUE',
  262 + MAX_QUEUE_SIZE = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.MAX_QUEUE_SIZE',
  263 + CREDENTIALS = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.CREDENTIALS',
338 264
339   - TYPE = t('designer_form_label.externals.index.RestApiCallFieldsNameEnum.TYPE'),
340   - PASSWORD = t('designer_form_label.externals.index.RestApiCallFieldsNameEnum.PASSWORD'),
341   - CA_CERT = t('designer_form_label.externals.index.RestApiCallFieldsNameEnum.CA_CERT'),
342   - CA_CERT_FILE_NAME = t(
343   - 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.CA_CERT_FILE_NAME'
344   - ),
345   - PRIVATE_KEY = t('designer_form_label.externals.index.RestApiCallFieldsNameEnum.PRIVATE_KEY'),
346   - PRIVATE_KEY_FILE_NAME = t(
347   - 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.PRIVATE_KEY_FILE_NAME'
348   - ),
349   - CERT = t('designer_form_label.externals.index.RestApiCallFieldsNameEnum.CERT'),
350   - CERT_FILE_NAME = t(
351   - 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.CERT_FILE_NAME'
352   - ),
353   - USERNAME = t('designer_form_label.externals.index.RestApiCallFieldsNameEnum.USERNAME'),
  265 + TYPE = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.TYPE',
  266 + PASSWORD = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.PASSWORD',
  267 + CA_CERT = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.CA_CERT',
  268 + CA_CERT_FILE_NAME = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.CA_CERT_FILE_NAME',
  269 + PRIVATE_KEY = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.PRIVATE_KEY',
  270 + PRIVATE_KEY_FILE_NAME = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.PRIVATE_KEY_FILE_NAME',
  271 + CERT = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.CERT',
  272 + CERT_FILE_NAME = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.CERT_FILE_NAME',
  273 + USERNAME = 'designer_form_label.externals.index.RestApiCallFieldsNameEnum.USERNAME',
354 274 }
355 275
356 276 // send email
... ... @@ -372,22 +292,20 @@ export enum SendEmailFieldsEnum {
372 292 }
373 293
374 294 export enum SendEmailFieldsNameEnum {
375   - USE_SYSTEM_SMTP_SETTINGS = t(
376   - 'designer_form_label.externals.index.SendEmailFieldsNameEnum.USE_SYSTEM_SMTP_SETTINGS'
377   - ),
378   - SMTP_PROTOCOL = t('designer_form_label.externals.index.SendEmailFieldsNameEnum.SMTP_PROTOCOL'),
379   - SMTP_HOST = t('designer_form_label.externals.index.SendEmailFieldsNameEnum.SMTP_HOST'),
380   - SMTP_PORT = t('designer_form_label.externals.index.SendEmailFieldsNameEnum.SMTP_PORT'),
381   - TIMEOUT = t('designer_form_label.externals.index.SendEmailFieldsNameEnum.TIMEOUT'),
382   - ENABLE_TLS = t('designer_form_label.externals.index.SendEmailFieldsNameEnum.ENABLE_TLS'),
383   - TLS_VERSION = t('designer_form_label.externals.index.SendEmailFieldsNameEnum.TLS_VERSION'),
384   - ENABLE_PROXY = t('designer_form_label.externals.index.SendEmailFieldsNameEnum.ENABLE_PROXY'),
385   - PROXY_HOST = t('designer_form_label.externals.index.SendEmailFieldsNameEnum.PROXY_HOST'),
386   - PROXY_PORT = t('designer_form_label.externals.index.SendEmailFieldsNameEnum.PROXY_PORT'),
387   - PROXY_USER = t('designer_form_label.externals.index.SendEmailFieldsNameEnum.PROXY_USER'),
388   - PROXY_PASSWORD = t('designer_form_label.externals.index.SendEmailFieldsNameEnum.PROXY_PASSWORD'),
389   - USERNAME = t('designer_form_label.externals.index.SendEmailFieldsNameEnum.USERNAME'),
390   - PASSWORD = t('designer_form_label.externals.index.SendEmailFieldsNameEnum.PASSWORD'),
  295 + USE_SYSTEM_SMTP_SETTINGS = 'designer_form_label.externals.index.SendEmailFieldsNameEnum.USE_SYSTEM_SMTP_SETTINGS',
  296 + SMTP_PROTOCOL = 'designer_form_label.externals.index.SendEmailFieldsNameEnum.SMTP_PROTOCOL',
  297 + SMTP_HOST = 'designer_form_label.externals.index.SendEmailFieldsNameEnum.SMTP_HOST',
  298 + SMTP_PORT = 'designer_form_label.externals.index.SendEmailFieldsNameEnum.SMTP_PORT',
  299 + TIMEOUT = 'designer_form_label.externals.index.SendEmailFieldsNameEnum.TIMEOUT',
  300 + ENABLE_TLS = 'designer_form_label.externals.index.SendEmailFieldsNameEnum.ENABLE_TLS',
  301 + TLS_VERSION = 'designer_form_label.externals.index.SendEmailFieldsNameEnum.TLS_VERSION',
  302 + ENABLE_PROXY = 'designer_form_label.externals.index.SendEmailFieldsNameEnum.ENABLE_PROXY',
  303 + PROXY_HOST = 'designer_form_label.externals.index.SendEmailFieldsNameEnum.PROXY_HOST',
  304 + PROXY_PORT = 'designer_form_label.externals.index.SendEmailFieldsNameEnum.PROXY_PORT',
  305 + PROXY_USER = 'designer_form_label.externals.index.SendEmailFieldsNameEnum.PROXY_USER',
  306 + PROXY_PASSWORD = 'designer_form_label.externals.index.SendEmailFieldsNameEnum.PROXY_PASSWORD',
  307 + USERNAME = 'designer_form_label.externals.index.SendEmailFieldsNameEnum.USERNAME',
  308 + PASSWORD = 'designer_form_label.externals.index.SendEmailFieldsNameEnum.PASSWORD',
391 309 }
392 310
393 311 export enum SendSMSFieldsEnum {
... ... @@ -406,26 +324,16 @@ export enum SendSMSFieldsEnum {
406 324 }
407 325
408 326 export enum SendSMSFieldsNameEnum {
409   - NUMBERS_TO_TEMPLATE = t(
410   - 'designer_form_label.externals.index.SendSMSFieldsNameEnum.NUMBERS_TO_TEMPLATE'
411   - ),
412   - SMS_MESSAGE_TEMPLATE = t(
413   - 'designer_form_label.externals.index.SendSMSFieldsNameEnum.SMS_MESSAGE_TEMPLATE'
414   - ),
415   - USE_SYSTEM_SMS_SETTINGS = t(
416   - 'designer_form_label.externals.index.SendSMSFieldsNameEnum.USE_SYSTEM_SMS_SETTINGS'
417   - ),
418   - SMS_PROVIDER_CONFIGURATION = t(
419   - 'designer_form_label.externals.index.SendSMSFieldsNameEnum.SMS_PROVIDER_CONFIGURATION'
420   - ),
  327 + NUMBERS_TO_TEMPLATE = 'designer_form_label.externals.index.SendSMSFieldsNameEnum.NUMBERS_TO_TEMPLATE',
  328 + SMS_MESSAGE_TEMPLATE = 'designer_form_label.externals.index.SendSMSFieldsNameEnum.SMS_MESSAGE_TEMPLATE',
  329 + USE_SYSTEM_SMS_SETTINGS = 'designer_form_label.externals.index.SendSMSFieldsNameEnum.USE_SYSTEM_SMS_SETTINGS',
  330 + SMS_PROVIDER_CONFIGURATION = 'designer_form_label.externals.index.SendSMSFieldsNameEnum.SMS_PROVIDER_CONFIGURATION',
421 331
422   - ACCESS_KEY_ID = t('designer_form_label.externals.index.SendSMSFieldsNameEnum.ACCESS_KEY_ID'),
423   - SECRET_ACCESS_KEY = t(
424   - 'designer_form_label.externals.index.SendSMSFieldsNameEnum.SECRET_ACCESS_KEY'
425   - ),
426   - REGION = t('designer_form_label.externals.index.SendSMSFieldsNameEnum.REGION'),
427   - TYPE = t('designer_form_label.externals.index.SendSMSFieldsNameEnum.TYPE'),
428   - NUMBER_FROM = t('designer_form_label.externals.index.SendSMSFieldsNameEnum.NUMBER_FROM'),
429   - ACCOUNT_SID = t('designer_form_label.externals.index.SendSMSFieldsNameEnum.ACCOUNT_SID'),
430   - ACCOUNT_TOKEN = t('designer_form_label.externals.index.SendSMSFieldsNameEnum.ACCOUNT_TOKEN'),
  332 + ACCESS_KEY_ID = 'designer_form_label.externals.index.SendSMSFieldsNameEnum.ACCESS_KEY_ID',
  333 + SECRET_ACCESS_KEY = 'designer_form_label.externals.index.SendSMSFieldsNameEnum.SECRET_ACCESS_KEY',
  334 + REGION = 'designer_form_label.externals.index.SendSMSFieldsNameEnum.REGION',
  335 + TYPE = 'designer_form_label.externals.index.SendSMSFieldsNameEnum.TYPE',
  336 + NUMBER_FROM = 'designer_form_label.externals.index.SendSMSFieldsNameEnum.NUMBER_FROM',
  337 + ACCOUNT_SID = 'designer_form_label.externals.index.SendSMSFieldsNameEnum.ACCOUNT_SID',
  338 + ACCOUNT_TOKEN = 'designer_form_label.externals.index.SendSMSFieldsNameEnum.ACCOUNT_TOKEN',
431 339 }
... ...
1   -import { useI18n } from '/@/hooks/web/useI18n';
2   -
3   -const { t } = useI18n() as any; //加载国际化
4   -
5 1 // Filter Check Alarm Status Fields
6 2 export enum CheckAlarmStatusFieldEnum {
7 3 ALARM_STATUS_LIST = 'alarmStatusList',
8 4 }
9 5
10 6 export enum CheckAlarmStatusFieldNameEnum {
11   - ALARM_STATUS_LIST = t(
12   - 'designer_form_label.filters.index.CheckAlarmStatusFieldNameEnum.ALARM_STATUS_LIST'
13   - ),
  7 + ALARM_STATUS_LIST = 'designer_form_label.filters.index.CheckAlarmStatusFieldNameEnum.ALARM_STATUS_LIST',
14 8 }
15 9
16 10 // Filter CHeck Existence Fields
... ... @@ -21,13 +15,9 @@ export enum CheckExistenceFieldsEnum {
21 15 }
22 16
23 17 export enum CheckExistenceFieldsNameEnum {
24   - MESSAGE_NAMES = t('designer_form_label.filters.index.CheckExistenceFieldsNameEnum.MESSAGE_NAMES'),
25   - METADATA_NAMES = t(
26   - 'designer_form_label.filters.index.CheckExistenceFieldsNameEnum.METADATA_NAMES'
27   - ),
28   - CHECK_ALL_KEYS = t(
29   - 'designer_form_label.filters.index.CheckExistenceFieldsNameEnum.CHECK_ALL_KEYS'
30   - ),
  18 + MESSAGE_NAMES = 'designer_form_label.filters.index.CheckExistenceFieldsNameEnum.MESSAGE_NAMES',
  19 + METADATA_NAMES = 'designer_form_label.filters.index.CheckExistenceFieldsNameEnum.METADATA_NAMES',
  20 + CHECK_ALL_KEYS = 'designer_form_label.filters.index.CheckExistenceFieldsNameEnum.CHECK_ALL_KEYS',
31 21 }
32 22
33 23 // Filter Check Relation Fields
... ... @@ -40,14 +30,10 @@ export enum CheckRelationFieldsEnum {
40 30 }
41 31
42 32 export enum CheckRelationFieldsNameEnum {
43   - DIRECTION = t('designer_form_label.filters.index.CheckRelationFieldsNameEnum.DIRECTION'),
44   - CHECK_FOR_SINGLE_ENTITY = t(
45   - 'designer_form_label.filters.index.CheckRelationFieldsNameEnum.CHECK_FOR_SINGLE_ENTITY'
46   - ),
47   - ENTITY_TYPE = t('designer_form_label.filters.index.CheckRelationFieldsNameEnum.ENTITY_TYPE'),
48   - RELEATION_TYPE = t(
49   - 'designer_form_label.filters.index.CheckRelationFieldsNameEnum.RELEATION_TYPE'
50   - ),
  33 + DIRECTION = 'designer_form_label.filters.index.CheckRelationFieldsNameEnum.DIRECTION',
  34 + CHECK_FOR_SINGLE_ENTITY = 'designer_form_label.filters.index.CheckRelationFieldsNameEnum.CHECK_FOR_SINGLE_ENTITY',
  35 + ENTITY_TYPE = 'designer_form_label.filters.index.CheckRelationFieldsNameEnum.ENTITY_TYPE',
  36 + RELEATION_TYPE = 'designer_form_label.filters.index.CheckRelationFieldsNameEnum.RELEATION_TYPE',
51 37 }
52 38
53 39 // Filter Gps geofencing filter
... ... @@ -65,32 +51,16 @@ export enum GpsGeofencingFilterFieldsEnum {
65 51 }
66 52
67 53 export enum GpsGeofencingFilterFieldsNameEnum {
68   - LATITUDE_KEY_NAME = t(
69   - 'designer_form_label.filters.index.GpsGeofencingFilterFieldsNameEnum.LATITUDE_KEY_NAME'
70   - ),
71   - LONGITUDE_KEY_NAME = t(
72   - 'designer_form_label.filters.index.GpsGeofencingFilterFieldsNameEnum.LONGITUDE_KEY_NAME'
73   - ),
74   - PERIMETER_TYPE = t(
75   - 'designer_form_label.filters.index.GpsGeofencingFilterFieldsNameEnum.PERIMETER_TYPE'
76   - ),
77   - FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA = t(
78   - 'designer_form_label.filters.index.GpsGeofencingFilterFieldsNameEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA'
79   - ),
80   - CENTER_LATITUDE = t(
81   - 'designer_form_label.filters.index.GpsGeofencingFilterFieldsNameEnum.CENTER_LATITUDE'
82   - ),
83   - CENTER_LONGITUDE = t(
84   - 'designer_form_label.filters.index.GpsGeofencingFilterFieldsNameEnum.CENTER_LONGITUDE'
85   - ),
86   - RANGE = t('designer_form_label.filters.index.GpsGeofencingFilterFieldsNameEnum.RANGE'),
87   - RANGE_UNIT = t('designer_form_label.filters.index.GpsGeofencingFilterFieldsNameEnum.RANGE_UNIT'),
88   - PERIMETER_KEY_NAME = t(
89   - 'designer_form_label.filters.index.GpsGeofencingFilterFieldsNameEnum.PERIMETER_KEY_NAME'
90   - ),
91   - POLYGONS_DEFINITION = t(
92   - 'designer_form_label.filters.index.GpsGeofencingFilterFieldsNameEnum.POLYGONS_DEFINITION'
93   - ),
  54 + LATITUDE_KEY_NAME = 'designer_form_label.filters.index.GpsGeofencingFilterFieldsNameEnum.LATITUDE_KEY_NAME',
  55 + LONGITUDE_KEY_NAME = 'designer_form_label.filters.index.GpsGeofencingFilterFieldsNameEnum.LONGITUDE_KEY_NAME',
  56 + PERIMETER_TYPE = 'designer_form_label.filters.index.GpsGeofencingFilterFieldsNameEnum.PERIMETER_TYPE',
  57 + FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA = 'designer_form_label.filters.index.GpsGeofencingFilterFieldsNameEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA',
  58 + CENTER_LATITUDE = 'designer_form_label.filters.index.GpsGeofencingFilterFieldsNameEnum.CENTER_LATITUDE',
  59 + CENTER_LONGITUDE = 'designer_form_label.filters.index.GpsGeofencingFilterFieldsNameEnum.CENTER_LONGITUDE',
  60 + RANGE = 'designer_form_label.filters.index.GpsGeofencingFilterFieldsNameEnum.RANGE',
  61 + RANGE_UNIT = 'designer_form_label.filters.index.GpsGeofencingFilterFieldsNameEnum.RANGE_UNIT',
  62 + PERIMETER_KEY_NAME = 'designer_form_label.filters.index.GpsGeofencingFilterFieldsNameEnum.PERIMETER_KEY_NAME',
  63 + POLYGONS_DEFINITION = 'designer_form_label.filters.index.GpsGeofencingFilterFieldsNameEnum.POLYGONS_DEFINITION',
94 64 }
95 65
96 66 // Filter Message Type
... ... @@ -99,7 +69,7 @@ export enum MessageTypeFieldsEnum {
99 69 }
100 70
101 71 export enum MessageTypeFieldsNameEnum {
102   - MESSAGE_TYPES = t('designer_form_label.filters.index.MessageTypeFieldsNameEnum.MESSAGE_TYPES'),
  72 + MESSAGE_TYPES = 'designer_form_label.filters.index.MessageTypeFieldsNameEnum.MESSAGE_TYPES',
103 73 }
104 74
105 75 // Filter Originator Type
... ... @@ -108,9 +78,7 @@ export enum OriginatorTypeFieldsEnum {
108 78 }
109 79
110 80 export enum OriginatorTypeFieldsNameEnum {
111   - ORIGINATOR_TYPES = t(
112   - 'designer_form_label.filters.index.OriginatorTypeFieldsNameEnum.ORIGINATOR_TYPES'
113   - ),
  81 + ORIGINATOR_TYPES = 'designer_form_label.filters.index.OriginatorTypeFieldsNameEnum.ORIGINATOR_TYPES',
114 82 }
115 83
116 84 // Filter Script
... ... @@ -119,7 +87,7 @@ export enum ScriptFieldsEnum {
119 87 }
120 88
121 89 export enum ScriptFieldsNameEnum {
122   - JS_SCRIPT = t('designer_form_label.filters.index.ScriptFieldsNameEnum.JS_SCRIPT'),
  90 + JS_SCRIPT = 'designer_form_label.filters.index.ScriptFieldsNameEnum.JS_SCRIPT',
123 91 }
124 92
125 93 // Filter Switch
... ... @@ -128,5 +96,5 @@ export enum SwitchFieldsEnum {
128 96 }
129 97
130 98 export enum SwitchFieldsNameEnum {
131   - JS_SCRIPT = t('designer_form_label.filters.index.SwitchFieldsNameEnum.JS_SCRIPT'),
  99 + JS_SCRIPT = 'designer_form_label.filters.index.SwitchFieldsNameEnum.JS_SCRIPT',
132 100 }
... ...
1   -import { useI18n } from '/@/hooks/web/useI18n';
2   -
3   -const { t } = useI18n() as any; //加载国际化
4   -
5 1 export enum CheckPointFieldsEnum {
6 2 QUEUE_NAME = 'queueName',
7 3 }
8 4 export enum CheckPointFieldsNameEnum {
9   - QUEUE_NAME = t('designer_form_label.flows.index.CheckPointFieldsNameEnum.QUEUE_NAME'),
  5 + QUEUE_NAME = 'designer_form_label.flows.index.CheckPointFieldsNameEnum.QUEUE_NAME',
10 6 }
11 7
12 8 export enum RuleChainFieldsEnum {
... ... @@ -14,5 +10,5 @@ export enum RuleChainFieldsEnum {
14 10 }
15 11
16 12 export enum RuleChainFieldsNameEnum {
17   - RULE_CHAIN_ID = t('designer_form_label.flows.index.RuleChainFieldsNameEnum.RULE_CHAIN_ID'),
  13 + RULE_CHAIN_ID = 'designer_form_label.flows.index.RuleChainFieldsNameEnum.RULE_CHAIN_ID',
18 14 }
... ...
1   -import { useI18n } from '/@/hooks/web/useI18n';
2   -
3   -const { t } = useI18n() as any; //加载国际化
4   -
5 1 // Change originator
6 2 export enum ChangeOriginatorFieldsEnum {
7 3 ORIGINATOR_SOURCE = 'originatorSource',
... ... @@ -9,12 +5,8 @@ export enum ChangeOriginatorFieldsEnum {
9 5 }
10 6
11 7 export enum ChangeOriginatorFieldsNameEnum {
12   - ORIGINATOR_SOURCE = t(
13   - 'designer_form_label.transformations.index.ChangeOriginatorFieldsNameEnum.ORIGINATOR_SOURCE'
14   - ),
15   - RELATIONS_QUERY = t(
16   - 'designer_form_label.transformations.index.ChangeOriginatorFieldsNameEnum.RELATIONS_QUERY'
17   - ),
  8 + ORIGINATOR_SOURCE = 'designer_form_label.transformations.index.ChangeOriginatorFieldsNameEnum.ORIGINATOR_SOURCE',
  9 + RELATIONS_QUERY = 'designer_form_label.transformations.index.ChangeOriginatorFieldsNameEnum.RELATIONS_QUERY',
18 10 }
19 11
20 12 export enum ScriptFieldsEnum {
... ... @@ -22,7 +14,7 @@ export enum ScriptFieldsEnum {
22 14 }
23 15
24 16 export enum ScriptFieldsNameEnum {
25   - JS_SCRIPT = t('designer_form_label.transformations.index.ScriptFieldsNameEnum.JS_SCRIPT'),
  17 + JS_SCRIPT = 'designer_form_label.transformations.index.ScriptFieldsNameEnum.JS_SCRIPT',
26 18 }
27 19
28 20 export enum ToEmailFieldsEnum {
... ... @@ -37,22 +29,12 @@ export enum ToEmailFieldsEnum {
37 29 }
38 30
39 31 export enum ToEmailFieldsNameEnum {
40   - FROM_TEMPLATE = t(
41   - 'designer_form_label.transformations.index.ToEmailFieldsNameEnum.FROM_TEMPLATE'
42   - ),
43   - TO_TEMPLATE = t('designer_form_label.transformations.index.ToEmailFieldsNameEnum.TO_TEMPLATE'),
44   - CC_TEMPLATE = t('designer_form_label.transformations.index.ToEmailFieldsNameEnum.CC_TEMPLATE'),
45   - BCC_TEMPLATE = t('designer_form_label.transformations.index.ToEmailFieldsNameEnum.BCC_TEMPLATE'),
46   - SUBJECT_TEMPLATE = t(
47   - 'designer_form_label.transformations.index.ToEmailFieldsNameEnum.SUBJECT_TEMPLATE'
48   - ),
49   - MAIL_BODY_TYPE = t(
50   - 'designer_form_label.transformations.index.ToEmailFieldsNameEnum.MAIL_BODY_TYPE'
51   - ),
52   - IS_HTML_TEMPLATE = t(
53   - 'designer_form_label.transformations.index.ToEmailFieldsNameEnum.IS_HTML_TEMPLATE'
54   - ),
55   - BODY_TEMPLATE = t(
56   - 'designer_form_label.transformations.index.ToEmailFieldsNameEnum.BODY_TEMPLATE'
57   - ),
  32 + FROM_TEMPLATE = 'designer_form_label.transformations.index.ToEmailFieldsNameEnum.FROM_TEMPLATE',
  33 + TO_TEMPLATE = 'designer_form_label.transformations.index.ToEmailFieldsNameEnum.TO_TEMPLATE',
  34 + CC_TEMPLATE = 'designer_form_label.transformations.index.ToEmailFieldsNameEnum.CC_TEMPLATE',
  35 + BCC_TEMPLATE = 'designer_form_label.transformations.index.ToEmailFieldsNameEnum.BCC_TEMPLATE',
  36 + SUBJECT_TEMPLATE = 'designer_form_label.transformations.index.ToEmailFieldsNameEnum.SUBJECT_TEMPLATE',
  37 + MAIL_BODY_TYPE = 'designer_form_label.transformations.index.ToEmailFieldsNameEnum.MAIL_BODY_TYPE',
  38 + IS_HTML_TEMPLATE = 'designer_form_label.transformations.index.ToEmailFieldsNameEnum.IS_HTML_TEMPLATE',
  39 + BODY_TEMPLATE = 'designer_form_label.transformations.index.ToEmailFieldsNameEnum.BODY_TEMPLATE',
58 40 }
... ...
... ... @@ -3,16 +3,19 @@ import {
3 3 AssignToCustomerFieldsNameEnum,
4 4 } from '../../../enum/formField/action';
5 5 import { FormSchema } from '/@/components/Form';
  6 +import { useI18n } from '/@/hooks/web/useI18n';
  7 +
  8 +const { t } = useI18n();
6 9
7 10 export const formSchemas: FormSchema[] = [
8 11 {
9 12 field: AssignToCustomerFieldsEnum.CUSTOMER_NAME_PATTERN,
10 13 component: 'Input',
11   - label: AssignToCustomerFieldsNameEnum.CUSTOMER_NAME_PATTERN,
  14 + label: t(AssignToCustomerFieldsNameEnum.CUSTOMER_NAME_PATTERN),
12 15 helpMessage:
13 16 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
14 17 componentProps: {
15   - placeholder: `请输入${AssignToCustomerFieldsNameEnum.CUSTOMER_NAME_PATTERN}`,
  18 + placeholder: `请输入${t(AssignToCustomerFieldsNameEnum.CUSTOMER_NAME_PATTERN)}`,
16 19 },
17 20 },
18 21 {
... ... @@ -20,18 +23,23 @@ export const formSchemas: FormSchema[] = [
20 23 component: 'Checkbox',
21 24 label: '',
22 25 renderComponentContent: () => ({
23   - default: () => AssignToCustomerFieldsNameEnum.CREATE_CUSTOMER_IF_NOT_EXISTS,
  26 + default: () => t(AssignToCustomerFieldsNameEnum.CREATE_CUSTOMER_IF_NOT_EXISTS),
24 27 }),
25 28 },
26 29 {
27 30 field: AssignToCustomerFieldsEnum.CUSTOMER_CACHE_EXPIRATION,
28 31 component: 'InputNumber',
29   - label: AssignToCustomerFieldsNameEnum.CUSTOMER_CACHE_EXPIRATION,
30   - required: true,
  32 + label: t(AssignToCustomerFieldsNameEnum.CUSTOMER_CACHE_EXPIRATION),
  33 + rules: [
  34 + {
  35 + required: true,
  36 + message: `请输入${t(AssignToCustomerFieldsNameEnum.CUSTOMER_CACHE_EXPIRATION)}`,
  37 + },
  38 + ],
31 39 helpMessage:
32 40 'Specifies maximum time interval allowed to store found customer records. 0 value means that records will never expire.',
33 41 componentProps: {
34   - placeholder: `请输入${AssignToCustomerFieldsNameEnum.CUSTOMER_CACHE_EXPIRATION}`,
  42 + placeholder: `请输入${t(AssignToCustomerFieldsNameEnum.CUSTOMER_CACHE_EXPIRATION)}`,
35 43 min: 0,
36 44 },
37 45 },
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ActionCategoryComponentEnum.ASSIGN_TO_CUSTOMER);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface AssignToCustomerDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
1 1 import { ClearAlarmFieldsEnum, ClearAlarmFieldsNameEnum } from '../../../enum/formField/action';
2 2 import { JavascriptEditorWithTestModal } from '../../../src/components/JavaScriptFilterModal';
3 3 import { FormSchema, useComponentRegister } from '/@/components/Form';
  4 +import { useI18n } from '/@/hooks/web/useI18n';
  5 +
  6 +const { t } = useI18n();
4 7
5 8 useComponentRegister('JavascriptEditorWithTestModal', JavascriptEditorWithTestModal);
6 9
... ... @@ -8,7 +11,7 @@ export const formSchemas: FormSchema[] = [
8 11 {
9 12 field: ClearAlarmFieldsEnum.ALARM_DETAILS_BUILD_JS,
10 13 component: 'JavascriptEditorWithTestModal',
11   - label: ClearAlarmFieldsNameEnum.ALARM_DETAILS_BUILD_JS,
  14 + label: t(ClearAlarmFieldsNameEnum.ALARM_DETAILS_BUILD_JS),
12 15 componentProps: {
13 16 javaScriptEditorProps: {
14 17 functionName: 'Details',
... ... @@ -21,10 +24,10 @@ export const formSchemas: FormSchema[] = [
21 24 {
22 25 field: ClearAlarmFieldsEnum.ALARM_TYPE,
23 26 component: 'Input',
24   - label: ClearAlarmFieldsNameEnum.ALARM_TYPE,
  27 + label: t(ClearAlarmFieldsNameEnum.ALARM_TYPE),
25 28 required: true,
26 29 componentProps: {
27   - placeholder: `请输入${ClearAlarmFieldsNameEnum.ALARM_TYPE}`,
  30 + placeholder: `请输入${t(ClearAlarmFieldsNameEnum.ALARM_TYPE)}`,
28 31 },
29 32 },
30 33 ];
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ActionCategoryComponentEnum.CLEAR_ALARM);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface ClearAlarmDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ActionCategoryComponentEnum.COPY_TO_VIEW);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface CopyToViewDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
1 1 import { CreateAlarmFieldsEnum, CreateAlarmFieldsNameEnum } from '../../../enum/formField/action';
2 2 import { JavascriptEditorWithTestModal } from '../../../src/components/JavaScriptFilterModal';
3 3 import { FormSchema, useComponentRegister } from '/@/components/Form';
  4 +import { useI18n } from '/@/hooks/web/useI18n';
  5 +
  6 +const { t } = useI18n();
4 7
5 8 useComponentRegister('JavascriptEditorWithTestModal', JavascriptEditorWithTestModal);
6 9
... ... @@ -10,7 +13,7 @@ export const formSchemas: FormSchema[] = [
10 13 component: 'Checkbox',
11 14 label: '',
12 15 renderComponentContent: () => ({
13   - default: () => CreateAlarmFieldsNameEnum.USE_MESSAGE_ALARM_DATA,
  16 + default: () => t(CreateAlarmFieldsNameEnum.USE_MESSAGE_ALARM_DATA),
14 17 }),
15 18 },
16 19 {
... ... @@ -19,13 +22,13 @@ export const formSchemas: FormSchema[] = [
19 22 label: '',
20 23 show: ({ model }) => model[CreateAlarmFieldsEnum.USE_MESSAGE_ALARM_DATA],
21 24 renderComponentContent: () => ({
22   - default: () => CreateAlarmFieldsNameEnum.OVERWRITE_ALARM_DETAILS,
  25 + default: () => t(CreateAlarmFieldsNameEnum.OVERWRITE_ALARM_DETAILS),
23 26 }),
24 27 },
25 28 {
26 29 field: CreateAlarmFieldsEnum.ALARM_DETAILS_BUILD_JS,
27 30 component: 'JavascriptEditorWithTestModal',
28   - label: CreateAlarmFieldsNameEnum.ALARM_DETAILS_BUILD_JS,
  31 + label: t(CreateAlarmFieldsNameEnum.ALARM_DETAILS_BUILD_JS),
29 32 valueField: 'value',
30 33 changeEvent: 'update:value',
31 34 show: ({ model }) =>
... ... @@ -45,13 +48,13 @@ export const formSchemas: FormSchema[] = [
45 48 {
46 49 field: CreateAlarmFieldsEnum.ALARM_TYPE,
47 50 component: 'Input',
48   - label: CreateAlarmFieldsNameEnum.ALARM_TYPE,
  51 + label: t(CreateAlarmFieldsNameEnum.ALARM_TYPE),
49 52 helpMessage: [
50 53 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
51 54 ],
52 55 show: ({ model }) => !model[CreateAlarmFieldsEnum.USE_MESSAGE_ALARM_DATA],
53 56 componentProps: {
54   - placeholder: `请输入${CreateAlarmFieldsNameEnum.ALARM_TYPE}`,
  57 + placeholder: `请输入${t(CreateAlarmFieldsNameEnum.ALARM_TYPE)}`,
55 58 },
56 59 },
57 60 {
... ... @@ -60,19 +63,19 @@ export const formSchemas: FormSchema[] = [
60 63 label: '',
61 64 show: ({ model }) => !model[CreateAlarmFieldsEnum.USE_MESSAGE_ALARM_DATA],
62 65 renderComponentContent: () => ({
63   - default: () => CreateAlarmFieldsNameEnum.DYNAMIC_SEVERITY,
  66 + default: () => t(CreateAlarmFieldsNameEnum.DYNAMIC_SEVERITY),
64 67 }),
65 68 },
66 69 {
67 70 field: CreateAlarmFieldsEnum.SEVERITY,
68 71 component: 'Input',
69   - label: CreateAlarmFieldsNameEnum.SEVERITY,
  72 + label: t(CreateAlarmFieldsNameEnum.SEVERITY),
70 73 show: ({ model }) => !model[CreateAlarmFieldsEnum.USE_MESSAGE_ALARM_DATA],
71 74 helpMessage: [
72 75 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body. Alarm severity should be system (CRITICAL, MAJOR etc.)',
73 76 ],
74 77 componentProps: {
75   - placeholder: `请输入${CreateAlarmFieldsNameEnum.SEVERITY}`,
  78 + placeholder: `请输入${t(CreateAlarmFieldsNameEnum.SEVERITY)}`,
76 79 },
77 80 },
78 81 {
... ... @@ -81,18 +84,18 @@ export const formSchemas: FormSchema[] = [
81 84 label: '',
82 85 show: ({ model }) => !model[CreateAlarmFieldsEnum.USE_MESSAGE_ALARM_DATA],
83 86 renderComponentContent: () => ({
84   - default: () => CreateAlarmFieldsNameEnum.PROPAGATE,
  87 + default: () => t(CreateAlarmFieldsNameEnum.PROPAGATE),
85 88 }),
86 89 },
87 90 {
88 91 field: CreateAlarmFieldsEnum.RELATION_TYPES,
89 92 component: 'Select',
90   - label: CreateAlarmFieldsNameEnum.RELATION_TYPES,
  93 + label: t(CreateAlarmFieldsNameEnum.RELATION_TYPES),
91 94 show: ({ model }) => !model[CreateAlarmFieldsEnum.USE_MESSAGE_ALARM_DATA],
92 95 componentProps: {
93 96 open: false,
94 97 mode: 'tags',
95   - placeholder: `请输入${CreateAlarmFieldsNameEnum.RELATION_TYPES}`,
  98 + placeholder: `请输入${t(CreateAlarmFieldsNameEnum.RELATION_TYPES)}`,
96 99 },
97 100 },
98 101 {
... ... @@ -101,7 +104,7 @@ export const formSchemas: FormSchema[] = [
101 104 label: '',
102 105 show: ({ model }) => !model[CreateAlarmFieldsEnum.USE_MESSAGE_ALARM_DATA],
103 106 renderComponentContent: () => ({
104   - default: () => CreateAlarmFieldsNameEnum.PROPAGATE_TO_TENANT,
  107 + default: () => t(CreateAlarmFieldsNameEnum.PROPAGATE_TO_TENANT),
105 108 }),
106 109 },
107 110 {
... ... @@ -110,7 +113,7 @@ export const formSchemas: FormSchema[] = [
110 113 label: '',
111 114 show: ({ model }) => !model[CreateAlarmFieldsEnum.USE_MESSAGE_ALARM_DATA],
112 115 renderComponentContent: () => ({
113   - default: () => CreateAlarmFieldsNameEnum.PROPAGATE_TO_OWNER,
  116 + default: () => t(CreateAlarmFieldsNameEnum.PROPAGATE_TO_OWNER),
114 117 }),
115 118 },
116 119 ];
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ActionCategoryComponentEnum.CREATE_ALARM);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface CreateAlarmDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -9,26 +9,29 @@ import {
9 9 CreateRelationFieldsNameEnum,
10 10 } from '../../../enum/formField/action';
11 11 import { FormSchema } from '/@/components/Form';
  12 +import { useI18n } from '/@/hooks/web/useI18n';
  13 +
  14 +const { t } = useI18n();
12 15
13 16 export const formSchemas: FormSchema[] = [
14 17 {
15 18 field: CreateRelationFieldsEnum.DIRECTION,
16 19 component: 'Select',
17   - label: CreateRelationFieldsNameEnum.DIRECTION,
18   - required: true,
  20 + label: t(CreateRelationFieldsNameEnum.DIRECTION),
  21 + rules: [{ required: true, message: `请选择${t(CreateRelationFieldsNameEnum.DIRECTION)}` }],
19 22 componentProps: {
20 23 options: Object.keys(DirectionEnum).map((value) => ({
21 24 label: DirectionNameEnum[value],
22 25 value,
23 26 })),
24 27 getPopupContainer: () => document.body,
25   - placeholder: `请选择${CreateRelationFieldsNameEnum.DIRECTION}`,
  28 + placeholder: `请选择${t(CreateRelationFieldsNameEnum.DIRECTION)}`,
26 29 },
27 30 },
28 31 {
29 32 field: CreateRelationFieldsEnum.ENTITY_TYPE,
30 33 component: 'Select',
31   - label: CreateRelationFieldsNameEnum.ENTITY_TYPE,
  34 + label: t(CreateRelationFieldsNameEnum.ENTITY_TYPE),
32 35 colProps: { span: 8 },
33 36 required: true,
34 37 componentProps: {
... ... @@ -37,28 +40,29 @@ export const formSchemas: FormSchema[] = [
37 40 value,
38 41 })),
39 42 getPopupContainer: () => document.body,
40   - placeholder: `请选择${CreateRelationFieldsNameEnum.ENTITY_TYPE}`,
  43 + placeholder: `请选择${t(CreateRelationFieldsNameEnum.ENTITY_TYPE)}`,
41 44 },
42 45 },
43 46 {
44 47 field: CreateRelationFieldsEnum.ENTITY_NAME_PATTERN,
45 48 component: 'Input',
46   - label: CreateRelationFieldsNameEnum.ENTITY_NAME_PATTERN,
  49 + label: t(CreateRelationFieldsNameEnum.ENTITY_NAME_PATTERN),
47 50 colProps: { span: 8 },
48   - required: true,
49 51 helpMessage: [
50 52 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
51 53 ],
  54 + rules: [
  55 + { required: true, message: `请输入${t(CreateRelationFieldsNameEnum.ENTITY_NAME_PATTERN)}` },
  56 + ],
52 57 componentProps: {
53   - placeholder: `请输入${CreateRelationFieldsNameEnum.ENTITY_NAME_PATTERN}`,
  58 + placeholder: `请输入${t(CreateRelationFieldsNameEnum.ENTITY_NAME_PATTERN)}`,
54 59 },
55 60 },
56 61 {
57 62 field: CreateRelationFieldsEnum.ENTITY_TYPE_PATTERN,
58 63 component: 'Input',
59   - label: CreateRelationFieldsNameEnum.ENTITY_TYPE_PATTERN,
  64 + label: t(CreateRelationFieldsNameEnum.ENTITY_TYPE_PATTERN),
60 65 colProps: { span: 8 },
61   - required: true,
62 66 helpMessage: [
63 67 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
64 68 ],
... ... @@ -66,25 +70,28 @@ export const formSchemas: FormSchema[] = [
66 70 const type = model[CreateRelationFieldsEnum.ENTITY_TYPE];
67 71 return [EntityTypeEnum.ASSET, EntityTypeEnum.DEVICE].includes(type);
68 72 },
  73 + rules: [
  74 + { required: true, message: `请选择${t(CreateRelationFieldsNameEnum.ENTITY_TYPE_PATTERN)}` },
  75 + ],
69 76 componentProps: {
70   - placeholder: `请选择${CreateRelationFieldsNameEnum.ENTITY_TYPE_PATTERN}`,
  77 + placeholder: `请选择${t(CreateRelationFieldsNameEnum.ENTITY_TYPE_PATTERN)}`,
71 78 },
72 79 },
73 80 {
74 81 field: CreateRelationFieldsEnum.RELATION_TYPE,
75 82 component: 'Input',
76   - label: CreateRelationFieldsNameEnum.RELATION_TYPE,
  83 + label: t(CreateRelationFieldsNameEnum.RELATION_TYPE),
77 84 helpMessage: [
78 85 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
79 86 ],
80 87 componentProps: {
81   - placeholder: `请输入${CreateRelationFieldsNameEnum.RELATION_TYPE}`,
  88 + placeholder: `请输入${t(CreateRelationFieldsNameEnum.RELATION_TYPE)}`,
82 89 },
83 90 },
84 91 {
85 92 field: CreateRelationFieldsEnum.CREATE_ENTITY_IF_NOT_EXISTS,
86 93 component: 'Checkbox',
87   - label: CreateRelationFieldsNameEnum.CREATE_ENTITY_IF_NOT_EXISTS,
  94 + label: t(CreateRelationFieldsNameEnum.CREATE_ENTITY_IF_NOT_EXISTS),
88 95 helpMessage: '',
89 96 show: ({ model }) => {
90 97 const type = model[CreateRelationFieldsEnum.ENTITY_TYPE];
... ... @@ -97,7 +104,7 @@ export const formSchemas: FormSchema[] = [
97 104 {
98 105 field: CreateRelationFieldsEnum.REMOVE_CURRENT_RELATIONS,
99 106 component: 'Checkbox',
100   - label: CreateRelationFieldsNameEnum.REMOVE_CURRENT_RELATIONS,
  107 + label: t(CreateRelationFieldsNameEnum.REMOVE_CURRENT_RELATIONS),
101 108 renderComponentContent: () => ({
102 109 default: () =>
103 110 'Removes current relations from the originator of the incoming message based on direction and type.',
... ... @@ -106,7 +113,7 @@ export const formSchemas: FormSchema[] = [
106 113 {
107 114 field: CreateRelationFieldsEnum.CHANGE_ORIGINATOR_TO_RELATED_ENTITY,
108 115 component: 'Checkbox',
109   - label: CreateRelationFieldsNameEnum.CHANGE_ORIGINATOR_TO_RELATED_ENTITY,
  116 + label: t(CreateRelationFieldsNameEnum.CHANGE_ORIGINATOR_TO_RELATED_ENTITY),
110 117 renderComponentContent: () => ({
111 118 default: () => 'Used to process submitted message as a message from another entity.',
112 119 }),
... ... @@ -114,11 +121,11 @@ export const formSchemas: FormSchema[] = [
114 121 {
115 122 field: CreateRelationFieldsEnum.ENTITY_CACHE_EXPIRATION,
116 123 component: 'InputNumber',
117   - label: CreateRelationFieldsNameEnum.ENTITY_CACHE_EXPIRATION,
  124 + label: t(CreateRelationFieldsNameEnum.ENTITY_CACHE_EXPIRATION),
118 125 required: true,
119 126 componentProps: {
120 127 min: 0,
121   - placeholder: `请输入${CreateRelationFieldsNameEnum.ENTITY_CACHE_EXPIRATION}`,
  128 + placeholder: `请输入${t(CreateRelationFieldsNameEnum.ENTITY_CACHE_EXPIRATION)}`,
122 129 },
123 130 },
124 131 ];
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ActionCategoryComponentEnum.CREATE_RELATION);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface CreateRelationDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -3,11 +3,14 @@ import {
3 3 DelayDeprecatedFieldsNameEnum,
4 4 } from '../../../enum/formField/action';
5 5 import { FormSchema } from '/@/components/Form';
  6 +import { useI18n } from '/@/hooks/web/useI18n';
  7 +
  8 +const { t } = useI18n();
6 9
7 10 export const formSchemas: FormSchema[] = [
8 11 {
9 12 field: DelayDeprecatedFieldsEnum.USE_METADATA_PERIOD_IN_SECONDS_PATTERNS,
10   - label: DelayDeprecatedFieldsNameEnum.USE_METADATA_PERIOD_IN_SECONDS_PATTERNS,
  13 + label: t(DelayDeprecatedFieldsNameEnum.USE_METADATA_PERIOD_IN_SECONDS_PATTERNS),
11 14 component: 'Checkbox',
12 15 renderComponentContent: () => ({
13 16 default: () =>
... ... @@ -17,34 +20,43 @@ export const formSchemas: FormSchema[] = [
17 20 {
18 21 field: DelayDeprecatedFieldsEnum.PERIOD_IN_SECONDS_PATTERN,
19 22 component: 'Input',
20   - label: DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS_PATTERN,
21   - required: true,
  23 + label: t(DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS_PATTERN),
22 24 ifShow: ({ model }) => model[DelayDeprecatedFieldsEnum.USE_METADATA_PERIOD_IN_SECONDS_PATTERNS],
  25 + rules: [
  26 + {
  27 + required: true,
  28 + message: `请输入${DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS_PATTERN}`,
  29 + },
  30 + ],
23 31 componentProps: {
24 32 min: 0,
25   - placeholder: `请输入${DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS_PATTERN}`,
  33 + placeholder: `请输入${t(DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS_PATTERN)}`,
26 34 },
27 35 },
28 36 {
29 37 field: DelayDeprecatedFieldsEnum.PERIOD_IN_SECONDS,
30 38 component: 'InputNumber',
31   - label: DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS,
32   - required: true,
  39 + label: t(DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS),
33 40 ifShow: ({ model }) =>
34 41 !model[DelayDeprecatedFieldsEnum.USE_METADATA_PERIOD_IN_SECONDS_PATTERNS],
  42 + rules: [
  43 + { required: true, message: `请输入${t(DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS)}` },
  44 + ],
35 45 componentProps: {
36 46 min: 0,
37   - placeholder: `请输入${DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS}`,
  47 + placeholder: `请输入${t(DelayDeprecatedFieldsNameEnum.PERIOD_IN_SECONDS)}`,
38 48 },
39 49 },
40 50 {
41 51 field: DelayDeprecatedFieldsEnum.MAX_PENDING_MSGS,
42 52 component: 'InputNumber',
43   - label: DelayDeprecatedFieldsNameEnum.MAX_PENDING_MSGS,
44   - required: true,
  53 + label: t(DelayDeprecatedFieldsNameEnum.MAX_PENDING_MSGS),
  54 + rules: [
  55 + { required: true, message: `请输入${t(DelayDeprecatedFieldsNameEnum.MAX_PENDING_MSGS)}` },
  56 + ],
45 57 componentProps: {
46 58 min: 0,
47   - placeholder: `请输入${DelayDeprecatedFieldsNameEnum.MAX_PENDING_MSGS}`,
  59 + placeholder: `请输入${t(DelayDeprecatedFieldsNameEnum.MAX_PENDING_MSGS)}`,
48 60 },
49 61 },
50 62 ];
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ActionCategoryComponentEnum.DELAY_DEPRECATED);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface DelayDeprecatedDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -9,12 +9,15 @@ import {
9 9 DeleteRelationFieldsNameEnum,
10 10 } from '../../../enum/formField/action';
11 11 import { FormSchema } from '/@/components/Form';
  12 +import { useI18n } from '/@/hooks/web/useI18n';
  13 +
  14 +const { t } = useI18n();
12 15
13 16 export const formSchemas: FormSchema[] = [
14 17 {
15 18 field: DeleteRelationFieldsEnum.DELETE_FOR_SINGLE_ENTITY,
16 19 component: 'Checkbox',
17   - label: DeleteRelationFieldsNameEnum.DELETE_FOR_SINGLE_ENTITY,
  20 + label: t(DeleteRelationFieldsNameEnum.DELETE_FOR_SINGLE_ENTITY),
18 21 renderComponentContent: () => ({
19 22 default: () =>
20 23 'Deletes relation from the originator of the incoming message to the specified entity or list of entities based on direction and type.',
... ... @@ -23,70 +26,82 @@ export const formSchemas: FormSchema[] = [
23 26 {
24 27 field: DeleteRelationFieldsEnum.DIRECTION,
25 28 component: 'Select',
26   - label: DeleteRelationFieldsNameEnum.DIRECTION,
27   - required: true,
  29 + label: t(DeleteRelationFieldsNameEnum.DIRECTION),
28 30 show: ({ model }) => model[DeleteRelationFieldsEnum.DELETE_FOR_SINGLE_ENTITY],
  31 + rules: [
  32 + {
  33 + required: true,
  34 + message: `请选择${t(DeleteRelationFieldsNameEnum.DELETE_FOR_SINGLE_ENTITY)}`,
  35 + },
  36 + ],
29 37 componentProps: {
30 38 options: Object.keys(DirectionEnum).map((value) => ({
31 39 label: DirectionNameEnum[value],
32 40 value,
33 41 })),
34 42 getPopupContainer: () => document.body,
35   - placeholder: `请选择${DeleteRelationFieldsNameEnum.DELETE_FOR_SINGLE_ENTITY}`,
  43 + placeholder: `请选择${t(DeleteRelationFieldsNameEnum.DELETE_FOR_SINGLE_ENTITY)}`,
36 44 },
37 45 },
38 46 {
39 47 field: DeleteRelationFieldsEnum.ENTITY_TYPE,
40 48 component: 'Select',
41   - label: DeleteRelationFieldsNameEnum.ENTITY_TYPE,
42   - required: true,
  49 + label: t(DeleteRelationFieldsNameEnum.ENTITY_TYPE),
43 50 colProps: { span: 12 },
  51 + rules: [{ required: true, message: `请选择${t(DeleteRelationFieldsNameEnum.ENTITY_TYPE)}` }],
44 52 componentProps: {
45 53 options: Object.keys(EntityTypeEnum).map((value) => ({
46 54 label: EntityTypeNameEnum[value],
47 55 value,
48 56 })),
49 57 getPopupContainer: () => document.body,
50   - placeholder: `请选择${DeleteRelationFieldsNameEnum.ENTITY_TYPE}`,
  58 + placeholder: `请选择${t(DeleteRelationFieldsNameEnum.ENTITY_TYPE)}`,
51 59 },
52 60 },
53 61 {
54 62 field: DeleteRelationFieldsEnum.ENTITY_NAME_PATTERN,
55 63 component: 'Input',
56   - label: DeleteRelationFieldsNameEnum.ENTITY_NAME_PATTERN,
57   - required: true,
  64 + label: t(DeleteRelationFieldsNameEnum.ENTITY_NAME_PATTERN),
58 65 colProps: { span: 12 },
59 66 show: ({ model }) => model[DeleteRelationFieldsEnum.DELETE_FOR_SINGLE_ENTITY],
60 67 helpMessage: [
61 68 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
62 69 ],
  70 + rules: [
  71 + { required: true, message: `请输入${t(DeleteRelationFieldsNameEnum.ENTITY_NAME_PATTERN)}` },
  72 + ],
63 73 componentProps: {
64   - placeholder: `请输入${DeleteRelationFieldsNameEnum.ENTITY_NAME_PATTERN}`,
  74 + placeholder: `请输入${t(DeleteRelationFieldsNameEnum.ENTITY_NAME_PATTERN)}`,
65 75 },
66 76 },
67 77 {
68 78 field: DeleteRelationFieldsEnum.RELATION_TYPE,
69 79 component: 'Input',
70   - label: DeleteRelationFieldsNameEnum.RELATION_TYPE,
71   - required: true,
  80 + label: t(DeleteRelationFieldsNameEnum.RELATION_TYPE),
72 81 helpMessage: [
73 82 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
74 83 ],
  84 + rules: [{ required: true, message: `请输入${t(DeleteRelationFieldsNameEnum.RELATION_TYPE)}` }],
75 85 componentProps: {
76   - placeholder: `请输入${DeleteRelationFieldsNameEnum.RELATION_TYPE}`,
  86 + placeholder: `请输入${t(DeleteRelationFieldsNameEnum.RELATION_TYPE)}`,
77 87 },
78 88 },
79 89 {
80 90 field: DeleteRelationFieldsEnum.ENTITY_CACHE_EXPIRATION,
81 91 component: 'InputNumber',
82   - label: DeleteRelationFieldsNameEnum.ENTITY_CACHE_EXPIRATION,
83   - required: true,
  92 + label: t(DeleteRelationFieldsNameEnum.ENTITY_CACHE_EXPIRATION),
84 93 helpMessage: [
85 94 'Specifies maximum time interval allowed to store found entity records. 0 value means that records will never expire.',
86 95 ],
  96 + rules: [
  97 + {
  98 + required: true,
  99 + message: `请输入${t(DeleteRelationFieldsNameEnum.DELETE_FOR_SINGLE_ENTITY)}`,
  100 + },
  101 + ],
87 102 componentProps: {
88 103 min: 0,
89   - placeholder: `请输入${DeleteRelationFieldsNameEnum.DELETE_FOR_SINGLE_ENTITY}`,
  104 + placeholder: `请输入${t(DeleteRelationFieldsNameEnum.DELETE_FOR_SINGLE_ENTITY)}`,
90 105 },
91 106 },
92 107 ];
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ActionCategoryComponentEnum.DELETE_RELATION);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10
11 11 export interface DeleteRelationDataType {
12 12 someConfiguration?: Recordable;
... ...
... ... @@ -3,6 +3,9 @@ import {
3 3 DeviceProfileFieldsNameEnum,
4 4 } from '../../../enum/formField/action';
5 5 import { FormSchema } from '/@/components/Form';
  6 +import { useI18n } from '/@/hooks/web/useI18n';
  7 +
  8 +const { t } = useI18n();
6 9
7 10 export const formSchemas: FormSchema[] = [
8 11 {
... ... @@ -10,7 +13,7 @@ export const formSchemas: FormSchema[] = [
10 13 component: 'Checkbox',
11 14 label: '',
12 15 renderComponentContent: () => ({
13   - default: () => DeviceProfileFieldsNameEnum.PERSIST_ALARM_RULES_STATE,
  16 + default: () => t(DeviceProfileFieldsNameEnum.PERSIST_ALARM_RULES_STATE),
14 17 }),
15 18 },
16 19 {
... ... @@ -18,7 +21,7 @@ export const formSchemas: FormSchema[] = [
18 21 component: 'Checkbox',
19 22 label: '',
20 23 renderComponentContent: () => ({
21   - default: () => DeviceProfileFieldsNameEnum.FETCH_ALARM_RULES_STATE_ON_START,
  24 + default: () => t(DeviceProfileFieldsNameEnum.FETCH_ALARM_RULES_STATE_ON_START),
22 25 }),
23 26 },
24 27 ];
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ActionCategoryComponentEnum.DEVICE_PROFILE);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10
11 11 export interface DeviceProfileDataType {
12 12 someConfiguration?: Recordable;
... ...
... ... @@ -3,6 +3,9 @@ import { GeneratorFieldsEnum, GeneratorFieldsNameEnum } from '../../../enum/form
3 3 import { JavascriptEditorWithTestModal } from '../../../src/components/JavaScriptFilterModal';
4 4 import { getEntityIdSelect } from '../../Filter/CheckRelation/create.config';
5 5 import { FormSchema, useComponentRegister } from '/@/components/Form';
  6 +import { useI18n } from '/@/hooks/web/useI18n';
  7 +
  8 +const { t } = useI18n();
6 9
7 10 useComponentRegister('JavascriptEditorWithTestModal', JavascriptEditorWithTestModal);
8 11
... ... @@ -10,34 +13,34 @@ export const formSchemas: FormSchema[] = [
10 13 {
11 14 field: GeneratorFieldsEnum.MSG_COUNT,
12 15 component: 'InputNumber',
13   - label: GeneratorFieldsNameEnum.MSG_COUNT,
14   - required: true,
  16 + label: t(GeneratorFieldsNameEnum.MSG_COUNT),
  17 + rules: [{ required: true, message: `请输入${t(GeneratorFieldsNameEnum.MSG_COUNT)}` }],
15 18 componentProps: {
16 19 min: 0,
17   - placeholder: `请输入${GeneratorFieldsNameEnum.MSG_COUNT}`,
  20 + placeholder: `请输入${t(GeneratorFieldsNameEnum.MSG_COUNT)}`,
18 21 },
19 22 },
20 23 {
21 24 field: GeneratorFieldsEnum.PERIOD_IN_SECONDS,
22 25 component: 'InputNumber',
23   - label: GeneratorFieldsNameEnum.PERIOD_IN_SECONDS,
24   - required: true,
  26 + label: t(GeneratorFieldsNameEnum.PERIOD_IN_SECONDS),
  27 + rules: [{ required: true, message: `请输入${t(GeneratorFieldsNameEnum.PERIOD_IN_SECONDS)}` }],
25 28 componentProps: {
26 29 min: 0,
27   - placeholder: `请输入${GeneratorFieldsNameEnum.PERIOD_IN_SECONDS}`,
  30 + placeholder: `请输入${t(GeneratorFieldsNameEnum.PERIOD_IN_SECONDS)}`,
28 31 },
29 32 },
30 33 {
31 34 field: GeneratorFieldsEnum.ORIGINATOR_TYPE,
32 35 component: 'Select',
33   - label: GeneratorFieldsNameEnum.ORIGINATOR_TYPE,
  36 + label: t(GeneratorFieldsNameEnum.ORIGINATOR_TYPE),
34 37 colProps: { span: 8 },
35 38 componentProps: {
36 39 options: Object.keys(EntityTypeEnum).map((value) => ({
37 40 label: EntityTypeNameEnum[value],
38 41 value,
39 42 })),
40   - placeholder: `请选择${GeneratorFieldsNameEnum.ORIGINATOR_TYPE}`,
  43 + placeholder: `请选择${t(GeneratorFieldsNameEnum.ORIGINATOR_TYPE)}`,
41 44 getPopupContainer: () => document.body,
42 45 },
43 46 },
... ... @@ -54,7 +57,7 @@ export const formSchemas: FormSchema[] = [
54 57 {
55 58 field: GeneratorFieldsEnum.JS_SCRIPT,
56 59 component: 'JavascriptEditorWithTestModal',
57   - label: GeneratorFieldsNameEnum.JS_SCRIPT,
  60 + label: t(GeneratorFieldsNameEnum.JS_SCRIPT),
58 61 valueField: 'value',
59 62 changeEvent: 'update:value',
60 63 componentProps: {
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ActionCategoryComponentEnum.GENERATOR);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10
11 11 export interface GeneratorDataType {
12 12 someConfiguration?: Recordable;
... ...
... ... @@ -4,34 +4,49 @@ import {
4 4 GpsGeofencingEventsFieldsNameEnum,
5 5 } from '../../../enum/formField/action';
6 6 import { FormSchema } from '/@/components/Form';
  7 +import { useI18n } from '/@/hooks/web/useI18n';
  8 +
  9 +const { t } = useI18n();
7 10
8 11 export const formSchemas: FormSchema[] = [
9 12 {
10 13 field: GpsGeofencingEventsFieldsEnum.LATITUDE_KEY_NAME,
11 14 component: 'Input',
12   - label: GpsGeofencingEventsFieldsNameEnum.LATITUDE_KEY_NAME,
13   - required: true,
  15 + label: t(GpsGeofencingEventsFieldsNameEnum.LATITUDE_KEY_NAME),
  16 + rules: [
  17 + {
  18 + required: true,
  19 + message: `请输入${t(GpsGeofencingEventsFieldsNameEnum.LATITUDE_KEY_NAME)}`,
  20 + },
  21 + ],
14 22 componentProps: {
15   - placeholder: `请输入${GpsGeofencingEventsFieldsNameEnum.LATITUDE_KEY_NAME}`,
  23 + placeholder: `请输入${t(GpsGeofencingEventsFieldsNameEnum.LATITUDE_KEY_NAME)}`,
16 24 },
17 25 },
18 26 {
19 27 field: GpsGeofencingEventsFieldsEnum.LONGITUDE_KEY_NAME,
20 28 component: 'Input',
21   - label: GpsGeofencingEventsFieldsNameEnum.LONGITUDE_KEY_NAME,
22   - required: true,
  29 + label: t(GpsGeofencingEventsFieldsNameEnum.LONGITUDE_KEY_NAME),
  30 + rules: [
  31 + {
  32 + required: true,
  33 + message: `请输入${t(GpsGeofencingEventsFieldsNameEnum.LONGITUDE_KEY_NAME)}`,
  34 + },
  35 + ],
23 36 componentProps: {
24   - placeholder: `请输入${GpsGeofencingEventsFieldsNameEnum.LONGITUDE_KEY_NAME}`,
  37 + placeholder: `请输入${t(GpsGeofencingEventsFieldsNameEnum.LONGITUDE_KEY_NAME)}`,
25 38 },
26 39 },
27 40 {
28 41 field: GpsGeofencingEventsFieldsEnum.PERIMETER_TYPE,
29 42 component: 'Select',
30   - label: GpsGeofencingEventsFieldsNameEnum.PERIMETER_TYPE,
31   - required: true,
  43 + label: t(GpsGeofencingEventsFieldsNameEnum.PERIMETER_TYPE),
  44 + rules: [
  45 + { required: true, message: `请选择${t(GpsGeofencingEventsFieldsNameEnum.PERIMETER_TYPE)}` },
  46 + ],
32 47 componentProps: {
33 48 options: Object.keys(PerimeterTypeEnum).map((value) => ({ label: value, value })),
34   - placeholder: `请选择${GpsGeofencingEventsFieldsNameEnum.PERIMETER_TYPE}`,
  49 + placeholder: `请选择${t(GpsGeofencingEventsFieldsNameEnum.PERIMETER_TYPE)}`,
35 50 },
36 51 },
37 52 {
... ... @@ -39,143 +54,178 @@ export const formSchemas: FormSchema[] = [
39 54 component: 'Checkbox',
40 55 label: '',
41 56 renderComponentContent: () => ({
42   - default: () => GpsGeofencingEventsFieldsNameEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA,
  57 + default: () =>
  58 + t(GpsGeofencingEventsFieldsNameEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA),
43 59 }),
44 60 },
45 61 {
46 62 field: GpsGeofencingEventsFieldsEnum.PERIMETER_KEY_NAME,
47 63 component: 'Input',
48   - label: GpsGeofencingEventsFieldsNameEnum.PERIMETER_KEY_NAME,
49   - required: true,
  64 + label: t(GpsGeofencingEventsFieldsNameEnum.PERIMETER_KEY_NAME),
50 65 ifShow: ({ model }) =>
51 66 model[GpsGeofencingEventsFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.POLYGON &&
52 67 model[GpsGeofencingEventsFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA],
  68 + rules: [
  69 + {
  70 + required: true,
  71 + message: `请输入${t(GpsGeofencingEventsFieldsNameEnum.PERIMETER_KEY_NAME)}`,
  72 + },
  73 + ],
53 74 componentProps: {
54   - placeholder: `请输入${GpsGeofencingEventsFieldsNameEnum.PERIMETER_KEY_NAME}`,
  75 + placeholder: `请输入${t(GpsGeofencingEventsFieldsNameEnum.PERIMETER_KEY_NAME)}`,
55 76 },
56 77 },
57 78 {
58 79 field: GpsGeofencingEventsFieldsEnum.POLYGONS_DEFINITION,
59 80 component: 'Input',
60   - label: GpsGeofencingEventsFieldsNameEnum.POLYGONS_DEFINITION,
  81 + label: t(GpsGeofencingEventsFieldsNameEnum.POLYGONS_DEFINITION),
61 82 helpMessage:
62 83 'Please, use the following format for manual definition of polygon: [[lat1,lon1],[lat2,lon2], ... ,[latN,lonN]].',
63   - required: true,
64 84 ifShow: ({ model }) =>
65 85 model[GpsGeofencingEventsFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.POLYGON &&
66 86 !model[GpsGeofencingEventsFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA],
  87 + rules: [
  88 + {
  89 + required: true,
  90 + message: `请输入${t(GpsGeofencingEventsFieldsNameEnum.POLYGONS_DEFINITION)}`,
  91 + },
  92 + ],
67 93 componentProps: {
68   - placeholder: `请输入${GpsGeofencingEventsFieldsNameEnum.POLYGONS_DEFINITION}`,
  94 + placeholder: `请输入${t(GpsGeofencingEventsFieldsNameEnum.POLYGONS_DEFINITION)}`,
69 95 },
70 96 },
71 97 {
72 98 field: GpsGeofencingEventsFieldsEnum.CENTER_LATITUDE,
73 99 component: 'InputNumber',
74   - label: GpsGeofencingEventsFieldsNameEnum.CENTER_LATITUDE,
  100 + label: t(GpsGeofencingEventsFieldsNameEnum.CENTER_LATITUDE),
75 101 colProps: { span: 12 },
76   - required: true,
77 102 ifShow: ({ model }) =>
78 103 model[GpsGeofencingEventsFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.CIRCLE &&
79 104 !model[GpsGeofencingEventsFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA],
  105 + rules: [
  106 + { required: true, message: `请输入${t(GpsGeofencingEventsFieldsNameEnum.CENTER_LATITUDE)}` },
  107 + ],
80 108 componentProps: {
81   - placeholder: `请输入${GpsGeofencingEventsFieldsNameEnum.CENTER_LATITUDE}`,
  109 + placeholder: `请输入${t(GpsGeofencingEventsFieldsNameEnum.CENTER_LATITUDE)}`,
82 110 },
83 111 },
84 112 {
85 113 field: GpsGeofencingEventsFieldsEnum.CENTER_LONGITUDE,
86 114 component: 'InputNumber',
87   - label: GpsGeofencingEventsFieldsNameEnum.CENTER_LONGITUDE,
  115 + label: t(GpsGeofencingEventsFieldsNameEnum.CENTER_LONGITUDE),
88 116 colProps: { span: 12 },
89 117 ifShow: ({ model }) =>
90 118 model[GpsGeofencingEventsFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.CIRCLE &&
91 119 !model[GpsGeofencingEventsFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA],
92 120 componentProps: {
93   - placeholder: `请输入${GpsGeofencingEventsFieldsNameEnum.CENTER_LONGITUDE}`,
  121 + placeholder: `请输入${t(GpsGeofencingEventsFieldsNameEnum.CENTER_LONGITUDE)}`,
94 122 },
95 123 },
96 124 {
97 125 field: GpsGeofencingEventsFieldsEnum.RANGE,
98 126 component: 'InputNumber',
99   - label: GpsGeofencingEventsFieldsNameEnum.RANGE,
  127 + label: t(GpsGeofencingEventsFieldsNameEnum.RANGE),
100 128 colProps: { span: 12 },
101   - required: true,
102 129 ifShow: ({ model }) =>
103 130 model[GpsGeofencingEventsFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.CIRCLE &&
104 131 !model[GpsGeofencingEventsFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA],
  132 + rules: [{ required: true, message: `请输入${t(GpsGeofencingEventsFieldsNameEnum.RANGE)}` }],
105 133 componentProps: {
106   - placeholder: `请输入${GpsGeofencingEventsFieldsNameEnum.RANGE}`,
  134 + placeholder: `请输入${t(GpsGeofencingEventsFieldsNameEnum.RANGE)}`,
107 135 },
108 136 },
109 137 {
110 138 field: GpsGeofencingEventsFieldsEnum.RANGE_UNIT,
111 139 component: 'Select',
112   - label: GpsGeofencingEventsFieldsNameEnum.RANGE_UNIT,
  140 + label: t(GpsGeofencingEventsFieldsNameEnum.RANGE_UNIT),
113 141 colProps: { span: 12 },
114   - required: true,
115 142 ifShow: ({ model }) =>
116 143 model[GpsGeofencingEventsFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.CIRCLE &&
117 144 !model[GpsGeofencingEventsFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA],
  145 + rules: [
  146 + { required: true, message: `请选择${t(GpsGeofencingEventsFieldsNameEnum.RANGE_UNIT)}` },
  147 + ],
118 148 componentProps: {
119 149 options: Object.keys(RangeUtilEnum).map((value) => ({
120 150 label: RangeUtilNameEnum[value],
121 151 value,
122 152 })),
123 153 getPopupContainer: () => document.body,
124   - placeholder: `请选择${GpsGeofencingEventsFieldsNameEnum.RANGE_UNIT}`,
  154 + placeholder: `请选择${t(GpsGeofencingEventsFieldsNameEnum.RANGE_UNIT)}`,
125 155 },
126 156 },
127 157 {
128 158 field: GpsGeofencingEventsFieldsEnum.MIN_INSIDE_DURATION,
129 159 component: 'InputNumber',
130   - label: GpsGeofencingEventsFieldsNameEnum.MIN_INSIDE_DURATION,
  160 + label: t(GpsGeofencingEventsFieldsNameEnum.MIN_INSIDE_DURATION),
131 161 colProps: { span: 12 },
132   - required: true,
  162 + rules: [
  163 + {
  164 + required: true,
  165 + message: `请输入${t(GpsGeofencingEventsFieldsNameEnum.MIN_INSIDE_DURATION)}`,
  166 + },
  167 + ],
133 168 componentProps: {
134 169 min: 1,
135 170 max: 2147483647,
136   - placeholder: `请输入${GpsGeofencingEventsFieldsNameEnum.MIN_INSIDE_DURATION}`,
  171 + placeholder: `请输入${t(GpsGeofencingEventsFieldsNameEnum.MIN_INSIDE_DURATION)}`,
137 172 },
138 173 },
139 174 {
140 175 field: GpsGeofencingEventsFieldsEnum.MIN_INSIDE_DURATION_TIME_UNIT,
141 176 component: 'Select',
142   - label: GpsGeofencingEventsFieldsNameEnum.MIN_INSIDE_DURATION_TIME_UNIT,
  177 + label: t(GpsGeofencingEventsFieldsNameEnum.MIN_INSIDE_DURATION_TIME_UNIT),
143 178 colProps: { span: 12 },
144   - required: true,
  179 + rules: [
  180 + {
  181 + required: true,
  182 + message: `请输入${t(GpsGeofencingEventsFieldsNameEnum.MIN_INSIDE_DURATION_TIME_UNIT)}`,
  183 + },
  184 + ],
145 185 componentProps: {
146 186 options: Object.keys(RangeUtilEnum).map((value) => ({
147 187 label: RangeUtilNameEnum[value],
148 188 value,
149 189 })),
150 190 getPopupContainer: () => document.body,
151   - placeholder: `请输入${GpsGeofencingEventsFieldsNameEnum.MIN_INSIDE_DURATION_TIME_UNIT}`,
  191 + placeholder: `请输入${t(GpsGeofencingEventsFieldsNameEnum.MIN_INSIDE_DURATION_TIME_UNIT)}`,
152 192 },
153 193 },
154 194 {
155 195 field: GpsGeofencingEventsFieldsEnum.MIN_OUTSIDE_DURATION,
156 196 component: 'InputNumber',
157   - label: GpsGeofencingEventsFieldsNameEnum.MIN_OUTSIDE_DURATION,
  197 + label: t(GpsGeofencingEventsFieldsNameEnum.MIN_OUTSIDE_DURATION),
158 198 colProps: { span: 12 },
159   - required: true,
  199 + rules: [
  200 + {
  201 + required: true,
  202 + message: `请输入${t(GpsGeofencingEventsFieldsNameEnum.MIN_OUTSIDE_DURATION)}`,
  203 + },
  204 + ],
160 205 componentProps: {
161 206 min: 1,
162 207 max: 2147483647,
163   - placeholder: `请输入${GpsGeofencingEventsFieldsNameEnum.MIN_OUTSIDE_DURATION}`,
  208 + placeholder: `请输入${t(GpsGeofencingEventsFieldsNameEnum.MIN_OUTSIDE_DURATION)}`,
164 209 },
165 210 },
166 211 {
167 212 field: GpsGeofencingEventsFieldsEnum.MIN_OUTSIDE_DURATION_TIME_UNIT,
168 213 component: 'Select',
169   - label: GpsGeofencingEventsFieldsNameEnum.MIN_OUTSIDE_DURATION_TIME_UNIT,
  214 + label: t(GpsGeofencingEventsFieldsNameEnum.MIN_OUTSIDE_DURATION_TIME_UNIT),
170 215 colProps: { span: 12 },
171   - required: true,
  216 + rules: [
  217 + {
  218 + required: true,
  219 + message: `请输入${t(GpsGeofencingEventsFieldsNameEnum.MIN_OUTSIDE_DURATION_TIME_UNIT)}`,
  220 + },
  221 + ],
172 222 componentProps: {
173 223 options: Object.keys(RangeUtilEnum).map((value) => ({
174 224 label: RangeUtilNameEnum[value],
175 225 value,
176 226 })),
177 227 getPopupContainer: () => document.body,
178   - placeholder: `请输入${GpsGeofencingEventsFieldsNameEnum.MIN_OUTSIDE_DURATION_TIME_UNIT}`,
  228 + placeholder: `请输入${t(GpsGeofencingEventsFieldsNameEnum.MIN_OUTSIDE_DURATION_TIME_UNIT)}`,
179 229 },
180 230 },
181 231 ];
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ActionCategoryComponentEnum.GPS_GEOFENCING_EVENTS);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface GpsGeofencingEventsDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
1 1 import { LogFieldsEnum, LogFieldsNameEnum } from '../../../enum/formField/action';
2 2 import { JavascriptEditorWithTestModal } from '../../../src/components/JavaScriptFilterModal';
3 3 import { FormSchema, useComponentRegister } from '/@/components/Form';
  4 +import { useI18n } from '/@/hooks/web/useI18n';
  5 +const { t } = useI18n();
4 6
5 7 useComponentRegister('JavascriptEditorWithTestModal', JavascriptEditorWithTestModal);
6 8
... ... @@ -8,7 +10,7 @@ export const formSchemas: FormSchema[] = [
8 10 {
9 11 field: LogFieldsEnum.JS_SCRIPT,
10 12 component: 'JavascriptEditorWithTestModal',
11   - label: LogFieldsNameEnum.JS_SCRIPT,
  13 + label: t(LogFieldsNameEnum.JS_SCRIPT),
12 14 valueField: 'value',
13 15 changeEvent: 'update:value',
14 16 componentProps: {
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ActionCategoryComponentEnum.LOG);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface LogDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
1 1 import { MessageCountFieldsEnum, MessageCountFieldsNameEnum } from '../../../enum/formField/action';
2 2 import { FormSchema } from '/@/components/Form';
  3 +import { useI18n } from '/@/hooks/web/useI18n';
  4 +
  5 +const { t } = useI18n();
3 6
4 7 export const formSchemas: FormSchema[] = [
5 8 {
6 9 field: MessageCountFieldsEnum.INTERVAL,
7 10 component: 'InputNumber',
8   - label: MessageCountFieldsNameEnum.INTERVAL,
9   - required: true,
  11 + label: t(MessageCountFieldsNameEnum.INTERVAL),
  12 + rules: [{ required: true, message: `请输入${t(MessageCountFieldsNameEnum.INTERVAL)}` }],
10 13 componentProps: {
11 14 step: 1,
12 15 precision: 0,
13   - placeholder: `请输入${MessageCountFieldsNameEnum.INTERVAL}`,
  16 + placeholder: `请输入${t(MessageCountFieldsNameEnum.INTERVAL)}`,
14 17 },
15 18 },
16 19 {
17 20 field: MessageCountFieldsEnum.TELEMETRY_PREFIX,
18 21 component: 'Input',
19   - label: MessageCountFieldsNameEnum.TELEMETRY_PREFIX,
20   - required: true,
  22 + label: t(MessageCountFieldsNameEnum.TELEMETRY_PREFIX),
  23 + rules: [{ required: true, message: `请输入${t(MessageCountFieldsNameEnum.TELEMETRY_PREFIX)}` }],
21 24 componentProps: {
22   - placeholder: `请输入${MessageCountFieldsNameEnum.TELEMETRY_PREFIX}`,
  25 + placeholder: `请输入${t(MessageCountFieldsNameEnum.TELEMETRY_PREFIX)}`,
23 26 },
24 27 },
25 28 ];
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ActionCategoryComponentEnum.MESSAGE_COUNT);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10
11 11 export interface MessageCountDataType {
12 12 someConfiguration?: Recordable;
... ...
1 1 import { ScopeEnum, ScopeNameEnum } from '../../../enum/form';
2 2 import { PushToEdgeFieldsEnum, PushToEdgeFieldsNameEnum } from '../../../enum/formField/action';
3 3 import { FormSchema } from '/@/components/Form';
  4 +import { useI18n } from '/@/hooks/web/useI18n';
  5 +
  6 +const { t } = useI18n();
4 7
5 8 export const formSchemas: FormSchema[] = [
6 9 {
7 10 field: PushToEdgeFieldsEnum.SCOPE,
8 11 component: 'Select',
9   - label: PushToEdgeFieldsNameEnum.SCOPE,
10   - required: true,
  12 + label: t(PushToEdgeFieldsNameEnum.SCOPE),
  13 + rules: [{ required: true, message: `请选择${t(PushToEdgeFieldsNameEnum.SCOPE)}` }],
11 14 componentProps: {
12 15 options: Object.keys(ScopeEnum).map((value) => ({ label: ScopeNameEnum[value], value })),
13 16 getPopupContainer: () => document.body,
14   - placeholder: `请选择${PushToEdgeFieldsNameEnum.SCOPE}`,
  17 + placeholder: `请选择${t(PushToEdgeFieldsNameEnum.SCOPE)}`,
15 18 },
16 19 },
17 20 ];
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ActionCategoryComponentEnum.PUSH_TO_EDGE);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface PushToEdgeDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
1 1 import { RpcCallReplyFieldsEnum, RpcCallReplyFieldsNameEnum } from '../../../enum/formField/action';
2 2 import { FormSchema } from '/@/components/Form';
  3 +import { useI18n } from '/@/hooks/web/useI18n';
  4 +
  5 +const { t } = useI18n();
3 6
4 7 export const formSchemas: FormSchema[] = [
5 8 {
6 9 field: RpcCallReplyFieldsEnum.REQUEST_ID_META_DATA_ATTRIBUTE,
7 10 component: 'Input',
8   - label: RpcCallReplyFieldsNameEnum.REQUEST_ID_META_DATA_ATTRIBUTE,
  11 + label: t(RpcCallReplyFieldsNameEnum.REQUEST_ID_META_DATA_ATTRIBUTE),
9 12 componentProps: {
10   - placeholder: `请输入${RpcCallReplyFieldsNameEnum.REQUEST_ID_META_DATA_ATTRIBUTE}`,
  13 + placeholder: `请输入${t(RpcCallReplyFieldsNameEnum.REQUEST_ID_META_DATA_ATTRIBUTE)}`,
11 14 },
12 15 },
13 16 ];
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ActionCategoryComponentEnum.RPC_CALL_REPLY);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface RpcCallReplyDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -3,16 +3,19 @@ import {
3 3 RpcCallRequestFieldsNameEnum,
4 4 } from '../../../enum/formField/action';
5 5 import { FormSchema } from '/@/components/Form';
  6 +import { useI18n } from '/@/hooks/web/useI18n';
  7 +
  8 +const { t } = useI18n();
6 9
7 10 export const formSchemas: FormSchema[] = [
8 11 {
9 12 field: RpcCallRequestFieldsEnum.TIMEOUT_IN_SECONDS,
10 13 component: 'InputNumber',
11   - label: RpcCallRequestFieldsNameEnum.TIMEOUT_IN_SECONDS,
  14 + label: t(RpcCallRequestFieldsNameEnum.TIMEOUT_IN_SECONDS),
12 15 required: true,
13 16 componentProps: {
14 17 min: 0,
15   - placeholder: `请输入${RpcCallRequestFieldsNameEnum.TIMEOUT_IN_SECONDS}`,
  18 + placeholder: `请输入${t(RpcCallRequestFieldsNameEnum.TIMEOUT_IN_SECONDS)}`,
16 19 },
17 20 },
18 21 ];
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ActionCategoryComponentEnum.RPC_CALL_REQUEST);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface RpcCallRequestDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -4,23 +4,26 @@ import {
4 4 SaveAttributesFieldsNameEnum,
5 5 } from '../../../enum/formField/action';
6 6 import { FormSchema } from '/@/components/Form';
  7 +import { useI18n } from '/@/hooks/web/useI18n';
  8 +
  9 +const { t } = useI18n();
7 10
8 11 export const formSchemas: FormSchema[] = [
9 12 {
10 13 field: SaveAttributesFieldsEnum.SCOPE,
11 14 component: 'Select',
12   - label: SaveAttributesFieldsNameEnum.SCOPE,
  15 + label: t(SaveAttributesFieldsNameEnum.SCOPE),
13 16 required: true,
14 17 componentProps: {
15 18 options: Object.keys(ScopeEnum).map((value) => ({ label: ScopeNameEnum[value], value })),
16 19 getPopupContainer: () => document.body,
17   - placeholder: `请选择${SaveAttributesFieldsNameEnum.SCOPE}`,
  20 + placeholder: `请选择${t(SaveAttributesFieldsNameEnum.SCOPE)}`,
18 21 },
19 22 },
20 23 {
21 24 field: SaveAttributesFieldsEnum.NOTIFY_DEVICE,
22 25 component: 'Checkbox',
23   - label: SaveAttributesFieldsNameEnum.NOTIFY_DEVICE,
  26 + label: t(SaveAttributesFieldsNameEnum.NOTIFY_DEVICE),
24 27 ifShow: ({ model }) => model[SaveAttributesFieldsEnum.SCOPE] === ScopeEnum.SHARED_SCOPE,
25 28 renderComponentContent: () => ({
26 29 default: () =>
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ActionCategoryComponentEnum.SAVE_ATTRIBUTES);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface SaveAttributesDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
1 1 import { h } from 'vue';
2 2 import { SaveEventFieldsEnum, SaveEventFieldsNameEnum } from '../../../enum/formField/action';
3 3 import { FormSchema } from '/@/components/Form';
  4 +import { useI18n } from '/@/hooks/web/useI18n';
  5 +
  6 +const { t } = useI18n();
4 7
5 8 export const formSchemas: FormSchema[] = [
6 9 {
... ... @@ -17,7 +20,7 @@ export const formSchemas: FormSchema[] = [
17 20 {
18 21 field: SaveEventFieldsEnum.CONFIGURATION,
19 22 component: 'JSONEditor',
20   - label: SaveEventFieldsNameEnum.CONFIGURATION,
  23 + label: t(SaveEventFieldsNameEnum.CONFIGURATION),
21 24 valueField: 'value',
22 25 changeEvent: 'update:value',
23 26 },
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ActionCategoryComponentEnum.SAVE_EVENT);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface SaveEventDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -3,16 +3,19 @@ import {
3 3 SaveTimeseriesFieldsNameEnum,
4 4 } from '../../../enum/formField/action';
5 5 import { FormSchema } from '/@/components/Form';
  6 +import { useI18n } from '/@/hooks/web/useI18n';
  7 +
  8 +const { t } = useI18n();
6 9
7 10 export const formSchemas: FormSchema[] = [
8 11 {
9 12 field: SaveTimeseriesFieldsEnum.DEFAULT_TTL,
10 13 component: 'InputNumber',
11   - label: SaveTimeseriesFieldsNameEnum.DEFAULT_TTL,
  14 + label: t(SaveTimeseriesFieldsNameEnum.DEFAULT_TTL),
12 15 required: true,
13 16 componentProps: {
14 17 min: 0,
15   - placeholder: `请输入${SaveTimeseriesFieldsNameEnum.DEFAULT_TTL}`,
  18 + placeholder: `请输入${t(SaveTimeseriesFieldsNameEnum.DEFAULT_TTL)}`,
16 19 },
17 20 },
18 21 {
... ... @@ -20,13 +23,13 @@ export const formSchemas: FormSchema[] = [
20 23 component: 'Checkbox',
21 24 label: '',
22 25 renderComponentContent: () => ({
23   - default: () => SaveTimeseriesFieldsNameEnum.DEFAULT_TTL,
  26 + default: () => t(SaveTimeseriesFieldsNameEnum.DEFAULT_TTL),
24 27 }),
25 28 },
26 29 {
27 30 field: SaveTimeseriesFieldsEnum.USE_SERVER_TS,
28 31 component: 'Checkbox',
29   - label: SaveTimeseriesFieldsNameEnum.USE_SERVER_TS,
  32 + label: t(SaveTimeseriesFieldsNameEnum.USE_SERVER_TS),
30 33 renderComponentContent: () => ({
31 34 default: () =>
32 35 'Enable this setting to use the timestamp of the message processing instead of the timestamp from the message. Useful for all sorts of sequential processing if you merge messages from multiple sources (devices, assets, etc).',
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ActionCategoryComponentEnum.SAVE_TIMESERIES);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface SaveTimeseriesDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -5,22 +5,25 @@ import {
5 5 import { AttributeConfiguration } from '../../../src/components/AttributeConfiguration';
6 6 import { FormSchema, useComponentRegister } from '/@/components/Form';
7 7 import { isObject } from '/@/utils/is';
  8 +import { useI18n } from '/@/hooks/web/useI18n';
  9 +
  10 +const { t } = useI18n();
8 11
9 12 useComponentRegister('AttributeConfiguration', AttributeConfiguration);
10 13 export const formSchemas: FormSchema[] = [
11 14 {
12 15 field: SaveToCustomTableFieldsEnum.TABLE_NAME,
13 16 component: 'Input',
14   - label: SaveToCustomTableFieldsNameEnum.TABLE_NAME,
  17 + label: t(SaveToCustomTableFieldsNameEnum.TABLE_NAME),
15 18 required: true,
16 19 componentProps: {
17   - placeholder: `请输入${SaveToCustomTableFieldsEnum.TABLE_NAME}`,
  20 + placeholder: `请输入${t(SaveToCustomTableFieldsNameEnum.TABLE_NAME)}`,
18 21 },
19 22 },
20 23 {
21 24 field: SaveToCustomTableFieldsEnum.FIELDS_MAPPING,
22 25 component: 'AttributeConfiguration',
23   - label: SaveToCustomTableFieldsNameEnum.FIELDS_MAPPING,
  26 + label: t(SaveToCustomTableFieldsNameEnum.FIELDS_MAPPING),
24 27 required: true,
25 28 valueField: 'value',
26 29 changeEvent: 'update:value',
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ActionCategoryComponentEnum.SAVE_TO_CUSTOM_TABLE);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface SaveToCustomTableDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ActionCategoryComponentEnum.SYNCHRONIZATION_END);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface SynchronizationEndDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ActionCategoryComponentEnum.SYNCHRONIZATION_START);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface SynchronizationStartDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -4,31 +4,34 @@ import {
4 4 } from '../../../enum/formField/action';
5 5
6 6 import { FormSchema } from '/@/components/Form';
  7 +import { useI18n } from '/@/hooks/web/useI18n';
  8 +
  9 +const { t } = useI18n();
7 10
8 11 export const formSchemas: FormSchema[] = [
9 12 {
10 13 field: UnassignFromCustomerFieldsEnum.CUSTOMER_NAME_PATTERN,
11   - label: UnassignFromCustomerFieldsNameEnum.CUSTOMER_NAME_PATTERN,
  14 + label: t(UnassignFromCustomerFieldsNameEnum.CUSTOMER_NAME_PATTERN),
12 15 component: 'Input',
13 16 required: true,
14 17 helpMessage: [
15 18 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
16 19 ],
17 20 componentProps: {
18   - placeholder: `请输入${UnassignFromCustomerFieldsNameEnum.CUSTOMER_NAME_PATTERN}`,
  21 + placeholder: `请输入${t(UnassignFromCustomerFieldsNameEnum.CUSTOMER_NAME_PATTERN)}`,
19 22 },
20 23 },
21 24 {
22 25 field: UnassignFromCustomerFieldsEnum.CUSTOMER_CACHE_EXPIRATION,
23 26 component: 'InputNumber',
24   - label: UnassignFromCustomerFieldsNameEnum.CUSTOMER_CACHE_EXPIRATION,
  27 + label: t(UnassignFromCustomerFieldsNameEnum.CUSTOMER_CACHE_EXPIRATION),
25 28 required: true,
26 29 helpMessage: [
27 30 'Specifies maximum time interval allowed to store found customer records. 0 value means that records will never expire.',
28 31 ],
29 32 componentProps: {
30 33 min: 0,
31   - placeholder: `请输入${UnassignFromCustomerFieldsNameEnum.CUSTOMER_CACHE_EXPIRATION}`,
  34 + placeholder: `请输入${t(UnassignFromCustomerFieldsNameEnum.CUSTOMER_CACHE_EXPIRATION)}`,
32 35 },
33 36 },
34 37 ];
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ActionCategoryComponentEnum.UNASSIGN_FROM_CUSTOMER);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface UnassignFromCustomerDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -24,7 +24,7 @@ import { SaveAttributesConfig } from './SaveAttributes';
24 24 import { CreateRelationConfig } from './CreateRelation';
25 25 import { useI18n } from '/@/hooks/web/useI18n';
26 26
27   -const { t } = useI18n(); //加载国际化
  27 +const { t } = useI18n(); // 加载国际化
28 28 export const ActionCategoryConfig: CategoryConfigType = {
29 29 category: RuleNodeTypeEnum.ACTION,
30 30 title: t('designer_config.actions.index.title'),
... ...
... ... @@ -3,37 +3,44 @@ import {
3 3 CalculateDeltaFieldsNameEnum,
4 4 } from '../../../enum/formField/enrichment';
5 5 import { FormSchema } from '/@/components/Form';
  6 +import { useI18n } from '/@/hooks/web/useI18n';
  7 +
  8 +const { t } = useI18n();
6 9
7 10 export const formSchemas: FormSchema[] = [
8 11 {
9 12 field: CalculateDeltaFieldsEnum.INPUT_VALUE_KEY,
10 13 component: 'Input',
11   - label: CalculateDeltaFieldsNameEnum.INPUT_VALUE_KEY,
12   - required: true,
  14 + label: t(CalculateDeltaFieldsNameEnum.INPUT_VALUE_KEY),
13 15 colProps: { span: 8 },
  16 + rules: [
  17 + { required: true, message: `请输入${t(CalculateDeltaFieldsNameEnum.INPUT_VALUE_KEY)}` },
  18 + ],
14 19 componentProps: {
15   - placeholder: `请输入${CalculateDeltaFieldsNameEnum.INPUT_VALUE_KEY}`,
  20 + placeholder: `请输入${t(CalculateDeltaFieldsNameEnum.INPUT_VALUE_KEY)}`,
16 21 },
17 22 },
18 23 {
19 24 field: CalculateDeltaFieldsEnum.OUTPUT_VALUE_KEY,
20 25 component: 'Input',
21   - label: CalculateDeltaFieldsNameEnum.OUTPUT_VALUE_KEY,
22   - required: true,
  26 + label: t(CalculateDeltaFieldsNameEnum.OUTPUT_VALUE_KEY),
23 27 colProps: { span: 8 },
  28 + rules: [
  29 + { required: true, message: `请输入${t(CalculateDeltaFieldsNameEnum.OUTPUT_VALUE_KEY)}` },
  30 + ],
24 31 componentProps: {
25   - placeholder: `请输入${CalculateDeltaFieldsNameEnum.OUTPUT_VALUE_KEY}`,
  32 + placeholder: `请输入${t(CalculateDeltaFieldsNameEnum.OUTPUT_VALUE_KEY)}`,
26 33 },
27 34 },
28 35 {
29 36 field: CalculateDeltaFieldsEnum.ROUND,
30 37 component: 'InputNumber',
31   - label: CalculateDeltaFieldsNameEnum.ROUND,
  38 + label: t(CalculateDeltaFieldsNameEnum.ROUND),
32 39 colProps: { span: 8 },
33 40 componentProps: {
34 41 step: 1,
35 42 max: 15,
36   - placeholder: `请输入${CalculateDeltaFieldsNameEnum.ROUND}`,
  43 + placeholder: `请输入${t(CalculateDeltaFieldsNameEnum.ROUND)}`,
37 44 },
38 45 },
39 46 {
... ... @@ -42,7 +49,7 @@ export const formSchemas: FormSchema[] = [
42 49 label: '',
43 50 renderComponentContent: () => {
44 51 return {
45   - default: () => CalculateDeltaFieldsNameEnum.USE_CACHE,
  52 + default: () => t(CalculateDeltaFieldsNameEnum.USE_CACHE),
46 53 };
47 54 },
48 55 },
... ... @@ -52,7 +59,7 @@ export const formSchemas: FormSchema[] = [
52 59 label: '',
53 60 renderComponentContent: () => {
54 61 return {
55   - default: () => CalculateDeltaFieldsNameEnum.TELL_FAILURE_IF_DELTA_IS_NEGATIVE,
  62 + default: () => t(CalculateDeltaFieldsNameEnum.TELL_FAILURE_IF_DELTA_IS_NEGATIVE),
56 63 };
57 64 },
58 65 },
... ... @@ -62,18 +69,18 @@ export const formSchemas: FormSchema[] = [
62 69 label: '',
63 70 renderComponentContent: () => {
64 71 return {
65   - default: () => CalculateDeltaFieldsNameEnum.ADD_PERIOD_BETWEEN_MSGS,
  72 + default: () => t(CalculateDeltaFieldsNameEnum.ADD_PERIOD_BETWEEN_MSGS),
66 73 };
67 74 },
68 75 },
69 76 {
70 77 field: CalculateDeltaFieldsEnum.PERIOD_VALUE_KEY,
71 78 component: 'Input',
72   - label: CalculateDeltaFieldsNameEnum.PERIOD_VALUE_KEY,
  79 + label: t(CalculateDeltaFieldsNameEnum.PERIOD_VALUE_KEY),
73 80 required: true,
74 81 ifShow: ({ model }) => model[CalculateDeltaFieldsEnum.ADD_PERIOD_BETWEEN_MSGS],
75 82 componentProps: {
76   - placeholder: `请输入${CalculateDeltaFieldsNameEnum.PERIOD_VALUE_KEY}`,
  83 + placeholder: `请输入${t(CalculateDeltaFieldsNameEnum.PERIOD_VALUE_KEY)}`,
77 84 },
78 85 },
79 86 ];
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(EnrichmentCategoryComponentEnum.CALCULATE_DELTA);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface CalculateDeltaDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -3,8 +3,11 @@ import {
3 3 CustomerAttributesFieldsNameEnum,
4 4 } from '../../../enum/formField/enrichment';
5 5 import { FormSchema, useComponentRegister } from '/@/components/Form';
  6 +import { useI18n } from '/@/hooks/web/useI18n';
6 7 import { AttributeConfiguration } from '/@/views/rule/designer/src/components/AttributeConfiguration';
7 8
  9 +const { t } = useI18n();
  10 +
8 11 useComponentRegister('AttributeConfiguration', AttributeConfiguration);
9 12
10 13 export const formSchemas: FormSchema[] = [
... ... @@ -14,14 +17,14 @@ export const formSchemas: FormSchema[] = [
14 17 label: '',
15 18 renderComponentContent: () => {
16 19 return {
17   - default: () => CustomerAttributesFieldsNameEnum.TELEMETRY,
  20 + default: () => t(CustomerAttributesFieldsNameEnum.TELEMETRY),
18 21 };
19 22 },
20 23 },
21 24 {
22 25 field: CustomerAttributesFieldsEnum.ATTR_MAPING,
23 26 component: 'AttributeConfiguration',
24   - label: CustomerAttributesFieldsNameEnum.ATTR_MAPING,
  27 + label: t(CustomerAttributesFieldsNameEnum.ATTR_MAPING),
25 28 slot: CustomerAttributesFieldsEnum.ATTR_MAPING,
26 29 valueField: 'value',
27 30 changeEvent: 'update:value',
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(EnrichmentCategoryComponentEnum.CUSTOMER_ATTRIBUTES);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface CustomerAttributesDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -4,13 +4,16 @@ import {
4 4 CustomerDetailsFieldsNameEnum,
5 5 } from '../../../enum/formField/enrichment';
6 6 import { FormSchema } from '/@/components/Form';
  7 +import { useI18n } from '/@/hooks/web/useI18n';
  8 +
  9 +const { t } = useI18n();
7 10
8 11 export const formSchemas: FormSchema[] = [
9 12 {
10 13 field: CustomerDetailsFieldsEnum.DETAILS_LIST,
11 14 component: 'Select',
12   - label: CustomerDetailsFieldsNameEnum.DETAILS_LIST,
13   - required: true, //ft修改为必传
  15 + label: t(CustomerDetailsFieldsNameEnum.DETAILS_LIST),
  16 + rules: [{ required: true, message: `请选择${t(CustomerDetailsFieldsNameEnum.DETAILS_LIST)}` }],
14 17 componentProps: {
15 18 mode: 'multiple',
16 19 options: Object.keys(DetailsListEnum).map((item) => ({
... ... @@ -18,6 +21,7 @@ export const formSchemas: FormSchema[] = [
18 21 value: item,
19 22 })),
20 23 getPopupContainer: () => document.body,
  24 + placeholder: `请选择${t(CustomerDetailsFieldsNameEnum.DETAILS_LIST)}`,
21 25 },
22 26 },
23 27 {
... ... @@ -26,7 +30,7 @@ export const formSchemas: FormSchema[] = [
26 30 label: '',
27 31 renderComponentContent: () => {
28 32 return {
29   - default: () => CustomerDetailsFieldsNameEnum.ADD_TO_METADATA,
  33 + default: () => t(CustomerDetailsFieldsNameEnum.ADD_TO_METADATA),
30 34 };
31 35 },
32 36 },
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(EnrichmentCategoryComponentEnum.CUSTOMER_DETAILS);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface CustomerDetailsDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -3,12 +3,15 @@ import {
3 3 OriginatorAttributesNameEnum,
4 4 } from '../../../enum/formField/enrichment';
5 5 import { FormSchema } from '/@/components/Form';
  6 +import { useI18n } from '/@/hooks/web/useI18n';
  7 +
  8 +const { t } = useI18n();
6 9
7 10 export const formSchemas: FormSchema[] = [
8 11 {
9 12 field: OriginatorAttributesEnum.TELL_FAILURE_IF_ABSENT,
10 13 component: 'Checkbox',
11   - label: OriginatorAttributesNameEnum.TELL_FAILURE_IF_ABSENT,
  14 + label: t(OriginatorAttributesNameEnum.TELL_FAILURE_IF_ABSENT),
12 15 renderComponentContent: () => ({
13 16 default: () =>
14 17 'If at least one selected key doesn\'t exist the outbound message will report "Failure".',
... ... @@ -17,59 +20,59 @@ export const formSchemas: FormSchema[] = [
17 20 {
18 21 field: OriginatorAttributesEnum.CLIENT_ATTRIBUTE_NAMES,
19 22 component: 'Select',
20   - label: OriginatorAttributesNameEnum.CLIENT_ATTRIBUTE_NAMES,
  23 + label: t(OriginatorAttributesNameEnum.CLIENT_ATTRIBUTE_NAMES),
21 24 helpMessage: [
22 25 `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`,
23 26 ],
24 27 componentProps: {
25 28 mode: 'tags',
26 29 open: false,
27   - placeholder: `请输入${OriginatorAttributesNameEnum.CLIENT_ATTRIBUTE_NAMES}`,
  30 + placeholder: `请输入${t(OriginatorAttributesNameEnum.CLIENT_ATTRIBUTE_NAMES)}`,
28 31 },
29 32 },
30 33 {
31 34 field: OriginatorAttributesEnum.SHARED_ATTRIBUTE_NAMES,
32 35 component: 'Select',
33   - label: OriginatorAttributesNameEnum.SHARED_ATTRIBUTE_NAMES,
  36 + label: t(OriginatorAttributesNameEnum.SHARED_ATTRIBUTE_NAMES),
34 37 helpMessage: [
35 38 `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`,
36 39 ],
37 40 componentProps: {
38 41 mode: 'tags',
39 42 open: false,
40   - placeholder: `请输入${OriginatorAttributesNameEnum.SHARED_ATTRIBUTE_NAMES}`,
  43 + placeholder: `请输入${t(OriginatorAttributesNameEnum.SHARED_ATTRIBUTE_NAMES)}`,
41 44 },
42 45 },
43 46 {
44 47 field: OriginatorAttributesEnum.SERVER_ATTRIBUTE_NAMES,
45 48 component: 'Select',
46   - label: OriginatorAttributesNameEnum.SERVER_ATTRIBUTE_NAMES,
  49 + label: t(OriginatorAttributesNameEnum.SERVER_ATTRIBUTE_NAMES),
47 50 helpMessage: [
48 51 `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`,
49 52 ],
50 53 componentProps: {
51 54 mode: 'tags',
52 55 open: false,
53   - placeholder: `请输入${OriginatorAttributesNameEnum.SERVER_ATTRIBUTE_NAMES}`,
  56 + placeholder: `请输入${t(OriginatorAttributesNameEnum.SERVER_ATTRIBUTE_NAMES)}`,
54 57 },
55 58 },
56 59 {
57 60 field: OriginatorAttributesEnum.LATEST_TS_KEY_NAMES,
58 61 component: 'Select',
59   - label: OriginatorAttributesNameEnum.LATEST_TS_KEY_NAMES,
  62 + label: t(OriginatorAttributesNameEnum.LATEST_TS_KEY_NAMES),
60 63 helpMessage: [
61 64 `Hint: use \${metadataKey} for value from metadata, $[messageKey] for value from message body`,
62 65 ],
63 66 componentProps: {
64 67 mode: 'tags',
65 68 open: false,
66   - placeholder: `请输入${OriginatorAttributesNameEnum.LATEST_TS_KEY_NAMES}`,
  69 + placeholder: `请输入${t(OriginatorAttributesNameEnum.LATEST_TS_KEY_NAMES)}`,
67 70 },
68 71 },
69 72 {
70 73 field: OriginatorAttributesEnum.GET_LATEST_VALUE_WITH_TS,
71 74 component: 'Checkbox',
72   - label: OriginatorAttributesNameEnum.GET_LATEST_VALUE_WITH_TS,
  75 + label: t(OriginatorAttributesNameEnum.GET_LATEST_VALUE_WITH_TS),
73 76 renderComponentContent: () => ({
74 77 default: () =>
75 78 'If selected, latest telemetry values will be added to the outbound message metadata with timestamp, e.g: "temp": "{"ts":1574329385897, "value":42}"',
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(EnrichmentCategoryComponentEnum.ORIGINATOR_ATTRIBUTES);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface OriginatorAttributesDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
1 1 import { OriginatorFieldsEnum, OriginatorFieldsNameEnum } from '../../../enum/formField/enrichment';
2 2 import { FormSchema, useComponentRegister } from '/@/components/Form';
3 3 import { AttributeConfiguration } from '/@/views/rule/designer/src/components/AttributeConfiguration';
  4 +import { useI18n } from '/@/hooks/web/useI18n';
  5 +
  6 +const { t } = useI18n();
4 7
5 8 useComponentRegister('AttributeConfiguration', AttributeConfiguration);
6 9
... ... @@ -8,7 +11,7 @@ export const formSchemas: FormSchema[] = [
8 11 {
9 12 field: OriginatorFieldsEnum.FIELDS_MAPPING,
10 13 component: 'AttributeConfiguration',
11   - label: OriginatorFieldsNameEnum.FIELDS_MAPPING,
  14 + label: t(OriginatorFieldsNameEnum.FIELDS_MAPPING),
12 15 slot: OriginatorFieldsEnum.FIELDS_MAPPING,
13 16 valueField: 'value',
14 17 changeEvent: 'update:value',
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(EnrichmentCategoryComponentEnum.ORIGINATOR_FIELDS);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface OriginatorFieldsDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -11,72 +11,79 @@ import {
11 11 OriginatorTelemetryFieldsNameEnum,
12 12 } from '../../../enum/formField/enrichment';
13 13 import { FormSchema } from '/@/components/Form';
  14 +import { useI18n } from '/@/hooks/web/useI18n';
  15 +
  16 +const { t } = useI18n();
14 17
15 18 export const formSchemas: FormSchema[] = [
16 19 {
17 20 field: OriginatorTelemetryFieldsEnum.LATEST_TS_KEY_NAMES,
18 21 component: 'Select',
19   - label: OriginatorTelemetryFieldsNameEnum.LATEST_TS_KEY_NAMES,
  22 + label: t(OriginatorTelemetryFieldsNameEnum.LATEST_TS_KEY_NAMES),
20 23 componentProps: {
21 24 mode: 'tags',
22 25 open: false,
23   - placeholder: `请输入${OriginatorTelemetryFieldsNameEnum.LATEST_TS_KEY_NAMES}`,
  26 + placeholder: `请输入${t(OriginatorTelemetryFieldsNameEnum.LATEST_TS_KEY_NAMES)}`,
24 27 getPopupContainer: () => document.body,
25 28 },
26 29 },
27 30 {
28 31 field: OriginatorTelemetryFieldsEnum.FETCH_MODE,
29 32 component: 'Select',
30   - label: OriginatorTelemetryFieldsNameEnum.FETCH_MODE,
31   - required: true,
  33 + label: t(OriginatorTelemetryFieldsNameEnum.FETCH_MODE),
  34 + rules: [
  35 + { required: true, message: `请选择${t(OriginatorTelemetryFieldsNameEnum.FETCH_MODE)}` },
  36 + ],
32 37 componentProps: {
33 38 options: Object.keys(FetchModeEnum).map((value) => ({ label: value, value })),
34   - placeholder: `请选择${OriginatorTelemetryFieldsNameEnum.FETCH_MODE}`,
  39 + placeholder: `请选择${t(OriginatorTelemetryFieldsNameEnum.FETCH_MODE)}`,
35 40 getPopupContainer: () => document.body,
36 41 },
37 42 },
38 43 {
39 44 field: OriginatorTelemetryFieldsEnum.AGGREGATION,
40 45 component: 'Select',
41   - label: OriginatorTelemetryFieldsNameEnum.AGGREGATION,
42   - required: true,
  46 + label: t(OriginatorTelemetryFieldsNameEnum.AGGREGATION),
43 47 show: ({ model }) => model[OriginatorTelemetryFieldsEnum.FETCH_MODE] === FetchModeEnum.ALL,
  48 + rules: [
  49 + { required: true, message: `请选择${t(OriginatorTelemetryFieldsNameEnum.AGGREGATION)}` },
  50 + ],
44 51 componentProps: {
45 52 options: Object.keys(AggregationEnum).map((value) => ({
46 53 label: AggregationNameEnum[value],
47 54 value,
48 55 })),
49   - placeholder: `请选择${OriginatorTelemetryFieldsNameEnum.AGGREGATION}`,
  56 + placeholder: `请选择${t(OriginatorTelemetryFieldsNameEnum.AGGREGATION)}`,
50 57 getPopupContainer: () => document.body,
51 58 },
52 59 },
53 60 {
54 61 field: OriginatorTelemetryFieldsEnum.ORDER_BY,
55 62 component: 'Select',
56   - label: OriginatorTelemetryFieldsNameEnum.ORDER_BY,
57   - required: true,
  63 + label: t(OriginatorTelemetryFieldsNameEnum.ORDER_BY),
58 64 helpMessage: ['Select to choose telemetry sampling order.'],
59 65 show: ({ model }) => model[OriginatorTelemetryFieldsEnum.FETCH_MODE] === FetchModeEnum.ALL,
  66 + rules: [{ required: true, message: `请选择${OriginatorTelemetryFieldsNameEnum.FETCH_MODE}` }],
60 67 componentProps: {
61 68 options: Object.keys(OrderByEnum).map((value) => ({ label: value, value })),
62   - placeholder: `请选择${OriginatorTelemetryFieldsNameEnum.FETCH_MODE}`,
  69 + placeholder: `请选择${t(OriginatorTelemetryFieldsNameEnum.ORDER_BY)}`,
63 70 getPopupContainer: () => document.body,
64 71 },
65 72 },
66 73 {
67 74 field: OriginatorTelemetryFieldsEnum.LIMIT,
68 75 component: 'InputNumber',
69   - label: OriginatorTelemetryFieldsNameEnum.LIMIT,
70   - required: true,
  76 + label: t(OriginatorTelemetryFieldsNameEnum.LIMIT),
71 77 helpMessage: [
72 78 "Min limit value is 2, max - 1000. In case you want to fetch a single entry, select fetch mode 'FIRST' or 'LAST'.",
73 79 ],
74 80 show: ({ model }) => model[OriginatorTelemetryFieldsEnum.FETCH_MODE] === FetchModeEnum.ALL,
  81 + rules: [{ required: true, message: `请输入${t(OriginatorTelemetryFieldsNameEnum.LIMIT)}` }],
75 82 componentProps: {
76 83 min: 2,
77 84 max: 1000,
78 85 step: 1,
79   - placeholder: `请输入${OriginatorTelemetryFieldsNameEnum.LIMIT}`,
  86 + placeholder: `请输入${t(OriginatorTelemetryFieldsNameEnum.LIMIT)}`,
80 87 },
81 88 },
82 89 {
... ... @@ -84,91 +91,115 @@ export const formSchemas: FormSchema[] = [
84 91 component: 'Checkbox',
85 92 label: '',
86 93 renderComponentContent: () => ({
87   - default: () => OriginatorTelemetryFieldsNameEnum.USE_METADATA_INTERVAL_PATTERNS,
  94 + default: () => t(OriginatorTelemetryFieldsNameEnum.USE_METADATA_INTERVAL_PATTERNS),
88 95 }),
89 96 },
90 97 {
91 98 field: OriginatorTelemetryFieldsEnum.START_INTERVAL,
92 99 component: 'InputNumber',
93   - label: OriginatorTelemetryFieldsNameEnum.START_INTERVAL,
  100 + label: t(OriginatorTelemetryFieldsNameEnum.START_INTERVAL),
94 101 colProps: { span: 12 },
95   - required: true,
96 102 show: ({ model }) => !model[OriginatorTelemetryFieldsEnum.USE_METADATA_INTERVAL_PATTERNS],
  103 + rules: [
  104 + { required: true, message: `请输入${t(OriginatorTelemetryFieldsNameEnum.START_INTERVAL)}` },
  105 + ],
97 106 componentProps: {
98 107 step: 1,
99 108 min: 0,
100   - placeholder: `请输入${OriginatorTelemetryFieldsNameEnum.START_INTERVAL}`,
  109 + placeholder: `请输入${t(OriginatorTelemetryFieldsNameEnum.START_INTERVAL)}`,
101 110 },
102 111 },
103 112 {
104 113 field: OriginatorTelemetryFieldsEnum.START_INTERVAL_TIME_UNIT,
105 114 component: 'Select',
106   - label: OriginatorTelemetryFieldsNameEnum.START_INTERVAL_TIME_UNIT,
  115 + label: t(OriginatorTelemetryFieldsNameEnum.START_INTERVAL_TIME_UNIT),
107 116 colProps: { span: 12 },
108   - required: true,
109 117 show: ({ model }) => !model[OriginatorTelemetryFieldsEnum.USE_METADATA_INTERVAL_PATTERNS],
  118 + rules: [
  119 + {
  120 + required: true,
  121 + message: `请选择${t(OriginatorTelemetryFieldsNameEnum.START_INTERVAL_TIME_UNIT)}`,
  122 + },
  123 + ],
110 124 componentProps: {
111 125 options: Object.keys(TimeIntervalUnitEnum).map((value) => ({
112 126 label: TimeIntervalUnitNameEnum[value],
113 127 value,
114 128 })),
115   - placeholder: `请选择${OriginatorTelemetryFieldsNameEnum.START_INTERVAL_TIME_UNIT}`,
  129 + placeholder: `请选择${t(OriginatorTelemetryFieldsNameEnum.START_INTERVAL_TIME_UNIT)}`,
116 130 getPopupContainer: () => document.body,
117 131 },
118 132 },
119 133 {
120 134 field: OriginatorTelemetryFieldsEnum.END_INTERVAL,
121 135 component: 'InputNumber',
122   - label: OriginatorTelemetryFieldsNameEnum.END_INTERVAL,
  136 + label: t(OriginatorTelemetryFieldsNameEnum.END_INTERVAL),
123 137 colProps: { span: 12 },
124   - required: true,
125 138 show: ({ model }) => !model[OriginatorTelemetryFieldsEnum.USE_METADATA_INTERVAL_PATTERNS],
  139 + rules: [
  140 + { required: true, message: `请输入${t(OriginatorTelemetryFieldsNameEnum.END_INTERVAL)}` },
  141 + ],
126 142 componentProps: {
127 143 step: 1,
128 144 min: 0,
129   - placeholder: `请输入${OriginatorTelemetryFieldsNameEnum.END_INTERVAL}`,
  145 + placeholder: `请输入${t(OriginatorTelemetryFieldsNameEnum.END_INTERVAL)}`,
130 146 },
131 147 },
132 148 {
133 149 field: OriginatorTelemetryFieldsEnum.END_INTERVAL_TIME_UNIT,
134 150 component: 'Select',
135   - label: OriginatorTelemetryFieldsNameEnum.END_INTERVAL_TIME_UNIT,
  151 + label: t(OriginatorTelemetryFieldsNameEnum.END_INTERVAL_TIME_UNIT),
136 152 colProps: { span: 12 },
137   - required: true,
138 153 show: ({ model }) => !model[OriginatorTelemetryFieldsEnum.USE_METADATA_INTERVAL_PATTERNS],
  154 + rules: [
  155 + {
  156 + required: true,
  157 + message: `请选择${t(OriginatorTelemetryFieldsNameEnum.END_INTERVAL_TIME_UNIT)}`,
  158 + },
  159 + ],
139 160 componentProps: {
140 161 options: Object.keys(TimeIntervalUnitEnum).map((value) => ({
141 162 label: TimeIntervalUnitNameEnum[value],
142 163 value,
143 164 })),
144   - placeholder: `请选择${OriginatorTelemetryFieldsNameEnum.END_INTERVAL_TIME_UNIT}`,
  165 + placeholder: `请选择${t(OriginatorTelemetryFieldsNameEnum.END_INTERVAL_TIME_UNIT)}`,
145 166 getPopupContainer: () => document.body,
146 167 },
147 168 },
148 169 {
149 170 field: OriginatorTelemetryFieldsEnum.START_INTERVAL_PATTERN,
150 171 component: 'Input',
151   - label: OriginatorTelemetryFieldsNameEnum.START_INTERVAL_PATTERN,
152   - required: true,
  172 + label: t(OriginatorTelemetryFieldsNameEnum.START_INTERVAL_PATTERN),
153 173 helpMessage: [
154 174 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
155 175 ],
156 176 ifShow: ({ model }) => model[OriginatorTelemetryFieldsEnum.USE_METADATA_INTERVAL_PATTERNS],
  177 + rules: [
  178 + {
  179 + required: true,
  180 + message: `请输入${t(OriginatorTelemetryFieldsNameEnum.START_INTERVAL_PATTERN)}`,
  181 + },
  182 + ],
157 183 componentProps: {
158   - placeholder: `请输入${OriginatorTelemetryFieldsNameEnum.START_INTERVAL_PATTERN}`,
  184 + placeholder: `请输入${t(OriginatorTelemetryFieldsNameEnum.START_INTERVAL_PATTERN)}`,
159 185 },
160 186 },
161 187 {
162 188 field: OriginatorTelemetryFieldsEnum.END_INTERVAL_PATTERN,
163 189 component: 'Input',
164   - label: OriginatorTelemetryFieldsNameEnum.END_INTERVAL_PATTERN,
165   - required: true,
  190 + label: t(OriginatorTelemetryFieldsNameEnum.END_INTERVAL_PATTERN),
166 191 helpMessage: [
167 192 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
168 193 ],
  194 + rules: [
  195 + {
  196 + required: true,
  197 + message: `请输入${t(OriginatorTelemetryFieldsNameEnum.END_INTERVAL_PATTERN)}`,
  198 + },
  199 + ],
169 200 ifShow: ({ model }) => model[OriginatorTelemetryFieldsEnum.USE_METADATA_INTERVAL_PATTERNS],
170 201 componentProps: {
171   - placeholder: `请输入${OriginatorTelemetryFieldsNameEnum.END_INTERVAL_PATTERN}`,
  202 + placeholder: `请输入${t(OriginatorTelemetryFieldsNameEnum.END_INTERVAL_PATTERN)}`,
172 203 },
173 204 },
174 205 ];
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(EnrichmentCategoryComponentEnum.ORIGINATOR_TELEMETRY);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface OriginatorTelemetryDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -6,6 +6,9 @@ import {
6 6 RelatedAttributesFieldsNameEnum,
7 7 } from '../../../enum/formField/enrichment';
8 8
  9 +import { useI18n } from '/@/hooks/web/useI18n';
  10 +const { t } = useI18n();
  11 +
9 12 useComponentRegister('RelationsQuery', RelationsQuery);
10 13 useComponentRegister('AttributeConfiguration', AttributeConfiguration);
11 14
... ... @@ -13,7 +16,7 @@ export const formSchemas: FormSchema[] = [
13 16 {
14 17 field: RelatedAttributesFieldsEnum.RELATIONS_QUERY,
15 18 component: 'RelationsQuery',
16   - label: RelatedAttributesFieldsNameEnum.RELATIONS_QUERY,
  19 + label: t(RelatedAttributesFieldsNameEnum.RELATIONS_QUERY),
17 20 changeEvent: 'update:value',
18 21 valueField: 'value',
19 22 slot: RelatedAttributesFieldsEnum.RELATIONS_QUERY,
... ... @@ -23,7 +26,7 @@ export const formSchemas: FormSchema[] = [
23 26 component: 'Checkbox',
24 27 label: '',
25 28 renderComponentContent: () => ({
26   - default: () => RelatedAttributesFieldsNameEnum.TELEMETRY,
  29 + default: () => t(RelatedAttributesFieldsNameEnum.TELEMETRY),
27 30 }),
28 31 },
29 32 {
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(EnrichmentCategoryComponentEnum.RELATED_ATTRIBUTES);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface RelatedAttributesDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -11,6 +11,9 @@ import {
11 11
12 12 import { getDeviceTypes } from '/@/api/ruleChainDesigner';
13 13 import { FormSchema } from '/@/components/Form';
  14 +import { useI18n } from '/@/hooks/web/useI18n';
  15 +
  16 +const { t } = useI18n();
14 17
15 18 export interface ValueType {
16 19 deviceRelationsQuery: DeviceRelationsQuery;
... ... @@ -36,58 +39,63 @@ export const formSchemas: FormSchema[] = [
36 39 component: 'Checkbox',
37 40 label: '',
38 41 renderComponentContent: () => ({
39   - default: () => RelatedDeviceAttributeFieldsNameEnum.FETCH_LAST_LEVEL_ONLY,
  42 + default: () => t(RelatedDeviceAttributeFieldsNameEnum.FETCH_LAST_LEVEL_ONLY),
40 43 }),
41 44 },
42 45 {
43 46 field: RelatedDeviceAttributeFieldsEnum.DIRECTION,
44 47 component: 'Select',
45   - label: RelatedDeviceAttributeFieldsNameEnum.DIRECTION,
46   - required: true,
  48 + label: t(RelatedDeviceAttributeFieldsNameEnum.DIRECTION),
47 49 colProps: { span: 12 },
  50 + rules: [
  51 + {
  52 + required: true,
  53 + message: `请选择${t(RelatedDeviceAttributeFieldsNameEnum.FETCH_LAST_LEVEL_ONLY)}`,
  54 + },
  55 + ],
48 56 componentProps: {
49 57 options: Object.keys(DirectionEnum).map((value) => ({
50 58 label: DirectionNameEnum[value],
51 59 value,
52 60 })),
53   - placeholder: `请选择${RelatedDeviceAttributeFieldsNameEnum.DIRECTION}`,
  61 + placeholder: `请选择${t(RelatedDeviceAttributeFieldsNameEnum.DIRECTION)}`,
54 62 getPopupContainer: () => document.body,
55 63 },
56 64 },
57 65 {
58 66 field: RelatedDeviceAttributeFieldsEnum.MAX_LEVEL,
59 67 component: 'InputNumber',
60   - label: RelatedDeviceAttributeFieldsNameEnum.MAX_LEVEL,
  68 + label: t(RelatedDeviceAttributeFieldsNameEnum.MAX_LEVEL),
61 69 colProps: { span: 12 },
62 70 componentProps: {
63 71 min: 1,
64   - placeholder: `请输入${RelatedDeviceAttributeFieldsNameEnum.MAX_LEVEL}`,
  72 + placeholder: `请输入${t(RelatedDeviceAttributeFieldsNameEnum.MAX_LEVEL)}`,
65 73 },
66 74 },
67 75 {
68 76 field: RelatedDeviceAttributeFieldsEnum.RELATION_TYPE,
69 77 component: 'Select',
70   - label: RelatedDeviceAttributeFieldsNameEnum.RELATION_TYPE,
  78 + label: t(RelatedDeviceAttributeFieldsNameEnum.RELATION_TYPE),
71 79 componentProps: {
72 80 options: Object.keys(RelationTypeEnum).map((value) => ({
73 81 label: RelationTypeNameEnum[value],
74 82 value,
75 83 })),
76   - placeholder: `请选择${RelatedDeviceAttributeFieldsNameEnum.RELATION_TYPE}`,
  84 + placeholder: `请选择${t(RelatedDeviceAttributeFieldsNameEnum.RELATION_TYPE)}`,
77 85 getPopupContainer: () => document.body,
78 86 },
79 87 },
80 88 {
81 89 field: RelatedDeviceAttributeFieldsEnum.DEVICE_TYPES,
82 90 component: 'ApiSelect',
83   - label: RelatedDeviceAttributeFieldsNameEnum.DEVICE_TYPES,
  91 + label: t(RelatedDeviceAttributeFieldsNameEnum.DEVICE_TYPES),
84 92 componentProps: {
85 93 mode: 'multiple',
86 94 api: getDeviceTypes,
87 95 labelField: 'type',
88 96 valueField: 'type',
89 97 getPopupContainer: () => document.body,
90   - placeholder: `请选择${RelatedDeviceAttributeFieldsNameEnum.DEVICE_TYPES}`,
  98 + placeholder: `请选择${t(RelatedDeviceAttributeFieldsNameEnum.DEVICE_TYPES)}`,
91 99 },
92 100 },
93 101 {
... ... @@ -95,47 +103,47 @@ export const formSchemas: FormSchema[] = [
95 103 component: 'Checkbox',
96 104 label: '',
97 105 renderComponentContent: () => ({
98   - default: () => RelatedDeviceAttributeFieldsNameEnum.TELL_FAILURE_IF_ABSENT,
  106 + default: () => t(RelatedDeviceAttributeFieldsNameEnum.TELL_FAILURE_IF_ABSENT),
99 107 }),
100 108 },
101 109 {
102 110 field: RelatedDeviceAttributeFieldsEnum.CLIENT_ATTRIBUTE_NAMES,
103 111 component: 'Select',
104   - label: RelatedDeviceAttributeFieldsNameEnum.CLIENT_ATTRIBUTE_NAMES,
  112 + label: t(RelatedDeviceAttributeFieldsNameEnum.CLIENT_ATTRIBUTE_NAMES),
105 113 componentProps: {
106 114 open: false,
107 115 mode: 'tags',
108   - placeholder: RelatedDeviceAttributeFieldsNameEnum.CLIENT_ATTRIBUTE_NAMES,
  116 + placeholder: t(RelatedDeviceAttributeFieldsNameEnum.CLIENT_ATTRIBUTE_NAMES),
109 117 },
110 118 },
111 119 {
112 120 field: RelatedDeviceAttributeFieldsEnum.SHARED_ATTRIBUTE_NAMES,
113 121 component: 'Select',
114   - label: RelatedDeviceAttributeFieldsNameEnum.SHARED_ATTRIBUTE_NAMES,
  122 + label: t(RelatedDeviceAttributeFieldsNameEnum.SHARED_ATTRIBUTE_NAMES),
115 123 componentProps: {
116 124 open: false,
117 125 mode: 'tags',
118   - placeholder: RelatedDeviceAttributeFieldsNameEnum.SHARED_ATTRIBUTE_NAMES,
  126 + placeholder: t(RelatedDeviceAttributeFieldsNameEnum.SHARED_ATTRIBUTE_NAMES),
119 127 },
120 128 },
121 129 {
122 130 field: RelatedDeviceAttributeFieldsEnum.SERVER_ATTRIBUTE_NAMES,
123 131 component: 'Select',
124   - label: RelatedDeviceAttributeFieldsNameEnum.SERVER_ATTRIBUTE_NAMES,
  132 + label: t(RelatedDeviceAttributeFieldsNameEnum.SERVER_ATTRIBUTE_NAMES),
125 133 componentProps: {
126 134 open: false,
127 135 mode: 'tags',
128   - placeholder: RelatedDeviceAttributeFieldsNameEnum.SERVER_ATTRIBUTE_NAMES,
  136 + placeholder: t(RelatedDeviceAttributeFieldsNameEnum.SERVER_ATTRIBUTE_NAMES),
129 137 },
130 138 },
131 139 {
132 140 field: RelatedDeviceAttributeFieldsEnum.LATEST_TS_KEY_NAMES,
133 141 component: 'Select',
134   - label: RelatedDeviceAttributeFieldsNameEnum.LATEST_TS_KEY_NAMES,
  142 + label: t(RelatedDeviceAttributeFieldsNameEnum.LATEST_TS_KEY_NAMES),
135 143 componentProps: {
136 144 open: false,
137 145 mode: 'tags',
138   - placeholder: RelatedDeviceAttributeFieldsNameEnum.LATEST_TS_KEY_NAMES,
  146 + placeholder: t(RelatedDeviceAttributeFieldsNameEnum.LATEST_TS_KEY_NAMES),
139 147 },
140 148 },
141 149 {
... ... @@ -143,7 +151,7 @@ export const formSchemas: FormSchema[] = [
143 151 component: 'Checkbox',
144 152 label: '',
145 153 renderComponentContent: () => ({
146   - default: () => RelatedDeviceAttributeFieldsNameEnum.GET_LATEST_VALUE_WITH_TS,
  154 + default: () => t(RelatedDeviceAttributeFieldsNameEnum.GET_LATEST_VALUE_WITH_TS),
147 155 }),
148 156 },
149 157 ];
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(EnrichmentCategoryComponentEnum.RELATED_DEVICE_ATTRIBUTES);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface RelatedDeviceAttributesDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -4,6 +4,9 @@ import {
4 4 } from '../../../enum/formField/enrichment';
5 5 import { FormSchema, useComponentRegister } from '/@/components/Form';
6 6 import { AttributeConfiguration } from '/@/views/rule/designer/src/components/AttributeConfiguration';
  7 +import { useI18n } from '/@/hooks/web/useI18n';
  8 +
  9 +const { t } = useI18n();
7 10
8 11 useComponentRegister('AttributeConfiguration', AttributeConfiguration);
9 12
... ... @@ -14,14 +17,14 @@ export const formSchemas: FormSchema[] = [
14 17 label: '',
15 18 renderComponentContent: () => {
16 19 return {
17   - default: () => TenantAttributesFieldsNameEnum.TELEMETRY,
  20 + default: () => t(TenantAttributesFieldsNameEnum.TELEMETRY),
18 21 };
19 22 },
20 23 },
21 24 {
22 25 field: TenantAttributesFieldsEnum.ATTR_MAPING,
23 26 component: 'AttributeConfiguration',
24   - label: TenantAttributesFieldsNameEnum.ATTR_MAPING,
  27 + label: t(TenantAttributesFieldsNameEnum.ATTR_MAPING),
25 28 slot: TenantAttributesFieldsEnum.ATTR_MAPING,
26 29 valueField: 'value',
27 30 changeEvent: 'update:value',
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(EnrichmentCategoryComponentEnum.TENANT_ATTRIBUTES);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface TenantAttributesDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -4,13 +4,16 @@ import {
4 4 TenantDetailsFieldsNameEnum,
5 5 } from '../../../enum/formField/enrichment';
6 6 import { FormSchema } from '/@/components/Form';
  7 +import { useI18n } from '/@/hooks/web/useI18n';
  8 +
  9 +const { t } = useI18n();
7 10
8 11 export const formSchemas: FormSchema[] = [
9 12 {
10 13 field: TenantDetailsFieldsEnum.DETAILS_LIST,
11 14 component: 'Select',
12   - label: TenantDetailsFieldsNameEnum.DETAILS_LIST,
13   - required: true,
  15 + label: t(TenantDetailsFieldsNameEnum.DETAILS_LIST),
  16 + rules: [{ required: true, message: `请选择${t(TenantDetailsFieldsNameEnum.DETAILS_LIST)}` }],
14 17 componentProps: {
15 18 mode: 'multiple',
16 19 options: Object.keys(DetailsListEnum).map((value) => ({
... ... @@ -18,7 +21,7 @@ export const formSchemas: FormSchema[] = [
18 21 value,
19 22 })),
20 23 getPopupContainer: () => document.body,
21   - placeholder: `请选择${TenantDetailsFieldsNameEnum.DETAILS_LIST}`,
  24 + placeholder: `请选择${t(TenantDetailsFieldsNameEnum.DETAILS_LIST)}`,
22 25 },
23 26 },
24 27 {
... ... @@ -26,7 +29,7 @@ export const formSchemas: FormSchema[] = [
26 29 component: 'Checkbox',
27 30 label: '',
28 31 renderComponentContent: () => ({
29   - default: () => TenantDetailsFieldsNameEnum.DETAILS_LIST,
  32 + default: () => t(TenantDetailsFieldsNameEnum.ADD_TO_METADATA),
30 33 }),
31 34 },
32 35 ];
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(EnrichmentCategoryComponentEnum.TENANT_DETAILS);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10
11 11 export interface TenantDetailsDataType {
12 12 someConfiguration?: Recordable;
... ...
... ... @@ -12,7 +12,7 @@ import { OriginatorAttributesConfig } from './OriginatorAttributes';
12 12 import { CustomerDetailsConfig } from './CustomerDetails';
13 13 import { useI18n } from '/@/hooks/web/useI18n';
14 14
15   -const { t } = useI18n(); //加载国际化
  15 +const { t } = useI18n(); // 加载国际化
16 16 export const EnrichmentCategoryConfig: CategoryConfigType = {
17 17 category: RuleNodeTypeEnum.ENRICHMENT,
18 18 title: t('designer_config.enrichments.index.title'),
... ...
1 1 import { AlarmNoticeFieldsEnum, AlarmNoticeFieldsNameEnum } from '../../../enum/formField/external';
2 2 import { FormSchema } from '/@/components/Form';
  3 +import { useI18n } from '/@/hooks/web/useI18n';
  4 +
  5 +const { t } = useI18n();
3 6
4 7 export const formSchemas: FormSchema[] = [
5 8 {
6 9 field: AlarmNoticeFieldsEnum.CONFIGURATION,
7 10 component: 'JSONEditor',
8   - label: AlarmNoticeFieldsNameEnum.CONFIGURATION,
  11 + label: t(AlarmNoticeFieldsNameEnum.CONFIGURATION),
9 12 valueField: 'value',
10 13 changeEvent: 'update:value',
11 14 },
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ExternalCategoryComponentEnum.ALARM_NOTICE);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface AlarmNoticeDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
1 1 import { AwsSnsFieldsEnum, AwsSnsFieldsNameEnum } from '../../../enum/formField/external';
2 2 import { FormSchema } from '/@/components/Form';
  3 +import { useI18n } from '/@/hooks/web/useI18n';
  4 +
  5 +const { t } = useI18n();
3 6
4 7 export const formSchemas: FormSchema[] = [
5 8 {
6 9 field: AwsSnsFieldsEnum.TOPIC_ARN_PATTERN,
7   - label: AwsSnsFieldsNameEnum.TOPIC_ARN_PATTERN,
  10 + label: t(AwsSnsFieldsNameEnum.TOPIC_ARN_PATTERN),
8 11 component: 'Input',
9 12 required: true,
10 13 componentProps: {
11   - placeholder: `请输入${AwsSnsFieldsNameEnum.TOPIC_ARN_PATTERN}`,
  14 + placeholder: `请输入${t(AwsSnsFieldsNameEnum.TOPIC_ARN_PATTERN)}`,
12 15 },
13 16 },
14 17 {
15 18 field: AwsSnsFieldsEnum.ACCESS_KEY_ID,
16   - label: AwsSnsFieldsNameEnum.ACCESS_KEY_ID,
  19 + label: t(AwsSnsFieldsNameEnum.ACCESS_KEY_ID),
17 20 component: 'Input',
18 21 required: true,
19 22 componentProps: {
20   - placeholder: `请输入${AwsSnsFieldsNameEnum.ACCESS_KEY_ID}`,
  23 + placeholder: `请输入${t(AwsSnsFieldsNameEnum.ACCESS_KEY_ID)}`,
21 24 },
22 25 },
23 26 {
24 27 field: AwsSnsFieldsEnum.SECRET_ACCESS_KEY,
25   - label: AwsSnsFieldsNameEnum.SECRET_ACCESS_KEY,
  28 + label: t(AwsSnsFieldsNameEnum.SECRET_ACCESS_KEY),
26 29 component: 'Input',
27 30 required: true,
28 31 componentProps: {
29   - placeholder: `请输入${AwsSnsFieldsNameEnum.SECRET_ACCESS_KEY}`,
  32 + placeholder: `请输入${t(AwsSnsFieldsNameEnum.SECRET_ACCESS_KEY)}`,
30 33 },
31 34 },
32 35 {
33 36 field: AwsSnsFieldsEnum.REGION,
34   - label: AwsSnsFieldsNameEnum.REGION,
  37 + label: t(AwsSnsFieldsNameEnum.REGION),
35 38 component: 'Input',
36 39 required: true,
37 40 componentProps: {
38   - placeholder: `请输入${AwsSnsFieldsNameEnum.REGION}`,
  41 + placeholder: `请输入${t(AwsSnsFieldsNameEnum.REGION)}`,
39 42 },
40 43 },
41 44 ];
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ExternalCategoryComponentEnum.AWS_SNS);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface AwsSnsDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -2,13 +2,16 @@ import { QueueTypeEnum, QueueTypeNameEnum } from '../../../enum/form';
2 2 import { AwsSqsFieldsEnum, AwsSqsFieldsNameEnum } from '../../../enum/formField/external';
3 3 import { AttributeConfiguration } from '../../../src/components/AttributeConfiguration';
4 4 import { FormSchema, useComponentRegister } from '/@/components/Form';
  5 +import { useI18n } from '/@/hooks/web/useI18n';
  6 +
  7 +const { t } = useI18n();
5 8
6 9 useComponentRegister('AttributeConfiguration', AttributeConfiguration);
7 10
8 11 export const formSchemas: FormSchema[] = [
9 12 {
10 13 field: AwsSqsFieldsEnum.QUEUE_TYPE,
11   - label: AwsSqsFieldsNameEnum.QUEUE_TYPE,
  14 + label: t(AwsSqsFieldsNameEnum.QUEUE_TYPE),
12 15 component: 'Select',
13 16 required: true,
14 17 componentProps: {
... ... @@ -17,21 +20,21 @@ export const formSchemas: FormSchema[] = [
17 20 value,
18 21 })),
19 22 getPopupContainer: () => document.body,
20   - placeholder: `请选择${AwsSqsFieldsNameEnum.QUEUE_TYPE}`,
  23 + placeholder: `请选择${t(t(AwsSqsFieldsNameEnum.QUEUE_TYPE))}`,
21 24 },
22 25 },
23 26 {
24 27 field: AwsSqsFieldsEnum.QUEUE_URL_PATTERN,
25   - label: AwsSqsFieldsNameEnum.QUEUE_URL_PATTERN,
  28 + label: t(AwsSqsFieldsNameEnum.QUEUE_URL_PATTERN),
26 29 component: 'Input',
27 30 required: true,
28 31 componentProps: {
29   - placeholder: `请输入${AwsSqsFieldsNameEnum.QUEUE_URL_PATTERN}`,
  32 + placeholder: `请输入${t(AwsSqsFieldsNameEnum.QUEUE_URL_PATTERN)}`,
30 33 },
31 34 },
32 35 {
33 36 field: AwsSqsFieldsEnum.DELAY_SECONDS,
34   - label: AwsSqsFieldsNameEnum.DELAY_SECONDS,
  37 + label: t(AwsSqsFieldsNameEnum.DELAY_SECONDS),
35 38 component: 'Input',
36 39 required: true,
37 40 helpMessage: [
... ... @@ -39,12 +42,12 @@ export const formSchemas: FormSchema[] = [
39 42 ],
40 43 show: ({ model }) => model[AwsSqsFieldsEnum.QUEUE_TYPE] === QueueTypeEnum.STANDARD,
41 44 componentProps: {
42   - placeholder: `请输入${AwsSqsFieldsNameEnum.DELAY_SECONDS}`,
  45 + placeholder: `请输入${t(AwsSqsFieldsNameEnum.DELAY_SECONDS)}`,
43 46 },
44 47 },
45 48 {
46 49 field: AwsSqsFieldsEnum.MESSAGE_ATTRIBUTES,
47   - label: AwsSqsFieldsNameEnum.MESSAGE_ATTRIBUTES,
  50 + label: t(AwsSqsFieldsNameEnum.MESSAGE_ATTRIBUTES),
48 51 component: 'AttributeConfiguration',
49 52 helpMessage:
50 53 'Use ${metadataKey} for value from metadata, $[messageKey] for value from message body in name/value fields',
... ... @@ -52,29 +55,29 @@ export const formSchemas: FormSchema[] = [
52 55 },
53 56 {
54 57 field: AwsSqsFieldsEnum.ACCESS_KEY_ID,
55   - label: AwsSqsFieldsNameEnum.ACCESS_KEY_ID,
  58 + label: t(AwsSqsFieldsNameEnum.ACCESS_KEY_ID),
56 59 component: 'Input',
57 60 required: true,
58 61 componentProps: {
59   - placeholder: `请输入${AwsSqsFieldsNameEnum.ACCESS_KEY_ID}`,
  62 + placeholder: `请输入${t(AwsSqsFieldsNameEnum.ACCESS_KEY_ID)}`,
60 63 },
61 64 },
62 65 {
63 66 field: AwsSqsFieldsEnum.SECRET_ACCESS_KEY,
64   - label: AwsSqsFieldsNameEnum.SECRET_ACCESS_KEY,
  67 + label: t(AwsSqsFieldsNameEnum.SECRET_ACCESS_KEY),
65 68 component: 'Input',
66 69 required: true,
67 70 componentProps: {
68   - placeholder: `请输入${AwsSqsFieldsNameEnum.SECRET_ACCESS_KEY}`,
  71 + placeholder: `请输入${t(AwsSqsFieldsNameEnum.SECRET_ACCESS_KEY)}`,
69 72 },
70 73 },
71 74 {
72 75 field: AwsSqsFieldsEnum.REGION,
73   - label: AwsSqsFieldsNameEnum.REGION,
  76 + label: t(AwsSqsFieldsNameEnum.REGION),
74 77 component: 'Input',
75 78 required: true,
76 79 componentProps: {
77   - placeholder: `请输入${AwsSqsFieldsNameEnum.REGION}`,
  80 + placeholder: `请输入${t(AwsSqsFieldsNameEnum.REGION)}`,
78 81 },
79 82 },
80 83 ];
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ExternalCategoryComponentEnum.AWS_SQS);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface AwsSqsDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -3,6 +3,9 @@ import {
3 3 AzureIotHubFieldsNameEnum,
4 4 } from '../../../../enum/formField/external';
5 5 import { FormSchema } from '/@/components/Form';
  6 +import { useI18n } from '/@/hooks/web/useI18n';
  7 +
  8 +const { t } = useI18n();
6 9
7 10 export enum CredentialsTypeEnum {
8 11 PEM = 'cert.PEM',
... ... @@ -53,7 +56,7 @@ export const formSchemas = (
53 56 return [
54 57 {
55 58 field: AzureIotHubFieldsEnum.TYPE,
56   - label: AzureIotHubFieldsNameEnum.TYPE,
  59 + label: t(AzureIotHubFieldsNameEnum.TYPE),
57 60 component: 'Select',
58 61 required: true,
59 62 defaultValue: CredentialsTypeEnum.SHARED_ACCESS_SIGNATURE,
... ... @@ -61,8 +64,9 @@ export const formSchemas = (
61 64 const { setFieldsValue } = formActionType;
62 65 return {
63 66 options: credentialsTypeOptions,
64   - placeholder: `请选择${AzureIotHubFieldsNameEnum.TYPE}`,
  67 + placeholder: `请选择${t(AzureIotHubFieldsNameEnum.TYPE)}`,
65 68 getPopupContainer: () => document.body,
  69 + allowClear: false,
66 70 onChange(
67 71 value: CredentialsTypeEnum,
68 72 option: { label: CredentialsTypeNameEnum; value: CredentialsTypeEnum }
... ... @@ -84,24 +88,24 @@ export const formSchemas = (
84 88 },
85 89 {
86 90 field: AzureIotHubFieldsEnum.SAS_KEY,
87   - label: AzureIotHubFieldsNameEnum.SAS_KEY,
  91 + label: t(AzureIotHubFieldsNameEnum.SAS_KEY),
88 92 required: true,
89 93 component: 'Input',
90 94 ifShow: ({ model }) =>
91 95 model[AzureIotHubFieldsEnum.TYPE] === CredentialsTypeEnum.SHARED_ACCESS_SIGNATURE,
92 96 componentProps: {
93   - placeholder: `请输入${AzureIotHubFieldsNameEnum.SAS_KEY}`,
  97 + placeholder: `请输入${t(AzureIotHubFieldsNameEnum.SAS_KEY)}`,
94 98 },
95 99 },
96 100 {
97 101 field: AzureIotHubFieldsEnum.CA_CERT_FILE_NAME,
98   - label: AzureIotHubFieldsNameEnum.CA_CERT_FILE_NAME,
  102 + label: t(AzureIotHubFieldsNameEnum.CA_CERT_FILE_NAME),
99 103 component: 'InputPassword',
100 104 show: false,
101 105 },
102 106 {
103 107 field: AzureIotHubFieldsEnum.CA_CERT,
104   - label: AzureIotHubFieldsNameEnum.CA_CERT,
  108 + label: t(AzureIotHubFieldsNameEnum.CA_CERT),
105 109 component: 'ApiUpload',
106 110 valueField: 'fileList',
107 111 changeEvent: 'update:fileList',
... ... @@ -118,13 +122,13 @@ export const formSchemas = (
118 122 },
119 123 {
120 124 field: AzureIotHubFieldsEnum.CERT_FILE_NAME,
121   - label: AzureIotHubFieldsNameEnum.CERT_FILE_NAME,
  125 + label: t(AzureIotHubFieldsNameEnum.CERT_FILE_NAME),
122 126 component: 'InputPassword',
123 127 show: false,
124 128 },
125 129 {
126 130 field: AzureIotHubFieldsEnum.CERT,
127   - label: AzureIotHubFieldsNameEnum.CERT,
  131 + label: t(AzureIotHubFieldsNameEnum.CERT),
128 132 component: 'ApiUpload',
129 133 valueField: 'fileList',
130 134 changeEvent: 'update:fileList',
... ... @@ -143,13 +147,13 @@ export const formSchemas = (
143 147 },
144 148 {
145 149 field: AzureIotHubFieldsEnum.PRIVATE_KEY_FILE_NAME,
146   - label: AzureIotHubFieldsNameEnum.PRIVATE_KEY_FILE_NAME,
  150 + label: t(AzureIotHubFieldsNameEnum.PRIVATE_KEY_FILE_NAME),
147 151 component: 'InputPassword',
148 152 show: false,
149 153 },
150 154 {
151 155 field: AzureIotHubFieldsEnum.PRIVATE_KEY,
152   - label: AzureIotHubFieldsNameEnum.PRIVATE_KEY,
  156 + label: t(AzureIotHubFieldsNameEnum.PRIVATE_KEY),
153 157 component: 'ApiUpload',
154 158 valueField: 'fileList',
155 159 changeEvent: 'update:fileList',
... ... @@ -168,11 +172,11 @@ export const formSchemas = (
168 172 },
169 173 {
170 174 field: AzureIotHubFieldsEnum.PASSWORD,
171   - label: AzureIotHubFieldsNameEnum.PASSWORD,
  175 + label: t(AzureIotHubFieldsNameEnum.PASSWORD),
172 176 component: 'InputPassword',
173 177 ifShow: ({ model }) => model[AzureIotHubFieldsEnum.TYPE] === CredentialsTypeEnum.PEM,
174 178 componentProps: {
175   - placeholder: `请输入${AzureIotHubFieldsNameEnum.PASSWORD}`,
  179 + placeholder: `请输入${t(AzureIotHubFieldsNameEnum.PASSWORD)}`,
176 180 },
177 181 },
178 182 ];
... ...
... ... @@ -2,36 +2,40 @@ import { AzureIotHubFieldsEnum, AzureIotHubFieldsNameEnum } from '../../../enum/
2 2 import { FormSchema, useComponentRegister } from '/@/components/Form';
3 3 import { CredentialsCard } from './CredentialsCard';
4 4
  5 +import { useI18n } from '/@/hooks/web/useI18n';
  6 +
  7 +const { t } = useI18n();
  8 +
5 9 useComponentRegister('CredentialsCard', CredentialsCard);
6 10
7 11 export const formSchemas: FormSchema[] = [
8 12 {
9 13 field: AzureIotHubFieldsEnum.TOPIC_PATTERN,
10   - label: AzureIotHubFieldsNameEnum.TOPIC_PATTERN,
  14 + label: t(AzureIotHubFieldsNameEnum.TOPIC_PATTERN),
11 15 component: 'Input',
12 16 required: true,
13 17 helpMessage:
14 18 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
15 19 componentProps: {
16   - placeholder: `请输入${AzureIotHubFieldsNameEnum.TOPIC_PATTERN}`,
  20 + placeholder: `请输入${t(AzureIotHubFieldsNameEnum.TOPIC_PATTERN)}`,
17 21 },
18 22 },
19 23 {
20 24 field: AzureIotHubFieldsEnum.HOST,
21   - label: AzureIotHubFieldsNameEnum.HOST,
  25 + label: t(AzureIotHubFieldsNameEnum.HOST),
22 26 component: 'Input',
23 27 required: true,
24 28 componentProps: {
25   - placeholder: `请输入${AzureIotHubFieldsNameEnum.HOST}`,
  29 + placeholder: `请输入${t(AzureIotHubFieldsNameEnum.HOST)}`,
26 30 },
27 31 },
28 32 {
29 33 field: AzureIotHubFieldsEnum.CLIENT_ID,
30   - label: AzureIotHubFieldsNameEnum.CLIENT_ID,
  34 + label: t(AzureIotHubFieldsNameEnum.CLIENT_ID),
31 35 component: 'Input',
32 36 required: true,
33 37 componentProps: {
34   - placeholder: `请输入${AzureIotHubFieldsNameEnum.CLIENT_ID}`,
  38 + placeholder: `请输入${t(AzureIotHubFieldsNameEnum.CLIENT_ID)}`,
35 39 },
36 40 },
37 41 {
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ExternalCategoryComponentEnum.AZURE_IOT_HUB);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface AzureIotHubDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -3,39 +3,43 @@ import { AttributeConfiguration } from '/@/views/rule/designer/src/components/At
3 3 import { FileItemType, getFileData } from '../AzureIotHub/CredentialsCard/config';
4 4 import { FormSchema, useComponentRegister } from '/@/components/Form';
5 5
  6 +import { useI18n } from '/@/hooks/web/useI18n';
  7 +
  8 +const { t } = useI18n();
  9 +
6 10 useComponentRegister('AttributeConfiguration', AttributeConfiguration);
7 11
8 12 export const formSchemas: FormSchema[] = [
9 13 {
10 14 field: GcpPubsubFieldsEnum.PROJECT_ID,
11   - label: GcpPubsubFieldsNameEnum.PROJECT_ID,
  15 + label: t(GcpPubsubFieldsNameEnum.PROJECT_ID),
12 16 component: 'Input',
13 17 required: true,
14 18 componentProps: {
15   - placeholder: `请输入${GcpPubsubFieldsNameEnum.PROJECT_ID}`,
  19 + placeholder: `请输入${t(GcpPubsubFieldsNameEnum.PROJECT_ID)}`,
16 20 },
17 21 },
18 22 {
19 23 field: GcpPubsubFieldsEnum.TOPIC_NAME,
20   - label: GcpPubsubFieldsNameEnum.TOPIC_NAME,
  24 + label: t(GcpPubsubFieldsNameEnum.TOPIC_NAME),
21 25 component: 'Input',
22 26 required: true,
23 27 componentProps: {
24   - placeholder: `请输入${GcpPubsubFieldsNameEnum.TOPIC_NAME}`,
  28 + placeholder: `请输入${t(GcpPubsubFieldsNameEnum.TOPIC_NAME)}`,
25 29 },
26 30 },
27 31 {
28 32 field: GcpPubsubFieldsEnum.SERVICE_ACCOUNT_KEY_FILE_NAME,
29   - label: GcpPubsubFieldsNameEnum.SERVICE_ACCOUNT_KEY_FILE_NAME,
  33 + label: t(GcpPubsubFieldsNameEnum.SERVICE_ACCOUNT_KEY_FILE_NAME),
30 34 component: 'Input',
31 35 show: false,
32 36 componentProps: {
33   - placeholder: `请输入${GcpPubsubFieldsNameEnum.TOPIC_NAME}`,
  37 + placeholder: `请输入${t(GcpPubsubFieldsNameEnum.TOPIC_NAME)}`,
34 38 },
35 39 },
36 40 {
37 41 field: GcpPubsubFieldsEnum.SERVICE_ACCOUNT_KEY,
38   - label: GcpPubsubFieldsNameEnum.SERVICE_ACCOUNT_KEY,
  42 + label: t(GcpPubsubFieldsNameEnum.SERVICE_ACCOUNT_KEY),
39 43 component: 'ApiUpload',
40 44 valueField: 'fileList',
41 45 changeEvent: 'update:fileList',
... ... @@ -53,7 +57,7 @@ export const formSchemas: FormSchema[] = [
53 57 },
54 58 {
55 59 field: GcpPubsubFieldsEnum.MESSAGE_ATTRIBUTES,
56   - label: GcpPubsubFieldsNameEnum.MESSAGE_ATTRIBUTES,
  60 + label: t(GcpPubsubFieldsNameEnum.MESSAGE_ATTRIBUTES),
57 61 component: 'AttributeConfiguration',
58 62 helpMessage:
59 63 'Use ${metadataKey} for value from metadata, $[messageKey] for value from message body in name/value fields',
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ExternalCategoryComponentEnum.GCP_PUBSUB);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface GcpPubsubDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -3,68 +3,72 @@ import { AttributeConfiguration } from '/@/views/rule/designer/src/components/At
3 3 import { FormSchema, useComponentRegister } from '/@/components/Form';
4 4 import { CharsetEncodingEnum, CharsetEncodingNameEnum } from '../../../enum/form';
5 5
  6 +import { useI18n } from '/@/hooks/web/useI18n';
  7 +
  8 +const { t } = useI18n();
  9 +
6 10 useComponentRegister('AttributeConfiguration', AttributeConfiguration);
7 11
8 12 export const formSchemas: FormSchema[] = [
9 13 {
10 14 field: KafkaFieldsEnum.TOPIC_PATTERN,
11   - label: KafkaFieldsNameEnum.TOPIC_PATTERN,
  15 + label: t(KafkaFieldsNameEnum.TOPIC_PATTERN),
12 16 component: 'Input',
13 17 helpMessage:
14 18 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
15 19 required: true,
16 20 componentProps: {
17   - placeholder: `请输入${KafkaFieldsEnum.TOPIC_PATTERN}`,
  21 + placeholder: `请输入${t(KafkaFieldsEnum.TOPIC_PATTERN)}`,
18 22 },
19 23 },
20 24 {
21 25 field: KafkaFieldsEnum.BOOTSTRAP_SERVERS,
22   - label: KafkaFieldsNameEnum.BOOTSTRAP_SERVERS,
  26 + label: t(KafkaFieldsNameEnum.BOOTSTRAP_SERVERS),
23 27 component: 'Input',
24 28 required: true,
25 29 componentProps: {
26   - placeholder: `请输入${KafkaFieldsEnum.BOOTSTRAP_SERVERS}`,
  30 + placeholder: `请输入${t(KafkaFieldsEnum.BOOTSTRAP_SERVERS)}`,
27 31 },
28 32 },
29 33 {
30 34 field: KafkaFieldsEnum.RETRIES,
31   - label: KafkaFieldsNameEnum.RETRIES,
  35 + label: t(KafkaFieldsNameEnum.RETRIES),
32 36 component: 'InputNumber',
33 37 componentProps: {
34 38 min: 0,
35   - placeholder: `请输入${KafkaFieldsEnum.BOOTSTRAP_SERVERS}`,
  39 + placeholder: `请输入${t(KafkaFieldsEnum.BOOTSTRAP_SERVERS)}`,
36 40 },
37 41 },
38 42 {
39 43 field: KafkaFieldsEnum.BATCH_SIZE,
40   - label: KafkaFieldsNameEnum.BATCH_SIZE,
  44 + label: t(KafkaFieldsNameEnum.BATCH_SIZE),
41 45 component: 'InputNumber',
42 46 componentProps: {
43 47 min: 0,
44   - placeholder: `请输入${KafkaFieldsEnum.BATCH_SIZE}`,
  48 + placeholder: `请输入${t(KafkaFieldsEnum.BATCH_SIZE)}`,
45 49 },
46 50 },
47 51 {
48 52 field: KafkaFieldsEnum.LINGER,
49   - label: KafkaFieldsNameEnum.LINGER,
  53 + label: t(KafkaFieldsNameEnum.LINGER),
50 54 component: 'InputNumber',
51 55 componentProps: {
52 56 min: 0,
53   - placeholder: `请输入${KafkaFieldsEnum.LINGER}`,
  57 + placeholder: `请输入${t(KafkaFieldsEnum.LINGER)}`,
54 58 },
55 59 },
56 60 {
57 61 field: KafkaFieldsEnum.BUFFER_MEMORY,
58   - label: KafkaFieldsNameEnum.BUFFER_MEMORY,
  62 + label: t(KafkaFieldsNameEnum.BUFFER_MEMORY),
59 63 component: 'InputNumber',
60 64 componentProps: {
61 65 min: 0,
62   - placeholder: `请输入${KafkaFieldsEnum.BUFFER_MEMORY}`,
  66 + placeholder: `请输入${t(KafkaFieldsEnum.BUFFER_MEMORY)}`,
63 67 },
64 68 },
65 69 {
66 70 field: KafkaFieldsEnum.ACKS,
67   - label: KafkaFieldsEnum.ACKS,
  71 + label: t(KafkaFieldsEnum.ACKS),
68 72 component: 'Select',
69 73 required: true,
70 74 componentProps: {
... ... @@ -74,37 +78,37 @@ export const formSchemas: FormSchema[] = [
74 78 { label: '0', value: '0' },
75 79 { label: '1', value: '1' },
76 80 ],
77   - placeholder: `请选择${KafkaFieldsEnum.BUFFER_MEMORY}`,
  81 + placeholder: `请选择${t(KafkaFieldsEnum.ACKS)}`,
78 82 getPopupContainer: () => document.body,
79 83 },
80 84 },
81 85 {
82 86 field: KafkaFieldsEnum.KEY_SERIALIZER,
83   - label: KafkaFieldsNameEnum.KEY_SERIALIZER,
  87 + label: t(KafkaFieldsNameEnum.KEY_SERIALIZER),
84 88 component: 'Input',
85 89 required: true,
86 90 componentProps: {
87   - placeholder: `请输入${KafkaFieldsEnum.KEY_SERIALIZER}`,
  91 + placeholder: `请输入${t(KafkaFieldsNameEnum.KEY_SERIALIZER)}`,
88 92 },
89 93 },
90 94 {
91 95 field: KafkaFieldsEnum.VALUE_SERIALIZER,
92   - label: KafkaFieldsNameEnum.VALUE_SERIALIZER,
  96 + label: t(KafkaFieldsNameEnum.VALUE_SERIALIZER),
93 97 component: 'Input',
94 98 required: true,
95 99 componentProps: {
96   - placeholder: `请输入${KafkaFieldsEnum.VALUE_SERIALIZER}`,
  100 + placeholder: `请输入${t(KafkaFieldsNameEnum.VALUE_SERIALIZER)}`,
97 101 },
98 102 },
99 103 {
100 104 field: KafkaFieldsEnum.OTHER_PROPERTIES,
101   - label: KafkaFieldsNameEnum.OTHER_PROPERTIES,
  105 + label: t(KafkaFieldsNameEnum.OTHER_PROPERTIES),
102 106 component: 'AttributeConfiguration',
103 107 slot: KafkaFieldsEnum.OTHER_PROPERTIES,
104 108 },
105 109 {
106 110 field: KafkaFieldsEnum.ADD_METADATA_KEY_VALUES_AS_KAFKA_HEADERS,
107   - label: KafkaFieldsNameEnum.ADD_METADATA_KEY_VALUES_AS_KAFKA_HEADERS,
  111 + label: t(KafkaFieldsNameEnum.ADD_METADATA_KEY_VALUES_AS_KAFKA_HEADERS),
108 112 component: 'Checkbox',
109 113 renderComponentContent: () => ({
110 114 default: () =>
... ... @@ -113,7 +117,7 @@ export const formSchemas: FormSchema[] = [
113 117 },
114 118 {
115 119 field: KafkaFieldsEnum.KAFKA_HEADERS_CHARSET,
116   - label: KafkaFieldsNameEnum.KAFKA_HEADERS_CHARSET,
  120 + label: t(KafkaFieldsNameEnum.KAFKA_HEADERS_CHARSET),
117 121 component: 'Select',
118 122 required: true,
119 123 show: ({ model }) => model[KafkaFieldsEnum.ADD_METADATA_KEY_VALUES_AS_KAFKA_HEADERS],
... ... @@ -122,7 +126,7 @@ export const formSchemas: FormSchema[] = [
122 126 label: CharsetEncodingNameEnum[value],
123 127 value,
124 128 })),
125   - placeholder: `请选择${KafkaFieldsEnum.KAFKA_HEADERS_CHARSET}`,
  129 + placeholder: `请选择${t(KafkaFieldsEnum.KAFKA_HEADERS_CHARSET)}`,
126 130 getPopupContainer: () => document.body,
127 131 },
128 132 },
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ExternalCategoryComponentEnum.KAFKA);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface KafkaDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
1 1 import { MqttFieldsEnum, MqttFieldsNameEnum } from '../../../../enum/formField/external';
2 2 import { FormSchema } from '/@/components/Form';
  3 +import { useI18n } from '/@/hooks/web/useI18n';
  4 +
  5 +const { t } = useI18n();
3 6
4 7 // Credentials type
5 8 export enum CredentialsTypeEnum {
... ... @@ -51,15 +54,16 @@ export const formSchemas = (
51 54 return [
52 55 {
53 56 field: MqttFieldsEnum.TYPE,
54   - label: MqttFieldsNameEnum.TYPE,
  57 + label: t(MqttFieldsNameEnum.TYPE),
55 58 component: 'Select',
56 59 required: true,
57 60 defaultValue: CredentialsTypeEnum.ANONYMOUS,
58 61 componentProps: ({ formActionType }) => {
59 62 const { setFieldsValue } = formActionType;
60 63 return {
  64 + allowClear: false,
61 65 options: credentialsTypeOptions,
62   - placeholder: `请选择${MqttFieldsNameEnum.TYPE}`,
  66 + placeholder: `请选择${t(MqttFieldsNameEnum.TYPE)}`,
63 67 getPopupContainer: () => document.body,
64 68 onChange(
65 69 value: CredentialsTypeEnum,
... ... @@ -81,23 +85,23 @@ export const formSchemas = (
81 85 },
82 86 {
83 87 field: MqttFieldsEnum.USERNAME,
84   - label: MqttFieldsNameEnum.USERNAME,
  88 + label: t(MqttFieldsNameEnum.USERNAME),
85 89 component: 'Input',
86 90 required: true,
87 91 ifShow: ({ model }) => model[MqttFieldsEnum.TYPE] === CredentialsTypeEnum.BASIC,
88 92 componentProps: {
89   - placeholder: `请输入${MqttFieldsNameEnum.USERNAME}`,
  93 + placeholder: `请输入${t(MqttFieldsNameEnum.USERNAME)}`,
90 94 },
91 95 },
92 96 {
93 97 field: MqttFieldsEnum.CA_CERT_FILE_NAME,
94   - label: MqttFieldsNameEnum.CA_CERT_FILE_NAME,
  98 + label: t(MqttFieldsNameEnum.CA_CERT_FILE_NAME),
95 99 component: 'InputPassword',
96 100 show: false,
97 101 },
98 102 {
99 103 field: MqttFieldsEnum.CA_CERT,
100   - label: MqttFieldsNameEnum.CA_CERT,
  104 + label: t(MqttFieldsNameEnum.CA_CERT),
101 105 component: 'ApiUpload',
102 106 valueField: 'fileList',
103 107 changeEvent: 'update:fileList',
... ... @@ -116,13 +120,13 @@ export const formSchemas = (
116 120 },
117 121 {
118 122 field: MqttFieldsEnum.CERT_FILE_NAME,
119   - label: MqttFieldsNameEnum.CERT_FILE_NAME,
  123 + label: t(MqttFieldsNameEnum.CERT_FILE_NAME),
120 124 component: 'InputPassword',
121 125 show: false,
122 126 },
123 127 {
124 128 field: MqttFieldsEnum.CERT,
125   - label: MqttFieldsNameEnum.CERT,
  129 + label: t(MqttFieldsNameEnum.CERT),
126 130 component: 'ApiUpload',
127 131 valueField: 'fileList',
128 132 changeEvent: 'update:fileList',
... ... @@ -141,13 +145,13 @@ export const formSchemas = (
141 145 },
142 146 {
143 147 field: MqttFieldsEnum.PRIVATE_KEY_FILE_NAME,
144   - label: MqttFieldsNameEnum.PRIVATE_KEY_FILE_NAME,
  148 + label: t(MqttFieldsNameEnum.PRIVATE_KEY_FILE_NAME),
145 149 component: 'InputPassword',
146 150 show: false,
147 151 },
148 152 {
149 153 field: MqttFieldsEnum.PRIVATE_KEY,
150   - label: MqttFieldsNameEnum.PRIVATE_KEY,
  154 + label: t(MqttFieldsNameEnum.PRIVATE_KEY),
151 155 component: 'ApiUpload',
152 156 valueField: 'fileList',
153 157 changeEvent: 'update:fileList',
... ... @@ -166,13 +170,13 @@ export const formSchemas = (
166 170 },
167 171 {
168 172 field: MqttFieldsEnum.PASSWORD,
169   - label: MqttFieldsNameEnum.PASSWORD,
  173 + label: t(MqttFieldsNameEnum.PASSWORD),
170 174 component: 'InputPassword',
171 175 ifShow: ({ model }) =>
172 176 model[MqttFieldsEnum.TYPE] === CredentialsTypeEnum.PEM ||
173 177 model[MqttFieldsEnum.TYPE] === CredentialsTypeEnum.BASIC,
174 178 componentProps: {
175   - placeholder: `请输入${MqttFieldsNameEnum.PASSWORD}`,
  179 + placeholder: `请输入${t(MqttFieldsNameEnum.PASSWORD)}`,
176 180 },
177 181 },
178 182 ];
... ...
1 1 import { MqttFieldsEnum, MqttFieldsNameEnum } from '../../../enum/formField/external';
2 2 import { CredentialsCard } from './CredentialsCard';
3 3 import { FormSchema, useComponentRegister } from '/@/components/Form';
  4 +import { useI18n } from '/@/hooks/web/useI18n';
  5 +
  6 +const { t } = useI18n();
4 7
5 8 useComponentRegister('CredentialsCard', CredentialsCard);
6 9
7 10 export const formSchemas: FormSchema[] = [
8 11 {
9 12 field: MqttFieldsEnum.TOPIC_PATTERN,
10   - label: MqttFieldsNameEnum.TOPIC_PATTERN,
  13 + label: t(MqttFieldsNameEnum.TOPIC_PATTERN),
11 14 component: 'Input',
12 15 helpMessage:
13 16 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
14 17 required: true,
15 18 componentProps: {
16   - placeholder: `请输入${MqttFieldsNameEnum.TOPIC_PATTERN}`,
  19 + placeholder: `请输入${t(MqttFieldsNameEnum.TOPIC_PATTERN)}`,
17 20 },
18 21 },
19 22 {
20 23 field: MqttFieldsEnum.HOST,
21   - label: MqttFieldsNameEnum.HOST,
  24 + label: t(MqttFieldsNameEnum.HOST),
22 25 component: 'Input',
23 26 required: true,
24 27 colProps: { span: 8 },
25 28 componentProps: {
26   - placeholder: `请输入${MqttFieldsNameEnum.HOST}`,
  29 + placeholder: `请输入${t(MqttFieldsNameEnum.HOST)}`,
27 30 },
28 31 },
29 32 {
30 33 field: MqttFieldsEnum.PORT,
31   - label: MqttFieldsNameEnum.PORT,
  34 + label: t(MqttFieldsNameEnum.PORT),
32 35 component: 'InputNumber',
33 36 required: true,
34 37 colProps: { span: 8 },
35 38 componentProps: {
36   - placeholder: `请输入${MqttFieldsNameEnum.PORT}`,
  39 + placeholder: `请输入${t(MqttFieldsNameEnum.PORT)}`,
37 40 },
38 41 },
39 42 {
40 43 field: MqttFieldsEnum.CONNECT_TIMEOUT_SEC,
41   - label: MqttFieldsNameEnum.CONNECT_TIMEOUT_SEC,
  44 + label: t(MqttFieldsNameEnum.CONNECT_TIMEOUT_SEC),
42 45 component: 'Input',
43 46 required: true,
44 47 colProps: { span: 8 },
45 48 componentProps: {
46   - placeholder: `请输入${MqttFieldsNameEnum.CONNECT_TIMEOUT_SEC}`,
  49 + placeholder: `请输入${t(MqttFieldsNameEnum.CONNECT_TIMEOUT_SEC)}`,
47 50 },
48 51 },
49 52 {
50 53 field: MqttFieldsEnum.CLIENT_ID,
51   - label: MqttFieldsNameEnum.CLIENT_ID,
  54 + label: t(MqttFieldsNameEnum.CLIENT_ID),
52 55 component: 'Input',
53 56 helpMessage:
54 57 'Hint: Optional. Leave empty for auto-generated Client ID. Be careful when specifying the Client ID. Majority of the MQTT brokers will not allow multiple connections with the same Client ID. To connect to such brokers, your mqtt Client ID must be unique. When platform is running in a micro-services mode, the copy of rule node is launched in each micro-service. This will automatically lead to multiple mqtt clients with the same ID and may cause failures of the rule node. To avoid such failures enable "Add Service ID as suffix to Client ID" option below.',
55 58 componentProps: {
56   - placeholder: `请输入${MqttFieldsNameEnum.TOPIC_PATTERN}`,
  59 + placeholder: `请输入${t(MqttFieldsNameEnum.TOPIC_PATTERN)}`,
57 60 },
58 61 },
59 62 {
60 63 field: MqttFieldsEnum.APPEND_CLIENT_ID_SUFFIX,
61   - label: MqttFieldsNameEnum.APPEND_CLIENT_ID_SUFFIX,
  64 + label: t(MqttFieldsNameEnum.APPEND_CLIENT_ID_SUFFIX),
62 65 component: 'Checkbox',
63 66 renderComponentContent: () => ({
64 67 default: () =>
... ... @@ -76,7 +79,7 @@ export const formSchemas: FormSchema[] = [
76 79 label: '',
77 80 component: 'Checkbox',
78 81 renderComponentContent: () => ({
79   - default: () => MqttFieldsNameEnum.CLEAN_SESSION,
  82 + default: () => t(MqttFieldsNameEnum.CLEAN_SESSION),
80 83 }),
81 84 },
82 85 {
... ... @@ -84,12 +87,12 @@ export const formSchemas: FormSchema[] = [
84 87 label: '',
85 88 component: 'Checkbox',
86 89 renderComponentContent: () => ({
87   - default: () => MqttFieldsNameEnum.SSL,
  90 + default: () => t(MqttFieldsNameEnum.SSL),
88 91 }),
89 92 },
90 93 {
91 94 field: MqttFieldsEnum.CREDENTIALS,
92   - label: MqttFieldsNameEnum.CREDENTIALS,
  95 + label: t(MqttFieldsNameEnum.CREDENTIALS),
93 96 component: 'CredentialsCard',
94 97 slot: MqttFieldsEnum.CREDENTIALS,
95 98 },
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ExternalCategoryComponentEnum.MQTT);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface MqttDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
1 1 import { MessagePropertiesEnum } from '../../../enum/form';
2 2 import { RabbitmqFieldsEnum, RabbitmqFieldsNameEnum } from '../../../enum/formField/external';
3 3 import { FormSchema } from '/@/components/Form';
  4 +import { useI18n } from '/@/hooks/web/useI18n';
  5 +
  6 +const { t } = useI18n();
4 7
5 8 export const formSchemas: FormSchema[] = [
6 9 {
7 10 field: RabbitmqFieldsEnum.EXCHANGE_NAME_PATTERN,
8   - label: RabbitmqFieldsNameEnum.EXCHANGE_NAME_PATTERN,
  11 + label: t(RabbitmqFieldsNameEnum.EXCHANGE_NAME_PATTERN),
9 12 component: 'Input',
10 13 componentProps: {
11   - placeholder: `请输入${RabbitmqFieldsNameEnum.EXCHANGE_NAME_PATTERN}`,
  14 + placeholder: `请输入${t(RabbitmqFieldsNameEnum.EXCHANGE_NAME_PATTERN)}`,
12 15 },
13 16 },
14 17 {
15 18 field: RabbitmqFieldsEnum.ROUTING_KEY_PATTERN,
16   - label: RabbitmqFieldsNameEnum.ROUTING_KEY_PATTERN,
  19 + label: t(RabbitmqFieldsNameEnum.ROUTING_KEY_PATTERN),
17 20 component: 'Input',
18 21 componentProps: {
19   - placeholder: `请输入${RabbitmqFieldsNameEnum.ROUTING_KEY_PATTERN}`,
  22 + placeholder: `请输入${t(RabbitmqFieldsNameEnum.ROUTING_KEY_PATTERN)}`,
20 23 },
21 24 },
22 25 {
23 26 field: RabbitmqFieldsEnum.MESSAGE_PROPERTIES,
24   - label: RabbitmqFieldsNameEnum.MESSAGE_PROPERTIES,
  27 + label: t(RabbitmqFieldsNameEnum.MESSAGE_PROPERTIES),
25 28 component: 'Select',
26 29 componentProps: {
27 30 allowClear: true,
28 31 options: Object.keys(MessagePropertiesEnum).map((value) => ({ label: value, value })),
29   - placeholder: `请选择${RabbitmqFieldsNameEnum.ROUTING_KEY_PATTERN}`,
  32 + placeholder: `请选择${t(RabbitmqFieldsNameEnum.ROUTING_KEY_PATTERN)}`,
30 33 getPopupContainer: () => document.body,
31 34 },
32 35 },
33 36 {
34 37 field: RabbitmqFieldsEnum.HOST,
35   - label: RabbitmqFieldsNameEnum.HOST,
  38 + label: t(RabbitmqFieldsNameEnum.HOST),
36 39 component: 'Input',
37 40 required: true,
38 41 colProps: { span: 12 },
39 42 componentProps: {
40   - placeholder: `请输入${RabbitmqFieldsNameEnum.HOST}`,
  43 + placeholder: `请输入${t(RabbitmqFieldsNameEnum.HOST)}`,
41 44 },
42 45 },
43 46 {
44 47 field: RabbitmqFieldsEnum.PORT,
45   - label: RabbitmqFieldsNameEnum.PORT,
  48 + label: t(RabbitmqFieldsNameEnum.PORT),
46 49 component: 'InputNumber',
47 50 required: true,
48 51 colProps: { span: 12 },
49 52 componentProps: {
50   - placeholder: `请输入${RabbitmqFieldsNameEnum.PORT}`,
  53 + placeholder: `请输入${t(RabbitmqFieldsNameEnum.PORT)}`,
51 54 },
52 55 },
53 56 {
54 57 field: RabbitmqFieldsEnum.VIRTUAL_HOST,
55   - label: RabbitmqFieldsNameEnum.VIRTUAL_HOST,
  58 + label: t(RabbitmqFieldsNameEnum.VIRTUAL_HOST),
56 59 component: 'Input',
57 60 componentProps: {
58   - placeholder: `请输入${RabbitmqFieldsNameEnum.VIRTUAL_HOST}`,
  61 + placeholder: `请输入${t(RabbitmqFieldsNameEnum.VIRTUAL_HOST)}`,
59 62 },
60 63 },
61 64 {
62 65 field: RabbitmqFieldsEnum.USERNAME,
63   - label: RabbitmqFieldsNameEnum.USERNAME,
  66 + label: t(RabbitmqFieldsNameEnum.USERNAME),
64 67 component: 'Input',
65 68 componentProps: {
66   - placeholder: `请输入${RabbitmqFieldsNameEnum.USERNAME}`,
  69 + placeholder: `请输入${t(RabbitmqFieldsNameEnum.USERNAME)}`,
67 70 },
68 71 },
69 72 {
70 73 field: RabbitmqFieldsEnum.PASSWORD,
71   - label: RabbitmqFieldsNameEnum.PASSWORD,
  74 + label: t(RabbitmqFieldsNameEnum.PASSWORD),
72 75 component: 'Input',
73 76 componentProps: {
74   - placeholder: `请输入${RabbitmqFieldsNameEnum.PASSWORD}`,
  77 + placeholder: `请输入${t(RabbitmqFieldsNameEnum.PASSWORD)}`,
75 78 },
76 79 },
77 80 {
... ... @@ -79,30 +82,30 @@ export const formSchemas: FormSchema[] = [
79 82 component: 'Checkbox',
80 83 label: '',
81 84 renderComponentContent: () => ({
82   - default: () => RabbitmqFieldsNameEnum.AUTOMATIC_RECOVERY_ENABLED,
  85 + default: () => t(RabbitmqFieldsNameEnum.AUTOMATIC_RECOVERY_ENABLED),
83 86 }),
84 87 },
85 88 {
86 89 field: RabbitmqFieldsEnum.CONNECTION_TIMEOUT,
87   - label: RabbitmqFieldsNameEnum.CONNECTION_TIMEOUT,
  90 + label: t(RabbitmqFieldsNameEnum.CONNECTION_TIMEOUT),
88 91 component: 'InputNumber',
89 92 componentProps: {
90 93 min: 0,
91   - placeholder: `请输入${RabbitmqFieldsNameEnum.CONNECTION_TIMEOUT}`,
  94 + placeholder: `请输入${t(RabbitmqFieldsNameEnum.CONNECTION_TIMEOUT)}`,
92 95 },
93 96 },
94 97 {
95 98 field: RabbitmqFieldsEnum.HANDSHAKE_TIMEOUT,
96   - label: RabbitmqFieldsNameEnum.HANDSHAKE_TIMEOUT,
  99 + label: t(RabbitmqFieldsNameEnum.HANDSHAKE_TIMEOUT),
97 100 component: 'InputNumber',
98 101 componentProps: {
99 102 min: 0,
100   - placeholder: `请输入${RabbitmqFieldsNameEnum.HANDSHAKE_TIMEOUT}`,
  103 + placeholder: `请输入${t(RabbitmqFieldsNameEnum.HANDSHAKE_TIMEOUT)}`,
101 104 },
102 105 },
103 106 {
104 107 field: RabbitmqFieldsEnum.CLIENT_PROPERTIES,
105   - label: RabbitmqFieldsNameEnum.CLIENT_PROPERTIES,
  108 + label: t(RabbitmqFieldsNameEnum.CLIENT_PROPERTIES),
106 109 component: 'Input',
107 110 slot: RabbitmqFieldsEnum.CLIENT_PROPERTIES,
108 111 },
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ExternalCategoryComponentEnum.RABBITMQ);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10
11 11 export interface RabbitmqDataType {
12 12 someConfiguration?: Recordable;
... ...
1 1 import { ProtocolEnum, ProtocolNameEnum, RequestMethodEnum } from '../../../enum/form';
2 2 import { RestApiCallFieldsEnum, RestApiCallFieldsNameEnum } from '../../../enum/formField/external';
3 3 import { FormSchema } from '/@/components/Form';
  4 +import { useI18n } from '/@/hooks/web/useI18n';
  5 +
  6 +const { t } = useI18n();
4 7
5 8 export const formSchemas: FormSchema[] = [
6 9 {
7 10 field: RestApiCallFieldsEnum.REST_ENDPOINT_URL_PATTERN,
8   - label: RestApiCallFieldsNameEnum.REST_ENDPOINT_URL_PATTERN,
  11 + label: t(RestApiCallFieldsNameEnum.REST_ENDPOINT_URL_PATTERN),
9 12 component: 'Input',
10 13 required: true,
11 14 helpMessage:
12 15 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
13 16 componentProps: {
14   - placeholder: `请输入${RestApiCallFieldsNameEnum.REST_ENDPOINT_URL_PATTERN}`,
  17 + placeholder: `请输入${t(RestApiCallFieldsNameEnum.REST_ENDPOINT_URL_PATTERN)}`,
15 18 },
16 19 },
17 20 {
18 21 field: RestApiCallFieldsEnum.REQUEST_METHOD,
19   - label: RestApiCallFieldsNameEnum.REQUEST_METHOD,
  22 + label: t(RestApiCallFieldsNameEnum.REQUEST_METHOD),
20 23 component: 'Select',
21 24 required: true,
22 25 componentProps: {
23 26 options: Object.keys(RequestMethodEnum).map((value) => ({ label: value, value })),
24 27 getPopupContainer: () => document.body,
25   - placeholder: `请选择${RestApiCallFieldsNameEnum.REQUEST_METHOD}`,
  28 + placeholder: `请选择${t(RestApiCallFieldsNameEnum.REQUEST_METHOD)}`,
26 29 },
27 30 },
28 31 {
... ... @@ -30,7 +33,7 @@ export const formSchemas: FormSchema[] = [
30 33 label: '',
31 34 component: 'Checkbox',
32 35 renderComponentContent: () => ({
33   - default: () => RestApiCallFieldsNameEnum.ENABLE_PROXY,
  36 + default: () => t(RestApiCallFieldsNameEnum.ENABLE_PROXY),
34 37 }),
35 38 },
36 39 {
... ... @@ -39,7 +42,7 @@ export const formSchemas: FormSchema[] = [
39 42 component: 'Checkbox',
40 43 show: ({ model }) => !model[RestApiCallFieldsEnum.ENABLE_PROXY],
41 44 renderComponentContent: () => ({
42   - default: () => RestApiCallFieldsNameEnum.USE_SIMPLE_CLIENT_HTTP_FACTORY,
  45 + default: () => t(RestApiCallFieldsNameEnum.USE_SIMPLE_CLIENT_HTTP_FACTORY),
43 46 }),
44 47 },
45 48 {
... ... @@ -47,7 +50,7 @@ export const formSchemas: FormSchema[] = [
47 50 label: '',
48 51 component: 'Checkbox',
49 52 renderComponentContent: () => ({
50   - default: () => RestApiCallFieldsNameEnum.IGNORE_REQUEST_BODY,
  53 + default: () => t(RestApiCallFieldsNameEnum.IGNORE_REQUEST_BODY),
51 54 }),
52 55 },
53 56 {
... ... @@ -56,12 +59,12 @@ export const formSchemas: FormSchema[] = [
56 59 component: 'Checkbox',
57 60 show: ({ model }) => model[RestApiCallFieldsEnum.ENABLE_PROXY],
58 61 renderComponentContent: () => ({
59   - default: () => RestApiCallFieldsNameEnum.USE_SYSTEM_PROXY_PROPERTIES,
  62 + default: () => t(RestApiCallFieldsNameEnum.USE_SYSTEM_PROXY_PROPERTIES),
60 63 }),
61 64 },
62 65 {
63 66 field: RestApiCallFieldsEnum.PROXY_SCHEME,
64   - label: RestApiCallFieldsNameEnum.PROXY_SCHEME,
  67 + label: t(RestApiCallFieldsNameEnum.PROXY_SCHEME),
65 68 component: 'Select',
66 69 required: true,
67 70 colProps: { span: 8 },
... ... @@ -71,7 +74,7 @@ export const formSchemas: FormSchema[] = [
71 74 value,
72 75 })),
73 76 getPopupContainer: () => document.body,
74   - placeholder: `请选择${RestApiCallFieldsEnum.PROXY_SCHEME}`,
  77 + placeholder: `请选择${t(RestApiCallFieldsEnum.PROXY_SCHEME)}`,
75 78 },
76 79 ifShow: ({ model }) => {
77 80 const ifShowField = model[RestApiCallFieldsEnum.ENABLE_PROXY];
... ... @@ -80,12 +83,12 @@ export const formSchemas: FormSchema[] = [
80 83 },
81 84 {
82 85 field: RestApiCallFieldsEnum.PROXY_HOST,
83   - label: RestApiCallFieldsNameEnum.PROXY_HOST,
  86 + label: t(RestApiCallFieldsNameEnum.PROXY_HOST),
84 87 component: 'Input',
85 88 required: true,
86 89 colProps: { span: 8 },
87 90 componentProps: {
88   - placeholder: `请输入${RestApiCallFieldsNameEnum.PROXY_HOST}`,
  91 + placeholder: `请输入${t(RestApiCallFieldsNameEnum.PROXY_HOST)}`,
89 92 },
90 93 ifShow: ({ model }) => {
91 94 const ifShowField = model[RestApiCallFieldsEnum.ENABLE_PROXY];
... ... @@ -94,12 +97,12 @@ export const formSchemas: FormSchema[] = [
94 97 },
95 98 {
96 99 field: RestApiCallFieldsEnum.PROXY_PORT,
97   - label: RestApiCallFieldsNameEnum.PROXY_PORT,
  100 + label: t(RestApiCallFieldsNameEnum.PROXY_PORT),
98 101 component: 'InputNumber',
99 102 required: true,
100 103 colProps: { span: 8 },
101 104 componentProps: {
102   - placeholder: `请输入${RestApiCallFieldsNameEnum.PROXY_HOST}`,
  105 + placeholder: `请输入${t(RestApiCallFieldsNameEnum.PROXY_HOST)}`,
103 106 },
104 107 ifShow: ({ model }) => {
105 108 const ifShowField = model[RestApiCallFieldsEnum.ENABLE_PROXY];
... ... @@ -108,10 +111,10 @@ export const formSchemas: FormSchema[] = [
108 111 },
109 112 {
110 113 field: RestApiCallFieldsEnum.PROXY_USER,
111   - label: RestApiCallFieldsNameEnum.PROXY_USER,
  114 + label: t(RestApiCallFieldsNameEnum.PROXY_USER),
112 115 component: 'Input',
113 116 componentProps: {
114   - placeholder: `请输入${RestApiCallFieldsNameEnum.PROXY_USER}`,
  117 + placeholder: `请输入${t(RestApiCallFieldsNameEnum.PROXY_USER)}`,
115 118 },
116 119 ifShow: ({ model }) => {
117 120 const ifShowField = model[RestApiCallFieldsEnum.ENABLE_PROXY];
... ... @@ -120,10 +123,10 @@ export const formSchemas: FormSchema[] = [
120 123 },
121 124 {
122 125 field: RestApiCallFieldsEnum.PROXY_PASSWORD,
123   - label: RestApiCallFieldsNameEnum.PROXY_PASSWORD,
  126 + label: t(RestApiCallFieldsNameEnum.PROXY_PASSWORD),
124 127 component: 'Input',
125 128 componentProps: {
126   - placeholder: `请输入${RestApiCallFieldsNameEnum.PROXY_PASSWORD}`,
  129 + placeholder: `请输入${t(RestApiCallFieldsNameEnum.PROXY_PASSWORD)}`,
127 130 },
128 131 ifShow: ({ model }) => {
129 132 const ifShowField = model[RestApiCallFieldsEnum.ENABLE_PROXY];
... ... @@ -132,25 +135,25 @@ export const formSchemas: FormSchema[] = [
132 135 },
133 136 {
134 137 field: RestApiCallFieldsEnum.READ_TIMEOUT_MS,
135   - label: RestApiCallFieldsNameEnum.READ_TIMEOUT_MS,
  138 + label: t(RestApiCallFieldsNameEnum.READ_TIMEOUT_MS),
136 139 component: 'InputNumber',
137 140 componentProps: {
138 141 min: 0,
139   - placeholder: `请输入${RestApiCallFieldsNameEnum.READ_TIMEOUT_MS}`,
  142 + placeholder: `请输入${t(RestApiCallFieldsNameEnum.READ_TIMEOUT_MS)}`,
140 143 },
141 144 },
142 145 {
143 146 field: RestApiCallFieldsEnum.MAX_PARALLEL_REQUESTS_COUNT,
144   - label: RestApiCallFieldsNameEnum.MAX_PARALLEL_REQUESTS_COUNT,
  147 + label: t(RestApiCallFieldsNameEnum.MAX_PARALLEL_REQUESTS_COUNT),
145 148 component: 'InputNumber',
146 149 componentProps: {
147 150 min: 0,
148   - placeholder: `请输入${RestApiCallFieldsNameEnum.MAX_PARALLEL_REQUESTS_COUNT}`,
  151 + placeholder: `请输入${t(RestApiCallFieldsNameEnum.MAX_PARALLEL_REQUESTS_COUNT)}`,
149 152 },
150 153 },
151 154 {
152 155 field: RestApiCallFieldsEnum.HEADERS,
153   - label: RestApiCallFieldsNameEnum.HEADERS,
  156 + label: t(RestApiCallFieldsNameEnum.HEADERS),
154 157 component: 'Input',
155 158 slot: RestApiCallFieldsEnum.HEADERS,
156 159 },
... ... @@ -159,7 +162,7 @@ export const formSchemas: FormSchema[] = [
159 162 label: '',
160 163 component: 'Checkbox',
161 164 renderComponentContent: () => ({
162   - default: () => RestApiCallFieldsNameEnum.USE_REDIS_QUEUE_FOR_MSG_PERSISTENCE,
  165 + default: () => t(RestApiCallFieldsNameEnum.USE_REDIS_QUEUE_FOR_MSG_PERSISTENCE),
163 166 }),
164 167 },
165 168 {
... ... @@ -168,22 +171,22 @@ export const formSchemas: FormSchema[] = [
168 171 component: 'Checkbox',
169 172 ifShow: ({ model }) => model[RestApiCallFieldsEnum.USE_REDIS_QUEUE_FOR_MSG_PERSISTENCE],
170 173 renderComponentContent: () => ({
171   - default: () => RestApiCallFieldsNameEnum.TRIM_QUEUE,
  174 + default: () => t(RestApiCallFieldsNameEnum.TRIM_QUEUE),
172 175 }),
173 176 },
174 177 {
175 178 field: RestApiCallFieldsEnum.MAX_QUEUE_SIZE,
176   - label: RestApiCallFieldsNameEnum.MAX_QUEUE_SIZE,
  179 + label: t(RestApiCallFieldsNameEnum.MAX_QUEUE_SIZE),
177 180 component: 'InputNumber',
178 181 ifShow: ({ model }) => model[RestApiCallFieldsEnum.USE_REDIS_QUEUE_FOR_MSG_PERSISTENCE],
179 182 componentProps: {
180 183 min: 0,
181   - placeholder: `请输入${RestApiCallFieldsNameEnum.MAX_QUEUE_SIZE}`,
  184 + placeholder: `请输入${t(RestApiCallFieldsNameEnum.MAX_QUEUE_SIZE)}`,
182 185 },
183 186 },
184 187 {
185 188 field: RestApiCallFieldsEnum.CREDENTIALS,
186   - label: RestApiCallFieldsNameEnum.CREDENTIALS,
  189 + label: t(RestApiCallFieldsNameEnum.CREDENTIALS),
187 190 component: 'Input',
188 191 slot: RestApiCallFieldsEnum.CREDENTIALS,
189 192 },
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ExternalCategoryComponentEnum.REST_API_CALL);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface RestApiCallDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -6,6 +6,9 @@ import {
6 6 } from '../../../enum/form';
7 7 import { SendEmailFieldsEnum, SendEmailFieldsNameEnum } from '../../../enum/formField/external';
8 8 import { FormSchema } from '/@/components/Form';
  9 +import { useI18n } from '/@/hooks/web/useI18n';
  10 +
  11 +const { t } = useI18n();
9 12
10 13 export const formSchemas: FormSchema[] = [
11 14 {
... ... @@ -13,12 +16,12 @@ export const formSchemas: FormSchema[] = [
13 16 label: '',
14 17 component: 'Checkbox',
15 18 renderComponentContent: () => ({
16   - default: () => SendEmailFieldsNameEnum.USE_SYSTEM_SMTP_SETTINGS,
  19 + default: () => t(SendEmailFieldsNameEnum.USE_SYSTEM_SMTP_SETTINGS),
17 20 }),
18 21 },
19 22 {
20 23 field: SendEmailFieldsEnum.SMTP_PROTOCOL,
21   - label: SendEmailFieldsNameEnum.SMTP_PROTOCOL,
  24 + label: t(SendEmailFieldsNameEnum.SMTP_PROTOCOL),
22 25 component: 'Select',
23 26 required: true,
24 27 ifShow: ({ model }) => !model[SendEmailFieldsEnum.USE_SYSTEM_SMTP_SETTINGS],
... ... @@ -27,42 +30,42 @@ export const formSchemas: FormSchema[] = [
27 30 label: EmailProtocolNameEnum[value],
28 31 value,
29 32 })),
30   - placeholder: `请选择${SendEmailFieldsNameEnum.SMTP_PROTOCOL}`,
  33 + placeholder: `请选择${t(SendEmailFieldsNameEnum.SMTP_PROTOCOL)}`,
31 34 getPopupContainer: () => document.body,
32 35 },
33 36 },
34 37 {
35 38 field: SendEmailFieldsEnum.SMTP_HOST,
36   - label: SendEmailFieldsNameEnum.SMTP_HOST,
  39 + label: t(SendEmailFieldsNameEnum.SMTP_HOST),
37 40 component: 'Input',
38 41 required: true,
39 42 colProps: { span: 12 },
40 43 ifShow: ({ model }) => !model[SendEmailFieldsEnum.USE_SYSTEM_SMTP_SETTINGS],
41 44 componentProps: {
42   - placeholder: `请输入${SendEmailFieldsNameEnum.SMTP_HOST}`,
  45 + placeholder: `请输入${t(SendEmailFieldsNameEnum.SMTP_HOST)}`,
43 46 },
44 47 },
45 48 {
46 49 field: SendEmailFieldsEnum.SMTP_PORT,
47   - label: SendEmailFieldsNameEnum.SMTP_PORT,
  50 + label: t(SendEmailFieldsNameEnum.SMTP_PORT),
48 51 component: 'InputNumber',
49 52 required: true,
50 53 colProps: { span: 12 },
51 54 ifShow: ({ model }) => !model[SendEmailFieldsEnum.USE_SYSTEM_SMTP_SETTINGS],
52 55 componentProps: {
53 56 min: 0,
54   - placeholder: `请输入${SendEmailFieldsNameEnum.SMTP_PORT}`,
  57 + placeholder: `请输入${t(SendEmailFieldsNameEnum.SMTP_PORT)}`,
55 58 },
56 59 },
57 60 {
58 61 field: SendEmailFieldsEnum.TIMEOUT,
59   - label: SendEmailFieldsNameEnum.TIMEOUT,
  62 + label: t(SendEmailFieldsNameEnum.TIMEOUT),
60 63 component: 'InputNumber',
61 64 required: true,
62 65 ifShow: ({ model }) => !model[SendEmailFieldsEnum.USE_SYSTEM_SMTP_SETTINGS],
63 66 componentProps: {
64 67 min: 0,
65   - placeholder: `请输入${SendEmailFieldsNameEnum.TIMEOUT}`,
  68 + placeholder: `请输入${t(SendEmailFieldsNameEnum.TIMEOUT)}`,
66 69 },
67 70 },
68 71 {
... ... @@ -71,12 +74,12 @@ export const formSchemas: FormSchema[] = [
71 74 component: 'Checkbox',
72 75 ifShow: ({ model }) => !model[SendEmailFieldsEnum.USE_SYSTEM_SMTP_SETTINGS],
73 76 renderComponentContent: () => ({
74   - default: () => SendEmailFieldsNameEnum.ENABLE_TLS,
  77 + default: () => t(SendEmailFieldsNameEnum.ENABLE_TLS),
75 78 }),
76 79 },
77 80 {
78 81 field: SendEmailFieldsEnum.TLS_VERSION,
79   - label: SendEmailFieldsNameEnum.TLS_VERSION,
  82 + label: t(SendEmailFieldsNameEnum.TLS_VERSION),
80 83 component: 'Select',
81 84 required: true,
82 85 ifShow: ({ model }) =>
... ... @@ -86,7 +89,7 @@ export const formSchemas: FormSchema[] = [
86 89 label: TSLVersionNameEnum[value],
87 90 value,
88 91 })),
89   - placeholder: `请选择${SendEmailFieldsNameEnum.TLS_VERSION}`,
  92 + placeholder: `请选择${t(SendEmailFieldsNameEnum.TLS_VERSION)}`,
90 93 getPopupContainer: () => document.body,
91 94 },
92 95 },
... ... @@ -96,12 +99,12 @@ export const formSchemas: FormSchema[] = [
96 99 component: 'Checkbox',
97 100 ifShow: ({ model }) => !model[SendEmailFieldsEnum.USE_SYSTEM_SMTP_SETTINGS],
98 101 renderComponentContent: () => ({
99   - default: () => SendEmailFieldsNameEnum.ENABLE_PROXY,
  102 + default: () => t(SendEmailFieldsNameEnum.ENABLE_PROXY),
100 103 }),
101 104 },
102 105 {
103 106 field: SendEmailFieldsEnum.PROXY_HOST,
104   - label: SendEmailFieldsNameEnum.PROXY_HOST,
  107 + label: t(SendEmailFieldsNameEnum.PROXY_HOST),
105 108 component: 'Input',
106 109 required: true,
107 110 colProps: { span: 12 },
... ... @@ -109,12 +112,12 @@ export const formSchemas: FormSchema[] = [
109 112 !model[SendEmailFieldsEnum.USE_SYSTEM_SMTP_SETTINGS] &&
110 113 model[SendEmailFieldsEnum.ENABLE_PROXY],
111 114 componentProps: {
112   - placeholder: `请输入${SendEmailFieldsNameEnum.PROXY_HOST}`,
  115 + placeholder: `请输入${t(SendEmailFieldsNameEnum.PROXY_HOST)}`,
113 116 },
114 117 },
115 118 {
116 119 field: SendEmailFieldsEnum.PROXY_PORT,
117   - label: SendEmailFieldsNameEnum.PROXY_PORT,
  120 + label: t(SendEmailFieldsNameEnum.PROXY_PORT),
118 121 component: 'Input',
119 122 required: true,
120 123 colProps: { span: 12 },
... ... @@ -122,47 +125,47 @@ export const formSchemas: FormSchema[] = [
122 125 !model[SendEmailFieldsEnum.USE_SYSTEM_SMTP_SETTINGS] &&
123 126 model[SendEmailFieldsEnum.ENABLE_PROXY],
124 127 componentProps: {
125   - placeholder: `请输入${SendEmailFieldsNameEnum.PROXY_PORT}`,
  128 + placeholder: `请输入${t(SendEmailFieldsNameEnum.PROXY_PORT)}`,
126 129 },
127 130 },
128 131 {
129 132 field: SendEmailFieldsEnum.PROXY_USER,
130   - label: SendEmailFieldsNameEnum.PROXY_USER,
  133 + label: t(SendEmailFieldsNameEnum.PROXY_USER),
131 134 component: 'Input',
132 135 ifShow: ({ model }) =>
133 136 !model[SendEmailFieldsEnum.USE_SYSTEM_SMTP_SETTINGS] &&
134 137 model[SendEmailFieldsEnum.ENABLE_PROXY],
135 138 componentProps: {
136   - placeholder: `请输入${SendEmailFieldsNameEnum.PROXY_USER}`,
  139 + placeholder: `请输入${t(SendEmailFieldsNameEnum.PROXY_USER)}`,
137 140 },
138 141 },
139 142 {
140 143 field: SendEmailFieldsEnum.PROXY_PASSWORD,
141   - label: SendEmailFieldsNameEnum.PROXY_PASSWORD,
  144 + label: t(SendEmailFieldsNameEnum.PROXY_PASSWORD),
142 145 component: 'Input',
143 146 ifShow: ({ model }) =>
144 147 !model[SendEmailFieldsEnum.USE_SYSTEM_SMTP_SETTINGS] &&
145 148 model[SendEmailFieldsEnum.ENABLE_PROXY],
146 149 componentProps: {
147   - placeholder: `请输入${SendEmailFieldsNameEnum.PROXY_PASSWORD}`,
  150 + placeholder: `请输入${t(SendEmailFieldsNameEnum.PROXY_PASSWORD)}`,
148 151 },
149 152 },
150 153 {
151 154 field: SendEmailFieldsEnum.USERNAME,
152   - label: SendEmailFieldsNameEnum.USERNAME,
  155 + label: t(SendEmailFieldsNameEnum.USERNAME),
153 156 component: 'Input',
154 157 ifShow: ({ model }) => !model[SendEmailFieldsEnum.USE_SYSTEM_SMTP_SETTINGS],
155 158 componentProps: {
156   - placeholder: `请输入${SendEmailFieldsNameEnum.USERNAME}`,
  159 + placeholder: `请输入${t(SendEmailFieldsNameEnum.USERNAME)}`,
157 160 },
158 161 },
159 162 {
160 163 field: SendEmailFieldsEnum.PASSWORD,
161   - label: SendEmailFieldsNameEnum.PASSWORD,
  164 + label: t(SendEmailFieldsNameEnum.PASSWORD),
162 165 component: 'InputPassword',
163 166 ifShow: ({ model }) => !model[SendEmailFieldsEnum.USE_SYSTEM_SMTP_SETTINGS],
164 167 componentProps: {
165   - placeholder: `请输入${SendEmailFieldsNameEnum.PASSWORD}`,
  168 + placeholder: `请输入${t(SendEmailFieldsNameEnum.PASSWORD)}`,
166 169 },
167 170 },
168 171 ];
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ExternalCategoryComponentEnum.SEND_EMAIL);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface SendEmailDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
1 1 import { SMSServiceProviderEnum, SMSServiceProviderNameEnum } from '../../../enum/form';
2 2 import { SendSMSFieldsEnum, SendSMSFieldsNameEnum } from '../../../enum/formField/external';
3 3 import { FormSchema } from '/@/components/Form';
  4 +import { useI18n } from '/@/hooks/web/useI18n';
  5 +
  6 +const { t } = useI18n();
4 7
5 8 export const formSchemas: FormSchema[] = [
6 9 {
7 10 field: SendSMSFieldsEnum.NUMBERS_TO_TEMPLATE,
8   - label: SendSMSFieldsNameEnum.NUMBERS_TO_TEMPLATE,
  11 + label: t(SendSMSFieldsNameEnum.NUMBERS_TO_TEMPLATE),
9 12 component: 'Input',
10 13 required: true,
11 14 helpMessage:
12 15 'Comma separated Phone Numbers, use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
13 16 componentProps: {
14   - placeholder: `请输入${SendSMSFieldsNameEnum.NUMBERS_TO_TEMPLATE}`,
  17 + placeholder: `请输入${t(SendSMSFieldsNameEnum.NUMBERS_TO_TEMPLATE)}`,
15 18 },
16 19 },
17 20 {
18 21 field: SendSMSFieldsEnum.SMS_MESSAGE_TEMPLATE,
19   - label: SendSMSFieldsNameEnum.SMS_MESSAGE_TEMPLATE,
  22 + label: t(SendSMSFieldsNameEnum.SMS_MESSAGE_TEMPLATE),
20 23 component: 'InputTextArea',
21 24 required: true,
22 25 helpMessage:
23 26 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
24 27 componentProps: {
25   - placeholder: `请输入${SendSMSFieldsNameEnum.SMS_MESSAGE_TEMPLATE}`,
  28 + placeholder: `请输入${t(SendSMSFieldsNameEnum.SMS_MESSAGE_TEMPLATE)}`,
26 29 },
27 30 },
28 31 {
... ... @@ -30,12 +33,12 @@ export const formSchemas: FormSchema[] = [
30 33 label: '',
31 34 component: 'Checkbox',
32 35 renderComponentContent: () => ({
33   - default: () => SendSMSFieldsNameEnum.USE_SYSTEM_SMS_SETTINGS,
  36 + default: () => t(SendSMSFieldsNameEnum.USE_SYSTEM_SMS_SETTINGS),
34 37 }),
35 38 },
36 39 {
37 40 field: SendSMSFieldsEnum.TYPE,
38   - label: SendSMSFieldsNameEnum.TYPE,
  41 + label: t(SendSMSFieldsNameEnum.TYPE),
39 42 component: 'Select',
40 43 required: true,
41 44 ifShow: ({ model }) => !model[SendSMSFieldsEnum.USE_SYSTEM_SMS_SETTINGS],
... ... @@ -45,12 +48,12 @@ export const formSchemas: FormSchema[] = [
45 48 value,
46 49 })),
47 50 getPopupContainer: () => document.body,
48   - placeholder: `请选择${SendSMSFieldsNameEnum.TYPE}`,
  51 + placeholder: `请选择${t(SendSMSFieldsNameEnum.TYPE)}`,
49 52 },
50 53 },
51 54 {
52 55 field: SendSMSFieldsEnum.NUMBER_FROM,
53   - label: SendSMSFieldsNameEnum.NUMBER_FROM,
  56 + label: t(SendSMSFieldsNameEnum.NUMBER_FROM),
54 57 component: 'Input',
55 58 required: true,
56 59 helpMessage: `Phone Number in E.164 format/Phone Number's SID/Messaging Service SID, ex. +19995550123/PNXXX/MGXXX`,
... ... @@ -58,67 +61,67 @@ export const formSchemas: FormSchema[] = [
58 61 !model[SendSMSFieldsEnum.USE_SYSTEM_SMS_SETTINGS] &&
59 62 model[SendSMSFieldsEnum.TYPE] === SMSServiceProviderEnum.TWILIO,
60 63 componentProps: {
61   - placeholder: `请输入${SendSMSFieldsNameEnum.NUMBER_FROM}`,
  64 + placeholder: `请输入${t(SendSMSFieldsNameEnum.NUMBER_FROM)}`,
62 65 },
63 66 },
64 67 {
65 68 field: SendSMSFieldsEnum.ACCOUNT_SID,
66   - label: SendSMSFieldsNameEnum.ACCOUNT_SID,
  69 + label: t(SendSMSFieldsNameEnum.ACCOUNT_SID),
67 70 component: 'Input',
68 71 required: true,
69 72 ifShow: ({ model }) =>
70 73 !model[SendSMSFieldsEnum.USE_SYSTEM_SMS_SETTINGS] &&
71 74 model[SendSMSFieldsEnum.TYPE] === SMSServiceProviderEnum.TWILIO,
72 75 componentProps: {
73   - placeholder: `请选择${SendSMSFieldsNameEnum.ACCOUNT_SID}`,
  76 + placeholder: `请选择${t(SendSMSFieldsNameEnum.ACCOUNT_SID)}`,
74 77 },
75 78 },
76 79 {
77 80 field: SendSMSFieldsEnum.ACCOUNT_TOKEN,
78   - label: SendSMSFieldsNameEnum.ACCOUNT_TOKEN,
  81 + label: t(SendSMSFieldsNameEnum.ACCOUNT_TOKEN),
79 82 component: 'Input',
80 83 required: true,
81 84 ifShow: ({ model }) =>
82 85 !model[SendSMSFieldsEnum.USE_SYSTEM_SMS_SETTINGS] &&
83 86 model[SendSMSFieldsEnum.TYPE] === SMSServiceProviderEnum.TWILIO,
84 87 componentProps: {
85   - placeholder: `请选择${SendSMSFieldsNameEnum.ACCOUNT_TOKEN}`,
  88 + placeholder: `请选择${t(SendSMSFieldsNameEnum.ACCOUNT_TOKEN)}`,
86 89 },
87 90 },
88 91 {
89 92 field: SendSMSFieldsEnum.ACCESS_KEY_ID,
90   - label: SendSMSFieldsNameEnum.ACCESS_KEY_ID,
  93 + label: t(SendSMSFieldsNameEnum.ACCESS_KEY_ID),
91 94 component: 'Input',
92 95 required: true,
93 96 ifShow: ({ model }) =>
94 97 !model[SendSMSFieldsEnum.USE_SYSTEM_SMS_SETTINGS] &&
95 98 model[SendSMSFieldsEnum.TYPE] === SMSServiceProviderEnum.AWS_SNS,
96 99 componentProps: {
97   - placeholder: `请选择${SendSMSFieldsNameEnum.ACCESS_KEY_ID}`,
  100 + placeholder: `请选择${t(SendSMSFieldsNameEnum.ACCESS_KEY_ID)}`,
98 101 },
99 102 },
100 103 {
101 104 field: SendSMSFieldsEnum.SECRET_ACCESS_KEY,
102   - label: SendSMSFieldsNameEnum.SECRET_ACCESS_KEY,
  105 + label: t(SendSMSFieldsNameEnum.SECRET_ACCESS_KEY),
103 106 component: 'InputPassword',
104 107 required: true,
105 108 ifShow: ({ model }) =>
106 109 !model[SendSMSFieldsEnum.USE_SYSTEM_SMS_SETTINGS] &&
107 110 model[SendSMSFieldsEnum.TYPE] === SMSServiceProviderEnum.AWS_SNS,
108 111 componentProps: {
109   - placeholder: `请选择${SendSMSFieldsNameEnum.SECRET_ACCESS_KEY}`,
  112 + placeholder: `请选择${t(SendSMSFieldsNameEnum.SECRET_ACCESS_KEY)}`,
110 113 },
111 114 },
112 115 {
113 116 field: SendSMSFieldsEnum.REGION,
114   - label: SendSMSFieldsNameEnum.REGION,
  117 + label: t(SendSMSFieldsNameEnum.REGION),
115 118 component: 'InputPassword',
116 119 required: true,
117 120 ifShow: ({ model }) =>
118 121 !model[SendSMSFieldsEnum.USE_SYSTEM_SMS_SETTINGS] &&
119 122 model[SendSMSFieldsEnum.TYPE] === SMSServiceProviderEnum.AWS_SNS,
120 123 componentProps: {
121   - placeholder: `请选择${SendSMSFieldsNameEnum.REGION}`,
  124 + placeholder: `请选择${t(SendSMSFieldsNameEnum.REGION)}`,
122 125 },
123 126 },
124 127 ];
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(ExternalCategoryComponentEnum.SEND_SMS);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface SendSmsDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -13,7 +13,7 @@ import { RabbitmqConfig } from './Rabbitmq';
13 13 import { AwsSqsConfig } from './AwsSqs';
14 14 import { useI18n } from '/@/hooks/web/useI18n';
15 15
16   -const { t } = useI18n(); //加载国际化
  16 +const { t } = useI18n(); // 加载国际化
17 17 export const ExternalCategoryConfig: CategoryConfigType = {
18 18 category: RuleNodeTypeEnum.EXTERNAL,
19 19 title: t('designer_config.externals.index.title'),
... ...
... ... @@ -3,18 +3,27 @@ import {
3 3 CheckAlarmStatusFieldNameEnum,
4 4 } from '../../../enum/formField/filter';
5 5 import { FormSchema } from '/@/components/Form';
  6 +import { useI18n } from '/@/hooks/web/useI18n';
  7 +
  8 +const { t } = useI18n();
6 9 import { AlarmStatus, AlarmStatusMean } from '/@/enums/alarmEnum';
7 10
8 11 export const formSchemas: FormSchema[] = [
9 12 {
10 13 field: CheckAlarmStatusFieldEnum.ALARM_STATUS_LIST,
11 14 component: 'Select',
12   - label: CheckAlarmStatusFieldNameEnum.ALARM_STATUS_LIST,
13   - required: true,
  15 + label: t(CheckAlarmStatusFieldNameEnum.ALARM_STATUS_LIST),
  16 + rules: [
  17 + {
  18 + required: true,
  19 + message: `请选择${t(CheckAlarmStatusFieldNameEnum.ALARM_STATUS_LIST)}`,
  20 + type: 'array',
  21 + },
  22 + ],
14 23 componentProps: {
15 24 mode: 'multiple',
16 25 getPopupContainer: () => document.body,
17   - placeholder: `请选择${CheckAlarmStatusFieldNameEnum.ALARM_STATUS_LIST}`,
  26 + placeholder: `请选择${t(CheckAlarmStatusFieldNameEnum.ALARM_STATUS_LIST)}`,
18 27 options: [
19 28 {
20 29 label: AlarmStatusMean[AlarmStatus.CLEARED_UN_ACK],
... ...
... ... @@ -7,7 +7,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
7 7
8 8 const keys = useCreateNodeKey(FilterCategoryComponentEnum.CHECK_ALARM_STATUS);
9 9
10   -const { t } = useI18n(); //加载国际化
  10 +const { t } = useI18n(); // 加载国际化
11 11 export interface CheckAlarmStatusDataType {
12 12 alarmStatusList: AlarmStatus[];
13 13 }
... ...
... ... @@ -3,30 +3,45 @@ import {
3 3 CheckExistenceFieldsNameEnum,
4 4 } from '../../../enum/formField/filter';
5 5 import { FormSchema } from '/@/components/Form';
  6 +import { useI18n } from '/@/hooks/web/useI18n';
  7 +
  8 +const { t } = useI18n();
6 9
7 10 export const formSchemas: FormSchema[] = [
8 11 {
9 12 field: CheckExistenceFieldsEnum.MESSAGE_NAMES,
10 13 component: 'Select',
11   - label: CheckExistenceFieldsNameEnum.MESSAGE_NAMES,
12   - rules: [{ required: true, type: 'array' }],
  14 + label: t(CheckExistenceFieldsNameEnum.MESSAGE_NAMES),
  15 + rules: [
  16 + {
  17 + required: true,
  18 + type: 'array',
  19 + message: `请选择${t(CheckExistenceFieldsNameEnum.MESSAGE_NAMES)}`,
  20 + },
  21 + ],
13 22 componentProps: {
14 23 mode: 'tags',
15 24 open: false,
16 25 getPopupContainer: () => document.body,
17   - placeholder: `请选择${CheckExistenceFieldsNameEnum.MESSAGE_NAMES}`,
  26 + placeholder: `请选择${t(CheckExistenceFieldsNameEnum.MESSAGE_NAMES)}`,
18 27 },
19 28 },
20 29 {
21 30 field: CheckExistenceFieldsEnum.METADATA_NAMES,
22 31 component: 'Select',
23   - label: CheckExistenceFieldsNameEnum.METADATA_NAMES,
24   - rules: [{ required: true, type: 'array' }],
  32 + label: t(CheckExistenceFieldsNameEnum.METADATA_NAMES),
  33 + rules: [
  34 + {
  35 + required: true,
  36 + type: 'array',
  37 + message: `请选择${t(CheckExistenceFieldsNameEnum.METADATA_NAMES)}`,
  38 + },
  39 + ],
25 40 componentProps: {
26 41 mode: 'tags',
27 42 open: false,
28 43 getPopupContainer: () => document.body,
29   - placeholder: `请选择${CheckExistenceFieldsNameEnum.METADATA_NAMES}`,
  44 + placeholder: `请选择${t(CheckExistenceFieldsNameEnum.METADATA_NAMES)}`,
30 45 },
31 46 },
32 47 {
... ... @@ -34,7 +49,7 @@ export const formSchemas: FormSchema[] = [
34 49 component: 'Checkbox',
35 50 label: '',
36 51 renderComponentContent: () => ({
37   - default: () => CheckExistenceFieldsNameEnum.CHECK_ALL_KEYS,
  52 + default: () => t(CheckExistenceFieldsNameEnum.CHECK_ALL_KEYS),
38 53 }),
39 54 },
40 55 ];
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(FilterCategoryComponentEnum.CHECK_EXISTENCE_FIELDS);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface CheckExistenceFieldsDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -11,6 +11,10 @@ import {
11 11 CheckRelationFieldsNameEnum,
12 12 } from '../../../enum/formField/filter';
13 13 import { FormSchema } from '/@/components/Form';
  14 +import { useI18n } from '/@/hooks/web/useI18n';
  15 +
  16 +const { t } = useI18n();
  17 +
14 18 import {
15 19 getEntityDevice,
16 20 getEntityAssets,
... ... @@ -46,7 +50,7 @@ export const getEntityIdSelect = (type: EntityTypeEnum) => {
46 50 };
47 51
48 52 return {
49   - placeholder: `请选择${EntityTypeNameEnum[type] ?? ''}`,
  53 + placeholder: `请选择${t(EntityTypeNameEnum[type] ?? '')}`,
50 54 resultField: 'data',
51 55 labelField: 'name',
52 56 valueField: 'id.id',
... ... @@ -63,26 +67,26 @@ export const formSchemas: FormSchema[] = [
63 67 component: 'Checkbox',
64 68 label: '',
65 69 renderComponentContent: () => ({
66   - default: () => CheckRelationFieldsNameEnum.CHECK_FOR_SINGLE_ENTITY,
  70 + default: () => t(CheckRelationFieldsNameEnum.CHECK_FOR_SINGLE_ENTITY),
67 71 }),
68 72 },
69 73 {
70 74 field: CheckRelationFieldsEnum.DIRECTION,
71 75 component: 'Select',
72   - label: CheckRelationFieldsNameEnum.DIRECTION,
  76 + label: t(CheckRelationFieldsNameEnum.DIRECTION),
73 77 componentProps: {
74 78 options: [
75 79 { label: DirectionNameEnum.FROM, value: DirectionEnum.FROM },
76 80 { label: DirectionNameEnum.TO, value: DirectionEnum.TO },
77 81 ],
78   - placeholder: `请选择${CheckRelationFieldsNameEnum.DIRECTION}`,
  82 + placeholder: `请选择${t(CheckRelationFieldsNameEnum.DIRECTION)}`,
79 83 getPopupContainer: () => document.body,
80 84 },
81 85 },
82 86 {
83 87 field: CheckRelationFieldsEnum.ENTITY_TYPE,
84 88 component: 'Select',
85   - label: CheckRelationFieldsNameEnum.ENTITY_TYPE,
  89 + label: t(CheckRelationFieldsNameEnum.ENTITY_TYPE),
86 90 colProps: { span: 8 },
87 91 componentProps: ({ formActionType }) => {
88 92 const { setFieldsValue } = formActionType;
... ... @@ -91,7 +95,7 @@ export const formSchemas: FormSchema[] = [
91 95 label: EntityTypeNameEnum[key],
92 96 value: key,
93 97 })),
94   - placeholder: `请选择${CheckRelationFieldsNameEnum.ENTITY_TYPE}`,
  98 + placeholder: `请选择${t(CheckRelationFieldsNameEnum.ENTITY_TYPE)}`,
95 99 getPopupContainer: () => document.body,
96 100 onChange: () => {
97 101 setFieldsValue({ [CheckRelationFieldsEnum.ENTITY_ID]: null });
... ... @@ -108,7 +112,6 @@ export const formSchemas: FormSchema[] = [
108 112 show: ({ model }) => model[CheckRelationFieldsEnum.ENTITY_TYPE],
109 113 componentProps: ({ formModel }) => {
110 114 const entityType = formModel[CheckRelationFieldsEnum.ENTITY_TYPE];
111   -
112 115 return getEntityIdSelect(entityType);
113 116 },
114 117 ifShow: ({ values }) => values[CheckRelationFieldsEnum.CHECK_FOR_SINGLE_ENTITY],
... ... @@ -116,7 +119,7 @@ export const formSchemas: FormSchema[] = [
116 119 {
117 120 field: CheckRelationFieldsEnum.RELEATION_TYPE,
118 121 component: 'Select',
119   - label: CheckRelationFieldsNameEnum.RELEATION_TYPE,
  122 + label: t(CheckRelationFieldsNameEnum.RELEATION_TYPE),
120 123 defaultValue: RelationTypeEnum.CONTAINS,
121 124 componentProps: {
122 125 options: Object.keys(RelationTypeEnum).map((value) => ({
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(FilterCategoryComponentEnum.CHECK_RELATION);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10
11 11 export interface CheckRelationDataType {
12 12 someConfiguration?: Recordable;
... ...
... ... @@ -4,24 +4,34 @@ import {
4 4 GpsGeofencingFilterFieldsNameEnum,
5 5 } from '../../../enum/formField/filter';
6 6 import { FormSchema } from '/@/components/Form';
  7 +import { useI18n } from '/@/hooks/web/useI18n';
  8 +
  9 +const { t } = useI18n();
7 10
8 11 export const formSchemas: FormSchema[] = [
9 12 {
10 13 field: GpsGeofencingFilterFieldsEnum.LATITUDE_KEY_NAME,
11 14 component: 'Input',
12   - label: GpsGeofencingFilterFieldsNameEnum.LATITUDE_KEY_NAME,
  15 + label: t(GpsGeofencingFilterFieldsNameEnum.LATITUDE_KEY_NAME),
  16 + componentProps: {
  17 + placeholder: `请输入${t(GpsGeofencingFilterFieldsNameEnum.LATITUDE_KEY_NAME)}`,
  18 + },
13 19 },
14 20 {
15 21 field: GpsGeofencingFilterFieldsEnum.LONGITUDE_KEY_NAME,
16 22 component: 'Input',
17   - label: GpsGeofencingFilterFieldsNameEnum.LONGITUDE_KEY_NAME,
  23 + label: t(GpsGeofencingFilterFieldsNameEnum.LONGITUDE_KEY_NAME),
  24 + componentProps: {
  25 + placeholder: `请输入${t(GpsGeofencingFilterFieldsNameEnum.LONGITUDE_KEY_NAME)}`,
  26 + },
18 27 },
19 28 {
20 29 field: GpsGeofencingFilterFieldsEnum.PERIMETER_TYPE,
21 30 component: 'Select',
22   - label: GpsGeofencingFilterFieldsNameEnum.PERIMETER_TYPE,
  31 + label: t(GpsGeofencingFilterFieldsNameEnum.PERIMETER_TYPE),
23 32 componentProps: {
24 33 options: Object.keys(PerimeterTypeEnum).map((value) => ({ label: value, value })),
  34 + placeholder: `请选择${t(GpsGeofencingFilterFieldsNameEnum.PERIMETER_TYPE)}`,
25 35 },
26 36 },
27 37 {
... ... @@ -29,57 +39,73 @@ export const formSchemas: FormSchema[] = [
29 39 component: 'Checkbox',
30 40 label: '',
31 41 renderComponentContent: () => ({
32   - default: () => GpsGeofencingFilterFieldsNameEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA,
  42 + default: () =>
  43 + t(GpsGeofencingFilterFieldsNameEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA),
33 44 }),
34 45 },
35 46 {
36 47 field: GpsGeofencingFilterFieldsEnum.PERIMETER_KEY_NAME,
37 48 component: 'Input',
38   - label: GpsGeofencingFilterFieldsNameEnum.PERIMETER_KEY_NAME,
  49 + label: t(GpsGeofencingFilterFieldsNameEnum.PERIMETER_KEY_NAME),
39 50 show: ({ model }) =>
40 51 model[GpsGeofencingFilterFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA],
  52 + componentProps: {
  53 + placeholder: `请输入${t(GpsGeofencingFilterFieldsNameEnum.PERIMETER_KEY_NAME)}`,
  54 + },
41 55 },
42 56 {
43 57 field: GpsGeofencingFilterFieldsEnum.POLYGONS_DEFINITION,
44 58 component: 'Input',
45   - label: GpsGeofencingFilterFieldsNameEnum.POLYGONS_DEFINITION,
  59 + label: t(GpsGeofencingFilterFieldsNameEnum.POLYGONS_DEFINITION),
46 60 helpMessage:
47 61 'Please, use the following format for manual definition of polygon: [[lat1,lon1],[lat2,lon2], ... ,[latN,lonN]].',
48 62 show: ({ model }) =>
49 63 !model[GpsGeofencingFilterFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA] &&
50 64 model[GpsGeofencingFilterFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.POLYGON,
  65 + componentProps: {
  66 + placeholder: `请输入${t(GpsGeofencingFilterFieldsNameEnum.POLYGONS_DEFINITION)}`,
  67 + },
51 68 },
52 69 {
53 70 field: GpsGeofencingFilterFieldsEnum.CENTER_LATITUDE,
54 71 component: 'InputNumber',
55   - label: GpsGeofencingFilterFieldsNameEnum.CENTER_LATITUDE,
  72 + label: t(GpsGeofencingFilterFieldsNameEnum.CENTER_LATITUDE),
56 73 colProps: { span: 12 },
57 74 show: ({ model }) =>
58 75 model[GpsGeofencingFilterFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.CIRCLE &&
59 76 !model[GpsGeofencingFilterFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA],
  77 + componentProps: {
  78 + placeholder: `请输入${t(GpsGeofencingFilterFieldsNameEnum.CENTER_LATITUDE)}`,
  79 + },
60 80 },
61 81 {
62 82 field: GpsGeofencingFilterFieldsEnum.CENTER_LONGITUDE,
63 83 component: 'InputNumber',
64   - label: GpsGeofencingFilterFieldsNameEnum.CENTER_LONGITUDE,
  84 + label: t(GpsGeofencingFilterFieldsNameEnum.CENTER_LONGITUDE),
65 85 colProps: { span: 12 },
66 86 show: ({ model }) =>
67 87 model[GpsGeofencingFilterFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.CIRCLE &&
68 88 !model[GpsGeofencingFilterFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA],
  89 + componentProps: {
  90 + placeholder: `请输入${t(GpsGeofencingFilterFieldsNameEnum.CENTER_LONGITUDE)}`,
  91 + },
69 92 },
70 93 {
71 94 field: GpsGeofencingFilterFieldsEnum.RANGE,
72 95 component: 'InputNumber',
73   - label: GpsGeofencingFilterFieldsNameEnum.RANGE,
  96 + label: t(GpsGeofencingFilterFieldsNameEnum.RANGE),
74 97 colProps: { span: 12 },
75 98 show: ({ model }) =>
76 99 model[GpsGeofencingFilterFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.CIRCLE &&
77 100 !model[GpsGeofencingFilterFieldsEnum.FETCH_PERIMETER_INFO_FROM_MESSAGE_METADATA],
  101 + componentProps: {
  102 + placeholder: `请输入${t(GpsGeofencingFilterFieldsNameEnum.RANGE)}`,
  103 + },
78 104 },
79 105 {
80 106 field: GpsGeofencingFilterFieldsEnum.RANGE_UNIT,
81 107 component: 'Select',
82   - label: GpsGeofencingFilterFieldsNameEnum.RANGE_UNIT,
  108 + label: t(GpsGeofencingFilterFieldsNameEnum.RANGE_UNIT),
83 109 colProps: { span: 12 },
84 110 show: ({ model }) =>
85 111 model[GpsGeofencingFilterFieldsEnum.PERIMETER_TYPE] === PerimeterTypeEnum.CIRCLE &&
... ... @@ -89,6 +115,7 @@ export const formSchemas: FormSchema[] = [
89 115 label: RangeUtilNameEnum[value],
90 116 value,
91 117 })),
  118 + placeholder: `请选择${t(GpsGeofencingFilterFieldsNameEnum.RANGE_UNIT)}`,
92 119 },
93 120 },
94 121 ];
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(FilterCategoryComponentEnum.GPS_GEOFENCING_FILTER);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface GpsGeofencingFilterDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
1 1 import { MessageTypesEnum, MessageTypesNameEnum } from '../../../enum/form';
2 2 import { MessageTypeFieldsEnum, MessageTypeFieldsNameEnum } from '../../../enum/formField/filter';
3 3 import { FormSchema } from '/@/components/Form';
  4 +import { useI18n } from '/@/hooks/web/useI18n';
  5 +
  6 +const { t } = useI18n();
4 7
5 8 export const formSchemas: FormSchema[] = [
6 9 {
7 10 field: MessageTypeFieldsEnum.MESSAGE_TYPES,
8 11 component: 'Select',
9   - label: MessageTypeFieldsNameEnum.MESSAGE_TYPES,
  12 + label: t(MessageTypeFieldsNameEnum.MESSAGE_TYPES),
10 13 componentProps: {
11 14 options: Object.keys(MessageTypesEnum).map((value) => ({
12 15 label: MessageTypesNameEnum[value],
13 16 value,
14 17 })),
15 18 mode: 'multiple',
16   - placeholder: `请选择${MessageTypeFieldsNameEnum.MESSAGE_TYPES}`,
  19 + placeholder: `请选择${t(MessageTypeFieldsNameEnum.MESSAGE_TYPES)}`,
17 20 getPopupContainer: () => document.body,
18 21 },
19 22 },
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(FilterCategoryComponentEnum.MESSAGE_TYPE);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10
11 11 export interface MessageTypeDataType {
12 12 someConfiguration?: Recordable;
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(FilterCategoryComponentEnum.MESSAGE_TYPE_SWITCH);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface MessageTypeSwitchDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -4,13 +4,16 @@ import {
4 4 } from '../../../enum/formField/filter';
5 5 import { findDictItemByCode } from '/@/api/system/dict';
6 6 import { FormSchema } from '/@/components/Form';
  7 +import { useI18n } from '/@/hooks/web/useI18n';
  8 +
  9 +const { t } = useI18n();
7 10 import { DictEnum } from '/@/enums/dictEnum';
8 11
9 12 export const formSchemas: FormSchema[] = [
10 13 {
11 14 field: OriginatorTypeFieldsEnum.ORIGINATOR_TYPES,
12 15 component: 'ApiSelect',
13   - label: OriginatorTypeFieldsNameEnum.ORIGINATOR_TYPES,
  16 + label: t(OriginatorTypeFieldsNameEnum.ORIGINATOR_TYPES),
14 17 componentProps: {
15 18 api: findDictItemByCode,
16 19 params: {
... ... @@ -20,6 +23,7 @@ export const formSchemas: FormSchema[] = [
20 23 labelField: 'itemText',
21 24 valueField: 'itemValue',
22 25 getPopupContainer: () => document.body,
  26 + placeholder: `请选择${t(OriginatorTypeFieldsNameEnum.ORIGINATOR_TYPES)}`,
23 27 },
24 28 },
25 29 ];
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(FilterCategoryComponentEnum.ORIGINATOR_TYPE);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface OriginatorTypeDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(FilterCategoryComponentEnum.ORIGINATOR_TYPE_SWITCH);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface OriginatorTypeSwitchDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
1 1 import { FormSchema } from '/@/components/Form';
  2 +
2 3 import { isObject } from '/@/utils/is';
3 4
4 5 export const validateJSON = (value: string): { value: Recordable | string; flag: boolean } => {
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(FilterCategoryComponentEnum.SCENE_REACT);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface SceneReactDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
1   -import { h } from 'vue';
2 1 import { FormSchema, useComponentRegister } from '/@/components/Form';
3 2 import HelpMessage from './HelpMessage.vue';
4 3 import { JavascriptEditorWithTestModal } from '/@/views/rule/designer/src/components/JavaScriptFilterModal';
5 4 import { ScriptFieldsEnum, ScriptFieldsNameEnum } from '../../../enum/formField/filter';
  5 +import { useI18n } from '/@/hooks/web/useI18n';
  6 +
  7 +const { t } = useI18n();
6 8
7 9 useComponentRegister('JavascriptEditorWithTestModal', JavascriptEditorWithTestModal);
8 10
... ... @@ -10,7 +12,7 @@ export const formSchemas: FormSchema[] = [
10 12 {
11 13 field: ScriptFieldsEnum.JS_SCRIPT,
12 14 component: 'JavascriptEditorWithTestModal',
13   - label: ScriptFieldsNameEnum.JS_SCRIPT,
  15 + label: t(ScriptFieldsNameEnum.JS_SCRIPT),
14 16 changeEvent: 'update:value',
15 17 valueField: 'value',
16 18 renderComponentContent: () => {
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(FilterCategoryComponentEnum.SCRIPT);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface ScriptDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
1 1 import { SwitchFieldsEnum, SwitchFieldsNameEnum } from '../../../enum/formField/filter';
2 2 import { FormSchema, useComponentRegister } from '/@/components/Form';
3 3 import { JavascriptEditorWithTestModal } from '/@/views/rule/designer/src/components/JavaScriptFilterModal';
  4 +import { useI18n } from '/@/hooks/web/useI18n';
  5 +
  6 +const { t } = useI18n();
4 7
5 8 useComponentRegister('JavascriptEditorWithTestModal', JavascriptEditorWithTestModal);
6 9
... ... @@ -8,7 +11,7 @@ export const formSchemas: FormSchema[] = [
8 11 {
9 12 field: SwitchFieldsEnum.JS_SCRIPT,
10 13 component: 'JavascriptEditorWithTestModal',
11   - label: SwitchFieldsNameEnum.JS_SCRIPT,
  14 + label: t(SwitchFieldsNameEnum.JS_SCRIPT),
12 15 changeEvent: 'update:value',
13 16 valueField: 'value',
14 17 componentProps: {
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(FilterCategoryComponentEnum.SWITCH);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface SwitchDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -13,7 +13,7 @@ import { GpsGeofencingFilterConfig } from './GpsGeofencingFilter';
13 13 import { CheckAlarmStatusConfig } from './CheckAlarmStatus';
14 14 import { useI18n } from '/@/hooks/web/useI18n';
15 15
16   -const { t } = useI18n(); //加载国际化
  16 +const { t } = useI18n(); // 加载国际化
17 17 export const FilterCategoryConfig: CategoryConfigType = {
18 18 category: RuleNodeTypeEnum.FILTER,
19 19 title: t('designer_config.filters.index.title'),
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(FlowCategoryComponentEnum.ACKNOWLEDGE);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface AcknowledgeDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -3,12 +3,16 @@ import { FormSchema, useComponentRegister } from '/@/components/Form';
3 3 import ApiComplete from './ApiComplete.vue';
4 4 import { getTenantQueue } from '/@/api/ruleChainDesigner';
5 5
  6 +import { useI18n } from '/@/hooks/web/useI18n';
  7 +
  8 +const { t } = useI18n();
  9 +
6 10 useComponentRegister('ApiComplete', ApiComplete);
7 11
8 12 export const formSchemas: FormSchema[] = [
9 13 {
10 14 field: CheckPointFieldsEnum.QUEUE_NAME,
11   - label: CheckPointFieldsNameEnum.QUEUE_NAME,
  15 + label: t(CheckPointFieldsNameEnum.QUEUE_NAME),
12 16 component: 'ApiComplete',
13 17 required: true,
14 18 helpMessage: ['从下拉列表中选择或自定义名称'],
... ... @@ -16,7 +20,7 @@ export const formSchemas: FormSchema[] = [
16 20 changeEvent: 'update:value',
17 21 componentProps: () => {
18 22 return {
19   - placeholder: `请选择${CheckPointFieldsNameEnum.QUEUE_NAME}`,
  23 + placeholder: `请选择${t(CheckPointFieldsNameEnum.QUEUE_NAME)}`,
20 24 getPopupContainer: () => document.body,
21 25 api: async (params: Recordable) => {
22 26 const options = await getTenantQueue(params);
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(FlowCategoryComponentEnum.CHECKPOINT);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface CheckpointDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(FlowCategoryComponentEnum.OUTPUT);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface OutputDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -2,6 +2,9 @@ import { RouteLocationNormalizedLoaded } from 'vue-router';
2 2 import { RuleChainFieldsEnum, RuleChainFieldsNameEnum } from '../../../enum/formField/flow';
3 3 import { getRuleChains } from '/@/api/ruleDesigner';
4 4 import { FormSchema } from '/@/components/Form';
  5 +import { useI18n } from '/@/hooks/web/useI18n';
  6 +
  7 +const { t } = useI18n();
5 8
6 9 const fetch = async (params: Recordable, ruleChainId: string) => {
7 10 try {
... ... @@ -11,6 +14,7 @@ const fetch = async (params: Recordable, ruleChainId: string) => {
11 14 .filter((item) => item.value !== ruleChainId);
12 15 return data;
13 16 } catch (err) {
  17 + // eslint-disable-next-line no-console
14 18 console.error(err);
15 19 return [];
16 20 }
... ... @@ -21,7 +25,7 @@ export const getFormSchemas = (route: RouteLocationNormalizedLoaded): FormSchema
21 25 return [
22 26 {
23 27 field: RuleChainFieldsEnum.RULE_CHAIN_ID,
24   - label: RuleChainFieldsNameEnum.RULE_CHAIN_ID,
  28 + label: t(RuleChainFieldsNameEnum.RULE_CHAIN_ID),
25 29 component: 'ApiSearchSelect',
26 30 componentProps: () => {
27 31 return {
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(FlowCategoryComponentEnum.RULE_CHAIN);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface RuleChainDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -6,7 +6,7 @@ import { RuleChainConfig } from './RuleChain';
6 6 import { OutputConfig } from './Output';
7 7 import { useI18n } from '/@/hooks/web/useI18n';
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export const FlowCategoryConfig: CategoryConfigType = {
11 11 category: RuleNodeTypeEnum.FLOW,
12 12 title: t('designer_config.flows.index.title'),
... ...
... ... @@ -5,6 +5,9 @@ import {
5 5 } from '../../../enum/formField/transformation';
6 6 import { RelationsQuery } from '../../../src/components/RelationsQuery';
7 7 import { FormSchema, useComponentRegister } from '/@/components/Form';
  8 +import { useI18n } from '/@/hooks/web/useI18n';
  9 +
  10 +const { t } = useI18n();
8 11
9 12 useComponentRegister('RelationsQuery', RelationsQuery);
10 13
... ... @@ -12,21 +15,23 @@ export const formSchemas: FormSchema[] = [
12 15 {
13 16 field: ChangeOriginatorFieldsEnum.ORIGINATOR_SOURCE,
14 17 component: 'Select',
15   - label: ChangeOriginatorFieldsNameEnum.ORIGINATOR_SOURCE,
16   - required: true,
  18 + label: t(ChangeOriginatorFieldsNameEnum.ORIGINATOR_SOURCE),
  19 + rules: [
  20 + { required: true, message: `请选择${t(ChangeOriginatorFieldsNameEnum.ORIGINATOR_SOURCE)}` },
  21 + ],
17 22 componentProps: {
18 23 options: Object.keys(OriginatorSourceEnum).map((value) => ({
19 24 label: OriginatorSourceNameEnum[value],
20 25 value,
21 26 })),
22 27 getPopupContainer: () => document.body,
23   - placeholder: `请选择${ChangeOriginatorFieldsNameEnum.ORIGINATOR_SOURCE}`,
  28 + placeholder: `请选择${t(ChangeOriginatorFieldsNameEnum.ORIGINATOR_SOURCE)}`,
24 29 },
25 30 },
26 31 {
27 32 field: ChangeOriginatorFieldsEnum.RELATIONS_QUERY,
28 33 component: 'RelationsQuery',
29   - label: ChangeOriginatorFieldsNameEnum.RELATIONS_QUERY,
  34 + label: t(ChangeOriginatorFieldsNameEnum.RELATIONS_QUERY),
30 35 slot: ChangeOriginatorFieldsEnum.RELATIONS_QUERY,
31 36 ifShow: ({ model }) =>
32 37 model[ChangeOriginatorFieldsEnum.ORIGINATOR_SOURCE] === OriginatorSourceEnum.RELATED,
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(TransformationCategoryComponentEnum.CHANGE_ORIGINATOR);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface ChangeOriginatorDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
1 1 import { ScriptFieldsEnum, ScriptFieldsNameEnum } from '../../../enum/formField/transformation';
2 2 import { JavascriptEditorWithTestModal } from '../../../src/components/JavaScriptFilterModal';
3 3 import { FormSchema, useComponentRegister } from '/@/components/Form';
  4 +import { useI18n } from '/@/hooks/web/useI18n';
  5 +
  6 +const { t } = useI18n();
4 7
5 8 useComponentRegister('JavascriptEditorWithTestModal', JavascriptEditorWithTestModal);
6 9
... ... @@ -8,7 +11,7 @@ export const formSchemas: FormSchema[] = [
8 11 {
9 12 field: ScriptFieldsEnum.JS_SCRIPT,
10 13 component: 'JavascriptEditorWithTestModal',
11   - label: ScriptFieldsNameEnum.JS_SCRIPT,
  14 + label: t(ScriptFieldsNameEnum.JS_SCRIPT),
12 15 changeEvent: 'update:value',
13 16 valueField: 'value',
14 17 componentProps: {
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(TransformationCategoryComponentEnum.SCRIPT);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10
11 11 export interface ScriptDataType {
12 12 someConfiguration?: Recordable;
... ...
1 1 import { MailBodyTypeEnum, MailBodyTypeNameEnum } from '../../../enum/form';
2 2 import { ToEmailFieldsEnum, ToEmailFieldsNameEnum } from '../../../enum/formField/transformation';
3 3 import { FormSchema } from '/@/components/Form';
  4 +import { useI18n } from '/@/hooks/web/useI18n';
  5 +
  6 +const { t } = useI18n();
4 7
5 8 export const formSchemas: FormSchema[] = [
6 9 {
7 10 field: ToEmailFieldsEnum.FROM_TEMPLATE,
8 11 component: 'Input',
9   - label: ToEmailFieldsNameEnum.FROM_TEMPLATE,
  12 + label: t(ToEmailFieldsNameEnum.FROM_TEMPLATE),
10 13 helpMessage: [
11 14 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
12 15 ],
13 16 componentProps: {
14   - placeholder: `请输入${ToEmailFieldsNameEnum.FROM_TEMPLATE}`,
  17 + placeholder: `请输入${t(ToEmailFieldsNameEnum.FROM_TEMPLATE)}`,
15 18 },
16 19 },
17 20 {
18 21 field: ToEmailFieldsEnum.TO_TEMPLATE,
19 22 component: 'Input',
20   - label: ToEmailFieldsNameEnum.TO_TEMPLATE,
  23 + label: t(ToEmailFieldsNameEnum.TO_TEMPLATE),
21 24 helpMessage: [
22 25 'Comma separated address list, use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
23 26 ],
24 27 componentProps: {
25   - placeholder: `请输入${ToEmailFieldsNameEnum.FROM_TEMPLATE}`,
  28 + placeholder: `请输入${t(ToEmailFieldsNameEnum.FROM_TEMPLATE)}`,
26 29 },
27 30 },
28 31 {
29 32 field: ToEmailFieldsEnum.CC_TEMPLATE,
30 33 component: 'Input',
31   - label: ToEmailFieldsNameEnum.CC_TEMPLATE,
  34 + label: t(ToEmailFieldsNameEnum.CC_TEMPLATE),
32 35 helpMessage: [
33 36 'Comma separated address list, use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
34 37 ],
35 38 componentProps: {
36   - placeholder: `请输入${ToEmailFieldsNameEnum.FROM_TEMPLATE}`,
  39 + placeholder: `请输入${t(ToEmailFieldsNameEnum.FROM_TEMPLATE)}`,
37 40 },
38 41 },
39 42 {
40 43 field: ToEmailFieldsEnum.BCC_TEMPLATE,
41 44 component: 'Input',
42   - label: ToEmailFieldsNameEnum.BCC_TEMPLATE,
  45 + label: t(ToEmailFieldsNameEnum.BCC_TEMPLATE),
43 46 helpMessage: [
44 47 'Comma separated address list, use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
45 48 ],
46 49 componentProps: {
47   - placeholder: `请输入${ToEmailFieldsNameEnum.FROM_TEMPLATE}`,
  50 + placeholder: `请输入${t(ToEmailFieldsNameEnum.FROM_TEMPLATE)}`,
48 51 },
49 52 },
50 53 {
51 54 field: ToEmailFieldsEnum.SUBJECT_TEMPLATE,
52 55 component: 'Input',
53   - label: ToEmailFieldsNameEnum.SUBJECT_TEMPLATE,
  56 + label: t(ToEmailFieldsNameEnum.SUBJECT_TEMPLATE),
54 57 helpMessage: [
55 58 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
56 59 ],
57 60 componentProps: {
58   - placeholder: `请输入${ToEmailFieldsNameEnum.FROM_TEMPLATE}`,
  61 + placeholder: `请输入${t(ToEmailFieldsNameEnum.FROM_TEMPLATE)}`,
59 62 },
60 63 },
61 64 {
62 65 field: ToEmailFieldsEnum.MAIL_BODY_TYPE,
63 66 component: 'Select',
64   - label: ToEmailFieldsNameEnum.MAIL_BODY_TYPE,
  67 + label: t(ToEmailFieldsNameEnum.MAIL_BODY_TYPE),
65 68 componentProps: ({ formActionType }) => {
66 69 const { setFieldsValue } = formActionType;
67 70 return {
... ... @@ -70,7 +73,7 @@ export const formSchemas: FormSchema[] = [
70 73 { label: MailBodyTypeNameEnum.HTML, value: MailBodyTypeEnum.HTML },
71 74 { label: MailBodyTypeNameEnum.DYNAMIC, value: MailBodyTypeEnum.DYNAMIC },
72 75 ],
73   - placeholder: `请选择${ToEmailFieldsNameEnum.MAIL_BODY_TYPE}`,
  76 + placeholder: `请选择${t(ToEmailFieldsNameEnum.MAIL_BODY_TYPE)}`,
74 77 getPopupContainer: () => document.body,
75 78 onChange: () => {
76 79 setFieldsValue({ [ToEmailFieldsEnum.IS_HTML_TEMPLATE]: null });
... ... @@ -81,21 +84,21 @@ export const formSchemas: FormSchema[] = [
81 84 {
82 85 field: ToEmailFieldsEnum.IS_HTML_TEMPLATE,
83 86 component: 'Input',
84   - label: ToEmailFieldsNameEnum.IS_HTML_TEMPLATE,
  87 + label: t(ToEmailFieldsNameEnum.IS_HTML_TEMPLATE),
85 88 show: ({ model }) => model[ToEmailFieldsEnum.MAIL_BODY_TYPE] === MailBodyTypeEnum.DYNAMIC,
86 89 helpMessage: [
87 90 'Hint: use ${metadataKey} for value from metadata, $[messageKey] for value from message body',
88 91 ],
89 92 componentProps: {
90   - placeholder: `请输入${ToEmailFieldsNameEnum.IS_HTML_TEMPLATE}`,
  93 + placeholder: `请输入${t(ToEmailFieldsNameEnum.IS_HTML_TEMPLATE)}`,
91 94 },
92 95 },
93 96 {
94 97 field: ToEmailFieldsEnum.BODY_TEMPLATE,
95 98 component: 'InputTextArea',
96   - label: ToEmailFieldsEnum.BODY_TEMPLATE,
  99 + label: t(ToEmailFieldsEnum.BODY_TEMPLATE),
97 100 componentProps: {
98   - placeholder: `请输入${ToEmailFieldsNameEnum.BODY_TEMPLATE}`,
  101 + placeholder: `请输入${t(ToEmailFieldsNameEnum.BODY_TEMPLATE)}`,
99 102 autoSize: { minRows: 3 },
100 103 },
101 104 },
... ...
... ... @@ -6,7 +6,7 @@ import { useI18n } from '/@/hooks/web/useI18n';
6 6
7 7 const keys = useCreateNodeKey(TransformationCategoryComponentEnum.TO_EMAIL);
8 8
9   -const { t } = useI18n(); //加载国际化
  9 +const { t } = useI18n(); // 加载国际化
10 10 export interface ToEmailDataType {
11 11 someConfiguration?: Recordable;
12 12 }
... ...
... ... @@ -5,7 +5,7 @@ import { ScriptConfig } from './Script';
5 5 import { ToEmailConfig } from './ToEmail';
6 6 import { useI18n } from '/@/hooks/web/useI18n';
7 7
8   -const { t } = useI18n(); //加载国际化
  8 +const { t } = useI18n(); // 加载国际化
9 9 export const TransformationCategoryConfig: CategoryConfigType = {
10 10 category: RuleNodeTypeEnum.TRANSFORMATION,
11 11 title: t('designer_config.transformations.index.title'),
... ...
1 1 import { NodeBindDataFieldEnum, NodeBindDataFieldNameEnum } from '../../../enum/node';
2 2 import { FormSchema } from '/@/components/Form';
  3 +import { useI18n } from '/@/hooks/web/useI18n';
  4 +
  5 +const { t } = useI18n();
3 6
4 7 export const TopFormSchemas: FormSchema[] = [
5 8 {
6 9 field: NodeBindDataFieldEnum.NAME,
7 10 component: 'Input',
8   - label: NodeBindDataFieldNameEnum.NAME,
9   - required: true,
  11 + label: t(NodeBindDataFieldNameEnum.NAME),
10 12 colProps: {
11 13 span: 16,
12 14 },
  15 + rules: [{ required: true, message: `请输入${t(NodeBindDataFieldNameEnum.NAME)}` }],
13 16 componentProps: {
14   - placeholder: `请输入${NodeBindDataFieldNameEnum.NAME}`,
  17 + placeholder: `请输入${t(NodeBindDataFieldNameEnum.NAME)}`,
15 18 },
16 19 },
17 20 {
18 21 field: NodeBindDataFieldEnum.DEBUG_MODE,
19 22 component: 'Switch',
20   - label: NodeBindDataFieldNameEnum.DEBUG_MODE,
  23 + label: t(NodeBindDataFieldNameEnum.DEBUG_MODE),
21 24 colProps: {
22 25 offset: 2,
23 26 span: 6,
24 27 },
25 28 componentProps: {
26   - placeholder: `请输入${NodeBindDataFieldNameEnum.NAME}`,
  29 + placeholder: `请输入${t(NodeBindDataFieldNameEnum.NAME)}`,
27 30 },
28 31 renderComponentContent: () => {
29 32 return {
30   - default: () => NodeBindDataFieldNameEnum.DEBUG_MODE,
  33 + default: () => t(NodeBindDataFieldNameEnum.DEBUG_MODE),
31 34 };
32 35 },
33 36 },
... ... @@ -37,9 +40,9 @@ export const BottomFormSchemas: FormSchema[] = [
37 40 {
38 41 field: NodeBindDataFieldEnum.DESCRIPTION,
39 42 component: 'InputTextArea',
40   - label: NodeBindDataFieldNameEnum.DESCRIPTION,
  43 + label: t(NodeBindDataFieldNameEnum.DESCRIPTION),
41 44 componentProps: {
42   - placeholder: `请输入${NodeBindDataFieldNameEnum.DESCRIPTION}`,
  45 + placeholder: `请输入${t(NodeBindDataFieldNameEnum.DESCRIPTION)}`,
43 46 autoSize: true,
44 47 },
45 48 },
... ...
... ... @@ -67,6 +67,7 @@
67 67 <BasicModal
68 68 v-model:visible="visible"
69 69 :title="`添加规则节点: ${nodeData?.config?.name}`"
  70 + width="50%"
70 71 :get-container="getContainer"
71 72 @ok="handleModalOk"
72 73 @cancel="handleCancel"
... ...
... ... @@ -39,7 +39,7 @@
39 39 showActionButtonGroup: false,
40 40 baseColProps: { lg: 12, md: 24 },
41 41 });
42   - const { t } = useI18n(); //加载国际化
  42 + const { t } = useI18n(); // 加载国际化
43 43
44 44 //默认传递页面数据
45 45 const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
... ...
... ... @@ -64,7 +64,7 @@
64 64 components: { BasicTable, MenuDrawer, TableAction, Button },
65 65 setup() {
66 66 const [registerDrawer, { openDrawer }] = useDrawer(); //使用右侧弹出框
67   - const { t } = useI18n(); //加载国际化
  67 + const { t } = useI18n(); // 加载国际化
68 68 // 新增菜单
69 69 const getI18nCreateMenu = computed(() => t('routes.common.system.pageSystemTitleCreateMenu'));
70 70
... ...
... ... @@ -34,7 +34,7 @@
34 34 schemas: formSchema,
35 35 showActionButtonGroup: false,
36 36 });
37   - const { t } = useI18n(); //加载国际化
  37 + const { t } = useI18n(); // 加载国际化
38 38
39 39 //默认传递页面数据
40 40 const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
... ...
... ... @@ -62,7 +62,7 @@
62 62 components: { BasicTable, DeptDrawer, TableAction, Authority, Popconfirm },
63 63 setup() {
64 64 const [registerModal, { openDrawer }] = useDrawer();
65   - const { t } = useI18n(); //加载国际化
  65 + const { t } = useI18n(); // 加载国际化
66 66 const getI18n = computed(() => t('routes.common.organization.toolCreateOrganization'));
67 67
68 68 const [registerTable, { reload, expandAll, setProps }] = useTable({
... ...
... ... @@ -33,7 +33,7 @@
33 33 import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
34 34 import { BasicTree, TreeActionType, TreeItem } from '/@/components/Tree';
35 35 import { useMessage } from '/@/hooks/web/useMessage';
36   - const { t } = useI18n(); //加载国际化
  36 + const { t } = useI18n(); // 加载国际化
37 37 // 加载菜单数据
38 38 import { getMeMenuList, getMenusIdsByRoleId } from '/@/api/sys/menu';
39 39 import { useI18n } from '/@/hooks/web/useI18n';
... ...
... ... @@ -40,7 +40,7 @@
40 40 showActionButtonGroup: false,
41 41 baseColProps: { lg: 24, md: 24 },
42 42 });
43   - const { t } = useI18n(); //加载国际化
  43 + const { t } = useI18n(); // 加载国际化
44 44
45 45 //默认传递页面数据
46 46 const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
... ... @@ -58,8 +58,7 @@
58 58 });
59 59 }
60 60 getTenantRoles(data.record.tenantId).then((result) => {
61   - const { icon, ...params } = data.record;
62   - console.log(icon);
  61 + const { ...params } = data.record;
63 62 //为表单赋值
64 63 setFieldsValue({
65 64 ...params,
... ...
... ... @@ -33,7 +33,7 @@
33 33 import { formSchema } from './role.data';
34 34 import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
35 35 import { BasicTree, CheckEvent, TreeActionType, TreeItem, CheckKeys } from '/@/components/Tree';
36   - const { t } = useI18n(); //加载国际化
  36 + const { t } = useI18n(); // 加载国际化
37 37 // 加载菜单数据
38 38 import { getAdminMenuList, getMenuList, getMenusIdsByRoleId } from '/@/api/sys/menu';
39 39 import { useI18n } from '/@/hooks/web/useI18n';
... ...