|
@@ -66,18 +66,26 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div
|
|
|
+ <!-- <div
|
|
|
class="swiper-container root-group-list"
|
|
|
ref="root-group"
|
|
|
id="swcatalogRoot"
|
|
|
:style="`width:${Math.min(catalogRootW, innerW)}px;
|
|
|
padding:${catalogRootW > innerW ? '0 15px' : '0'}`"
|
|
|
v-if="metadata?.navigationTrees?.length > 1"
|
|
|
+ > -->
|
|
|
+ <div
|
|
|
+ class="swiper-container root-group-list"
|
|
|
+ ref="root-group"
|
|
|
+ id="swcatalogRoot"
|
|
|
+ :style="`width:${Math.min(catalogRootW, innerW)}px;
|
|
|
+ padding:${catalogRootW > innerW ? '0 15px' : '0'}`"
|
|
|
+ v-if="rootTabShow"
|
|
|
>
|
|
|
<ul class="swiper-wrapper">
|
|
|
<template v-for="(item, i) in metadata?.navigationTrees" :key="item.id">
|
|
|
<li
|
|
|
- v-if="item.children.length"
|
|
|
+ v-if="getCurrentTabScenes(item).length"
|
|
|
class="swiper-slide"
|
|
|
:class="{
|
|
|
active: currentRootId == item.id,
|
|
@@ -163,14 +171,70 @@ const secondaryW = computed(() => {
|
|
|
let list = metadata.value?.navigationTrees[rootTabIndex.value].children.filter((item) => item.children.length);
|
|
|
return list.length * (swidth.value["swSecondary"] + 10) - 10;
|
|
|
});
|
|
|
+const rootTabShow = computed(() => {
|
|
|
+ let list = [];
|
|
|
+
|
|
|
+ metadata.value.navigationTrees.forEach((item) => {
|
|
|
+ let show = false;
|
|
|
+ item.children.forEach((i) => {
|
|
|
+ if (i.type != "group") {
|
|
|
+ // list.push(i);
|
|
|
+ show = true;
|
|
|
+ } else {
|
|
|
+ let res = i.children.filter((t) => t.type != "group");
|
|
|
+ if (res.length) {
|
|
|
+ show = true;
|
|
|
+ }
|
|
|
+ // list = list.concat(res);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (show) {
|
|
|
+ list.push(item);
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
+ return list.length > 1 ? true : false;
|
|
|
+});
|
|
|
const catalogRootW = computed(() => {
|
|
|
- let list = metadata.value.navigationTrees.filter((item) => item.children.length);
|
|
|
+ // let list = metadata.value.navigationTrees.filter((item) => item.children.length);
|
|
|
+
|
|
|
+ let list = [];
|
|
|
+
|
|
|
+ metadata.value.navigationTrees.forEach((item) => {
|
|
|
+ let show = false;
|
|
|
+ item.children.forEach((i) => {
|
|
|
+ if (i.type != "group") {
|
|
|
+ // list.push(i);
|
|
|
+ show = true;
|
|
|
+ } else {
|
|
|
+ let res = i.children.filter((t) => t.type != "group");
|
|
|
+ if (res.length) {
|
|
|
+ show = true;
|
|
|
+ }
|
|
|
+ // list = list.concat(res);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (show) {
|
|
|
+ list.push(item);
|
|
|
+ }
|
|
|
+ // return list.length * (swidth.value["swcatalogRoot"] + 10);
|
|
|
+ });
|
|
|
return list.length * (swidth.value["swcatalogRoot"] + 10);
|
|
|
});
|
|
|
|
|
|
const innerW = computed(() => window.innerWidth);
|
|
|
-
|
|
|
+const getCurrentTabScenes = (item) => {
|
|
|
+ let list = [];
|
|
|
+ item.children.forEach((i) => {
|
|
|
+ if (i.type != "group") {
|
|
|
+ list.push(i);
|
|
|
+ } else {
|
|
|
+ let res = i.children.filter((t) => t.type != "group");
|
|
|
+ list = list.concat(res);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return list;
|
|
|
+};
|
|
|
watch(
|
|
|
() => currentScenesList.value,
|
|
|
() => {
|
|
@@ -200,6 +264,8 @@ const fixTitle = (name) => {
|
|
|
name = t("navigation.default_group_two");
|
|
|
} else if (name == "一级分组") {
|
|
|
name = t("navigation.group_one");
|
|
|
+ } else if (name == "二级分组") {
|
|
|
+ name = t("navigation.group_two");
|
|
|
} else {
|
|
|
name = name;
|
|
|
}
|
|
@@ -245,10 +311,11 @@ const changeSceneList = () => {
|
|
|
let currentList = null;
|
|
|
|
|
|
if (metadata.value.navigationTrees[rootTabIndex.value].children.length && metadata.value.navigationTrees[rootTabIndex.value].children[0].type == "group") {
|
|
|
- store.commit("scene/setData", { currentSecondId: metadata.value.navigationTrees[rootTabIndex.value].children[0].id });
|
|
|
+ // store.commit("scene/setData", { currentSecondId: metadata.value.navigationTrees[rootTabIndex.value].children[0].id });
|
|
|
//如果有当前视图则选择二级目录
|
|
|
metadata.value.navigationTrees[rootTabIndex.value].children.forEach((item, index) => {
|
|
|
if (item.children.length) {
|
|
|
+ store.commit("scene/setData", { currentSecondId: item.id });
|
|
|
item.children.forEach((t_item, t_index) => {
|
|
|
if (t_item.id == currentScene.value.id || (t_item.sid && currentScene.value.sid && t_item.sid == currentScene.value.sid)) {
|
|
|
store.commit("scene/setData", { currentSecondId: item.id });
|
|
@@ -292,7 +359,7 @@ const initSceneSwiper = () => {
|
|
|
});
|
|
|
};
|
|
|
const tabCurrentScene = (data, index) => {
|
|
|
- if(data.type == '4dkk') {
|
|
|
+ if (data.type == "4dkk") {
|
|
|
store.commit("functions/setShowScenesList", false);
|
|
|
}
|
|
|
store.commit("scene/setCurrentScene", data);
|
|
@@ -345,7 +412,7 @@ const tabCurrentRootGroup = (data, index) => {
|
|
|
|
|
|
onMounted(() => {
|
|
|
useApp().then(async (app) => {
|
|
|
- if(currentScene.value.type == '4dkk' && currentScene.value.version == 'V4') {
|
|
|
+ if (currentScene.value.type == "4dkk" && currentScene.value.version == "V4") {
|
|
|
store.commit("functions/setShowScenesList", false);
|
|
|
}
|
|
|
show.value = true;
|
|
@@ -554,4 +621,4 @@ onMounted(() => {
|
|
|
.marquee-text-text {
|
|
|
padding: 0 5px;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|