@tddc/assign-modal 2.0.4 → 2.0.6
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 +443 -201
- package/es/AssignModal/AssignApp/utils.js +61 -18
- package/es/AssignModal/index.js +154 -37
- package/es/AssignModal/index.less +7 -7
- package/es/index.js +3 -2
- package/es/locale.js +22 -12
- package/package.json +16 -19
|
@@ -1,18 +1,90 @@
|
|
|
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
|
-
|
|
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) {
|
|
6
|
+
return (
|
|
7
|
+
_arrayWithoutHoles(arr) ||
|
|
8
|
+
_iterableToArray(arr) ||
|
|
9
|
+
_unsupportedIterableToArray(arr) ||
|
|
10
|
+
_nonIterableSpread()
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
function _nonIterableSpread() {
|
|
14
|
+
throw new TypeError(
|
|
15
|
+
'Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.',
|
|
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++) {
|
|
53
|
+
arr2[i] = arr[i];
|
|
54
|
+
}
|
|
55
|
+
return arr2;
|
|
56
|
+
}
|
|
57
|
+
function _iterableToArrayLimit(arr, i) {
|
|
58
|
+
var _i =
|
|
59
|
+
arr == null
|
|
60
|
+
? null
|
|
61
|
+
: (typeof Symbol !== 'undefined' && arr[Symbol.iterator]) || arr['@@iterator'];
|
|
62
|
+
if (_i == null) return;
|
|
63
|
+
var _arr = [];
|
|
64
|
+
var _n = true;
|
|
65
|
+
var _d = false;
|
|
66
|
+
var _s, _e;
|
|
67
|
+
try {
|
|
68
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
69
|
+
_arr.push(_s.value);
|
|
70
|
+
if (i && _arr.length === i) break;
|
|
71
|
+
}
|
|
72
|
+
} catch (err) {
|
|
73
|
+
_d = true;
|
|
74
|
+
_e = err;
|
|
75
|
+
} finally {
|
|
76
|
+
try {
|
|
77
|
+
if (!_n && _i['return'] != null) _i['return']();
|
|
78
|
+
} finally {
|
|
79
|
+
if (_d) throw _e;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return _arr;
|
|
83
|
+
}
|
|
84
|
+
function _arrayWithHoles(arr) {
|
|
85
|
+
if (Array.isArray(arr)) return arr;
|
|
86
|
+
}
|
|
87
|
+
import React from 'react';
|
|
16
88
|
import { useEffect, useState, useCallback } from 'react';
|
|
17
89
|
import { cloneDeep, debounce } from 'lodash';
|
|
18
90
|
import './index.less';
|
|
@@ -53,9 +125,12 @@ var AssignModal = function AssignModal(props) {
|
|
|
53
125
|
var allApp = appList.map(function (item) {
|
|
54
126
|
return item.value;
|
|
55
127
|
});
|
|
56
|
-
var allUser =
|
|
57
|
-
|
|
58
|
-
|
|
128
|
+
var allUser =
|
|
129
|
+
(userList === null || userList === void 0
|
|
130
|
+
? void 0
|
|
131
|
+
: userList.map(function (item) {
|
|
132
|
+
return item.account;
|
|
133
|
+
})) || [];
|
|
59
134
|
var _useState = useState([]),
|
|
60
135
|
_useState2 = _slicedToArray(_useState, 2),
|
|
61
136
|
checkedKeys = _useState2[0],
|
|
@@ -85,82 +160,101 @@ var AssignModal = function AssignModal(props) {
|
|
|
85
160
|
filterUser = _useState14[0],
|
|
86
161
|
setFilterUser = _useState14[1];
|
|
87
162
|
if (!((_orgList$ = orgList[0]) === null || _orgList$ === void 0 ? void 0 : _orgList$.path)) {
|
|
88
|
-
|
|
89
|
-
|
|
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))));
|
|
163
|
+
for (var i = 0; i < orgList.length; i++) {
|
|
164
|
+
addPath(orgList[i], []); // 添加 上级机构到子机构的路径
|
|
101
165
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
useEffect(
|
|
169
|
+
function () {
|
|
170
|
+
// path 和 allOrgList 赋值
|
|
171
|
+
path = findSameCodePath(orgList, orgCode);
|
|
172
|
+
var initOrgs = [];
|
|
173
|
+
var initApps = [];
|
|
174
|
+
var initAccounts = [];
|
|
175
|
+
if (orgCodes.includes('all')) {
|
|
176
|
+
setAllOrgChecked(orgCodes.includes('all'));
|
|
177
|
+
initOrgs = allOrg;
|
|
112
178
|
} else {
|
|
113
|
-
|
|
179
|
+
initOrgs = Array.from(
|
|
180
|
+
new Set([].concat(_toConsumableArray(orgCodes || []), _toConsumableArray(path))),
|
|
181
|
+
);
|
|
114
182
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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
|
|
183
|
+
if (appCodes.includes('all')) {
|
|
184
|
+
setAllAppChecked(appCodes.includes('all'));
|
|
185
|
+
initApps = allApp;
|
|
186
|
+
} else {
|
|
187
|
+
initApps = Array.from(new Set([].concat(_toConsumableArray(appCodes || []), [appCode])));
|
|
130
188
|
}
|
|
131
|
-
|
|
132
|
-
|
|
189
|
+
if (showUser) {
|
|
190
|
+
if (accounts.includes('all')) {
|
|
191
|
+
setAllUserChecked(true);
|
|
192
|
+
initAccounts = allUser;
|
|
193
|
+
} else {
|
|
194
|
+
initAccounts = Array.from(
|
|
195
|
+
new Set([].concat(_toConsumableArray(accounts || []), [account])),
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
setCheckedKeys(initOrgs);
|
|
200
|
+
setAppKeys(initApps || []);
|
|
201
|
+
setUserKeys(initAccounts || []);
|
|
202
|
+
onChange &&
|
|
203
|
+
onChange({
|
|
204
|
+
appKeys: appCodes.includes('all') ? ['all'] : initApps,
|
|
205
|
+
checkedKeys: orgCodes.includes('all') ? ['all'] : initOrgs,
|
|
206
|
+
userKeys: accounts.includes('all') ? ['all'] : initAccounts,
|
|
207
|
+
appCheckAll: appCodes.includes('all'),
|
|
208
|
+
orgCheckAll: orgCodes.includes('all'),
|
|
209
|
+
userCheckAll: accounts.includes('all'),
|
|
210
|
+
checkData: {
|
|
211
|
+
apps: initApps,
|
|
212
|
+
orgs: initOrgs,
|
|
213
|
+
accounts: initAccounts,
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
},
|
|
217
|
+
[dataItem],
|
|
218
|
+
);
|
|
133
219
|
var loopTreeNodes = function loopTreeNodes(data) {
|
|
134
220
|
var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
135
221
|
var NodeTitle = function NodeTitle(_ref) {
|
|
136
222
|
var node = _ref.node;
|
|
137
|
-
return /*#__PURE__*/React.createElement(
|
|
138
|
-
|
|
139
|
-
|
|
223
|
+
return /*#__PURE__*/ React.createElement(
|
|
224
|
+
'div',
|
|
225
|
+
{
|
|
226
|
+
className: 'node-title',
|
|
227
|
+
},
|
|
228
|
+
node.title,
|
|
229
|
+
);
|
|
140
230
|
};
|
|
141
231
|
return data.map(function (item) {
|
|
142
232
|
var orgDisabled = path.includes(item.code);
|
|
143
233
|
if (item.children) {
|
|
144
|
-
return /*#__PURE__*/React.createElement(
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
234
|
+
return /*#__PURE__*/ React.createElement(
|
|
235
|
+
TreeNode,
|
|
236
|
+
{
|
|
237
|
+
key: item.code,
|
|
238
|
+
title: /*#__PURE__*/ React.createElement(NodeTitle, {
|
|
239
|
+
node: item,
|
|
240
|
+
}),
|
|
241
|
+
item: item,
|
|
242
|
+
disabled: orgDisabled || disabled || allOrgChecked,
|
|
243
|
+
},
|
|
244
|
+
loopTreeNodes(item.children, level + 1),
|
|
245
|
+
);
|
|
152
246
|
}
|
|
153
|
-
return /*#__PURE__*/React.createElement(TreeNode, {
|
|
247
|
+
return /*#__PURE__*/ React.createElement(TreeNode, {
|
|
154
248
|
style: {
|
|
155
|
-
paddingLeft:
|
|
156
|
-
marginLeft:
|
|
249
|
+
paddingLeft: ''.concat((level + 1) * 14, 'px'),
|
|
250
|
+
marginLeft: '-'.concat(level * 14, 'px'),
|
|
157
251
|
},
|
|
158
252
|
key: item.code,
|
|
159
|
-
title: /*#__PURE__*/React.createElement(NodeTitle, {
|
|
160
|
-
node: item
|
|
253
|
+
title: /*#__PURE__*/ React.createElement(NodeTitle, {
|
|
254
|
+
node: item,
|
|
161
255
|
}),
|
|
162
256
|
item: item,
|
|
163
|
-
disabled: orgDisabled || disabled
|
|
257
|
+
disabled: orgDisabled || disabled,
|
|
164
258
|
});
|
|
165
259
|
});
|
|
166
260
|
};
|
|
@@ -180,7 +274,9 @@ var AssignModal = function AssignModal(props) {
|
|
|
180
274
|
});
|
|
181
275
|
}
|
|
182
276
|
if (info.checked) {
|
|
183
|
-
checked = Array.from(
|
|
277
|
+
checked = Array.from(
|
|
278
|
+
new Set([].concat(_toConsumableArray(checked), _toConsumableArray(path))),
|
|
279
|
+
);
|
|
184
280
|
}
|
|
185
281
|
setCheckedKeys(checked);
|
|
186
282
|
onChange({
|
|
@@ -193,8 +289,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
193
289
|
checkData: {
|
|
194
290
|
apps: appKeys,
|
|
195
291
|
orgs: checked,
|
|
196
|
-
accounts: userKeys
|
|
197
|
-
}
|
|
292
|
+
accounts: userKeys,
|
|
293
|
+
},
|
|
198
294
|
});
|
|
199
295
|
};
|
|
200
296
|
var assignApp = function assignApp(e) {
|
|
@@ -223,8 +319,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
223
319
|
checkData: {
|
|
224
320
|
apps: newAppKeys,
|
|
225
321
|
orgs: checkedKeys,
|
|
226
|
-
accounts: userKeys
|
|
227
|
-
}
|
|
322
|
+
accounts: userKeys,
|
|
323
|
+
},
|
|
228
324
|
});
|
|
229
325
|
};
|
|
230
326
|
var assignUser = function assignUser(e) {
|
|
@@ -253,8 +349,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
253
349
|
checkData: {
|
|
254
350
|
apps: appKeys,
|
|
255
351
|
orgs: checkedKeys,
|
|
256
|
-
accounts: newUserKeys
|
|
257
|
-
}
|
|
352
|
+
accounts: newUserKeys,
|
|
353
|
+
},
|
|
258
354
|
});
|
|
259
355
|
};
|
|
260
356
|
|
|
@@ -275,13 +371,15 @@ var AssignModal = function AssignModal(props) {
|
|
|
275
371
|
checkData: {
|
|
276
372
|
apps: appKeys,
|
|
277
373
|
orgs: checkedKeys,
|
|
278
|
-
accounts: accounts
|
|
279
|
-
}
|
|
374
|
+
accounts: accounts,
|
|
375
|
+
},
|
|
280
376
|
});
|
|
281
377
|
} else {
|
|
282
378
|
setAllOrgChecked(false);
|
|
283
379
|
var arr = orgCodes.includes('all') ? allOrg : orgCodes;
|
|
284
|
-
orgChecks = Array.from(
|
|
380
|
+
orgChecks = Array.from(
|
|
381
|
+
new Set([].concat(_toConsumableArray(arr || []), _toConsumableArray(path))),
|
|
382
|
+
);
|
|
285
383
|
setCheckedKeys(orgChecks);
|
|
286
384
|
onChange({
|
|
287
385
|
appKeys: allAppChecked ? ['all'] : appKeys,
|
|
@@ -293,8 +391,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
293
391
|
checkData: {
|
|
294
392
|
apps: appKeys,
|
|
295
393
|
orgs: orgChecks,
|
|
296
|
-
accounts: accounts
|
|
297
|
-
}
|
|
394
|
+
accounts: accounts,
|
|
395
|
+
},
|
|
298
396
|
});
|
|
299
397
|
}
|
|
300
398
|
};
|
|
@@ -318,8 +416,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
318
416
|
checkData: {
|
|
319
417
|
apps: appChecks,
|
|
320
418
|
orgs: checkedKeys,
|
|
321
|
-
accounts: accounts
|
|
322
|
-
}
|
|
419
|
+
accounts: accounts,
|
|
420
|
+
},
|
|
323
421
|
});
|
|
324
422
|
} else {
|
|
325
423
|
setAllAppChecked(false);
|
|
@@ -336,8 +434,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
336
434
|
checkData: {
|
|
337
435
|
apps: appChecks,
|
|
338
436
|
orgs: checkedKeys,
|
|
339
|
-
accounts: accounts
|
|
340
|
-
}
|
|
437
|
+
accounts: accounts,
|
|
438
|
+
},
|
|
341
439
|
});
|
|
342
440
|
}
|
|
343
441
|
};
|
|
@@ -361,8 +459,8 @@ var AssignModal = function AssignModal(props) {
|
|
|
361
459
|
checkData: {
|
|
362
460
|
apps: appKeys,
|
|
363
461
|
orgs: checkedKeys,
|
|
364
|
-
accounts: userChecks
|
|
365
|
-
}
|
|
462
|
+
accounts: userChecks,
|
|
463
|
+
},
|
|
366
464
|
});
|
|
367
465
|
} else {
|
|
368
466
|
setAllUserChecked(false);
|
|
@@ -379,115 +477,259 @@ var AssignModal = function AssignModal(props) {
|
|
|
379
477
|
checkData: {
|
|
380
478
|
apps: appKeys,
|
|
381
479
|
orgs: checkedKeys,
|
|
382
|
-
accounts: userChecks
|
|
383
|
-
}
|
|
480
|
+
accounts: userChecks,
|
|
481
|
+
},
|
|
384
482
|
});
|
|
385
483
|
}
|
|
386
484
|
};
|
|
387
|
-
var debouncedSearch = useCallback(
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
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);
|
|
485
|
+
var debouncedSearch = useCallback(
|
|
486
|
+
debounce(function (nextValue) {
|
|
487
|
+
setFilterUser(nextValue);
|
|
488
|
+
}, 200),
|
|
489
|
+
[],
|
|
490
|
+
);
|
|
491
|
+
return /*#__PURE__*/ React.createElement(
|
|
492
|
+
'div',
|
|
493
|
+
{
|
|
494
|
+
className: 'assign-box-container',
|
|
460
495
|
},
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
496
|
+
/*#__PURE__*/ React.createElement(
|
|
497
|
+
'div',
|
|
498
|
+
{
|
|
499
|
+
className: 'left',
|
|
500
|
+
},
|
|
501
|
+
/*#__PURE__*/ React.createElement(
|
|
502
|
+
'div',
|
|
503
|
+
{
|
|
504
|
+
className: 'menu-header',
|
|
505
|
+
},
|
|
506
|
+
orgTitle ||
|
|
507
|
+
getText('authorizesOrgList', props === null || props === void 0 ? void 0 : props.lang),
|
|
508
|
+
/*#__PURE__*/ React.createElement(
|
|
509
|
+
'div',
|
|
510
|
+
{
|
|
511
|
+
className: 'menu-all-checked',
|
|
512
|
+
},
|
|
513
|
+
/*#__PURE__*/ React.createElement(
|
|
514
|
+
_Checkbox,
|
|
515
|
+
{
|
|
516
|
+
onChange: checkAllOrg,
|
|
517
|
+
checked: allOrgChecked,
|
|
518
|
+
disabled: disabled,
|
|
519
|
+
},
|
|
520
|
+
orgCheckboxTitle ||
|
|
521
|
+
getText('allOrgAvailable', props === null || props === void 0 ? void 0 : props.lang),
|
|
522
|
+
),
|
|
523
|
+
),
|
|
524
|
+
),
|
|
525
|
+
/*#__PURE__*/ React.createElement(
|
|
526
|
+
_Tree,
|
|
527
|
+
{
|
|
528
|
+
blockNode: true,
|
|
529
|
+
className: 'tree-list',
|
|
530
|
+
checkable: true,
|
|
531
|
+
checkStrictly: true,
|
|
532
|
+
checkedKeys: checkedKeys,
|
|
533
|
+
defaultExpandAll: true,
|
|
534
|
+
onCheck: onCheck,
|
|
535
|
+
disabled: true,
|
|
536
|
+
},
|
|
537
|
+
loopTreeNodes(orgList, 0),
|
|
538
|
+
),
|
|
539
|
+
),
|
|
540
|
+
/*#__PURE__*/ React.createElement(
|
|
541
|
+
'div',
|
|
542
|
+
{
|
|
543
|
+
className: 'right',
|
|
544
|
+
},
|
|
545
|
+
/*#__PURE__*/ React.createElement(
|
|
546
|
+
'div',
|
|
547
|
+
{
|
|
548
|
+
className: 'menu-header',
|
|
549
|
+
},
|
|
550
|
+
appTitle ||
|
|
551
|
+
getText('authorizesAppList', props === null || props === void 0 ? void 0 : props.lang),
|
|
552
|
+
/*#__PURE__*/ React.createElement(
|
|
553
|
+
'div',
|
|
554
|
+
{
|
|
555
|
+
className: 'menu-all-checked',
|
|
556
|
+
},
|
|
557
|
+
/*#__PURE__*/ React.createElement(
|
|
558
|
+
_Checkbox,
|
|
559
|
+
{
|
|
560
|
+
onChange: checkedAllApp,
|
|
561
|
+
checked: allAppChecked,
|
|
562
|
+
disabled: disabled,
|
|
563
|
+
},
|
|
564
|
+
appCheckboxTitle ||
|
|
565
|
+
getText('allAppAvailable', props === null || props === void 0 ? void 0 : props.lang),
|
|
566
|
+
),
|
|
567
|
+
),
|
|
568
|
+
),
|
|
569
|
+
/*#__PURE__*/ React.createElement(
|
|
570
|
+
'div',
|
|
571
|
+
{
|
|
572
|
+
className: 'menu-body',
|
|
573
|
+
},
|
|
574
|
+
appList.map(function (item, index) {
|
|
575
|
+
var isCheck =
|
|
576
|
+
appKeys === null || appKeys === void 0 ? void 0 : appKeys.includes(item.value);
|
|
577
|
+
var isOwnAppCode = appCode === item.value;
|
|
578
|
+
return /*#__PURE__*/ React.createElement(
|
|
579
|
+
_Checkbox,
|
|
580
|
+
{
|
|
581
|
+
checked: isCheck,
|
|
582
|
+
disabled: disabled || isOwnAppCode || allAppChecked,
|
|
583
|
+
onChange: assignApp,
|
|
584
|
+
value: item.value,
|
|
585
|
+
key: index,
|
|
586
|
+
},
|
|
587
|
+
/*#__PURE__*/ React.createElement(
|
|
588
|
+
'span',
|
|
589
|
+
{
|
|
590
|
+
style: {
|
|
591
|
+
display: 'inline-block',
|
|
592
|
+
},
|
|
593
|
+
},
|
|
594
|
+
/*#__PURE__*/ React.createElement(_Ellipsis, {
|
|
595
|
+
widthLimit: 100,
|
|
596
|
+
title: item.label,
|
|
597
|
+
}),
|
|
598
|
+
),
|
|
599
|
+
);
|
|
600
|
+
}),
|
|
601
|
+
),
|
|
602
|
+
),
|
|
603
|
+
!!showUser &&
|
|
604
|
+
/*#__PURE__*/ React.createElement(
|
|
605
|
+
'div',
|
|
606
|
+
{
|
|
607
|
+
className: 'user',
|
|
608
|
+
},
|
|
609
|
+
/*#__PURE__*/ React.createElement(
|
|
610
|
+
'div',
|
|
611
|
+
{
|
|
612
|
+
className: 'menu-header',
|
|
613
|
+
},
|
|
614
|
+
userTitle ||
|
|
615
|
+
getText('authorizesUserList', props === null || props === void 0 ? void 0 : props.lang),
|
|
616
|
+
/*#__PURE__*/ React.createElement(
|
|
617
|
+
'div',
|
|
618
|
+
{
|
|
619
|
+
className: 'menu-all-checked',
|
|
620
|
+
},
|
|
621
|
+
/*#__PURE__*/ React.createElement(
|
|
622
|
+
_Checkbox,
|
|
623
|
+
{
|
|
624
|
+
onChange: checkedAllUser,
|
|
625
|
+
checked: allUserChecked,
|
|
626
|
+
disabled: disabled,
|
|
627
|
+
},
|
|
628
|
+
userCheckboxTitle ||
|
|
629
|
+
getText(
|
|
630
|
+
'allUserAvailable',
|
|
631
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
632
|
+
),
|
|
633
|
+
),
|
|
634
|
+
),
|
|
635
|
+
),
|
|
636
|
+
/*#__PURE__*/ React.createElement(
|
|
637
|
+
'div',
|
|
638
|
+
{
|
|
639
|
+
className: 'menu-body',
|
|
640
|
+
},
|
|
641
|
+
/*#__PURE__*/ React.createElement(
|
|
642
|
+
'div',
|
|
643
|
+
{
|
|
644
|
+
className: 'assign-search-wrap',
|
|
645
|
+
},
|
|
646
|
+
/*#__PURE__*/ React.createElement(Search, {
|
|
647
|
+
size: 'small',
|
|
648
|
+
allowClear: true,
|
|
649
|
+
placeholder: getText(
|
|
650
|
+
'search',
|
|
651
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
652
|
+
),
|
|
653
|
+
onChange: function onChange(e) {
|
|
654
|
+
debouncedSearch(e.target.value);
|
|
655
|
+
},
|
|
656
|
+
onSearch: function onSearch(v) {
|
|
657
|
+
setFilterUser(v);
|
|
658
|
+
},
|
|
659
|
+
style: {
|
|
660
|
+
width: '90%',
|
|
661
|
+
},
|
|
662
|
+
}),
|
|
663
|
+
),
|
|
664
|
+
userList === null || userList === void 0
|
|
665
|
+
? void 0
|
|
666
|
+
: userList
|
|
667
|
+
.filter(function (item) {
|
|
668
|
+
if (filterUser) {
|
|
669
|
+
var _item$account, _item$userName;
|
|
670
|
+
return (
|
|
671
|
+
(item === null || item === void 0
|
|
672
|
+
? void 0
|
|
673
|
+
: (_item$account = item.account) === null || _item$account === void 0
|
|
674
|
+
? void 0
|
|
675
|
+
: _item$account
|
|
676
|
+
.toLocaleLowerCase()
|
|
677
|
+
.includes(
|
|
678
|
+
filterUser === null || filterUser === void 0
|
|
679
|
+
? void 0
|
|
680
|
+
: filterUser.toLocaleLowerCase(),
|
|
681
|
+
)) ||
|
|
682
|
+
(item === null || item === void 0
|
|
683
|
+
? void 0
|
|
684
|
+
: (_item$userName = item.userName) === null || _item$userName === void 0
|
|
685
|
+
? void 0
|
|
686
|
+
: _item$userName
|
|
687
|
+
.toLocaleLowerCase()
|
|
688
|
+
.includes(
|
|
689
|
+
filterUser === null || filterUser === void 0
|
|
690
|
+
? void 0
|
|
691
|
+
: filterUser.toLocaleLowerCase(),
|
|
692
|
+
))
|
|
693
|
+
);
|
|
694
|
+
} else {
|
|
695
|
+
return item;
|
|
696
|
+
}
|
|
697
|
+
})
|
|
698
|
+
.map(function (item, index) {
|
|
699
|
+
var isCheck =
|
|
700
|
+
userKeys === null || userKeys === void 0
|
|
701
|
+
? void 0
|
|
702
|
+
: userKeys.includes(item.account);
|
|
703
|
+
var isOwnAccount = account === item.account;
|
|
704
|
+
return /*#__PURE__*/ React.createElement(
|
|
705
|
+
'div',
|
|
706
|
+
null,
|
|
707
|
+
/*#__PURE__*/ React.createElement(
|
|
708
|
+
_Checkbox,
|
|
709
|
+
{
|
|
710
|
+
checked: isCheck,
|
|
711
|
+
disabled: disabled || isOwnAccount || allUserChecked,
|
|
712
|
+
onChange: assignUser,
|
|
713
|
+
value: item.account,
|
|
714
|
+
key: index,
|
|
715
|
+
},
|
|
716
|
+
/*#__PURE__*/ React.createElement(
|
|
717
|
+
'span',
|
|
718
|
+
{
|
|
719
|
+
style: {
|
|
720
|
+
display: 'inline-block',
|
|
721
|
+
},
|
|
722
|
+
},
|
|
723
|
+
/*#__PURE__*/ React.createElement(_Ellipsis, {
|
|
724
|
+
widthLimit: 240,
|
|
725
|
+
title: item.userName,
|
|
726
|
+
}),
|
|
727
|
+
),
|
|
728
|
+
),
|
|
729
|
+
);
|
|
730
|
+
}),
|
|
731
|
+
),
|
|
732
|
+
),
|
|
733
|
+
);
|
|
492
734
|
};
|
|
493
|
-
export default AssignModal;
|
|
735
|
+
export default AssignModal;
|
|
@@ -1,9 +1,42 @@
|
|
|
1
|
-
function _toConsumableArray(arr) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
function _toConsumableArray(arr) {
|
|
2
|
+
return (
|
|
3
|
+
_arrayWithoutHoles(arr) ||
|
|
4
|
+
_iterableToArray(arr) ||
|
|
5
|
+
_unsupportedIterableToArray(arr) ||
|
|
6
|
+
_nonIterableSpread()
|
|
7
|
+
);
|
|
8
|
+
}
|
|
9
|
+
function _nonIterableSpread() {
|
|
10
|
+
throw new TypeError(
|
|
11
|
+
'Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.',
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
15
|
+
if (!o) return;
|
|
16
|
+
if (typeof o === 'string') return _arrayLikeToArray(o, minLen);
|
|
17
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
18
|
+
if (n === 'Object' && o.constructor) n = o.constructor.name;
|
|
19
|
+
if (n === 'Map' || n === 'Set') return Array.from(o);
|
|
20
|
+
if (n === 'Arguments' || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
21
|
+
return _arrayLikeToArray(o, minLen);
|
|
22
|
+
}
|
|
23
|
+
function _iterableToArray(iter) {
|
|
24
|
+
if (
|
|
25
|
+
(typeof Symbol !== 'undefined' && iter[Symbol.iterator] != null) ||
|
|
26
|
+
iter['@@iterator'] != null
|
|
27
|
+
)
|
|
28
|
+
return Array.from(iter);
|
|
29
|
+
}
|
|
30
|
+
function _arrayWithoutHoles(arr) {
|
|
31
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
32
|
+
}
|
|
33
|
+
function _arrayLikeToArray(arr, len) {
|
|
34
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
35
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
36
|
+
arr2[i] = arr[i];
|
|
37
|
+
}
|
|
38
|
+
return arr2;
|
|
39
|
+
}
|
|
7
40
|
// 遍历机构树 添加 path属性 (上级机构到子机构的路径)
|
|
8
41
|
export var addPath = function addPath(root) {
|
|
9
42
|
var parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
@@ -18,19 +51,29 @@ export var addPath = function addPath(root) {
|
|
|
18
51
|
};
|
|
19
52
|
|
|
20
53
|
// 遍历寻找 当前规则集所属机构
|
|
21
|
-
export var findSameCodePath = function findSameCodePath(
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
54
|
+
export var findSameCodePath = function findSameCodePath(orgList, code) {
|
|
55
|
+
var loop = function loop(list, code) {
|
|
56
|
+
for (var i = 0; i < list.length; i++) {
|
|
57
|
+
var _root$children;
|
|
58
|
+
var root = list[i];
|
|
59
|
+
if (root.code === code) {
|
|
60
|
+
return root;
|
|
61
|
+
}
|
|
62
|
+
if (
|
|
63
|
+
((_root$children = root.children) === null || _root$children === void 0
|
|
64
|
+
? void 0
|
|
65
|
+
: _root$children.length) > 0
|
|
66
|
+
) {
|
|
67
|
+
var _back = loop(root.children, code);
|
|
68
|
+
if (_back) {
|
|
69
|
+
return _back;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
30
72
|
}
|
|
73
|
+
return false;
|
|
31
74
|
};
|
|
32
|
-
|
|
33
|
-
return
|
|
75
|
+
var back = loop(orgList, code);
|
|
76
|
+
return (back === null || back === void 0 ? void 0 : back.path) || [];
|
|
34
77
|
};
|
|
35
78
|
|
|
36
79
|
// 遍历输出 orgCode;
|
|
@@ -48,4 +91,4 @@ export var preorder = function preorder(root) {
|
|
|
48
91
|
};
|
|
49
92
|
dfs(root, res);
|
|
50
93
|
return res;
|
|
51
|
-
};
|
|
94
|
+
};
|
package/es/AssignModal/index.js
CHANGED
|
@@ -1,15 +1,119 @@
|
|
|
1
|
-
import _Modal from
|
|
2
|
-
var _excluded = [
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import _Modal from 'tntd/es/modal';
|
|
2
|
+
var _excluded = [
|
|
3
|
+
'visible',
|
|
4
|
+
'orgList',
|
|
5
|
+
'dataItem',
|
|
6
|
+
'close',
|
|
7
|
+
'disabled',
|
|
8
|
+
'title',
|
|
9
|
+
'onSubmit',
|
|
10
|
+
'appList',
|
|
11
|
+
'userList',
|
|
12
|
+
'showUser',
|
|
13
|
+
];
|
|
14
|
+
function _extends() {
|
|
15
|
+
_extends = Object.assign
|
|
16
|
+
? Object.assign.bind()
|
|
17
|
+
: function (target) {
|
|
18
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
19
|
+
var source = arguments[i];
|
|
20
|
+
for (var key in source) {
|
|
21
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
22
|
+
target[key] = source[key];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return target;
|
|
27
|
+
};
|
|
28
|
+
return _extends.apply(this, arguments);
|
|
29
|
+
}
|
|
30
|
+
function _slicedToArray(arr, i) {
|
|
31
|
+
return (
|
|
32
|
+
_arrayWithHoles(arr) ||
|
|
33
|
+
_iterableToArrayLimit(arr, i) ||
|
|
34
|
+
_unsupportedIterableToArray(arr, i) ||
|
|
35
|
+
_nonIterableRest()
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
function _nonIterableRest() {
|
|
39
|
+
throw new TypeError(
|
|
40
|
+
'Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.',
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
44
|
+
if (!o) return;
|
|
45
|
+
if (typeof o === 'string') return _arrayLikeToArray(o, minLen);
|
|
46
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
47
|
+
if (n === 'Object' && o.constructor) n = o.constructor.name;
|
|
48
|
+
if (n === 'Map' || n === 'Set') return Array.from(o);
|
|
49
|
+
if (n === 'Arguments' || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
50
|
+
return _arrayLikeToArray(o, minLen);
|
|
51
|
+
}
|
|
52
|
+
function _arrayLikeToArray(arr, len) {
|
|
53
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
54
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
55
|
+
arr2[i] = arr[i];
|
|
56
|
+
}
|
|
57
|
+
return arr2;
|
|
58
|
+
}
|
|
59
|
+
function _iterableToArrayLimit(arr, i) {
|
|
60
|
+
var _i =
|
|
61
|
+
arr == null
|
|
62
|
+
? null
|
|
63
|
+
: (typeof Symbol !== 'undefined' && arr[Symbol.iterator]) || arr['@@iterator'];
|
|
64
|
+
if (_i == null) return;
|
|
65
|
+
var _arr = [];
|
|
66
|
+
var _n = true;
|
|
67
|
+
var _d = false;
|
|
68
|
+
var _s, _e;
|
|
69
|
+
try {
|
|
70
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
71
|
+
_arr.push(_s.value);
|
|
72
|
+
if (i && _arr.length === i) break;
|
|
73
|
+
}
|
|
74
|
+
} catch (err) {
|
|
75
|
+
_d = true;
|
|
76
|
+
_e = err;
|
|
77
|
+
} finally {
|
|
78
|
+
try {
|
|
79
|
+
if (!_n && _i['return'] != null) _i['return']();
|
|
80
|
+
} finally {
|
|
81
|
+
if (_d) throw _e;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return _arr;
|
|
85
|
+
}
|
|
86
|
+
function _arrayWithHoles(arr) {
|
|
87
|
+
if (Array.isArray(arr)) return arr;
|
|
88
|
+
}
|
|
89
|
+
function _objectWithoutProperties(source, excluded) {
|
|
90
|
+
if (source == null) return {};
|
|
91
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
92
|
+
var key, i;
|
|
93
|
+
if (Object.getOwnPropertySymbols) {
|
|
94
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
95
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
96
|
+
key = sourceSymbolKeys[i];
|
|
97
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
98
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
99
|
+
target[key] = source[key];
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return target;
|
|
103
|
+
}
|
|
104
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
105
|
+
if (source == null) return {};
|
|
106
|
+
var target = {};
|
|
107
|
+
var sourceKeys = Object.keys(source);
|
|
108
|
+
var key, i;
|
|
109
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
110
|
+
key = sourceKeys[i];
|
|
111
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
112
|
+
target[key] = source[key];
|
|
113
|
+
}
|
|
114
|
+
return target;
|
|
115
|
+
}
|
|
116
|
+
import React from 'react';
|
|
13
117
|
import { useState } from 'react';
|
|
14
118
|
import AssignApp from './AssignApp';
|
|
15
119
|
import './index.less';
|
|
@@ -35,33 +139,46 @@ var AssignModal = function AssignModal(props) {
|
|
|
35
139
|
setAssignData = _useState2[1];
|
|
36
140
|
var submit = function submit() {
|
|
37
141
|
console.log({
|
|
38
|
-
assignData: assignData
|
|
142
|
+
assignData: assignData,
|
|
39
143
|
});
|
|
40
144
|
onSubmit(assignData);
|
|
41
145
|
};
|
|
42
|
-
return /*#__PURE__*/React.createElement(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
orgList: orgList,
|
|
57
|
-
appList: appList,
|
|
58
|
-
userList: userList,
|
|
59
|
-
onChange: function onChange(data) {
|
|
60
|
-
setAssignData(data);
|
|
146
|
+
return /*#__PURE__*/ React.createElement(
|
|
147
|
+
_Modal,
|
|
148
|
+
{
|
|
149
|
+
className: 'modelTool-assign',
|
|
150
|
+
title: title,
|
|
151
|
+
visible: visible,
|
|
152
|
+
width: showUser ? '80%' : '65%',
|
|
153
|
+
onCancel: close,
|
|
154
|
+
onOk: submit,
|
|
155
|
+
maskClosable: false,
|
|
156
|
+
destroyOnClose: true,
|
|
157
|
+
okButtonProps: {
|
|
158
|
+
disabled: disabled,
|
|
159
|
+
},
|
|
61
160
|
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
161
|
+
/*#__PURE__*/ React.createElement(
|
|
162
|
+
AssignApp,
|
|
163
|
+
_extends(
|
|
164
|
+
{
|
|
165
|
+
dataItem: dataItem,
|
|
166
|
+
orgList: orgList,
|
|
167
|
+
appList: appList,
|
|
168
|
+
userList: userList,
|
|
169
|
+
onChange: function onChange(data) {
|
|
170
|
+
setAssignData(data);
|
|
171
|
+
},
|
|
172
|
+
disabled: disabled,
|
|
173
|
+
lang:
|
|
174
|
+
(props === null || props === void 0 ? void 0 : props.lang) ||
|
|
175
|
+
cookies.get('lang') ||
|
|
176
|
+
'cn',
|
|
177
|
+
showUser: showUser,
|
|
178
|
+
},
|
|
179
|
+
restProps,
|
|
180
|
+
),
|
|
181
|
+
),
|
|
182
|
+
);
|
|
66
183
|
};
|
|
67
|
-
export default AssignModal;
|
|
184
|
+
export default AssignModal;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
.modelTool-assign {
|
|
2
|
-
.ant-modal-body {
|
|
3
|
-
height: 550px;
|
|
4
|
-
padding: 0;
|
|
5
|
-
overflow: hidden;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
1
|
+
.modelTool-assign {
|
|
2
|
+
.ant-modal-body {
|
|
3
|
+
height: 550px;
|
|
4
|
+
padding: 0;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
}
|
|
7
|
+
}
|
package/es/index.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export { default } from './AssignModal';
|
|
1
|
+
import Assign from './AssignModal/AssignApp';
|
|
2
|
+
export { default } from './AssignModal';
|
|
3
|
+
export var AssignApp = Assign;
|
package/es/locale.js
CHANGED
|
@@ -7,7 +7,7 @@ export var zh_CN = {
|
|
|
7
7
|
allAppAvailable: '全部渠道',
|
|
8
8
|
authorizesUserList: '用户列表',
|
|
9
9
|
allUserAvailable: '全部用户',
|
|
10
|
-
search: '查询'
|
|
10
|
+
search: '查询',
|
|
11
11
|
};
|
|
12
12
|
export var en_US = {
|
|
13
13
|
authorizesOrgList: 'Organization List',
|
|
@@ -16,15 +16,23 @@ export var en_US = {
|
|
|
16
16
|
allAppAvailable: 'All Channels',
|
|
17
17
|
authorizesUserList: 'Account List',
|
|
18
18
|
allUserAvailable: 'All Accounts',
|
|
19
|
-
search: 'Search'
|
|
19
|
+
search: 'Search',
|
|
20
20
|
};
|
|
21
21
|
export var getText = function getText(key, language) {
|
|
22
22
|
var _ref;
|
|
23
|
-
var text =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
var text =
|
|
24
|
+
(_ref =
|
|
25
|
+
{
|
|
26
|
+
cn: zh_CN,
|
|
27
|
+
en: en_US,
|
|
28
|
+
}[language || getLanguage()] || zh_CN) === null || _ref === void 0
|
|
29
|
+
? void 0
|
|
30
|
+
: _ref[key];
|
|
31
|
+
for (
|
|
32
|
+
var _len = arguments.length, params = new Array(_len > 2 ? _len - 2 : 0), _key = 2;
|
|
33
|
+
_key < _len;
|
|
34
|
+
_key++
|
|
35
|
+
) {
|
|
28
36
|
params[_key - 2] = arguments[_key];
|
|
29
37
|
}
|
|
30
38
|
if (params === null || params === void 0 ? void 0 : params.length) {
|
|
@@ -35,11 +43,13 @@ export var getText = function getText(key, language) {
|
|
|
35
43
|
return text;
|
|
36
44
|
};
|
|
37
45
|
export var getLanguage = function getLanguage() {
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
|
|
46
|
+
return (
|
|
47
|
+
cookies.get('lang', {
|
|
48
|
+
path: '/',
|
|
49
|
+
}) || 'cn'
|
|
50
|
+
);
|
|
41
51
|
};
|
|
42
52
|
export default {
|
|
43
53
|
en_US: en_US,
|
|
44
|
-
zh_CN: zh_CN
|
|
45
|
-
};
|
|
54
|
+
zh_CN: zh_CN,
|
|
55
|
+
};
|
package/package.json
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@tddc/assign-modal",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"description": "assign-modal",
|
|
5
|
-
"author": "zj <jun.zhang002383@tongdun.net>",
|
|
6
|
-
"license": "ISC",
|
|
7
|
-
"main": "es/index.js",
|
|
8
|
-
"files": [
|
|
9
|
-
"es"
|
|
10
|
-
],
|
|
11
|
-
"devDependencies": {
|
|
12
|
-
"universal-cookie": ">=2.2.0",
|
|
13
|
-
"react": ">=16.8.0"
|
|
14
|
-
},
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
"gitHead": "597697f3b6df285679feeabf56b25943a4ec89d4"
|
|
19
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@tddc/assign-modal",
|
|
3
|
+
"version": "2.0.6",
|
|
4
|
+
"description": "assign-modal",
|
|
5
|
+
"author": "zj <jun.zhang002383@tongdun.net>",
|
|
6
|
+
"license": "ISC",
|
|
7
|
+
"main": "es/index.js",
|
|
8
|
+
"files": [
|
|
9
|
+
"es"
|
|
10
|
+
],
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"universal-cookie": ">=2.2.0",
|
|
13
|
+
"react": ">=16.8.0"
|
|
14
|
+
},
|
|
15
|
+
"gitHead": "597697f3b6df285679feeabf56b25943a4ec89d4"
|
|
16
|
+
}
|