智慧园区前端大屏
shuishen
2024-12-17 a07f79573d52f61ba6ec97766e9abc12309eadee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<template>
  <div class="page-mode">
    <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>
  </div>
</template>
 
<script setup>
import { ref, reactive, watch } from 'vue'
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: '企业信息',
      value: 1,
    },
    {
      menuName: '应急物资',
      value: 2,
    },
    {
      menuName: '应急空间',
      value: 3,
    },
    {
      menuName: '三道防线',
      value: 4,
    }
  ]
)
let { buttonIndex } = defineProps({
  buttonIndex: Number
})
 
// 父级方法
const emit = defineEmits(['childEvent'])
 
const goToPath = (params) => {
  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
  }
}
 
watch(
  () => router.currentRoute.value,
  (newValue, oldValue) => {
    currentUrl.value = newValue.path
  },
  { immediate: true }
)
 
const userName = ref('管理员')
</script>
 
<style lang="scss" scoped>
.page-mode {
  position: absolute;
  top: auto;
  bottom: 55px;
  left: 50%;
  z-index: 99;
  transform: translateX(-50%);
  display: flex;
  pointer-events: auto;
 
  &>div {
    background-image: url(/images/mode-tab.png);
    background-size: cover;
    width: 150px;
    height: 50px;
    font-size: 16px;
    text-align: center;
    font-weight: bold;
    color: #BFD3E5;
    line-height: 32px;
    padding-top: 12px;
    margin-right: -20px;
    font-style: italic;
    cursor: pointer;
    box-sizing: border-box;
 
    &:last-child {
      margin-right: 0px;
    }
 
    &.active {
      color: #F6FCFF;
      background-image: url(/images/mode-tab-ac.png);
    }
 
    &:hover {
      background-image: url(/images/mode-tab-ac.png);
    }
  }
}
</style>