1
|
1
|
/* eslint-disable array-callback-return */
|
2
|
2
|
/* eslint-disable eqeqeq */
|
3
|
|
-import {
|
4
|
|
- SnippetsOutlined,
|
5
|
|
-} from '@ant-design/icons';
|
|
3
|
+import { SnippetsOutlined } from '@ant-design/icons';
|
|
4
|
+import { QxFieldSetter, QxFormSelect } from '@qx/common';
|
6
|
5
|
import {
|
7
|
6
|
Button,
|
8
|
7
|
Col,
|
9
|
8
|
DatePicker,
|
|
9
|
+ Divider,
|
10
|
10
|
Form,
|
11
|
11
|
Input,
|
12
|
12
|
InputNumber,
|
...
|
...
|
@@ -15,31 +15,23 @@ import { |
15
|
15
|
Select,
|
16
|
16
|
Space,
|
17
|
17
|
Table,
|
18
|
|
- Divider,
|
19
|
18
|
message,
|
20
|
19
|
} from 'antd';
|
21
|
|
-import React, {
|
22
|
|
- useCallback,
|
23
|
|
- useEffect,
|
24
|
|
- useState,
|
25
|
|
-} from 'react';
|
|
20
|
+import React, { useCallback, useEffect, useState } from 'react';
|
26
|
21
|
import JSONEditor from './codeMirror';
|
27
|
|
-import './style.less';
|
28
|
|
-import { QxFieldSetter, QxFormSelect } from '@qx/common';
|
29
|
|
-import { formatEnum } from './constant';
|
30
|
22
|
import {
|
|
23
|
+ formatEnum,
|
31
|
24
|
typeTranslateFieIdtype,
|
32
|
|
- typeTranslateWidget,
|
33
|
25
|
typeTranslateGrouptype,
|
34
|
|
- // typeTranslateItemtype,
|
|
26
|
+ typeTranslateWidget,
|
35
|
27
|
} from './constant';
|
|
28
|
+import './style.less';
|
36
|
29
|
// import { Controlled as CodeMirror } from 'react-codemirror2'
|
37
|
|
-import { cloneDeep } from 'lodash-es';
|
38
|
|
-import moment from 'dayjs';
|
39
|
|
-import { QxBaseIcon } from '@qx/common';
|
40
|
30
|
import Icon from '@ant-design/icons';
|
41
|
|
-import { SubNodeIcon } from './sub-node-icon';
|
42
|
|
-import { SubDropIcon } from './sub-node-icon';
|
|
31
|
+import { QxBaseIcon } from '@qx/common';
|
|
32
|
+import moment from 'dayjs';
|
|
33
|
+import { cloneDeep } from 'lodash-es';
|
|
34
|
+import { SubDropIcon, SubNodeIcon } from './sub-node-icon';
|
43
|
35
|
|
44
|
36
|
import '../style/reset.less';
|
45
|
37
|
|
...
|
...
|
@@ -90,9 +82,6 @@ interface ParameterSettingProps { |
90
|
82
|
appId?: string; // 当前应用ID
|
91
|
83
|
}
|
92
|
84
|
|
93
|
|
-
|
94
|
|
-
|
95
|
|
-
|
96
|
85
|
const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
|
97
|
86
|
const {
|
98
|
87
|
visible,
|
...
|
...
|
@@ -163,11 +152,15 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
163
|
152
|
const columns = [
|
164
|
153
|
{
|
165
|
154
|
title: (
|
166
|
|
- <div style={{
|
167
|
|
- display: 'flex', flexDirection: 'row'
|
168
|
|
- , alignContent: 'center', flexWrap: 'wrap'
|
169
|
|
- }}>
|
170
|
|
- <span className='parameter-setting-table-title'>参数编码</span>
|
|
155
|
+ <div
|
|
156
|
+ style={{
|
|
157
|
+ display: 'flex',
|
|
158
|
+ flexDirection: 'row',
|
|
159
|
+ alignContent: 'center',
|
|
160
|
+ flexWrap: 'wrap',
|
|
161
|
+ }}
|
|
162
|
+ >
|
|
163
|
+ <span className="parameter-setting-table-title">参数编码</span>
|
171
|
164
|
<span style={{ color: 'red' }}>*</span>
|
172
|
165
|
</div>
|
173
|
166
|
),
|
...
|
...
|
@@ -179,10 +172,10 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
179
|
172
|
const strTitle = (text as string) || '';
|
180
|
173
|
const index = strTitle.indexOf(searchValue);
|
181
|
174
|
return (
|
182
|
|
- < Form.Item
|
|
175
|
+ <Form.Item
|
183
|
176
|
name={'code' + record.id}
|
184
|
177
|
style={{ margin: 0 }}
|
185
|
|
- // initialValue={record.code}
|
|
178
|
+ // initialValue={record.code}
|
186
|
179
|
>
|
187
|
180
|
<Input
|
188
|
181
|
style={{ color: index > -1 && searchValue ? '#1890ff' : '' }}
|
...
|
...
|
@@ -193,15 +186,17 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
193
|
186
|
}}
|
194
|
187
|
defaultValue={record.code}
|
195
|
188
|
bordered={false}
|
196
|
|
- disabled={record.disabled || typeDis} onBlur={(e) => handleChange(e, record, 'code')} />
|
197
|
|
- </Form.Item >
|
198
|
|
- )
|
|
189
|
+ disabled={record.disabled || typeDis}
|
|
190
|
+ onBlur={(e) => handleChange(e, record, 'code')}
|
|
191
|
+ />
|
|
192
|
+ </Form.Item>
|
|
193
|
+ );
|
199
|
194
|
},
|
200
|
195
|
},
|
201
|
196
|
{
|
202
|
197
|
title: (
|
203
|
198
|
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
204
|
|
- <span className='parameter-setting-table-title'>参数名</span>
|
|
199
|
+ <span className="parameter-setting-table-title">参数名</span>
|
205
|
200
|
<span style={{ color: 'red' }}>*</span>
|
206
|
201
|
</div>
|
207
|
202
|
),
|
...
|
...
|
@@ -216,7 +211,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
216
|
211
|
<Form.Item
|
217
|
212
|
name={'title' + record.id}
|
218
|
213
|
style={{ margin: 0 }}
|
219
|
|
- // initialValue={record.title}
|
|
214
|
+ // initialValue={record.title}
|
220
|
215
|
>
|
221
|
216
|
<Input
|
222
|
217
|
style={{ color: index > -1 && searchValue ? '#1890ff' : '' }}
|
...
|
...
|
@@ -227,15 +222,17 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
227
|
222
|
}}
|
228
|
223
|
defaultValue={record.title}
|
229
|
224
|
bordered={false}
|
230
|
|
- disabled={record.disabled || typeDis} onBlur={(e) => handleChange(e, record, 'title')} />
|
|
225
|
+ disabled={record.disabled || typeDis}
|
|
226
|
+ onBlur={(e) => handleChange(e, record, 'title')}
|
|
227
|
+ />
|
231
|
228
|
</Form.Item>
|
232
|
|
- )
|
|
229
|
+ );
|
233
|
230
|
},
|
234
|
231
|
},
|
235
|
232
|
{
|
236
|
233
|
title: (
|
237
|
234
|
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
238
|
|
- <span className='parameter-setting-table-title'>参数类型</span>
|
|
235
|
+ <span className="parameter-setting-table-title">参数类型</span>
|
239
|
236
|
<span style={{ color: 'red' }}>*</span>
|
240
|
237
|
</div>
|
241
|
238
|
),
|
...
|
...
|
@@ -243,36 +240,40 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
243
|
240
|
className: 'ps-table-cell',
|
244
|
241
|
width: '102px',
|
245
|
242
|
key: 'type',
|
246
|
|
- render: (text, record) =>
|
|
243
|
+ render: (text, record) => (
|
247
|
244
|
<Form.Item
|
248
|
245
|
style={{ margin: 0 }}
|
249
|
246
|
name={'type' + record.id}
|
250
|
|
- // initialValue={record.type}
|
|
247
|
+ // initialValue={record.type}
|
251
|
248
|
>
|
252
|
249
|
<Select
|
253
|
250
|
bordered={false}
|
254
|
251
|
disabled={record.disabled || typeDis}
|
255
|
252
|
defaultValue={record.type}
|
256
|
|
- onSelect={(e) => handleChange(e, record, 'type')} >
|
257
|
|
- {
|
258
|
|
- valueOptions.map((item) => {
|
259
|
|
- return <Select.Option key={item.key} value={item.key}>{item.title}</Select.Option>;
|
260
|
|
- })
|
261
|
|
- }
|
|
253
|
+ onSelect={(e) => handleChange(e, record, 'type')}
|
|
254
|
+ >
|
|
255
|
+ {valueOptions.map((item) => {
|
|
256
|
+ return (
|
|
257
|
+ <Select.Option key={item.key} value={item.key}>
|
|
258
|
+ {item.title}
|
|
259
|
+ </Select.Option>
|
|
260
|
+ );
|
|
261
|
+ })}
|
262
|
262
|
</Select>
|
263
|
263
|
</Form.Item>
|
|
264
|
+ ),
|
264
|
265
|
},
|
265
|
266
|
{
|
266
|
267
|
title: (
|
267
|
268
|
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
268
|
|
- <span className='parameter-setting-table-title'>默认值</span>
|
|
269
|
+ <span className="parameter-setting-table-title">默认值</span>
|
269
|
270
|
</div>
|
270
|
271
|
),
|
271
|
272
|
dataIndex: 'valueMapping',
|
272
|
273
|
className: 'ps-table-cell',
|
273
|
274
|
width: '116px',
|
274
|
275
|
key: 'valueMapping',
|
275
|
|
- render: (text, record) =>
|
|
276
|
+ render: (text, record) => (
|
276
|
277
|
<div className="editable-cell ">
|
277
|
278
|
<QxFieldSetter
|
278
|
279
|
disabled={record.disabled || typeDis}
|
...
|
...
|
@@ -292,14 +293,14 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
292
|
293
|
inputDis={true}
|
293
|
294
|
/>
|
294
|
295
|
</div>
|
|
296
|
+ ),
|
295
|
297
|
},
|
296
|
298
|
{
|
297
|
|
- title:
|
298
|
|
- (
|
299
|
|
- <div style={{ display: 'flex', flexDirection: 'row' }}>
|
300
|
|
- <span className='parameter-setting-table-title'>参数说明</span>
|
301
|
|
- </div>
|
302
|
|
- ),
|
|
299
|
+ title: (
|
|
300
|
+ <div style={{ display: 'flex', flexDirection: 'row' }}>
|
|
301
|
+ <span className="parameter-setting-table-title">参数说明</span>
|
|
302
|
+ </div>
|
|
303
|
+ ),
|
303
|
304
|
dataIndex: 'description',
|
304
|
305
|
className: 'ps-table-cell',
|
305
|
306
|
key: 'description',
|
...
|
...
|
@@ -308,7 +309,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
308
|
309
|
<Form.Item
|
309
|
310
|
name={'description' + record.id}
|
310
|
311
|
style={{ margin: 0 }}
|
311
|
|
- // initialValue={text}
|
|
312
|
+ // initialValue={text}
|
312
|
313
|
>
|
313
|
314
|
<Input
|
314
|
315
|
draggable={true}
|
...
|
...
|
@@ -319,23 +320,24 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
319
|
320
|
key={inputKey}
|
320
|
321
|
defaultValue={text}
|
321
|
322
|
bordered={false}
|
322
|
|
- disabled={record.disabled || typeDis} onBlur={(e) => handleChange(e, record, 'description')} />
|
|
323
|
+ disabled={record.disabled || typeDis}
|
|
324
|
+ onBlur={(e) => handleChange(e, record, 'description')}
|
|
325
|
+ />
|
323
|
326
|
</Form.Item>
|
324
|
327
|
),
|
325
|
328
|
},
|
326
|
329
|
{
|
327
|
|
- title:
|
328
|
|
- (
|
329
|
|
- <div style={{ display: 'flex', flexDirection: 'row' }}>
|
330
|
|
- <span className='parameter-setting-table-title'>操作</span>
|
331
|
|
- </div>
|
332
|
|
- ),
|
|
330
|
+ title: (
|
|
331
|
+ <div style={{ display: 'flex', flexDirection: 'row' }}>
|
|
332
|
+ <span className="parameter-setting-table-title">操作</span>
|
|
333
|
+ </div>
|
|
334
|
+ ),
|
333
|
335
|
key: 'action',
|
334
|
336
|
className: 'ps-table-cell',
|
335
|
337
|
width: '96px',
|
336
|
338
|
render: (text, record) => {
|
337
|
|
- const isShowAdd = (record && checkShowAdd(record));
|
338
|
|
- const isShowTree = (record && checkShowTree(record));
|
|
339
|
+ const isShowAdd = record && checkShowAdd(record);
|
|
340
|
+ const isShowTree = record && checkShowTree(record);
|
339
|
341
|
return (
|
340
|
342
|
<Space size="small">
|
341
|
343
|
{isShowAdd && (
|
...
|
...
|
@@ -343,7 +345,9 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
343
|
345
|
size={'small'}
|
344
|
346
|
type="link"
|
345
|
347
|
disabled={record.disabled || typeDis}
|
346
|
|
- icon={<QxBaseIcon style={{ fontSize: 16 }} type={'qx-icon-plus'} />}
|
|
348
|
+ icon={
|
|
349
|
+ <QxBaseIcon style={{ fontSize: 16 }} type={'qx-icon-plus'} />
|
|
350
|
+ }
|
347
|
351
|
onClick={() => handleAdd(record.pid)}
|
348
|
352
|
/>
|
349
|
353
|
)}
|
...
|
...
|
@@ -353,7 +357,9 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
353
|
357
|
size={'small'}
|
354
|
358
|
type="link"
|
355
|
359
|
disabled={record.disabled || typeDis}
|
356
|
|
- icon={<Icon style={{ fontSize: 16 }} component={SubNodeIcon} />}
|
|
360
|
+ icon={
|
|
361
|
+ <Icon style={{ fontSize: 16 }} component={SubNodeIcon} />
|
|
362
|
+ }
|
357
|
363
|
onClick={() => handleAddTree(record.id)}
|
358
|
364
|
/>
|
359
|
365
|
)}
|
...
|
...
|
@@ -362,7 +368,13 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
362
|
368
|
type="link"
|
363
|
369
|
className="btn-high-del"
|
364
|
370
|
disabled={record.disabled || typeDis}
|
365
|
|
- icon={<QxBaseIcon style={{ fontSize: 16 }} className={'title-btn-del-btn'} type={'qx-icon-delete'} />}
|
|
371
|
+ icon={
|
|
372
|
+ <QxBaseIcon
|
|
373
|
+ style={{ fontSize: 16 }}
|
|
374
|
+ className={'title-btn-del-btn'}
|
|
375
|
+ type={'qx-icon-delete'}
|
|
376
|
+ />
|
|
377
|
+ }
|
366
|
378
|
onClick={() => handleDelete(record)}
|
367
|
379
|
/>
|
368
|
380
|
</Space>
|
...
|
...
|
@@ -372,12 +384,11 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
372
|
384
|
];
|
373
|
385
|
|
374
|
386
|
const range = {
|
375
|
|
- title:
|
376
|
|
- (
|
377
|
|
- <div style={{ display: 'flex', flexDirection: 'row' }}>
|
378
|
|
- <span className='parameter-setting-table-title'>取值范围</span>
|
379
|
|
- </div>
|
380
|
|
- ),
|
|
387
|
+ title: (
|
|
388
|
+ <div style={{ display: 'flex', flexDirection: 'row' }}>
|
|
389
|
+ <span className="parameter-setting-table-title">取值范围</span>
|
|
390
|
+ </div>
|
|
391
|
+ ),
|
381
|
392
|
dataIndex: 'qxProps',
|
382
|
393
|
className: 'ps-table-cell',
|
383
|
394
|
width: '314px',
|
...
|
...
|
@@ -386,10 +397,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
386
|
397
|
switch (record.type) {
|
387
|
398
|
case 'STRING':
|
388
|
399
|
return (
|
389
|
|
- <div
|
390
|
|
- key={record.id}
|
391
|
|
- className="editable-cell"
|
392
|
|
- >
|
|
400
|
+ <div key={record.id} className="editable-cell">
|
393
|
401
|
<InputNumber
|
394
|
402
|
draggable={true}
|
395
|
403
|
disabled={record.disabled || typeDis}
|
...
|
...
|
@@ -404,7 +412,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
404
|
412
|
defaultValue={qxProps?.min || undefined}
|
405
|
413
|
placeholder="最小长度"
|
406
|
414
|
/>
|
407
|
|
- <div className='range-cell'>-</div>
|
|
415
|
+ <div className="range-cell">-</div>
|
408
|
416
|
<InputNumber
|
409
|
417
|
draggable={true}
|
410
|
418
|
disabled={record.disabled || typeDis}
|
...
|
...
|
@@ -423,11 +431,8 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
423
|
431
|
);
|
424
|
432
|
case 'NUMBER':
|
425
|
433
|
return (
|
426
|
|
- <div
|
427
|
|
- key={record.id}
|
428
|
|
- className="editable-cell"
|
429
|
|
- >
|
430
|
|
- <div className='range-cell'>
|
|
434
|
+ <div key={record.id} className="editable-cell">
|
|
435
|
+ <div className="range-cell">
|
431
|
436
|
<InputNumber
|
432
|
437
|
disabled={record.disabled || typeDis}
|
433
|
438
|
draggable={true}
|
...
|
...
|
@@ -437,7 +442,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
437
|
442
|
}}
|
438
|
443
|
precision={qxProps.precision || 0}
|
439
|
444
|
bordered={false}
|
440
|
|
- size='small'
|
|
445
|
+ size="small"
|
441
|
446
|
defaultValue={qxProps?.min || undefined}
|
442
|
447
|
onBlur={(e) => handleChange(e, record, 'qxProps-min')}
|
443
|
448
|
// style={{ width: '110px' }}
|
...
|
...
|
@@ -452,7 +457,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
452
|
457
|
event.preventDefault();
|
453
|
458
|
}}
|
454
|
459
|
bordered={false}
|
455
|
|
- size='small'
|
|
460
|
+ size="small"
|
456
|
461
|
precision={qxProps.precision || 0}
|
457
|
462
|
defaultValue={qxProps.max || undefined}
|
458
|
463
|
onBlur={(e) => handleChange(e, record, 'qxProps-max')}
|
...
|
...
|
@@ -461,8 +466,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
461
|
466
|
/>
|
462
|
467
|
<Divider type="vertical" style={{ height: '16px' }} />
|
463
|
468
|
</div>
|
464
|
|
- <div className='range-cell'>
|
465
|
|
-
|
|
469
|
+ <div className="range-cell">
|
466
|
470
|
<InputNumber
|
467
|
471
|
disabled={record.disabled || typeDis}
|
468
|
472
|
draggable={true}
|
...
|
...
|
@@ -471,7 +475,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
471
|
475
|
event.preventDefault();
|
472
|
476
|
}}
|
473
|
477
|
bordered={false}
|
474
|
|
- size='small'
|
|
478
|
+ size="small"
|
475
|
479
|
precision={0}
|
476
|
480
|
min={0}
|
477
|
481
|
max={8}
|
...
|
...
|
@@ -484,20 +488,13 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
484
|
488
|
);
|
485
|
489
|
case 'TIME':
|
486
|
490
|
return (
|
487
|
|
- <div
|
488
|
|
- key={record.id}
|
489
|
|
- className="editable-cell"
|
490
|
|
- >
|
491
|
|
- <div className='range-cell'>
|
|
491
|
+ <div key={record.id} className="editable-cell">
|
|
492
|
+ <div className="range-cell">
|
492
|
493
|
<DatePicker
|
493
|
494
|
bordered={false}
|
494
|
495
|
disabled={record.disabled || typeDis}
|
495
|
|
- size='small'
|
496
|
|
- defaultValue={
|
497
|
|
- qxProps?.min
|
498
|
|
- ? moment(qxProps.min)
|
499
|
|
- : undefined
|
500
|
|
- }
|
|
496
|
+ size="small"
|
|
497
|
+ defaultValue={qxProps?.min ? moment(qxProps.min) : undefined}
|
501
|
498
|
format={formatEnum[qxProps?.format] || 'YYYY-MM-DD'}
|
502
|
499
|
// style={{ width: '110px' }}
|
503
|
500
|
showTime
|
...
|
...
|
@@ -507,13 +504,9 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
507
|
504
|
-
|
508
|
505
|
<DatePicker
|
509
|
506
|
disabled={record.disabled || typeDis}
|
510
|
|
- size='small'
|
|
507
|
+ size="small"
|
511
|
508
|
bordered={false}
|
512
|
|
- defaultValue={
|
513
|
|
- qxProps?.max
|
514
|
|
- ? moment(qxProps.max)
|
515
|
|
- : undefined
|
516
|
|
- }
|
|
509
|
+ defaultValue={qxProps?.max ? moment(qxProps.max) : undefined}
|
517
|
510
|
format={formatEnum[qxProps?.format] || 'YYYY-MM-DD'}
|
518
|
511
|
// style={{ width: '110px' }}
|
519
|
512
|
showTime
|
...
|
...
|
@@ -522,18 +515,16 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
522
|
515
|
/>
|
523
|
516
|
<Divider type="vertical" style={{ height: '16px' }} />
|
524
|
517
|
</div>
|
525
|
|
- <div className='range-cell'>
|
|
518
|
+ <div className="range-cell">
|
526
|
519
|
<Select
|
527
|
520
|
disabled={record.disabled || typeDis}
|
528
|
|
- size='small'
|
|
521
|
+ size="small"
|
529
|
522
|
// style={{ width: '90px' }}
|
530
|
523
|
bordered={false}
|
531
|
524
|
placeholder="格式"
|
532
|
525
|
popupMatchSelectWidth={false}
|
533
|
526
|
defaultValue={qxProps?.format || 'YEAR_DATE'}
|
534
|
|
- onSelect={(e) =>
|
535
|
|
- handleChange(e, record, 'qxProps-format')
|
536
|
|
- }
|
|
527
|
+ onSelect={(e) => handleChange(e, record, 'qxProps-format')}
|
537
|
528
|
>
|
538
|
529
|
{timeFormat.map((item) => {
|
539
|
530
|
return (
|
...
|
...
|
@@ -554,10 +545,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
554
|
545
|
case 'USER':
|
555
|
546
|
case 'ORG':
|
556
|
547
|
return (
|
557
|
|
- <div
|
558
|
|
- className='editable-cell'
|
559
|
|
- key={record.id}
|
560
|
|
- >
|
|
548
|
+ <div className="editable-cell" key={record.id}>
|
561
|
549
|
<QxFormSelect
|
562
|
550
|
value={qxProps}
|
563
|
551
|
appId={props?.appId}
|
...
|
...
|
@@ -566,7 +554,11 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
566
|
554
|
onChange={(val: any) => {
|
567
|
555
|
handleChange(val, record, 'qxProps');
|
568
|
556
|
}}
|
569
|
|
- disabled={['USER', 'ORG'].includes(record.type) || record.disabled || typeDis}
|
|
557
|
+ disabled={
|
|
558
|
+ ['USER', 'ORG'].includes(record.type) ||
|
|
559
|
+ record.disabled ||
|
|
560
|
+ typeDis
|
|
561
|
+ }
|
570
|
562
|
request={props?.request}
|
571
|
563
|
/>
|
572
|
564
|
</div>
|
...
|
...
|
@@ -577,21 +569,17 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
577
|
569
|
};
|
578
|
570
|
|
579
|
571
|
const require = {
|
580
|
|
- title:
|
581
|
|
- (
|
582
|
|
- <div style={{ display: 'flex', flexDirection: 'row' }}>
|
583
|
|
- <span className='parameter-setting-table-title'>必填</span>
|
584
|
|
- </div>
|
585
|
|
- ),
|
|
572
|
+ title: (
|
|
573
|
+ <div style={{ display: 'flex', flexDirection: 'row' }}>
|
|
574
|
+ <span className="parameter-setting-table-title">必填</span>
|
|
575
|
+ </div>
|
|
576
|
+ ),
|
586
|
577
|
dataIndex: 'required',
|
587
|
578
|
className: 'ps-table-cell',
|
588
|
579
|
key: 'required',
|
589
|
580
|
width: '86px',
|
590
|
581
|
render: (text, record) => (
|
591
|
|
- <Form.Item
|
592
|
|
- name={'required' + record.id}
|
593
|
|
- style={{ margin: 0 }}
|
594
|
|
- >
|
|
582
|
+ <Form.Item name={'required' + record.id} style={{ margin: 0 }}>
|
595
|
583
|
<Select
|
596
|
584
|
defaultValue={text || false}
|
597
|
585
|
bordered={false}
|
...
|
...
|
@@ -601,12 +589,12 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
601
|
589
|
<Select.Option value={true}>是</Select.Option>
|
602
|
590
|
<Select.Option value={false}>否</Select.Option>
|
603
|
591
|
</Select>
|
604
|
|
- </Form.Item >
|
|
592
|
+ </Form.Item>
|
605
|
593
|
),
|
606
|
594
|
};
|
607
|
595
|
|
608
|
596
|
if (nodeType !== 'END') {
|
609
|
|
- columns.splice(3, 0, range, require)
|
|
597
|
+ columns.splice(3, 0, range, require);
|
610
|
598
|
}
|
611
|
599
|
|
612
|
600
|
// const isDeveloper = window.sessionStorage.getItem('DEVELOPER_MODE') === '1';
|
...
|
...
|
@@ -618,7 +606,6 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
618
|
606
|
handleAdd('');
|
619
|
607
|
}
|
620
|
608
|
}
|
621
|
|
-
|
622
|
609
|
}, [visible]);
|
623
|
610
|
|
624
|
611
|
//展开 所有子节点
|
...
|
...
|
@@ -648,7 +635,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
648
|
635
|
style: { cursor: 'move' },
|
649
|
636
|
onDragStart: (ev: any) => {
|
650
|
637
|
ev.persist();
|
651
|
|
- console.log('onDragStart', ev.target)
|
|
638
|
+ console.log('onDragStart', ev.target);
|
652
|
639
|
ev.dataTransfer.effectAllowed = 'move';
|
653
|
640
|
ev.dataTransfer.setData('text', ev.target.getAttribute('data-row-key'));
|
654
|
641
|
},
|
...
|
...
|
@@ -797,8 +784,8 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
797
|
784
|
/>
|
798
|
785
|
}
|
799
|
786
|
>
|
800
|
|
- {!type && (
|
801
|
|
- isShowJson ? (
|
|
787
|
+ {!type &&
|
|
788
|
+ (isShowJson ? (
|
802
|
789
|
<Row>
|
803
|
790
|
<Col span={12}>
|
804
|
791
|
<Button
|
...
|
...
|
@@ -816,7 +803,12 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
816
|
803
|
<Button
|
817
|
804
|
size={'small'}
|
818
|
805
|
type="link"
|
819
|
|
- icon={<QxBaseIcon style={{ fontSize: 16 }} type={'qx-icon-flow-code'} />}
|
|
806
|
+ icon={
|
|
807
|
+ <QxBaseIcon
|
|
808
|
+ style={{ fontSize: 16 }}
|
|
809
|
+ type={'qx-icon-flow-code'}
|
|
810
|
+ />
|
|
811
|
+ }
|
820
|
812
|
style={{
|
821
|
813
|
padding: 0,
|
822
|
814
|
height: '32px',
|
...
|
...
|
@@ -846,69 +838,68 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
846
|
838
|
/>
|
847
|
839
|
</Col>
|
848
|
840
|
</Row>
|
849
|
|
- )
|
850
|
|
- )
|
851
|
|
- }
|
852
|
|
- {
|
853
|
|
- isShowJson ? (
|
854
|
|
- <>
|
855
|
|
- <JSONEditor value={midData} onChange={onJsonChange} />
|
856
|
|
- <Col
|
857
|
|
- className="border-none"
|
858
|
|
- span={24}
|
859
|
|
- style={{
|
860
|
|
- display: 'flex',
|
861
|
|
- flexDirection: 'row-reverse',
|
862
|
|
- marginBottom: '10px',
|
863
|
|
- textAlign: 'center',
|
864
|
|
- }}
|
865
|
|
- >
|
866
|
|
- <Space>
|
867
|
|
- <Button onClick={() => onCancel()}>{'取消'}</Button>
|
868
|
|
- <Button type="primary" onClick={() => submit()}>
|
869
|
|
- {'确定'}
|
870
|
|
- </Button>
|
871
|
|
- </Space>
|
872
|
|
- </Col>
|
873
|
|
- </>
|
874
|
|
- ) : (
|
875
|
|
- <Table
|
876
|
|
- expandable={{
|
877
|
|
- defaultExpandAllRows: true,
|
878
|
|
- childrenColumnName: 'child',
|
879
|
|
- expandIcon: ({ expanded, onExpand, record }) =>
|
880
|
|
- record.child && record.child.length > 0 && expanded ? (
|
881
|
|
- <>
|
882
|
|
- <Icon component={SubDropIcon}
|
883
|
|
- className='drop-icon' />
|
884
|
|
- <QxBaseIcon className={'table-expanded'} type={'qx-caret-down'} onClick={e => onExpand(record, e)} />
|
885
|
|
- </>
|
886
|
|
-
|
887
|
|
- ) : record.child && record.child.length > 0 && !expanded ?
|
888
|
|
- (
|
889
|
|
- <>
|
890
|
|
- <Icon component={SubDropIcon}
|
891
|
|
- className='drop-icon' />
|
892
|
|
- <QxBaseIcon className={'table-expanded-change'} type={'qx-caret-down'} onClick={e => onExpand(record, e)} />
|
893
|
|
- </>
|
894
|
|
- )
|
895
|
|
- :
|
896
|
|
- <Icon component={SubDropIcon}
|
897
|
|
- className='drop-icon' />
|
|
841
|
+ ))}
|
|
842
|
+ {isShowJson ? (
|
|
843
|
+ <>
|
|
844
|
+ <JSONEditor value={midData} onChange={onJsonChange} />
|
|
845
|
+ <Col
|
|
846
|
+ className="border-none"
|
|
847
|
+ span={24}
|
|
848
|
+ style={{
|
|
849
|
+ display: 'flex',
|
|
850
|
+ flexDirection: 'row-reverse',
|
|
851
|
+ marginBottom: '10px',
|
|
852
|
+ textAlign: 'center',
|
898
|
853
|
}}
|
899
|
|
- className='parameter-setting-table'
|
900
|
|
- onRow={() => onRow()}
|
901
|
|
- scroll={{ x: 1000, y: 432 }}
|
902
|
|
- bordered
|
903
|
|
- pagination={false}
|
904
|
|
- size={'small'}
|
905
|
|
- // @ts-ignore
|
906
|
|
- columns={columns}
|
907
|
|
- dataSource={data}
|
908
|
|
- rowKey={'id'}
|
909
|
|
- />
|
910
|
|
- )
|
911
|
|
- }
|
|
854
|
+ >
|
|
855
|
+ <Space>
|
|
856
|
+ <Button onClick={() => onCancel()}>{'取消'}</Button>
|
|
857
|
+ <Button type="primary" onClick={() => submit()}>
|
|
858
|
+ {'确定'}
|
|
859
|
+ </Button>
|
|
860
|
+ </Space>
|
|
861
|
+ </Col>
|
|
862
|
+ </>
|
|
863
|
+ ) : (
|
|
864
|
+ <Table
|
|
865
|
+ expandable={{
|
|
866
|
+ defaultExpandAllRows: true,
|
|
867
|
+ childrenColumnName: 'child',
|
|
868
|
+ expandIcon: ({ expanded, onExpand, record }) =>
|
|
869
|
+ record.child && record.child.length > 0 && expanded ? (
|
|
870
|
+ <>
|
|
871
|
+ <Icon component={SubDropIcon} className="drop-icon" />
|
|
872
|
+ <QxBaseIcon
|
|
873
|
+ className={'table-expanded'}
|
|
874
|
+ type={'qx-caret-down'}
|
|
875
|
+ onClick={(e) => onExpand(record, e)}
|
|
876
|
+ />
|
|
877
|
+ </>
|
|
878
|
+ ) : record.child && record.child.length > 0 && !expanded ? (
|
|
879
|
+ <>
|
|
880
|
+ <Icon component={SubDropIcon} className="drop-icon" />
|
|
881
|
+ <QxBaseIcon
|
|
882
|
+ className={'table-expanded-change'}
|
|
883
|
+ type={'qx-caret-down'}
|
|
884
|
+ onClick={(e) => onExpand(record, e)}
|
|
885
|
+ />
|
|
886
|
+ </>
|
|
887
|
+ ) : (
|
|
888
|
+ <Icon component={SubDropIcon} className="drop-icon" />
|
|
889
|
+ ),
|
|
890
|
+ }}
|
|
891
|
+ className="parameter-setting-table"
|
|
892
|
+ onRow={onRow}
|
|
893
|
+ scroll={{ x: 1000, y: 432 }}
|
|
894
|
+ bordered
|
|
895
|
+ pagination={false}
|
|
896
|
+ size={'small'}
|
|
897
|
+ // @ts-ignore
|
|
898
|
+ columns={columns}
|
|
899
|
+ dataSource={data}
|
|
900
|
+ rowKey={'id'}
|
|
901
|
+ />
|
|
902
|
+ )}
|
912
|
903
|
</Modal>
|
913
|
904
|
</>
|
914
|
905
|
);
|
...
|
...
|
|