Commit 801ce943e31f358d5d7143ff05be813ce1380edd
Merge branch 'feature/dataflow' of http://gitlab.qgutech.com/tianqiang/qx-common…
… into feature/dataflow
Showing
2 changed files
with
89 additions
and
71 deletions
... | ... | @@ -187,6 +187,11 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
187 | 187 | // initialValue={record.code} |
188 | 188 | > |
189 | 189 | <Input |
190 | + draggable={true} | |
191 | + onDragStart={(event) => { | |
192 | + event.stopPropagation(); | |
193 | + event.preventDefault(); | |
194 | + }} | |
190 | 195 | defaultValue={record.code} |
191 | 196 | bordered={false} |
192 | 197 | disabled={record.disabled} onBlur={(e) => handleChange(e, record, 'code')} /> |
... | ... | @@ -210,6 +215,11 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
210 | 215 | // initialValue={record.title} |
211 | 216 | > |
212 | 217 | <Input |
218 | + draggable={true} | |
219 | + onDragStart={(event) => { | |
220 | + event.stopPropagation(); | |
221 | + event.preventDefault(); | |
222 | + }} | |
213 | 223 | defaultValue={record.title} |
214 | 224 | bordered={false} |
215 | 225 | disabled={record.disabled} onBlur={(e) => handleChange(e, record, 'title')} /> |
... | ... | @@ -284,6 +294,11 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
284 | 294 | // initialValue={text} |
285 | 295 | > |
286 | 296 | <Input |
297 | + draggable={true} | |
298 | + onDragStart={(event) => { | |
299 | + event.stopPropagation(); | |
300 | + event.preventDefault(); | |
301 | + }} | |
287 | 302 | key={inputKey} |
288 | 303 | defaultValue={text} |
289 | 304 | bordered={false} |
... | ... | @@ -347,33 +362,33 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
347 | 362 | key={record.id} |
348 | 363 | className="editable-cell" |
349 | 364 | > |
350 | - <Form.Item | |
351 | - name={'qxProps-min'} | |
352 | - style={{ margin: 0 }} | |
353 | - > | |
354 | - <InputNumber | |
355 | - bordered={false} | |
356 | - min={0} | |
357 | - precision={0} | |
358 | - onBlur={(e) => handleChange(e, record, 'qxProps-min')} | |
359 | - defaultValue={qxProps.min} | |
360 | - placeholder="最小长度" | |
361 | - /> | |
362 | - </Form.Item> | |
365 | + <InputNumber | |
366 | + draggable={true} | |
367 | + onDragStart={(event) => { | |
368 | + event.stopPropagation(); | |
369 | + event.preventDefault(); | |
370 | + }} | |
371 | + bordered={false} | |
372 | + min={0} | |
373 | + precision={0} | |
374 | + onBlur={(e) => handleChange(e, record, 'qxProps-min')} | |
375 | + defaultValue={qxProps?.min || undefined} | |
376 | + placeholder="最小长度" | |
377 | + /> | |
363 | 378 | <div className='range-cell'>-</div> |
364 | - <Form.Item | |
365 | - name={'qxProps-max'} | |
366 | - style={{ margin: 0 }} | |
367 | - > | |
368 | - <InputNumber | |
369 | - min={0} | |
370 | - bordered={false} | |
371 | - precision={0} | |
372 | - defaultValue={qxProps.max} | |
373 | - onBlur={(e) => handleChange(e, record, 'qxProps-max')} | |
374 | - placeholder="最大长度" | |
375 | - /> | |
376 | - </Form.Item> | |
379 | + <InputNumber | |
380 | + draggable={true} | |
381 | + onDragStart={(event) => { | |
382 | + event.stopPropagation(); | |
383 | + event.preventDefault(); | |
384 | + }} | |
385 | + min={0} | |
386 | + bordered={false} | |
387 | + precision={0} | |
388 | + defaultValue={qxProps?.max || undefined} | |
389 | + onBlur={(e) => handleChange(e, record, 'qxProps-max')} | |
390 | + placeholder="最大长度" | |
391 | + /> | |
377 | 392 | </div> |
378 | 393 | ); |
379 | 394 | case 'NUMBER': |
... | ... | @@ -383,53 +398,54 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
383 | 398 | className="editable-cell" |
384 | 399 | > |
385 | 400 | <div className='range-cell'> |
386 | - <Form.Item | |
387 | - name={'qxProps-min'} | |
388 | - style={{ margin: 0 }} | |
389 | - > | |
390 | - <InputNumber | |
391 | - precision={qxProps.precision || 0} | |
392 | - bordered={false} | |
393 | - size='small' | |
394 | - defaultValue={qxProps.min} | |
395 | - onBlur={(e) => handleChange(e, record, 'qxProps-min')} | |
396 | - // style={{ width: '110px' }} | |
397 | - placeholder="最小值" | |
398 | - /> | |
399 | - </Form.Item> | |
401 | + <InputNumber | |
402 | + draggable={true} | |
403 | + onDragStart={(event) => { | |
404 | + event.stopPropagation(); | |
405 | + event.preventDefault(); | |
406 | + }} | |
407 | + precision={qxProps.precision || 0} | |
408 | + bordered={false} | |
409 | + size='small' | |
410 | + defaultValue={qxProps?.min || undefined} | |
411 | + onBlur={(e) => handleChange(e, record, 'qxProps-min')} | |
412 | + // style={{ width: '110px' }} | |
413 | + placeholder="最小值" | |
414 | + /> | |
400 | 415 | - |
401 | - <Form.Item | |
402 | - style={{ margin: 0 }} | |
403 | - name={'qxProps-max'} | |
404 | - > | |
405 | - <InputNumber | |
406 | - bordered={false} | |
407 | - size='small' | |
408 | - precision={qxProps.precision || 0} | |
409 | - defaultValue={qxProps.max} | |
410 | - onBlur={(e) => handleChange(e, record, 'qxProps-max')} | |
411 | - // style={{ width: '110px' }} | |
412 | - placeholder="最大值" | |
413 | - /> | |
414 | - </Form.Item> | |
416 | + <InputNumber | |
417 | + draggable={true} | |
418 | + onDragStart={(event) => { | |
419 | + event.stopPropagation(); | |
420 | + event.preventDefault(); | |
421 | + }} | |
422 | + bordered={false} | |
423 | + size='small' | |
424 | + precision={qxProps.precision || 0} | |
425 | + defaultValue={qxProps.max || undefined} | |
426 | + onBlur={(e) => handleChange(e, record, 'qxProps-max')} | |
427 | + // style={{ width: '110px' }} | |
428 | + placeholder="最大值" | |
429 | + /> | |
415 | 430 | <Divider type="vertical" style={{ height: '16px' }} /> |
416 | 431 | </div> |
417 | 432 | <div className='range-cell'> |
418 | - <Form.Item | |
419 | - style={{ margin: 0 }} | |
420 | - name={'qxProps-precision'} | |
421 | - > | |
422 | - <InputNumber | |
423 | - bordered={false} | |
424 | - size='small' | |
425 | - precision={0} | |
426 | - min={0} | |
427 | - max={8} | |
428 | - defaultValue={qxProps.precision} | |
429 | - onBlur={(e) => handleChange(e, record, 'qxProps-precision')} | |
430 | - placeholder="小数位数" | |
431 | - /> | |
432 | - </Form.Item> | |
433 | + | |
434 | + <InputNumber | |
435 | + draggable={true} | |
436 | + onDragStart={(event) => { | |
437 | + event.stopPropagation(); | |
438 | + event.preventDefault(); | |
439 | + }} | |
440 | + bordered={false} | |
441 | + size='small' | |
442 | + precision={0} | |
443 | + min={0} | |
444 | + max={8} | |
445 | + defaultValue={qxProps.precision || undefined} | |
446 | + onBlur={(e) => handleChange(e, record, 'qxProps-precision')} | |
447 | + placeholder="小数位数" | |
448 | + /> | |
433 | 449 | </div> |
434 | 450 | </div> |
435 | 451 | ); |
... | ... | @@ -478,7 +494,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
478 | 494 | bordered={false} |
479 | 495 | placeholder="格式" |
480 | 496 | popupMatchSelectWidth={false} |
481 | - defaultValue={qxProps.format} | |
497 | + defaultValue={qxProps.format || undefined} | |
482 | 498 | onSelect={(e) => |
483 | 499 | handleChange(e, record, 'qxProps-format') |
484 | 500 | } |
... | ... | @@ -682,6 +698,8 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
682 | 698 | _newTreeData.splice(dropIndex, 0, todoData[0]); // 插入 |
683 | 699 | } |
684 | 700 | const _newData = generateTreeData(_newTreeData, ''); |
701 | + console.log('_newData', _newData) | |
702 | + console.log('_newTreeData', _newTreeData) | |
685 | 703 | handleDrop(_newData); |
686 | 704 | dropCol.childNodes.forEach((item: any) => (item.style.borderTop = '')); |
687 | 705 | dropCol.parentNode.childNodes.forEach( | ... | ... |
... | ... | @@ -482,7 +482,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { |
482 | 482 | }; |
483 | 483 | |
484 | 484 | if (!_pid) { |
485 | - _treeData.push({ id, code, type: _type, title: code, qxProps: getDefaultQxProps(_type) }); | |
485 | + _treeData.push({ id, code, type: _type, title: code, qxProps: getDefaultQxProps(_type), pid: '' }); | |
486 | 486 | } else { |
487 | 487 | loopAddTree(_treeData); |
488 | 488 | } | ... | ... |