|
|
@@ -1,23 +1,49 @@
|
|
1
|
1
|
<template>
|
|
2
|
2
|
<div class="bg">
|
|
3
|
3
|
<div class="page">
|
|
4
|
|
- <div class="title">{{ title }}</div>
|
|
|
4
|
+ <div class="title-wrapper">
|
|
|
5
|
+ <div v-if="tabs.length>0" class="left-tab">
|
|
|
6
|
+ <div
|
|
|
7
|
+ v-for="(tab, index) in tabs"
|
|
|
8
|
+ :key="index"
|
|
|
9
|
+ class="tab-item"
|
|
|
10
|
+ :class="{ active: activeTab === index }"
|
|
|
11
|
+ @click="handleTabClick(index)"
|
|
|
12
|
+ >
|
|
|
13
|
+ {{ tab }}
|
|
|
14
|
+ </div>
|
|
|
15
|
+ </div>
|
|
|
16
|
+ <div class="title">{{ title }}</div>
|
|
|
17
|
+ </div>
|
|
5
|
18
|
<div class="content">
|
|
6
|
|
- <slot></slot>
|
|
|
19
|
+ <slot />
|
|
7
|
20
|
</div>
|
|
8
|
21
|
</div>
|
|
9
|
22
|
</div>
|
|
10
|
|
-
|
|
11
|
|
-
|
|
12
|
23
|
</template>
|
|
13
|
24
|
|
|
14
|
25
|
<script setup>
|
|
|
26
|
+import { ref } from 'vue'
|
|
|
27
|
+
|
|
15
|
28
|
const props = defineProps({
|
|
16
|
29
|
title: {
|
|
17
|
30
|
type: String,
|
|
18
|
31
|
default: '安检人事管理可视化大屏'
|
|
|
32
|
+ },
|
|
|
33
|
+ tabs: {
|
|
|
34
|
+ type: Array,
|
|
|
35
|
+ default: () => []
|
|
19
|
36
|
}
|
|
20
|
37
|
})
|
|
|
38
|
+
|
|
|
39
|
+const emit = defineEmits(['tabChange'])
|
|
|
40
|
+
|
|
|
41
|
+const activeTab = ref(0)
|
|
|
42
|
+
|
|
|
43
|
+const handleTabClick = (index) => {
|
|
|
44
|
+ activeTab.value = index
|
|
|
45
|
+ emit('tabChange', index)
|
|
|
46
|
+}
|
|
21
|
47
|
</script>
|
|
22
|
48
|
|
|
23
|
49
|
<style lang="scss" scoped>
|
|
|
@@ -33,7 +59,7 @@ const props = defineProps({
|
|
33
|
59
|
content: '';
|
|
34
|
60
|
position: absolute;
|
|
35
|
61
|
inset: 0;
|
|
36
|
|
- background: linear-gradient(45deg, #231A43, #1c2d3e) ;
|
|
|
62
|
+ background: linear-gradient(45deg, #231A43, #1c2d3e);
|
|
37
|
63
|
opacity: 0.8;
|
|
38
|
64
|
z-index: 1;
|
|
39
|
65
|
}
|
|
|
@@ -44,16 +70,13 @@ const props = defineProps({
|
|
44
|
70
|
flex-direction: column;
|
|
45
|
71
|
min-height: 100vh;
|
|
46
|
72
|
}
|
|
47
|
|
- .title {
|
|
|
73
|
+ .title-wrapper {
|
|
|
74
|
+ display: flex;
|
|
|
75
|
+ align-items: center;
|
|
48
|
76
|
height: 88px;
|
|
49
|
|
- line-height: 88px;
|
|
50
|
|
- text-align: center;
|
|
51
|
|
- color: #fff;
|
|
52
|
|
- font-size: 48px;
|
|
53
|
77
|
background: #2b394d86;
|
|
54
|
78
|
position: relative;
|
|
55
|
79
|
margin-bottom: 2px;
|
|
56
|
|
- font-weight: bold;
|
|
57
|
80
|
&::before {
|
|
58
|
81
|
content: '';
|
|
59
|
82
|
position: absolute;
|
|
|
@@ -67,6 +90,38 @@ const props = defineProps({
|
|
67
|
90
|
z-index: -1;
|
|
68
|
91
|
}
|
|
69
|
92
|
}
|
|
|
93
|
+ .left-tab {
|
|
|
94
|
+ display: flex;
|
|
|
95
|
+ padding: 0 20px;
|
|
|
96
|
+ .tab-item {
|
|
|
97
|
+ padding: 0 20px;
|
|
|
98
|
+ height: 88px;
|
|
|
99
|
+ line-height: 88px;
|
|
|
100
|
+ color: #a0c4ff;
|
|
|
101
|
+ font-size: 16px;
|
|
|
102
|
+ cursor: pointer;
|
|
|
103
|
+ transition: all 0.3s;
|
|
|
104
|
+
|
|
|
105
|
+ &:hover {
|
|
|
106
|
+ background: rgba(15, 70, 250, 0.1);
|
|
|
107
|
+ color: #fff;
|
|
|
108
|
+ }
|
|
|
109
|
+ &.active {
|
|
|
110
|
+ background: rgba(15, 70, 250, 0.2);
|
|
|
111
|
+ color: #fff;
|
|
|
112
|
+ border-bottom-color: #cfdf89;
|
|
|
113
|
+ }
|
|
|
114
|
+ }
|
|
|
115
|
+ }
|
|
|
116
|
+ .title {
|
|
|
117
|
+ flex: 1;
|
|
|
118
|
+ height: 88px;
|
|
|
119
|
+ line-height: 88px;
|
|
|
120
|
+ text-align: center;
|
|
|
121
|
+ color: #fff;
|
|
|
122
|
+ font-size: 48px;
|
|
|
123
|
+ font-weight: bold;
|
|
|
124
|
+ }
|
|
70
|
125
|
.content {
|
|
71
|
126
|
flex: 1;
|
|
72
|
127
|
}
|