neo-cmp-cli 1.13.18 → 1.13.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +217 -600
- package/dist/neo/neoRequire.js +1 -1
- package/dist/package.json.js +1 -1
- package/package.json +1 -2
- package/template/asset-manage-template/package.json +2 -2
- package/template/echarts-custom-cmp-template/package.json +1 -1
- package/template/empty-custom-cmp-template/package.json +2 -2
- package/template/neo-bi-cmps/package.json +2 -2
- package/template/neo-bi-cmps/src/components/filterBar__c/common.scss +1 -1
- package/template/neo-bi-cmps/src/components/filterBar__c/index.tsx +18 -10
- package/template/neo-bi-cmps/src/components/filterBar__c/model.ts +8 -2
- package/template/neo-bi-cmps/src/utils/common.ts +18 -20
- package/template/neo-bi-cmps/src/utils/filter2chartFilter.ts +4 -6
- package/template/neo-bi-cmps/src/utils/pipelineFunnel.ts +4 -2
- package/template/neo-bi-cmps/src/utils/simpleTable.tsx +21 -16
- package/template/neo-custom-cmp-template/package.json +2 -2
- package/template/neo-custom-cmp-template/src/components/customApi__c/README.md +90 -0
- package/template/neo-custom-cmp-template/src/components/customApi__c/index.tsx +184 -0
- package/template/neo-custom-cmp-template/src/components/customApi__c/model.ts +53 -0
- package/template/neo-custom-cmp-template/src/components/customApi__c/style.scss +116 -0
- package/template/neo-custom-cmp-template/src/components/entityTable__c/index.tsx +5 -1
- package/template/neo-custom-cmp-template/src/components/simpleCmp__c/index.tsx +4 -1
- package/template/neo-h5-cmps/neo.config.js +1 -1
- package/template/neo-h5-cmps/package.json +2 -2
- package/template/neo-h5-cmps/src/components/entityList__c/index.tsx +0 -1
- package/template/neo-order-cmps/package.json +1 -1
- package/template/neo-pipeline-cmps/package.json +1 -1
- package/template/neo-pipeline-cmps/src/components/filterBar__c/model.ts +10 -2
- package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/index.tsx +1 -0
- package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/model.ts +14 -2
- package/template/neo-pipeline-cmps/src/components/pipelineFunnel__c/reset.scss +4 -0
- package/template/neo-pipeline-cmps/src/components/showHealthResult__c/index.tsx +2 -1
- package/template/neo-pipeline-cmps/src/components/stageSwitch__c/model.ts +14 -2
- package/template/neo-pipeline-cmps/src/components/stageTimeChart__c/model.ts +14 -2
- package/template/neo-web-entity-grid/package.json +1 -1
- package/template/neo-web-entity-grid/src/components/createForm__c/index.tsx +271 -259
- package/template/neo-web-entity-grid/src/components/createForm__c/model.ts +17 -3
- package/template/neo-web-entity-grid/src/components/createForm__c/resetAntd.scss +0 -1
- package/template/neo-web-entity-grid/src/components/createForm__c/style.scss +1 -1
- package/template/neo-web-entity-grid/src/components/entityGrid2__c/index.tsx +5 -1
- package/template/neo-web-entity-grid/src/components/entityGrid2__c/model.ts +4 -3
- package/template/neo-web-entity-grid/src/components/entityGrid3__c/index.tsx +1 -1
- package/template/neo-web-entity-grid/src/components/searchForm__c/index.tsx +4 -3
- package/template/neo-web-entity-grid/src/components/searchForm__c/model.ts +9 -4
- package/template/neo-web-entity-grid/src/components/searchForm__c/style.scss +2 -1
- package/template/neo-web-form/package.json +2 -2
- package/template/neo-web-form/src/components/batchAddTable__c/index.tsx +19 -19
- package/template/neo-web-form/src/components/batchAddTable__c/model.ts +11 -15
- package/template/neo-web-form/src/components/listSummary__c/index.tsx +6 -5
- package/template/react-custom-cmp-template/package.json +1 -1
- package/docs/H5/347/253/257 NeoEntityList /344/275/277/347/224/250/350/257/264/346/230/216.md" +0 -293
- package/docs/Web/347/253/257 NeoEntityGrid /344/275/277/347/224/250/350/257/264/346/230/216.md" +0 -1206
- package/docs//345/217/257/347/224/250/345/261/236/346/200/247/351/205/215/347/275/256/351/241/271.md +0 -801
- package/docs//351/200/232/347/224/250/344/273/243/347/220/206/346/216/245/345/217/243/forward.zip +0 -0
- package/docs//351/200/232/347/224/250/344/273/243/347/220/206/346/216/245/345/217/243//350/207/252/345/256/232/344/271/211API:/351/200/232/347/224/250/344/273/243/347/220/206/346/216/245/345/217/243/344/275/277/347/224/250/350/257/264/346/230/216.md +0 -13
|
@@ -345,7 +345,7 @@ export default class CreateEntityForm extends React.PureComponent<
|
|
|
345
345
|
// 触发表单提交事件
|
|
346
346
|
this.onSubmit({
|
|
347
347
|
xObjectApiKey,
|
|
348
|
-
data: values
|
|
348
|
+
data: values,
|
|
349
349
|
});
|
|
350
350
|
});
|
|
351
351
|
}
|
|
@@ -438,275 +438,287 @@ export default class CreateEntityForm extends React.PureComponent<
|
|
|
438
438
|
|
|
439
439
|
return (
|
|
440
440
|
<>
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
441
|
+
<Form
|
|
442
|
+
ref={(form) => this.setState({ form })}
|
|
443
|
+
layout="horizontal"
|
|
444
|
+
{...formItemLayout}
|
|
445
|
+
>
|
|
446
|
+
<Row gutter={16}>
|
|
447
|
+
{curFieldList.map((field) => {
|
|
448
|
+
// 跳过 ID 字段,不需要在表单中显示
|
|
449
|
+
if (field.apiKey === 'id') return null;
|
|
450
|
+
|
|
451
|
+
let inputComponent;
|
|
452
|
+
const selectitem = field.selectitem || [];
|
|
453
|
+
const checkitem = field.checkitem || [];
|
|
454
|
+
|
|
455
|
+
// 关联字段:存在 referTo 时,渲染为点击选择弹窗的输入框
|
|
456
|
+
if (
|
|
457
|
+
field.referTo &&
|
|
458
|
+
field.type !== 'entityType' &&
|
|
459
|
+
field.type !== 'entitytype'
|
|
460
|
+
) {
|
|
461
|
+
// 非业务类型字段
|
|
462
|
+
const selectedLabel = referSelectedLabels[field.apiKey] || '';
|
|
463
|
+
const colSpan = columnCount === 2 ? 12 : 24;
|
|
464
|
+
return (
|
|
465
|
+
<Col span={colSpan} key={field.apiKey}>
|
|
466
|
+
<Form.Item
|
|
467
|
+
label={field.label}
|
|
468
|
+
required={field.required ?? false}
|
|
469
|
+
>
|
|
470
|
+
<Input.Group compact style={{ display: 'flex' }}>
|
|
471
|
+
<Form.Item
|
|
472
|
+
name={field.apiKey}
|
|
473
|
+
noStyle
|
|
474
|
+
rules={[
|
|
475
|
+
{
|
|
476
|
+
required: field.required,
|
|
477
|
+
message: `请选择${field.label}`,
|
|
478
|
+
},
|
|
479
|
+
]}
|
|
480
|
+
>
|
|
481
|
+
<Input type="hidden" />
|
|
482
|
+
</Form.Item>
|
|
483
|
+
<Input
|
|
484
|
+
readOnly
|
|
485
|
+
value={selectedLabel}
|
|
486
|
+
placeholder={`请点击选择${field.label}`}
|
|
487
|
+
style={{ flex: 1, cursor: 'pointer' }}
|
|
488
|
+
onClick={() => this.openReferModal(field)}
|
|
489
|
+
/>
|
|
490
|
+
<Button
|
|
491
|
+
type="primary"
|
|
492
|
+
onClick={() => this.openReferModal(field)}
|
|
493
|
+
>
|
|
494
|
+
选择
|
|
495
|
+
</Button>
|
|
496
|
+
</Input.Group>
|
|
497
|
+
</Form.Item>
|
|
498
|
+
</Col>
|
|
499
|
+
);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
// 根据字段类型生成对应的输入组件
|
|
503
|
+
switch (field.type) {
|
|
504
|
+
case 'entityType':
|
|
505
|
+
case 'entitytype':
|
|
506
|
+
// 业务类型选择器
|
|
507
|
+
inputComponent = (
|
|
508
|
+
<Select placeholder="请选择业务类型" allowClear>
|
|
509
|
+
{entityTypeList.map((item) => (
|
|
510
|
+
<Option
|
|
511
|
+
key={item.apiKey}
|
|
512
|
+
value={item.id}
|
|
513
|
+
disabled={!item.active}
|
|
514
|
+
>
|
|
515
|
+
{item.label}
|
|
516
|
+
</Option>
|
|
517
|
+
))}
|
|
518
|
+
</Select>
|
|
519
|
+
);
|
|
520
|
+
break;
|
|
521
|
+
case 'picklist':
|
|
522
|
+
// 单选下拉框
|
|
523
|
+
inputComponent = (
|
|
524
|
+
<Select placeholder={`请选择${field.label}`} allowClear>
|
|
525
|
+
{selectitem.map((item) => (
|
|
526
|
+
<Option key={item.apiKey} value={item.id}>
|
|
527
|
+
{item.label}
|
|
528
|
+
</Option>
|
|
529
|
+
))}
|
|
530
|
+
</Select>
|
|
531
|
+
);
|
|
532
|
+
break;
|
|
533
|
+
case 'textarea':
|
|
534
|
+
// 多行文本输入框
|
|
535
|
+
inputComponent = (
|
|
536
|
+
<Input.TextArea
|
|
537
|
+
placeholder={`请输入${field.label}`}
|
|
538
|
+
rows={3}
|
|
539
|
+
showCount
|
|
540
|
+
maxLength={500}
|
|
541
|
+
/>
|
|
542
|
+
);
|
|
543
|
+
break;
|
|
544
|
+
case 'multipicklist':
|
|
545
|
+
// 多选下拉框
|
|
546
|
+
inputComponent = (
|
|
547
|
+
<Select
|
|
548
|
+
placeholder={`请选择${field.label}`}
|
|
549
|
+
mode="multiple"
|
|
550
|
+
allowClear
|
|
551
|
+
>
|
|
552
|
+
{checkitem.map((item) => (
|
|
553
|
+
<Option key={item.apiKey} value={item.id}>
|
|
554
|
+
{item.label}
|
|
555
|
+
</Option>
|
|
556
|
+
))}
|
|
557
|
+
</Select>
|
|
558
|
+
);
|
|
559
|
+
break;
|
|
560
|
+
case 'datetime':
|
|
561
|
+
// 日期时间选择器
|
|
562
|
+
inputComponent = (
|
|
563
|
+
<DatePicker
|
|
564
|
+
placeholder={`请选择${field.label}`}
|
|
565
|
+
format={'YYYY/MM/DD HH:mm:ss'}
|
|
566
|
+
showTime={true}
|
|
567
|
+
style={{ width: '100%' }}
|
|
568
|
+
/>
|
|
569
|
+
);
|
|
570
|
+
break;
|
|
571
|
+
case 'date':
|
|
572
|
+
// 日期选择器
|
|
573
|
+
inputComponent = (
|
|
574
|
+
<DatePicker
|
|
575
|
+
placeholder={`请选择${field.label}`}
|
|
576
|
+
format={'YYYY/MM/DD'}
|
|
577
|
+
style={{ width: '100%' }}
|
|
578
|
+
/>
|
|
579
|
+
);
|
|
580
|
+
break;
|
|
581
|
+
case 'time':
|
|
582
|
+
// 时间选择器
|
|
583
|
+
inputComponent = (
|
|
584
|
+
<DatePicker
|
|
585
|
+
placeholder={`请选择${field.label}`}
|
|
586
|
+
format={'HH:mm:ss'}
|
|
587
|
+
showTime={true}
|
|
588
|
+
style={{ width: '100%' }}
|
|
589
|
+
/>
|
|
590
|
+
);
|
|
591
|
+
break;
|
|
592
|
+
case 'int':
|
|
593
|
+
case 'float':
|
|
594
|
+
// 数字输入框
|
|
595
|
+
inputComponent = (
|
|
596
|
+
<InputNumber
|
|
597
|
+
placeholder={`请输入${field.label}`}
|
|
598
|
+
style={{ width: '100%' }}
|
|
599
|
+
/>
|
|
600
|
+
);
|
|
601
|
+
break;
|
|
602
|
+
case 'email':
|
|
603
|
+
// 邮箱输入框
|
|
604
|
+
inputComponent = (
|
|
605
|
+
<Input placeholder={`请输入${field.label}`} type="email" />
|
|
606
|
+
);
|
|
607
|
+
break;
|
|
608
|
+
case 'url':
|
|
609
|
+
// URL 输入框
|
|
610
|
+
inputComponent = (
|
|
611
|
+
<Input placeholder={`请输入${field.label}`} type="url" />
|
|
612
|
+
);
|
|
613
|
+
break;
|
|
614
|
+
case 'phone':
|
|
615
|
+
// 电话号码输入框
|
|
616
|
+
inputComponent = (
|
|
617
|
+
<Input placeholder={`请输入${field.label}`} type="tel" />
|
|
618
|
+
);
|
|
619
|
+
break;
|
|
620
|
+
default:
|
|
621
|
+
// 默认文本输入框
|
|
622
|
+
inputComponent = (
|
|
623
|
+
<Input
|
|
624
|
+
placeholder={`请输入${field.label}`}
|
|
625
|
+
maxLength={200}
|
|
626
|
+
/>
|
|
627
|
+
);
|
|
628
|
+
}
|
|
629
|
+
|
|
459
630
|
const colSpan = columnCount === 2 ? 12 : 24;
|
|
631
|
+
|
|
460
632
|
return (
|
|
461
633
|
<Col span={colSpan} key={field.apiKey}>
|
|
462
634
|
<Form.Item
|
|
635
|
+
name={field.apiKey}
|
|
463
636
|
label={field.label}
|
|
464
637
|
required={field.required ?? false}
|
|
638
|
+
rules={[
|
|
639
|
+
{
|
|
640
|
+
required: field.required,
|
|
641
|
+
message: `请${
|
|
642
|
+
field.type === 'picklist' ||
|
|
643
|
+
field.type === 'multipicklist' ||
|
|
644
|
+
field.type === 'entityType' ||
|
|
645
|
+
field.type === 'entitytype' ||
|
|
646
|
+
field.type === 'date' ||
|
|
647
|
+
field.type === 'datetime' ||
|
|
648
|
+
field.type === 'time'
|
|
649
|
+
? '选择'
|
|
650
|
+
: '输入'
|
|
651
|
+
}${field.label}`,
|
|
652
|
+
},
|
|
653
|
+
]}
|
|
465
654
|
>
|
|
466
|
-
|
|
467
|
-
<Form.Item
|
|
468
|
-
name={field.apiKey}
|
|
469
|
-
noStyle
|
|
470
|
-
rules={[
|
|
471
|
-
{
|
|
472
|
-
required: field.required,
|
|
473
|
-
message: `请选择${field.label}`,
|
|
474
|
-
},
|
|
475
|
-
]}
|
|
476
|
-
>
|
|
477
|
-
<Input type="hidden" />
|
|
478
|
-
</Form.Item>
|
|
479
|
-
<Input
|
|
480
|
-
readOnly
|
|
481
|
-
value={selectedLabel}
|
|
482
|
-
placeholder={`请点击选择${field.label}`}
|
|
483
|
-
style={{ flex: 1, cursor: 'pointer' }}
|
|
484
|
-
onClick={() => this.openReferModal(field)}
|
|
485
|
-
/>
|
|
486
|
-
<Button
|
|
487
|
-
type="primary"
|
|
488
|
-
onClick={() => this.openReferModal(field)}
|
|
489
|
-
>
|
|
490
|
-
选择
|
|
491
|
-
</Button>
|
|
492
|
-
</Input.Group>
|
|
655
|
+
{inputComponent}
|
|
493
656
|
</Form.Item>
|
|
494
657
|
</Col>
|
|
495
658
|
);
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
<Option key={item.apiKey} value={item.id}>
|
|
550
|
-
{item.label}
|
|
551
|
-
</Option>
|
|
552
|
-
))}
|
|
553
|
-
</Select>
|
|
554
|
-
);
|
|
555
|
-
break;
|
|
556
|
-
case 'datetime':
|
|
557
|
-
// 日期时间选择器
|
|
558
|
-
inputComponent = (
|
|
559
|
-
<DatePicker
|
|
560
|
-
placeholder={`请选择${field.label}`}
|
|
561
|
-
format={'YYYY/MM/DD HH:mm:ss'}
|
|
562
|
-
showTime={true}
|
|
563
|
-
style={{ width: '100%' }}
|
|
564
|
-
/>
|
|
565
|
-
);
|
|
566
|
-
break;
|
|
567
|
-
case 'date':
|
|
568
|
-
// 日期选择器
|
|
569
|
-
inputComponent = (
|
|
570
|
-
<DatePicker
|
|
571
|
-
placeholder={`请选择${field.label}`}
|
|
572
|
-
format={'YYYY/MM/DD'}
|
|
573
|
-
style={{ width: '100%' }}
|
|
574
|
-
/>
|
|
575
|
-
);
|
|
576
|
-
break;
|
|
577
|
-
case 'time':
|
|
578
|
-
// 时间选择器
|
|
579
|
-
inputComponent = (
|
|
580
|
-
<DatePicker
|
|
581
|
-
placeholder={`请选择${field.label}`}
|
|
582
|
-
format={'HH:mm:ss'}
|
|
583
|
-
showTime={true}
|
|
584
|
-
style={{ width: '100%' }}
|
|
585
|
-
/>
|
|
586
|
-
);
|
|
587
|
-
break;
|
|
588
|
-
case 'int':
|
|
589
|
-
case 'float':
|
|
590
|
-
// 数字输入框
|
|
591
|
-
inputComponent = (
|
|
592
|
-
<InputNumber
|
|
593
|
-
placeholder={`请输入${field.label}`}
|
|
594
|
-
style={{ width: '100%' }}
|
|
595
|
-
/>
|
|
596
|
-
);
|
|
597
|
-
break;
|
|
598
|
-
case 'email':
|
|
599
|
-
// 邮箱输入框
|
|
600
|
-
inputComponent = (
|
|
601
|
-
<Input placeholder={`请输入${field.label}`} type="email" />
|
|
602
|
-
);
|
|
603
|
-
break;
|
|
604
|
-
case 'url':
|
|
605
|
-
// URL 输入框
|
|
606
|
-
inputComponent = (
|
|
607
|
-
<Input placeholder={`请输入${field.label}`} type="url" />
|
|
608
|
-
);
|
|
609
|
-
break;
|
|
610
|
-
case 'phone':
|
|
611
|
-
// 电话号码输入框
|
|
612
|
-
inputComponent = (
|
|
613
|
-
<Input placeholder={`请输入${field.label}`} type="tel" />
|
|
614
|
-
);
|
|
615
|
-
break;
|
|
616
|
-
default:
|
|
617
|
-
// 默认文本输入框
|
|
618
|
-
inputComponent = (
|
|
619
|
-
<Input placeholder={`请输入${field.label}`} maxLength={200} />
|
|
620
|
-
);
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
const colSpan = columnCount === 2 ? 12 : 24;
|
|
624
|
-
|
|
625
|
-
return (
|
|
626
|
-
<Col span={colSpan} key={field.apiKey}>
|
|
627
|
-
<Form.Item
|
|
628
|
-
name={field.apiKey}
|
|
629
|
-
label={field.label}
|
|
630
|
-
required={field.required ?? false}
|
|
631
|
-
rules={[
|
|
632
|
-
{
|
|
633
|
-
required: field.required,
|
|
634
|
-
message: `请${
|
|
635
|
-
field.type === 'picklist' ||
|
|
636
|
-
field.type === 'multipicklist' ||
|
|
637
|
-
field.type === 'entityType' ||
|
|
638
|
-
field.type === 'entitytype' ||
|
|
639
|
-
field.type === 'date' ||
|
|
640
|
-
field.type === 'datetime' ||
|
|
641
|
-
field.type === 'time'
|
|
642
|
-
? '选择'
|
|
643
|
-
: '输入'
|
|
644
|
-
}${field.label}`,
|
|
659
|
+
})}
|
|
660
|
+
</Row>
|
|
661
|
+
|
|
662
|
+
{submitSuccess && (
|
|
663
|
+
<div className="submit-success-message">
|
|
664
|
+
<CheckCircleOutlined /> 数据已成功提交
|
|
665
|
+
</div>
|
|
666
|
+
)}
|
|
667
|
+
</Form>
|
|
668
|
+
|
|
669
|
+
<Modal
|
|
670
|
+
open={referModalVisible}
|
|
671
|
+
onCancel={this.closeReferModal}
|
|
672
|
+
footer={null}
|
|
673
|
+
width={900}
|
|
674
|
+
title={`选择${currentReferField?.label || ''}`}
|
|
675
|
+
destroyOnClose
|
|
676
|
+
>
|
|
677
|
+
{currentReferField && currentReferField.referTo && (
|
|
678
|
+
<NeoEntityGrid
|
|
679
|
+
render={this.props.render}
|
|
680
|
+
objectApiKey={currentReferField.referTo.apiKey}
|
|
681
|
+
referData={{
|
|
682
|
+
referObjectApiKey: xObjectDataApi?.xObjectApiKey,
|
|
683
|
+
referItemApiKey: currentReferField.apiKey,
|
|
684
|
+
}}
|
|
685
|
+
selectedCount={1}
|
|
686
|
+
hiddenHeader={true}
|
|
687
|
+
onCancel={this.closeReferModal}
|
|
688
|
+
onSelectedCall={(selectedData: any) => {
|
|
689
|
+
const { currentReferField: curField, currentReferField } =
|
|
690
|
+
this.state;
|
|
691
|
+
if (!curField) return;
|
|
692
|
+
|
|
693
|
+
const items = Array.isArray(selectedData)
|
|
694
|
+
? selectedData
|
|
695
|
+
: [selectedData];
|
|
696
|
+
const firstItem = items[0];
|
|
697
|
+
const selectedId = firstItem?.id ?? firstItem;
|
|
698
|
+
const selectedName =
|
|
699
|
+
firstItem[`${currentReferField?.referTo?.apiKey}Name`] ||
|
|
700
|
+
firstItem?.label ||
|
|
701
|
+
firstItem?.name ||
|
|
702
|
+
firstItem?.id;
|
|
703
|
+
|
|
704
|
+
if (selectedId !== undefined && selectedId !== null) {
|
|
705
|
+
this.state.form?.setFieldsValue({
|
|
706
|
+
[curField.apiKey]: selectedId,
|
|
707
|
+
});
|
|
708
|
+
this.setState((prev) => ({
|
|
709
|
+
referSelectedLabels: {
|
|
710
|
+
...prev.referSelectedLabels,
|
|
711
|
+
[curField.apiKey]: selectedName,
|
|
645
712
|
},
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
{submitSuccess && (
|
|
656
|
-
<div className="submit-success-message">
|
|
657
|
-
<CheckCircleOutlined /> 数据已成功提交
|
|
658
|
-
</div>
|
|
659
|
-
)}
|
|
660
|
-
</Form>
|
|
661
|
-
|
|
662
|
-
<Modal
|
|
663
|
-
open={referModalVisible}
|
|
664
|
-
onCancel={this.closeReferModal}
|
|
665
|
-
footer={null}
|
|
666
|
-
width={900}
|
|
667
|
-
title={`选择${currentReferField?.label || ''}`}
|
|
668
|
-
destroyOnClose
|
|
669
|
-
>
|
|
670
|
-
{currentReferField && currentReferField.referTo && (
|
|
671
|
-
<NeoEntityGrid
|
|
672
|
-
render={this.props.render}
|
|
673
|
-
objectApiKey={currentReferField.referTo.apiKey}
|
|
674
|
-
referData={{
|
|
675
|
-
referObjectApiKey: xObjectDataApi?.xObjectApiKey,
|
|
676
|
-
referItemApiKey: currentReferField.apiKey,
|
|
677
|
-
}}
|
|
678
|
-
selectedCount={1}
|
|
679
|
-
hiddenHeader={true}
|
|
680
|
-
onCancel={this.closeReferModal}
|
|
681
|
-
onSelectedCall={(selectedData: any) => {
|
|
682
|
-
const { currentReferField: curField, currentReferField } = this.state;
|
|
683
|
-
if (!curField) return;
|
|
684
|
-
|
|
685
|
-
const items = Array.isArray(selectedData)
|
|
686
|
-
? selectedData
|
|
687
|
-
: [selectedData];
|
|
688
|
-
const firstItem = items[0];
|
|
689
|
-
const selectedId = firstItem?.id ?? firstItem;
|
|
690
|
-
const selectedName = firstItem[`${currentReferField?.referTo?.apiKey}Name`] || firstItem?.label || firstItem?.name || firstItem?.id;
|
|
691
|
-
|
|
692
|
-
if (selectedId !== undefined && selectedId !== null) {
|
|
693
|
-
this.state.form?.setFieldsValue({
|
|
694
|
-
[curField.apiKey]: selectedId,
|
|
695
|
-
});
|
|
696
|
-
this.setState((prev) => ({
|
|
697
|
-
referSelectedLabels: {
|
|
698
|
-
...prev.referSelectedLabels,
|
|
699
|
-
[curField.apiKey]: selectedName,
|
|
700
|
-
},
|
|
701
|
-
referModalVisible: false,
|
|
702
|
-
currentReferField: null,
|
|
703
|
-
}));
|
|
704
|
-
}
|
|
705
|
-
return false; // 阻止事件冒泡
|
|
706
|
-
}}
|
|
707
|
-
/>
|
|
708
|
-
)}
|
|
709
|
-
</Modal>
|
|
713
|
+
referModalVisible: false,
|
|
714
|
+
currentReferField: null,
|
|
715
|
+
}));
|
|
716
|
+
}
|
|
717
|
+
return false; // 阻止事件冒泡
|
|
718
|
+
}}
|
|
719
|
+
/>
|
|
720
|
+
)}
|
|
721
|
+
</Modal>
|
|
710
722
|
</>
|
|
711
723
|
);
|
|
712
724
|
}
|
|
@@ -52,7 +52,14 @@ export class CreateFormModel {
|
|
|
52
52
|
columnCount: 2,
|
|
53
53
|
xObjectDataApi: {
|
|
54
54
|
xObjectApiKey: 'opportunity',
|
|
55
|
-
fields: [
|
|
55
|
+
fields: [
|
|
56
|
+
'entityType',
|
|
57
|
+
'ownerId',
|
|
58
|
+
'opportunityName',
|
|
59
|
+
'accountId',
|
|
60
|
+
'money',
|
|
61
|
+
'closeDate',
|
|
62
|
+
],
|
|
56
63
|
},
|
|
57
64
|
};
|
|
58
65
|
|
|
@@ -65,8 +72,15 @@ export class CreateFormModel {
|
|
|
65
72
|
apiKey: 'onSubmit', // 事件名称
|
|
66
73
|
label: '提交表单后', // 事件
|
|
67
74
|
helpText: '表单提交后触发该事件', // 信息icon hover 时的提示文本
|
|
68
|
-
|
|
69
|
-
|
|
75
|
+
// 定义事件触发时接收到的事件数据格式
|
|
76
|
+
eventParams: [
|
|
77
|
+
{
|
|
78
|
+
apiKey: 'eventParam',
|
|
79
|
+
children: [{ apiKey: 'data', label: '当前表单数据', type: 'Object' }],
|
|
80
|
+
label: '事件入参',
|
|
81
|
+
type: 'Object',
|
|
82
|
+
},
|
|
83
|
+
],
|
|
70
84
|
},
|
|
71
85
|
];
|
|
72
86
|
|
|
@@ -55,7 +55,11 @@ export default class NeoEntityGridCmp extends BaseCmp<
|
|
|
55
55
|
*/
|
|
56
56
|
@NeoEvent.function
|
|
57
57
|
handleCustomSearchEvent(eventData: any) {
|
|
58
|
-
console.log(
|
|
58
|
+
console.log(
|
|
59
|
+
'设置自定义筛选条件(handleCustomSearchEvent): ',
|
|
60
|
+
eventData,
|
|
61
|
+
this.props,
|
|
62
|
+
);
|
|
59
63
|
|
|
60
64
|
if (!eventData) {
|
|
61
65
|
this.setState({ additionalConditions: [] });
|
|
@@ -67,14 +67,15 @@ export class NeoEntityGridModel {
|
|
|
67
67
|
apiKey: 'handleCustomSearchEvent',
|
|
68
68
|
label: '更新筛选条件',
|
|
69
69
|
helpTextKey: '更新自定义筛选条件',
|
|
70
|
-
funcInParams: [
|
|
70
|
+
funcInParams: [
|
|
71
|
+
// 定义组件函数入参
|
|
71
72
|
{
|
|
72
73
|
apiKey: 'eventData',
|
|
73
74
|
label: '自定义筛选条件',
|
|
74
75
|
type: 'Array',
|
|
75
|
-
required: true
|
|
76
|
+
required: true,
|
|
76
77
|
},
|
|
77
|
-
]
|
|
78
|
+
],
|
|
78
79
|
},
|
|
79
80
|
];
|
|
80
81
|
|
|
@@ -61,7 +61,7 @@ export default class NeoEntityGridCmp extends React.PureComponent<NeoEntityGridP
|
|
|
61
61
|
objectApiKey={objectApiKey || 'account'}
|
|
62
62
|
pattern={'pickView'} // Picker 列表(选择器)
|
|
63
63
|
referData={referData}
|
|
64
|
-
selectionMode={selectionMode ??
|
|
64
|
+
selectionMode={selectionMode ?? 'single'} // 多选模式
|
|
65
65
|
shouldCloseDialog={restProps.shouldCloseDialog ?? true}
|
|
66
66
|
onRowSelected={(data: any, event: any) => {
|
|
67
67
|
const selectedIds = data.map(({ data }: any) => data.id);
|
|
@@ -335,10 +335,11 @@ export default class SearchForm extends React.PureComponent<
|
|
|
335
335
|
const payload: CustomQueryPayload = {
|
|
336
336
|
xObjectApiKey, // 冗余数据
|
|
337
337
|
conditions, // 冗余数据
|
|
338
|
-
data: {
|
|
338
|
+
data: {
|
|
339
|
+
// 事件动作的入参数据
|
|
339
340
|
xObjectApiKey,
|
|
340
|
-
conditions
|
|
341
|
-
}
|
|
341
|
+
conditions,
|
|
342
|
+
},
|
|
342
343
|
};
|
|
343
344
|
|
|
344
345
|
this.onQuery(payload);
|