@tddc/assign-modal 3.0.6 → 3.0.7
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 +463 -1080
- package/es/AssignModal/AssignApp/Edit_without_TntdVirtualTree.js +414 -907
- package/es/AssignModal/AssignApp/View.js +240 -569
- package/es/AssignModal/AssignApp/index.js +3 -5
- package/es/AssignModal/AssignApp/index.less +1 -1
- package/es/AssignModal/AssignApp/utils.js +30 -133
- package/es/AssignModal/index.js +32 -135
- package/es/index.js +1 -1
- package/es/locale.js +12 -22
- package/package.json +1 -1
|
@@ -1,92 +1,19 @@
|
|
|
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
|
-
|
|
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';
|
|
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) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
7
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
9
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
10
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
11
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
13
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
14
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
15
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
16
|
+
import React from "react";
|
|
90
17
|
import { useEffect, useState, useCallback, useRef, useMemo } from 'react';
|
|
91
18
|
import { debounce } from 'lodash';
|
|
92
19
|
import './index.less';
|
|
@@ -118,30 +45,20 @@ var AssignModal = function AssignModal(props) {
|
|
|
118
45
|
var appMapRef = useRef({});
|
|
119
46
|
var userMapRef = useRef({});
|
|
120
47
|
var rootNode = orgList[0];
|
|
121
|
-
var _useMemo = useMemo(
|
|
122
|
-
function () {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
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
|
-
),
|
|
48
|
+
var _useMemo = useMemo(function () {
|
|
49
|
+
var org = preorder(rootNode, function (key, obj) {
|
|
50
|
+
orgMapRef.current[key] = obj;
|
|
51
|
+
}, true);
|
|
52
|
+
var app = appList.map(function (item) {
|
|
53
|
+
appMapRef.current[item.value] = item;
|
|
54
|
+
return item.value;
|
|
55
|
+
});
|
|
56
|
+
var user = (userList === null || userList === void 0 ? void 0 : userList.map(function (item) {
|
|
57
|
+
userMapRef.current[item.account] = item;
|
|
58
|
+
return item.account;
|
|
59
|
+
})) || [];
|
|
60
|
+
return [org, app, user];
|
|
61
|
+
}, [rootNode, appList, userList]),
|
|
145
62
|
_useMemo2 = _slicedToArray(_useMemo, 3),
|
|
146
63
|
allOrg = _useMemo2[0],
|
|
147
64
|
allApp = _useMemo2[1],
|
|
@@ -170,477 +87,231 @@ var AssignModal = function AssignModal(props) {
|
|
|
170
87
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
171
88
|
filterApp = _useState12[0],
|
|
172
89
|
setFilterApp = _useState12[1];
|
|
173
|
-
useEffect(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
90
|
+
useEffect(function () {
|
|
91
|
+
// path 和 allOrgList 赋值
|
|
92
|
+
path = findSameCodePath(rootNode, orgCode);
|
|
93
|
+
var initOrgs = [];
|
|
94
|
+
var initApps = [];
|
|
95
|
+
var initAccounts = [];
|
|
96
|
+
if (orgCodes.includes('all')) {
|
|
97
|
+
initOrgs = allOrg;
|
|
98
|
+
} else {
|
|
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
109
|
} else {
|
|
190
|
-
|
|
110
|
+
initAccounts = Array.from(new Set([].concat(_toConsumableArray(accounts || []), [account])));
|
|
191
111
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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
|
-
);
|
|
112
|
+
}
|
|
113
|
+
setCheckedKeys(initOrgs);
|
|
114
|
+
setAppKeys(initApps || []);
|
|
115
|
+
setUserKeys(initAccounts || []);
|
|
116
|
+
}, [dataItem]);
|
|
117
|
+
var debouncedOrgSearch = useCallback(debounce(function (nextValue) {
|
|
118
|
+
setFilterOrg(nextValue);
|
|
119
|
+
}, 200), []);
|
|
120
|
+
var debouncedUserSearch = useCallback(debounce(function (nextValue) {
|
|
121
|
+
setFilterUser(nextValue);
|
|
122
|
+
}, 200), []);
|
|
123
|
+
var debouncedAppSearch = useCallback(debounce(function (nextValue) {
|
|
124
|
+
setFilterApp(nextValue);
|
|
125
|
+
}, 200), []);
|
|
225
126
|
// 获取机构路径的中文显示名并拼接
|
|
226
127
|
var getOrgPathDisplayName = function getOrgPathDisplayName() {
|
|
227
128
|
var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
228
129
|
var displayName = '';
|
|
229
130
|
if (path.length > 0) {
|
|
230
|
-
displayName = path
|
|
231
|
-
.
|
|
232
|
-
|
|
233
|
-
})
|
|
234
|
-
.join(' / ');
|
|
131
|
+
displayName = path.map(function (item) {
|
|
132
|
+
return orgMapRef.current[item].name;
|
|
133
|
+
}).join(' / ');
|
|
235
134
|
}
|
|
236
135
|
return displayName;
|
|
237
136
|
};
|
|
238
137
|
|
|
239
138
|
// 渲染Org列表
|
|
240
|
-
var orgListDomRender = useMemo(
|
|
241
|
-
function () {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
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
|
-
);
|
|
139
|
+
var orgListDomRender = useMemo(function () {
|
|
140
|
+
var renderOrgItem = function renderOrgItem(item, lang) {
|
|
141
|
+
console.log(item, 'item');
|
|
142
|
+
var mapResult = {
|
|
143
|
+
1: {
|
|
144
|
+
cn: '职能部门',
|
|
145
|
+
en: 'Func. Dept.',
|
|
146
|
+
icon: 'crowd'
|
|
147
|
+
},
|
|
148
|
+
2: {
|
|
149
|
+
icon: 'corporation'
|
|
150
|
+
}
|
|
276
151
|
};
|
|
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
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
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
|
-
);
|
|
152
|
+
var result = mapResult[item === null || item === void 0 ? void 0 : item.orgAttribute] || {};
|
|
153
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
154
|
+
className: "org-item-wrapper",
|
|
155
|
+
style: {
|
|
156
|
+
width: '100%'
|
|
157
|
+
}
|
|
158
|
+
}, /*#__PURE__*/React.createElement(_Ellipsis, {
|
|
159
|
+
title: item.name,
|
|
160
|
+
widthLimit: String(item.orgAttribute) === '1' ? 'calc(100% - 90px}' : '100%'
|
|
161
|
+
}), String(item.orgAttribute) === '1' && /*#__PURE__*/React.createElement("span", {
|
|
162
|
+
className: "org-functional-departemt-marker"
|
|
163
|
+
}, result[lang] || '职能部门'));
|
|
164
|
+
};
|
|
165
|
+
return checkedKeys.filter(function (i) {
|
|
166
|
+
var node = orgMapRef.current[i] || {};
|
|
167
|
+
var path = node.path,
|
|
168
|
+
name = node.name;
|
|
169
|
+
if (!path && !name) return false;
|
|
170
|
+
var pathDisplayName = getOrgPathDisplayName(path);
|
|
171
|
+
if (filterOrg) {
|
|
172
|
+
return (pathDisplayName === null || pathDisplayName === void 0 ? void 0 : pathDisplayName.toLocaleLowerCase().includes(filterOrg === null || filterOrg === void 0 ? void 0 : filterOrg.toLocaleLowerCase())) || (name === null || name === void 0 ? void 0 : name.toLocaleLowerCase().includes(filterOrg === null || filterOrg === void 0 ? void 0 : filterOrg.toLocaleLowerCase()));
|
|
173
|
+
}
|
|
174
|
+
return i;
|
|
175
|
+
}).map(function (item, index) {
|
|
176
|
+
var node = orgMapRef.current[item] || {};
|
|
177
|
+
var path = node.path,
|
|
178
|
+
name = node.name;
|
|
179
|
+
var pathDisplayName = getOrgPathDisplayName(path);
|
|
180
|
+
if (!path && !name) return null;
|
|
181
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
182
|
+
key: item.value + index,
|
|
183
|
+
className: "select-menu-list-item"
|
|
184
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
185
|
+
className: "org-name"
|
|
186
|
+
}, /*#__PURE__*/React.createElement(_Ellipsis, {
|
|
187
|
+
title: renderOrgItem(node, props === null || props === void 0 ? void 0 : props.lang)
|
|
188
|
+
})), /*#__PURE__*/React.createElement("span", {
|
|
189
|
+
className: "path-name"
|
|
190
|
+
}, /*#__PURE__*/React.createElement(_Ellipsis, {
|
|
191
|
+
title: pathDisplayName
|
|
192
|
+
})));
|
|
193
|
+
}) || /*#__PURE__*/React.createElement(_Empty, null);
|
|
194
|
+
}, [userList, checkedKeys, filterOrg]);
|
|
348
195
|
// 渲染App列表
|
|
349
|
-
var appListDomRender = useMemo(
|
|
350
|
-
function () {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
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
|
-
);
|
|
196
|
+
var appListDomRender = useMemo(function () {
|
|
197
|
+
return appKeys.filter(function (i) {
|
|
198
|
+
var node = appMapRef.current[i] || {};
|
|
199
|
+
var label = node.label,
|
|
200
|
+
value = node.value;
|
|
201
|
+
if (!value && !label) return false;
|
|
202
|
+
if (filterApp) {
|
|
203
|
+
return (label === null || label === void 0 ? void 0 : label.toLocaleLowerCase().includes(filterApp === null || filterApp === void 0 ? void 0 : filterApp.toLocaleLowerCase())) || (value === null || value === void 0 ? void 0 : value.toLocaleLowerCase().includes(filterApp === null || filterApp === void 0 ? void 0 : filterApp.toLocaleLowerCase()));
|
|
204
|
+
}
|
|
205
|
+
return i;
|
|
206
|
+
}).map(function (item, index) {
|
|
207
|
+
var node = appMapRef.current[item] || {};
|
|
208
|
+
var value = node.value,
|
|
209
|
+
label = node.label;
|
|
210
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
211
|
+
key: value + index,
|
|
212
|
+
className: "select-menu-list-item"
|
|
213
|
+
}, /*#__PURE__*/React.createElement(_Tooltip, {
|
|
214
|
+
title: label,
|
|
215
|
+
key: label + index
|
|
216
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
217
|
+
className: "app-name"
|
|
218
|
+
}, label)));
|
|
219
|
+
}) || /*#__PURE__*/React.createElement(_Empty, null);
|
|
220
|
+
}, [appList, appKeys, filterApp]);
|
|
412
221
|
|
|
413
222
|
// 渲染User列表
|
|
414
|
-
var userListDomRender = useMemo(
|
|
415
|
-
function () {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
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
|
-
);
|
|
223
|
+
var userListDomRender = useMemo(function () {
|
|
224
|
+
return (userKeys === null || userKeys === void 0 ? void 0 : userKeys.filter(function (item) {
|
|
225
|
+
var node = userMapRef.current[item] || {};
|
|
226
|
+
var account = node.account,
|
|
227
|
+
userName = node.userName;
|
|
228
|
+
if (!userName && !node.account) return false;
|
|
229
|
+
if (filterUser) {
|
|
230
|
+
return (account === null || account === void 0 ? void 0 : account.toLocaleLowerCase().includes(filterUser === null || filterUser === void 0 ? void 0 : filterUser.toLocaleLowerCase())) || (userName === null || userName === void 0 ? void 0 : userName.toLocaleLowerCase().includes(filterUser === null || filterUser === void 0 ? void 0 : filterUser.toLocaleLowerCase()));
|
|
231
|
+
}
|
|
232
|
+
return item;
|
|
233
|
+
}).map(function (item, index) {
|
|
234
|
+
var node = userMapRef.current[item] || {};
|
|
235
|
+
var userName = node.userName;
|
|
236
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
237
|
+
key: userName + index,
|
|
238
|
+
className: "select-menu-list-item"
|
|
239
|
+
}, /*#__PURE__*/React.createElement(_Tooltip, {
|
|
240
|
+
title: userName,
|
|
241
|
+
key: userName + index
|
|
242
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
243
|
+
className: "user-name"
|
|
244
|
+
}, userName)));
|
|
245
|
+
})) || /*#__PURE__*/React.createElement(_Empty, null);
|
|
246
|
+
}, [userList, userKeys, filterUser]);
|
|
247
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
248
|
+
className: "assign-box-container view-mode"
|
|
249
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
250
|
+
className: "org-panel panel"
|
|
251
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
252
|
+
className: "menu-header"
|
|
253
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
254
|
+
className: "title"
|
|
255
|
+
}, orgTitle || getText('authorizesOrgList', props === null || props === void 0 ? void 0 : props.lang))), /*#__PURE__*/React.createElement("div", {
|
|
256
|
+
className: "panel-menu-body"
|
|
257
|
+
}, /*#__PURE__*/React.createElement("ul", {
|
|
258
|
+
className: "select-menu-list"
|
|
259
|
+
}, /*#__PURE__*/React.createElement(_Input, {
|
|
260
|
+
size: "small",
|
|
261
|
+
placeholder: getText('search', props === null || props === void 0 ? void 0 : props.lang),
|
|
262
|
+
onChange: function onChange(e) {
|
|
263
|
+
debouncedOrgSearch(e.target.value);
|
|
475
264
|
},
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
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
|
-
);
|
|
265
|
+
suffix: /*#__PURE__*/React.createElement(_Icon, {
|
|
266
|
+
type: "zoom"
|
|
267
|
+
}),
|
|
268
|
+
style: {
|
|
269
|
+
marginBottom: 16
|
|
270
|
+
}
|
|
271
|
+
}), orgListDomRender))), /*#__PURE__*/React.createElement("div", {
|
|
272
|
+
className: "app-panel panel"
|
|
273
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
274
|
+
className: "menu-header"
|
|
275
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
276
|
+
className: "title"
|
|
277
|
+
}, appTitle || getText('authorizesAppList', props === null || props === void 0 ? void 0 : props.lang))), /*#__PURE__*/React.createElement("div", {
|
|
278
|
+
className: "panel-menu-body"
|
|
279
|
+
}, /*#__PURE__*/React.createElement(_Input, {
|
|
280
|
+
onChange: function onChange(e) {
|
|
281
|
+
debouncedAppSearch(e.target.value);
|
|
282
|
+
},
|
|
283
|
+
placeholder: getText('enterAppName', props === null || props === void 0 ? void 0 : props.lang),
|
|
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);
|
|
306
|
+
},
|
|
307
|
+
suffix: /*#__PURE__*/React.createElement(_Icon, {
|
|
308
|
+
type: "zoom"
|
|
309
|
+
}),
|
|
310
|
+
style: {
|
|
311
|
+
marginBottom: 16
|
|
312
|
+
}
|
|
313
|
+
}), /*#__PURE__*/React.createElement("ul", {
|
|
314
|
+
className: "select-menu-list"
|
|
315
|
+
}, userListDomRender)))));
|
|
645
316
|
};
|
|
646
|
-
export default AssignModal;
|
|
317
|
+
export default AssignModal;
|