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