From 9a37c5e1b2190c3f6ec71483923922189091dd52 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Wed, 18 Dec 2024 09:42:01 +0800
Subject: [PATCH] 事件模拟更新
---
src/views/companyInfo/components/mainMenu.vue | 45 +++++++++++++++++++++++++++++++--------------
1 files changed, 31 insertions(+), 14 deletions(-)
diff --git a/src/views/companyInfo/components/mainMenu.vue b/src/views/companyInfo/components/mainMenu.vue
index bedd421..954f3c6 100644
--- a/src/views/companyInfo/components/mainMenu.vue
+++ b/src/views/companyInfo/components/mainMenu.vue
@@ -1,6 +1,6 @@
<template>
<div class="page-mode">
- <div @mouseenter="item.childrenFlag = true" :class="{ active: currentUrl.indexOf(item.path) != -1 }"
+ <div @mouseenter="item.childrenFlag = true" :class="{ active: buttonIndex == item.value }"
@mouseleave="item.childrenFlag = false" @click="goToPath(item)" v-for="(item, index) in menuList" :key="index">
{{ item.menuName }}
</div>
@@ -12,34 +12,51 @@
import { useRouter, useRoute } from 'vue-router'
import { Search } from '@element-plus/icons-vue'
import { getTime } from '@/utils/getTime.js'
+import { usePointStore } from 'store/usepoint'
+const useAppStore = usePointStore()
let router = useRouter()
let currentUrl = ref('statistics')
const menuList = ref(
[
{
- menuName: '雨水管网',
- path: '/layout/ys'
+ menuName: '企业信息',
+ value: 1,
},
{
- menuName: '污水管网',
- path: '/layout/ws'
+ menuName: '应急物资',
+ value: 2,
},
{
- menuName: '三级防控',
- path: '/layout/sj'
+ menuName: '应急空间',
+ value: 3,
+ },
+ {
+ menuName: '三道防线',
+ value: 4,
}
]
)
+let { buttonIndex } = defineProps({
+ buttonIndex: Number
+})
+
+// 父级方法
+const emit = defineEmits(['childEvent'])
const goToPath = (params) => {
- if (params.children && params.children.length > 0) return
-
- if (params.path) {
- if (router.currentRoute.value.path == params.path) return
- // router.push(params.path)
- } else {
- params.childrenFlag = !params.childrenFlag
+ if (params.value == 1) {
+ emit('childEvent', params.value)
+ return
+ } else if (params.value == 2) {
+ emit('childEvent', params.value)
+ return
+ } else if (params.value == 3) {
+ emit('childEvent', params.value)
+ return
+ } else if (params.value == 4) {
+ emit('childEvent', params.value)
+ return
}
}
--
Gitblit v1.9.3