bl-common-vue3 3.8.128 → 3.8.130
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
|
@@ -1045,7 +1045,9 @@ export default defineComponent({
|
|
|
1045
1045
|
let checkedKeys = getInitKeys(initKeys, "village");
|
|
1046
1046
|
let forCount = 0
|
|
1047
1047
|
const setResult = (key, value) => {
|
|
1048
|
-
|
|
1048
|
+
if (value != null) {
|
|
1049
|
+
result[key].push(value);
|
|
1050
|
+
}
|
|
1049
1051
|
let totalLength = 0;
|
|
1050
1052
|
for (let key in result) {
|
|
1051
1053
|
totalLength += result[key].length;
|
|
@@ -1139,11 +1141,11 @@ export default defineComponent({
|
|
|
1139
1141
|
if (arrKey.length == 8) {
|
|
1140
1142
|
setResult("roomList", room)
|
|
1141
1143
|
// 如果 showSub 为 true 且该房间有子房间,获取子房间并加入结果
|
|
1142
|
-
if (props.showSub &&room.sub_room_count > 0) {
|
|
1144
|
+
if (room && props.showSub && room.sub_room_count > 0) {
|
|
1143
1145
|
await getSubRooms(room);
|
|
1144
1146
|
if (room.children && room.children.length) {
|
|
1145
1147
|
room.children.forEach(subRoom => {
|
|
1146
|
-
if (!subRoom.disabled) {
|
|
1148
|
+
if (subRoom && !subRoom.disabled) {
|
|
1147
1149
|
setResult("roomList", subRoom);
|
|
1148
1150
|
}
|
|
1149
1151
|
});
|
|
@@ -1176,7 +1178,9 @@ export default defineComponent({
|
|
|
1176
1178
|
(item) => item.id == roomId
|
|
1177
1179
|
);
|
|
1178
1180
|
if (arrKey.length == 6) {
|
|
1179
|
-
|
|
1181
|
+
if (room) {
|
|
1182
|
+
state.selectedKeys.push(room.key)
|
|
1183
|
+
}
|
|
1180
1184
|
setResult("roomList", room);
|
|
1181
1185
|
} else {
|
|
1182
1186
|
if (arrKey.length == 8) {
|
|
@@ -1311,11 +1315,11 @@ export default defineComponent({
|
|
|
1311
1315
|
// 如果 showSub 为 true,遍历每个房间获取子房间
|
|
1312
1316
|
if (props.showSub) {
|
|
1313
1317
|
for (let room of list) {
|
|
1314
|
-
if (!room
|
|
1318
|
+
if (!room?.isLeaf || room?.sub_room_count > 0) {
|
|
1315
1319
|
await getSubRooms(room);
|
|
1316
1320
|
if (room.children && room.children.length) {
|
|
1317
1321
|
room.children.forEach(subRoom => {
|
|
1318
|
-
if (!subRoom.disabled) {
|
|
1322
|
+
if (subRoom && !subRoom.disabled) {
|
|
1319
1323
|
result.roomList.push(subRoom);
|
|
1320
1324
|
}
|
|
1321
1325
|
});
|
|
@@ -1334,6 +1338,7 @@ export default defineComponent({
|
|
|
1334
1338
|
return index === firstIndex;
|
|
1335
1339
|
});
|
|
1336
1340
|
// 去重
|
|
1341
|
+
result.roomList = result.roomList.filter(Boolean)
|
|
1337
1342
|
if (result.roomList && result.roomList.length > 0) {
|
|
1338
1343
|
result.roomList = Array.from(new Set(result.roomList.map(item => item.id)))
|
|
1339
1344
|
.map(id => result.roomList.find(item => item.id === id));
|
|
@@ -1343,11 +1348,11 @@ export default defineComponent({
|
|
|
1343
1348
|
// 如果没有选中楼层但选中了房间,且 showSub 为 true,也需要处理子房间
|
|
1344
1349
|
emit("getloading", 1);
|
|
1345
1350
|
for (let room of result.roomList) {
|
|
1346
|
-
if (!room
|
|
1351
|
+
if (room&&(!room?.isLeaf || room?.sub_room_count > 0)) {
|
|
1347
1352
|
await getSubRooms(room);
|
|
1348
|
-
if (room
|
|
1353
|
+
if (room?.children && room.children?.length) {
|
|
1349
1354
|
room.children.forEach(subRoom => {
|
|
1350
|
-
if (!subRoom.disabled) {
|
|
1355
|
+
if (subRoom && !subRoom.disabled) {
|
|
1351
1356
|
result.roomList.push(subRoom);
|
|
1352
1357
|
}
|
|
1353
1358
|
});
|
|
@@ -1355,6 +1360,7 @@ export default defineComponent({
|
|
|
1355
1360
|
}
|
|
1356
1361
|
}
|
|
1357
1362
|
// 去重
|
|
1363
|
+
result.roomList = result.roomList.filter(Boolean);
|
|
1358
1364
|
if (result.roomList && result.roomList.length > 0) {
|
|
1359
1365
|
result.roomList = Array.from(new Set(result.roomList.map(item => item.id)))
|
|
1360
1366
|
.map(id => result.roomList.find(item => item.id === id));
|
|
@@ -1769,6 +1775,10 @@ export default defineComponent({
|
|
|
1769
1775
|
// 获取子房间
|
|
1770
1776
|
const getSubRooms = (room) => {
|
|
1771
1777
|
return new Promise((resolve) => {
|
|
1778
|
+
if (!room) {
|
|
1779
|
+
resolve( []);
|
|
1780
|
+
return;
|
|
1781
|
+
}
|
|
1772
1782
|
if (room.isLeaf || (room.children && room.children.length)) {
|
|
1773
1783
|
resolve(room.children || []);
|
|
1774
1784
|
return;
|
|
@@ -613,7 +613,7 @@ export default defineComponent({
|
|
|
613
613
|
slotIcon: "buildIcon",
|
|
614
614
|
isLeaf: false,
|
|
615
615
|
});
|
|
616
|
-
if (
|
|
616
|
+
if (totalVillageCount === 1) {
|
|
617
617
|
state.expandedKeys.push(`${village.key}_buildLevel_${build.id}`);
|
|
618
618
|
}
|
|
619
619
|
}
|
|
@@ -873,7 +873,7 @@ export default defineComponent({
|
|
|
873
873
|
slotIcon: "buildIcon",
|
|
874
874
|
isLeaf: false,
|
|
875
875
|
});
|
|
876
|
-
if (buildId == build.id &&
|
|
876
|
+
if (buildId == build.id && state.expandedKeys.includes(v.key) && !state.expandedKeys.includes(`${v.key}_buildLevel_${build.id}`)) {
|
|
877
877
|
state.expandedKeys.push(`${v.key}_buildLevel_${build.id}`)
|
|
878
878
|
}
|
|
879
879
|
}
|