吉安感知网项目-前端
shuishen
2026-02-03 89380e6260a75d1d3b94de687ebcc2f50d50659d
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<template>
    <div :class="{ GatewayPage: true, 'narrowScreen': narrowScreen }">
        <div class="gateway-page">
            <div class="logo" v-if="isShowAiSkyLogo">
                <img src="@/assets/images/login/aisky-logo.png" alt="" />
            </div>
            <div class="title">{{ gateTitle }}</div>
            <div class="en-title">{{ gateTitleEn }}</div>
            <div class="card-warp">
                <div
                    class="card"
                    v-for="(item, index) in cardList"
                    :key="index"
                    @mouseenter="activeIndex = index"
                    @mouseleave="activeIndex = -1"
                >
                    <div
                        @click="activeClick(activeIndex)"
                        class="card-bg"
                        :style="{
                            background: `url(${activeIndex === index ? item.active : item.normal}) no-repeat center 100% / 100%`,
                        }"
                        :class="{
                            'hover-image': activeIndex === index,
                        }"
                    ></div>
                </div>
            </div>
        </div>
    </div>
</template>
 
<script setup>
import { useRouter, useRoute } from 'vue-router'
import { ElMessage } from 'element-plus'
 
import getBaseConfig from '@/buildConfig/config'
 
const { gateTitle, gateTitleEn, isShowAiSkyLogo, gatewayMenu } = getBaseConfig()
 
const router = useRouter()
 
// 图片数据
const cardList = ref([...gatewayMenu])
const activeIndex = ref(-1) // 当前激活的卡片索引
 
function activeClick(index) {
    if (index === 0) {
        const adminUrl = import.meta.env.VITE_APP_ADMIN_URL
        window.location.href = `${adminUrl}wel/index`
    }
    if (index === 1) {
        router.push('/index')
    }
    if (index === 2) {
        const url = encodeURIComponent(window.location.href)
        const { VITE_APP_AI_PLAT_URL } = import.meta.env
        window.location.href = `${VITE_APP_AI_PLAT_URL}/login?autoEnter=1&formUrl=${url}`
        // window.open(`http://localhost:8013/login?autoEnter=1&formUrl=${url}`)
    }
}
 
const narrowScreen = ref(false)
const narrowScreenFun = () => {
    // 监听窗口变化,计算是不是 窄屏幕
    narrowScreen.value = window.innerWidth / window.innerHeight < 16 / 9
}
 
onMounted(() => {
    narrowScreenFun()
    window.addEventListener('resize', narrowScreenFun)
    document.title = 'appWebview'
})
</script>
 
<style lang="scss" scoped>
.GatewayPage {
    position: relative;
    background: #020f25;
    width: 100%;
    height: 100%;
 
    overflow-x: auto;
    scrollbar-width: none; /* Firefox 隐藏滚动条 */
    &::-webkit-scrollbar {
        display: none; /* Chrome、Safari 隐藏滚动条 */
    }
 
    &.narrowScreen {
        > div {
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
        }
    }
    > div {
        left: 0;
        top: 0;
        position: absolute;
        height: 1080px;
        width: 1920px;
    }
    .gateway-page {
        background: url('@/assets/images/login/gateway-bg.png') center no-repeat;
        background-size: 100% 100%;
    }
    .logo {
        position: absolute;
        left: 52px;
        top: 44px;
        img {
            width: 156px;
            height: 44px;
        }
    }
    .title {
        position: absolute;
        left: 184px;
        top: 294px;
        width: 968px;
        height: 110px;
        font-family: Segoe UI, Segoe UI;
        font-weight: bold;
        font-size: 60px;
        color: #ffffff;
        line-height: 99px;
        letter-spacing: 5px;
        text-align: left;
    }
    .en-title {
        position: absolute;
        left: 190px;
        top: 396px;
        width: 968px;
        height: 80px;
        font-family: Segoe UI, Segoe UI;
        font-weight: 600;
        font-size: 26px;
        color: #ffffff;
        line-height: 72px;
        letter-spacing: 3px;
        text-align: left;
    }
    .card-warp {
        position: absolute;
        top: 540px;
        left: 50%;
        display: flex;
        gap: 50px; /* 卡片间距 */
        z-index: 1;
        transform: translate(-50%, 0);
 
        .card {
            position: relative; /* 确保子元素绝对定位基于卡片 */
            width: 564px;
            height: 416px;
            cursor: pointer;
 
            .card-bg {
                width: 564px;
                height: 416px;
                border-radius: 8px; /* 可选:圆角效果 */
            }
 
            .hover-image {
                transform: scale(1.05);
            }
        }
    }
}
</style>