@tddc/assign-modal 3.0.3 → 3.0.5
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.
|
@@ -329,6 +329,7 @@ var AssignModal = function AssignModal(props) {
|
|
|
329
329
|
);
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
|
+
console.log(initOrgs, 'initOrgs');
|
|
332
333
|
setCheckedKeys(initOrgs);
|
|
333
334
|
setAppKeys(initApps || []);
|
|
334
335
|
setUserKeys(initAccounts || []);
|
|
@@ -965,6 +966,82 @@ var AssignModal = function AssignModal(props) {
|
|
|
965
966
|
},
|
|
966
967
|
[userList, userKeys, filterUser],
|
|
967
968
|
);
|
|
969
|
+
var renderOrgItem = function renderOrgItem(item, lang) {
|
|
970
|
+
var mapResult = {
|
|
971
|
+
1: {
|
|
972
|
+
cn: '职能部门',
|
|
973
|
+
en: 'Func. Dept.',
|
|
974
|
+
icon: 'crowd',
|
|
975
|
+
},
|
|
976
|
+
2: {
|
|
977
|
+
icon: 'corporation',
|
|
978
|
+
},
|
|
979
|
+
};
|
|
980
|
+
var result = mapResult[item === null || item === void 0 ? void 0 : item.orgAttribute] || {};
|
|
981
|
+
return /*#__PURE__*/ React.createElement(
|
|
982
|
+
'div',
|
|
983
|
+
{
|
|
984
|
+
className: 'org-item-wrapper',
|
|
985
|
+
style: {
|
|
986
|
+
width: 'calc(100% - 32px)',
|
|
987
|
+
},
|
|
988
|
+
},
|
|
989
|
+
/*#__PURE__*/ React.createElement(_Ellipsis, {
|
|
990
|
+
title: item.title,
|
|
991
|
+
widthLimit: String(item.orgAttribute) === '1' ? 'calc(100% - 90px}' : '100%',
|
|
992
|
+
}),
|
|
993
|
+
String(item.orgAttribute) === '1' &&
|
|
994
|
+
/*#__PURE__*/ React.createElement(
|
|
995
|
+
'span',
|
|
996
|
+
{
|
|
997
|
+
className: 'org-functional-departemt-marker',
|
|
998
|
+
},
|
|
999
|
+
result[lang] || '职能部门',
|
|
1000
|
+
),
|
|
1001
|
+
);
|
|
1002
|
+
};
|
|
1003
|
+
var defaultRenderItem = function defaultRenderItem(item) {
|
|
1004
|
+
var isOrg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
1005
|
+
if (isOrg) {
|
|
1006
|
+
return renderOrgItem(item, props === null || props === void 0 ? void 0 : props.lang);
|
|
1007
|
+
}
|
|
1008
|
+
return /*#__PURE__*/ React.createElement(_Ellipsis, {
|
|
1009
|
+
title: item.title,
|
|
1010
|
+
widthLimit: '100%',
|
|
1011
|
+
});
|
|
1012
|
+
};
|
|
1013
|
+
var canNotRemoveOrg = useMemo(
|
|
1014
|
+
function () {
|
|
1015
|
+
var _orgMapRef$current, _orgMapRef$current$ch;
|
|
1016
|
+
return (
|
|
1017
|
+
(checkedKeys === null || checkedKeys === void 0 ? void 0 : checkedKeys.length) === 1 &&
|
|
1018
|
+
((_orgMapRef$current = orgMapRef.current) === null || _orgMapRef$current === void 0
|
|
1019
|
+
? void 0
|
|
1020
|
+
: (_orgMapRef$current$ch = _orgMapRef$current[checkedKeys[0]]) === null ||
|
|
1021
|
+
_orgMapRef$current$ch === void 0
|
|
1022
|
+
? void 0
|
|
1023
|
+
: _orgMapRef$current$ch.key) ===
|
|
1024
|
+
(rootNode === null || rootNode === void 0 ? void 0 : rootNode.key)
|
|
1025
|
+
);
|
|
1026
|
+
},
|
|
1027
|
+
[checkedKeys],
|
|
1028
|
+
);
|
|
1029
|
+
var canNotRemoveApp = useMemo(
|
|
1030
|
+
function () {
|
|
1031
|
+
var _appMapRef$current, _appMapRef$current$ap;
|
|
1032
|
+
return (
|
|
1033
|
+
(appKeys === null || appKeys === void 0 ? void 0 : appKeys.length) === 1 &&
|
|
1034
|
+
((_appMapRef$current = appMapRef.current) === null || _appMapRef$current === void 0
|
|
1035
|
+
? void 0
|
|
1036
|
+
: (_appMapRef$current$ap = _appMapRef$current[appKeys[0]]) === null ||
|
|
1037
|
+
_appMapRef$current$ap === void 0
|
|
1038
|
+
? void 0
|
|
1039
|
+
: _appMapRef$current$ap.name) === appCode
|
|
1040
|
+
);
|
|
1041
|
+
},
|
|
1042
|
+
[appKeys],
|
|
1043
|
+
);
|
|
1044
|
+
console.log(canNotRemoveOrg, 'canNotRemove');
|
|
968
1045
|
return /*#__PURE__*/ React.createElement(
|
|
969
1046
|
React.Fragment,
|
|
970
1047
|
null,
|
|
@@ -1044,6 +1121,9 @@ var AssignModal = function AssignModal(props) {
|
|
|
1044
1121
|
'div',
|
|
1045
1122
|
{
|
|
1046
1123
|
className: 'panel-left',
|
|
1124
|
+
style: {
|
|
1125
|
+
width: '60%',
|
|
1126
|
+
},
|
|
1047
1127
|
},
|
|
1048
1128
|
/*#__PURE__*/ React.createElement(_Input, {
|
|
1049
1129
|
size: 'small',
|
|
@@ -1063,6 +1143,9 @@ var AssignModal = function AssignModal(props) {
|
|
|
1063
1143
|
},
|
|
1064
1144
|
}),
|
|
1065
1145
|
/*#__PURE__*/ React.createElement(_TntdVirtualTree, {
|
|
1146
|
+
style: {
|
|
1147
|
+
overflowX: 'auto',
|
|
1148
|
+
},
|
|
1066
1149
|
isOrg: true,
|
|
1067
1150
|
treeData: treeData,
|
|
1068
1151
|
filterKey: filterOrg,
|
|
@@ -1073,12 +1156,16 @@ var AssignModal = function AssignModal(props) {
|
|
|
1073
1156
|
defaultExpandAll: true,
|
|
1074
1157
|
onCheck: onCheck,
|
|
1075
1158
|
height: windowHeight,
|
|
1159
|
+
titleRender: defaultRenderItem,
|
|
1076
1160
|
}),
|
|
1077
1161
|
),
|
|
1078
1162
|
/*#__PURE__*/ React.createElement(
|
|
1079
1163
|
'div',
|
|
1080
1164
|
{
|
|
1081
1165
|
className: 'panel-right',
|
|
1166
|
+
style: {
|
|
1167
|
+
width: '40%',
|
|
1168
|
+
},
|
|
1082
1169
|
},
|
|
1083
1170
|
/*#__PURE__*/ React.createElement(
|
|
1084
1171
|
'div',
|
|
@@ -1088,18 +1175,27 @@ var AssignModal = function AssignModal(props) {
|
|
|
1088
1175
|
/*#__PURE__*/ React.createElement(
|
|
1089
1176
|
'span',
|
|
1090
1177
|
null,
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1178
|
+
getText(
|
|
1179
|
+
'hasBeenSelected',
|
|
1180
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
1181
|
+
),
|
|
1182
|
+
':',
|
|
1183
|
+
' ',
|
|
1184
|
+
getText(
|
|
1185
|
+
'numOfOrg',
|
|
1186
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
1187
|
+
areadySelectOrg.length || 0,
|
|
1188
|
+
),
|
|
1094
1189
|
),
|
|
1095
1190
|
/*#__PURE__*/ React.createElement(
|
|
1096
1191
|
'a',
|
|
1097
1192
|
{
|
|
1193
|
+
className: canNotRemoveOrg ? 'disabeld' : '',
|
|
1098
1194
|
onClick: function onClick() {
|
|
1099
1195
|
return onRemoveAllOrg();
|
|
1100
1196
|
},
|
|
1101
1197
|
},
|
|
1102
|
-
'
|
|
1198
|
+
getText('clear', props === null || props === void 0 ? void 0 : props.lang),
|
|
1103
1199
|
),
|
|
1104
1200
|
),
|
|
1105
1201
|
/*#__PURE__*/ React.createElement(
|
|
@@ -1107,46 +1203,50 @@ var AssignModal = function AssignModal(props) {
|
|
|
1107
1203
|
{
|
|
1108
1204
|
className: 'select-menu-list',
|
|
1109
1205
|
},
|
|
1110
|
-
checkedKeys
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
/*#__PURE__*/ React.createElement(
|
|
1123
|
-
'span',
|
|
1124
|
-
{
|
|
1125
|
-
className: 'org-name',
|
|
1126
|
-
},
|
|
1127
|
-
/*#__PURE__*/ React.createElement(_Ellipsis, {
|
|
1128
|
-
title: name,
|
|
1129
|
-
}),
|
|
1130
|
-
),
|
|
1131
|
-
/*#__PURE__*/ React.createElement(
|
|
1132
|
-
'span',
|
|
1206
|
+
checkedKeys
|
|
1207
|
+
.filter(function (i) {
|
|
1208
|
+
return !!orgMapRef.current[i];
|
|
1209
|
+
})
|
|
1210
|
+
.map(function (item, index) {
|
|
1211
|
+
var node = orgMapRef.current[item] || {};
|
|
1212
|
+
var path = node.path,
|
|
1213
|
+
name = node.name;
|
|
1214
|
+
var pathDisplayName = getOrgPathDisplayName(path);
|
|
1215
|
+
var disabled = rootNode.key === item;
|
|
1216
|
+
return /*#__PURE__*/ React.createElement(
|
|
1217
|
+
'li',
|
|
1133
1218
|
{
|
|
1134
|
-
|
|
1219
|
+
key: item.value + index,
|
|
1220
|
+
className: 'select-menu-list-item',
|
|
1135
1221
|
},
|
|
1136
|
-
/*#__PURE__*/ React.createElement(
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
!disabled &&
|
|
1141
|
-
/*#__PURE__*/ React.createElement(_Icon, {
|
|
1142
|
-
type: 'close',
|
|
1143
|
-
className: 'close-icon',
|
|
1144
|
-
onClick: function onClick() {
|
|
1145
|
-
return onRemoveSingleOrg(node);
|
|
1222
|
+
/*#__PURE__*/ React.createElement(
|
|
1223
|
+
'span',
|
|
1224
|
+
{
|
|
1225
|
+
className: 'org-name',
|
|
1146
1226
|
},
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1227
|
+
/*#__PURE__*/ React.createElement(_Ellipsis, {
|
|
1228
|
+
title: name,
|
|
1229
|
+
}),
|
|
1230
|
+
),
|
|
1231
|
+
/*#__PURE__*/ React.createElement(
|
|
1232
|
+
'span',
|
|
1233
|
+
{
|
|
1234
|
+
className: 'path-name',
|
|
1235
|
+
},
|
|
1236
|
+
/*#__PURE__*/ React.createElement(_Ellipsis, {
|
|
1237
|
+
title: pathDisplayName,
|
|
1238
|
+
}),
|
|
1239
|
+
),
|
|
1240
|
+
!disabled &&
|
|
1241
|
+
/*#__PURE__*/ React.createElement(_Icon, {
|
|
1242
|
+
type: 'close',
|
|
1243
|
+
className: 'close-icon',
|
|
1244
|
+
onClick: function onClick() {
|
|
1245
|
+
return onRemoveSingleOrg(node);
|
|
1246
|
+
},
|
|
1247
|
+
}),
|
|
1248
|
+
);
|
|
1249
|
+
}) || /*#__PURE__*/ React.createElement(_Empty, null),
|
|
1150
1250
|
),
|
|
1151
1251
|
),
|
|
1152
1252
|
),
|
|
@@ -1206,7 +1306,10 @@ var AssignModal = function AssignModal(props) {
|
|
|
1206
1306
|
onChange: function onChange(e) {
|
|
1207
1307
|
debouncedAppSearch(e.target.value);
|
|
1208
1308
|
},
|
|
1209
|
-
|
|
1309
|
+
placeholder: getText(
|
|
1310
|
+
'enterAppName',
|
|
1311
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
1312
|
+
),
|
|
1210
1313
|
size: 'small',
|
|
1211
1314
|
suffix: /*#__PURE__*/ React.createElement(_Icon, {
|
|
1212
1315
|
type: 'zoom',
|
|
@@ -1231,18 +1334,27 @@ var AssignModal = function AssignModal(props) {
|
|
|
1231
1334
|
/*#__PURE__*/ React.createElement(
|
|
1232
1335
|
'span',
|
|
1233
1336
|
null,
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1337
|
+
getText(
|
|
1338
|
+
'hasBeenSelected',
|
|
1339
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
1340
|
+
),
|
|
1341
|
+
':',
|
|
1342
|
+
' ',
|
|
1343
|
+
getText(
|
|
1344
|
+
'numOfApp',
|
|
1345
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
1346
|
+
areadySelectApp.length || 0,
|
|
1347
|
+
),
|
|
1237
1348
|
),
|
|
1238
1349
|
/*#__PURE__*/ React.createElement(
|
|
1239
1350
|
'a',
|
|
1240
1351
|
{
|
|
1352
|
+
className: canNotRemoveApp ? 'disabeld' : '',
|
|
1241
1353
|
onClick: function onClick() {
|
|
1242
1354
|
return onRemoveAllApp();
|
|
1243
1355
|
},
|
|
1244
1356
|
},
|
|
1245
|
-
'
|
|
1357
|
+
getText('clear', props === null || props === void 0 ? void 0 : props.lang),
|
|
1246
1358
|
),
|
|
1247
1359
|
),
|
|
1248
1360
|
/*#__PURE__*/ React.createElement(
|
|
@@ -1340,7 +1452,7 @@ var AssignModal = function AssignModal(props) {
|
|
|
1340
1452
|
/*#__PURE__*/ React.createElement(_Input, {
|
|
1341
1453
|
size: 'small',
|
|
1342
1454
|
placeholder: getText(
|
|
1343
|
-
'
|
|
1455
|
+
'enterUserName',
|
|
1344
1456
|
props === null || props === void 0 ? void 0 : props.lang,
|
|
1345
1457
|
),
|
|
1346
1458
|
onChange: function onChange(e) {
|
|
@@ -1369,18 +1481,26 @@ var AssignModal = function AssignModal(props) {
|
|
|
1369
1481
|
/*#__PURE__*/ React.createElement(
|
|
1370
1482
|
'span',
|
|
1371
1483
|
null,
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1484
|
+
getText(
|
|
1485
|
+
'hasBeenSelected',
|
|
1486
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
1487
|
+
),
|
|
1488
|
+
':',
|
|
1489
|
+
' ',
|
|
1490
|
+
getText(
|
|
1491
|
+
'numOfUser',
|
|
1492
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
1493
|
+
areadySelectUser.length || 0,
|
|
1494
|
+
),
|
|
1375
1495
|
),
|
|
1376
1496
|
/*#__PURE__*/ React.createElement(
|
|
1377
1497
|
'a',
|
|
1378
1498
|
{
|
|
1379
1499
|
onClick: function onClick() {
|
|
1380
|
-
return
|
|
1500
|
+
return onRemoveAllOrg();
|
|
1381
1501
|
},
|
|
1382
1502
|
},
|
|
1383
|
-
'
|
|
1503
|
+
getText('clear', props === null || props === void 0 ? void 0 : props.lang),
|
|
1384
1504
|
),
|
|
1385
1505
|
),
|
|
1386
1506
|
/*#__PURE__*/ React.createElement(
|
|
@@ -239,6 +239,41 @@ var AssignModal = function AssignModal(props) {
|
|
|
239
239
|
// 渲染Org列表
|
|
240
240
|
var orgListDomRender = useMemo(
|
|
241
241
|
function () {
|
|
242
|
+
var renderOrgItem = function renderOrgItem(item, lang) {
|
|
243
|
+
console.log(item, 'item');
|
|
244
|
+
var mapResult = {
|
|
245
|
+
1: {
|
|
246
|
+
cn: '职能部门',
|
|
247
|
+
en: 'Func. Dept.',
|
|
248
|
+
icon: 'crowd',
|
|
249
|
+
},
|
|
250
|
+
2: {
|
|
251
|
+
icon: 'corporation',
|
|
252
|
+
},
|
|
253
|
+
};
|
|
254
|
+
var result = mapResult[item === null || item === void 0 ? void 0 : item.orgAttribute] || {};
|
|
255
|
+
return /*#__PURE__*/ React.createElement(
|
|
256
|
+
'div',
|
|
257
|
+
{
|
|
258
|
+
className: 'org-item-wrapper',
|
|
259
|
+
style: {
|
|
260
|
+
width: '100%',
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
/*#__PURE__*/ React.createElement(_Ellipsis, {
|
|
264
|
+
title: item.name,
|
|
265
|
+
widthLimit: String(item.orgAttribute) === '1' ? 'calc(100% - 90px}' : '100%',
|
|
266
|
+
}),
|
|
267
|
+
String(item.orgAttribute) === '1' &&
|
|
268
|
+
/*#__PURE__*/ React.createElement(
|
|
269
|
+
'span',
|
|
270
|
+
{
|
|
271
|
+
className: 'org-functional-departemt-marker',
|
|
272
|
+
},
|
|
273
|
+
result[lang] || '职能部门',
|
|
274
|
+
),
|
|
275
|
+
);
|
|
276
|
+
};
|
|
242
277
|
return (
|
|
243
278
|
checkedKeys
|
|
244
279
|
.filter(function (i) {
|
|
@@ -289,7 +324,10 @@ var AssignModal = function AssignModal(props) {
|
|
|
289
324
|
className: 'org-name',
|
|
290
325
|
},
|
|
291
326
|
/*#__PURE__*/ React.createElement(_Ellipsis, {
|
|
292
|
-
title:
|
|
327
|
+
title: renderOrgItem(
|
|
328
|
+
node,
|
|
329
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
330
|
+
),
|
|
293
331
|
}),
|
|
294
332
|
),
|
|
295
333
|
/*#__PURE__*/ React.createElement(
|
|
@@ -528,6 +566,10 @@ var AssignModal = function AssignModal(props) {
|
|
|
528
566
|
onChange: function onChange(e) {
|
|
529
567
|
debouncedAppSearch(e.target.value);
|
|
530
568
|
},
|
|
569
|
+
placeholder: getText(
|
|
570
|
+
'enterAppName',
|
|
571
|
+
props === null || props === void 0 ? void 0 : props.lang,
|
|
572
|
+
),
|
|
531
573
|
size: 'small',
|
|
532
574
|
suffix: /*#__PURE__*/ React.createElement(_Icon, {
|
|
533
575
|
type: 'zoom',
|
|
@@ -576,7 +618,7 @@ var AssignModal = function AssignModal(props) {
|
|
|
576
618
|
/*#__PURE__*/ React.createElement(_Input, {
|
|
577
619
|
size: 'small',
|
|
578
620
|
placeholder: getText(
|
|
579
|
-
'
|
|
621
|
+
'enterUserName',
|
|
580
622
|
props === null || props === void 0 ? void 0 : props.lang,
|
|
581
623
|
),
|
|
582
624
|
onChange: function onChange(e) {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
|
|
38
38
|
.panel-left {
|
|
39
39
|
height: 100%;
|
|
40
|
-
|
|
40
|
+
overflow: auto;
|
|
41
41
|
|
|
42
42
|
> .ant-input-affix-wrapper {
|
|
43
43
|
position: sticky;
|
|
@@ -160,11 +160,11 @@
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
.slider.panel-1 {
|
|
163
|
-
transform: translateX(-
|
|
163
|
+
transform: translateX(-852px);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
.slider.panel-2 {
|
|
167
|
-
transform: translateX(-
|
|
167
|
+
transform: translateX(-1504px);
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
.menu-header {
|
|
@@ -206,6 +206,11 @@
|
|
|
206
206
|
content: '';
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
+
|
|
210
|
+
.disabeld {
|
|
211
|
+
color: rgba(0, 0, 0, 0.25);
|
|
212
|
+
cursor: not-allowed;
|
|
213
|
+
}
|
|
209
214
|
}
|
|
210
215
|
|
|
211
216
|
.assign-box-container.view-mode {
|
package/es/AssignModal/index.js
CHANGED
package/es/locale.js
CHANGED
|
@@ -13,9 +13,11 @@ export var zh_CN = {
|
|
|
13
13
|
availableUsers: '可用用户',
|
|
14
14
|
clear: '清空',
|
|
15
15
|
hasBeenSelected: '已选',
|
|
16
|
-
numOfOrg: '%s
|
|
17
|
-
numOfApp: '%s
|
|
18
|
-
numOfUser: '%s
|
|
16
|
+
numOfOrg: '%s 个机构',
|
|
17
|
+
numOfApp: '%s 个渠道',
|
|
18
|
+
numOfUser: '%s 个用户',
|
|
19
|
+
enterAppName: '请输入渠道名称',
|
|
20
|
+
enterUserName: '请输入用户名称',
|
|
19
21
|
};
|
|
20
22
|
export var en_US = {
|
|
21
23
|
authorizesOrgList: 'Organization List',
|
|
@@ -33,6 +35,8 @@ export var en_US = {
|
|
|
33
35
|
numOfOrg: '%s Organizations',
|
|
34
36
|
numOfApp: '%s Channels',
|
|
35
37
|
numOfUser: '%s Accounts',
|
|
38
|
+
enterAppName: 'Enter Channel name',
|
|
39
|
+
enterUserName: 'Enter Account name',
|
|
36
40
|
};
|
|
37
41
|
export var getText = function getText(key, language) {
|
|
38
42
|
var _ref;
|