|
@@ -27,7 +27,7 @@ import React, { |
|
@@ -27,7 +27,7 @@ import React, { |
27
|
} from 'react';
|
27
|
} from 'react';
|
28
|
import JSONEditor from './codeMirror';
|
28
|
import JSONEditor from './codeMirror';
|
29
|
import './style.less';
|
29
|
import './style.less';
|
30
|
-import { QxFieldSetter, QxFormSelect, ValueOptionProps } from '@qx/common';
|
30
|
+import { QxFieldSetter, QxFormSelect } from '@qx/common';
|
31
|
import { formatEnum } from './constant';
|
31
|
import { formatEnum } from './constant';
|
32
|
import {
|
32
|
import {
|
33
|
typeTranslateFieIdtype,
|
33
|
typeTranslateFieIdtype,
|
|
@@ -40,7 +40,12 @@ import { cloneDeep, debounce, isEmpty } from 'lodash-es'; |
|
@@ -40,7 +40,12 @@ import { cloneDeep, debounce, isEmpty } from 'lodash-es'; |
40
|
import moment from 'dayjs';
|
40
|
import moment from 'dayjs';
|
41
|
import { QxBaseIcon } from '@qx/common';
|
41
|
import { QxBaseIcon } from '@qx/common';
|
42
|
import Icon from '@ant-design/icons';
|
42
|
import Icon from '@ant-design/icons';
|
43
|
-import {SubNodeIcon} from './sub-node-icon';
|
43
|
+import { SubNodeIcon } from './sub-node-icon';
|
|
|
44
|
+
|
|
|
45
|
+type ValueOptionProps = {
|
|
|
46
|
+ key: number | string;
|
|
|
47
|
+ value: string;
|
|
|
48
|
+};
|
44
|
|
49
|
|
45
|
const valueOptions = [
|
50
|
const valueOptions = [
|
46
|
{ key: 'STRING', title: '文本' },
|
51
|
{ key: 'STRING', title: '文本' },
|
|
@@ -49,20 +54,20 @@ const valueOptions = [ |
|
@@ -49,20 +54,20 @@ const valueOptions = [ |
49
|
{ key: 'BOOL', title: '布尔' },
|
54
|
{ key: 'BOOL', title: '布尔' },
|
50
|
{ key: 'OBJECT', title: '对象' },
|
55
|
{ key: 'OBJECT', title: '对象' },
|
51
|
{ key: 'ARRAY', title: '数组' },
|
56
|
{ key: 'ARRAY', title: '数组' },
|
52
|
- { key: 'ANNEX', title: '附件' },
|
|
|
53
|
- { key: 'PIC', title: '图片' },
|
57
|
+ /*{ key: 'ANNEX', title: '附件' },
|
|
|
58
|
+ { key: 'PIC', title: '图片' },*/
|
54
|
{ key: 'FORM', title: '表单' },
|
59
|
{ key: 'FORM', title: '表单' },
|
55
|
{ key: 'USER', title: '人员' },
|
60
|
{ key: 'USER', title: '人员' },
|
56
|
{ key: 'ORG', title: '部门' },
|
61
|
{ key: 'ORG', title: '部门' },
|
57
|
];
|
62
|
];
|
58
|
|
63
|
|
59
|
const timeFormat = [
|
64
|
const timeFormat = [
|
60
|
- { lable: '年', value: 'YEAR' },
|
|
|
61
|
- { lable: '年-月', value: 'YEAR_MONTH' },
|
|
|
62
|
- { lable: '年-月-日', value: 'YEAR_DATE' },
|
|
|
63
|
- { lable: '年-月-日 时', value: 'YEAR_HOUR' },
|
|
|
64
|
- { lable: '年-月-日 时:分', value: 'YEAR_MIN' },
|
|
|
65
|
- { lable: '年-月-日 时:分:秒', value: 'YEAR_SEC' },
|
65
|
+ { label: '年', value: 'YEAR' },
|
|
|
66
|
+ { label: '年-月', value: 'YEAR_MONTH' },
|
|
|
67
|
+ { label: '年-月-日', value: 'YEAR_DATE' },
|
|
|
68
|
+ { label: '年-月-日 时', value: 'YEAR_HOUR' },
|
|
|
69
|
+ { label: '年-月-日 时:分', value: 'YEAR_MIN' },
|
|
|
70
|
+ { label: '年-月-日 时:分:秒', value: 'YEAR_SEC' },
|
66
|
];
|
71
|
];
|
67
|
|
72
|
|
68
|
interface ParameterSettingProps {
|
73
|
interface ParameterSettingProps {
|
|
@@ -79,7 +84,8 @@ interface ParameterSettingProps { |
|
@@ -79,7 +84,8 @@ interface ParameterSettingProps { |
79
|
handleAdd: (val: any) => void;
|
84
|
handleAdd: (val: any) => void;
|
80
|
handleDelete: (val: any) => void;
|
85
|
handleDelete: (val: any) => void;
|
81
|
appFormList?: any[]; // 当前应用表单list
|
86
|
appFormList?: any[]; // 当前应用表单list
|
82
|
- request?: any,
|
87
|
+ request?: any;
|
|
|
88
|
+ nodeType?: string | 'START' | 'END';
|
83
|
}
|
89
|
}
|
84
|
const EditableContext = React.createContext<FormInstance<any> | null>(null);
|
90
|
const EditableContext = React.createContext<FormInstance<any> | null>(null);
|
85
|
|
91
|
|
|
@@ -120,10 +126,9 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -120,10 +126,9 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
120
|
handleChange,
|
126
|
handleChange,
|
121
|
handleChangeField,
|
127
|
handleChangeField,
|
122
|
inputKey,
|
128
|
inputKey,
|
|
|
129
|
+ nodeType,
|
123
|
} = props;
|
130
|
} = props;
|
124
|
- console.log('data', data);
|
|
|
125
|
// const [form] = Form.useForm()
|
131
|
// const [form] = Form.useForm()
|
126
|
-
|
|
|
127
|
//判断数组是否只有一个子节点
|
132
|
//判断数组是否只有一个子节点
|
128
|
const checkShowAdd = (_data: any) => {
|
133
|
const checkShowAdd = (_data: any) => {
|
129
|
const _newTreeData = cloneDeep(treeData);
|
134
|
const _newTreeData = cloneDeep(treeData);
|
|
@@ -139,7 +144,6 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -139,7 +144,6 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
139
|
};
|
144
|
};
|
140
|
|
145
|
|
141
|
const checkShowTree = (_data: any) => {
|
146
|
const checkShowTree = (_data: any) => {
|
142
|
- // console.log('_data', _data)
|
|
|
143
|
if (_data.type == 'ARRAY') {
|
147
|
if (_data.type == 'ARRAY') {
|
144
|
if (_data.child && _data.child.length > 0) {
|
148
|
if (_data.child && _data.child.length > 0) {
|
145
|
return false;
|
149
|
return false;
|
|
@@ -157,7 +161,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -157,7 +161,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
157
|
</div>
|
161
|
</div>
|
158
|
),
|
162
|
),
|
159
|
dataIndex: 'code',
|
163
|
dataIndex: 'code',
|
160
|
- width: '15%',
|
164
|
+ width: '12%',
|
161
|
editable: true,
|
165
|
editable: true,
|
162
|
key: 'code',
|
166
|
key: 'code',
|
163
|
// render: (text, record) => (
|
167
|
// render: (text, record) => (
|
|
@@ -185,7 +189,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -185,7 +189,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
185
|
</div>
|
189
|
</div>
|
186
|
),
|
190
|
),
|
187
|
dataIndex: 'title',
|
191
|
dataIndex: 'title',
|
188
|
- width: '15%',
|
192
|
+ width: '12%',
|
189
|
editable: true,
|
193
|
editable: true,
|
190
|
key: 'title',
|
194
|
key: 'title',
|
191
|
// render: (text, record) => (
|
195
|
// render: (text, record) => (
|
|
@@ -239,83 +243,44 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -239,83 +243,44 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
239
|
// </Form.Item>
|
243
|
// </Form.Item>
|
240
|
},
|
244
|
},
|
241
|
{
|
245
|
{
|
242
|
- title: '取值范围',
|
|
|
243
|
- dataIndex: 'qxProps',
|
|
|
244
|
- editable: true,
|
|
|
245
|
- key: 'qxProps',
|
|
|
246
|
- render: (text: any, record: any) => {
|
|
|
247
|
- console.log('record ====', record);
|
|
|
248
|
- console.log('text ====', text);
|
|
|
249
|
- return (
|
|
|
250
|
- <>
|
|
|
251
|
- {record.type === 'FORM' ? <>
|
|
|
252
|
- <div key={record.id}>
|
|
|
253
|
- <span>
|
|
|
254
|
- {text?.name}
|
|
|
255
|
- </span>
|
|
|
256
|
- </div>
|
|
|
257
|
- </> : <>
|
|
|
258
|
- <div key={record.id}>
|
|
|
259
|
- <span>{record.type == 'TIME' ? moment(text?.min).format(
|
|
|
260
|
- formatEnum[text?.format] || 'YYYY-MM-DD') : text?.min}
|
|
|
261
|
- </span>
|
|
|
262
|
- {text?.min && (
|
|
|
263
|
- <Space style={{ marginLeft: 5, marginRight: 5 }}>-</Space>
|
|
|
264
|
- )}
|
|
|
265
|
- <span>{record.type == 'TIME' ? moment(text?.max).format(
|
|
|
266
|
- formatEnum[text?.format] || 'YYYY-MM-DD') : text?.max}
|
|
|
267
|
- </span>
|
|
|
268
|
- </div>
|
|
|
269
|
- </>}
|
|
|
270
|
- </>
|
|
|
271
|
- )
|
|
|
272
|
- },
|
|
|
273
|
- },
|
|
|
274
|
- {
|
|
|
275
|
- title: '必填',
|
|
|
276
|
- dataIndex: 'required',
|
|
|
277
|
- editable: true,
|
|
|
278
|
- key: 'required',
|
|
|
279
|
- width: '5%',
|
|
|
280
|
- render: (text, record) => (
|
|
|
281
|
- <span key={record.id}>{text ? '是' : '否'}</span>
|
|
|
282
|
- // <Form.Item
|
|
|
283
|
- // name={'required' + record.id}
|
|
|
284
|
- // initialValue={record.required}
|
|
|
285
|
- // >
|
|
|
286
|
- // <Select
|
|
|
287
|
- // disabled={record.disabled}
|
|
|
288
|
- // onSelect={(e) => props.handleChange(e, record, 'required')}
|
|
|
289
|
- // >
|
|
|
290
|
- // <Select.Option value={true}>是</Select.Option>
|
|
|
291
|
- // <Select.Option value={false}>否</Select.Option>
|
|
|
292
|
- // </Select>
|
|
|
293
|
- // </Form.Item>
|
|
|
294
|
- ),
|
|
|
295
|
- },
|
|
|
296
|
- {
|
|
|
297
|
title: '默认值',
|
246
|
title: '默认值',
|
298
|
- dataIndex: 'qxProps',
|
|
|
299
|
- width: '10%',
|
247
|
+ dataIndex: 'mappingValues',
|
|
|
248
|
+ width: '15%',
|
300
|
editable: true,
|
249
|
editable: true,
|
301
|
- key: 'qxProps',
|
|
|
302
|
- render: (text, record) => (
|
|
|
303
|
- // console.log('text', text)
|
|
|
304
|
- <span key={record.id}>{text?.default}</span>
|
250
|
+ key: 'mappingValues',
|
|
|
251
|
+ render: (text) =>
|
|
|
252
|
+ text || [].map((item) => {
|
|
|
253
|
+ // if (item.indexOf('-') > -1) {
|
|
|
254
|
+ // if (text == item.key) {
|
|
|
255
|
+ return <span key={item}>{item.indexOf('-') > -1 ? item : ''}</span>;
|
|
|
256
|
+ // }
|
|
|
257
|
+ }),
|
|
|
258
|
+ // }
|
305
|
|
259
|
|
306
|
- // <Form.Item
|
|
|
307
|
- // name={'default' + record.id}
|
|
|
308
|
- // initialValue={text?.default}
|
|
|
309
|
- // >
|
|
|
310
|
- // <Input disabled={record.disabled} onBlur={(e) => props.handleChange(e, record, 'qxProps-default')} />
|
|
|
311
|
- // </Form.Item>
|
|
|
312
|
- ),
|
260
|
+ // }
|
|
|
261
|
+ // )
|
|
|
262
|
+ // text || [].map((item ) => {
|
|
|
263
|
+ // return console.log('123', item.indexOf('-'))
|
|
|
264
|
+ // if (item.indexOf('-') > -1) {
|
|
|
265
|
+
|
|
|
266
|
+ // <span key={item.type + record.id}>{item.value}</span>;
|
|
|
267
|
+ // }
|
|
|
268
|
+ // }),
|
|
|
269
|
+ // console.log('text', text)
|
|
|
270
|
+ // <span key={record.id}>{text?.default}</span>
|
|
|
271
|
+
|
|
|
272
|
+ // <Form.Item
|
|
|
273
|
+ // name={'default' + record.id}
|
|
|
274
|
+ // initialValue={text?.default}
|
|
|
275
|
+ // >
|
|
|
276
|
+ // <Input disabled={record.disabled} onBlur={(e) => props.handleChange(e, record, 'qxProps-default')} />
|
|
|
277
|
+ // </Form.Item>
|
|
|
278
|
+ // ),
|
313
|
},
|
279
|
},
|
314
|
{
|
280
|
{
|
315
|
title: '参数说明',
|
281
|
title: '参数说明',
|
316
|
dataIndex: 'description',
|
282
|
dataIndex: 'description',
|
317
|
editable: true,
|
283
|
editable: true,
|
318
|
- width: '10%',
|
|
|
319
|
key: 'description',
|
284
|
key: 'description',
|
320
|
render: (text, record) => (
|
285
|
render: (text, record) => (
|
321
|
<span key={record.id}>{text}</span>
|
286
|
<span key={record.id}>{text}</span>
|
|
@@ -371,6 +336,65 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -371,6 +336,65 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
371
|
},
|
336
|
},
|
372
|
];
|
337
|
];
|
373
|
|
338
|
|
|
|
339
|
+ const range = {
|
|
|
340
|
+ title: '取值范围',
|
|
|
341
|
+ dataIndex: 'qxProps',
|
|
|
342
|
+ editable: true,
|
|
|
343
|
+ key: 'qxProps',
|
|
|
344
|
+ render: (text: any, record: any) => {
|
|
|
345
|
+ return (
|
|
|
346
|
+ <>
|
|
|
347
|
+ {record.type === 'FORM' ? <>
|
|
|
348
|
+ <div key={record.id}>
|
|
|
349
|
+ <span>
|
|
|
350
|
+ {text?.name}
|
|
|
351
|
+ </span>
|
|
|
352
|
+ </div>
|
|
|
353
|
+ </> : <>
|
|
|
354
|
+ <div key={record.id}>
|
|
|
355
|
+ <span>{record.type == 'TIME' ? text?.min ? moment(text.min).format(
|
|
|
356
|
+ formatEnum[text?.format] || 'YYYY-MM-DD') : undefined : text?.min}
|
|
|
357
|
+ </span>
|
|
|
358
|
+ {!!text?.min || text?.min >= 0 && (
|
|
|
359
|
+ <Space style={{ marginLeft: 5, marginRight: 5 }}>-</Space>
|
|
|
360
|
+ )}
|
|
|
361
|
+ <span>{record.type == 'TIME' ? text?.max ? moment(text.max).format(
|
|
|
362
|
+ formatEnum[text?.format] || 'YYYY-MM-DD') : undefined : text?.max}
|
|
|
363
|
+ </span>
|
|
|
364
|
+ </div>
|
|
|
365
|
+ </>}
|
|
|
366
|
+ </>
|
|
|
367
|
+ )
|
|
|
368
|
+ },
|
|
|
369
|
+ };
|
|
|
370
|
+
|
|
|
371
|
+ const require = {
|
|
|
372
|
+ title: '必填',
|
|
|
373
|
+ dataIndex: 'required',
|
|
|
374
|
+ editable: true,
|
|
|
375
|
+ key: 'required',
|
|
|
376
|
+ width: '5%',
|
|
|
377
|
+ render: (text, record) => (
|
|
|
378
|
+ <span key={record.id}>{text ? '是' : '否'}</span>
|
|
|
379
|
+ // <Form.Item
|
|
|
380
|
+ // name={'required' + record.id}
|
|
|
381
|
+ // initialValue={record.required}
|
|
|
382
|
+ // >
|
|
|
383
|
+ // <Select
|
|
|
384
|
+ // disabled={record.disabled}
|
|
|
385
|
+ // onSelect={(e) => props.handleChange(e, record, 'required')}
|
|
|
386
|
+ // >
|
|
|
387
|
+ // <Select.Option value={true}>是</Select.Option>
|
|
|
388
|
+ // <Select.Option value={false}>否</Select.Option>
|
|
|
389
|
+ // </Select>
|
|
|
390
|
+ // </Form.Item>
|
|
|
391
|
+ ),
|
|
|
392
|
+ };
|
|
|
393
|
+
|
|
|
394
|
+ if (nodeType !== 'END') {
|
|
|
395
|
+ columns.splice(3, 0, range, require)
|
|
|
396
|
+ }
|
|
|
397
|
+
|
374
|
interface EditableRowProps {
|
398
|
interface EditableRowProps {
|
375
|
index: number;
|
399
|
index: number;
|
376
|
}
|
400
|
}
|
|
@@ -392,6 +416,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -392,6 +416,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
392
|
children: React.ReactNode;
|
416
|
children: React.ReactNode;
|
393
|
dataIndex: keyof any;
|
417
|
dataIndex: keyof any;
|
394
|
record: any;
|
418
|
record: any;
|
|
|
419
|
+ index: number;
|
395
|
// handleSave: (record: Item) => void;
|
420
|
// handleSave: (record: Item) => void;
|
396
|
}
|
421
|
}
|
397
|
|
422
|
|
|
@@ -409,12 +434,10 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -409,12 +434,10 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
409
|
const form = useContext(EditableContext)!;
|
434
|
const form = useContext(EditableContext)!;
|
410
|
const qxProps = record?.qxProps || {};
|
435
|
const qxProps = record?.qxProps || {};
|
411
|
const [currentNode, setCurrentNode] = useState<any>('');
|
436
|
const [currentNode, setCurrentNode] = useState<any>('');
|
412
|
- // console.log('dataIndex', dataIndex)
|
|
|
413
|
|
437
|
|
414
|
useEffect(() => {
|
438
|
useEffect(() => {
|
415
|
if (editing) {
|
439
|
if (editing) {
|
416
|
if (inputRef.current) {
|
440
|
if (inputRef.current) {
|
417
|
- // console.log('setEditing', inputRef)
|
|
|
418
|
inputRef.current!.focus();
|
441
|
inputRef.current!.focus();
|
419
|
}
|
442
|
}
|
420
|
}
|
443
|
}
|
|
@@ -434,7 +457,6 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -434,7 +457,6 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
434
|
const toggleEdit1 = (e) => {
|
457
|
const toggleEdit1 = (e) => {
|
435
|
const values = form.getFieldsValue();
|
458
|
const values = form.getFieldsValue();
|
436
|
e.persist();
|
459
|
e.persist();
|
437
|
- // console.log('vae.target.tagNamelues', e.target.tagName)
|
|
|
438
|
if (e.target.tagName == 'DIV') {
|
460
|
if (e.target.tagName == 'DIV') {
|
439
|
setCurrentNode(e.target)
|
461
|
setCurrentNode(e.target)
|
440
|
// console.log('values', values)
|
462
|
// console.log('values', values)
|
|
@@ -443,31 +465,8 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -443,31 +465,8 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
443
|
props.handleChange(values?.newQxProps, record, 'qxProps')
|
465
|
props.handleChange(values?.newQxProps, record, 'qxProps')
|
444
|
}
|
466
|
}
|
445
|
}
|
467
|
}
|
446
|
-
|
|
|
447
|
- // setCurrentNode(e.currentTarget)
|
|
|
448
|
- // console.log('e-onburl', e.currentTarget.key)
|
|
|
449
|
- //
|
|
|
450
|
- // if (e.currentTarget == e.target) {
|
|
|
451
|
- // // setEditing(!editing);
|
|
|
452
|
- // }
|
|
|
453
|
- // form.setFieldsValue({ [dataIndex]: record[dataIndex] });
|
|
|
454
|
};
|
468
|
};
|
455
|
|
469
|
|
456
|
- // const test = (value) => {
|
|
|
457
|
- // console.log('value', value)
|
|
|
458
|
- // // form.setFieldsValue({
|
|
|
459
|
- // // ['qxProps']: { value: value }
|
|
|
460
|
- // // })
|
|
|
461
|
- // }
|
|
|
462
|
- // const toggleEdit2 = (e) => {
|
|
|
463
|
- // e.persist();
|
|
|
464
|
- // // console.log('e-onforce', e.currentTarget)
|
|
|
465
|
-
|
|
|
466
|
- // // e.dataTransfer.setData('text', e.target.getAttribute('data-row-key'));
|
|
|
467
|
- // // console.log('currentTarget-fource', currentNode)
|
|
|
468
|
- // // form.setFieldsValue({ [dataIndex]: record[dataIndex] });
|
|
|
469
|
- // };
|
|
|
470
|
-
|
|
|
471
|
const save = async (code: string) => {
|
470
|
const save = async (code: string) => {
|
472
|
const isProps = code.indexOf('qxProps');
|
471
|
const isProps = code.indexOf('qxProps');
|
473
|
const _newCode = isProps > -1 ? code.slice(8) : '';
|
472
|
const _newCode = isProps > -1 ? code.slice(8) : '';
|
|
@@ -480,7 +479,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -480,7 +479,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
480
|
props.handleChange(newValue, record, code);
|
479
|
props.handleChange(newValue, record, code);
|
481
|
// toggleEdit();
|
480
|
// toggleEdit();
|
482
|
} catch (errInfo) {
|
481
|
} catch (errInfo) {
|
483
|
- console.log('Save failed:', errInfo);
|
482
|
+ console.warn('Save failed:', errInfo);
|
484
|
}
|
483
|
}
|
485
|
};
|
484
|
};
|
486
|
|
485
|
|
|
@@ -510,6 +509,8 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -510,6 +509,8 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
510
|
initialValue={qxProps.min}
|
509
|
initialValue={qxProps.min}
|
511
|
>
|
510
|
>
|
512
|
<InputNumber
|
511
|
<InputNumber
|
|
|
512
|
+ min={0}
|
|
|
513
|
+ precision={0}
|
513
|
// defaultValue={qxProps.min}
|
514
|
// defaultValue={qxProps.min}
|
514
|
// onChange={onQxpropsChangen}
|
515
|
// onChange={onQxpropsChangen}
|
515
|
// onBlur={() => save('qxProps-min')}
|
516
|
// onBlur={() => save('qxProps-min')}
|
|
@@ -523,6 +524,8 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -523,6 +524,8 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
523
|
initialValue={qxProps.max}
|
524
|
initialValue={qxProps.max}
|
524
|
>
|
525
|
>
|
525
|
<InputNumber
|
526
|
<InputNumber
|
|
|
527
|
+ min={0}
|
|
|
528
|
+ precision={0}
|
526
|
// dataIndex={["qxProps", "max"]}
|
529
|
// dataIndex={["qxProps", "max"]}
|
527
|
// defaultValue={qxProps.max}
|
530
|
// defaultValue={qxProps.max}
|
528
|
// onBlur={() => save('qxProps-max')}
|
531
|
// onBlur={() => save('qxProps-max')}
|
|
@@ -548,6 +551,8 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -548,6 +551,8 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
548
|
style={{ margin: 0 }}
|
551
|
style={{ margin: 0 }}
|
549
|
>
|
552
|
>
|
550
|
<InputNumber
|
553
|
<InputNumber
|
|
|
554
|
+ precision={qxProps.precision || 0}
|
|
|
555
|
+ size='small'
|
551
|
// defaultValue={qxProps.min}
|
556
|
// defaultValue={qxProps.min}
|
552
|
// onBlur={() => save('qxProps-min')}
|
557
|
// onBlur={() => save('qxProps-min')}
|
553
|
style={{ width: '110px' }}
|
558
|
style={{ width: '110px' }}
|
|
@@ -562,6 +567,8 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -562,6 +567,8 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
562
|
name={['newQxProps', 'max']}
|
567
|
name={['newQxProps', 'max']}
|
563
|
>
|
568
|
>
|
564
|
<InputNumber
|
569
|
<InputNumber
|
|
|
570
|
+ size='small'
|
|
|
571
|
+ precision={qxProps.precision || 0}
|
565
|
// defaultValue={qxProps.max}
|
572
|
// defaultValue={qxProps.max}
|
566
|
// onBlur={() => save('qxProps-max')}
|
573
|
// onBlur={() => save('qxProps-max')}
|
567
|
style={{ width: '110px' }}
|
574
|
style={{ width: '110px' }}
|
|
@@ -576,6 +583,11 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -576,6 +583,11 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
576
|
name={['newQxProps', 'precision']}
|
583
|
name={['newQxProps', 'precision']}
|
577
|
>
|
584
|
>
|
578
|
<InputNumber
|
585
|
<InputNumber
|
|
|
586
|
+ size='small'
|
|
|
587
|
+ // formatter={decimalCheck}
|
|
|
588
|
+ precision={0}
|
|
|
589
|
+ min={0}
|
|
|
590
|
+ max={8}
|
579
|
// defaultValue={qxProps.precision}
|
591
|
// defaultValue={qxProps.precision}
|
580
|
// onBlur={() => save('qxProps-precision')}
|
592
|
// onBlur={() => save('qxProps-precision')}
|
581
|
placeholder="小数位数"
|
593
|
placeholder="小数位数"
|
|
@@ -595,6 +607,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -595,6 +607,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
595
|
>
|
607
|
>
|
596
|
<div>
|
608
|
<div>
|
597
|
<DatePicker
|
609
|
<DatePicker
|
|
|
610
|
+ size='small'
|
598
|
defaultValue={
|
611
|
defaultValue={
|
599
|
qxProps?.min
|
612
|
qxProps?.min
|
600
|
? moment(qxProps.min)
|
613
|
? moment(qxProps.min)
|
|
@@ -602,7 +615,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -602,7 +615,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
602
|
}
|
615
|
}
|
603
|
format={formatEnum[qxProps?.format]}
|
616
|
format={formatEnum[qxProps?.format]}
|
604
|
// onChange={dateChange}
|
617
|
// onChange={dateChange}
|
605
|
- style={{ width: '130px' }}
|
618
|
+ style={{ width: '110px' }}
|
606
|
// onBlur={() => save('qxProps-min')}
|
619
|
// onBlur={() => save('qxProps-min')}
|
607
|
showTime
|
620
|
showTime
|
608
|
onSelect={(e) => props.handleChange(e, record, 'qxProps-min')}
|
621
|
onSelect={(e) => props.handleChange(e, record, 'qxProps-min')}
|
|
@@ -611,13 +624,14 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -611,13 +624,14 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
611
|
{/* <DatePicker defaultValue={moment(qxProps.min)} onBlur={() => save('qxProps-min')} placeholder='开始日期' /> */}
|
624
|
{/* <DatePicker defaultValue={moment(qxProps.min)} onBlur={() => save('qxProps-min')} placeholder='开始日期' /> */}
|
612
|
~
|
625
|
~
|
613
|
<DatePicker
|
626
|
<DatePicker
|
|
|
627
|
+ size='small'
|
614
|
defaultValue={
|
628
|
defaultValue={
|
615
|
qxProps?.min
|
629
|
qxProps?.min
|
616
|
? moment(qxProps.max)
|
630
|
? moment(qxProps.max)
|
617
|
: undefined
|
631
|
: undefined
|
618
|
}
|
632
|
}
|
619
|
format={formatEnum[qxProps?.format]}
|
633
|
format={formatEnum[qxProps?.format]}
|
620
|
- style={{ width: '130px' }}
|
634
|
+ style={{ width: '110px' }}
|
621
|
// onChange={dateChange}
|
635
|
// onChange={dateChange}
|
622
|
showTime
|
636
|
showTime
|
623
|
// onBlur={toggleEdit}
|
637
|
// onBlur={toggleEdit}
|
|
@@ -627,6 +641,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -627,6 +641,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
627
|
{/* <DatePicker defaultValue={moment(qxProps.max)} onBlur={() => save('qxProps-max')} placeholder='结束日期' /> */}
|
641
|
{/* <DatePicker defaultValue={moment(qxProps.max)} onBlur={() => save('qxProps-max')} placeholder='结束日期' /> */}
|
628
|
</div>
|
642
|
</div>
|
629
|
<Select
|
643
|
<Select
|
|
|
644
|
+ size='small'
|
630
|
style={{ width: '90px' }}
|
645
|
style={{ width: '90px' }}
|
631
|
placeholder="格式"
|
646
|
placeholder="格式"
|
632
|
popupMatchSelectWidth={false}
|
647
|
popupMatchSelectWidth={false}
|
|
@@ -642,7 +657,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -642,7 +657,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
642
|
key={item.value}
|
657
|
key={item.value}
|
643
|
value={item.value}
|
658
|
value={item.value}
|
644
|
>
|
659
|
>
|
645
|
- {item.lable}
|
660
|
+ {item.label}
|
646
|
</Select.Option>
|
661
|
</Select.Option>
|
647
|
);
|
662
|
);
|
648
|
})}
|
663
|
})}
|
|
@@ -650,6 +665,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -650,6 +665,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
650
|
</div>
|
665
|
</div>
|
651
|
);
|
666
|
);
|
652
|
case 'FORM':
|
667
|
case 'FORM':
|
|
|
668
|
+ console.log('FORM ====', '数据变化');
|
653
|
return (
|
669
|
return (
|
654
|
<div
|
670
|
<div
|
655
|
key={record.id}
|
671
|
key={record.id}
|
|
@@ -715,32 +731,25 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -715,32 +731,25 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
715
|
}
|
731
|
}
|
716
|
|
732
|
|
717
|
const qxPropsDefault = () => {
|
733
|
const qxPropsDefault = () => {
|
718
|
- const valuesObj = [{
|
|
|
719
|
- type: typeTranslateItemtype(record.type),
|
|
|
720
|
- value: record?.qxProps?.default || '',
|
|
|
721
|
- }]
|
|
|
722
|
- record.valuesObj = valuesObj
|
734
|
+ // const valuesObj = [{
|
|
|
735
|
+ // type: typeTranslateItemtype(record.type),
|
|
|
736
|
+ // value: record.mappingValues || [],
|
|
|
737
|
+ // }]
|
|
|
738
|
+ // record.valuesObj = !record.valuesObj ? valuesObj : record.valuesObj
|
723
|
return (
|
739
|
return (
|
724
|
<div>
|
740
|
<div>
|
725
|
- {/* <Input
|
|
|
726
|
- defaultValue={record?.qxProps?.default}
|
|
|
727
|
- ref={inputRef}
|
|
|
728
|
- onBlur={() => save('qxProps-default')}
|
|
|
729
|
- /> */}
|
|
|
730
|
<QxFieldSetter
|
741
|
<QxFieldSetter
|
731
|
value={record.valuesObj || []}
|
742
|
value={record.valuesObj || []}
|
732
|
- // value={[{
|
|
|
733
|
- // type: typeTranslateItemtype(record.type) || '',
|
|
|
734
|
- // value: record?.qxProps?.default
|
|
|
735
|
- // }]}
|
|
|
736
|
params={{ appCode: 'appCode', useId: true }}
|
743
|
params={{ appCode: 'appCode', useId: true }}
|
737
|
valueOptions={getValueOptions(record)}
|
744
|
valueOptions={getValueOptions(record)}
|
738
|
field={record.type}
|
745
|
field={record.type}
|
739
|
widget={typeTranslateWidget(record.type)}
|
746
|
widget={typeTranslateWidget(record.type)}
|
740
|
fieldType={typeTranslateFieIdtype(record.type)}
|
747
|
fieldType={typeTranslateFieIdtype(record.type)}
|
741
|
fieldGroupType={typeTranslateGrouptype(record.type)}
|
748
|
fieldGroupType={typeTranslateGrouptype(record.type)}
|
742
|
- isMixValue={typeTranslateFieIdtype(record.type) == 'STRING' ? true : false}
|
749
|
+ isMixValue={typeTranslateFieIdtype(record.type) === 'STRING'}
|
743
|
isMultiple={false}
|
750
|
isMultiple={false}
|
|
|
751
|
+ colsTree={props.nodeItem}
|
|
|
752
|
+ showFieldOpt={!(nodeType === 'START')}
|
744
|
onChange={debounce((val) => handleField(val), 700)}
|
753
|
onChange={debounce((val) => handleField(val), 700)}
|
745
|
/>
|
754
|
/>
|
746
|
</div>
|
755
|
</div>
|
|
@@ -791,19 +800,19 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -791,19 +800,19 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
791
|
) : dataIndex == 'qxProps' ? (
|
800
|
) : dataIndex == 'qxProps' ? (
|
792
|
title == '取值范围' ? (
|
801
|
title == '取值范围' ? (
|
793
|
qxPropsRange()
|
802
|
qxPropsRange()
|
794
|
- ) : title == '默认值' ? (
|
|
|
795
|
- qxPropsDefault()
|
|
|
796
|
) : (
|
803
|
) : (
|
797
|
qxPropsRemark()
|
804
|
qxPropsRemark()
|
798
|
)
|
805
|
)
|
799
|
- ) : (
|
|
|
800
|
- // @ts-ignore
|
|
|
801
|
- <Input
|
|
|
802
|
- ref={inputRef}
|
|
|
803
|
- onPressEnter={save}
|
|
|
804
|
- onBlur={() => save(dataIndex)}
|
|
|
805
|
- />
|
|
|
806
|
- )}
|
806
|
+ ) : dataIndex == 'mappingValues' ?
|
|
|
807
|
+ qxPropsDefault() :
|
|
|
808
|
+ (
|
|
|
809
|
+ // @ts-ignore
|
|
|
810
|
+ <Input
|
|
|
811
|
+ ref={inputRef}
|
|
|
812
|
+ onPressEnter={save}
|
|
|
813
|
+ onBlur={() => save(dataIndex)}
|
|
|
814
|
+ />
|
|
|
815
|
+ )}
|
807
|
</Form.Item>
|
816
|
</Form.Item>
|
808
|
) : (
|
817
|
) : (
|
809
|
<div
|
818
|
<div
|
|
@@ -859,7 +868,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -859,7 +868,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
859
|
onCell: (record: any, index: any) => ({
|
868
|
onCell: (record: any, index: any) => ({
|
860
|
index,
|
869
|
index,
|
861
|
record,
|
870
|
record,
|
862
|
- editable: record.disabled ? false : true,
|
871
|
+ editable: !record.disabled,
|
863
|
dataIndex: col.dataIndex,
|
872
|
dataIndex: col.dataIndex,
|
864
|
title: col.title,
|
873
|
title: col.title,
|
865
|
// handleSave,
|
874
|
// handleSave,
|
|
@@ -1120,7 +1129,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -1120,7 +1129,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
1120
|
childrenColumnName: 'child'
|
1129
|
childrenColumnName: 'child'
|
1121
|
}}
|
1130
|
}}
|
1122
|
onRow={() => onRow()}
|
1131
|
onRow={() => onRow()}
|
1123
|
- scroll={{ x: 1600 }}
|
1132
|
+ scroll={{ x: 960 }}
|
1124
|
rowClassName={() => 'editable-row'}
|
1133
|
rowClassName={() => 'editable-row'}
|
1125
|
bordered
|
1134
|
bordered
|
1126
|
pagination={false}
|
1135
|
pagination={false}
|