智慧园区前端大屏
linwe
2024-11-06 a2fae1e5063dee21c68554f36a6f0a4b3429ffbd
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
<script setup>
 
import { useRouter, useRoute } from 'vue-router'
let router = useRouter()
import { useRouterStore } from 'store/router'
const store = useRouterStore()
 
 
 
let data = reactive({
    companyInfo: {}
})
 
let buttonIndex = defineProps({
    buttonIndex: Number
})
 
onMounted(() => {
    data.companyInfo = JSON.parse(localStorage.getItem('companyInfo'))
})
// 父级方法
const emit = defineEmits(['childEvent']);
// 回调父级方法
const handleClick = (index) => {
    console.log(index)
    emit('childEvent', index)
}
// 返回首页
const goHome = () => {
    store.setLoadSub(false)
    router.push('/layout')
}
 
</script>
    
<template>
    <div class="center-container">
        <div class="center-container-title">
            <el-row>
                <el-col :span="7">
                    <div class="center-name">{{ data.companyInfo.name }}</div>
                </el-col>
                <el-col :span="10">
                    <div class="button-group">
                        <button @click="handleClick(1)">基本信息</button>
                        <button @click="handleClick(2)">应急物质</button>
                        <button @click="handleClick(3)">救援队伍</button>
                    </div>
                </el-col>
                <el-col :span="7">
                    <div class="center-info">
                        <button @click="goHome()">返回首页</button>
                    </div>
                </el-col>
            </el-row>
        </div>
    </div>
</template>
    
<style lang="scss" scoped >
.center-container {
    margin: -35px auto;
    color: #fff;
    pointer-events: auto;
}
 
.center-container-title {}
 
.center-name {
    font-size: 30px;
    margin: 10px 0;
    font-family: "华文行楷";
}
 
.button-group {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: -6px 0;
    cursor: pointer;
 
}
 
.button-group button {
    width: 120px;
    height: 40px;
    border: none;
    border-radius: 20px;
    background-color: transparent;
    color: #fff;
    font-size: 25px;
}
 
.center-info {
    text-align: right;
}
 
.center-info button {
    width: 120px;
    height: 40px;
    border: none;
    border-radius: 20px;
    color: #fff;
    background-color: transparent;
    font-size: 20px;
    background-image: url(/images/mode-tab.png);
}
 
button:hover {
    background-color: #3c5e8f;
}
</style>