@qmlight/web-platform-components 1.0.0 → 1.0.2
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.
- package/SearchAssistanceSelect/src/SearchAssistanceComponent/component/customOrg/customModal.tsx +1 -1
- package/SearchAssistanceSelect/src/SearchAssistanceComponent/component/customOrg/index.tsx +163 -134
- package/SearchAssistanceSelect/src/SearchAssistanceComponent/component/customOrg/style.less +10 -3
- package/SearchAssistanceSelect/src/SearchAssistanceComponent/component/recently/index.tsx +1 -1
- package/SearchAssistanceSelect/src/SearchAssistanceComponent/component/search/index.tsx +11 -8
- package/SearchAssistanceSelect/src/SearchAssistanceComponent/component/tabList/style.less +1 -1
- package/SearchAssistanceSelect/src/SearchAssistanceComponent/searchTabs.tsx +44 -16
- package/SearchAssistanceSelect/src/SearchAssistanceComponent/style.less +2 -1
- package/SearchAssistanceSelect/src/SearchAssistanceComponent/transfer/index.tsx +51 -21
- package/SearchAssistanceSelect/src/SearchAssistanceComponent/treeData/index.tsx +1 -1
- package/package.json +1 -1
package/SearchAssistanceSelect/src/SearchAssistanceComponent/component/customOrg/customModal.tsx
CHANGED
|
@@ -100,7 +100,7 @@ const CustomModal = ({ actionInfo, onClose, setAcitonInfo, mode }) => {
|
|
|
100
100
|
: updateCustomGroup({ ...field, id: data.id }));
|
|
101
101
|
if (res.code === 200) {
|
|
102
102
|
Message('保存成功', 'success');
|
|
103
|
-
onClose(
|
|
103
|
+
onClose(data?.id);
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
106
|
const onModalDataChange = (data) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef, useLayoutEffect } from 'react';
|
|
2
|
-
import { DcpButton, DcpModal,
|
|
2
|
+
import { DcpButton, DcpModal, Collapse, Spin } from 'dcp-design-react';
|
|
3
3
|
import { PlusOutlined } from '@/icons';
|
|
4
4
|
import {
|
|
5
5
|
getAllCustomGroups,
|
|
@@ -12,7 +12,7 @@ import './style.less';
|
|
|
12
12
|
import { Message } from '@/utils';
|
|
13
13
|
import CustomModal from './customModal';
|
|
14
14
|
import { EditOutlined, DeleteOutlined } from '@/icons';
|
|
15
|
-
|
|
15
|
+
const { Panel } = Collapse;
|
|
16
16
|
const CustomOrg = (props) => {
|
|
17
17
|
const {
|
|
18
18
|
onDoubleClickChange,
|
|
@@ -32,8 +32,16 @@ const CustomOrg = (props) => {
|
|
|
32
32
|
const [fetchParams, setFetchParams] = useState({});
|
|
33
33
|
|
|
34
34
|
const [moveKey, setMoveKey] = useState<string | null>(null);
|
|
35
|
-
const
|
|
36
|
-
|
|
35
|
+
const [activeKeys, setActiveKeys] = useState<string[]>([]);
|
|
36
|
+
const userList = React.useRef<any[]>([]);
|
|
37
|
+
const dataList = React.useRef<any>([]);
|
|
38
|
+
const [loading, setLoading] = useState(false);
|
|
39
|
+
const [loaingChild, setLoadingChild] = useState('');
|
|
40
|
+
const getData = async (flag?) => {
|
|
41
|
+
setLoading(true);
|
|
42
|
+
const res = await getAllCustomGroups({}).finally(() => {
|
|
43
|
+
setLoading(false);
|
|
44
|
+
});
|
|
37
45
|
if (res.code === 200) {
|
|
38
46
|
const list = res.data.map((item) => {
|
|
39
47
|
return {
|
|
@@ -42,45 +50,68 @@ const CustomOrg = (props) => {
|
|
|
42
50
|
orgtype: 'customOrg',
|
|
43
51
|
};
|
|
44
52
|
});
|
|
45
|
-
|
|
46
|
-
|
|
53
|
+
|
|
54
|
+
if (mode) {
|
|
55
|
+
userList.current = list;
|
|
56
|
+
onDataChange && onDataChange(list);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (flag) {
|
|
60
|
+
dataList.current = list.map((item) => {
|
|
61
|
+
const field = dataList.current.find((items) => items.id === item.id) || {};
|
|
62
|
+
return {
|
|
63
|
+
...item,
|
|
64
|
+
...field,
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
setData(dataList.current);
|
|
68
|
+
return;
|
|
69
|
+
} else {
|
|
70
|
+
setData(list);
|
|
71
|
+
dataList.current = list;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
const firstId = list.find((_, index) => index === 0).id;
|
|
75
|
+
|
|
76
|
+
if (firstId) {
|
|
77
|
+
setActiveKeys([firstId]);
|
|
78
|
+
getUserData(firstId);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// onDataChange && onDataChange(list);
|
|
47
82
|
}
|
|
48
83
|
};
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
84
|
+
const getUserData = async (id) => {
|
|
85
|
+
setLoading(true);
|
|
86
|
+
const res = await getUsersByCustomGroup({ ids: [id] }).finally(() => {
|
|
87
|
+
setLoading(false);
|
|
88
|
+
});
|
|
89
|
+
const { data = [] } = res;
|
|
53
90
|
if (res.code === 200) {
|
|
54
|
-
|
|
91
|
+
const newList = data[0]?.userList?.map((item) => {
|
|
55
92
|
return {
|
|
56
|
-
...
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
...item,
|
|
60
|
-
isLeaf: true,
|
|
61
|
-
title: item.userName,
|
|
62
|
-
};
|
|
63
|
-
}),
|
|
64
|
-
};
|
|
65
|
-
} else {
|
|
66
|
-
return {
|
|
67
|
-
...res,
|
|
68
|
-
data: res.data.map((item) => {
|
|
69
|
-
return {
|
|
70
|
-
...item,
|
|
71
|
-
orgtype: 'customOrg',
|
|
72
|
-
};
|
|
73
|
-
}),
|
|
93
|
+
...item,
|
|
94
|
+
name: item.userName,
|
|
95
|
+
title: item.userName,
|
|
74
96
|
};
|
|
75
|
-
}
|
|
97
|
+
});
|
|
98
|
+
userList.current = userList.current.concat(newList || []);
|
|
99
|
+
onDataChange && onDataChange(userList.current);
|
|
100
|
+
dataList.current = dataList.current.map((item) => {
|
|
101
|
+
if (item.id === id) {
|
|
102
|
+
return {
|
|
103
|
+
...item,
|
|
104
|
+
userList: newList,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
return item;
|
|
108
|
+
});
|
|
109
|
+
setData(dataList.current);
|
|
76
110
|
}
|
|
77
|
-
return res;
|
|
78
111
|
};
|
|
79
112
|
|
|
80
113
|
useEffect(() => {
|
|
81
|
-
|
|
82
|
-
getData();
|
|
83
|
-
}
|
|
114
|
+
getData();
|
|
84
115
|
// onDataChange && onDataChange(dataSource);
|
|
85
116
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
86
117
|
}, []);
|
|
@@ -93,7 +124,7 @@ const CustomOrg = (props) => {
|
|
|
93
124
|
return;
|
|
94
125
|
}
|
|
95
126
|
setItemKeys([value]);
|
|
96
|
-
const field =
|
|
127
|
+
const field = userList.current.find((item) => item.id === value);
|
|
97
128
|
onValueChange && onValueChange({ ...field, value: field.id, label: field.title });
|
|
98
129
|
};
|
|
99
130
|
const onItemAction = async (act, item) => {
|
|
@@ -113,25 +144,22 @@ const CustomOrg = (props) => {
|
|
|
113
144
|
const res = await deleteCustomGroup({ id: item.id });
|
|
114
145
|
if (res.code === 200) {
|
|
115
146
|
Message('删除成功', 'success');
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
getData();
|
|
147
|
+
|
|
148
|
+
getData(true);
|
|
121
149
|
}
|
|
122
150
|
}
|
|
123
151
|
};
|
|
124
152
|
|
|
125
|
-
const onClose = () => {
|
|
153
|
+
const onClose = (id?) => {
|
|
126
154
|
setAcitonInfo({
|
|
127
155
|
type: 'add',
|
|
128
156
|
visible: false,
|
|
129
157
|
});
|
|
130
|
-
if (!mode) {
|
|
131
|
-
|
|
158
|
+
if (!mode && id) {
|
|
159
|
+
getUserData(id);
|
|
132
160
|
return;
|
|
133
161
|
}
|
|
134
|
-
getData();
|
|
162
|
+
getData(true);
|
|
135
163
|
};
|
|
136
164
|
const actionHandle = (e, flag, info) => {
|
|
137
165
|
e.stopPropagation();
|
|
@@ -143,102 +171,103 @@ const CustomOrg = (props) => {
|
|
|
143
171
|
onItemAction('del', info);
|
|
144
172
|
}
|
|
145
173
|
};
|
|
174
|
+
|
|
146
175
|
return (
|
|
147
176
|
<div className="custom-org-page">
|
|
148
|
-
<
|
|
149
|
-
<
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
>
|
|
159
|
-
新建分组
|
|
160
|
-
</DcpButton>
|
|
161
|
-
</div>
|
|
162
|
-
{!mode && (
|
|
163
|
-
<div className="custom-org-page-tree">
|
|
164
|
-
<DcpSearchTree
|
|
165
|
-
showSearchBar={false}
|
|
166
|
-
filterable={false}
|
|
167
|
-
showCollapse={false}
|
|
168
|
-
asyncLoad={true}
|
|
169
|
-
value={itemKeys}
|
|
170
|
-
onSelectChange={(node: any) => {
|
|
171
|
-
if (!mode) {
|
|
172
|
-
if (!node.orgtype) {
|
|
173
|
-
setItemKeys([node.id]);
|
|
174
|
-
onValueChange && onValueChange({ ...node, value: node.id, title: node.title });
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}}
|
|
178
|
-
fetch={{
|
|
179
|
-
api: getTreeData,
|
|
180
|
-
params: fetchParams,
|
|
181
|
-
}}
|
|
182
|
-
fieldsDefine={{
|
|
183
|
-
valueKey: 'id',
|
|
184
|
-
textKey: 'title',
|
|
177
|
+
<Spin spinning={loading}>
|
|
178
|
+
<div className="custom-org-page-extra">
|
|
179
|
+
<DcpButton
|
|
180
|
+
type="primary"
|
|
181
|
+
icon={<PlusOutlined />}
|
|
182
|
+
onClick={() => {
|
|
183
|
+
setAcitonInfo({
|
|
184
|
+
type: 'add',
|
|
185
|
+
visible: true,
|
|
186
|
+
});
|
|
185
187
|
}}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
188
|
+
>
|
|
189
|
+
新建分组
|
|
190
|
+
</DcpButton>
|
|
191
|
+
</div>
|
|
192
|
+
{!mode && (
|
|
193
|
+
<div className="custom-org-page-list">
|
|
194
|
+
<Collapse
|
|
195
|
+
activeKey={activeKeys}
|
|
196
|
+
onChange={(val: string[]) => {
|
|
197
|
+
setActiveKeys(val);
|
|
198
|
+
if (val.length) {
|
|
199
|
+
const newId = val[val.length - 1];
|
|
200
|
+
const userFlag = dataList.current.find((item) => item.id === newId)?.userList;
|
|
201
|
+
if (!userFlag) {
|
|
202
|
+
getUserData(newId);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}}
|
|
206
|
+
>
|
|
207
|
+
{dataSource.map((item) => {
|
|
208
|
+
return (
|
|
209
|
+
<Panel
|
|
210
|
+
header={item.title}
|
|
211
|
+
key={item.id}
|
|
212
|
+
extra={
|
|
213
|
+
<div className="item-action">
|
|
214
|
+
<EditOutlined
|
|
215
|
+
onClick={(e) => actionHandle(e, 'edit', item)}
|
|
216
|
+
style={{ marginRight: 8, fontSize: 14 }}
|
|
217
|
+
/>
|
|
218
|
+
<DeleteOutlined
|
|
219
|
+
onClick={(e) => actionHandle(e, 'del', item)}
|
|
220
|
+
style={{ marginRight: 8, fontSize: 14 }}
|
|
221
|
+
/>
|
|
222
|
+
</div>
|
|
223
|
+
}
|
|
197
224
|
>
|
|
198
|
-
<
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
style={{ marginRight: 8, fontSize: 14 }}
|
|
225
|
+
<TabList
|
|
226
|
+
onDoubleClickChange={onDoubleClickChange}
|
|
227
|
+
onItemSelect={itemSelect}
|
|
228
|
+
selectedKeys={itemKeys}
|
|
229
|
+
// loading={item.id === loaingChild}
|
|
230
|
+
dataSource={item.userList?.filter((items) => !targetKeys.includes(items.id))}
|
|
205
231
|
/>
|
|
206
|
-
</
|
|
207
|
-
|
|
208
|
-
)
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
232
|
+
</Panel>
|
|
233
|
+
);
|
|
234
|
+
})}
|
|
235
|
+
</Collapse>
|
|
236
|
+
</div>
|
|
237
|
+
)}
|
|
238
|
+
{mode === 'multiple' && (
|
|
239
|
+
<div className="custom-org-page-list">
|
|
240
|
+
<TabList
|
|
241
|
+
onDoubleClickChange={onDoubleClickChange}
|
|
242
|
+
onItemSelect={itemSelect}
|
|
243
|
+
selectedKeys={itemKeys}
|
|
244
|
+
type={'edit'}
|
|
245
|
+
onItemAction={onItemAction}
|
|
246
|
+
dataSource={dataSource.filter((item) => !targetKeys.includes(item.id))}
|
|
247
|
+
/>
|
|
248
|
+
</div>
|
|
249
|
+
)}
|
|
250
|
+
<DcpModal
|
|
251
|
+
width={800}
|
|
252
|
+
height={540}
|
|
253
|
+
title="分组"
|
|
254
|
+
visible={actionInfo.visible}
|
|
255
|
+
onClose={() =>
|
|
256
|
+
setAcitonInfo({
|
|
257
|
+
type: 'add',
|
|
258
|
+
visible: false,
|
|
259
|
+
})
|
|
260
|
+
}
|
|
261
|
+
wrapClassName={'search-assistance-modal'}
|
|
262
|
+
>
|
|
263
|
+
<CustomModal
|
|
264
|
+
actionInfo={actionInfo}
|
|
265
|
+
onClose={onClose}
|
|
266
|
+
mode={mode}
|
|
267
|
+
setAcitonInfo={setAcitonInfo}
|
|
224
268
|
/>
|
|
225
|
-
</
|
|
226
|
-
|
|
227
|
-
<DcpModal
|
|
228
|
-
width={800}
|
|
229
|
-
height={540}
|
|
230
|
-
title="分组"
|
|
231
|
-
visible={actionInfo.visible}
|
|
232
|
-
onClose={() => onClose()}
|
|
233
|
-
wrapClassName={'search-assistance-modal'}
|
|
234
|
-
>
|
|
235
|
-
<CustomModal
|
|
236
|
-
actionInfo={actionInfo}
|
|
237
|
-
onClose={onClose}
|
|
238
|
-
mode={mode}
|
|
239
|
-
setAcitonInfo={setAcitonInfo}
|
|
240
|
-
/>
|
|
241
|
-
</DcpModal>
|
|
269
|
+
</DcpModal>
|
|
270
|
+
</Spin>
|
|
242
271
|
</div>
|
|
243
272
|
);
|
|
244
273
|
};
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
.custom-org-page{
|
|
2
2
|
height: 100%;
|
|
3
|
+
.ant-spin-nested-loading{
|
|
4
|
+
height: 100%;
|
|
5
|
+
.ant-spin-container{
|
|
6
|
+
height:100%;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
.ant-collapse-content-box{
|
|
10
|
+
padding: 0px;
|
|
11
|
+
}
|
|
3
12
|
&-extra{
|
|
4
13
|
text-align: right;
|
|
5
14
|
padding: 3px ;
|
|
@@ -20,8 +29,6 @@
|
|
|
20
29
|
}
|
|
21
30
|
&-list{
|
|
22
31
|
height: calc(100% - 38px);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
32
|
+
overflow-y: auto;
|
|
26
33
|
}
|
|
27
34
|
}
|
|
@@ -69,7 +69,7 @@ const RecentlyPageIndex = (props) => {
|
|
|
69
69
|
onDoubleClickChange={onDoubleClickChange}
|
|
70
70
|
onItemSelect={itemSelect}
|
|
71
71
|
selectedKeys={itemKeys}
|
|
72
|
-
dataSource={dataSource.filter((item) => !targetKeys
|
|
72
|
+
dataSource={dataSource.filter((item) => !targetKeys?.includes(item.id))}
|
|
73
73
|
/>
|
|
74
74
|
{/* <Pagination
|
|
75
75
|
simple
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { useEffect, useRef, useState } from
|
|
2
|
-
import TabList from
|
|
3
|
-
import { getUsersByConditions, getOrgsByConditions } from
|
|
4
|
-
import { Pagination } from
|
|
1
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
2
|
+
import TabList from "../tabList";
|
|
3
|
+
import { getUsersByConditions, getOrgsByConditions } from "../../api/tabList";
|
|
4
|
+
import { Pagination } from "dcp-design-react";
|
|
5
5
|
|
|
6
6
|
const SearchPageIndex = (props) => {
|
|
7
7
|
const {
|
|
@@ -27,16 +27,17 @@ const SearchPageIndex = (props) => {
|
|
|
27
27
|
setItemKeys(selectedKeys || []);
|
|
28
28
|
}, [selectedKeys]);
|
|
29
29
|
const itemSelect = (value, checked) => {
|
|
30
|
-
if (mode ===
|
|
30
|
+
if (mode === "multiple") {
|
|
31
31
|
onItemSelect && onItemSelect(value, checked);
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
34
|
setItemKeys([value]);
|
|
35
35
|
const field = dataSource.find((item) => item.id === value);
|
|
36
|
-
onValueChange &&
|
|
36
|
+
onValueChange &&
|
|
37
|
+
onValueChange({ ...field, value: field.id, label: field.userName });
|
|
37
38
|
};
|
|
38
39
|
const fetchHandleApi = async (params) => {
|
|
39
|
-
if (type !==
|
|
40
|
+
if (type !== "org") {
|
|
40
41
|
return getUsersByConditions(params);
|
|
41
42
|
}
|
|
42
43
|
return getOrgsByConditions(params);
|
|
@@ -73,7 +74,9 @@ const SearchPageIndex = (props) => {
|
|
|
73
74
|
};
|
|
74
75
|
useEffect(() => {
|
|
75
76
|
if (fetchParams.currentPage) {
|
|
76
|
-
|
|
77
|
+
if (fetchParams.name) {
|
|
78
|
+
getData({ ...fetchParams });
|
|
79
|
+
}
|
|
77
80
|
}
|
|
78
81
|
|
|
79
82
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -50,6 +50,7 @@ const SearchTabs = (props) => {
|
|
|
50
50
|
const { data, onClose, onDataChange, mode, items, customData } = props;
|
|
51
51
|
const [itemsList, setItemsList] = useState(item);
|
|
52
52
|
const [fetchParams, setFetchParams] = useState({});
|
|
53
|
+
const [value, setValue] = useState('');
|
|
53
54
|
|
|
54
55
|
const [activeKey, setActiveKey] = useState('1');
|
|
55
56
|
const prevActiveKey = useRef('1');
|
|
@@ -71,6 +72,7 @@ const SearchTabs = (props) => {
|
|
|
71
72
|
}, [items]);
|
|
72
73
|
const fetchHandle = (field) => {
|
|
73
74
|
const { type, name } = field;
|
|
75
|
+
console.log(field);
|
|
74
76
|
if (name === '') {
|
|
75
77
|
setActiveKey(prevActiveKey.current);
|
|
76
78
|
return;
|
|
@@ -80,6 +82,7 @@ const SearchTabs = (props) => {
|
|
|
80
82
|
name,
|
|
81
83
|
// orgIdList: params.orgIdList?.map((item) => item.value),
|
|
82
84
|
// roleId: params.roleId?.value,
|
|
85
|
+
deleted: 0,
|
|
83
86
|
orgTypeCode: 'def',
|
|
84
87
|
};
|
|
85
88
|
setActiveKey('5');
|
|
@@ -95,8 +98,12 @@ const SearchTabs = (props) => {
|
|
|
95
98
|
}
|
|
96
99
|
};
|
|
97
100
|
const onSearch = (e) => {
|
|
101
|
+
if (e === '') {
|
|
102
|
+
setActiveKey(prevActiveKey.current);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
98
105
|
setActiveKey('5');
|
|
99
|
-
setFetchParams({ name: e, orgTypeCode: 'def' });
|
|
106
|
+
setFetchParams({ name: e, orgTypeCode: 'def', deleted: 0 });
|
|
100
107
|
};
|
|
101
108
|
return (
|
|
102
109
|
<div className="search-assistance-tabs">
|
|
@@ -113,38 +120,59 @@ const SearchTabs = (props) => {
|
|
|
113
120
|
) : (
|
|
114
121
|
<Search
|
|
115
122
|
// bordered={false}
|
|
116
|
-
|
|
117
|
-
|
|
123
|
+
value={value}
|
|
124
|
+
onChange={(e) => setValue(e.target.value)}
|
|
118
125
|
onSearch={onSearch}
|
|
119
126
|
allowClear
|
|
120
127
|
/>
|
|
121
128
|
)
|
|
122
129
|
}
|
|
123
130
|
/>
|
|
124
|
-
<div
|
|
131
|
+
<div
|
|
132
|
+
className={'search-assistance-tabs-content'}
|
|
133
|
+
// style={{ display: activeKey !== '5' ? 'block' : 'none' }}
|
|
134
|
+
>
|
|
125
135
|
{mode === 'multiple' ? (
|
|
126
136
|
<TransferIndex
|
|
127
137
|
data={data || []}
|
|
128
138
|
customData={customData}
|
|
129
139
|
leftChildren={
|
|
130
|
-
componentList[activeKey] ?
|
|
140
|
+
componentList[activeKey] ? (
|
|
141
|
+
React.cloneElement(componentList[prevActiveKey.current])
|
|
142
|
+
) : (
|
|
143
|
+
<></>
|
|
144
|
+
)
|
|
131
145
|
}
|
|
132
|
-
|
|
146
|
+
activeKey={activeKey}
|
|
133
147
|
onTabChange={tabSearchChange}
|
|
148
|
+
onValueChange={onValueChange}
|
|
134
149
|
params={fetchParams}
|
|
135
150
|
type={itemsList.find((item) => item.key === activeKey)?.type || 'default'}
|
|
136
151
|
/>
|
|
137
152
|
) : (
|
|
138
|
-
componentList[activeKey] &&
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
153
|
+
componentList[activeKey] && (
|
|
154
|
+
<>
|
|
155
|
+
{activeKey === '5' &&
|
|
156
|
+
React.cloneElement(<SearchPageIndex />, {
|
|
157
|
+
mode,
|
|
158
|
+
selectedKeys: data?.value ? [data.value] : [],
|
|
159
|
+
onValueChange,
|
|
160
|
+
customData,
|
|
161
|
+
targetKeys: [],
|
|
162
|
+
params: fetchParams,
|
|
163
|
+
type: itemsList.find((item) => item.key === activeKey)?.type || 'default',
|
|
164
|
+
})}
|
|
165
|
+
{React.cloneElement(componentList[prevActiveKey.current], {
|
|
166
|
+
mode,
|
|
167
|
+
selectedKeys: data?.value ? [data.value] : [],
|
|
168
|
+
onValueChange,
|
|
169
|
+
customData,
|
|
170
|
+
targetKeys: [],
|
|
171
|
+
// params: params,
|
|
172
|
+
type: itemsList.find((item) => item.key === activeKey)?.type || 'default',
|
|
173
|
+
})}
|
|
174
|
+
</>
|
|
175
|
+
)
|
|
148
176
|
)}
|
|
149
177
|
</div>
|
|
150
178
|
</div>
|
|
@@ -4,7 +4,7 @@ import SearchTransferRight from './searchTransferRight';
|
|
|
4
4
|
import { Input, Transfer } from 'dcp-design-react';
|
|
5
5
|
import { getUsersUnderOrg } from '../api/treeData';
|
|
6
6
|
import { getUsersByCustomGroup } from '../api/tabList';
|
|
7
|
-
|
|
7
|
+
import SearchPageIndex from '../component/search';
|
|
8
8
|
|
|
9
9
|
const { Search } = Input;
|
|
10
10
|
import './style.less';
|
|
@@ -18,7 +18,7 @@ const searchTransfer = ({ onSearch }) => {
|
|
|
18
18
|
};
|
|
19
19
|
const searchLeft = ({ type, onSearch, value, onSearchChange }) => {
|
|
20
20
|
console.log(type);
|
|
21
|
-
return type !== 'dept' && type !== 'doc' && type !== 'customNode' ? (
|
|
21
|
+
return type !== 'dept' && type !== 'doc' && type !== 'customNode' && type !== 'customOrg' ? (
|
|
22
22
|
<div className="search-transfer-action">
|
|
23
23
|
<Search
|
|
24
24
|
bordered={false}
|
|
@@ -40,6 +40,7 @@ const TransferIndex = ({
|
|
|
40
40
|
type,
|
|
41
41
|
params = {},
|
|
42
42
|
customData = [],
|
|
43
|
+
activeKey,
|
|
43
44
|
}) => {
|
|
44
45
|
const [transferDataSource, setTransferDataSource] = useState<any[]>([]);
|
|
45
46
|
const [targetKeys, setTargetKeys] = useState<string[]>([]);
|
|
@@ -51,6 +52,11 @@ const TransferIndex = ({
|
|
|
51
52
|
setTargetKeys(data.map((item) => item.id) || []);
|
|
52
53
|
}
|
|
53
54
|
}, [data]);
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (activeKey !== '5') {
|
|
57
|
+
setLeftValue('');
|
|
58
|
+
}
|
|
59
|
+
}, [activeKey]);
|
|
54
60
|
const getUserData = async (list) => {
|
|
55
61
|
const lists = transferDataSource
|
|
56
62
|
.filter((item) => list.includes(item.id) && item.orgtype)
|
|
@@ -166,25 +172,49 @@ const TransferIndex = ({
|
|
|
166
172
|
>
|
|
167
173
|
{({ direction, onItemSelect, selectedKeys, onItemSelectAll }) => {
|
|
168
174
|
if (direction === 'left') {
|
|
169
|
-
return
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
175
|
+
return (
|
|
176
|
+
<>
|
|
177
|
+
{activeKey === '5' &&
|
|
178
|
+
React.cloneElement(<SearchPageIndex />, {
|
|
179
|
+
height: 300,
|
|
180
|
+
mode: 'multiple',
|
|
181
|
+
onDataChange: (data) => {
|
|
182
|
+
console.log(123);
|
|
183
|
+
console.log(data);
|
|
184
|
+
setTransferDataSource(data);
|
|
185
|
+
},
|
|
186
|
+
onTypeChange: onTypeChange,
|
|
187
|
+
targetKeys: targetKeys,
|
|
188
|
+
onItemSelect: onItemSelect,
|
|
189
|
+
selectedKeys: selectedKeys,
|
|
190
|
+
onItemSelectAll: onItemSelectAll,
|
|
191
|
+
onDoubleClickChange: onDoubleClickChange,
|
|
192
|
+
data: data,
|
|
193
|
+
type: type,
|
|
194
|
+
params: params,
|
|
195
|
+
customData,
|
|
196
|
+
})}
|
|
197
|
+
{React.cloneElement(leftChildren, {
|
|
198
|
+
height: 300,
|
|
199
|
+
mode: 'multiple',
|
|
200
|
+
onDataChange: (data) => {
|
|
201
|
+
console.log(123);
|
|
202
|
+
console.log(data);
|
|
203
|
+
setTransferDataSource(data);
|
|
204
|
+
},
|
|
205
|
+
onTypeChange: onTypeChange,
|
|
206
|
+
targetKeys: targetKeys,
|
|
207
|
+
onItemSelect: onItemSelect,
|
|
208
|
+
selectedKeys: selectedKeys,
|
|
209
|
+
onItemSelectAll: onItemSelectAll,
|
|
210
|
+
onDoubleClickChange: onDoubleClickChange,
|
|
211
|
+
data: data,
|
|
212
|
+
type: type,
|
|
213
|
+
params: params,
|
|
214
|
+
customData,
|
|
215
|
+
})}
|
|
216
|
+
</>
|
|
217
|
+
);
|
|
188
218
|
}
|
|
189
219
|
if (direction === 'right') {
|
|
190
220
|
return (
|
|
@@ -125,7 +125,7 @@ const TreeData = (props) => {
|
|
|
125
125
|
data: list,
|
|
126
126
|
};
|
|
127
127
|
} else {
|
|
128
|
-
const resPer: any = await (type === 'default'
|
|
128
|
+
const resPer: any = await (type === 'default' && field.hasChildren
|
|
129
129
|
? getOrgPerson({ id: params.id })
|
|
130
130
|
: new Promise((resolve) => {
|
|
131
131
|
resolve({
|