@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,27 +1,162 @@
|
|
|
1
|
-
function _typeof(o) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
import
|
|
1
|
+
function _typeof(o) {
|
|
2
|
+
'@babel/helpers - typeof';
|
|
3
|
+
return (
|
|
4
|
+
(_typeof =
|
|
5
|
+
'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator
|
|
6
|
+
? function (o) {
|
|
7
|
+
return typeof o;
|
|
8
|
+
}
|
|
9
|
+
: function (o) {
|
|
10
|
+
return o &&
|
|
11
|
+
'function' == typeof Symbol &&
|
|
12
|
+
o.constructor === Symbol &&
|
|
13
|
+
o !== Symbol.prototype
|
|
14
|
+
? 'symbol'
|
|
15
|
+
: typeof o;
|
|
16
|
+
}),
|
|
17
|
+
_typeof(o)
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
import _TntdVirtualTree from 'tntd/es/tntd-virtual-tree';
|
|
21
|
+
import _Input from 'tntd/es/input';
|
|
22
|
+
import _Icon from 'tntd/es/icon';
|
|
23
|
+
import _Segmented from 'tntd/es/segmented';
|
|
24
|
+
import _Empty from 'tntd/es/empty';
|
|
25
|
+
import _Checkbox from 'tntd/es/checkbox';
|
|
26
|
+
import _Ellipsis from 'tntd/es/ellipsis';
|
|
27
|
+
function ownKeys(e, r) {
|
|
28
|
+
var t = Object.keys(e);
|
|
29
|
+
if (Object.getOwnPropertySymbols) {
|
|
30
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
31
|
+
r &&
|
|
32
|
+
(o = o.filter(function (r) {
|
|
33
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
34
|
+
})),
|
|
35
|
+
t.push.apply(t, o);
|
|
36
|
+
}
|
|
37
|
+
return t;
|
|
38
|
+
}
|
|
39
|
+
function _objectSpread(e) {
|
|
40
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
41
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
42
|
+
r % 2
|
|
43
|
+
? ownKeys(Object(t), !0).forEach(function (r) {
|
|
44
|
+
_defineProperty(e, r, t[r]);
|
|
45
|
+
})
|
|
46
|
+
: Object.getOwnPropertyDescriptors
|
|
47
|
+
? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t))
|
|
48
|
+
: ownKeys(Object(t)).forEach(function (r) {
|
|
49
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return e;
|
|
53
|
+
}
|
|
54
|
+
function _defineProperty(e, r, t) {
|
|
55
|
+
return (
|
|
56
|
+
(r = _toPropertyKey(r)) in e
|
|
57
|
+
? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 })
|
|
58
|
+
: (e[r] = t),
|
|
59
|
+
e
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
function _toPropertyKey(t) {
|
|
63
|
+
var i = _toPrimitive(t, 'string');
|
|
64
|
+
return 'symbol' == _typeof(i) ? i : i + '';
|
|
65
|
+
}
|
|
66
|
+
function _toPrimitive(t, r) {
|
|
67
|
+
if ('object' != _typeof(t) || !t) return t;
|
|
68
|
+
var e = t[Symbol.toPrimitive];
|
|
69
|
+
if (void 0 !== e) {
|
|
70
|
+
var i = e.call(t, r || 'default');
|
|
71
|
+
if ('object' != _typeof(i)) return i;
|
|
72
|
+
throw new TypeError('@@toPrimitive must return a primitive value.');
|
|
73
|
+
}
|
|
74
|
+
return ('string' === r ? String : Number)(t);
|
|
75
|
+
}
|
|
76
|
+
function _toConsumableArray(r) {
|
|
77
|
+
return (
|
|
78
|
+
_arrayWithoutHoles(r) ||
|
|
79
|
+
_iterableToArray(r) ||
|
|
80
|
+
_unsupportedIterableToArray(r) ||
|
|
81
|
+
_nonIterableSpread()
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
function _nonIterableSpread() {
|
|
85
|
+
throw new TypeError(
|
|
86
|
+
'Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.',
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
function _iterableToArray(r) {
|
|
90
|
+
if (('undefined' != typeof Symbol && null != r[Symbol.iterator]) || null != r['@@iterator'])
|
|
91
|
+
return Array.from(r);
|
|
92
|
+
}
|
|
93
|
+
function _arrayWithoutHoles(r) {
|
|
94
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
95
|
+
}
|
|
96
|
+
function _slicedToArray(r, e) {
|
|
97
|
+
return (
|
|
98
|
+
_arrayWithHoles(r) ||
|
|
99
|
+
_iterableToArrayLimit(r, e) ||
|
|
100
|
+
_unsupportedIterableToArray(r, e) ||
|
|
101
|
+
_nonIterableRest()
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
function _nonIterableRest() {
|
|
105
|
+
throw new TypeError(
|
|
106
|
+
'Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.',
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
function _unsupportedIterableToArray(r, a) {
|
|
110
|
+
if (r) {
|
|
111
|
+
if ('string' == typeof r) return _arrayLikeToArray(r, a);
|
|
112
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
113
|
+
return (
|
|
114
|
+
'Object' === t && r.constructor && (t = r.constructor.name),
|
|
115
|
+
'Map' === t || 'Set' === t
|
|
116
|
+
? Array.from(r)
|
|
117
|
+
: 'Arguments' === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)
|
|
118
|
+
? _arrayLikeToArray(r, a)
|
|
119
|
+
: void 0
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
function _arrayLikeToArray(r, a) {
|
|
124
|
+
(null == a || a > r.length) && (a = r.length);
|
|
125
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
126
|
+
return n;
|
|
127
|
+
}
|
|
128
|
+
function _iterableToArrayLimit(r, l) {
|
|
129
|
+
var t =
|
|
130
|
+
null == r ? null : ('undefined' != typeof Symbol && r[Symbol.iterator]) || r['@@iterator'];
|
|
131
|
+
if (null != t) {
|
|
132
|
+
var e,
|
|
133
|
+
n,
|
|
134
|
+
i,
|
|
135
|
+
u,
|
|
136
|
+
a = [],
|
|
137
|
+
f = !0,
|
|
138
|
+
o = !1;
|
|
139
|
+
try {
|
|
140
|
+
if (((i = (t = t.call(r)).next), 0 === l)) {
|
|
141
|
+
if (Object(t) !== t) return;
|
|
142
|
+
f = !1;
|
|
143
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
144
|
+
} catch (r) {
|
|
145
|
+
(o = !0), (n = r);
|
|
146
|
+
} finally {
|
|
147
|
+
try {
|
|
148
|
+
if (!f && null != t.return && ((u = t.return()), Object(u) !== u)) return;
|
|
149
|
+
} finally {
|
|
150
|
+
if (o) throw n;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return a;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function _arrayWithHoles(r) {
|
|
157
|
+
if (Array.isArray(r)) return r;
|
|
158
|
+
}
|
|
159
|
+
import React from 'react';
|
|
25
160
|
import { useEffect, useState, useCallback, useRef, useMemo } from 'react';
|
|
26
161
|
import { cloneDeep, debounce } from 'lodash';
|
|
27
162
|
import './index.less';
|
|
@@ -61,25 +196,48 @@ var AssignModal = function AssignModal(props) {
|
|
|
61
196
|
var appMapRef = useRef({});
|
|
62
197
|
var userMapRef = useRef({});
|
|
63
198
|
var rootNode = orgList[0];
|
|
64
|
-
var _useMemo = useMemo(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
199
|
+
var _useMemo = useMemo(
|
|
200
|
+
function () {
|
|
201
|
+
var org = preorder(
|
|
202
|
+
rootNode,
|
|
203
|
+
function (key, node) {
|
|
204
|
+
orgMapRef.current[key] = node;
|
|
205
|
+
},
|
|
206
|
+
true,
|
|
207
|
+
);
|
|
208
|
+
var app = appList.map(function (item) {
|
|
209
|
+
appMapRef.current[item.value] = item;
|
|
210
|
+
return item.value;
|
|
211
|
+
});
|
|
212
|
+
var user =
|
|
213
|
+
(userList === null || userList === void 0
|
|
214
|
+
? void 0
|
|
215
|
+
: userList.map(function (item) {
|
|
216
|
+
userMapRef.current[item.account] = item;
|
|
217
|
+
return item.account;
|
|
218
|
+
})) || [];
|
|
219
|
+
return [org, app, user];
|
|
220
|
+
},
|
|
221
|
+
[rootNode, appList, userList],
|
|
222
|
+
),
|
|
78
223
|
_useMemo2 = _slicedToArray(_useMemo, 3),
|
|
79
224
|
allOrg = _useMemo2[0],
|
|
80
225
|
allApp = _useMemo2[1],
|
|
81
226
|
allUser = _useMemo2[2];
|
|
82
|
-
var titleOptions = [
|
|
227
|
+
var titleOptions = [
|
|
228
|
+
''.concat(
|
|
229
|
+
orgTitle ||
|
|
230
|
+
getText('availableOrgs', props === null || props === void 0 ? void 0 : props.lang),
|
|
231
|
+
),
|
|
232
|
+
''.concat(
|
|
233
|
+
appTitle ||
|
|
234
|
+
getText('availableApps', props === null || props === void 0 ? void 0 : props.lang),
|
|
235
|
+
),
|
|
236
|
+
''.concat(
|
|
237
|
+
userTitle ||
|
|
238
|
+
getText('availableUsers', props === null || props === void 0 ? void 0 : props.lang),
|
|
239
|
+
),
|
|
240
|
+
];
|
|
83
241
|
if (!showUser) {
|
|
84
242
|
titleOptions.pop();
|
|
85
243
|
}
|
|
@@ -100,111 +258,145 @@ var AssignModal = function AssignModal(props) {
|
|
|
100
258
|
checkedKeys = _useState8[0],
|
|
101
259
|
setCheckedKeys = _useState8[1];
|
|
102
260
|
var _useState9 = useState(appCodes || []),
|
|
103
|
-
|
|
104
|
-
appKeys =
|
|
105
|
-
setAppKeys =
|
|
106
|
-
var
|
|
261
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
262
|
+
appKeys = _useState0[0],
|
|
263
|
+
setAppKeys = _useState0[1];
|
|
264
|
+
var _useState1 = useState(accounts || []),
|
|
265
|
+
_useState10 = _slicedToArray(_useState1, 2),
|
|
266
|
+
userKeys = _useState10[0],
|
|
267
|
+
setUserKeys = _useState10[1];
|
|
268
|
+
var _useState11 = useState(false),
|
|
107
269
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
108
|
-
|
|
109
|
-
|
|
270
|
+
allOrgChecked = _useState12[0],
|
|
271
|
+
setAllOrgChecked = _useState12[1];
|
|
110
272
|
var _useState13 = useState(false),
|
|
111
273
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
112
|
-
|
|
113
|
-
|
|
274
|
+
allAppChecked = _useState14[0],
|
|
275
|
+
setAllAppChecked = _useState14[1];
|
|
114
276
|
var _useState15 = useState(false),
|
|
115
277
|
_useState16 = _slicedToArray(_useState15, 2),
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
var _useState17 = useState(
|
|
278
|
+
allUserChecked = _useState16[0],
|
|
279
|
+
setAllUserChecked = _useState16[1];
|
|
280
|
+
var _useState17 = useState(),
|
|
119
281
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
120
|
-
|
|
121
|
-
|
|
282
|
+
filterOrg = _useState18[0],
|
|
283
|
+
setFilterOrg = _useState18[1];
|
|
122
284
|
var _useState19 = useState(),
|
|
123
285
|
_useState20 = _slicedToArray(_useState19, 2),
|
|
124
|
-
|
|
125
|
-
|
|
286
|
+
filterUser = _useState20[0],
|
|
287
|
+
setFilterUser = _useState20[1];
|
|
126
288
|
var _useState21 = useState(),
|
|
127
289
|
_useState22 = _slicedToArray(_useState21, 2),
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
var _useState23 = useState(),
|
|
131
|
-
_useState24 = _slicedToArray(_useState23, 2),
|
|
132
|
-
filterApp = _useState24[0],
|
|
133
|
-
setFilterApp = _useState24[1];
|
|
290
|
+
filterApp = _useState22[0],
|
|
291
|
+
setFilterApp = _useState22[1];
|
|
134
292
|
var gap = 335;
|
|
135
293
|
var windowHeight = useWindowHeight(gap);
|
|
136
|
-
useEffect(
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
} else {
|
|
154
|
-
initApps = Array.from(new Set([].concat(_toConsumableArray(appCodes || []), [appCode])));
|
|
155
|
-
}
|
|
156
|
-
if (showUser) {
|
|
157
|
-
if (accounts.includes('all')) {
|
|
158
|
-
setAllUserChecked(true);
|
|
159
|
-
initAccounts = allUser;
|
|
294
|
+
useEffect(
|
|
295
|
+
function () {
|
|
296
|
+
var _Object$keys;
|
|
297
|
+
if (
|
|
298
|
+
dataItem &&
|
|
299
|
+
((_Object$keys = Object.keys(dataItem)) === null || _Object$keys === void 0
|
|
300
|
+
? void 0
|
|
301
|
+
: _Object$keys.length)
|
|
302
|
+
) {
|
|
303
|
+
// path 和 allOrgList 赋值
|
|
304
|
+
path = findSameCodePath(rootNode, orgCode);
|
|
305
|
+
var initOrgs = [];
|
|
306
|
+
var initApps = [];
|
|
307
|
+
var initAccounts = [];
|
|
308
|
+
if (orgCodes.includes('all')) {
|
|
309
|
+
setAllOrgChecked(orgCodes.includes('all'));
|
|
310
|
+
initOrgs = allOrg;
|
|
160
311
|
} else {
|
|
161
|
-
|
|
312
|
+
initOrgs = Array.from(
|
|
313
|
+
new Set([].concat(_toConsumableArray(orgCodes || []), _toConsumableArray(path))),
|
|
314
|
+
);
|
|
162
315
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
appKeys: appCodes.includes('all') ? ['all'] : initApps,
|
|
169
|
-
checkedKeys: orgCodes.includes('all') ? ['all'] : initOrgs,
|
|
170
|
-
userKeys: accounts.includes('all') ? ['all'] : initAccounts,
|
|
171
|
-
appCheckAll: appCodes.includes('all'),
|
|
172
|
-
orgCheckAll: orgCodes.includes('all'),
|
|
173
|
-
userCheckAll: accounts.includes('all'),
|
|
174
|
-
checkData: {
|
|
175
|
-
apps: initApps,
|
|
176
|
-
orgs: initOrgs,
|
|
177
|
-
accounts: initAccounts
|
|
316
|
+
if (appCodes.includes('all')) {
|
|
317
|
+
setAllAppChecked(appCodes.includes('all'));
|
|
318
|
+
initApps = allApp;
|
|
319
|
+
} else {
|
|
320
|
+
initApps = Array.from(new Set([].concat(_toConsumableArray(appCodes || []), [appCode])));
|
|
178
321
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
var orgDisabled = path.includes(item.code);
|
|
188
|
-
if (item.children && item.children.length > 0) {
|
|
189
|
-
return _objectSpread(_objectSpread({}, item), {}, {
|
|
190
|
-
key: item.code,
|
|
191
|
-
title: item.name,
|
|
192
|
-
value: item.code,
|
|
193
|
-
disabled: orgDisabled || disabled || allOrgChecked || customOrgDisabled && customOrgDisabled(item),
|
|
194
|
-
children: _loopTreeNodes(item.children, level + 1)
|
|
195
|
-
});
|
|
322
|
+
if (showUser) {
|
|
323
|
+
if (accounts.includes('all')) {
|
|
324
|
+
setAllUserChecked(true);
|
|
325
|
+
initAccounts = allUser;
|
|
326
|
+
} else {
|
|
327
|
+
initAccounts = Array.from(
|
|
328
|
+
new Set([].concat(_toConsumableArray(accounts || []), [account])),
|
|
329
|
+
);
|
|
196
330
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
331
|
+
}
|
|
332
|
+
setCheckedKeys(initOrgs);
|
|
333
|
+
setAppKeys(initApps || []);
|
|
334
|
+
setUserKeys(initAccounts || []);
|
|
335
|
+
onChange &&
|
|
336
|
+
onChange({
|
|
337
|
+
appKeys: appCodes.includes('all') ? ['all'] : initApps,
|
|
338
|
+
checkedKeys: orgCodes.includes('all') ? ['all'] : initOrgs,
|
|
339
|
+
userKeys: accounts.includes('all') ? ['all'] : initAccounts,
|
|
340
|
+
appCheckAll: appCodes.includes('all'),
|
|
341
|
+
orgCheckAll: orgCodes.includes('all'),
|
|
342
|
+
userCheckAll: accounts.includes('all'),
|
|
343
|
+
checkData: {
|
|
344
|
+
apps: initApps,
|
|
345
|
+
orgs: initOrgs,
|
|
346
|
+
accounts: initAccounts,
|
|
347
|
+
},
|
|
202
348
|
});
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
[dataItem],
|
|
352
|
+
);
|
|
353
|
+
useEffect(
|
|
354
|
+
function () {
|
|
355
|
+
if (orgList) {
|
|
356
|
+
var _loopTreeNodes = function loopTreeNodes(nodes) {
|
|
357
|
+
var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
358
|
+
return nodes === null || nodes === void 0
|
|
359
|
+
? void 0
|
|
360
|
+
: nodes.map(function (item) {
|
|
361
|
+
var orgDisabled = path.includes(item.code);
|
|
362
|
+
if (item.children && item.children.length > 0) {
|
|
363
|
+
return _objectSpread(
|
|
364
|
+
_objectSpread({}, item),
|
|
365
|
+
{},
|
|
366
|
+
{
|
|
367
|
+
key: item.code,
|
|
368
|
+
title: item.name,
|
|
369
|
+
value: item.code,
|
|
370
|
+
disabled:
|
|
371
|
+
orgDisabled ||
|
|
372
|
+
disabled ||
|
|
373
|
+
allOrgChecked ||
|
|
374
|
+
(customOrgDisabled && customOrgDisabled(item)),
|
|
375
|
+
children: _loopTreeNodes(item.children, level + 1),
|
|
376
|
+
},
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
return _objectSpread(
|
|
380
|
+
_objectSpread({}, item),
|
|
381
|
+
{},
|
|
382
|
+
{
|
|
383
|
+
key: item.code,
|
|
384
|
+
value: item.code,
|
|
385
|
+
title: item.name,
|
|
386
|
+
disabled:
|
|
387
|
+
orgDisabled ||
|
|
388
|
+
disabled ||
|
|
389
|
+
allOrgChecked ||
|
|
390
|
+
(customOrgDisabled && customOrgDisabled(item)),
|
|
391
|
+
},
|
|
392
|
+
);
|
|
393
|
+
});
|
|
394
|
+
};
|
|
395
|
+
setTreeData(_loopTreeNodes(orgList, 0));
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
[orgList, allOrgChecked, allAppChecked, allUserChecked],
|
|
399
|
+
);
|
|
208
400
|
var onCheck = function onCheck() {
|
|
209
401
|
var _node$childrenValues;
|
|
210
402
|
for (var _len = arguments.length, rest = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -213,7 +405,11 @@ var AssignModal = function AssignModal(props) {
|
|
|
213
405
|
var checked = rest[0],
|
|
214
406
|
node = rest[1],
|
|
215
407
|
isChecked = rest[2];
|
|
216
|
-
var isLeaf = !(node === null || node === void 0
|
|
408
|
+
var isLeaf = !(node === null || node === void 0
|
|
409
|
+
? void 0
|
|
410
|
+
: (_node$childrenValues = node.childrenValues) === null || _node$childrenValues === void 0
|
|
411
|
+
? void 0
|
|
412
|
+
: _node$childrenValues.length);
|
|
217
413
|
var curNode = orgMapRef.current[node.value] || {};
|
|
218
414
|
var path = curNode.path;
|
|
219
415
|
var newChecked = cloneDeep(checked);
|
|
@@ -242,8 +438,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
242
438
|
checkData: {
|
|
243
439
|
apps: appKeys,
|
|
244
440
|
orgs: newChecked,
|
|
245
|
-
accounts: userKeys
|
|
246
|
-
}
|
|
441
|
+
accounts: userKeys,
|
|
442
|
+
},
|
|
247
443
|
});
|
|
248
444
|
};
|
|
249
445
|
var assignApp = function assignApp(e) {
|
|
@@ -272,8 +468,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
272
468
|
checkData: {
|
|
273
469
|
apps: newAppKeys,
|
|
274
470
|
orgs: checkedKeys,
|
|
275
|
-
accounts: userKeys
|
|
276
|
-
}
|
|
471
|
+
accounts: userKeys,
|
|
472
|
+
},
|
|
277
473
|
});
|
|
278
474
|
};
|
|
279
475
|
var assignUser = function assignUser(e) {
|
|
@@ -302,8 +498,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
302
498
|
checkData: {
|
|
303
499
|
apps: appKeys,
|
|
304
500
|
orgs: checkedKeys,
|
|
305
|
-
accounts: newUserKeys
|
|
306
|
-
}
|
|
501
|
+
accounts: newUserKeys,
|
|
502
|
+
},
|
|
307
503
|
});
|
|
308
504
|
};
|
|
309
505
|
|
|
@@ -324,13 +520,15 @@ var AssignModal = function AssignModal(props) {
|
|
|
324
520
|
checkData: {
|
|
325
521
|
apps: appKeys,
|
|
326
522
|
orgs: checkedKeys,
|
|
327
|
-
accounts: accounts
|
|
328
|
-
}
|
|
523
|
+
accounts: accounts,
|
|
524
|
+
},
|
|
329
525
|
});
|
|
330
526
|
} else {
|
|
331
527
|
setAllOrgChecked(false);
|
|
332
528
|
var arr = orgCodes.includes('all') ? allOrg : orgCodes;
|
|
333
|
-
orgChecks = Array.from(
|
|
529
|
+
orgChecks = Array.from(
|
|
530
|
+
new Set([].concat(_toConsumableArray(arr || []), _toConsumableArray(path))),
|
|
531
|
+
);
|
|
334
532
|
setCheckedKeys(orgChecks);
|
|
335
533
|
onChange({
|
|
336
534
|
appKeys: allAppChecked ? ['all'] : appKeys,
|
|
@@ -342,8 +540,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
342
540
|
checkData: {
|
|
343
541
|
apps: appKeys,
|
|
344
542
|
orgs: orgChecks,
|
|
345
|
-
accounts: accounts
|
|
346
|
-
}
|
|
543
|
+
accounts: accounts,
|
|
544
|
+
},
|
|
347
545
|
});
|
|
348
546
|
}
|
|
349
547
|
};
|
|
@@ -367,8 +565,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
367
565
|
checkData: {
|
|
368
566
|
apps: appChecks,
|
|
369
567
|
orgs: checkedKeys,
|
|
370
|
-
accounts: accounts
|
|
371
|
-
}
|
|
568
|
+
accounts: accounts,
|
|
569
|
+
},
|
|
372
570
|
});
|
|
373
571
|
} else {
|
|
374
572
|
setAllAppChecked(false);
|
|
@@ -385,8 +583,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
385
583
|
checkData: {
|
|
386
584
|
apps: appChecks,
|
|
387
585
|
orgs: checkedKeys,
|
|
388
|
-
accounts: accounts
|
|
389
|
-
}
|
|
586
|
+
accounts: accounts,
|
|
587
|
+
},
|
|
390
588
|
});
|
|
391
589
|
}
|
|
392
590
|
};
|
|
@@ -410,8 +608,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
410
608
|
checkData: {
|
|
411
609
|
apps: appKeys,
|
|
412
610
|
orgs: checkedKeys,
|
|
413
|
-
accounts: userChecks
|
|
414
|
-
}
|
|
611
|
+
accounts: userChecks,
|
|
612
|
+
},
|
|
415
613
|
});
|
|
416
614
|
} else {
|
|
417
615
|
setAllUserChecked(false);
|
|
@@ -428,29 +626,40 @@ var AssignModal = function AssignModal(props) {
|
|
|
428
626
|
checkData: {
|
|
429
627
|
apps: appKeys,
|
|
430
628
|
orgs: checkedKeys,
|
|
431
|
-
accounts: userChecks
|
|
432
|
-
}
|
|
629
|
+
accounts: userChecks,
|
|
630
|
+
},
|
|
433
631
|
});
|
|
434
632
|
}
|
|
435
633
|
};
|
|
436
|
-
var debouncedOrgSearch = useCallback(
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
var
|
|
443
|
-
|
|
444
|
-
|
|
634
|
+
var debouncedOrgSearch = useCallback(
|
|
635
|
+
debounce(function (nextValue) {
|
|
636
|
+
setFilterOrg(nextValue);
|
|
637
|
+
}, 200),
|
|
638
|
+
[],
|
|
639
|
+
);
|
|
640
|
+
var debouncedUserSearch = useCallback(
|
|
641
|
+
debounce(function (nextValue) {
|
|
642
|
+
setFilterUser(nextValue);
|
|
643
|
+
}, 200),
|
|
644
|
+
[],
|
|
645
|
+
);
|
|
646
|
+
var debouncedAppSearch = useCallback(
|
|
647
|
+
debounce(function (nextValue) {
|
|
648
|
+
setFilterApp(nextValue);
|
|
649
|
+
}, 200),
|
|
650
|
+
[],
|
|
651
|
+
);
|
|
445
652
|
|
|
446
653
|
// 拼接机构路径显示名
|
|
447
654
|
var getOrgPathDisplayName = function getOrgPathDisplayName() {
|
|
448
655
|
var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
449
656
|
var displayName = '';
|
|
450
657
|
if (path.length > 0) {
|
|
451
|
-
displayName = path
|
|
452
|
-
|
|
453
|
-
|
|
658
|
+
displayName = path
|
|
659
|
+
.map(function (item) {
|
|
660
|
+
return orgMapRef.current[item].name;
|
|
661
|
+
})
|
|
662
|
+
.join(' / ');
|
|
454
663
|
}
|
|
455
664
|
return displayName;
|
|
456
665
|
};
|
|
@@ -473,8 +682,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
473
682
|
checkData: {
|
|
474
683
|
apps: appKeys,
|
|
475
684
|
orgs: checked,
|
|
476
|
-
accounts: userKeys
|
|
477
|
-
}
|
|
685
|
+
accounts: userKeys,
|
|
686
|
+
},
|
|
478
687
|
});
|
|
479
688
|
};
|
|
480
689
|
|
|
@@ -493,8 +702,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
493
702
|
checkData: {
|
|
494
703
|
apps: appKeys,
|
|
495
704
|
orgs: checked,
|
|
496
|
-
accounts: userKeys
|
|
497
|
-
}
|
|
705
|
+
accounts: userKeys,
|
|
706
|
+
},
|
|
498
707
|
});
|
|
499
708
|
};
|
|
500
709
|
|
|
@@ -518,8 +727,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
518
727
|
checkData: {
|
|
519
728
|
apps: newAppKeys,
|
|
520
729
|
orgs: checkedKeys,
|
|
521
|
-
accounts: userKeys
|
|
522
|
-
}
|
|
730
|
+
accounts: userKeys,
|
|
731
|
+
},
|
|
523
732
|
});
|
|
524
733
|
};
|
|
525
734
|
// 移除全部应用
|
|
@@ -537,8 +746,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
537
746
|
checkData: {
|
|
538
747
|
apps: newAppKeys,
|
|
539
748
|
orgs: checkedKeys,
|
|
540
|
-
accounts: userKeys
|
|
541
|
-
}
|
|
749
|
+
accounts: userKeys,
|
|
750
|
+
},
|
|
542
751
|
});
|
|
543
752
|
};
|
|
544
753
|
|
|
@@ -557,8 +766,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
557
766
|
checkData: {
|
|
558
767
|
apps: appKeys,
|
|
559
768
|
orgs: checkedKeys,
|
|
560
|
-
accounts: newUserKeys
|
|
561
|
-
}
|
|
769
|
+
accounts: newUserKeys,
|
|
770
|
+
},
|
|
562
771
|
});
|
|
563
772
|
};
|
|
564
773
|
|
|
@@ -582,350 +791,758 @@ var AssignModal = function AssignModal(props) {
|
|
|
582
791
|
checkData: {
|
|
583
792
|
apps: appKeys,
|
|
584
793
|
orgs: checkedKeys,
|
|
585
|
-
accounts: newUserKeys
|
|
586
|
-
}
|
|
794
|
+
accounts: newUserKeys,
|
|
795
|
+
},
|
|
587
796
|
});
|
|
588
797
|
};
|
|
589
798
|
|
|
590
799
|
// 已选择的机构列表
|
|
591
|
-
var areadySelectOrg = useMemo(
|
|
592
|
-
|
|
593
|
-
return
|
|
594
|
-
|
|
595
|
-
|
|
800
|
+
var areadySelectOrg = useMemo(
|
|
801
|
+
function () {
|
|
802
|
+
return (
|
|
803
|
+
checkedKeys.filter(function (i) {
|
|
804
|
+
return allOrg.includes(i);
|
|
805
|
+
}) || []
|
|
806
|
+
);
|
|
807
|
+
},
|
|
808
|
+
[checkedKeys, allOrg],
|
|
809
|
+
);
|
|
596
810
|
// 已选择的渠道列表
|
|
597
|
-
var areadySelectApp = useMemo(
|
|
598
|
-
|
|
599
|
-
return
|
|
600
|
-
|
|
601
|
-
|
|
811
|
+
var areadySelectApp = useMemo(
|
|
812
|
+
function () {
|
|
813
|
+
return (
|
|
814
|
+
appKeys.filter(function (i) {
|
|
815
|
+
return allApp.includes(i);
|
|
816
|
+
}) || []
|
|
817
|
+
);
|
|
818
|
+
},
|
|
819
|
+
[appKeys, allApp],
|
|
820
|
+
);
|
|
602
821
|
// 已选择的用户列表
|
|
603
|
-
var areadySelectUser = useMemo(
|
|
604
|
-
|
|
605
|
-
return
|
|
606
|
-
|
|
607
|
-
|
|
822
|
+
var areadySelectUser = useMemo(
|
|
823
|
+
function () {
|
|
824
|
+
return (
|
|
825
|
+
userKeys.filter(function (i) {
|
|
826
|
+
return allUser.includes(i);
|
|
827
|
+
}) || []
|
|
828
|
+
);
|
|
829
|
+
},
|
|
830
|
+
[userKeys, allUser],
|
|
831
|
+
);
|
|
608
832
|
|
|
609
833
|
// 渲染App列表
|
|
610
|
-
var appListDomRender = useMemo(
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
834
|
+
var appListDomRender = useMemo(
|
|
835
|
+
function () {
|
|
836
|
+
return appList
|
|
837
|
+
.filter(function (i) {
|
|
838
|
+
var label = i.label,
|
|
839
|
+
value = i.value;
|
|
840
|
+
if (filterApp) {
|
|
841
|
+
return (
|
|
842
|
+
(label === null || label === void 0
|
|
843
|
+
? void 0
|
|
844
|
+
: label
|
|
845
|
+
.toLocaleLowerCase()
|
|
846
|
+
.includes(
|
|
847
|
+
filterApp === null || filterApp === void 0
|
|
848
|
+
? void 0
|
|
849
|
+
: filterApp.toLocaleLowerCase(),
|
|
850
|
+
)) ||
|
|
851
|
+
(value === null || value === void 0
|
|
852
|
+
? void 0
|
|
853
|
+
: value
|
|
854
|
+
.toLocaleLowerCase()
|
|
855
|
+
.includes(
|
|
856
|
+
filterApp === null || filterApp === void 0
|
|
857
|
+
? void 0
|
|
858
|
+
: filterApp.toLocaleLowerCase(),
|
|
859
|
+
))
|
|
860
|
+
);
|
|
861
|
+
}
|
|
862
|
+
return i;
|
|
863
|
+
})
|
|
864
|
+
.map(function (item, index) {
|
|
865
|
+
var isCheck =
|
|
866
|
+
appKeys === null || appKeys === void 0 ? void 0 : appKeys.includes(item.value);
|
|
867
|
+
var isOwnAppCode = appCode === item.value;
|
|
868
|
+
return /*#__PURE__*/ React.createElement(
|
|
869
|
+
_Checkbox,
|
|
870
|
+
{
|
|
871
|
+
checked: isCheck,
|
|
872
|
+
disabled:
|
|
873
|
+
disabled ||
|
|
874
|
+
isOwnAppCode ||
|
|
875
|
+
allAppChecked ||
|
|
876
|
+
(customAppDisabled && customAppDisabled(item)),
|
|
877
|
+
onChange: assignApp,
|
|
878
|
+
value: item.value,
|
|
879
|
+
key: index,
|
|
880
|
+
},
|
|
881
|
+
/*#__PURE__*/ React.createElement(
|
|
882
|
+
'span',
|
|
883
|
+
{
|
|
884
|
+
style: {
|
|
885
|
+
display: 'inline-block',
|
|
886
|
+
},
|
|
887
|
+
},
|
|
888
|
+
/*#__PURE__*/ React.createElement(_Ellipsis, {
|
|
889
|
+
title: item.label,
|
|
890
|
+
}),
|
|
891
|
+
),
|
|
892
|
+
);
|
|
893
|
+
});
|
|
894
|
+
},
|
|
895
|
+
[appList, appKeys, filterApp],
|
|
896
|
+
);
|
|
636
897
|
|
|
637
898
|
// 渲染User列表
|
|
638
|
-
var userListDomRender = useMemo(
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
899
|
+
var userListDomRender = useMemo(
|
|
900
|
+
function () {
|
|
901
|
+
return (
|
|
902
|
+
(userList === null || userList === void 0
|
|
903
|
+
? void 0
|
|
904
|
+
: userList
|
|
905
|
+
.filter(function (item) {
|
|
906
|
+
if (filterUser) {
|
|
907
|
+
var _item$account, _item$userName;
|
|
908
|
+
return (
|
|
909
|
+
(item === null || item === void 0
|
|
910
|
+
? void 0
|
|
911
|
+
: (_item$account = item.account) === null || _item$account === void 0
|
|
912
|
+
? void 0
|
|
913
|
+
: _item$account
|
|
914
|
+
.toLocaleLowerCase()
|
|
915
|
+
.includes(
|
|
916
|
+
filterUser === null || filterUser === void 0
|
|
917
|
+
? void 0
|
|
918
|
+
: filterUser.toLocaleLowerCase(),
|
|
919
|
+
)) ||
|
|
920
|
+
(item === null || item === void 0
|
|
921
|
+
? void 0
|
|
922
|
+
: (_item$userName = item.userName) === null || _item$userName === void 0
|
|
923
|
+
? void 0
|
|
924
|
+
: _item$userName
|
|
925
|
+
.toLocaleLowerCase()
|
|
926
|
+
.includes(
|
|
927
|
+
filterUser === null || filterUser === void 0
|
|
928
|
+
? void 0
|
|
929
|
+
: filterUser.toLocaleLowerCase(),
|
|
930
|
+
))
|
|
931
|
+
);
|
|
932
|
+
}
|
|
933
|
+
return item;
|
|
934
|
+
})
|
|
935
|
+
.map(function (item, index) {
|
|
936
|
+
var isCheck =
|
|
937
|
+
userKeys === null || userKeys === void 0
|
|
938
|
+
? void 0
|
|
939
|
+
: userKeys.includes(item.account);
|
|
940
|
+
var isOwnAccount = account === item.account;
|
|
941
|
+
return /*#__PURE__*/ React.createElement(
|
|
942
|
+
_Checkbox,
|
|
943
|
+
{
|
|
944
|
+
key: item + index,
|
|
945
|
+
checked: isCheck,
|
|
946
|
+
disabled: disabled || isOwnAccount || allUserChecked,
|
|
947
|
+
onChange: assignUser,
|
|
948
|
+
value: item.account,
|
|
949
|
+
},
|
|
950
|
+
/*#__PURE__*/ React.createElement(
|
|
951
|
+
'span',
|
|
952
|
+
{
|
|
953
|
+
style: {
|
|
954
|
+
display: 'inline-block',
|
|
955
|
+
},
|
|
956
|
+
},
|
|
957
|
+
/*#__PURE__*/ React.createElement(_Ellipsis, {
|
|
958
|
+
widthLimit: 240,
|
|
959
|
+
title: item.userName,
|
|
960
|
+
}),
|
|
961
|
+
),
|
|
962
|
+
);
|
|
963
|
+
})) || /*#__PURE__*/ React.createElement(_Empty, null)
|
|
964
|
+
);
|
|
965
|
+
},
|
|
966
|
+
[userList, userKeys, filterUser],
|
|
967
|
+
);
|
|
664
968
|
var renderOrgItem = function renderOrgItem(item, lang) {
|
|
665
969
|
var mapResult = {
|
|
666
970
|
1: {
|
|
667
971
|
cn: '职能部门',
|
|
668
972
|
en: 'Func. Dept.',
|
|
669
|
-
icon: 'crowd'
|
|
973
|
+
icon: 'crowd',
|
|
670
974
|
},
|
|
671
975
|
2: {
|
|
672
|
-
icon: 'corporation'
|
|
673
|
-
}
|
|
976
|
+
icon: 'corporation',
|
|
977
|
+
},
|
|
674
978
|
};
|
|
675
979
|
var result = mapResult[item === null || item === void 0 ? void 0 : item.orgAttribute] || {};
|
|
676
|
-
return /*#__PURE__*/React.createElement(
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
980
|
+
return /*#__PURE__*/ React.createElement(
|
|
981
|
+
'div',
|
|
982
|
+
{
|
|
983
|
+
className: 'org-item-wrapper',
|
|
984
|
+
style: {
|
|
985
|
+
width: 'calc(100% - 32px)',
|
|
986
|
+
},
|
|
987
|
+
},
|
|
988
|
+
/*#__PURE__*/ React.createElement(_Ellipsis, {
|
|
989
|
+
title: item.title,
|
|
990
|
+
widthLimit: String(item.orgAttribute) === '1' ? 'calc(100% - 90px}' : '100%',
|
|
991
|
+
}),
|
|
992
|
+
String(item.orgAttribute) === '1' &&
|
|
993
|
+
/*#__PURE__*/ React.createElement(
|
|
994
|
+
'span',
|
|
995
|
+
{
|
|
996
|
+
className: 'org-functional-departemt-marker',
|
|
997
|
+
},
|
|
998
|
+
result[lang] || '职能部门',
|
|
999
|
+
),
|
|
1000
|
+
);
|
|
687
1001
|
};
|
|
688
1002
|
var defaultRenderItem = function defaultRenderItem(item) {
|
|
689
1003
|
var isOrg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
690
1004
|
if (isOrg) {
|
|
691
1005
|
return renderOrgItem(item, props === null || props === void 0 ? void 0 : props.lang);
|
|
692
1006
|
}
|
|
693
|
-
return /*#__PURE__*/React.createElement(_Ellipsis, {
|
|
1007
|
+
return /*#__PURE__*/ React.createElement(_Ellipsis, {
|
|
694
1008
|
title: item.title,
|
|
695
|
-
widthLimit: '100%'
|
|
1009
|
+
widthLimit: '100%',
|
|
696
1010
|
});
|
|
697
1011
|
};
|
|
698
|
-
var canNotRemoveOrg = useMemo(
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
onChange: function onChange(index) {
|
|
712
|
-
setCurValue(index);
|
|
713
|
-
setCurIndex(titleOptions.findIndex(function (i) {
|
|
714
|
-
return i === index;
|
|
715
|
-
}));
|
|
716
|
-
}
|
|
717
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
718
|
-
className: "assign-box-container"
|
|
719
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
720
|
-
className: "slider panel-".concat(curIndex),
|
|
721
|
-
style: {
|
|
722
|
-
width: !!showUser ? '300%' : '200%'
|
|
723
|
-
}
|
|
724
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
725
|
-
className: "org-panel panel"
|
|
726
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
727
|
-
className: "menu-header"
|
|
728
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
729
|
-
className: "title"
|
|
730
|
-
}, orgTitle || getText('authorizesOrgList', props === null || props === void 0 ? void 0 : props.lang)), /*#__PURE__*/React.createElement("div", {
|
|
731
|
-
className: "menu-all-checked"
|
|
732
|
-
}, /*#__PURE__*/React.createElement(_Checkbox, {
|
|
733
|
-
onChange: checkAllOrg,
|
|
734
|
-
checked: allOrgChecked,
|
|
735
|
-
disabled: disabled
|
|
736
|
-
}, orgCheckboxTitle || getText('allOrgAvailable', props === null || props === void 0 ? void 0 : props.lang)))), /*#__PURE__*/React.createElement("div", {
|
|
737
|
-
className: "panel-menu-body"
|
|
738
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
739
|
-
className: "panel-left",
|
|
740
|
-
style: {
|
|
741
|
-
width: '60%'
|
|
742
|
-
}
|
|
743
|
-
}, /*#__PURE__*/React.createElement(_Input, {
|
|
744
|
-
size: "small",
|
|
745
|
-
placeholder: getText('search', props === null || props === void 0 ? void 0 : props.lang),
|
|
746
|
-
onChange: function onChange(e) {
|
|
747
|
-
debouncedOrgSearch(e.target.value);
|
|
1012
|
+
var canNotRemoveOrg = useMemo(
|
|
1013
|
+
function () {
|
|
1014
|
+
var _orgMapRef$current, _orgMapRef$current$ch;
|
|
1015
|
+
return (
|
|
1016
|
+
(checkedKeys === null || checkedKeys === void 0 ? void 0 : checkedKeys.length) === 1 &&
|
|
1017
|
+
((_orgMapRef$current = orgMapRef.current) === null || _orgMapRef$current === void 0
|
|
1018
|
+
? void 0
|
|
1019
|
+
: (_orgMapRef$current$ch = _orgMapRef$current[checkedKeys[0]]) === null ||
|
|
1020
|
+
_orgMapRef$current$ch === void 0
|
|
1021
|
+
? void 0
|
|
1022
|
+
: _orgMapRef$current$ch.key) ===
|
|
1023
|
+
(rootNode === null || rootNode === void 0 ? void 0 : rootNode.key)
|
|
1024
|
+
);
|
|
748
1025
|
},
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
blockNode: true,
|
|
764
|
-
checkable: true,
|
|
765
|
-
checkStrictly: true,
|
|
766
|
-
checkedKeys: checkedKeys,
|
|
767
|
-
defaultExpandAll: true,
|
|
768
|
-
onCheck: onCheck,
|
|
769
|
-
height: windowHeight,
|
|
770
|
-
titleRender: defaultRenderItem
|
|
771
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
772
|
-
className: "panel-right",
|
|
773
|
-
style: {
|
|
774
|
-
width: '40%'
|
|
775
|
-
}
|
|
776
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
777
|
-
className: "select-menu-header"
|
|
778
|
-
}, /*#__PURE__*/React.createElement("span", null, getText('hasBeenSelected', props === null || props === void 0 ? void 0 : props.lang), ":", ' ', getText('numOfOrg', props === null || props === void 0 ? void 0 : props.lang, areadySelectOrg.length || 0)), /*#__PURE__*/React.createElement("a", {
|
|
779
|
-
className: canNotRemoveOrg ? 'disabeld' : '',
|
|
780
|
-
onClick: function onClick() {
|
|
781
|
-
return onRemoveAllOrg();
|
|
782
|
-
}
|
|
783
|
-
}, getText('clear', props === null || props === void 0 ? void 0 : props.lang))), /*#__PURE__*/React.createElement("ul", {
|
|
784
|
-
className: "select-menu-list"
|
|
785
|
-
}, checkedKeys.filter(function (i) {
|
|
786
|
-
return !!orgMapRef.current[i];
|
|
787
|
-
}).map(function (item, index) {
|
|
788
|
-
var node = orgMapRef.current[item] || {};
|
|
789
|
-
var path = node.path,
|
|
790
|
-
name = node.name;
|
|
791
|
-
var pathDisplayName = getOrgPathDisplayName(path);
|
|
792
|
-
var disabled = rootNode.key === item;
|
|
793
|
-
return /*#__PURE__*/React.createElement("li", {
|
|
794
|
-
key: item.value + index,
|
|
795
|
-
className: "select-menu-list-item"
|
|
796
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
797
|
-
className: "org-name"
|
|
798
|
-
}, /*#__PURE__*/React.createElement(_Ellipsis, {
|
|
799
|
-
title: name
|
|
800
|
-
})), /*#__PURE__*/React.createElement("span", {
|
|
801
|
-
className: "path-name"
|
|
802
|
-
}, /*#__PURE__*/React.createElement(_Ellipsis, {
|
|
803
|
-
title: pathDisplayName
|
|
804
|
-
})), !disabled && /*#__PURE__*/React.createElement(_Icon, {
|
|
805
|
-
type: "close",
|
|
806
|
-
className: "close-icon",
|
|
807
|
-
onClick: function onClick() {
|
|
808
|
-
return onRemoveSingleOrg(node);
|
|
809
|
-
}
|
|
810
|
-
}));
|
|
811
|
-
}) || /*#__PURE__*/React.createElement(_Empty, null))))), /*#__PURE__*/React.createElement("div", {
|
|
812
|
-
className: "app-panel panel"
|
|
813
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
814
|
-
className: "menu-header"
|
|
815
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
816
|
-
className: "title"
|
|
817
|
-
}, appTitle || getText('authorizesAppList', props === null || props === void 0 ? void 0 : props.lang)), /*#__PURE__*/React.createElement("div", {
|
|
818
|
-
className: "menu-all-checked"
|
|
819
|
-
}, /*#__PURE__*/React.createElement(_Checkbox, {
|
|
820
|
-
onChange: checkedAllApp,
|
|
821
|
-
checked: allAppChecked,
|
|
822
|
-
disabled: disabled
|
|
823
|
-
}, appCheckboxTitle || getText('allAppAvailable', props === null || props === void 0 ? void 0 : props.lang)))), /*#__PURE__*/React.createElement("div", {
|
|
824
|
-
className: "panel-menu-body"
|
|
825
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
826
|
-
className: "panel-left"
|
|
827
|
-
}, /*#__PURE__*/React.createElement(_Input, {
|
|
828
|
-
onChange: function onChange(e) {
|
|
829
|
-
debouncedAppSearch(e.target.value);
|
|
1026
|
+
[checkedKeys],
|
|
1027
|
+
);
|
|
1028
|
+
var canNotRemoveApp = useMemo(
|
|
1029
|
+
function () {
|
|
1030
|
+
var _appMapRef$current, _appMapRef$current$ap;
|
|
1031
|
+
return (
|
|
1032
|
+
(appKeys === null || appKeys === void 0 ? void 0 : appKeys.length) === 1 &&
|
|
1033
|
+
((_appMapRef$current = appMapRef.current) === null || _appMapRef$current === void 0
|
|
1034
|
+
? void 0
|
|
1035
|
+
: (_appMapRef$current$ap = _appMapRef$current[appKeys[0]]) === null ||
|
|
1036
|
+
_appMapRef$current$ap === void 0
|
|
1037
|
+
? void 0
|
|
1038
|
+
: _appMapRef$current$ap.name) === appCode
|
|
1039
|
+
);
|
|
830
1040
|
},
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
}, getText('clear', props === null || props === void 0 ? void 0 : props.lang))), /*#__PURE__*/React.createElement("ul", {
|
|
850
|
-
className: "select-menu-list"
|
|
851
|
-
}, appKeys.map(function (item, index) {
|
|
852
|
-
var node = appMapRef.current[item] || {};
|
|
853
|
-
var value = node.value,
|
|
854
|
-
label = node.label;
|
|
855
|
-
var isOwnAppCode = appCode === value;
|
|
856
|
-
if (!value && !label) return null; // 不显示多余数据
|
|
857
|
-
return /*#__PURE__*/React.createElement("li", {
|
|
858
|
-
key: value + index,
|
|
859
|
-
className: "select-menu-list-item"
|
|
860
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
861
|
-
className: "app-name"
|
|
862
|
-
}, /*#__PURE__*/React.createElement(_Ellipsis, {
|
|
863
|
-
title: label
|
|
864
|
-
})), !isOwnAppCode && /*#__PURE__*/React.createElement(_Icon, {
|
|
865
|
-
type: "close",
|
|
866
|
-
className: "close-icon",
|
|
867
|
-
onClick: function onClick() {
|
|
868
|
-
return onRemoveSingleApp(value);
|
|
869
|
-
}
|
|
870
|
-
}));
|
|
871
|
-
}) || /*#__PURE__*/React.createElement(_Empty, null))))), !!showUser && /*#__PURE__*/React.createElement("div", {
|
|
872
|
-
className: "user-panel panel"
|
|
873
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
874
|
-
className: "menu-header"
|
|
875
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
876
|
-
className: "title"
|
|
877
|
-
}, userTitle || getText('authorizesUserList', props === null || props === void 0 ? void 0 : props.lang)), /*#__PURE__*/React.createElement("div", {
|
|
878
|
-
className: "menu-all-checked"
|
|
879
|
-
}, /*#__PURE__*/React.createElement(_Checkbox, {
|
|
880
|
-
onChange: checkedAllUser,
|
|
881
|
-
checked: allUserChecked,
|
|
882
|
-
disabled: disabled
|
|
883
|
-
}, userCheckboxTitle || getText('allUserAvailable', props === null || props === void 0 ? void 0 : props.lang)))), /*#__PURE__*/React.createElement("div", {
|
|
884
|
-
className: "panel-menu-body"
|
|
885
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
886
|
-
className: "panel-left"
|
|
887
|
-
}, /*#__PURE__*/React.createElement(_Input, {
|
|
888
|
-
size: "small",
|
|
889
|
-
placeholder: getText('enterUserName', props === null || props === void 0 ? void 0 : props.lang),
|
|
890
|
-
onChange: function onChange(e) {
|
|
891
|
-
debouncedUserSearch(e.target.value);
|
|
892
|
-
},
|
|
893
|
-
suffix: /*#__PURE__*/React.createElement(_Icon, {
|
|
894
|
-
type: "zoom"
|
|
1041
|
+
[appKeys],
|
|
1042
|
+
);
|
|
1043
|
+
console.log(canNotRemoveOrg, 'canNotRemove');
|
|
1044
|
+
return /*#__PURE__*/ React.createElement(
|
|
1045
|
+
React.Fragment,
|
|
1046
|
+
null,
|
|
1047
|
+
/*#__PURE__*/ React.createElement(_Segmented, {
|
|
1048
|
+
className: 'menu-title',
|
|
1049
|
+
value: curValue,
|
|
1050
|
+
options: titleOptions,
|
|
1051
|
+
onChange: function onChange(index) {
|
|
1052
|
+
setCurValue(index);
|
|
1053
|
+
setCurIndex(
|
|
1054
|
+
titleOptions.findIndex(function (i) {
|
|
1055
|
+
return i === index;
|
|
1056
|
+
}),
|
|
1057
|
+
);
|
|
1058
|
+
},
|
|
895
1059
|
}),
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
1060
|
+
/*#__PURE__*/ React.createElement(
|
|
1061
|
+
'div',
|
|
1062
|
+
{
|
|
1063
|
+
className: 'assign-box-container',
|
|
1064
|
+
},
|
|
1065
|
+
/*#__PURE__*/ React.createElement(
|
|
1066
|
+
'div',
|
|
1067
|
+
{
|
|
1068
|
+
className: 'slider panel-'.concat(curIndex),
|
|
1069
|
+
style: {
|
|
1070
|
+
width: !!showUser ? '300%' : '200%',
|
|
1071
|
+
},
|
|
1072
|
+
},
|
|
1073
|
+
/*#__PURE__*/ React.createElement(
|
|
1074
|
+
'div',
|
|
1075
|
+
{
|
|
1076
|
+
className: 'org-panel panel',
|
|
1077
|
+
},
|
|
1078
|
+
/*#__PURE__*/ React.createElement(
|
|
1079
|
+
'div',
|
|
1080
|
+
{
|
|
1081
|
+
className: 'menu-header',
|
|
1082
|
+
},
|
|
1083
|
+
/*#__PURE__*/ React.createElement(
|
|
1084
|
+
'span',
|
|
1085
|
+
{
|
|
1086
|
+
className: 'title',
|
|
1087
|
+
},
|
|
1088
|
+
orgTitle ||
|
|
1089
|
+
getText(
|
|
1090
|
+
'authorizesOrgList',
|
|
1091
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
1092
|
+
),
|
|
1093
|
+
),
|
|
1094
|
+
/*#__PURE__*/ React.createElement(
|
|
1095
|
+
'div',
|
|
1096
|
+
{
|
|
1097
|
+
className: 'menu-all-checked',
|
|
1098
|
+
},
|
|
1099
|
+
/*#__PURE__*/ React.createElement(
|
|
1100
|
+
_Checkbox,
|
|
1101
|
+
{
|
|
1102
|
+
onChange: checkAllOrg,
|
|
1103
|
+
checked: allOrgChecked,
|
|
1104
|
+
disabled: disabled,
|
|
1105
|
+
},
|
|
1106
|
+
orgCheckboxTitle ||
|
|
1107
|
+
getText(
|
|
1108
|
+
'allOrgAvailable',
|
|
1109
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
1110
|
+
),
|
|
1111
|
+
),
|
|
1112
|
+
),
|
|
1113
|
+
),
|
|
1114
|
+
/*#__PURE__*/ React.createElement(
|
|
1115
|
+
'div',
|
|
1116
|
+
{
|
|
1117
|
+
className: 'panel-menu-body',
|
|
1118
|
+
},
|
|
1119
|
+
/*#__PURE__*/ React.createElement(
|
|
1120
|
+
'div',
|
|
1121
|
+
{
|
|
1122
|
+
className: 'panel-left',
|
|
1123
|
+
style: {
|
|
1124
|
+
width: '60%',
|
|
1125
|
+
},
|
|
1126
|
+
},
|
|
1127
|
+
/*#__PURE__*/ React.createElement(_Input, {
|
|
1128
|
+
size: 'small',
|
|
1129
|
+
placeholder: getText(
|
|
1130
|
+
'search',
|
|
1131
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
1132
|
+
),
|
|
1133
|
+
onChange: function onChange(e) {
|
|
1134
|
+
debouncedOrgSearch(e.target.value);
|
|
1135
|
+
},
|
|
1136
|
+
suffix: /*#__PURE__*/ React.createElement(_Icon, {
|
|
1137
|
+
type: 'zoom',
|
|
1138
|
+
}),
|
|
1139
|
+
style: {
|
|
1140
|
+
marginBottom: 16,
|
|
1141
|
+
width: 'calc(100% - 16px)',
|
|
1142
|
+
},
|
|
1143
|
+
}),
|
|
1144
|
+
/*#__PURE__*/ React.createElement(_TntdVirtualTree, {
|
|
1145
|
+
style: {
|
|
1146
|
+
overflowX: 'auto',
|
|
1147
|
+
},
|
|
1148
|
+
isOrg: true,
|
|
1149
|
+
treeData: treeData,
|
|
1150
|
+
filterKey: filterOrg,
|
|
1151
|
+
blockNode: true,
|
|
1152
|
+
checkable: true,
|
|
1153
|
+
checkStrictly: true,
|
|
1154
|
+
checkedKeys: checkedKeys,
|
|
1155
|
+
defaultExpandAll: true,
|
|
1156
|
+
onCheck: onCheck,
|
|
1157
|
+
height: windowHeight,
|
|
1158
|
+
titleRender: defaultRenderItem,
|
|
1159
|
+
}),
|
|
1160
|
+
),
|
|
1161
|
+
/*#__PURE__*/ React.createElement(
|
|
1162
|
+
'div',
|
|
1163
|
+
{
|
|
1164
|
+
className: 'panel-right',
|
|
1165
|
+
style: {
|
|
1166
|
+
width: '40%',
|
|
1167
|
+
},
|
|
1168
|
+
},
|
|
1169
|
+
/*#__PURE__*/ React.createElement(
|
|
1170
|
+
'div',
|
|
1171
|
+
{
|
|
1172
|
+
className: 'select-menu-header',
|
|
1173
|
+
},
|
|
1174
|
+
/*#__PURE__*/ React.createElement(
|
|
1175
|
+
'span',
|
|
1176
|
+
null,
|
|
1177
|
+
getText(
|
|
1178
|
+
'hasBeenSelected',
|
|
1179
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
1180
|
+
),
|
|
1181
|
+
':',
|
|
1182
|
+
' ',
|
|
1183
|
+
getText(
|
|
1184
|
+
'numOfOrg',
|
|
1185
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
1186
|
+
areadySelectOrg.length || 0,
|
|
1187
|
+
),
|
|
1188
|
+
),
|
|
1189
|
+
/*#__PURE__*/ React.createElement(
|
|
1190
|
+
'a',
|
|
1191
|
+
{
|
|
1192
|
+
className: canNotRemoveOrg ? 'disabeld' : '',
|
|
1193
|
+
onClick: function onClick() {
|
|
1194
|
+
return onRemoveAllOrg();
|
|
1195
|
+
},
|
|
1196
|
+
},
|
|
1197
|
+
getText('clear', props === null || props === void 0 ? void 0 : props.lang),
|
|
1198
|
+
),
|
|
1199
|
+
),
|
|
1200
|
+
/*#__PURE__*/ React.createElement(
|
|
1201
|
+
'ul',
|
|
1202
|
+
{
|
|
1203
|
+
className: 'select-menu-list',
|
|
1204
|
+
},
|
|
1205
|
+
checkedKeys
|
|
1206
|
+
.filter(function (i) {
|
|
1207
|
+
return !!orgMapRef.current[i];
|
|
1208
|
+
})
|
|
1209
|
+
.map(function (item, index) {
|
|
1210
|
+
var node = orgMapRef.current[item] || {};
|
|
1211
|
+
var path = node.path,
|
|
1212
|
+
name = node.name;
|
|
1213
|
+
var pathDisplayName = getOrgPathDisplayName(path);
|
|
1214
|
+
var disabled = rootNode.key === item;
|
|
1215
|
+
return /*#__PURE__*/ React.createElement(
|
|
1216
|
+
'li',
|
|
1217
|
+
{
|
|
1218
|
+
key: item.value + index,
|
|
1219
|
+
className: 'select-menu-list-item',
|
|
1220
|
+
},
|
|
1221
|
+
/*#__PURE__*/ React.createElement(
|
|
1222
|
+
'span',
|
|
1223
|
+
{
|
|
1224
|
+
className: 'org-name',
|
|
1225
|
+
},
|
|
1226
|
+
/*#__PURE__*/ React.createElement(_Ellipsis, {
|
|
1227
|
+
title: name,
|
|
1228
|
+
}),
|
|
1229
|
+
),
|
|
1230
|
+
/*#__PURE__*/ React.createElement(
|
|
1231
|
+
'span',
|
|
1232
|
+
{
|
|
1233
|
+
className: 'path-name',
|
|
1234
|
+
},
|
|
1235
|
+
/*#__PURE__*/ React.createElement(_Ellipsis, {
|
|
1236
|
+
title: pathDisplayName,
|
|
1237
|
+
}),
|
|
1238
|
+
),
|
|
1239
|
+
!disabled &&
|
|
1240
|
+
/*#__PURE__*/ React.createElement(_Icon, {
|
|
1241
|
+
type: 'close',
|
|
1242
|
+
className: 'close-icon',
|
|
1243
|
+
onClick: function onClick() {
|
|
1244
|
+
return onRemoveSingleOrg(node);
|
|
1245
|
+
},
|
|
1246
|
+
}),
|
|
1247
|
+
);
|
|
1248
|
+
}) || /*#__PURE__*/ React.createElement(_Empty, null),
|
|
1249
|
+
),
|
|
1250
|
+
),
|
|
1251
|
+
),
|
|
1252
|
+
),
|
|
1253
|
+
/*#__PURE__*/ React.createElement(
|
|
1254
|
+
'div',
|
|
1255
|
+
{
|
|
1256
|
+
className: 'app-panel panel',
|
|
1257
|
+
},
|
|
1258
|
+
/*#__PURE__*/ React.createElement(
|
|
1259
|
+
'div',
|
|
1260
|
+
{
|
|
1261
|
+
className: 'menu-header',
|
|
1262
|
+
},
|
|
1263
|
+
/*#__PURE__*/ React.createElement(
|
|
1264
|
+
'span',
|
|
1265
|
+
{
|
|
1266
|
+
className: 'title',
|
|
1267
|
+
},
|
|
1268
|
+
appTitle ||
|
|
1269
|
+
getText(
|
|
1270
|
+
'authorizesAppList',
|
|
1271
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
1272
|
+
),
|
|
1273
|
+
),
|
|
1274
|
+
/*#__PURE__*/ React.createElement(
|
|
1275
|
+
'div',
|
|
1276
|
+
{
|
|
1277
|
+
className: 'menu-all-checked',
|
|
1278
|
+
},
|
|
1279
|
+
/*#__PURE__*/ React.createElement(
|
|
1280
|
+
_Checkbox,
|
|
1281
|
+
{
|
|
1282
|
+
onChange: checkedAllApp,
|
|
1283
|
+
checked: allAppChecked,
|
|
1284
|
+
disabled: disabled,
|
|
1285
|
+
},
|
|
1286
|
+
appCheckboxTitle ||
|
|
1287
|
+
getText(
|
|
1288
|
+
'allAppAvailable',
|
|
1289
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
1290
|
+
),
|
|
1291
|
+
),
|
|
1292
|
+
),
|
|
1293
|
+
),
|
|
1294
|
+
/*#__PURE__*/ React.createElement(
|
|
1295
|
+
'div',
|
|
1296
|
+
{
|
|
1297
|
+
className: 'panel-menu-body',
|
|
1298
|
+
},
|
|
1299
|
+
/*#__PURE__*/ React.createElement(
|
|
1300
|
+
'div',
|
|
1301
|
+
{
|
|
1302
|
+
className: 'panel-left',
|
|
1303
|
+
},
|
|
1304
|
+
/*#__PURE__*/ React.createElement(_Input, {
|
|
1305
|
+
onChange: function onChange(e) {
|
|
1306
|
+
debouncedAppSearch(e.target.value);
|
|
1307
|
+
},
|
|
1308
|
+
placeholder: getText(
|
|
1309
|
+
'enterAppName',
|
|
1310
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
1311
|
+
),
|
|
1312
|
+
size: 'small',
|
|
1313
|
+
suffix: /*#__PURE__*/ React.createElement(_Icon, {
|
|
1314
|
+
type: 'zoom',
|
|
1315
|
+
}),
|
|
1316
|
+
style: {
|
|
1317
|
+
marginBottom: 16,
|
|
1318
|
+
width: 'calc(100% - 16px)',
|
|
1319
|
+
},
|
|
1320
|
+
}),
|
|
1321
|
+
appListDomRender,
|
|
1322
|
+
),
|
|
1323
|
+
/*#__PURE__*/ React.createElement(
|
|
1324
|
+
'div',
|
|
1325
|
+
{
|
|
1326
|
+
className: 'panel-right',
|
|
1327
|
+
},
|
|
1328
|
+
/*#__PURE__*/ React.createElement(
|
|
1329
|
+
'div',
|
|
1330
|
+
{
|
|
1331
|
+
className: 'select-menu-header',
|
|
1332
|
+
},
|
|
1333
|
+
/*#__PURE__*/ React.createElement(
|
|
1334
|
+
'span',
|
|
1335
|
+
null,
|
|
1336
|
+
getText(
|
|
1337
|
+
'hasBeenSelected',
|
|
1338
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
1339
|
+
),
|
|
1340
|
+
':',
|
|
1341
|
+
' ',
|
|
1342
|
+
getText(
|
|
1343
|
+
'numOfApp',
|
|
1344
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
1345
|
+
areadySelectApp.length || 0,
|
|
1346
|
+
),
|
|
1347
|
+
),
|
|
1348
|
+
/*#__PURE__*/ React.createElement(
|
|
1349
|
+
'a',
|
|
1350
|
+
{
|
|
1351
|
+
className: canNotRemoveApp ? 'disabeld' : '',
|
|
1352
|
+
onClick: function onClick() {
|
|
1353
|
+
return onRemoveAllApp();
|
|
1354
|
+
},
|
|
1355
|
+
},
|
|
1356
|
+
getText('clear', props === null || props === void 0 ? void 0 : props.lang),
|
|
1357
|
+
),
|
|
1358
|
+
),
|
|
1359
|
+
/*#__PURE__*/ React.createElement(
|
|
1360
|
+
'ul',
|
|
1361
|
+
{
|
|
1362
|
+
className: 'select-menu-list',
|
|
1363
|
+
},
|
|
1364
|
+
appKeys.map(function (item, index) {
|
|
1365
|
+
var node = appMapRef.current[item] || {};
|
|
1366
|
+
var value = node.value,
|
|
1367
|
+
label = node.label;
|
|
1368
|
+
var isOwnAppCode = appCode === value;
|
|
1369
|
+
if (!value && !label) return null; // 不显示多余数据
|
|
1370
|
+
return /*#__PURE__*/ React.createElement(
|
|
1371
|
+
'li',
|
|
1372
|
+
{
|
|
1373
|
+
key: value + index,
|
|
1374
|
+
className: 'select-menu-list-item',
|
|
1375
|
+
},
|
|
1376
|
+
/*#__PURE__*/ React.createElement(
|
|
1377
|
+
'span',
|
|
1378
|
+
{
|
|
1379
|
+
className: 'app-name',
|
|
1380
|
+
},
|
|
1381
|
+
/*#__PURE__*/ React.createElement(_Ellipsis, {
|
|
1382
|
+
title: label,
|
|
1383
|
+
}),
|
|
1384
|
+
),
|
|
1385
|
+
!isOwnAppCode &&
|
|
1386
|
+
/*#__PURE__*/ React.createElement(_Icon, {
|
|
1387
|
+
type: 'close',
|
|
1388
|
+
className: 'close-icon',
|
|
1389
|
+
onClick: function onClick() {
|
|
1390
|
+
return onRemoveSingleApp(value);
|
|
1391
|
+
},
|
|
1392
|
+
}),
|
|
1393
|
+
);
|
|
1394
|
+
}) || /*#__PURE__*/ React.createElement(_Empty, null),
|
|
1395
|
+
),
|
|
1396
|
+
),
|
|
1397
|
+
),
|
|
1398
|
+
),
|
|
1399
|
+
!!showUser &&
|
|
1400
|
+
/*#__PURE__*/ React.createElement(
|
|
1401
|
+
'div',
|
|
1402
|
+
{
|
|
1403
|
+
className: 'user-panel panel',
|
|
1404
|
+
},
|
|
1405
|
+
/*#__PURE__*/ React.createElement(
|
|
1406
|
+
'div',
|
|
1407
|
+
{
|
|
1408
|
+
className: 'menu-header',
|
|
1409
|
+
},
|
|
1410
|
+
/*#__PURE__*/ React.createElement(
|
|
1411
|
+
'span',
|
|
1412
|
+
{
|
|
1413
|
+
className: 'title',
|
|
1414
|
+
},
|
|
1415
|
+
userTitle ||
|
|
1416
|
+
getText(
|
|
1417
|
+
'authorizesUserList',
|
|
1418
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
1419
|
+
),
|
|
1420
|
+
),
|
|
1421
|
+
/*#__PURE__*/ React.createElement(
|
|
1422
|
+
'div',
|
|
1423
|
+
{
|
|
1424
|
+
className: 'menu-all-checked',
|
|
1425
|
+
},
|
|
1426
|
+
/*#__PURE__*/ React.createElement(
|
|
1427
|
+
_Checkbox,
|
|
1428
|
+
{
|
|
1429
|
+
onChange: checkedAllUser,
|
|
1430
|
+
checked: allUserChecked,
|
|
1431
|
+
disabled: disabled,
|
|
1432
|
+
},
|
|
1433
|
+
userCheckboxTitle ||
|
|
1434
|
+
getText(
|
|
1435
|
+
'allUserAvailable',
|
|
1436
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
1437
|
+
),
|
|
1438
|
+
),
|
|
1439
|
+
),
|
|
1440
|
+
),
|
|
1441
|
+
/*#__PURE__*/ React.createElement(
|
|
1442
|
+
'div',
|
|
1443
|
+
{
|
|
1444
|
+
className: 'panel-menu-body',
|
|
1445
|
+
},
|
|
1446
|
+
/*#__PURE__*/ React.createElement(
|
|
1447
|
+
'div',
|
|
1448
|
+
{
|
|
1449
|
+
className: 'panel-left',
|
|
1450
|
+
},
|
|
1451
|
+
/*#__PURE__*/ React.createElement(_Input, {
|
|
1452
|
+
size: 'small',
|
|
1453
|
+
placeholder: getText(
|
|
1454
|
+
'enterUserName',
|
|
1455
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
1456
|
+
),
|
|
1457
|
+
onChange: function onChange(e) {
|
|
1458
|
+
debouncedUserSearch(e.target.value);
|
|
1459
|
+
},
|
|
1460
|
+
suffix: /*#__PURE__*/ React.createElement(_Icon, {
|
|
1461
|
+
type: 'zoom',
|
|
1462
|
+
}),
|
|
1463
|
+
style: {
|
|
1464
|
+
marginBottom: 16,
|
|
1465
|
+
width: 'calc(100% - 16px)',
|
|
1466
|
+
},
|
|
1467
|
+
}),
|
|
1468
|
+
userListDomRender,
|
|
1469
|
+
),
|
|
1470
|
+
/*#__PURE__*/ React.createElement(
|
|
1471
|
+
'div',
|
|
1472
|
+
{
|
|
1473
|
+
className: 'panel-right',
|
|
1474
|
+
},
|
|
1475
|
+
/*#__PURE__*/ React.createElement(
|
|
1476
|
+
'div',
|
|
1477
|
+
{
|
|
1478
|
+
className: 'select-menu-header',
|
|
1479
|
+
},
|
|
1480
|
+
/*#__PURE__*/ React.createElement(
|
|
1481
|
+
'span',
|
|
1482
|
+
null,
|
|
1483
|
+
getText(
|
|
1484
|
+
'hasBeenSelected',
|
|
1485
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
1486
|
+
),
|
|
1487
|
+
':',
|
|
1488
|
+
' ',
|
|
1489
|
+
getText(
|
|
1490
|
+
'numOfUser',
|
|
1491
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
1492
|
+
areadySelectUser.length || 0,
|
|
1493
|
+
),
|
|
1494
|
+
),
|
|
1495
|
+
/*#__PURE__*/ React.createElement(
|
|
1496
|
+
'a',
|
|
1497
|
+
{
|
|
1498
|
+
onClick: function onClick() {
|
|
1499
|
+
return onRemoveAllOrg();
|
|
1500
|
+
},
|
|
1501
|
+
},
|
|
1502
|
+
getText('clear', props === null || props === void 0 ? void 0 : props.lang),
|
|
1503
|
+
),
|
|
1504
|
+
),
|
|
1505
|
+
/*#__PURE__*/ React.createElement(
|
|
1506
|
+
'ul',
|
|
1507
|
+
{
|
|
1508
|
+
className: 'select-menu-list',
|
|
1509
|
+
},
|
|
1510
|
+
userKeys.map(function (item, index) {
|
|
1511
|
+
var node = userMapRef.current[item] || {};
|
|
1512
|
+
var userName = node.userName;
|
|
1513
|
+
var isOwnAppCode = accounts === node.account;
|
|
1514
|
+
if (!userName && !node.account) return null; // 不显示多余数据
|
|
1515
|
+
return /*#__PURE__*/ React.createElement(
|
|
1516
|
+
'li',
|
|
1517
|
+
{
|
|
1518
|
+
key: userName + index,
|
|
1519
|
+
className: 'select-menu-list-item',
|
|
1520
|
+
},
|
|
1521
|
+
/*#__PURE__*/ React.createElement(
|
|
1522
|
+
'span',
|
|
1523
|
+
{
|
|
1524
|
+
className: 'app-name',
|
|
1525
|
+
},
|
|
1526
|
+
/*#__PURE__*/ React.createElement(_Ellipsis, {
|
|
1527
|
+
title: userName,
|
|
1528
|
+
}),
|
|
1529
|
+
),
|
|
1530
|
+
!isOwnAppCode &&
|
|
1531
|
+
/*#__PURE__*/ React.createElement(_Icon, {
|
|
1532
|
+
type: 'close',
|
|
1533
|
+
className: 'close-icon',
|
|
1534
|
+
onClick: function onClick() {
|
|
1535
|
+
return onRemoveSingleUser(node.account);
|
|
1536
|
+
},
|
|
1537
|
+
}),
|
|
1538
|
+
);
|
|
1539
|
+
}) || /*#__PURE__*/ React.createElement(_Empty, null),
|
|
1540
|
+
),
|
|
1541
|
+
),
|
|
1542
|
+
),
|
|
1543
|
+
),
|
|
1544
|
+
),
|
|
1545
|
+
),
|
|
1546
|
+
);
|
|
930
1547
|
};
|
|
931
|
-
export default AssignModal;
|
|
1548
|
+
export default AssignModal;
|