...
|
...
|
@@ -4,6 +4,7 @@ import { screenLinkOrganizationGetApi } from '/@/api/ruleengine/ruleengineApi'; |
4
|
4
|
import { scheduleOptions } from './formatData';
|
5
|
5
|
import { copyTransFun } from '/@/utils/fnUtils';
|
6
|
6
|
import { numberAndNonegativeRule } from '/@/utils/rules';
|
|
7
|
+import { findDictItemByCode } from '/@/api/system/dict';
|
7
|
8
|
|
8
|
9
|
/**
|
9
|
10
|
* 所使用的枚举值
|
...
|
...
|
@@ -161,6 +162,17 @@ const isReplace = (type) => { |
161
|
162
|
const isPart = (type: string) => {
|
162
|
163
|
return type === 'PART';
|
163
|
164
|
};
|
|
165
|
+//新增代码2022-11-23
|
|
166
|
+const isPartOrAll = (type: string) => {
|
|
167
|
+ return type === 'ALL' || type === 'PART';
|
|
168
|
+};
|
|
169
|
+const isService = (type: string) => {
|
|
170
|
+ return type === 'service';
|
|
171
|
+};
|
|
172
|
+const isDefine = (type: string) => {
|
|
173
|
+ return type === 'custom_define';
|
|
174
|
+};
|
|
175
|
+//新增代码2022-11-23
|
164
|
176
|
|
165
|
177
|
export const trigger_condition_schema: FormSchema[] = [
|
166
|
178
|
{
|
...
|
...
|
@@ -331,6 +343,73 @@ export const actionSchema: FormSchema[] = [ |
331
|
343
|
ifShow: ({ values }) => isPart(values.device) && isDeviceOut(values.outTarget),
|
332
|
344
|
colProps: { span: 6 },
|
333
|
345
|
},
|
|
346
|
+ //新增代码2022-11-23
|
|
347
|
+ {
|
|
348
|
+ field: 'customDefine',
|
|
349
|
+ label: '',
|
|
350
|
+ required: true,
|
|
351
|
+ component: 'ApiSelect',
|
|
352
|
+ colProps: {
|
|
353
|
+ span: 6,
|
|
354
|
+ },
|
|
355
|
+ defaultValue: 'custom_define',
|
|
356
|
+ componentProps: {
|
|
357
|
+ placeholder: '请选择类型',
|
|
358
|
+ api: findDictItemByCode,
|
|
359
|
+ params: {
|
|
360
|
+ dictCode: 'custom_define',
|
|
361
|
+ },
|
|
362
|
+ labelField: 'itemText',
|
|
363
|
+ valueField: 'itemValue',
|
|
364
|
+ getPopupContainer: () => document.body,
|
|
365
|
+ },
|
|
366
|
+ ifShow: ({ values }) => isDeviceOut(values.outTarget) && isPartOrAll(values.device),
|
|
367
|
+ },
|
|
368
|
+ //新增代码2022-11-23
|
|
369
|
+ {
|
|
370
|
+ field: 'customMode',
|
|
371
|
+ label: '',
|
|
372
|
+ required: true,
|
|
373
|
+ component: 'ApiSelect',
|
|
374
|
+ colProps: {
|
|
375
|
+ span: 6,
|
|
376
|
+ },
|
|
377
|
+ defaultValue: 'OneWay',
|
|
378
|
+ componentProps: {
|
|
379
|
+ placeholder: '请选择类型',
|
|
380
|
+ api: findDictItemByCode,
|
|
381
|
+ params: {
|
|
382
|
+ dictCode: 'custom_mode',
|
|
383
|
+ },
|
|
384
|
+ labelField: 'itemText',
|
|
385
|
+ valueField: 'itemValue',
|
|
386
|
+ getPopupContainer: () => document.body,
|
|
387
|
+ },
|
|
388
|
+ ifShow: ({ values }) =>
|
|
389
|
+ isDeviceOut(values.outTarget) && isPartOrAll(values.device) && isDefine(values.customDefine),
|
|
390
|
+ },
|
|
391
|
+ //新增代码2022-11-23
|
|
392
|
+ {
|
|
393
|
+ field: 'service',
|
|
394
|
+ label: '',
|
|
395
|
+ required: true,
|
|
396
|
+ component: 'ApiSelect',
|
|
397
|
+ colProps: {
|
|
398
|
+ span: 6,
|
|
399
|
+ },
|
|
400
|
+ componentProps: {
|
|
401
|
+ placeholder: '请选择服务',
|
|
402
|
+ api: findDictItemByCode,
|
|
403
|
+ params: {
|
|
404
|
+ dictCode: 'attribute_unit',
|
|
405
|
+ },
|
|
406
|
+ labelField: 'itemText',
|
|
407
|
+ valueField: 'itemValue',
|
|
408
|
+ getPopupContainer: () => document.body,
|
|
409
|
+ },
|
|
410
|
+ ifShow: ({ values }) => isDeviceOut(values.outTarget) && isService(values.customDefine),
|
|
411
|
+ },
|
|
412
|
+ //新增代码2022-11-23
|
334
|
413
|
{
|
335
|
414
|
field: 'alarm_config',
|
336
|
415
|
label: '',
|
...
|
...
|
@@ -342,16 +421,22 @@ export const actionSchema: FormSchema[] = [ |
342
|
421
|
ifShow: ({ values }) => values.outTarget === 'MSG_NOTIFY',
|
343
|
422
|
colProps: { span: 6 },
|
344
|
423
|
},
|
|
424
|
+ //新增代码2022-11-23
|
345
|
425
|
{
|
346
|
426
|
field: 'doContext',
|
347
|
427
|
component: 'Input',
|
348
|
428
|
label: '',
|
349
|
429
|
slot: 'doContext',
|
350
|
|
- show: ({ values }) => isDeviceOut(values.outTarget),
|
|
430
|
+ show: ({ values }) => {
|
|
431
|
+ return (
|
|
432
|
+ isDeviceOut(values.outTarget) && isPartOrAll(values.device) && isDefine(values.customDefine)
|
|
433
|
+ );
|
|
434
|
+ },
|
351
|
435
|
colProps: {
|
352
|
436
|
span: 24,
|
353
|
437
|
},
|
354
|
438
|
},
|
|
439
|
+ //新增代码2022-11-23
|
355
|
440
|
{
|
356
|
441
|
field: 'alarm_level',
|
357
|
442
|
component: 'Select',
|
...
|
...
|
|