|
@@ -219,6 +219,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -219,6 +219,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { |
219
|
|
219
|
|
220
|
// @ts-ignore
|
220
|
// @ts-ignore
|
221
|
const handleChange = (e?: any, data?: any, code?: string) => {
|
221
|
const handleChange = (e?: any, data?: any, code?: string) => {
|
|
|
222
|
+ console.log('handleChange');
|
222
|
let value,
|
223
|
let value,
|
223
|
oldValue,
|
224
|
oldValue,
|
224
|
_qxProps = {};
|
225
|
_qxProps = {};
|
|
@@ -480,7 +481,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -480,7 +481,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { |
480
|
code,
|
481
|
code,
|
481
|
type: _type,
|
482
|
type: _type,
|
482
|
pid: _pid,
|
483
|
pid: _pid,
|
483
|
- title: code,
|
484
|
+ title: '',
|
484
|
qxProps: getDefaultQxProps(_type),
|
485
|
qxProps: getDefaultQxProps(_type),
|
485
|
});
|
486
|
});
|
486
|
return;
|
487
|
return;
|
|
@@ -495,7 +496,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -495,7 +496,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { |
495
|
id,
|
496
|
id,
|
496
|
code,
|
497
|
code,
|
497
|
type: _type,
|
498
|
type: _type,
|
498
|
- title: code,
|
499
|
+ title: '',
|
499
|
qxProps: getDefaultQxProps(_type),
|
500
|
qxProps: getDefaultQxProps(_type),
|
500
|
pid: '',
|
501
|
pid: '',
|
501
|
});
|
502
|
});
|
|
@@ -514,9 +515,9 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -514,9 +515,9 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { |
514
|
const code = uidGen(undefined, 6);
|
515
|
const code = uidGen(undefined, 6);
|
515
|
if (item.id === pid) {
|
516
|
if (item.id === pid) {
|
516
|
if (item.child && item.child.length > 0) {
|
517
|
if (item.child && item.child.length > 0) {
|
517
|
- item.child.push({ id, type: 'STRING', pid, code, title: code });
|
518
|
+ item.child.push({ id, type: 'STRING', pid, code, title: '' });
|
518
|
} else {
|
519
|
} else {
|
519
|
- item.child = [{ id, type: 'STRING', pid, code, title: code }];
|
520
|
+ item.child = [{ id, type: 'STRING', pid, code, title: '' }];
|
520
|
}
|
521
|
}
|
521
|
} else {
|
522
|
} else {
|
522
|
if (item.child) {
|
523
|
if (item.child) {
|
|
@@ -613,13 +614,32 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -613,13 +614,32 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { |
613
|
|
614
|
|
614
|
// 渲染节点
|
615
|
// 渲染节点
|
615
|
const renderTitle = (nodeData: any) => {
|
616
|
const renderTitle = (nodeData: any) => {
|
|
|
617
|
+ let level = [];
|
|
|
618
|
+ const treeList = generateList(treeData);
|
|
|
619
|
+ const loop = (list: any[]) => {
|
|
|
620
|
+ if (!!list.pid) {
|
|
|
621
|
+ const index = treeList.findIndex((o: any) => o.id === list.pid);
|
|
|
622
|
+ level.push(treeList[index]);
|
|
|
623
|
+ loop(treeList[index]);
|
|
|
624
|
+ } else {
|
|
|
625
|
+ return level;
|
|
|
626
|
+ }
|
|
|
627
|
+ };
|
|
|
628
|
+ loop(nodeData);
|
|
|
629
|
+ const treeLevel2 = !!nodeData.pid ? level.length : 0;
|
|
|
630
|
+ const treeLevel = nodeData.child && nodeData.child.length > 0 ? 1 : 0;
|
|
|
631
|
+ const leftD = 22 + treeLevel * 22 + treeLevel2 * 24;
|
616
|
const strTitle = (nodeData.title as string) || '';
|
632
|
const strTitle = (nodeData.title as string) || '';
|
617
|
const index = strTitle.indexOf(searchValue);
|
633
|
const index = strTitle.indexOf(searchValue);
|
618
|
const isShowTree = checkShowTree(nodeData);
|
634
|
const isShowTree = checkShowTree(nodeData);
|
619
|
const disabled = !!props.type ? true : nodeData.disabled;
|
635
|
const disabled = !!props.type ? true : nodeData.disabled;
|
620
|
return (
|
636
|
return (
|
621
|
<div>
|
637
|
<div>
|
622
|
- <Icon component={SubDropIcon} className="drop-icon" />
|
638
|
+ <Icon
|
|
|
639
|
+ component={SubDropIcon}
|
|
|
640
|
+ className={`drop-icon`}
|
|
|
641
|
+ style={{ left: `-${leftD}px` }}
|
|
|
642
|
+ />
|
623
|
<div onBlur={(e) => onBlur(e)} tabIndex={0} onFocus={(e) => onFocus(e)}>
|
643
|
<div onBlur={(e) => onBlur(e)} tabIndex={0} onFocus={(e) => onFocus(e)}>
|
624
|
<div
|
644
|
<div
|
625
|
style={{
|
645
|
style={{
|
|
@@ -650,15 +670,17 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -650,15 +670,17 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { |
650
|
})}
|
670
|
})}
|
651
|
</Select>
|
671
|
</Select>
|
652
|
{(nodeData.type === 'OBJECT' || nodeData.type === 'ARRAY') &&
|
672
|
{(nodeData.type === 'OBJECT' || nodeData.type === 'ARRAY') &&
|
653
|
- isShowTree && (
|
|
|
654
|
- <Button
|
|
|
655
|
- icon={<Icon component={SubNodeIcon} />}
|
|
|
656
|
- disabled={disabled}
|
|
|
657
|
- type="link"
|
|
|
658
|
- className="title-btn"
|
|
|
659
|
- onClick={() => onAddTree(nodeData.id)}
|
|
|
660
|
- />
|
|
|
661
|
- )}
|
673
|
+ isShowTree ? (
|
|
|
674
|
+ <Button
|
|
|
675
|
+ icon={<Icon component={SubNodeIcon} />}
|
|
|
676
|
+ disabled={disabled}
|
|
|
677
|
+ type="link"
|
|
|
678
|
+ className="title-btn"
|
|
|
679
|
+ onClick={() => onAddTree(nodeData.id)}
|
|
|
680
|
+ />
|
|
|
681
|
+ ) : (
|
|
|
682
|
+ <div style={{ opacity: 0, height: 32, width: 32 }} />
|
|
|
683
|
+ )}
|
662
|
<Button
|
684
|
<Button
|
663
|
className="title-btn-del"
|
685
|
className="title-btn-del"
|
664
|
icon={
|
686
|
icon={
|
|
@@ -674,7 +696,11 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { |
|
@@ -674,7 +696,11 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { |
674
|
</div>
|
696
|
</div>
|
675
|
<div className="opt-left">
|
697
|
<div className="opt-left">
|
676
|
<Input
|
698
|
<Input
|
677
|
- className={index > -1 && searchValue ? 'search-selected' : ''}
|
699
|
+ status={!nodeData.title ? 'error' : ''}
|
|
|
700
|
+ placeholder={!nodeData.title ? '请输入参数名' : ''}
|
|
|
701
|
+ className={
|
|
|
702
|
+ index > -1 && searchValue ? 'search-selected' : 'sp-input'
|
|
|
703
|
+ }
|
678
|
draggable={true}
|
704
|
draggable={true}
|
679
|
onDragStart={(event) => {
|
705
|
onDragStart={(event) => {
|
680
|
event.stopPropagation();
|
706
|
event.stopPropagation();
|