|
@@ -1,49 +1,124 @@
|
|
|
<template>
|
|
|
- <div class="bar-list"
|
|
|
- v-if="show && !((metadata.catalogRoot && metadata.catalogRoot.length == 1) && scenes.length == 1 && secondaryList.length == 1)"
|
|
|
- :class="{ barshow: isShowScenesList }">
|
|
|
- <div class="top-con"
|
|
|
- :style="`width:${(Math.max(scenesListW, secondaryW) > 1150) ? '100%' : ((Math.max(scenesListW, secondaryW) + 120) + 'px')}`">
|
|
|
- <div class="swiper-container" :style="`width:${scenesListW > 1150 ? '100%' : (scenesListW + 'px')}`" id="swScenes"
|
|
|
- v-if="currentScenesList.length > 0">
|
|
|
+ <div
|
|
|
+ class="bar-list"
|
|
|
+ v-if="
|
|
|
+ show &&
|
|
|
+ !(
|
|
|
+ metadata.catalogRoot &&
|
|
|
+ metadata.catalogRoot.length == 1 &&
|
|
|
+ scenes.length == 1 &&
|
|
|
+ secondaryList.length == 1
|
|
|
+ )
|
|
|
+ "
|
|
|
+ :class="{ barshow: isShowScenesList }"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ class="top-con"
|
|
|
+ :style="`width:${
|
|
|
+ Math.max(scenesListW, secondaryW) > 1150
|
|
|
+ ? '100%'
|
|
|
+ : Math.max(scenesListW, secondaryW) + 120 + 'px'
|
|
|
+ }`"
|
|
|
+ >
|
|
|
+ <div
|
|
|
+ class="swiper-container"
|
|
|
+ :style="`width:${scenesListW > 1150 ? '100%' : scenesListW + 'px'}`"
|
|
|
+ id="swScenes"
|
|
|
+ v-if="currentScenesList.length > 0"
|
|
|
+ >
|
|
|
<ul class="swiper-wrapper">
|
|
|
- <li @click="tabCurrentScene(item)" class="swiper-slide" :class="{
|
|
|
- active: currentScene.sceneCode == item.sceneCode,
|
|
|
- loopspan: item.sceneTitle.length > spanlength && currentScene.id == item.id,
|
|
|
- }" :style="{ backgroundImage: `url(${item.icon})` }" v-for="(item, i) in currentScenesList" :key="i">
|
|
|
- <i class="iconfont " :class="item.type == '4dkk' ? 'icon-editor_3d' : 'icon-editor_panoramic'"></i>
|
|
|
+ <li
|
|
|
+ @click="tabCurrentScene(item)"
|
|
|
+ class="swiper-slide"
|
|
|
+ :class="{
|
|
|
+ active: currentScene.sceneCode == item.sceneCode,
|
|
|
+ loopspan:
|
|
|
+ item.sceneTitle.length > spanlength &&
|
|
|
+ currentScene.id == item.id,
|
|
|
+ }"
|
|
|
+ :style="{ backgroundImage: `url(${item.icon})` }"
|
|
|
+ v-for="(item, i) in currentScenesList"
|
|
|
+ :key="i"
|
|
|
+ >
|
|
|
+ <i
|
|
|
+ class="iconfont"
|
|
|
+ :class="
|
|
|
+ item.type == '4dkk' ? 'icon-editor_3d' : 'icon-editor_panoramic'
|
|
|
+ "
|
|
|
+ ></i>
|
|
|
<div>
|
|
|
- <span v-if="currentScene.id == item.id">{{ item.sceneTitle }}</span>
|
|
|
- <span v-else>{{ item.sceneTitle.length > spanlength ? item.sceneTitle.slice(0, spanlength) :
|
|
|
- item.sceneTitle
|
|
|
+ <span v-if="currentScene.id == item.id">{{
|
|
|
+ item.sceneTitle
|
|
|
+ }}</span>
|
|
|
+ <span v-else>{{
|
|
|
+ item.sceneTitle.length > spanlength
|
|
|
+ ? item.sceneTitle.slice(0, spanlength)
|
|
|
+ : item.sceneTitle
|
|
|
}}</span>
|
|
|
</div>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
|
|
|
- <div class="swiper-container" id="swSecondary" :style="`width:${secondaryW}px`" v-if="secondaryList.length > 1">
|
|
|
+ <div
|
|
|
+ class="swiper-container"
|
|
|
+ id="swSecondary"
|
|
|
+ :style="`width:${secondaryW}px`"
|
|
|
+ v-if="secondaryList.length > 1"
|
|
|
+ >
|
|
|
<ul class="swiper-wrapper">
|
|
|
- <li class="swiper-slide" @click="tabSecondary(item)" :class="{
|
|
|
- active: currentSecondary.id == item.id,
|
|
|
- loopspan: fixTitle(item.name).length > spanlength && currentSecondary.id == item.id,
|
|
|
- }" v-for="(item, i) in secondaryList" :key="i">
|
|
|
- <span v-if="currentSecondary.id == item.id">{{ fixTitle(item.name) }}</span>
|
|
|
- <span v-else>{{ fixTitle(item.name).length > spanlength ? fixTitle(item.name).slice(0, spanlength) : fixTitle(item.name) }}</span>
|
|
|
+ <li
|
|
|
+ class="swiper-slide"
|
|
|
+ @click="tabSecondary(item)"
|
|
|
+ :class="{
|
|
|
+ active: currentSecondary.id == item.id,
|
|
|
+ loopspan:
|
|
|
+ fixTitle(item.name).length > spanlength &&
|
|
|
+ currentSecondary.id == item.id,
|
|
|
+ }"
|
|
|
+ v-for="(item, i) in secondaryList"
|
|
|
+ :key="i"
|
|
|
+ >
|
|
|
+ <span v-if="currentSecondary.id == item.id">{{
|
|
|
+ fixTitle(item.name)
|
|
|
+ }}</span>
|
|
|
+ <span v-else>{{
|
|
|
+ fixTitle(item.name).length > spanlength
|
|
|
+ ? fixTitle(item.name).slice(0, spanlength)
|
|
|
+ : fixTitle(item.name)
|
|
|
+ }}</span>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="swiper-container" id="swcatalogRoot" :style="`width:${catalogRootW > innerW ? '100%' : (catalogRootW + 'px')}`"
|
|
|
- v-if="metadata.catalogRoot.length > 0 && metadata.catalogs.length > 1">
|
|
|
+ <div
|
|
|
+ class="swiper-container"
|
|
|
+ id="swcatalogRoot"
|
|
|
+ :style="`width:${catalogRootW > innerW ? '100%' : catalogRootW + 'px'}`"
|
|
|
+ v-if="metadata.catalogRoot.length > 0 && metadata.catalogs.length > 1"
|
|
|
+ >
|
|
|
<ul class="swiper-wrapper" v-if="metadata.catalogRoot.length > 1">
|
|
|
- <li class="swiper-slide" :class="{
|
|
|
- active: currentCatalogRoot.id == item.id,
|
|
|
- loopspan: fixTitle(item.name).length > spanlength && currentCatalogRoot.id == item.id,
|
|
|
- }" @click="tabRoot(item)" v-for="(item, i) in metadata.catalogRoot" :key="i">
|
|
|
- <span v-if="currentCatalogRoot.id == item.id">{{ fixTitle(item.name) }}</span>
|
|
|
- <span v-else>{{ fixTitle(item.name).length > spanlength ? fixTitle(item.name).slice(0, spanlength) : fixTitle(item.name) }}</span>
|
|
|
+ <li
|
|
|
+ class="swiper-slide"
|
|
|
+ :class="{
|
|
|
+ active: currentCatalogRoot.id == item.id,
|
|
|
+ loopspan:
|
|
|
+ fixTitle(item.name).length > spanlength &&
|
|
|
+ currentCatalogRoot.id == item.id,
|
|
|
+ }"
|
|
|
+ @click="tabRoot(item)"
|
|
|
+ v-for="(item, i) in metadata.catalogRoot"
|
|
|
+ :key="i"
|
|
|
+ >
|
|
|
+ <span v-if="currentCatalogRoot.id == item.id">{{
|
|
|
+ fixTitle(item.name)
|
|
|
+ }}</span>
|
|
|
+ <span v-else>{{
|
|
|
+ fixTitle(item.name).length > spanlength
|
|
|
+ ? fixTitle(item.name).slice(0, spanlength)
|
|
|
+ : fixTitle(item.name)
|
|
|
+ }}</span>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
@@ -55,8 +130,8 @@ import { ref, watch, computed, onMounted, nextTick } from "vue";
|
|
|
import { useStore } from "vuex";
|
|
|
import { useApp } from "@/app";
|
|
|
|
|
|
-import { useI18n, getLocale } from '@/i18n'
|
|
|
-const { t } = useI18n({ useScope: 'global' })
|
|
|
+import { useI18n, getLocale } from "@/i18n";
|
|
|
+const { t } = useI18n({ useScope: "global" });
|
|
|
|
|
|
const store = useStore();
|
|
|
|
|
@@ -66,33 +141,52 @@ const metadata = computed(() => store.getters["scene/metadata"]);
|
|
|
const scenes = computed(() => store.getters["scene/list"]);
|
|
|
const currentScene = computed(() => store.getters["scene/currentScene"]);
|
|
|
|
|
|
-const currentCatalogRoot = computed(() => store.getters["scene/currentCatalogRoot"]);
|
|
|
-const currentSecondary = computed(() => store.getters["scene/currentSecondary"]);
|
|
|
+const currentCatalogRoot = computed(
|
|
|
+ () => store.getters["scene/currentCatalogRoot"]
|
|
|
+);
|
|
|
+const currentSecondary = computed(
|
|
|
+ () => store.getters["scene/currentSecondary"]
|
|
|
+);
|
|
|
|
|
|
const secondaryList = computed(() => store.getters["scene/secondaryList"]);
|
|
|
|
|
|
-const isShowScenesList = computed(() => store.getters["functions/isShowScenesList"]);
|
|
|
+const isShowScenesList = computed(
|
|
|
+ () => store.getters["functions/isShowScenesList"]
|
|
|
+);
|
|
|
|
|
|
-const currentScenesList = computed(() => store.getters["scene/currentScenesList"]);
|
|
|
+const currentScenesList = computed(
|
|
|
+ () => store.getters["scene/currentScenesList"]
|
|
|
+);
|
|
|
|
|
|
const show = ref(false);
|
|
|
|
|
|
-
|
|
|
const swidth = ref({
|
|
|
- "swcatalogRoot": 104,
|
|
|
- "swSecondary": 84,
|
|
|
- "swScenes": 72,
|
|
|
-})
|
|
|
-
|
|
|
-const scenesListW = computed(() => currentScenesList.value.length * (swidth.value['swScenes'] + 10) - 10)
|
|
|
-const secondaryW = computed(() => secondaryList.value.length * (swidth.value['swSecondary'] + 10) - 10)
|
|
|
-const catalogRootW = computed(() => metadata.value.catalogRoot.length * (swidth.value['swcatalogRoot'] + 10) - 10)
|
|
|
-const innerW = computed(() => 1150)
|
|
|
-
|
|
|
+ swcatalogRoot: 104,
|
|
|
+ swSecondary: 84,
|
|
|
+ swScenes: 72,
|
|
|
+});
|
|
|
|
|
|
+const scenesListW = computed(
|
|
|
+ () => currentScenesList.value.length * (swidth.value["swScenes"] + 10) - 10
|
|
|
+);
|
|
|
+const secondaryW = computed(
|
|
|
+ () => secondaryList.value.length * (swidth.value["swSecondary"] + 10) - 10
|
|
|
+);
|
|
|
+const catalogRootW = computed(
|
|
|
+ () =>
|
|
|
+ metadata.value.catalogRoot.length * (swidth.value["swcatalogRoot"] + 10) -
|
|
|
+ 10
|
|
|
+);
|
|
|
+const innerW = computed(() => 1150);
|
|
|
|
|
|
const tabCurrentScene = (data) => {
|
|
|
- store.commit("scene/setCurrentScene", data);
|
|
|
+ console.log("tabCurrentScene", data.id, currentScene.value.id);
|
|
|
+ if (data.id !== currentScene.value.id) {
|
|
|
+ store.commit("scene/setCurrentScene", data);
|
|
|
+ } else {
|
|
|
+ console.log("重复点击当前导航");
|
|
|
+ // window.alert("alert-test-->重复点击当前导航");
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
const tabSecondary = (data) => {
|
|
@@ -104,15 +198,15 @@ const tabRoot = (data) => {
|
|
|
};
|
|
|
|
|
|
const fixTitle = (name) => {
|
|
|
- if (name == '默认二级分组') {
|
|
|
- name = t('navigation.default_group_two')
|
|
|
- } else if (name == '一级分组') {
|
|
|
- name = t('navigation.group_one')
|
|
|
+ if (name == "默认二级分组") {
|
|
|
+ name = t("navigation.default_group_two");
|
|
|
+ } else if (name == "一级分组") {
|
|
|
+ name = t("navigation.group_one");
|
|
|
} else {
|
|
|
- name = name
|
|
|
+ name = name;
|
|
|
}
|
|
|
- return name
|
|
|
-}
|
|
|
+ return name;
|
|
|
+};
|
|
|
|
|
|
const loadList = () => {
|
|
|
nextTick(() => {
|
|
@@ -160,7 +254,7 @@ $width: 1150px;
|
|
|
max-width: $width;
|
|
|
overflow: hidden;
|
|
|
max-height: 0;
|
|
|
- transition: .3s all ease;
|
|
|
+ transition: 0.3s all ease;
|
|
|
z-index: 9;
|
|
|
|
|
|
.swiper-container {
|
|
@@ -168,29 +262,27 @@ $width: 1150px;
|
|
|
position: relative;
|
|
|
margin: 0 auto;
|
|
|
|
|
|
- >ul {
|
|
|
- >li {
|
|
|
+ > ul {
|
|
|
+ > li {
|
|
|
white-space: nowrap;
|
|
|
|
|
|
- >span,
|
|
|
- >div>span {
|
|
|
+ > span,
|
|
|
+ > div > span {
|
|
|
cursor: pointer;
|
|
|
display: inline-block;
|
|
|
color: rgba(255, 255, 255, 0.6);
|
|
|
}
|
|
|
|
|
|
&.loopspan {
|
|
|
-
|
|
|
- >span,
|
|
|
- >div>span {
|
|
|
+ > span,
|
|
|
+ > div > span {
|
|
|
animation: 5s wordsLoop linear infinite normal;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
&.active {
|
|
|
-
|
|
|
- >span,
|
|
|
- >div>span {
|
|
|
+ > span,
|
|
|
+ > div > span {
|
|
|
color: rgba(255, 255, 255, 1);
|
|
|
}
|
|
|
}
|
|
@@ -201,12 +293,18 @@ $width: 1150px;
|
|
|
.top-con {
|
|
|
margin: 0 auto 10px;
|
|
|
padding: 10px 0;
|
|
|
- background: linear-gradient(268deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.4) 25%, rgba(0, 0, 0, 0.4) 75%, rgba(0, 0, 0, 0) 100%);
|
|
|
+ background: linear-gradient(
|
|
|
+ 268deg,
|
|
|
+ rgba(0, 0, 0, 0) 0%,
|
|
|
+ rgba(0, 0, 0, 0.4) 25%,
|
|
|
+ rgba(0, 0, 0, 0.4) 75%,
|
|
|
+ rgba(0, 0, 0, 0) 100%
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
#swcatalogRoot {
|
|
|
- >ul {
|
|
|
- >li {
|
|
|
+ > ul {
|
|
|
+ > li {
|
|
|
width: 104px;
|
|
|
background: rgba(0, 0, 0, 0.5);
|
|
|
border-radius: 4px;
|
|
@@ -215,7 +313,7 @@ $width: 1150px;
|
|
|
box-sizing: border-box;
|
|
|
overflow: hidden;
|
|
|
|
|
|
- >span {
|
|
|
+ > span {
|
|
|
width: 100%;
|
|
|
word-break: keep-all;
|
|
|
}
|
|
@@ -230,14 +328,14 @@ $width: 1150px;
|
|
|
#swSecondary {
|
|
|
margin: 20px auto 10px;
|
|
|
|
|
|
- >ul {
|
|
|
- >li {
|
|
|
+ > ul {
|
|
|
+ > li {
|
|
|
width: 84px;
|
|
|
box-sizing: border-box;
|
|
|
overflow: hidden;
|
|
|
padding-bottom: 6px;
|
|
|
|
|
|
- >span {
|
|
|
+ > span {
|
|
|
width: 100%;
|
|
|
word-break: keep-all;
|
|
|
}
|
|
@@ -263,8 +361,8 @@ $width: 1150px;
|
|
|
}
|
|
|
|
|
|
#swScenes {
|
|
|
- >ul {
|
|
|
- >li {
|
|
|
+ > ul {
|
|
|
+ > li {
|
|
|
cursor: pointer;
|
|
|
width: 72px;
|
|
|
height: 72px;
|
|
@@ -295,7 +393,7 @@ $width: 1150px;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- >div {
|
|
|
+ > div {
|
|
|
position: absolute;
|
|
|
bottom: 0;
|
|
|
left: 0;
|
|
@@ -304,7 +402,7 @@ $width: 1150px;
|
|
|
width: 100%;
|
|
|
overflow: hidden;
|
|
|
|
|
|
- >span {
|
|
|
+ > span {
|
|
|
width: 100%;
|
|
|
line-height: 20px;
|
|
|
word-break: keep-all;
|
|
@@ -314,8 +412,9 @@ $width: 1150px;
|
|
|
&.active {
|
|
|
border: 1px solid var(--colors-primary-base);
|
|
|
|
|
|
- >div {
|
|
|
- >span {}
|
|
|
+ > div {
|
|
|
+ > span {
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|