批量更新

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"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <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" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>guanwang</title>
</head> </head>
<body> <body>
<div id="app"></div> <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: 页面 - 正常路由跳转 --> <!-- type 2: 页面 - 正常路由跳转 -->
<router-link <router-link
v-if="item.type === 2" v-if="item.type === 2"
:to="item.path" :to="getPath(item.path)"
class="menu-link" class="menu-link"
> >
{{ item.title }} {{ item.title }}
@ -30,7 +30,7 @@
<!-- type 4: 单页 - 跳转到单页路由 --> <!-- type 4: 单页 - 跳转到单页路由 -->
<router-link <router-link
v-else-if="item.type === 4" v-else-if="item.type === 4"
:to="item.path" :to="getPath(item.path)"
class="menu-link" class="menu-link"
> >
{{ item.title }} {{ item.title }}
@ -77,32 +77,29 @@
</div> </div>
<!-- 右侧三级菜单内容 --> <!-- 右侧三级菜单内容 -->
<div class="content-panel"> <div class="content-panel">
<div v-if="item.children[activeCategory || 0]"> <div v-if="getActiveChild(item)">
<div class="content-section11"> <div class="content-section11">
<div> <div>
<h3> <h3>
{{ item.children[activeCategory || 0].title }} {{ getActiveChild(item)?.title }}
</h3> </h3>
</div> </div>
<div class="content-grid"> <div class="content-grid">
<!-- 如果二级菜单有子菜单三级显示三级菜单 --> <!-- 如果二级菜单有子菜单三级显示三级菜单 -->
<template <template
v-if=" v-if="
item.children[activeCategory || 0].children && getActiveChild(item)?.children &&
item.children[activeCategory || 0].children getActiveChild(item)!.children!.length > 0
.length > 0
" "
> >
<template <template
v-for="(subItem, subIndex) in item.children[ v-for="(subItem, subIndex) in getActiveChild(item)!.children"
activeCategory || 0
].children"
:key="'sub-' + subIndex" :key="'sub-' + subIndex"
> >
<!-- type 2: 页面 - 正常路由跳转 --> <!-- type 2: 页面 - 正常路由跳转 -->
<router-link <router-link
v-if="subItem.type === 2" v-if="subItem.type === 2"
:to="subItem.path" :to="getPath(subItem.path)"
class="content-item" class="content-item"
> >
<div class="icon" v-if="subItem.icon"> <div class="icon" v-if="subItem.icon">
@ -116,7 +113,7 @@
<!-- type 4: 单页 - 跳转到单页路由 --> <!-- type 4: 单页 - 跳转到单页路由 -->
<router-link <router-link
v-else-if="subItem.type === 4" v-else-if="subItem.type === 4"
:to="subItem.path" :to="getPath(subItem.path)"
class="content-item" class="content-item"
> >
<div class="icon" v-if="subItem.icon"> <div class="icon" v-if="subItem.icon">
@ -169,97 +166,97 @@
<!-- type 2: 页面 - 正常路由跳转 --> <!-- type 2: 页面 - 正常路由跳转 -->
<router-link <router-link
v-if=" 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" class="content-item"
> >
<div <div
class="icon" class="icon"
v-if="item.children[activeCategory || 0].icon" v-if="getActiveChild(item)?.icon"
> >
<i <i
:class=" :class="
item.children[activeCategory || 0].icon getActiveChild(item)?.icon
" "
></i> ></i>
</div> </div>
<div class="content"> <div class="content">
<h4> <h4>
{{ item.children[activeCategory || 0].title }} {{ getActiveChild(item)?.title }}
</h4> </h4>
<p <p
v-if="item.children[activeCategory || 0].desc" v-if="getActiveChild(item)?.desc"
> >
{{ item.children[activeCategory || 0].desc }} {{ getActiveChild(item)?.desc }}
</p> </p>
</div> </div>
</router-link> </router-link>
<!-- type 4: 单页 - 跳转到单页路由 --> <!-- type 4: 单页 - 跳转到单页路由 -->
<router-link <router-link
v-else-if=" 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" class="content-item"
> >
<div <div
class="icon" class="icon"
v-if="item.children[activeCategory || 0].icon" v-if="getActiveChild(item)?.icon"
> >
<i <i
:class=" :class="
item.children[activeCategory || 0].icon getActiveChild(item)?.icon
" "
></i> ></i>
</div> </div>
<div class="content"> <div class="content">
<h4> <h4>
{{ item.children[activeCategory || 0].title }} {{ getActiveChild(item)?.title }}
</h4> </h4>
<p <p
v-if="item.children[activeCategory || 0].desc" v-if="getActiveChild(item)?.desc"
> >
{{ item.children[activeCategory || 0].desc }} {{ getActiveChild(item)?.desc }}
</p> </p>
</div> </div>
</router-link> </router-link>
<!-- type 3: 外链 - 直接打开外链 --> <!-- type 3: 外链 - 直接打开外链 -->
<a <a
v-else-if=" v-else-if="
item.children[activeCategory || 0].type === 3 && getActiveChild(item)?.type === 3 &&
item.children[activeCategory || 0].link_url getActiveChild(item)?.link_url
" "
:href=" :href="
item.children[activeCategory || 0].link_url getActiveChild(item)?.link_url
" "
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
class="content-item" class="content-item"
@click.prevent=" @click.prevent="
handleExternalLink( handleExternalLink(
item.children[activeCategory || 0].link_url, getLink(getActiveChild(item)?.link_url),
) )
" "
> >
<div <div
class="icon" class="icon"
v-if="item.children[activeCategory || 0].icon" v-if="getActiveChild(item)?.icon"
> >
<i <i
:class=" :class="
item.children[activeCategory || 0].icon getActiveChild(item)?.icon
" "
></i> ></i>
</div> </div>
<div class="content"> <div class="content">
<h4> <h4>
{{ item.children[activeCategory || 0].title }} {{ getActiveChild(item)?.title }}
</h4> </h4>
<p <p
v-if="item.children[activeCategory || 0].desc" v-if="getActiveChild(item)?.desc"
> >
{{ item.children[activeCategory || 0].desc }} {{ getActiveChild(item)?.desc }}
</p> </p>
</div> </div>
</a> </a>
@ -271,22 +268,22 @@
> >
<div <div
class="icon" class="icon"
v-if="item.children[activeCategory || 0].icon" v-if="getActiveChild(item)?.icon"
> >
<i <i
:class=" :class="
item.children[activeCategory || 0].icon getActiveChild(item)?.icon
" "
></i> ></i>
</div> </div>
<div class="content"> <div class="content">
<h4> <h4>
{{ item.children[activeCategory || 0].title }} {{ getActiveChild(item)?.title }}
</h4> </h4>
<p <p
v-if="item.children[activeCategory || 0].desc" v-if="getActiveChild(item)?.desc"
> >
{{ item.children[activeCategory || 0].desc }} {{ getActiveChild(item)?.desc }}
</p> </p>
</div> </div>
</div> </div>
@ -366,14 +363,36 @@
import { ref, onMounted, onUnmounted } from 'vue' import { ref, onMounted, onUnmounted } from 'vue'
import { getHeadMenu,getFooterData } from '@/api/index' 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) => { const normalizeMenuPaths = (menus: MenuItem[]): MenuItem[] => {
return menus.map(menu => { return menus.map((menu: MenuItem) => {
const normalizedMenu = { ...menu } const normalizedMenu = { ...menu }
// /newscenter/ /newsCenter/ // /newscenter/ /newsCenter/
if (normalizedMenu.path) { if (normalizedMenu.path) {
@ -413,15 +432,15 @@ const getenvurl = (url: string) => {
return `${normalizedBase}/${normalizedUrl}` return `${normalizedBase}/${normalizedUrl}`
} }
const activeMenu = ref(null) const activeMenu = ref<number | null>(null)
const activeCategory = ref(0) const activeCategory = ref<number>(0)
const showSearch = ref(false) const showSearch = ref(false)
const showLanguage = ref(false) const showLanguage = ref(false)
const searchQuery = ref('') const searchQuery = ref('')
const currentLanguage = ref('zh') const currentLanguage = ref('zh')
const isScrolled = ref(false) const isScrolled = ref(false)
const footerData = ref<any | null>(null) const footerData = ref<any | null>(null)
let closeTimer = null let closeTimer: ReturnType<typeof setTimeout> | null = null
const handleScroll = () => { const handleScroll = () => {
isScrolled.value = window.scrollY > 10 isScrolled.value = window.scrollY > 10
@ -434,13 +453,29 @@ const performSearch = () => {
} }
} }
const changeLanguage = (lang) => { const changeLanguage = (lang: string) => {
currentLanguage.value = lang currentLanguage.value = lang
showLanguage.value = false showLanguage.value = false
console.log('Language changed to:', lang) 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) { if (closeTimer) {
clearTimeout(closeTimer) clearTimeout(closeTimer)
@ -459,7 +494,7 @@ const handleMenuLeave = () => {
} }
// //
const handleExternalLink = (url) => { const handleExternalLink = (url: string) => {
if (url) { if (url) {
// URL // URL
const fullUrl = const fullUrl =

View File

@ -55,7 +55,7 @@
</Swiper> </Swiper>
</div> </div>
<!-- 头条 --> <!-- 头条 -->
<div class="topnews"> <!-- <div class="topnews">
<div class="content"> <div class="content">
<div class="left"> <div class="left">
<span><i class="fas fa-volume-down"></i></span> <span><i class="fas fa-volume-down"></i></span>
@ -69,7 +69,7 @@
<span class="more" @click="handleMoreNewsClick">more news</span> <span class="more" @click="handleMoreNewsClick">more news</span>
</div> </div>
</div> </div>
</div> </div> -->
<main class="content-container"> <main class="content-container">
<!-- 站点资讯 --> <!-- 站点资讯 -->
@ -425,10 +425,6 @@ onMounted(() => {
}) })
onUnmounted(() => stopAutoScroll()) onUnmounted(() => stopAutoScroll())
const handleMoreNewsClick = () => {
// console.log('more news clicked')
}
const partnerImages = ref<any[]>([]) const partnerImages = ref<any[]>([])
// TODO // TODO
@ -512,7 +508,7 @@ onUnmounted(() => {
.banner { .banner {
position: relative; position: relative;
width: 100%; width: 100%;
height: 740px; height: 500px;
overflow: hidden; overflow: hidden;
.swiper-banner { .swiper-banner {

View File

@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue' 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 Footer from '@/views/components/footer.vue'
import { VideoPlay } from '@element-plus/icons-vue' import { VideoPlay } from '@element-plus/icons-vue'