|
@@ -85,6 +85,7 @@ interface ParameterSettingProps { |
|
@@ -85,6 +85,7 @@ interface ParameterSettingProps { |
85
|
handleDelete: (val: any) => void;
|
85
|
handleDelete: (val: any) => void;
|
86
|
request?: any;
|
86
|
request?: any;
|
87
|
nodeType?: string | 'START' | 'END';
|
87
|
nodeType?: string | 'START' | 'END';
|
|
|
88
|
+ type?: string;
|
88
|
appId?: string; // 当前应用ID
|
89
|
appId?: string; // 当前应用ID
|
89
|
}
|
90
|
}
|
90
|
|
91
|
|
|
@@ -105,6 +106,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -105,6 +106,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
105
|
handleChangeField,
|
106
|
handleChangeField,
|
106
|
inputKey,
|
107
|
inputKey,
|
107
|
nodeType,
|
108
|
nodeType,
|
|
|
109
|
+ type,
|
108
|
} = props;
|
110
|
} = props;
|
109
|
const [searchValue, setSearchValue] = useState('');
|
111
|
const [searchValue, setSearchValue] = useState('');
|
110
|
|
112
|
|
|
@@ -156,7 +158,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -156,7 +158,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
156
|
}
|
158
|
}
|
157
|
return true;
|
159
|
return true;
|
158
|
};
|
160
|
};
|
159
|
-
|
161
|
+ const typeDis = !!type;
|
160
|
const columns = [
|
162
|
const columns = [
|
161
|
{
|
163
|
{
|
162
|
title: (
|
164
|
title: (
|
|
@@ -186,7 +188,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -186,7 +188,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
186
|
}}
|
188
|
}}
|
187
|
defaultValue={record.code}
|
189
|
defaultValue={record.code}
|
188
|
bordered={false}
|
190
|
bordered={false}
|
189
|
- disabled={record.disabled} onBlur={(e) => handleChange(e, record, 'code')} />
|
191
|
+ disabled={record.disabled || typeDis} onBlur={(e) => handleChange(e, record, 'code')} />
|
190
|
</Form.Item >
|
192
|
</Form.Item >
|
191
|
)
|
193
|
)
|
192
|
},
|
194
|
},
|
|
@@ -219,7 +221,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -219,7 +221,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
219
|
}}
|
221
|
}}
|
220
|
defaultValue={record.title}
|
222
|
defaultValue={record.title}
|
221
|
bordered={false}
|
223
|
bordered={false}
|
222
|
- disabled={record.disabled} onBlur={(e) => handleChange(e, record, 'title')} />
|
224
|
+ disabled={record.disabled || typeDis} onBlur={(e) => handleChange(e, record, 'title')} />
|
223
|
</Form.Item>
|
225
|
</Form.Item>
|
224
|
)
|
226
|
)
|
225
|
},
|
227
|
},
|
|
@@ -242,7 +244,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -242,7 +244,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
242
|
>
|
244
|
>
|
243
|
<Select
|
245
|
<Select
|
244
|
bordered={false}
|
246
|
bordered={false}
|
245
|
- disabled={record.disabled}
|
247
|
+ disabled={record.disabled || typeDis}
|
246
|
defaultValue={record.type}
|
248
|
defaultValue={record.type}
|
247
|
onSelect={(e) => handleChange(e, record, 'type')} >
|
249
|
onSelect={(e) => handleChange(e, record, 'type')} >
|
248
|
{
|
250
|
{
|
|
@@ -261,7 +263,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -261,7 +263,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
261
|
render: (text, record) =>
|
263
|
render: (text, record) =>
|
262
|
<div className="editable-cell ">
|
264
|
<div className="editable-cell ">
|
263
|
<QxFieldSetter
|
265
|
<QxFieldSetter
|
264
|
- disabled={record.disabled}
|
266
|
+ disabled={record.disabled || typeDis}
|
265
|
value={record.valuesObj || []}
|
267
|
value={record.valuesObj || []}
|
266
|
params={{ appCode: 'appCode', useId: true }}
|
268
|
params={{ appCode: 'appCode', useId: true }}
|
267
|
valueOptions={getValueOptions(record)}
|
269
|
valueOptions={getValueOptions(record)}
|
|
@@ -299,7 +301,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -299,7 +301,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
299
|
key={inputKey}
|
301
|
key={inputKey}
|
300
|
defaultValue={text}
|
302
|
defaultValue={text}
|
301
|
bordered={false}
|
303
|
bordered={false}
|
302
|
- disabled={record.disabled} onBlur={(e) => handleChange(e, record, 'description')} />
|
304
|
+ disabled={record.disabled || typeDis} onBlur={(e) => handleChange(e, record, 'description')} />
|
303
|
</Form.Item>
|
305
|
</Form.Item>
|
304
|
),
|
306
|
),
|
305
|
},
|
307
|
},
|
|
@@ -316,7 +318,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -316,7 +318,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
316
|
<Button
|
318
|
<Button
|
317
|
size={'small'}
|
319
|
size={'small'}
|
318
|
type="link"
|
320
|
type="link"
|
319
|
- disabled={record.disabled}
|
321
|
+ disabled={record.disabled || typeDis}
|
320
|
icon={<QxBaseIcon style={{ fontSize: 16 }} type={'qx-icon-plus'} />}
|
322
|
icon={<QxBaseIcon style={{ fontSize: 16 }} type={'qx-icon-plus'} />}
|
321
|
onClick={() => handleAdd(record.pid)}
|
323
|
onClick={() => handleAdd(record.pid)}
|
322
|
/>
|
324
|
/>
|
|
@@ -326,7 +328,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -326,7 +328,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
326
|
<Button
|
328
|
<Button
|
327
|
size={'small'}
|
329
|
size={'small'}
|
328
|
type="link"
|
330
|
type="link"
|
329
|
- disabled={record.disabled}
|
331
|
+ disabled={record.disabled || typeDis}
|
330
|
icon={<Icon style={{ fontSize: 16 }} component={SubNodeIcon} />}
|
332
|
icon={<Icon style={{ fontSize: 16 }} component={SubNodeIcon} />}
|
331
|
onClick={() => handleAddTree(record.id)}
|
333
|
onClick={() => handleAddTree(record.id)}
|
332
|
/>
|
334
|
/>
|
|
@@ -335,7 +337,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -335,7 +337,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
335
|
size={'small'}
|
337
|
size={'small'}
|
336
|
type="link"
|
338
|
type="link"
|
337
|
className="btn-high-del"
|
339
|
className="btn-high-del"
|
338
|
- disabled={record.disabled}
|
340
|
+ disabled={record.disabled || typeDis}
|
339
|
icon={<QxBaseIcon style={{ fontSize: 16 }} className={'title-btn-del-btn'} type={'qx-icon-delete'} />}
|
341
|
icon={<QxBaseIcon style={{ fontSize: 16 }} className={'title-btn-del-btn'} type={'qx-icon-delete'} />}
|
340
|
onClick={() => handleDelete(record)}
|
342
|
onClick={() => handleDelete(record)}
|
341
|
/>
|
343
|
/>
|
|
@@ -361,7 +363,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -361,7 +363,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
361
|
>
|
363
|
>
|
362
|
<InputNumber
|
364
|
<InputNumber
|
363
|
draggable={true}
|
365
|
draggable={true}
|
364
|
- disabled={record.disabled}
|
366
|
+ disabled={record.disabled || typeDis}
|
365
|
onDragStart={(event) => {
|
367
|
onDragStart={(event) => {
|
366
|
event.stopPropagation();
|
368
|
event.stopPropagation();
|
367
|
event.preventDefault();
|
369
|
event.preventDefault();
|
|
@@ -376,7 +378,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -376,7 +378,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
376
|
<div className='range-cell'>-</div>
|
378
|
<div className='range-cell'>-</div>
|
377
|
<InputNumber
|
379
|
<InputNumber
|
378
|
draggable={true}
|
380
|
draggable={true}
|
379
|
- disabled={record.disabled}
|
381
|
+ disabled={record.disabled || typeDis}
|
380
|
onDragStart={(event) => {
|
382
|
onDragStart={(event) => {
|
381
|
event.stopPropagation();
|
383
|
event.stopPropagation();
|
382
|
event.preventDefault();
|
384
|
event.preventDefault();
|
|
@@ -398,7 +400,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -398,7 +400,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
398
|
>
|
400
|
>
|
399
|
<div className='range-cell'>
|
401
|
<div className='range-cell'>
|
400
|
<InputNumber
|
402
|
<InputNumber
|
401
|
- disabled={record.disabled}
|
403
|
+ disabled={record.disabled || typeDis}
|
402
|
draggable={true}
|
404
|
draggable={true}
|
403
|
onDragStart={(event) => {
|
405
|
onDragStart={(event) => {
|
404
|
event.stopPropagation();
|
406
|
event.stopPropagation();
|
|
@@ -414,7 +416,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -414,7 +416,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
414
|
/>
|
416
|
/>
|
415
|
-
|
417
|
-
|
416
|
<InputNumber
|
418
|
<InputNumber
|
417
|
- disabled={record.disabled}
|
419
|
+ disabled={record.disabled || typeDis}
|
418
|
draggable={true}
|
420
|
draggable={true}
|
419
|
onDragStart={(event) => {
|
421
|
onDragStart={(event) => {
|
420
|
event.stopPropagation();
|
422
|
event.stopPropagation();
|
|
@@ -433,7 +435,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -433,7 +435,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
433
|
<div className='range-cell'>
|
435
|
<div className='range-cell'>
|
434
|
|
436
|
|
435
|
<InputNumber
|
437
|
<InputNumber
|
436
|
- disabled={record.disabled}
|
438
|
+ disabled={record.disabled || typeDis}
|
437
|
draggable={true}
|
439
|
draggable={true}
|
438
|
onDragStart={(event) => {
|
440
|
onDragStart={(event) => {
|
439
|
event.stopPropagation();
|
441
|
event.stopPropagation();
|
|
@@ -460,7 +462,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -460,7 +462,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
460
|
<div className='range-cell'>
|
462
|
<div className='range-cell'>
|
461
|
<DatePicker
|
463
|
<DatePicker
|
462
|
bordered={false}
|
464
|
bordered={false}
|
463
|
- disabled={record.disabled}
|
465
|
+ disabled={record.disabled || typeDis}
|
464
|
size='small'
|
466
|
size='small'
|
465
|
defaultValue={
|
467
|
defaultValue={
|
466
|
qxProps?.min
|
468
|
qxProps?.min
|
|
@@ -475,7 +477,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -475,7 +477,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
475
|
/>
|
477
|
/>
|
476
|
-
|
478
|
-
|
477
|
<DatePicker
|
479
|
<DatePicker
|
478
|
- disabled={record.disabled}
|
480
|
+ disabled={record.disabled || typeDis}
|
479
|
size='small'
|
481
|
size='small'
|
480
|
bordered={false}
|
482
|
bordered={false}
|
481
|
defaultValue={
|
483
|
defaultValue={
|
|
@@ -493,7 +495,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -493,7 +495,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
493
|
</div>
|
495
|
</div>
|
494
|
<div className='range-cell'>
|
496
|
<div className='range-cell'>
|
495
|
<Select
|
497
|
<Select
|
496
|
- disabled={record.disabled}
|
498
|
+ disabled={record.disabled || typeDis}
|
497
|
size='small'
|
499
|
size='small'
|
498
|
// style={{ width: '90px' }}
|
500
|
// style={{ width: '90px' }}
|
499
|
bordered={false}
|
501
|
bordered={false}
|
|
@@ -535,7 +537,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -535,7 +537,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
535
|
onChange={(val: any) => {
|
537
|
onChange={(val: any) => {
|
536
|
handleChange(val, record, 'qxProps');
|
538
|
handleChange(val, record, 'qxProps');
|
537
|
}}
|
539
|
}}
|
538
|
- disabled={['USER', 'ORG'].includes(record.type) || record.disabled}
|
540
|
+ disabled={['USER', 'ORG'].includes(record.type) || record.disabled || typeDis}
|
539
|
request={props?.request}
|
541
|
request={props?.request}
|
540
|
/>
|
542
|
/>
|
541
|
</div>
|
543
|
</div>
|
|
@@ -559,7 +561,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -559,7 +561,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
559
|
<Select
|
561
|
<Select
|
560
|
defaultValue={text || false}
|
562
|
defaultValue={text || false}
|
561
|
bordered={false}
|
563
|
bordered={false}
|
562
|
- disabled={record.disabled}
|
564
|
+ disabled={record.disabled || typeDis}
|
563
|
onSelect={(e) => props.handleChange(e, record, 'required')}
|
565
|
onSelect={(e) => props.handleChange(e, record, 'required')}
|
564
|
>
|
566
|
>
|
565
|
<Select.Option value={true}>是</Select.Option>
|
567
|
<Select.Option value={true}>是</Select.Option>
|
|
@@ -608,8 +610,8 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -608,8 +610,8 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
608
|
|
610
|
|
609
|
//每行拖拽渲染
|
611
|
//每行拖拽渲染
|
610
|
const onRow = () => ({
|
612
|
const onRow = () => ({
|
611
|
- draggable: true,
|
|
|
612
|
- style: { cursor: 'move' },
|
613
|
+ draggable: !type,
|
|
|
614
|
+ style: !type && { cursor: 'move' },
|
613
|
onDragStart: (ev: any) => {
|
615
|
onDragStart: (ev: any) => {
|
614
|
ev.persist();
|
616
|
ev.persist();
|
615
|
ev.dataTransfer.effectAllowed = 'move';
|
617
|
ev.dataTransfer.effectAllowed = 'move';
|
|
@@ -758,55 +760,58 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -758,55 +760,58 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
758
|
/>
|
760
|
/>
|
759
|
}
|
761
|
}
|
760
|
>
|
762
|
>
|
761
|
- {isShowJson ? (
|
|
|
762
|
- <Row>
|
|
|
763
|
- <Col span={12}>
|
|
|
764
|
- <Button
|
|
|
765
|
- type="link"
|
|
|
766
|
- icon={<SnippetsOutlined />}
|
|
|
767
|
- onClick={() => setIsShowJson(false)}
|
|
|
768
|
- >
|
|
|
769
|
- {'表单参数设置'}
|
|
|
770
|
- </Button>
|
|
|
771
|
- </Col>
|
|
|
772
|
- </Row>
|
|
|
773
|
- ) : (
|
|
|
774
|
- <Row>
|
|
|
775
|
- <Col span={12}>
|
|
|
776
|
- <Button
|
|
|
777
|
- size={'small'}
|
|
|
778
|
- type="link"
|
|
|
779
|
- icon={<QxBaseIcon style={{ fontSize: 16 }} type={'qx-icon-flow-code'} />}
|
763
|
+ {!type && (
|
|
|
764
|
+ isShowJson ? (
|
|
|
765
|
+ <Row>
|
|
|
766
|
+ <Col span={12}>
|
|
|
767
|
+ <Button
|
|
|
768
|
+ type="link"
|
|
|
769
|
+ icon={<SnippetsOutlined />}
|
|
|
770
|
+ onClick={() => setIsShowJson(false)}
|
|
|
771
|
+ >
|
|
|
772
|
+ {'表单参数设置'}
|
|
|
773
|
+ </Button>
|
|
|
774
|
+ </Col>
|
|
|
775
|
+ </Row>
|
|
|
776
|
+ ) : (
|
|
|
777
|
+ <Row>
|
|
|
778
|
+ <Col span={12}>
|
|
|
779
|
+ <Button
|
|
|
780
|
+ size={'small'}
|
|
|
781
|
+ type="link"
|
|
|
782
|
+ icon={<QxBaseIcon style={{ fontSize: 16 }} type={'qx-icon-flow-code'} />}
|
|
|
783
|
+ style={{
|
|
|
784
|
+ padding: 0,
|
|
|
785
|
+ height: '32px',
|
|
|
786
|
+ lineHeight: '32px',
|
|
|
787
|
+ }}
|
|
|
788
|
+ onClick={() => onOpen()}
|
|
|
789
|
+ >
|
|
|
790
|
+ JSON参数设置
|
|
|
791
|
+ </Button>
|
|
|
792
|
+ </Col>
|
|
|
793
|
+ <Col
|
|
|
794
|
+ className="border-none"
|
|
|
795
|
+ span={12}
|
780
|
style={{
|
796
|
style={{
|
781
|
- padding: 0,
|
|
|
782
|
- height: '32px',
|
|
|
783
|
- lineHeight: '32px',
|
797
|
+ display: 'flex',
|
|
|
798
|
+ flexDirection: 'row-reverse',
|
|
|
799
|
+ marginBottom: '16px',
|
|
|
800
|
+ textAlign: 'center',
|
784
|
}}
|
801
|
}}
|
785
|
- onClick={() => onOpen()}
|
|
|
786
|
>
|
802
|
>
|
787
|
- JSON参数设置
|
|
|
788
|
- </Button>
|
|
|
789
|
- </Col>
|
|
|
790
|
- <Col
|
|
|
791
|
- className="border-none"
|
|
|
792
|
- span={12}
|
|
|
793
|
- style={{
|
|
|
794
|
- display: 'flex',
|
|
|
795
|
- flexDirection: 'row-reverse',
|
|
|
796
|
- marginBottom: '16px',
|
|
|
797
|
- textAlign: 'center',
|
|
|
798
|
- }}
|
|
|
799
|
- >
|
|
|
800
|
- <Input
|
|
|
801
|
- className={'qx-parameter-setting--search'}
|
|
|
802
|
- placeholder="参数编码/参数名搜索"
|
|
|
803
|
- prefix={<QxBaseIcon type={'icon-app-search-line'} />}
|
|
|
804
|
- onChange={onChange}
|
|
|
805
|
- style={{ width: 219 }}
|
|
|
806
|
- />
|
|
|
807
|
- </Col>
|
|
|
808
|
- </Row>
|
|
|
809
|
- )}
|
803
|
+ <Input
|
|
|
804
|
+ className={'qx-parameter-setting--search'}
|
|
|
805
|
+ placeholder="参数编码/参数名搜索"
|
|
|
806
|
+ prefix={<QxBaseIcon type={'icon-app-search-line'} />}
|
|
|
807
|
+ onChange={onChange}
|
|
|
808
|
+ style={{ width: 219 }}
|
|
|
809
|
+ />
|
|
|
810
|
+ </Col>
|
|
|
811
|
+ </Row>
|
|
|
812
|
+ )
|
|
|
813
|
+ )
|
|
|
814
|
+ }
|
810
|
{
|
815
|
{
|
811
|
isShowJson ? (
|
816
|
isShowJson ? (
|
812
|
<>
|
817
|
<>
|