批量更新

This commit is contained in:
李志强 2026-02-24 10:12:01 +08:00
parent e9a051520e
commit 50f34beab9
6 changed files with 90 additions and 60 deletions

View File

@ -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
View 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

View File

@ -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

View File

@ -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 =

View File

@ -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 {

View File

@ -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'