@tddc/assign-modal 3.0.7 → 3.0.8
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/es/AssignModal/AssignApp/Edit.js +1101 -484
- package/es/AssignModal/AssignApp/Edit_without_TntdVirtualTree.js +928 -435
- package/es/AssignModal/AssignApp/View.js +576 -247
- package/es/AssignModal/AssignApp/index.js +5 -3
- package/es/AssignModal/AssignApp/index.less +4 -0
- package/es/AssignModal/AssignApp/utils.js +133 -30
- package/es/AssignModal/index.js +135 -32
- package/es/index.js +1 -1
- package/es/locale.js +22 -12
- package/package.json +1 -1
|
@@ -1,19 +1,92 @@
|
|
|
1
|
-
import _Input from
|
|
2
|
-
import _Icon from
|
|
3
|
-
import _Tooltip from
|
|
4
|
-
import _Empty from
|
|
5
|
-
import _Ellipsis from
|
|
6
|
-
function _toConsumableArray(r) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import _Input from 'tntd/es/input';
|
|
2
|
+
import _Icon from 'tntd/es/icon';
|
|
3
|
+
import _Tooltip from 'tntd/es/tooltip';
|
|
4
|
+
import _Empty from 'tntd/es/empty';
|
|
5
|
+
import _Ellipsis from 'tntd/es/ellipsis';
|
|
6
|
+
function _toConsumableArray(r) {
|
|
7
|
+
return (
|
|
8
|
+
_arrayWithoutHoles(r) ||
|
|
9
|
+
_iterableToArray(r) ||
|
|
10
|
+
_unsupportedIterableToArray(r) ||
|
|
11
|
+
_nonIterableSpread()
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
function _nonIterableSpread() {
|
|
15
|
+
throw new TypeError(
|
|
16
|
+
'Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.',
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
function _iterableToArray(r) {
|
|
20
|
+
if (('undefined' != typeof Symbol && null != r[Symbol.iterator]) || null != r['@@iterator'])
|
|
21
|
+
return Array.from(r);
|
|
22
|
+
}
|
|
23
|
+
function _arrayWithoutHoles(r) {
|
|
24
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
25
|
+
}
|
|
26
|
+
function _slicedToArray(r, e) {
|
|
27
|
+
return (
|
|
28
|
+
_arrayWithHoles(r) ||
|
|
29
|
+
_iterableToArrayLimit(r, e) ||
|
|
30
|
+
_unsupportedIterableToArray(r, e) ||
|
|
31
|
+
_nonIterableRest()
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
function _nonIterableRest() {
|
|
35
|
+
throw new TypeError(
|
|
36
|
+
'Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.',
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
function _unsupportedIterableToArray(r, a) {
|
|
40
|
+
if (r) {
|
|
41
|
+
if ('string' == typeof r) return _arrayLikeToArray(r, a);
|
|
42
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
43
|
+
return (
|
|
44
|
+
'Object' === t && r.constructor && (t = r.constructor.name),
|
|
45
|
+
'Map' === t || 'Set' === t
|
|
46
|
+
? Array.from(r)
|
|
47
|
+
: 'Arguments' === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)
|
|
48
|
+
? _arrayLikeToArray(r, a)
|
|
49
|
+
: void 0
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function _arrayLikeToArray(r, a) {
|
|
54
|
+
(null == a || a > r.length) && (a = r.length);
|
|
55
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
56
|
+
return n;
|
|
57
|
+
}
|
|
58
|
+
function _iterableToArrayLimit(r, l) {
|
|
59
|
+
var t =
|
|
60
|
+
null == r ? null : ('undefined' != typeof Symbol && r[Symbol.iterator]) || r['@@iterator'];
|
|
61
|
+
if (null != t) {
|
|
62
|
+
var e,
|
|
63
|
+
n,
|
|
64
|
+
i,
|
|
65
|
+
u,
|
|
66
|
+
a = [],
|
|
67
|
+
f = !0,
|
|
68
|
+
o = !1;
|
|
69
|
+
try {
|
|
70
|
+
if (((i = (t = t.call(r)).next), 0 === l)) {
|
|
71
|
+
if (Object(t) !== t) return;
|
|
72
|
+
f = !1;
|
|
73
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
74
|
+
} catch (r) {
|
|
75
|
+
(o = !0), (n = r);
|
|
76
|
+
} finally {
|
|
77
|
+
try {
|
|
78
|
+
if (!f && null != t.return && ((u = t.return()), Object(u) !== u)) return;
|
|
79
|
+
} finally {
|
|
80
|
+
if (o) throw n;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return a;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function _arrayWithHoles(r) {
|
|
87
|
+
if (Array.isArray(r)) return r;
|
|
88
|
+
}
|
|
89
|
+
import React from 'react';
|
|
17
90
|
import { useEffect, useState, useCallback, useRef, useMemo } from 'react';
|
|
18
91
|
import { debounce } from 'lodash';
|
|
19
92
|
import './index.less';
|
|
@@ -45,20 +118,30 @@ var AssignModal = function AssignModal(props) {
|
|
|
45
118
|
var appMapRef = useRef({});
|
|
46
119
|
var userMapRef = useRef({});
|
|
47
120
|
var rootNode = orgList[0];
|
|
48
|
-
var _useMemo = useMemo(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
121
|
+
var _useMemo = useMemo(
|
|
122
|
+
function () {
|
|
123
|
+
var org = preorder(
|
|
124
|
+
rootNode,
|
|
125
|
+
function (key, obj) {
|
|
126
|
+
orgMapRef.current[key] = obj;
|
|
127
|
+
},
|
|
128
|
+
true,
|
|
129
|
+
);
|
|
130
|
+
var app = appList.map(function (item) {
|
|
131
|
+
appMapRef.current[item.value] = item;
|
|
132
|
+
return item.value;
|
|
133
|
+
});
|
|
134
|
+
var user =
|
|
135
|
+
(userList === null || userList === void 0
|
|
136
|
+
? void 0
|
|
137
|
+
: userList.map(function (item) {
|
|
138
|
+
userMapRef.current[item.account] = item;
|
|
139
|
+
return item.account;
|
|
140
|
+
})) || [];
|
|
141
|
+
return [org, app, user];
|
|
142
|
+
},
|
|
143
|
+
[rootNode, appList, userList],
|
|
144
|
+
),
|
|
62
145
|
_useMemo2 = _slicedToArray(_useMemo, 3),
|
|
63
146
|
allOrg = _useMemo2[0],
|
|
64
147
|
allApp = _useMemo2[1],
|
|
@@ -80,238 +163,484 @@ var AssignModal = function AssignModal(props) {
|
|
|
80
163
|
filterOrg = _useState8[0],
|
|
81
164
|
setFilterOrg = _useState8[1];
|
|
82
165
|
var _useState9 = useState(),
|
|
83
|
-
|
|
84
|
-
filterUser =
|
|
85
|
-
setFilterUser =
|
|
86
|
-
var
|
|
87
|
-
|
|
88
|
-
filterApp =
|
|
89
|
-
setFilterApp =
|
|
90
|
-
useEffect(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
initOrgs = Array.from(new Set([].concat(_toConsumableArray(orgCodes || []), _toConsumableArray(path))));
|
|
100
|
-
}
|
|
101
|
-
if (appCodes.includes('all')) {
|
|
102
|
-
initApps = allApp;
|
|
103
|
-
} else {
|
|
104
|
-
initApps = Array.from(new Set([].concat(_toConsumableArray(appCodes || []), [appCode])));
|
|
105
|
-
}
|
|
106
|
-
if (showUser) {
|
|
107
|
-
if (accounts.includes('all')) {
|
|
108
|
-
initAccounts = allUser;
|
|
166
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
167
|
+
filterUser = _useState0[0],
|
|
168
|
+
setFilterUser = _useState0[1];
|
|
169
|
+
var _useState1 = useState(),
|
|
170
|
+
_useState10 = _slicedToArray(_useState1, 2),
|
|
171
|
+
filterApp = _useState10[0],
|
|
172
|
+
setFilterApp = _useState10[1];
|
|
173
|
+
useEffect(
|
|
174
|
+
function () {
|
|
175
|
+
// path 和 allOrgList 赋值
|
|
176
|
+
path = findSameCodePath(rootNode, orgCode);
|
|
177
|
+
var initOrgs = [];
|
|
178
|
+
var initApps = [];
|
|
179
|
+
var initAccounts = [];
|
|
180
|
+
if (orgCodes.includes('all')) {
|
|
181
|
+
initOrgs = allOrg;
|
|
109
182
|
} else {
|
|
110
|
-
|
|
183
|
+
initOrgs = Array.from(
|
|
184
|
+
new Set([].concat(_toConsumableArray(orgCodes || []), _toConsumableArray(path))),
|
|
185
|
+
);
|
|
111
186
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
187
|
+
if (appCodes.includes('all')) {
|
|
188
|
+
initApps = allApp;
|
|
189
|
+
} else {
|
|
190
|
+
initApps = Array.from(new Set([].concat(_toConsumableArray(appCodes || []), [appCode])));
|
|
191
|
+
}
|
|
192
|
+
if (showUser) {
|
|
193
|
+
if (accounts.includes('all')) {
|
|
194
|
+
initAccounts = allUser;
|
|
195
|
+
} else {
|
|
196
|
+
initAccounts = Array.from(
|
|
197
|
+
new Set([].concat(_toConsumableArray(accounts || []), [account])),
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
setCheckedKeys(initOrgs);
|
|
202
|
+
setAppKeys(initApps || []);
|
|
203
|
+
setUserKeys(initAccounts || []);
|
|
204
|
+
},
|
|
205
|
+
[dataItem],
|
|
206
|
+
);
|
|
207
|
+
var debouncedOrgSearch = useCallback(
|
|
208
|
+
debounce(function (nextValue) {
|
|
209
|
+
setFilterOrg(nextValue);
|
|
210
|
+
}, 200),
|
|
211
|
+
[],
|
|
212
|
+
);
|
|
213
|
+
var debouncedUserSearch = useCallback(
|
|
214
|
+
debounce(function (nextValue) {
|
|
215
|
+
setFilterUser(nextValue);
|
|
216
|
+
}, 200),
|
|
217
|
+
[],
|
|
218
|
+
);
|
|
219
|
+
var debouncedAppSearch = useCallback(
|
|
220
|
+
debounce(function (nextValue) {
|
|
221
|
+
setFilterApp(nextValue);
|
|
222
|
+
}, 200),
|
|
223
|
+
[],
|
|
224
|
+
);
|
|
126
225
|
// 获取机构路径的中文显示名并拼接
|
|
127
226
|
var getOrgPathDisplayName = function getOrgPathDisplayName() {
|
|
128
227
|
var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
129
228
|
var displayName = '';
|
|
130
229
|
if (path.length > 0) {
|
|
131
|
-
displayName = path
|
|
132
|
-
|
|
133
|
-
|
|
230
|
+
displayName = path
|
|
231
|
+
.map(function (item) {
|
|
232
|
+
return orgMapRef.current[item].name;
|
|
233
|
+
})
|
|
234
|
+
.join(' / ');
|
|
134
235
|
}
|
|
135
236
|
return displayName;
|
|
136
237
|
};
|
|
137
238
|
|
|
138
239
|
// 渲染Org列表
|
|
139
|
-
var orgListDomRender = useMemo(
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
240
|
+
var orgListDomRender = useMemo(
|
|
241
|
+
function () {
|
|
242
|
+
var renderOrgItem = function renderOrgItem(item, lang) {
|
|
243
|
+
console.log(item, 'item');
|
|
244
|
+
var mapResult = {
|
|
245
|
+
1: {
|
|
246
|
+
cn: '职能部门',
|
|
247
|
+
en: 'Func. Dept.',
|
|
248
|
+
icon: 'crowd',
|
|
249
|
+
},
|
|
250
|
+
2: {
|
|
251
|
+
icon: 'corporation',
|
|
252
|
+
},
|
|
253
|
+
};
|
|
254
|
+
var result = mapResult[item === null || item === void 0 ? void 0 : item.orgAttribute] || {};
|
|
255
|
+
return /*#__PURE__*/ React.createElement(
|
|
256
|
+
'div',
|
|
257
|
+
{
|
|
258
|
+
className: 'org-item-wrapper',
|
|
259
|
+
style: {
|
|
260
|
+
width: '100%',
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
/*#__PURE__*/ React.createElement(_Ellipsis, {
|
|
264
|
+
title: item.name,
|
|
265
|
+
widthLimit: String(item.orgAttribute) === '1' ? 'calc(100% - 90px}' : '100%',
|
|
266
|
+
}),
|
|
267
|
+
String(item.orgAttribute) === '1' &&
|
|
268
|
+
/*#__PURE__*/ React.createElement(
|
|
269
|
+
'span',
|
|
270
|
+
{
|
|
271
|
+
className: 'org-functional-departemt-marker',
|
|
272
|
+
},
|
|
273
|
+
result[lang] || '职能部门',
|
|
274
|
+
),
|
|
275
|
+
);
|
|
151
276
|
};
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
277
|
+
return (
|
|
278
|
+
checkedKeys
|
|
279
|
+
.filter(function (i) {
|
|
280
|
+
var node = orgMapRef.current[i] || {};
|
|
281
|
+
var path = node.path,
|
|
282
|
+
name = node.name;
|
|
283
|
+
if (!path && !name) return false;
|
|
284
|
+
var pathDisplayName = getOrgPathDisplayName(path);
|
|
285
|
+
if (filterOrg) {
|
|
286
|
+
return (
|
|
287
|
+
(pathDisplayName === null || pathDisplayName === void 0
|
|
288
|
+
? void 0
|
|
289
|
+
: pathDisplayName
|
|
290
|
+
.toLocaleLowerCase()
|
|
291
|
+
.includes(
|
|
292
|
+
filterOrg === null || filterOrg === void 0
|
|
293
|
+
? void 0
|
|
294
|
+
: filterOrg.toLocaleLowerCase(),
|
|
295
|
+
)) ||
|
|
296
|
+
(name === null || name === void 0
|
|
297
|
+
? void 0
|
|
298
|
+
: name
|
|
299
|
+
.toLocaleLowerCase()
|
|
300
|
+
.includes(
|
|
301
|
+
filterOrg === null || filterOrg === void 0
|
|
302
|
+
? void 0
|
|
303
|
+
: filterOrg.toLocaleLowerCase(),
|
|
304
|
+
))
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
return i;
|
|
308
|
+
})
|
|
309
|
+
.map(function (item, index) {
|
|
310
|
+
var node = orgMapRef.current[item] || {};
|
|
311
|
+
var path = node.path,
|
|
312
|
+
name = node.name;
|
|
313
|
+
var pathDisplayName = getOrgPathDisplayName(path);
|
|
314
|
+
if (!path && !name) return null;
|
|
315
|
+
return /*#__PURE__*/ React.createElement(
|
|
316
|
+
'li',
|
|
317
|
+
{
|
|
318
|
+
key: item.value + index,
|
|
319
|
+
className: 'select-menu-list-item',
|
|
320
|
+
},
|
|
321
|
+
/*#__PURE__*/ React.createElement(
|
|
322
|
+
'span',
|
|
323
|
+
{
|
|
324
|
+
className: 'org-name',
|
|
325
|
+
},
|
|
326
|
+
/*#__PURE__*/ React.createElement(_Ellipsis, {
|
|
327
|
+
title: renderOrgItem(
|
|
328
|
+
node,
|
|
329
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
330
|
+
),
|
|
331
|
+
}),
|
|
332
|
+
),
|
|
333
|
+
/*#__PURE__*/ React.createElement(
|
|
334
|
+
'span',
|
|
335
|
+
{
|
|
336
|
+
className: 'path-name',
|
|
337
|
+
},
|
|
338
|
+
/*#__PURE__*/ React.createElement(_Ellipsis, {
|
|
339
|
+
title: pathDisplayName,
|
|
340
|
+
}),
|
|
341
|
+
),
|
|
342
|
+
);
|
|
343
|
+
}) || /*#__PURE__*/ React.createElement(_Empty, null)
|
|
344
|
+
);
|
|
345
|
+
},
|
|
346
|
+
[userList, checkedKeys, filterOrg],
|
|
347
|
+
);
|
|
195
348
|
// 渲染App列表
|
|
196
|
-
var appListDomRender = useMemo(
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
349
|
+
var appListDomRender = useMemo(
|
|
350
|
+
function () {
|
|
351
|
+
return (
|
|
352
|
+
appKeys
|
|
353
|
+
.filter(function (i) {
|
|
354
|
+
var node = appMapRef.current[i] || {};
|
|
355
|
+
var label = node.label,
|
|
356
|
+
value = node.value;
|
|
357
|
+
if (!value && !label) return false;
|
|
358
|
+
if (filterApp) {
|
|
359
|
+
return (
|
|
360
|
+
(label === null || label === void 0
|
|
361
|
+
? void 0
|
|
362
|
+
: label
|
|
363
|
+
.toLocaleLowerCase()
|
|
364
|
+
.includes(
|
|
365
|
+
filterApp === null || filterApp === void 0
|
|
366
|
+
? void 0
|
|
367
|
+
: filterApp.toLocaleLowerCase(),
|
|
368
|
+
)) ||
|
|
369
|
+
(value === null || value === void 0
|
|
370
|
+
? void 0
|
|
371
|
+
: value
|
|
372
|
+
.toLocaleLowerCase()
|
|
373
|
+
.includes(
|
|
374
|
+
filterApp === null || filterApp === void 0
|
|
375
|
+
? void 0
|
|
376
|
+
: filterApp.toLocaleLowerCase(),
|
|
377
|
+
))
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
return i;
|
|
381
|
+
})
|
|
382
|
+
.map(function (item, index) {
|
|
383
|
+
var node = appMapRef.current[item] || {};
|
|
384
|
+
var value = node.value,
|
|
385
|
+
label = node.label;
|
|
386
|
+
return /*#__PURE__*/ React.createElement(
|
|
387
|
+
'li',
|
|
388
|
+
{
|
|
389
|
+
key: value + index,
|
|
390
|
+
className: 'select-menu-list-item',
|
|
391
|
+
},
|
|
392
|
+
/*#__PURE__*/ React.createElement(
|
|
393
|
+
_Tooltip,
|
|
394
|
+
{
|
|
395
|
+
title: label,
|
|
396
|
+
key: label + index,
|
|
397
|
+
},
|
|
398
|
+
/*#__PURE__*/ React.createElement(
|
|
399
|
+
'span',
|
|
400
|
+
{
|
|
401
|
+
className: 'app-name',
|
|
402
|
+
},
|
|
403
|
+
label,
|
|
404
|
+
),
|
|
405
|
+
),
|
|
406
|
+
);
|
|
407
|
+
}) || /*#__PURE__*/ React.createElement(_Empty, null)
|
|
408
|
+
);
|
|
409
|
+
},
|
|
410
|
+
[appList, appKeys, filterApp],
|
|
411
|
+
);
|
|
221
412
|
|
|
222
413
|
// 渲染User列表
|
|
223
|
-
var userListDomRender = useMemo(
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
size: "small",
|
|
285
|
-
suffix: /*#__PURE__*/React.createElement(_Icon, {
|
|
286
|
-
type: "zoom"
|
|
287
|
-
}),
|
|
288
|
-
style: {
|
|
289
|
-
marginBottom: 16
|
|
290
|
-
}
|
|
291
|
-
}), /*#__PURE__*/React.createElement("ul", {
|
|
292
|
-
className: "select-menu-list"
|
|
293
|
-
}, appListDomRender))), !!showUser && /*#__PURE__*/React.createElement("div", {
|
|
294
|
-
className: "user-panel panel"
|
|
295
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
296
|
-
className: "menu-header"
|
|
297
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
298
|
-
className: "title"
|
|
299
|
-
}, userTitle || getText('authorizesUserList', props === null || props === void 0 ? void 0 : props.lang))), /*#__PURE__*/React.createElement("div", {
|
|
300
|
-
className: "panel-menu-body"
|
|
301
|
-
}, /*#__PURE__*/React.createElement(_Input, {
|
|
302
|
-
size: "small",
|
|
303
|
-
placeholder: getText('enterUserName', props === null || props === void 0 ? void 0 : props.lang),
|
|
304
|
-
onChange: function onChange(e) {
|
|
305
|
-
debouncedUserSearch(e.target.value);
|
|
414
|
+
var userListDomRender = useMemo(
|
|
415
|
+
function () {
|
|
416
|
+
return (
|
|
417
|
+
(userKeys === null || userKeys === void 0
|
|
418
|
+
? void 0
|
|
419
|
+
: userKeys
|
|
420
|
+
.filter(function (item) {
|
|
421
|
+
var node = userMapRef.current[item] || {};
|
|
422
|
+
var account = node.account,
|
|
423
|
+
userName = node.userName;
|
|
424
|
+
if (!userName && !node.account) return false;
|
|
425
|
+
if (filterUser) {
|
|
426
|
+
return (
|
|
427
|
+
(account === null || account === void 0
|
|
428
|
+
? void 0
|
|
429
|
+
: account
|
|
430
|
+
.toLocaleLowerCase()
|
|
431
|
+
.includes(
|
|
432
|
+
filterUser === null || filterUser === void 0
|
|
433
|
+
? void 0
|
|
434
|
+
: filterUser.toLocaleLowerCase(),
|
|
435
|
+
)) ||
|
|
436
|
+
(userName === null || userName === void 0
|
|
437
|
+
? void 0
|
|
438
|
+
: userName
|
|
439
|
+
.toLocaleLowerCase()
|
|
440
|
+
.includes(
|
|
441
|
+
filterUser === null || filterUser === void 0
|
|
442
|
+
? void 0
|
|
443
|
+
: filterUser.toLocaleLowerCase(),
|
|
444
|
+
))
|
|
445
|
+
);
|
|
446
|
+
}
|
|
447
|
+
return item;
|
|
448
|
+
})
|
|
449
|
+
.map(function (item, index) {
|
|
450
|
+
var node = userMapRef.current[item] || {};
|
|
451
|
+
var userName = node.userName;
|
|
452
|
+
return /*#__PURE__*/ React.createElement(
|
|
453
|
+
'li',
|
|
454
|
+
{
|
|
455
|
+
key: userName + index,
|
|
456
|
+
className: 'select-menu-list-item',
|
|
457
|
+
},
|
|
458
|
+
/*#__PURE__*/ React.createElement(
|
|
459
|
+
_Tooltip,
|
|
460
|
+
{
|
|
461
|
+
title: userName,
|
|
462
|
+
key: userName + index,
|
|
463
|
+
},
|
|
464
|
+
/*#__PURE__*/ React.createElement(
|
|
465
|
+
'span',
|
|
466
|
+
{
|
|
467
|
+
className: 'user-name',
|
|
468
|
+
},
|
|
469
|
+
userName,
|
|
470
|
+
),
|
|
471
|
+
),
|
|
472
|
+
);
|
|
473
|
+
})) || /*#__PURE__*/ React.createElement(_Empty, null)
|
|
474
|
+
);
|
|
306
475
|
},
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
476
|
+
[userList, userKeys, filterUser],
|
|
477
|
+
);
|
|
478
|
+
return /*#__PURE__*/ React.createElement(
|
|
479
|
+
React.Fragment,
|
|
480
|
+
null,
|
|
481
|
+
/*#__PURE__*/ React.createElement(
|
|
482
|
+
'div',
|
|
483
|
+
{
|
|
484
|
+
className: 'assign-box-container view-mode',
|
|
485
|
+
},
|
|
486
|
+
/*#__PURE__*/ React.createElement(
|
|
487
|
+
'div',
|
|
488
|
+
{
|
|
489
|
+
className: 'org-panel panel',
|
|
490
|
+
},
|
|
491
|
+
/*#__PURE__*/ React.createElement(
|
|
492
|
+
'div',
|
|
493
|
+
{
|
|
494
|
+
className: 'menu-header',
|
|
495
|
+
},
|
|
496
|
+
/*#__PURE__*/ React.createElement(
|
|
497
|
+
'span',
|
|
498
|
+
{
|
|
499
|
+
className: 'title',
|
|
500
|
+
},
|
|
501
|
+
orgTitle ||
|
|
502
|
+
getText(
|
|
503
|
+
'authorizesOrgList',
|
|
504
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
505
|
+
),
|
|
506
|
+
),
|
|
507
|
+
),
|
|
508
|
+
/*#__PURE__*/ React.createElement(
|
|
509
|
+
'div',
|
|
510
|
+
{
|
|
511
|
+
className: 'panel-menu-body',
|
|
512
|
+
},
|
|
513
|
+
/*#__PURE__*/ React.createElement(
|
|
514
|
+
'ul',
|
|
515
|
+
{
|
|
516
|
+
className: 'select-menu-list',
|
|
517
|
+
},
|
|
518
|
+
/*#__PURE__*/ React.createElement(_Input, {
|
|
519
|
+
size: 'small',
|
|
520
|
+
placeholder: getText(
|
|
521
|
+
'search',
|
|
522
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
523
|
+
),
|
|
524
|
+
onChange: function onChange(e) {
|
|
525
|
+
debouncedOrgSearch(e.target.value);
|
|
526
|
+
},
|
|
527
|
+
suffix: /*#__PURE__*/ React.createElement(_Icon, {
|
|
528
|
+
type: 'zoom',
|
|
529
|
+
}),
|
|
530
|
+
style: {
|
|
531
|
+
marginBottom: 16,
|
|
532
|
+
},
|
|
533
|
+
}),
|
|
534
|
+
orgListDomRender,
|
|
535
|
+
),
|
|
536
|
+
),
|
|
537
|
+
),
|
|
538
|
+
/*#__PURE__*/ React.createElement(
|
|
539
|
+
'div',
|
|
540
|
+
{
|
|
541
|
+
className: 'app-panel panel',
|
|
542
|
+
},
|
|
543
|
+
/*#__PURE__*/ React.createElement(
|
|
544
|
+
'div',
|
|
545
|
+
{
|
|
546
|
+
className: 'menu-header',
|
|
547
|
+
},
|
|
548
|
+
/*#__PURE__*/ React.createElement(
|
|
549
|
+
'span',
|
|
550
|
+
{
|
|
551
|
+
className: 'title',
|
|
552
|
+
},
|
|
553
|
+
appTitle ||
|
|
554
|
+
getText(
|
|
555
|
+
'authorizesAppList',
|
|
556
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
557
|
+
),
|
|
558
|
+
),
|
|
559
|
+
),
|
|
560
|
+
/*#__PURE__*/ React.createElement(
|
|
561
|
+
'div',
|
|
562
|
+
{
|
|
563
|
+
className: 'panel-menu-body',
|
|
564
|
+
},
|
|
565
|
+
/*#__PURE__*/ React.createElement(_Input, {
|
|
566
|
+
onChange: function onChange(e) {
|
|
567
|
+
debouncedAppSearch(e.target.value);
|
|
568
|
+
},
|
|
569
|
+
placeholder: getText(
|
|
570
|
+
'enterAppName',
|
|
571
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
572
|
+
),
|
|
573
|
+
size: 'small',
|
|
574
|
+
suffix: /*#__PURE__*/ React.createElement(_Icon, {
|
|
575
|
+
type: 'zoom',
|
|
576
|
+
}),
|
|
577
|
+
style: {
|
|
578
|
+
marginBottom: 16,
|
|
579
|
+
},
|
|
580
|
+
}),
|
|
581
|
+
/*#__PURE__*/ React.createElement(
|
|
582
|
+
'ul',
|
|
583
|
+
{
|
|
584
|
+
className: 'select-menu-list',
|
|
585
|
+
},
|
|
586
|
+
appListDomRender,
|
|
587
|
+
),
|
|
588
|
+
),
|
|
589
|
+
),
|
|
590
|
+
!!showUser &&
|
|
591
|
+
/*#__PURE__*/ React.createElement(
|
|
592
|
+
'div',
|
|
593
|
+
{
|
|
594
|
+
className: 'user-panel panel',
|
|
595
|
+
},
|
|
596
|
+
/*#__PURE__*/ React.createElement(
|
|
597
|
+
'div',
|
|
598
|
+
{
|
|
599
|
+
className: 'menu-header',
|
|
600
|
+
},
|
|
601
|
+
/*#__PURE__*/ React.createElement(
|
|
602
|
+
'span',
|
|
603
|
+
{
|
|
604
|
+
className: 'title',
|
|
605
|
+
},
|
|
606
|
+
userTitle ||
|
|
607
|
+
getText(
|
|
608
|
+
'authorizesUserList',
|
|
609
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
610
|
+
),
|
|
611
|
+
),
|
|
612
|
+
),
|
|
613
|
+
/*#__PURE__*/ React.createElement(
|
|
614
|
+
'div',
|
|
615
|
+
{
|
|
616
|
+
className: 'panel-menu-body',
|
|
617
|
+
},
|
|
618
|
+
/*#__PURE__*/ React.createElement(_Input, {
|
|
619
|
+
size: 'small',
|
|
620
|
+
placeholder: getText(
|
|
621
|
+
'enterUserName',
|
|
622
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
623
|
+
),
|
|
624
|
+
onChange: function onChange(e) {
|
|
625
|
+
debouncedUserSearch(e.target.value);
|
|
626
|
+
},
|
|
627
|
+
suffix: /*#__PURE__*/ React.createElement(_Icon, {
|
|
628
|
+
type: 'zoom',
|
|
629
|
+
}),
|
|
630
|
+
style: {
|
|
631
|
+
marginBottom: 16,
|
|
632
|
+
},
|
|
633
|
+
}),
|
|
634
|
+
/*#__PURE__*/ React.createElement(
|
|
635
|
+
'ul',
|
|
636
|
+
{
|
|
637
|
+
className: 'select-menu-list',
|
|
638
|
+
},
|
|
639
|
+
userListDomRender,
|
|
640
|
+
),
|
|
641
|
+
),
|
|
642
|
+
),
|
|
643
|
+
),
|
|
644
|
+
);
|
|
316
645
|
};
|
|
317
|
-
export default AssignModal;
|
|
646
|
+
export default AssignModal;
|