Commit b48f783012ac8c2d91283451db910f32eed1dc24

Authored by qiang.tian
2 parents bd1d495a 421750c9

Merge branch 'feature/dataflow' of http://gitlab.qgutech.com/tianqiang/qx-common…

… into feature/dataflow
... ... @@ -59,6 +59,13 @@ const FormSelectMain: React.FC<FormSelectProps>= (props)=> {
59 59
60 60 useEffect(() => {
61 61 if (!value || !Object.keys(value || {})?.length || !value?.formId) {
  62 + setItem({
  63 + flag: 'SINGLE',
  64 + code: '',
  65 + appId: appId || '',
  66 + name: '',
  67 + appName: ''
  68 + });
62 69 return;
63 70 }
64 71
... ...
... ... @@ -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'}
... ...
... ... @@ -528,6 +528,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => {
528 528 }
529 529 const _treeData = JSON.parse(JSON.stringify(treeData));
530 530 const _treeDataNew = addNode(key, _treeData);
  531 + setInputKey(inputKey + 1);
531 532 setTreeData(_treeDataNew);
532 533 props?.onChange(_treeDataNew);
533 534 };
... ... @@ -802,6 +803,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => {
802 803 draggable={{ icon: false }}
803 804 // draggable={!props.type}
804 805 blockNode
  806 + defaultExpandAll
805 807 expandedKeys={expandedKeys ? expandedKeys : defaultExpandedKeys}
806 808 autoExpandParent={autoExpandParent}
807 809 onExpand={onExpand}
... ...
... ... @@ -20,7 +20,6 @@
20 20 overflow: hidden;
21 21 white-space: nowrap;
22 22 text-overflow: ellipsis;
23   - text-overflow: ellipsis;
24 23 }
25 24 }
26 25
... ... @@ -268,6 +267,14 @@
268 267 }
269 268 }
270 269
  270 +.drop-icon {
  271 + position: absolute;
  272 + top: 10px;
  273 + left: -46px;
  274 + opacity: 1;
  275 + display: block;
  276 +}
  277 +
271 278 .qx-parameter-tree-list .ant-tree-list {
272 279 .ant-tree-treenode:not(.ant-tree-treenode-disabled) {
273 280 background-color: transparent !important;
... ... @@ -317,18 +324,6 @@
317 324 display: flex;
318 325 }
319 326
320   - .ant-table-tbody .ant-table-row {
321   - // .drop-icon{
322   - // opacity: 0.01;
323   - // }
324   -
325   - // &:hover {
326   - // .drop-icon{
327   - // opacity: 1;
328   - // }
329   - // }
330   - }
331   -
332 327 .table-expanded {
333 328 color: #7c7e86;
334 329 margin-left: 8px;
... ...
... ... @@ -89,7 +89,7 @@
89 89
90 90 .ant-modal-body {
91 91 max-height: 464px;
92   - padding: 16px 18px 8px 24px;
  92 + padding: 16px 18px 24px 24px;
93 93 overflow-y: hidden;
94 94 scrollbar-gutter: stable;
95 95
... ...