@tddc/assign-modal 2.0.2 → 2.0.3
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/index.js +200 -438
- package/es/AssignModal/AssignApp/utils.js +7 -38
- package/es/AssignModal/index.less +7 -7
- package/es/index.js +1 -1
- package/es/locale.js +12 -22
- package/package.json +2 -3
- package/es/AssignModal/index.js +0 -184
- package/lib/AssignModal/AssignApp/index.js +0 -502
- package/lib/AssignModal/AssignApp/index.less +0 -99
- package/lib/AssignModal/AssignApp/utils.js +0 -57
- package/lib/AssignModal/index.js +0 -82
- package/lib/AssignModal/index.less +0 -7
- package/lib/index.js +0 -13
- package/lib/locale.js +0 -52
|
@@ -1,89 +1,18 @@
|
|
|
1
|
-
import _Ellipsis from
|
|
2
|
-
import _Checkbox from
|
|
3
|
-
import _Input from
|
|
4
|
-
import _Tree from
|
|
5
|
-
function _toConsumableArray(arr) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
function _iterableToArray(iter) {
|
|
19
|
-
if (
|
|
20
|
-
(typeof Symbol !== 'undefined' && iter[Symbol.iterator] != null) ||
|
|
21
|
-
iter['@@iterator'] != null
|
|
22
|
-
)
|
|
23
|
-
return Array.from(iter);
|
|
24
|
-
}
|
|
25
|
-
function _arrayWithoutHoles(arr) {
|
|
26
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
27
|
-
}
|
|
28
|
-
function _slicedToArray(arr, i) {
|
|
29
|
-
return (
|
|
30
|
-
_arrayWithHoles(arr) ||
|
|
31
|
-
_iterableToArrayLimit(arr, i) ||
|
|
32
|
-
_unsupportedIterableToArray(arr, i) ||
|
|
33
|
-
_nonIterableRest()
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
function _nonIterableRest() {
|
|
37
|
-
throw new TypeError(
|
|
38
|
-
'Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.',
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
42
|
-
if (!o) return;
|
|
43
|
-
if (typeof o === 'string') return _arrayLikeToArray(o, minLen);
|
|
44
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
45
|
-
if (n === 'Object' && o.constructor) n = o.constructor.name;
|
|
46
|
-
if (n === 'Map' || n === 'Set') return Array.from(o);
|
|
47
|
-
if (n === 'Arguments' || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
48
|
-
return _arrayLikeToArray(o, minLen);
|
|
49
|
-
}
|
|
50
|
-
function _arrayLikeToArray(arr, len) {
|
|
51
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
52
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
53
|
-
return arr2;
|
|
54
|
-
}
|
|
55
|
-
function _iterableToArrayLimit(r, l) {
|
|
56
|
-
var t =
|
|
57
|
-
null == r ? null : ('undefined' != typeof Symbol && r[Symbol.iterator]) || r['@@iterator'];
|
|
58
|
-
if (null != t) {
|
|
59
|
-
var e,
|
|
60
|
-
n,
|
|
61
|
-
i,
|
|
62
|
-
u,
|
|
63
|
-
a = [],
|
|
64
|
-
f = !0,
|
|
65
|
-
o = !1;
|
|
66
|
-
try {
|
|
67
|
-
if (((i = (t = t.call(r)).next), 0 === l)) {
|
|
68
|
-
if (Object(t) !== t) return;
|
|
69
|
-
f = !1;
|
|
70
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
71
|
-
} catch (r) {
|
|
72
|
-
(o = !0), (n = r);
|
|
73
|
-
} finally {
|
|
74
|
-
try {
|
|
75
|
-
if (!f && null != t.return && ((u = t.return()), Object(u) !== u)) return;
|
|
76
|
-
} finally {
|
|
77
|
-
if (o) throw n;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return a;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
function _arrayWithHoles(arr) {
|
|
84
|
-
if (Array.isArray(arr)) return arr;
|
|
85
|
-
}
|
|
86
|
-
import React from 'react';
|
|
1
|
+
import _Ellipsis from "tntd/es/ellipsis";
|
|
2
|
+
import _Checkbox from "tntd/es/checkbox";
|
|
3
|
+
import _Input from "tntd/es/input";
|
|
4
|
+
import _Tree from "tntd/es/tree";
|
|
5
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
6
|
+
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."); }
|
|
7
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
9
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
10
|
+
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."); }
|
|
11
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
12
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
13
|
+
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; } }
|
|
14
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
15
|
+
import React from "react";
|
|
87
16
|
import { useEffect, useState, useCallback } from 'react';
|
|
88
17
|
import { cloneDeep, debounce } from 'lodash';
|
|
89
18
|
import './index.less';
|
|
@@ -124,12 +53,9 @@ var AssignModal = function AssignModal(props) {
|
|
|
124
53
|
var allApp = appList.map(function (item) {
|
|
125
54
|
return item.value;
|
|
126
55
|
});
|
|
127
|
-
var allUser =
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
: userList.map(function (item) {
|
|
131
|
-
return item.account;
|
|
132
|
-
})) || [];
|
|
56
|
+
var allUser = (userList === null || userList === void 0 ? void 0 : userList.map(function (item) {
|
|
57
|
+
return item.account;
|
|
58
|
+
})) || [];
|
|
133
59
|
var _useState = useState([]),
|
|
134
60
|
_useState2 = _slicedToArray(_useState, 2),
|
|
135
61
|
checkedKeys = _useState2[0],
|
|
@@ -161,96 +87,80 @@ var AssignModal = function AssignModal(props) {
|
|
|
161
87
|
if (!((_orgList$ = orgList[0]) === null || _orgList$ === void 0 ? void 0 : _orgList$.path)) {
|
|
162
88
|
addPath(orgList[0], []); // 添加 上级机构到子机构的路径
|
|
163
89
|
}
|
|
164
|
-
useEffect(
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
90
|
+
useEffect(function () {
|
|
91
|
+
// path 和 allOrgList 赋值
|
|
92
|
+
path = findSameCodePath(orgList[0], orgCode);
|
|
93
|
+
var initOrgs = [];
|
|
94
|
+
var initApps = [];
|
|
95
|
+
var initAccounts = [];
|
|
96
|
+
if (orgCodes.includes('all')) {
|
|
97
|
+
setAllOrgChecked(orgCodes.includes('all'));
|
|
98
|
+
initOrgs = allOrg;
|
|
99
|
+
} else {
|
|
100
|
+
initOrgs = Array.from(new Set([].concat(_toConsumableArray(orgCodes || []), _toConsumableArray(path))));
|
|
101
|
+
}
|
|
102
|
+
if (appCodes.includes('all')) {
|
|
103
|
+
setAllAppChecked(appCodes.includes('all'));
|
|
104
|
+
initApps = allApp;
|
|
105
|
+
} else {
|
|
106
|
+
initApps = Array.from(new Set([].concat(_toConsumableArray(appCodes || []), [appCode])));
|
|
107
|
+
}
|
|
108
|
+
if (showUser) {
|
|
109
|
+
if (accounts.includes('all')) {
|
|
110
|
+
setAllUserChecked(true);
|
|
111
|
+
initAccounts = allUser;
|
|
182
112
|
} else {
|
|
183
|
-
|
|
113
|
+
initAccounts = Array.from(new Set([].concat(_toConsumableArray(accounts || []), [account])));
|
|
184
114
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
115
|
+
}
|
|
116
|
+
setCheckedKeys(initOrgs);
|
|
117
|
+
setAppKeys(initApps || []);
|
|
118
|
+
setUserKeys(initAccounts || []);
|
|
119
|
+
onChange && onChange({
|
|
120
|
+
appKeys: appCodes.includes('all') ? ['all'] : initApps,
|
|
121
|
+
checkedKeys: orgCodes.includes('all') ? ['all'] : initOrgs,
|
|
122
|
+
userKeys: accounts.includes('all') ? ['all'] : initAccounts,
|
|
123
|
+
appCheckAll: appCodes.includes('all'),
|
|
124
|
+
orgCheckAll: orgCodes.includes('all'),
|
|
125
|
+
userCheckAll: accounts.includes('all'),
|
|
126
|
+
checkData: {
|
|
127
|
+
apps: initApps,
|
|
128
|
+
orgs: initOrgs,
|
|
129
|
+
accounts: initAccounts
|
|
194
130
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
setUserKeys(initAccounts || []);
|
|
198
|
-
onChange &&
|
|
199
|
-
onChange({
|
|
200
|
-
appKeys: appCodes.includes('all') ? ['all'] : initApps,
|
|
201
|
-
checkedKeys: orgCodes.includes('all') ? ['all'] : initOrgs,
|
|
202
|
-
userKeys: accounts.includes('all') ? ['all'] : initAccounts,
|
|
203
|
-
appCheckAll: appCodes.includes('all'),
|
|
204
|
-
orgCheckAll: orgCodes.includes('all'),
|
|
205
|
-
userCheckAll: accounts.includes('all'),
|
|
206
|
-
checkData: {
|
|
207
|
-
apps: initApps,
|
|
208
|
-
orgs: initOrgs,
|
|
209
|
-
accounts: initAccounts,
|
|
210
|
-
},
|
|
211
|
-
});
|
|
212
|
-
},
|
|
213
|
-
[dataItem],
|
|
214
|
-
);
|
|
131
|
+
});
|
|
132
|
+
}, [dataItem]);
|
|
215
133
|
var loopTreeNodes = function loopTreeNodes(data) {
|
|
216
134
|
var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
217
135
|
var NodeTitle = function NodeTitle(_ref) {
|
|
218
136
|
var node = _ref.node;
|
|
219
|
-
return /*#__PURE__*/
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
className: 'node-title',
|
|
223
|
-
},
|
|
224
|
-
node.title,
|
|
225
|
-
);
|
|
137
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
138
|
+
className: "node-title"
|
|
139
|
+
}, node.title);
|
|
226
140
|
};
|
|
227
141
|
return data.map(function (item) {
|
|
228
142
|
var orgDisabled = path.includes(item.code);
|
|
229
143
|
if (item.children) {
|
|
230
|
-
return /*#__PURE__*/
|
|
231
|
-
|
|
232
|
-
{
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
disabled: orgDisabled || disabled || allOrgChecked,
|
|
239
|
-
},
|
|
240
|
-
loopTreeNodes(item.children, level + 1),
|
|
241
|
-
);
|
|
144
|
+
return /*#__PURE__*/React.createElement(TreeNode, {
|
|
145
|
+
key: item.code,
|
|
146
|
+
title: /*#__PURE__*/React.createElement(NodeTitle, {
|
|
147
|
+
node: item
|
|
148
|
+
}),
|
|
149
|
+
item: item,
|
|
150
|
+
disabled: orgDisabled || disabled || allOrgChecked
|
|
151
|
+
}, loopTreeNodes(item.children, level + 1));
|
|
242
152
|
}
|
|
243
|
-
return /*#__PURE__*/
|
|
153
|
+
return /*#__PURE__*/React.createElement(TreeNode, {
|
|
244
154
|
style: {
|
|
245
|
-
paddingLeft:
|
|
246
|
-
marginLeft:
|
|
155
|
+
paddingLeft: "".concat((level + 1) * 14, "px"),
|
|
156
|
+
marginLeft: "-".concat(level * 14, "px")
|
|
247
157
|
},
|
|
248
158
|
key: item.code,
|
|
249
|
-
title: /*#__PURE__*/
|
|
250
|
-
node: item
|
|
159
|
+
title: /*#__PURE__*/React.createElement(NodeTitle, {
|
|
160
|
+
node: item
|
|
251
161
|
}),
|
|
252
162
|
item: item,
|
|
253
|
-
disabled: orgDisabled || disabled
|
|
163
|
+
disabled: orgDisabled || disabled
|
|
254
164
|
});
|
|
255
165
|
});
|
|
256
166
|
};
|
|
@@ -270,9 +180,7 @@ var AssignModal = function AssignModal(props) {
|
|
|
270
180
|
});
|
|
271
181
|
}
|
|
272
182
|
if (info.checked) {
|
|
273
|
-
checked = Array.from(
|
|
274
|
-
new Set([].concat(_toConsumableArray(checked), _toConsumableArray(path))),
|
|
275
|
-
);
|
|
183
|
+
checked = Array.from(new Set([].concat(_toConsumableArray(checked), _toConsumableArray(path))));
|
|
276
184
|
}
|
|
277
185
|
setCheckedKeys(checked);
|
|
278
186
|
onChange({
|
|
@@ -285,8 +193,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
285
193
|
checkData: {
|
|
286
194
|
apps: appKeys,
|
|
287
195
|
orgs: checked,
|
|
288
|
-
accounts: userKeys
|
|
289
|
-
}
|
|
196
|
+
accounts: userKeys
|
|
197
|
+
}
|
|
290
198
|
});
|
|
291
199
|
};
|
|
292
200
|
var assignApp = function assignApp(e) {
|
|
@@ -315,8 +223,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
315
223
|
checkData: {
|
|
316
224
|
apps: newAppKeys,
|
|
317
225
|
orgs: checkedKeys,
|
|
318
|
-
accounts: userKeys
|
|
319
|
-
}
|
|
226
|
+
accounts: userKeys
|
|
227
|
+
}
|
|
320
228
|
});
|
|
321
229
|
};
|
|
322
230
|
var assignUser = function assignUser(e) {
|
|
@@ -345,8 +253,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
345
253
|
checkData: {
|
|
346
254
|
apps: appKeys,
|
|
347
255
|
orgs: checkedKeys,
|
|
348
|
-
accounts: newUserKeys
|
|
349
|
-
}
|
|
256
|
+
accounts: newUserKeys
|
|
257
|
+
}
|
|
350
258
|
});
|
|
351
259
|
};
|
|
352
260
|
|
|
@@ -367,15 +275,13 @@ var AssignModal = function AssignModal(props) {
|
|
|
367
275
|
checkData: {
|
|
368
276
|
apps: appKeys,
|
|
369
277
|
orgs: checkedKeys,
|
|
370
|
-
accounts: accounts
|
|
371
|
-
}
|
|
278
|
+
accounts: accounts
|
|
279
|
+
}
|
|
372
280
|
});
|
|
373
281
|
} else {
|
|
374
282
|
setAllOrgChecked(false);
|
|
375
283
|
var arr = orgCodes.includes('all') ? allOrg : orgCodes;
|
|
376
|
-
orgChecks = Array.from(
|
|
377
|
-
new Set([].concat(_toConsumableArray(arr || []), _toConsumableArray(path))),
|
|
378
|
-
);
|
|
284
|
+
orgChecks = Array.from(new Set([].concat(_toConsumableArray(arr || []), _toConsumableArray(path))));
|
|
379
285
|
setCheckedKeys(orgChecks);
|
|
380
286
|
onChange({
|
|
381
287
|
appKeys: allAppChecked ? ['all'] : appKeys,
|
|
@@ -387,8 +293,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
387
293
|
checkData: {
|
|
388
294
|
apps: appKeys,
|
|
389
295
|
orgs: orgChecks,
|
|
390
|
-
accounts: accounts
|
|
391
|
-
}
|
|
296
|
+
accounts: accounts
|
|
297
|
+
}
|
|
392
298
|
});
|
|
393
299
|
}
|
|
394
300
|
};
|
|
@@ -412,8 +318,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
412
318
|
checkData: {
|
|
413
319
|
apps: appChecks,
|
|
414
320
|
orgs: checkedKeys,
|
|
415
|
-
accounts: accounts
|
|
416
|
-
}
|
|
321
|
+
accounts: accounts
|
|
322
|
+
}
|
|
417
323
|
});
|
|
418
324
|
} else {
|
|
419
325
|
setAllAppChecked(false);
|
|
@@ -430,8 +336,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
430
336
|
checkData: {
|
|
431
337
|
apps: appChecks,
|
|
432
338
|
orgs: checkedKeys,
|
|
433
|
-
accounts: accounts
|
|
434
|
-
}
|
|
339
|
+
accounts: accounts
|
|
340
|
+
}
|
|
435
341
|
});
|
|
436
342
|
}
|
|
437
343
|
};
|
|
@@ -455,8 +361,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
455
361
|
checkData: {
|
|
456
362
|
apps: appKeys,
|
|
457
363
|
orgs: checkedKeys,
|
|
458
|
-
accounts: userChecks
|
|
459
|
-
}
|
|
364
|
+
accounts: userChecks
|
|
365
|
+
}
|
|
460
366
|
});
|
|
461
367
|
} else {
|
|
462
368
|
setAllUserChecked(false);
|
|
@@ -473,259 +379,115 @@ var AssignModal = function AssignModal(props) {
|
|
|
473
379
|
checkData: {
|
|
474
380
|
apps: appKeys,
|
|
475
381
|
orgs: checkedKeys,
|
|
476
|
-
accounts: userChecks
|
|
477
|
-
}
|
|
382
|
+
accounts: userChecks
|
|
383
|
+
}
|
|
478
384
|
});
|
|
479
385
|
}
|
|
480
386
|
};
|
|
481
|
-
var debouncedSearch = useCallback(
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
387
|
+
var debouncedSearch = useCallback(debounce(function (nextValue) {
|
|
388
|
+
setFilterUser(nextValue);
|
|
389
|
+
}, 200), []);
|
|
390
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
391
|
+
className: "assign-box-container"
|
|
392
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
393
|
+
className: "left"
|
|
394
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
395
|
+
className: "menu-header"
|
|
396
|
+
}, orgTitle || getText('authorizesOrgList', props === null || props === void 0 ? void 0 : props.lang), /*#__PURE__*/React.createElement("div", {
|
|
397
|
+
className: "menu-all-checked"
|
|
398
|
+
}, /*#__PURE__*/React.createElement(_Checkbox, {
|
|
399
|
+
onChange: checkAllOrg,
|
|
400
|
+
checked: allOrgChecked,
|
|
401
|
+
disabled: disabled
|
|
402
|
+
}, orgCheckboxTitle || getText('allOrgAvailable', props === null || props === void 0 ? void 0 : props.lang)))), /*#__PURE__*/React.createElement(_Tree, {
|
|
403
|
+
blockNode: true,
|
|
404
|
+
className: "tree-list",
|
|
405
|
+
checkable: true,
|
|
406
|
+
checkStrictly: true,
|
|
407
|
+
checkedKeys: checkedKeys,
|
|
408
|
+
defaultExpandAll: true,
|
|
409
|
+
onCheck: onCheck,
|
|
410
|
+
disabled: true
|
|
411
|
+
}, loopTreeNodes(orgList, 0))), /*#__PURE__*/React.createElement("div", {
|
|
412
|
+
className: "right"
|
|
413
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
414
|
+
className: "menu-header"
|
|
415
|
+
}, appTitle || getText('authorizesAppList', props === null || props === void 0 ? void 0 : props.lang), /*#__PURE__*/React.createElement("div", {
|
|
416
|
+
className: "menu-all-checked"
|
|
417
|
+
}, /*#__PURE__*/React.createElement(_Checkbox, {
|
|
418
|
+
onChange: checkedAllApp,
|
|
419
|
+
checked: allAppChecked,
|
|
420
|
+
disabled: disabled
|
|
421
|
+
}, appCheckboxTitle || getText('allAppAvailable', props === null || props === void 0 ? void 0 : props.lang)))), /*#__PURE__*/React.createElement("div", {
|
|
422
|
+
className: "menu-body"
|
|
423
|
+
}, appList.map(function (item, index) {
|
|
424
|
+
var isCheck = appKeys === null || appKeys === void 0 ? void 0 : appKeys.includes(item.value);
|
|
425
|
+
var isOwnAppCode = appCode === item.value;
|
|
426
|
+
return /*#__PURE__*/React.createElement(_Checkbox, {
|
|
427
|
+
checked: isCheck,
|
|
428
|
+
disabled: disabled || isOwnAppCode || allAppChecked,
|
|
429
|
+
onChange: assignApp,
|
|
430
|
+
value: item.value,
|
|
431
|
+
key: index
|
|
432
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
433
|
+
style: {
|
|
434
|
+
display: 'inline-block'
|
|
435
|
+
}
|
|
436
|
+
}, /*#__PURE__*/React.createElement(_Ellipsis, {
|
|
437
|
+
widthLimit: 100,
|
|
438
|
+
title: item.label
|
|
439
|
+
})));
|
|
440
|
+
}))), !!showUser && /*#__PURE__*/React.createElement("div", {
|
|
441
|
+
className: "user"
|
|
442
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
443
|
+
className: "menu-header"
|
|
444
|
+
}, userTitle || getText('authorizesUserList', props === null || props === void 0 ? void 0 : props.lang), /*#__PURE__*/React.createElement("div", {
|
|
445
|
+
className: "menu-all-checked"
|
|
446
|
+
}, /*#__PURE__*/React.createElement(_Checkbox, {
|
|
447
|
+
onChange: checkedAllUser,
|
|
448
|
+
checked: allUserChecked,
|
|
449
|
+
disabled: disabled
|
|
450
|
+
}, userCheckboxTitle || getText('allUserAvailable', props === null || props === void 0 ? void 0 : props.lang)))), /*#__PURE__*/React.createElement("div", {
|
|
451
|
+
className: "menu-body"
|
|
452
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
453
|
+
className: "assign-search-wrap"
|
|
454
|
+
}, /*#__PURE__*/React.createElement(Search, {
|
|
455
|
+
size: "small",
|
|
456
|
+
allowClear: true,
|
|
457
|
+
placeholder: getText('search', props === null || props === void 0 ? void 0 : props.lang),
|
|
458
|
+
onChange: function onChange(e) {
|
|
459
|
+
debouncedSearch(e.target.value);
|
|
491
460
|
},
|
|
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
|
-
blockNode: true,
|
|
525
|
-
className: 'tree-list',
|
|
526
|
-
checkable: true,
|
|
527
|
-
checkStrictly: true,
|
|
528
|
-
checkedKeys: checkedKeys,
|
|
529
|
-
defaultExpandAll: true,
|
|
530
|
-
onCheck: onCheck,
|
|
531
|
-
disabled: true,
|
|
532
|
-
},
|
|
533
|
-
loopTreeNodes(orgList, 0),
|
|
534
|
-
),
|
|
535
|
-
),
|
|
536
|
-
/*#__PURE__*/ React.createElement(
|
|
537
|
-
'div',
|
|
538
|
-
{
|
|
539
|
-
className: 'right',
|
|
540
|
-
},
|
|
541
|
-
/*#__PURE__*/ React.createElement(
|
|
542
|
-
'div',
|
|
543
|
-
{
|
|
544
|
-
className: 'menu-header',
|
|
545
|
-
},
|
|
546
|
-
appTitle ||
|
|
547
|
-
getText('authorizesAppList', props === null || props === void 0 ? void 0 : props.lang),
|
|
548
|
-
/*#__PURE__*/ React.createElement(
|
|
549
|
-
'div',
|
|
550
|
-
{
|
|
551
|
-
className: 'menu-all-checked',
|
|
552
|
-
},
|
|
553
|
-
/*#__PURE__*/ React.createElement(
|
|
554
|
-
_Checkbox,
|
|
555
|
-
{
|
|
556
|
-
onChange: checkedAllApp,
|
|
557
|
-
checked: allAppChecked,
|
|
558
|
-
disabled: disabled,
|
|
559
|
-
},
|
|
560
|
-
appCheckboxTitle ||
|
|
561
|
-
getText('allAppAvailable', props === null || props === void 0 ? void 0 : props.lang),
|
|
562
|
-
),
|
|
563
|
-
),
|
|
564
|
-
),
|
|
565
|
-
/*#__PURE__*/ React.createElement(
|
|
566
|
-
'div',
|
|
567
|
-
{
|
|
568
|
-
className: 'menu-body',
|
|
569
|
-
},
|
|
570
|
-
appList.map(function (item, index) {
|
|
571
|
-
var isCheck =
|
|
572
|
-
appKeys === null || appKeys === void 0 ? void 0 : appKeys.includes(item.value);
|
|
573
|
-
var isOwnAppCode = appCode === item.value;
|
|
574
|
-
return /*#__PURE__*/ React.createElement(
|
|
575
|
-
_Checkbox,
|
|
576
|
-
{
|
|
577
|
-
checked: isCheck,
|
|
578
|
-
disabled: disabled || isOwnAppCode || allAppChecked,
|
|
579
|
-
onChange: assignApp,
|
|
580
|
-
value: item.value,
|
|
581
|
-
key: index,
|
|
582
|
-
},
|
|
583
|
-
/*#__PURE__*/ React.createElement(
|
|
584
|
-
'span',
|
|
585
|
-
{
|
|
586
|
-
style: {
|
|
587
|
-
display: 'inline-block',
|
|
588
|
-
},
|
|
589
|
-
},
|
|
590
|
-
/*#__PURE__*/ React.createElement(_Ellipsis, {
|
|
591
|
-
widthLimit: 100,
|
|
592
|
-
title: item.label,
|
|
593
|
-
}),
|
|
594
|
-
),
|
|
595
|
-
);
|
|
596
|
-
}),
|
|
597
|
-
),
|
|
598
|
-
),
|
|
599
|
-
!!showUser &&
|
|
600
|
-
/*#__PURE__*/ React.createElement(
|
|
601
|
-
'div',
|
|
602
|
-
{
|
|
603
|
-
className: 'user',
|
|
604
|
-
},
|
|
605
|
-
/*#__PURE__*/ React.createElement(
|
|
606
|
-
'div',
|
|
607
|
-
{
|
|
608
|
-
className: 'menu-header',
|
|
609
|
-
},
|
|
610
|
-
userTitle ||
|
|
611
|
-
getText('authorizesUserList', props === null || props === void 0 ? void 0 : props.lang),
|
|
612
|
-
/*#__PURE__*/ React.createElement(
|
|
613
|
-
'div',
|
|
614
|
-
{
|
|
615
|
-
className: 'menu-all-checked',
|
|
616
|
-
},
|
|
617
|
-
/*#__PURE__*/ React.createElement(
|
|
618
|
-
_Checkbox,
|
|
619
|
-
{
|
|
620
|
-
onChange: checkedAllUser,
|
|
621
|
-
checked: allUserChecked,
|
|
622
|
-
disabled: disabled,
|
|
623
|
-
},
|
|
624
|
-
userCheckboxTitle ||
|
|
625
|
-
getText(
|
|
626
|
-
'allUserAvailable',
|
|
627
|
-
props === null || props === void 0 ? void 0 : props.lang,
|
|
628
|
-
),
|
|
629
|
-
),
|
|
630
|
-
),
|
|
631
|
-
),
|
|
632
|
-
/*#__PURE__*/ React.createElement(
|
|
633
|
-
'div',
|
|
634
|
-
{
|
|
635
|
-
className: 'menu-body',
|
|
636
|
-
},
|
|
637
|
-
/*#__PURE__*/ React.createElement(
|
|
638
|
-
'div',
|
|
639
|
-
{
|
|
640
|
-
className: 'assign-search-wrap',
|
|
641
|
-
},
|
|
642
|
-
/*#__PURE__*/ React.createElement(Search, {
|
|
643
|
-
size: 'small',
|
|
644
|
-
allowClear: true,
|
|
645
|
-
placeholder: getText(
|
|
646
|
-
'search',
|
|
647
|
-
props === null || props === void 0 ? void 0 : props.lang,
|
|
648
|
-
),
|
|
649
|
-
onChange: function onChange(e) {
|
|
650
|
-
debouncedSearch(e.target.value);
|
|
651
|
-
},
|
|
652
|
-
onSearch: function onSearch(v) {
|
|
653
|
-
setFilterUser(v);
|
|
654
|
-
},
|
|
655
|
-
style: {
|
|
656
|
-
width: '90%',
|
|
657
|
-
},
|
|
658
|
-
}),
|
|
659
|
-
),
|
|
660
|
-
userList === null || userList === void 0
|
|
661
|
-
? void 0
|
|
662
|
-
: userList
|
|
663
|
-
.filter(function (item) {
|
|
664
|
-
if (filterUser) {
|
|
665
|
-
var _item$account, _item$userName;
|
|
666
|
-
return (
|
|
667
|
-
(item === null || item === void 0
|
|
668
|
-
? void 0
|
|
669
|
-
: (_item$account = item.account) === null || _item$account === void 0
|
|
670
|
-
? void 0
|
|
671
|
-
: _item$account
|
|
672
|
-
.toLocaleLowerCase()
|
|
673
|
-
.includes(
|
|
674
|
-
filterUser === null || filterUser === void 0
|
|
675
|
-
? void 0
|
|
676
|
-
: filterUser.toLocaleLowerCase(),
|
|
677
|
-
)) ||
|
|
678
|
-
(item === null || item === void 0
|
|
679
|
-
? void 0
|
|
680
|
-
: (_item$userName = item.userName) === null || _item$userName === void 0
|
|
681
|
-
? void 0
|
|
682
|
-
: _item$userName
|
|
683
|
-
.toLocaleLowerCase()
|
|
684
|
-
.includes(
|
|
685
|
-
filterUser === null || filterUser === void 0
|
|
686
|
-
? void 0
|
|
687
|
-
: filterUser.toLocaleLowerCase(),
|
|
688
|
-
))
|
|
689
|
-
);
|
|
690
|
-
} else {
|
|
691
|
-
return item;
|
|
692
|
-
}
|
|
693
|
-
})
|
|
694
|
-
.map(function (item, index) {
|
|
695
|
-
var isCheck =
|
|
696
|
-
userKeys === null || userKeys === void 0
|
|
697
|
-
? void 0
|
|
698
|
-
: userKeys.includes(item.account);
|
|
699
|
-
var isOwnAccount = account === item.account;
|
|
700
|
-
return /*#__PURE__*/ React.createElement(
|
|
701
|
-
'div',
|
|
702
|
-
null,
|
|
703
|
-
/*#__PURE__*/ React.createElement(
|
|
704
|
-
_Checkbox,
|
|
705
|
-
{
|
|
706
|
-
checked: isCheck,
|
|
707
|
-
disabled: disabled || isOwnAccount || allUserChecked,
|
|
708
|
-
onChange: assignUser,
|
|
709
|
-
value: item.account,
|
|
710
|
-
key: index,
|
|
711
|
-
},
|
|
712
|
-
/*#__PURE__*/ React.createElement(
|
|
713
|
-
'span',
|
|
714
|
-
{
|
|
715
|
-
style: {
|
|
716
|
-
display: 'inline-block',
|
|
717
|
-
},
|
|
718
|
-
},
|
|
719
|
-
/*#__PURE__*/ React.createElement(_Ellipsis, {
|
|
720
|
-
widthLimit: 240,
|
|
721
|
-
title: item.userName,
|
|
722
|
-
}),
|
|
723
|
-
),
|
|
724
|
-
),
|
|
725
|
-
);
|
|
726
|
-
}),
|
|
727
|
-
),
|
|
728
|
-
),
|
|
729
|
-
);
|
|
461
|
+
onSearch: function onSearch(v) {
|
|
462
|
+
setFilterUser(v);
|
|
463
|
+
},
|
|
464
|
+
style: {
|
|
465
|
+
width: '90%'
|
|
466
|
+
}
|
|
467
|
+
})), userList === null || userList === void 0 ? void 0 : userList.filter(function (item) {
|
|
468
|
+
if (filterUser) {
|
|
469
|
+
var _item$account, _item$userName;
|
|
470
|
+
return (item === null || item === void 0 ? void 0 : (_item$account = item.account) === null || _item$account === void 0 ? void 0 : _item$account.toLocaleLowerCase().includes(filterUser === null || filterUser === void 0 ? void 0 : filterUser.toLocaleLowerCase())) || (item === null || item === void 0 ? void 0 : (_item$userName = item.userName) === null || _item$userName === void 0 ? void 0 : _item$userName.toLocaleLowerCase().includes(filterUser === null || filterUser === void 0 ? void 0 : filterUser.toLocaleLowerCase()));
|
|
471
|
+
} else {
|
|
472
|
+
return item;
|
|
473
|
+
}
|
|
474
|
+
}).map(function (item, index) {
|
|
475
|
+
var isCheck = userKeys === null || userKeys === void 0 ? void 0 : userKeys.includes(item.account);
|
|
476
|
+
var isOwnAccount = account === item.account;
|
|
477
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Checkbox, {
|
|
478
|
+
checked: isCheck,
|
|
479
|
+
disabled: disabled || isOwnAccount || allUserChecked,
|
|
480
|
+
onChange: assignUser,
|
|
481
|
+
value: item.account,
|
|
482
|
+
key: index
|
|
483
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
484
|
+
style: {
|
|
485
|
+
display: 'inline-block'
|
|
486
|
+
}
|
|
487
|
+
}, /*#__PURE__*/React.createElement(_Ellipsis, {
|
|
488
|
+
widthLimit: 240,
|
|
489
|
+
title: item.userName
|
|
490
|
+
}))));
|
|
491
|
+
}))));
|
|
730
492
|
};
|
|
731
|
-
export default AssignModal;
|
|
493
|
+
export default AssignModal;
|