cloud-web-corejs 1.0.54-dev.682 → 1.0.54-dev.683
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
|
@@ -55,7 +55,8 @@
|
|
|
55
55
|
v-if="index > 0"
|
|
56
56
|
:key="'sep-' + index"
|
|
57
57
|
class="base-area-path-sep"
|
|
58
|
-
|
|
58
|
+
>/</span
|
|
59
|
+
>
|
|
59
60
|
<span
|
|
60
61
|
:key="'tab-' + index"
|
|
61
62
|
class="base-area-tab"
|
|
@@ -65,7 +66,8 @@
|
|
|
65
66
|
disabled: !isTabEnabled(index + 1),
|
|
66
67
|
}"
|
|
67
68
|
@click="switchLevel(index + 1)"
|
|
68
|
-
|
|
69
|
+
>{{ getTabLabel(tab) }}</span
|
|
70
|
+
>
|
|
69
71
|
</template>
|
|
70
72
|
</div>
|
|
71
73
|
</div>
|
|
@@ -80,7 +82,10 @@
|
|
|
80
82
|
>
|
|
81
83
|
<span>{{ item.name }}</span>
|
|
82
84
|
</div>
|
|
83
|
-
<div
|
|
85
|
+
<div
|
|
86
|
+
v-if="!browseLoading && !levelItems.length"
|
|
87
|
+
class="base-area-empty"
|
|
88
|
+
>
|
|
84
89
|
{{ emptyText }}
|
|
85
90
|
</div>
|
|
86
91
|
</div>
|
|
@@ -248,10 +253,7 @@ export default {
|
|
|
248
253
|
},
|
|
249
254
|
showClearIcon() {
|
|
250
255
|
return (
|
|
251
|
-
this.clearable &&
|
|
252
|
-
!this.readonly &&
|
|
253
|
-
!this.disabled &&
|
|
254
|
-
!!this.displayText
|
|
256
|
+
this.clearable && !this.readonly && !this.disabled && !!this.displayText
|
|
255
257
|
);
|
|
256
258
|
},
|
|
257
259
|
canPrevLevel() {
|
|
@@ -259,8 +261,8 @@ export default {
|
|
|
259
261
|
},
|
|
260
262
|
canNextLevel() {
|
|
261
263
|
return (
|
|
262
|
-
this.activeLevel < this.browseLevelCount
|
|
263
|
-
this.isTabEnabled(this.activeLevel + 1)
|
|
264
|
+
this.activeLevel < this.browseLevelCount
|
|
265
|
+
&& this.isTabEnabled(this.activeLevel + 1)
|
|
264
266
|
);
|
|
265
267
|
},
|
|
266
268
|
browseLevelCount() {
|
|
@@ -316,7 +318,10 @@ export default {
|
|
|
316
318
|
}
|
|
317
319
|
const str = String(val).trim();
|
|
318
320
|
if (this.isLegacyPathValue(str)) {
|
|
319
|
-
const parts = str
|
|
321
|
+
const parts = str
|
|
322
|
+
.split(",")
|
|
323
|
+
.map((part) => part.trim())
|
|
324
|
+
.filter(Boolean);
|
|
320
325
|
return parts.length ? parts[parts.length - 1] : null;
|
|
321
326
|
}
|
|
322
327
|
return str;
|
|
@@ -332,10 +337,10 @@ export default {
|
|
|
332
337
|
},
|
|
333
338
|
isLegacyPathValue(val) {
|
|
334
339
|
return (
|
|
335
|
-
this.valueFormat === "path"
|
|
336
|
-
val != null
|
|
337
|
-
String(val).includes(",")
|
|
338
|
-
!String(val).startsWith(",")
|
|
340
|
+
this.valueFormat === "path"
|
|
341
|
+
&& val != null
|
|
342
|
+
&& String(val).includes(",")
|
|
343
|
+
&& !String(val).startsWith(",")
|
|
339
344
|
);
|
|
340
345
|
},
|
|
341
346
|
parseTreePathIds(treePath) {
|
|
@@ -411,8 +416,8 @@ export default {
|
|
|
411
416
|
},
|
|
412
417
|
formatAreaPathResult(value, path, label) {
|
|
413
418
|
const result = this.createEmptyAreaPathResult(value);
|
|
414
|
-
result.label
|
|
415
|
-
label != null && label !== ""
|
|
419
|
+
result.label
|
|
420
|
+
= label != null && label !== ""
|
|
416
421
|
? label
|
|
417
422
|
: this.buildPathLabel(path) || this.labelValue || null;
|
|
418
423
|
result.path = path || [];
|
|
@@ -446,10 +451,10 @@ export default {
|
|
|
446
451
|
const leafId = this.getLeafIdFromValue(val);
|
|
447
452
|
let path = null;
|
|
448
453
|
if (
|
|
449
|
-
leafId != null
|
|
450
|
-
this.isValueSynced(leafId)
|
|
451
|
-
!this.shouldResyncBrowsePath()
|
|
452
|
-
this.selectedPath.length
|
|
454
|
+
leafId != null
|
|
455
|
+
&& this.isValueSynced(leafId)
|
|
456
|
+
&& !this.shouldResyncBrowsePath()
|
|
457
|
+
&& this.selectedPath.length
|
|
453
458
|
) {
|
|
454
459
|
path = this.selectedPath.map((item) => ({ ...item }));
|
|
455
460
|
}
|
|
@@ -620,10 +625,7 @@ export default {
|
|
|
620
625
|
if (token !== this.syncToken || this.hasDisplayLabel()) {
|
|
621
626
|
return;
|
|
622
627
|
}
|
|
623
|
-
const label =
|
|
624
|
-
(area && area.fullName) ||
|
|
625
|
-
(area && area.name) ||
|
|
626
|
-
null;
|
|
628
|
+
const label = (area && area.fullName) || (area && area.name) || null;
|
|
627
629
|
if (label) {
|
|
628
630
|
this.$emit("update:labelValue", label);
|
|
629
631
|
}
|
|
@@ -685,7 +687,7 @@ export default {
|
|
|
685
687
|
requestAreaList(extra = {}) {
|
|
686
688
|
return new Promise((resolve) => {
|
|
687
689
|
this.$http({
|
|
688
|
-
url: USER_PREFIX + "/area/
|
|
690
|
+
url: USER_PREFIX + "/area/listPage",
|
|
689
691
|
method: "post",
|
|
690
692
|
data: this.getAreaRequestData(extra),
|
|
691
693
|
success: (res) => resolve(this.normalizeAreaRows(res)),
|
|
@@ -744,12 +746,20 @@ export default {
|
|
|
744
746
|
},
|
|
745
747
|
buildAreaPath(item, depthLimit) {
|
|
746
748
|
const limit = depthLimit == null ? this.maxLevel : depthLimit;
|
|
747
|
-
if (
|
|
749
|
+
if (
|
|
750
|
+
item.pathList
|
|
751
|
+
&& Array.isArray(item.pathList)
|
|
752
|
+
&& item.pathList.length > 1
|
|
753
|
+
) {
|
|
748
754
|
if (this.isAreaObject(item.pathList[0])) {
|
|
749
755
|
return item.pathList.slice(0, limit);
|
|
750
756
|
}
|
|
751
757
|
}
|
|
752
|
-
if (
|
|
758
|
+
if (
|
|
759
|
+
item.areaPath
|
|
760
|
+
&& Array.isArray(item.areaPath)
|
|
761
|
+
&& item.areaPath.length > 1
|
|
762
|
+
) {
|
|
753
763
|
if (this.isAreaObject(item.areaPath[0])) {
|
|
754
764
|
return item.areaPath.slice(0, limit);
|
|
755
765
|
}
|
|
@@ -858,8 +868,8 @@ export default {
|
|
|
858
868
|
if (this.isPathResolvedForItem(parentPath, item)) {
|
|
859
869
|
return parentPath;
|
|
860
870
|
}
|
|
861
|
-
const depthLimit
|
|
862
|
-
options.depthLimit != null
|
|
871
|
+
const depthLimit
|
|
872
|
+
= options.depthLimit != null
|
|
863
873
|
? options.depthLimit
|
|
864
874
|
: this.getResolveDepthLimit(item);
|
|
865
875
|
if (item.treePath) {
|
|
@@ -915,10 +925,10 @@ export default {
|
|
|
915
925
|
const token = ++this.syncToken;
|
|
916
926
|
let seed = item || {};
|
|
917
927
|
if (
|
|
918
|
-
seed.id != null
|
|
919
|
-
!seed.fullName
|
|
920
|
-
!seed.name
|
|
921
|
-
!this.getParentIdFromRow(seed)
|
|
928
|
+
seed.id != null
|
|
929
|
+
&& !seed.fullName
|
|
930
|
+
&& !seed.name
|
|
931
|
+
&& !this.getParentIdFromRow(seed)
|
|
922
932
|
) {
|
|
923
933
|
const detail = await this.fetchAreaById(seed.id);
|
|
924
934
|
if (detail) {
|
|
@@ -980,7 +990,10 @@ export default {
|
|
|
980
990
|
},
|
|
981
991
|
async syncBrowseStateFromPathIds(ids) {
|
|
982
992
|
const token = ++this.syncToken;
|
|
983
|
-
const depthLimit = Math.min(
|
|
993
|
+
const depthLimit = Math.min(
|
|
994
|
+
Math.max(ids.length, this.maxLevel, 1),
|
|
995
|
+
MAX_AREA_DEPTH
|
|
996
|
+
);
|
|
984
997
|
const path = await this.resolvePathByIds(ids, depthLimit);
|
|
985
998
|
if (token !== this.syncToken) {
|
|
986
999
|
return;
|
|
@@ -1022,7 +1035,7 @@ export default {
|
|
|
1022
1035
|
},
|
|
1023
1036
|
doSearch(keyword) {
|
|
1024
1037
|
this.searchLoading = true;
|
|
1025
|
-
this.requestAreaList({ name: keyword }).then((rows) => {
|
|
1038
|
+
this.requestAreaList({ name: keyword, size: 20 }).then((rows) => {
|
|
1026
1039
|
this.searchList = rows;
|
|
1027
1040
|
this.searchLoading = false;
|
|
1028
1041
|
});
|