...
|
...
|
@@ -99,6 +99,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
99
|
99
|
type,
|
100
|
100
|
} = props;
|
101
|
101
|
const [searchValue, setSearchValue] = useState('');
|
|
102
|
+ const [defaultExpandedKeys, setDefaultExpandedKeys] = useState<React.Key[]>(); //树节点的id 有了则展开
|
102
|
103
|
|
103
|
104
|
// const [form] = Form.useForm()
|
104
|
105
|
//判断数组是否只有一个子节点
|
...
|
...
|
@@ -600,6 +601,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
600
|
601
|
// const isDeveloper = window.sessionStorage.getItem('DEVELOPER_MODE') === '1';
|
601
|
602
|
const [isShowJson, setIsShowJson] = useState<any>(false);
|
602
|
603
|
const [midData, setMidData] = useState<any>([]);
|
|
604
|
+
|
603
|
605
|
useEffect(() => {
|
604
|
606
|
if (visible) {
|
605
|
607
|
if (data.length == 0) {
|
...
|
...
|
@@ -608,6 +610,15 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
608
|
610
|
}
|
609
|
611
|
}, [visible]);
|
610
|
612
|
|
|
613
|
+ useEffect(() => {
|
|
614
|
+ const value = cloneDeep(data);
|
|
615
|
+ const expandedArray: any = [];
|
|
616
|
+ (value || []).map((_item: ParamDesignModel) => {
|
|
617
|
+ expandedArray.push(_item.id);
|
|
618
|
+ });
|
|
619
|
+ setDefaultExpandedKeys(expandedArray);
|
|
620
|
+ }, [inputKey]);
|
|
621
|
+
|
611
|
622
|
//展开 所有子节点
|
612
|
623
|
const generateTreeData = useCallback(
|
613
|
624
|
(_data: any[], _keywords?: string): any[] => {
|
...
|
...
|
@@ -865,10 +876,11 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
865
|
876
|
expandable={{
|
866
|
877
|
defaultExpandAllRows: true,
|
867
|
878
|
childrenColumnName: 'child',
|
|
879
|
+ expandedRowKeys: defaultExpandedKeys,
|
868
|
880
|
expandIcon: ({ expanded, onExpand, record }) =>
|
869
|
881
|
record.child && record.child.length > 0 && expanded ? (
|
870
|
882
|
<>
|
871
|
|
- <Icon component={SubDropIcon} className="drop-icon" />
|
|
883
|
+ <Icon component={SubDropIcon} className="drop-icon1" />
|
872
|
884
|
<QxBaseIcon
|
873
|
885
|
className={'table-expanded'}
|
874
|
886
|
type={'qx-caret-down'}
|
...
|
...
|
@@ -877,7 +889,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
877
|
889
|
</>
|
878
|
890
|
) : record.child && record.child.length > 0 && !expanded ? (
|
879
|
891
|
<>
|
880
|
|
- <Icon component={SubDropIcon} className="drop-icon" />
|
|
892
|
+ <Icon component={SubDropIcon} className="drop-icon1" />
|
881
|
893
|
<QxBaseIcon
|
882
|
894
|
className={'table-expanded-change'}
|
883
|
895
|
type={'qx-caret-down'}
|
...
|
...
|
@@ -885,12 +897,12 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
885
|
897
|
/>
|
886
|
898
|
</>
|
887
|
899
|
) : (
|
888
|
|
- <Icon component={SubDropIcon} className="drop-icon" />
|
|
900
|
+ <Icon component={SubDropIcon} className="drop-icon1" />
|
889
|
901
|
),
|
890
|
902
|
}}
|
891
|
903
|
className="parameter-setting-table"
|
892
|
904
|
onRow={onRow}
|
893
|
|
- scroll={{ x: 1000, y: 432 }}
|
|
905
|
+ scroll={{ x: 1000 }}
|
894
|
906
|
bordered
|
895
|
907
|
pagination={false}
|
896
|
908
|
size={'small'}
|
...
|
...
|
|