From d9d6fbdba66c4773ae606dcf9678c4a2d47e9b7d Mon Sep 17 00:00:00 2001 From: d266377 Date: Mon, 26 Jan 2026 17:32:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=80=81=E5=8A=BF=E6=84=9F=E7=9F=A5=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0-=E5=85=A8=E7=90=83=E5=BC=80=E6=BA=90=E9=A3=8E?= =?UTF-8?q?=E9=99=A9=E6=80=81=E5=8A=BF=E6=84=9F=E7=9F=A5=E7=9B=91=E6=8E=A7?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E6=83=85=E6=8A=A5=E6=B5=81=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Jyh/security/index.vue | 128 +------------------------------ 1 file changed, 3 insertions(+), 125 deletions(-) diff --git a/src/views/Jyh/security/index.vue b/src/views/Jyh/security/index.vue index e6ac874..1b76ad8 100644 --- a/src/views/Jyh/security/index.vue +++ b/src/views/Jyh/security/index.vue @@ -43,23 +43,7 @@ -
-

情报流

- -
-
-
- {{ item.type }} -
- {{ item.content }} -
-
-
-
-
+
@@ -127,6 +111,7 @@ import { usePageResize } from '@/utils/hooks/usePageResize'; import ThreatIntelMap from './components/ThreatIntelMap.vue'; import IndustryDistribution from './components/IndustryDistribution.vue'; import HighRiskComponentRank from './components/HighRiskComponentRank.vue'; +import IntelligenceFeed from './components/IntelligenceFeed.vue'; import StatsGlass from '@/views/Jyh/security/StatsGlass.vue'; // 页面尺寸响应式 @@ -146,33 +131,7 @@ const excellentProjects = ref([ { name: 'NextDenovo', desc: '高效且精确的长读长纠错与组装工具', org: '武汉希望组生物科技有限公司' } ]); -// 情报流数据 -const feedList = ref([ - { - type: 'CISA', - content: 'CISA KEV新增: WordPress 的 OneClick Chat to Order 插件,存在不安全的直接对象引用漏洞 (CVE-2025-13526) ' - }, - { - type: '投毒', - content: '投毒监控: npm 基建级包大规模投毒事件,影响chalk, debug, ansi-styles 等 18 个包' - }, - { - type: 'CNVD', - content: 'CNVD预警: Google Chrome信息泄露漏洞(CNVD-2025-3038304)' - }, - { - type: 'GitHub', - content: 'GitHub安全通告: MovableType 软件的 ContentType 页面 "编辑分类集" 功能存在存储型跨站脚本漏洞' - }, - { - type: '修复', - content: '漏洞修复: Node.js 发布 v20.11.0 版本,修复 3 个高危漏洞' - }, - { - type: '供应链', - content: '供应链预警: Maven 中央仓库发现 12 个伪造开源组件,包含后门程序' - } -]); + // 2. 2025武汉市优秀开源软件项目 const excellentProjects2025 = ref([ @@ -428,82 +387,7 @@ const chartInstances = ref<{ [key: string]: echarts.ECharts | null }>({ CVEChart: null }); -// ===================== 新增:列表自动滚动逻辑 ===================== -// 1. 定义滚动容器的ref -const scrollContainer1 = ref(null); // 第一个列表容器 -const scrollContainer2 = ref(null); // 第二个列表容器 -// 2. 存储定时器(键:1/2,值:定时器ID) -const scrollTimers: { [key: number]: NodeJS.Timeout | null } = { - 1: null, - 2: null -}; - -// 3. 滚动配置 -const scrollStep = 1; // 每次滚动的步长(像素,越小越流畅) -const scrollInterval = 20; // 滚动间隔(毫秒,越小越流畅) - -// 4. 通用自动滚动函数 -const autoScroll = (containerKey: number) => { - // 获取对应容器 - const container = containerKey === 1 ? scrollContainer1.value : scrollContainer2.value; - if (!container) return; - - // 获取列表内容元素(project-list) - const projectList = container.querySelector('.project-list') as HTMLDivElement; - if (!projectList) return; - - // 若内容高度 ≤ 容器高度,不执行滚动 - if (projectList.scrollHeight <= container.clientHeight) { - // 清除现有定时器 - if (scrollTimers[containerKey]) { - clearInterval(scrollTimers[containerKey]!); - scrollTimers[containerKey] = null; - } - return; - } - - // 清除现有定时器(避免重复) - if (scrollTimers[containerKey]) { - clearInterval(scrollTimers[containerKey]!); - } - - // 启动定时器滚动 - scrollTimers[containerKey] = setInterval(() => { - // 向下滚动步长 - container.scrollTop += scrollStep; - - // 滚动到底部时,重置为0(循环滚动) - // 加1是为了兼容像素精度问题 - if (projectList.scrollHeight - container.scrollTop <= container.clientHeight + 1) { - container.scrollTop = 0; // 直接重置(也可以用平滑滚动:container.scrollTo({ top: 0, behavior: 'smooth' })) - } - }, scrollInterval); -}; - -// 5. 暂停滚动 -const pauseScroll = (containerKey: number) => { - if (scrollTimers[containerKey]) { - clearInterval(scrollTimers[containerKey]!); - scrollTimers[containerKey] = null; - } -}; - -// 6. 恢复滚动 -const resumeScroll = (containerKey: number) => { - autoScroll(containerKey); -}; - -// 7. 组件卸载时清除所有定时器 -onUnmounted(() => { - Object.keys(scrollTimers).forEach(key => { - const k = Number(key); - if (scrollTimers[k]) { - clearInterval(scrollTimers[k]!); - scrollTimers[k] = null; - } - }); -}); // CVE视图切换方法 const switchCveView = (view: 'global' | 'regional') => { @@ -1148,18 +1032,12 @@ const initCharts = () => { // 页面resize时重绘图表 watch(widthType, () => { initCharts(); - // 重新启动滚动(防止resize后滚动失效) - autoScroll(1); - autoScroll(2); }); // 挂载时初始化 onMounted(() => { setTimeout(() => { initCharts(); - // 启动列表自动滚动 - autoScroll(1); - autoScroll(2); }, 100); });