|
@@ -53,264 +53,264 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
- import { onMounted, onUnmounted, ref, watch, computed } from 'vue';
|
|
|
|
|
- import { useRouter, useRoute } from 'vue-router';
|
|
|
|
|
- let props = defineProps({
|
|
|
|
|
- Title: {
|
|
|
|
|
- type: String,
|
|
|
|
|
- default: '',
|
|
|
|
|
- },
|
|
|
|
|
- disabled: {
|
|
|
|
|
- type: Boolean,
|
|
|
|
|
- default: false,
|
|
|
|
|
- },
|
|
|
|
|
- });
|
|
|
|
|
|
|
+import { onMounted, onUnmounted, ref, watch, computed } from 'vue';
|
|
|
|
|
+import { useRouter, useRoute } from 'vue-router';
|
|
|
|
|
+let props = defineProps({
|
|
|
|
|
+ Title: {
|
|
|
|
|
+ type: String,
|
|
|
|
|
+ default: '',
|
|
|
|
|
+ },
|
|
|
|
|
+ disabled: {
|
|
|
|
|
+ type: Boolean,
|
|
|
|
|
+ default: false,
|
|
|
|
|
+ },
|
|
|
|
|
+});
|
|
|
|
|
|
|
|
- let menuList = ref<any[]>([
|
|
|
|
|
- {
|
|
|
|
|
- name: '智能通风',
|
|
|
|
|
- targatUrl: '/micro-vent-3dModal/configurable/ventNew/ventS/home',
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: '火灾监控',
|
|
|
|
|
- targatUrl: '/micro-vent-3dModal/configurable/fireNew/fireS/home',
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: '粉尘监控',
|
|
|
|
|
- targatUrl: '/micro-vent-3dModal/configurable/dustNew/dustS/home',
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- name: '预警监测',
|
|
|
|
|
- targatUrl: '/warnMonitor/configurable/home',
|
|
|
|
|
- },
|
|
|
|
|
- ]); //一级菜单列表
|
|
|
|
|
- let activeIndex = ref(0); //当前激活menu索引
|
|
|
|
|
- const router = useRouter();
|
|
|
|
|
- const route = useRoute();
|
|
|
|
|
- let isShowMenuItem = ref(false); //是否显示menuItem下拉选项菜单
|
|
|
|
|
- let menuItemActive = ref(0); //menuItem当前激活选项
|
|
|
|
|
- const leftMenus = computed(() => menuList.value.slice(0, 4));
|
|
|
|
|
- const rightMenus = computed(() => menuList.value.slice(4));
|
|
|
|
|
- function menuClick(data) {
|
|
|
|
|
- activeIndex.value = data.index;
|
|
|
|
|
- isShowMenuItem.value = !isShowMenuItem.value;
|
|
|
|
|
- router.push({ path: data.item.targatUrl });
|
|
|
|
|
- }
|
|
|
|
|
- function menuItemClick(index) {
|
|
|
|
|
- menuItemActive.value = index;
|
|
|
|
|
- isShowMenuItem.value = false;
|
|
|
|
|
- }
|
|
|
|
|
- function updateActiveState(path: string) {
|
|
|
|
|
- const currentPath = route.path;
|
|
|
|
|
- menuList.value.forEach((menu, index) => {
|
|
|
|
|
- // 处理有直接链接的菜单项
|
|
|
|
|
- if (menu.targatUrl === currentPath) {
|
|
|
|
|
|
|
+let menuList = ref<any[]>([
|
|
|
|
|
+ {
|
|
|
|
|
+ name: '智能通风',
|
|
|
|
|
+ targatUrl: '/micro-vent-3dModal/configurable/ventNew/ventS/home',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: '火灾监控',
|
|
|
|
|
+ targatUrl: '/micro-vent-3dModal/configurable/fireNew/fireS/home',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: '粉尘监控',
|
|
|
|
|
+ targatUrl: '/micro-vent-3dModal/configurable/dustNew/dustS/home',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ name: '预警监测',
|
|
|
|
|
+ targatUrl: '/warnMonitor/configurable/home',
|
|
|
|
|
+ },
|
|
|
|
|
+]); //一级菜单列表
|
|
|
|
|
+let activeIndex = ref(0); //当前激活menu索引
|
|
|
|
|
+const router = useRouter();
|
|
|
|
|
+const route = useRoute();
|
|
|
|
|
+let isShowMenuItem = ref(false); //是否显示menuItem下拉选项菜单
|
|
|
|
|
+let menuItemActive = ref(0); //menuItem当前激活选项
|
|
|
|
|
+const leftMenus = computed(() => menuList.value.slice(0, 4));
|
|
|
|
|
+const rightMenus = computed(() => menuList.value.slice(4));
|
|
|
|
|
+function menuClick(data) {
|
|
|
|
|
+ activeIndex.value = data.index;
|
|
|
|
|
+ isShowMenuItem.value = !isShowMenuItem.value;
|
|
|
|
|
+ router.push({ path: data.item.targatUrl });
|
|
|
|
|
+}
|
|
|
|
|
+function menuItemClick(index) {
|
|
|
|
|
+ menuItemActive.value = index;
|
|
|
|
|
+ isShowMenuItem.value = false;
|
|
|
|
|
+}
|
|
|
|
|
+function updateActiveState(path: string) {
|
|
|
|
|
+ const currentPath = route.path;
|
|
|
|
|
+ menuList.value.forEach((menu, index) => {
|
|
|
|
|
+ // 处理有直接链接的菜单项
|
|
|
|
|
+ if (menu.targatUrl === currentPath) {
|
|
|
|
|
+ activeIndex.value = index;
|
|
|
|
|
+ isShowMenuItem.value = false;
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ // 处理有子菜单的菜单项
|
|
|
|
|
+ if (menu.MenuItemList) {
|
|
|
|
|
+ const itemIndex = menu.MenuItemList.findIndex((item) => item.targatUrl === path);
|
|
|
|
|
+ if (itemIndex !== -1) {
|
|
|
activeIndex.value = index;
|
|
activeIndex.value = index;
|
|
|
- isShowMenuItem.value = false;
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- // 处理有子菜单的菜单项
|
|
|
|
|
- if (menu.MenuItemList) {
|
|
|
|
|
- const itemIndex = menu.MenuItemList.findIndex((item) => item.targatUrl === path);
|
|
|
|
|
- if (itemIndex !== -1) {
|
|
|
|
|
- activeIndex.value = index;
|
|
|
|
|
- menuItemActive.value = itemIndex;
|
|
|
|
|
- isShowMenuItem.value = true;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ menuItemActive.value = itemIndex;
|
|
|
|
|
+ isShowMenuItem.value = true;
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- watch(
|
|
|
|
|
- () => route.path,
|
|
|
|
|
- (newPath) => {
|
|
|
|
|
- updateActiveState(newPath);
|
|
|
|
|
- },
|
|
|
|
|
- {
|
|
|
|
|
- immediate: true,
|
|
|
|
|
}
|
|
}
|
|
|
- );
|
|
|
|
|
- onMounted(() => {
|
|
|
|
|
- updateActiveState(route.path);
|
|
|
|
|
});
|
|
});
|
|
|
|
|
+}
|
|
|
|
|
+watch(
|
|
|
|
|
+ () => route.path,
|
|
|
|
|
+ (newPath) => {
|
|
|
|
|
+ updateActiveState(newPath);
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ immediate: true,
|
|
|
|
|
+ }
|
|
|
|
|
+);
|
|
|
|
|
+onMounted(() => {
|
|
|
|
|
+ updateActiveState(route.path);
|
|
|
|
|
+});
|
|
|
</script>
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
|
- @import '/@/design/theme.less';
|
|
|
|
|
|
|
+@import '/@/design/theme.less';
|
|
|
|
|
+
|
|
|
|
|
+@font-face {
|
|
|
|
|
+ font-family: 'douyuFont';
|
|
|
|
|
+ src: url('/@/assets/font/douyuFont.otf');
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
- @font-face {
|
|
|
|
|
|
|
+.New-nav {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+
|
|
|
|
|
+ .main-title {
|
|
|
|
|
+ width: 518px;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
font-family: 'douyuFont';
|
|
font-family: 'douyuFont';
|
|
|
- src: url('/@/assets/font/douyuFont.otf');
|
|
|
|
|
|
|
+ font-size: 25px;
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ left: 50%;
|
|
|
|
|
+ transform: translateX(-50%);
|
|
|
|
|
+ width: auto;
|
|
|
|
|
+ padding: 0;
|
|
|
|
|
+ color: #fff;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- .New-nav {
|
|
|
|
|
- position: relative;
|
|
|
|
|
- width: 100%;
|
|
|
|
|
|
|
+ .nav-menu {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ left: 675px;
|
|
|
height: 100%;
|
|
height: 100%;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ position: static; // 移除绝对定位
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ width: auto;
|
|
|
|
|
+ .nav-menu-left {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: row;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ float: left;
|
|
|
|
|
+ .nav-menu-active {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ width: 100px;
|
|
|
|
|
+ height: 35px;
|
|
|
|
|
+ margin-top: 10px;
|
|
|
|
|
+ margin-right: 40px;
|
|
|
|
|
+ line-height: 31px;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ font-size: 16px;
|
|
|
|
|
+ background: url(/src/assets/images/fireNew/2-1.png) no-repeat;
|
|
|
|
|
+ background-size: 100% 100%;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- .main-title {
|
|
|
|
|
- width: 518px;
|
|
|
|
|
- height: 100%;
|
|
|
|
|
|
|
+ .nav-menu-unactive {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ width: 100px;
|
|
|
|
|
+ height: 35px;
|
|
|
|
|
+ margin-top: 10px;
|
|
|
|
|
+ margin-right: 40px;
|
|
|
|
|
+ line-height: 31px;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ font-size: 16px;
|
|
|
|
|
+ background: url(/src/assets/images/fireNew/2-2.png) no-repeat;
|
|
|
|
|
+ background-size: 100% 100%;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .nav-menu-right {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
|
|
+ flex-direction: row;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
- font-family: 'douyuFont';
|
|
|
|
|
- font-size: 25px;
|
|
|
|
|
- position: absolute;
|
|
|
|
|
- left: 50%;
|
|
|
|
|
- transform: translateX(-50%);
|
|
|
|
|
- width: auto;
|
|
|
|
|
- padding: 0;
|
|
|
|
|
- color: #fff;
|
|
|
|
|
|
|
+ float: left;
|
|
|
|
|
+ margin-left: 42%;
|
|
|
|
|
+ .nav-menu-active {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ width: 100px;
|
|
|
|
|
+ height: 40px;
|
|
|
|
|
+ margin-top: 10px;
|
|
|
|
|
+ margin-right: 40px;
|
|
|
|
|
+ line-height: 35px;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ font-size: 16px;
|
|
|
|
|
+ background: url(/src/assets/images/fireNew/2-3.png) no-repeat;
|
|
|
|
|
+ background-size: 100% 100%;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .nav-menu-unactive {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ width: 100px;
|
|
|
|
|
+ height: 40px;
|
|
|
|
|
+ margin-top: 10px;
|
|
|
|
|
+ margin-right: 40px;
|
|
|
|
|
+ line-height: 35px;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ font-size: 16px;
|
|
|
|
|
+ background: url(/src/assets/images/fireNew/2-4.png) no-repeat;
|
|
|
|
|
+ background-size: 100% 100%;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- .nav-menu {
|
|
|
|
|
|
|
+ .nav-menu-item {
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
- top: 0;
|
|
|
|
|
- left: 675px;
|
|
|
|
|
- height: 100%;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- position: static; // 移除绝对定位
|
|
|
|
|
|
|
+ top: 23px;
|
|
|
|
|
+ width: 130px;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
- width: auto;
|
|
|
|
|
- .nav-menu-left {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- flex-direction: row;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- float: left;
|
|
|
|
|
- .nav-menu-active {
|
|
|
|
|
- position: relative;
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- width: 100px;
|
|
|
|
|
- height: 40px;
|
|
|
|
|
- margin-top: 10px;
|
|
|
|
|
- margin-right: 40px;
|
|
|
|
|
- line-height: 35px;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- font-size: 16px;
|
|
|
|
|
- background: url(/src/assets/images/fireNew/2-1.png) no-repeat;
|
|
|
|
|
- background-size: 100% 100%;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
|
|
|
- .nav-menu-unactive {
|
|
|
|
|
- position: relative;
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- width: 100px;
|
|
|
|
|
- height: 40px;
|
|
|
|
|
- margin-top: 10px;
|
|
|
|
|
- margin-right: 40px;
|
|
|
|
|
- line-height: 35px;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- font-size: 16px;
|
|
|
|
|
- background: url(/src/assets/images/fireNew/2-2.png) no-repeat;
|
|
|
|
|
|
|
+ .nav-menu-content {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ overflow-y: auto;
|
|
|
|
|
+ margin-top: 25%;
|
|
|
|
|
+ .nav-menu-List {
|
|
|
|
|
+ background: url('@/assets/images/vent/homeNew/menuList.png') no-repeat;
|
|
|
background-size: 100% 100%;
|
|
background-size: 100% 100%;
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- .nav-menu-right {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- flex-direction: row;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- float: left;
|
|
|
|
|
- margin-left: 42%;
|
|
|
|
|
- .nav-menu-active {
|
|
|
|
|
- position: relative;
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- width: 100px;
|
|
|
|
|
- height: 40px;
|
|
|
|
|
- margin-top: 10px;
|
|
|
|
|
- margin-right: 40px;
|
|
|
|
|
- line-height: 35px;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- font-size: 16px;
|
|
|
|
|
- background: url(/src/assets/images/fireNew/2-3.png) no-repeat;
|
|
|
|
|
|
|
+ .menu-item-active {
|
|
|
|
|
+ color: #ddd;
|
|
|
|
|
+ z-index: 999;
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 36px;
|
|
|
|
|
+ line-height: 36px;
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ background: url('@/assets/images/fireNew/2-2.png') no-repeat;
|
|
|
background-size: 100% 100%;
|
|
background-size: 100% 100%;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- .nav-menu-unactive {
|
|
|
|
|
- position: relative;
|
|
|
|
|
- cursor: pointer;
|
|
|
|
|
- width: 100px;
|
|
|
|
|
|
|
+ .menu-item-unactive {
|
|
|
|
|
+ color: #ddd;
|
|
|
|
|
+ width: 100%;
|
|
|
height: 40px;
|
|
height: 40px;
|
|
|
- margin-top: 10px;
|
|
|
|
|
- margin-right: 40px;
|
|
|
|
|
- line-height: 35px;
|
|
|
|
|
- text-align: center;
|
|
|
|
|
- font-size: 16px;
|
|
|
|
|
- background: url(/src/assets/images/fireNew/2-4.png) no-repeat;
|
|
|
|
|
- background-size: 100% 100%;
|
|
|
|
|
|
|
+ line-height: 40px;
|
|
|
|
|
+ font-size: 14px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- .nav-menu-item {
|
|
|
|
|
- position: absolute;
|
|
|
|
|
- top: 23px;
|
|
|
|
|
- width: 130px;
|
|
|
|
|
- display: flex;
|
|
|
|
|
- flex-direction: column;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- box-sizing: border-box;
|
|
|
|
|
-
|
|
|
|
|
- .nav-menu-content {
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- height: 100%;
|
|
|
|
|
- overflow-y: auto;
|
|
|
|
|
- margin-top: 25%;
|
|
|
|
|
- .nav-menu-List {
|
|
|
|
|
- background: url('@/assets/images/vent/homeNew/menuList.png') no-repeat;
|
|
|
|
|
- background-size: 100% 100%;
|
|
|
|
|
- }
|
|
|
|
|
- .menu-item-active {
|
|
|
|
|
- color: #ddd;
|
|
|
|
|
- z-index: 999;
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- height: 36px;
|
|
|
|
|
- line-height: 36px;
|
|
|
|
|
- font-size: 14px;
|
|
|
|
|
- background: url('@/assets/images/fireNew/2-2.png') no-repeat;
|
|
|
|
|
- background-size: 100% 100%;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .menu-item-unactive {
|
|
|
|
|
- color: #ddd;
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- height: 40px;
|
|
|
|
|
- line-height: 40px;
|
|
|
|
|
- font-size: 14px;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ @keyframes fadeIn {
|
|
|
|
|
+ from {
|
|
|
|
|
+ opacity: 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- @keyframes fadeIn {
|
|
|
|
|
- from {
|
|
|
|
|
- opacity: 0;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- to {
|
|
|
|
|
- opacity: 1;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ to {
|
|
|
|
|
+ opacity: 1;
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- /* 定义淡出动画 */
|
|
|
|
|
- @keyframes fadeOut {
|
|
|
|
|
- from {
|
|
|
|
|
- opacity: 1;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ /* 定义淡出动画 */
|
|
|
|
|
+ @keyframes fadeOut {
|
|
|
|
|
+ from {
|
|
|
|
|
+ opacity: 1;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- to {
|
|
|
|
|
- opacity: 0;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ to {
|
|
|
|
|
+ opacity: 0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- .userInfo {
|
|
|
|
|
- width: 120px;
|
|
|
|
|
- float: right;
|
|
|
|
|
- background: url(/src/assets/images/vent/homeNew/user.png) no-repeat;
|
|
|
|
|
- background-size: 100% 100%;
|
|
|
|
|
- position: absolute;
|
|
|
|
|
- top: 14px;
|
|
|
|
|
- right: 0;
|
|
|
|
|
- .userName {
|
|
|
|
|
- margin-left: 40px;
|
|
|
|
|
- font-size: 20px;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ .userInfo {
|
|
|
|
|
+ width: 120px;
|
|
|
|
|
+ float: right;
|
|
|
|
|
+ background: url(/src/assets/images/vent/homeNew/user.png) no-repeat;
|
|
|
|
|
+ background-size: 100% 100%;
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: 14px;
|
|
|
|
|
+ right: 0;
|
|
|
|
|
+ .userName {
|
|
|
|
|
+ margin-left: 40px;
|
|
|
|
|
+ font-size: 20px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|