cloud-web-corejs 1.0.54-dev.683 → 1.0.54-dev.685
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/package.json
CHANGED
|
@@ -261,8 +261,8 @@ export default {
|
|
|
261
261
|
},
|
|
262
262
|
canNextLevel() {
|
|
263
263
|
return (
|
|
264
|
-
this.activeLevel < this.browseLevelCount
|
|
265
|
-
|
|
264
|
+
this.activeLevel < this.browseLevelCount &&
|
|
265
|
+
this.isTabEnabled(this.activeLevel + 1)
|
|
266
266
|
);
|
|
267
267
|
},
|
|
268
268
|
browseLevelCount() {
|
|
@@ -337,10 +337,10 @@ export default {
|
|
|
337
337
|
},
|
|
338
338
|
isLegacyPathValue(val) {
|
|
339
339
|
return (
|
|
340
|
-
this.valueFormat === "path"
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
340
|
+
this.valueFormat === "path" &&
|
|
341
|
+
val != null &&
|
|
342
|
+
String(val).includes(",") &&
|
|
343
|
+
!String(val).startsWith(",")
|
|
344
344
|
);
|
|
345
345
|
},
|
|
346
346
|
parseTreePathIds(treePath) {
|
|
@@ -416,8 +416,8 @@ export default {
|
|
|
416
416
|
},
|
|
417
417
|
formatAreaPathResult(value, path, label) {
|
|
418
418
|
const result = this.createEmptyAreaPathResult(value);
|
|
419
|
-
result.label
|
|
420
|
-
|
|
419
|
+
result.label =
|
|
420
|
+
label != null && label !== ""
|
|
421
421
|
? label
|
|
422
422
|
: this.buildPathLabel(path) || this.labelValue || null;
|
|
423
423
|
result.path = path || [];
|
|
@@ -451,10 +451,10 @@ export default {
|
|
|
451
451
|
const leafId = this.getLeafIdFromValue(val);
|
|
452
452
|
let path = null;
|
|
453
453
|
if (
|
|
454
|
-
leafId != null
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
454
|
+
leafId != null &&
|
|
455
|
+
this.isValueSynced(leafId) &&
|
|
456
|
+
!this.shouldResyncBrowsePath() &&
|
|
457
|
+
this.selectedPath.length
|
|
458
458
|
) {
|
|
459
459
|
path = this.selectedPath.map((item) => ({ ...item }));
|
|
460
460
|
}
|
|
@@ -747,18 +747,18 @@ export default {
|
|
|
747
747
|
buildAreaPath(item, depthLimit) {
|
|
748
748
|
const limit = depthLimit == null ? this.maxLevel : depthLimit;
|
|
749
749
|
if (
|
|
750
|
-
item.pathList
|
|
751
|
-
|
|
752
|
-
|
|
750
|
+
item.pathList &&
|
|
751
|
+
Array.isArray(item.pathList) &&
|
|
752
|
+
item.pathList.length > 1
|
|
753
753
|
) {
|
|
754
754
|
if (this.isAreaObject(item.pathList[0])) {
|
|
755
755
|
return item.pathList.slice(0, limit);
|
|
756
756
|
}
|
|
757
757
|
}
|
|
758
758
|
if (
|
|
759
|
-
item.areaPath
|
|
760
|
-
|
|
761
|
-
|
|
759
|
+
item.areaPath &&
|
|
760
|
+
Array.isArray(item.areaPath) &&
|
|
761
|
+
item.areaPath.length > 1
|
|
762
762
|
) {
|
|
763
763
|
if (this.isAreaObject(item.areaPath[0])) {
|
|
764
764
|
return item.areaPath.slice(0, limit);
|
|
@@ -868,8 +868,8 @@ export default {
|
|
|
868
868
|
if (this.isPathResolvedForItem(parentPath, item)) {
|
|
869
869
|
return parentPath;
|
|
870
870
|
}
|
|
871
|
-
const depthLimit
|
|
872
|
-
|
|
871
|
+
const depthLimit =
|
|
872
|
+
options.depthLimit != null
|
|
873
873
|
? options.depthLimit
|
|
874
874
|
: this.getResolveDepthLimit(item);
|
|
875
875
|
if (item.treePath) {
|
|
@@ -925,10 +925,10 @@ export default {
|
|
|
925
925
|
const token = ++this.syncToken;
|
|
926
926
|
let seed = item || {};
|
|
927
927
|
if (
|
|
928
|
-
seed.id != null
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
928
|
+
seed.id != null &&
|
|
929
|
+
!seed.fullName &&
|
|
930
|
+
!seed.name &&
|
|
931
|
+
!this.getParentIdFromRow(seed)
|
|
932
932
|
) {
|
|
933
933
|
const detail = await this.fetchAreaById(seed.id);
|
|
934
934
|
if (detail) {
|
|
@@ -1035,7 +1035,7 @@ export default {
|
|
|
1035
1035
|
},
|
|
1036
1036
|
doSearch(keyword) {
|
|
1037
1037
|
this.searchLoading = true;
|
|
1038
|
-
this.requestAreaList({
|
|
1038
|
+
this.requestAreaList({ fullName: keyword, size: 20 }).then((rows) => {
|
|
1039
1039
|
this.searchList = rows;
|
|
1040
1040
|
this.searchLoading = false;
|
|
1041
1041
|
});
|
|
@@ -1108,8 +1108,28 @@ export default {
|
|
|
1108
1108
|
});
|
|
1109
1109
|
});
|
|
1110
1110
|
},
|
|
1111
|
+
async clampPathToMaxLevel(path) {
|
|
1112
|
+
if (!path || !path.length || path.length <= this.maxLevel) {
|
|
1113
|
+
return path || [];
|
|
1114
|
+
}
|
|
1115
|
+
const trimmed = path.slice(0, this.maxLevel);
|
|
1116
|
+
const last = trimmed[trimmed.length - 1];
|
|
1117
|
+
const id = this.getAreaId(last);
|
|
1118
|
+
if (id != null && (!last.name || !last.fullName)) {
|
|
1119
|
+
const detail = await this.fetchAreaById(id);
|
|
1120
|
+
if (detail) {
|
|
1121
|
+
trimmed[trimmed.length - 1] = detail;
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
return trimmed;
|
|
1125
|
+
},
|
|
1111
1126
|
async applySelection(item) {
|
|
1112
|
-
|
|
1127
|
+
let path = this.selectedPath.length
|
|
1128
|
+
? this.selectedPath.map((node) => ({ ...node }))
|
|
1129
|
+
: [item];
|
|
1130
|
+
path = await this.clampPathToMaxLevel(path);
|
|
1131
|
+
this.selectedPath = path.map((node) => ({ ...node }));
|
|
1132
|
+
this.activeLevel = path.length || 1;
|
|
1113
1133
|
let last = path[path.length - 1] || item;
|
|
1114
1134
|
const leafId = this.getAreaId(last);
|
|
1115
1135
|
if (leafId != null && !last.fullName) {
|
|
@@ -1117,6 +1137,8 @@ export default {
|
|
|
1117
1137
|
if (detail) {
|
|
1118
1138
|
last = detail;
|
|
1119
1139
|
if (path.length) {
|
|
1140
|
+
path = path.slice();
|
|
1141
|
+
path[path.length - 1] = detail;
|
|
1120
1142
|
this.$set(this.selectedPath, this.selectedPath.length - 1, detail);
|
|
1121
1143
|
}
|
|
1122
1144
|
}
|