@qmlight/web-platform-components 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,7 @@ export const getOrgsByConditions = (params) => {
11
11
  return axios.post(`${SERVER.QFC_BASE}/lowcode/getOrgsByConditions`, params);
12
12
  };
13
13
  export const recentUserPage = (params) => {
14
- return axios.post(`${SERVER.FT_FLOAT}/customGroup/getCustomGroup`, params);
14
+ return axios.post(`${SERVER.QFC_BASE}/lowcode/getOuterCustomGroup`, params);
15
15
  };
16
16
 
17
17
  export const getUsersByConditions = (params) => {
@@ -18,6 +18,7 @@ const RecentlyPageIndex = React.forwardRef((props: any, ref) => {
18
18
  actionHandle,
19
19
  } = props;
20
20
  const [fetchParams, setFetchParams] = useState<any>({});
21
+ const [dataSource, setDataSource] = useState<any[]>([]);
21
22
  const treeData = useRef<any[]>([]);
22
23
  const searchTreeRef = useRef<any>();
23
24
  const [itemKeys, setItemKeys] = useState<any[]>([]);
@@ -33,18 +34,7 @@ const RecentlyPageIndex = React.forwardRef((props: any, ref) => {
33
34
 
34
35
  // eslint-disable-next-line react-hooks/exhaustive-deps
35
36
  }, [selectedKeys]);
36
- const onRefreshChange = (id?) => {
37
- if (id) {
38
- setFetchParams({ newId: id, refesh: true });
39
- return;
40
- }
41
- setFetchParams({});
42
- };
43
- useImperativeHandle(ref, () => {
44
- return {
45
- onRefresh: onRefreshChange,
46
- };
47
- });
37
+
48
38
  const updateTreeData = (list, parentId) => {
49
39
  return list.map((node) => {
50
40
  const newNode = {
@@ -120,12 +110,13 @@ const RecentlyPageIndex = React.forwardRef((props: any, ref) => {
120
110
  )
121
111
  );
122
112
  };
123
-
124
- const getData = async (params) => {
125
- params.id = params.newId;
126
- const treeList = getTreeList(treeData.current, []);
127
- const { newId, refesh, ...newParams } = params;
113
+ useEffect(() => {
114
+ getData();
115
+ // eslint-disable-next-line react-hooks/exhaustive-deps
116
+ }, []);
117
+ const getData = async () => {
128
118
  const res = await recentUserPage({ orgCode: 'root' });
119
+
129
120
  if (res.code === 200) {
130
121
  treeData.current = updateTreeData(res.data?.childVOList, 'root');
131
122
  const treeList = getTreeList(treeData.current, []);
@@ -139,19 +130,8 @@ const RecentlyPageIndex = React.forwardRef((props: any, ref) => {
139
130
  };
140
131
  })
141
132
  );
142
- if (refesh) {
143
- return {
144
- ...res,
145
- data: treeData.current,
146
- };
147
- }
148
- return {
149
- ...res,
150
- data: treeData.current,
151
- };
133
+ setDataSource(treeData.current);
152
134
  }
153
- onRefreshChange(false);
154
- return res;
155
135
  };
156
136
  const getTreeList = (treeData, list) => {
157
137
  treeData.forEach((item) => {
@@ -205,10 +185,11 @@ const RecentlyPageIndex = React.forwardRef((props: any, ref) => {
205
185
  showCollapse={false}
206
186
  // asyncLoad={true}
207
187
  multiple={mode === 'multiple'}
208
- fetch={{
209
- api: getData,
210
- params: fetchParams,
211
- }}
188
+ dataSource={dataSource}
189
+ // fetch={{
190
+ // api: getData,
191
+ // params: fetchParams,
192
+ // }}
212
193
  // checkStrictly={true}
213
194
  value={itemKeys}
214
195
  checkStrategy={'SHOW_CHILD'}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qmlight/web-platform-components",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "A platform components for React",
5
5
  "keywords": [
6
6
  "React",