批量更新
This commit is contained in:
parent
e9a051520e
commit
50f34beab9
@ -2,9 +2,8 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<link rel="icon" type="image/svg+xml" href="/src/assets/logo.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>guanwang</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
1
src/assets/logo.svg
Normal file
1
src/assets/logo.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400" viewBox="0 0 400 400" fill="none"><path d="M77.08 90L15 90L89.64 239.51L89.64 310L145.07 310L145.07 239.51L196.406 137.69L275.435 137.69L203.574 276.92L203.574 310L386.005 310L386.005 262.31L272.464 262.31L345.085 123.08L345.085 90L157.64 90L116.99 180.63L77.08 90Z" fill-rule="evenodd" fill="#000000" ></path></svg>
|
||||
|
After Width: | Height: | Size: 425 B |
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>
|
||||
|
Before Width: | Height: | Size: 496 B |
@ -22,7 +22,7 @@
|
||||
<!-- type 2: 页面 - 正常路由跳转 -->
|
||||
<router-link
|
||||
v-if="item.type === 2"
|
||||
:to="item.path"
|
||||
:to="getPath(item.path)"
|
||||
class="menu-link"
|
||||
>
|
||||
{{ item.title }}
|
||||
@ -30,7 +30,7 @@
|
||||
<!-- type 4: 单页 - 跳转到单页路由 -->
|
||||
<router-link
|
||||
v-else-if="item.type === 4"
|
||||
:to="item.path"
|
||||
:to="getPath(item.path)"
|
||||
class="menu-link"
|
||||
>
|
||||
{{ item.title }}
|
||||
@ -77,32 +77,29 @@
|
||||
</div>
|
||||
<!-- 右侧:三级菜单内容 -->
|
||||
<div class="content-panel">
|
||||
<div v-if="item.children[activeCategory || 0]">
|
||||
<div v-if="getActiveChild(item)">
|
||||
<div class="content-section11">
|
||||
<div>
|
||||
<h3>
|
||||
{{ item.children[activeCategory || 0].title }}
|
||||
{{ getActiveChild(item)?.title }}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="content-grid">
|
||||
<!-- 如果二级菜单有子菜单(三级),显示三级菜单 -->
|
||||
<template
|
||||
v-if="
|
||||
item.children[activeCategory || 0].children &&
|
||||
item.children[activeCategory || 0].children
|
||||
.length > 0
|
||||
getActiveChild(item)?.children &&
|
||||
getActiveChild(item)!.children!.length > 0
|
||||
"
|
||||
>
|
||||
<template
|
||||
v-for="(subItem, subIndex) in item.children[
|
||||
activeCategory || 0
|
||||
].children"
|
||||
v-for="(subItem, subIndex) in getActiveChild(item)!.children"
|
||||
:key="'sub-' + subIndex"
|
||||
>
|
||||
<!-- type 2: 页面 - 正常路由跳转 -->
|
||||
<router-link
|
||||
v-if="subItem.type === 2"
|
||||
:to="subItem.path"
|
||||
:to="getPath(subItem.path)"
|
||||
class="content-item"
|
||||
>
|
||||
<div class="icon" v-if="subItem.icon">
|
||||
@ -116,7 +113,7 @@
|
||||
<!-- type 4: 单页 - 跳转到单页路由 -->
|
||||
<router-link
|
||||
v-else-if="subItem.type === 4"
|
||||
:to="subItem.path"
|
||||
:to="getPath(subItem.path)"
|
||||
class="content-item"
|
||||
>
|
||||
<div class="icon" v-if="subItem.icon">
|
||||
@ -169,97 +166,97 @@
|
||||
<!-- type 2: 页面 - 正常路由跳转 -->
|
||||
<router-link
|
||||
v-if="
|
||||
item.children[activeCategory || 0].type === 2
|
||||
getActiveChild(item)?.type === 2
|
||||
"
|
||||
:to="item.children[activeCategory || 0].path"
|
||||
:to="getPath(getActiveChild(item)?.path)"
|
||||
class="content-item"
|
||||
>
|
||||
<div
|
||||
class="icon"
|
||||
v-if="item.children[activeCategory || 0].icon"
|
||||
v-if="getActiveChild(item)?.icon"
|
||||
>
|
||||
<i
|
||||
:class="
|
||||
item.children[activeCategory || 0].icon
|
||||
getActiveChild(item)?.icon
|
||||
"
|
||||
></i>
|
||||
</div>
|
||||
<div class="content">
|
||||
<h4>
|
||||
{{ item.children[activeCategory || 0].title }}
|
||||
{{ getActiveChild(item)?.title }}
|
||||
</h4>
|
||||
<p
|
||||
v-if="item.children[activeCategory || 0].desc"
|
||||
v-if="getActiveChild(item)?.desc"
|
||||
>
|
||||
{{ item.children[activeCategory || 0].desc }}
|
||||
{{ getActiveChild(item)?.desc }}
|
||||
</p>
|
||||
</div>
|
||||
</router-link>
|
||||
<!-- type 4: 单页 - 跳转到单页路由 -->
|
||||
<router-link
|
||||
v-else-if="
|
||||
item.children[activeCategory || 0].type === 4
|
||||
getActiveChild(item)?.type === 4
|
||||
"
|
||||
:to="item.children[activeCategory || 0].path"
|
||||
:to="getPath(getActiveChild(item)?.path)"
|
||||
class="content-item"
|
||||
>
|
||||
<div
|
||||
class="icon"
|
||||
v-if="item.children[activeCategory || 0].icon"
|
||||
v-if="getActiveChild(item)?.icon"
|
||||
>
|
||||
<i
|
||||
:class="
|
||||
item.children[activeCategory || 0].icon
|
||||
getActiveChild(item)?.icon
|
||||
"
|
||||
></i>
|
||||
</div>
|
||||
<div class="content">
|
||||
<h4>
|
||||
{{ item.children[activeCategory || 0].title }}
|
||||
{{ getActiveChild(item)?.title }}
|
||||
</h4>
|
||||
<p
|
||||
v-if="item.children[activeCategory || 0].desc"
|
||||
v-if="getActiveChild(item)?.desc"
|
||||
>
|
||||
{{ item.children[activeCategory || 0].desc }}
|
||||
{{ getActiveChild(item)?.desc }}
|
||||
</p>
|
||||
</div>
|
||||
</router-link>
|
||||
<!-- type 3: 外链 - 直接打开外链 -->
|
||||
<a
|
||||
v-else-if="
|
||||
item.children[activeCategory || 0].type === 3 &&
|
||||
item.children[activeCategory || 0].link_url
|
||||
getActiveChild(item)?.type === 3 &&
|
||||
getActiveChild(item)?.link_url
|
||||
"
|
||||
:href="
|
||||
item.children[activeCategory || 0].link_url
|
||||
getActiveChild(item)?.link_url
|
||||
"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="content-item"
|
||||
@click.prevent="
|
||||
handleExternalLink(
|
||||
item.children[activeCategory || 0].link_url,
|
||||
getLink(getActiveChild(item)?.link_url),
|
||||
)
|
||||
"
|
||||
>
|
||||
<div
|
||||
class="icon"
|
||||
v-if="item.children[activeCategory || 0].icon"
|
||||
v-if="getActiveChild(item)?.icon"
|
||||
>
|
||||
<i
|
||||
:class="
|
||||
item.children[activeCategory || 0].icon
|
||||
getActiveChild(item)?.icon
|
||||
"
|
||||
></i>
|
||||
</div>
|
||||
<div class="content">
|
||||
<h4>
|
||||
{{ item.children[activeCategory || 0].title }}
|
||||
{{ getActiveChild(item)?.title }}
|
||||
</h4>
|
||||
<p
|
||||
v-if="item.children[activeCategory || 0].desc"
|
||||
v-if="getActiveChild(item)?.desc"
|
||||
>
|
||||
{{ item.children[activeCategory || 0].desc }}
|
||||
{{ getActiveChild(item)?.desc }}
|
||||
</p>
|
||||
</div>
|
||||
</a>
|
||||
@ -271,22 +268,22 @@
|
||||
>
|
||||
<div
|
||||
class="icon"
|
||||
v-if="item.children[activeCategory || 0].icon"
|
||||
v-if="getActiveChild(item)?.icon"
|
||||
>
|
||||
<i
|
||||
:class="
|
||||
item.children[activeCategory || 0].icon
|
||||
getActiveChild(item)?.icon
|
||||
"
|
||||
></i>
|
||||
</div>
|
||||
<div class="content">
|
||||
<h4>
|
||||
{{ item.children[activeCategory || 0].title }}
|
||||
{{ getActiveChild(item)?.title }}
|
||||
</h4>
|
||||
<p
|
||||
v-if="item.children[activeCategory || 0].desc"
|
||||
v-if="getActiveChild(item)?.desc"
|
||||
>
|
||||
{{ item.children[activeCategory || 0].desc }}
|
||||
{{ getActiveChild(item)?.desc }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -366,14 +363,36 @@
|
||||
import { ref, onMounted, onUnmounted } from 'vue'
|
||||
import { getHeadMenu,getFooterData } from '@/api/index'
|
||||
|
||||
// 定义菜单子项接口
|
||||
interface MenuChild {
|
||||
id: number
|
||||
title: string
|
||||
path?: string
|
||||
link_url?: string
|
||||
type: number
|
||||
icon?: string
|
||||
desc?: string
|
||||
children?: MenuChild[]
|
||||
}
|
||||
|
||||
// 定义菜单项接口
|
||||
interface MenuItem {
|
||||
id: number
|
||||
title: string
|
||||
path?: string
|
||||
link_url?: string
|
||||
type: number
|
||||
icon?: string
|
||||
desc?: string
|
||||
children?: MenuChild[]
|
||||
}
|
||||
|
||||
// 菜单数据
|
||||
const menuItems = ref([])
|
||||
const menuItems = ref<MenuItem[]>([])
|
||||
|
||||
// 统一处理菜单路径大小写
|
||||
const normalizeMenuPaths = (menus) => {
|
||||
return menus.map(menu => {
|
||||
const normalizeMenuPaths = (menus: MenuItem[]): MenuItem[] => {
|
||||
return menus.map((menu: MenuItem) => {
|
||||
const normalizedMenu = { ...menu }
|
||||
// 将路径中的 /newscenter/ 替换为 /newsCenter/
|
||||
if (normalizedMenu.path) {
|
||||
@ -413,15 +432,15 @@ const getenvurl = (url: string) => {
|
||||
return `${normalizedBase}/${normalizedUrl}`
|
||||
}
|
||||
|
||||
const activeMenu = ref(null)
|
||||
const activeCategory = ref(0)
|
||||
const activeMenu = ref<number | null>(null)
|
||||
const activeCategory = ref<number>(0)
|
||||
const showSearch = ref(false)
|
||||
const showLanguage = ref(false)
|
||||
const searchQuery = ref('')
|
||||
const currentLanguage = ref('zh')
|
||||
const isScrolled = ref(false)
|
||||
const footerData = ref<any | null>(null)
|
||||
let closeTimer = null
|
||||
let closeTimer: ReturnType<typeof setTimeout> | null = null
|
||||
|
||||
const handleScroll = () => {
|
||||
isScrolled.value = window.scrollY > 10
|
||||
@ -434,13 +453,29 @@ const performSearch = () => {
|
||||
}
|
||||
}
|
||||
|
||||
const changeLanguage = (lang) => {
|
||||
const changeLanguage = (lang: string) => {
|
||||
currentLanguage.value = lang
|
||||
showLanguage.value = false
|
||||
console.log('Language changed to:', lang)
|
||||
}
|
||||
|
||||
const handleMenuEnter = (index) => {
|
||||
// 获取当前激活的子菜单(用于模板中)
|
||||
const getActiveChild = (item: MenuItem): MenuChild | null => {
|
||||
if (!item.children || item.children.length === 0) return null
|
||||
return item.children[activeCategory.value] || item.children[0] || null
|
||||
}
|
||||
|
||||
// 安全获取路径
|
||||
const getPath = (path: string | undefined): string => {
|
||||
return path || '/'
|
||||
}
|
||||
|
||||
// 安全获取链接
|
||||
const getLink = (link: string | undefined): string => {
|
||||
return link || ''
|
||||
}
|
||||
|
||||
const handleMenuEnter = (index: number) => {
|
||||
// 清除关闭定时器
|
||||
if (closeTimer) {
|
||||
clearTimeout(closeTimer)
|
||||
@ -459,7 +494,7 @@ const handleMenuLeave = () => {
|
||||
}
|
||||
|
||||
// 处理外链跳转
|
||||
const handleExternalLink = (url) => {
|
||||
const handleExternalLink = (url: string) => {
|
||||
if (url) {
|
||||
// 确保 URL 是完整的(包含协议)
|
||||
const fullUrl =
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
</Swiper>
|
||||
</div>
|
||||
<!-- 头条 -->
|
||||
<div class="topnews">
|
||||
<!-- <div class="topnews">
|
||||
<div class="content">
|
||||
<div class="left">
|
||||
<span><i class="fas fa-volume-down"></i></span>
|
||||
@ -69,7 +69,7 @@
|
||||
<span class="more" @click="handleMoreNewsClick">more news</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<main class="content-container">
|
||||
<!-- 站点资讯 -->
|
||||
@ -425,10 +425,6 @@ onMounted(() => {
|
||||
})
|
||||
onUnmounted(() => stopAutoScroll())
|
||||
|
||||
const handleMoreNewsClick = () => {
|
||||
// console.log('more news clicked')
|
||||
}
|
||||
|
||||
const partnerImages = ref<any[]>([])
|
||||
|
||||
// TODO 改为接口读取图片文件
|
||||
@ -512,7 +508,7 @@ onUnmounted(() => {
|
||||
.banner {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 740px;
|
||||
height: 500px;
|
||||
overflow: hidden;
|
||||
|
||||
.swiper-banner {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import Header from '@/views/components/header.
|
||||
import Header from '@/views/components/header.vue'
|
||||
import Footer from '@/views/components/footer.vue'
|
||||
import { VideoPlay } from '@element-plus/icons-vue'
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user