Jelajahi Sumber

feat:new home&dynamic&association

0235624 2 minggu lalu
induk
melakukan
7687c8ebff

+ 3 - 2
travel-web/src/app/app.routes.ts

@@ -9,10 +9,11 @@ export const routes: Routes = [
       {
         path: 'home',
         loadComponent: () => import('../modules/pc-home/pages/page-home/page-home').then(m => m.PageHome)
+
       },
       {
         path: 'dynamic',
-        loadComponent: () => import('../modules/pc-home/pages/page-dynamic/page-dynamic.component').then(m => m.PageDynamicComponent)
+        loadComponent: () => import('../modules/pc-home/pages/page-dynamic/page-dynamic').then(m => m.PageDynamic)
       },
        {
         path: 'creation',
@@ -20,7 +21,7 @@ export const routes: Routes = [
       },
       {
         path: 'association',
-        loadComponent: () => import('../modules/pc-home/pages/page-association/page-association.component').then(m => m.PageAssociationComponent)
+        loadComponent: () => import('../modules/pc-home/pages/page-association/page-association').then(m => m.PageAssociation)
       },
       {
         path: 'us',

+ 17 - 37
travel-web/src/modules/pc-home/pages/page-association/page-association.component.html → travel-web/src/modules/pc-home/pages/page-association/page-association.html

@@ -54,8 +54,8 @@
   
   <div class="constitution-container">
     <div class="search-box">
-      <input type="text" class="search-input" [(ngModel)]="searchTerm" placeholder="输入关键词检索协会章程 (如:红色文化、会员权利...)">
-      <button class="search-btn" (click)="highlightText()"><i class="fas fa-search"></i> 智能检索</button>
+      <input #searchInput type="text" class="search-input" placeholder="输入关键词检索协会章程 (如:红色文化、会员权利...)" (keyup.enter)="highlightSearch(searchInput.value)">
+      <button class="search-btn" (click)="highlightSearch(searchInput.value)"><i class="fas fa-search"></i> 智能检索</button>
     </div>
     <div class="constitution-content">
       <h3>江西省数字文化发展协会章程</h3>
@@ -122,42 +122,22 @@
           <div class="version-card">
             <h5 class="version-title">2021版</h5>
             <div class="version-content">
-              <p>1. 数字资源采集应遵循真实性原则,确保<span class="diff-highlight" 
-                 (mouseenter)="highlightDifferences('diff-highlight')"
-                 (mouseleave)="resetHighlights()">内容准确</span>。</p>
-              <p>2. 图像采集分辨率不低于<span class="diff-highlight"
-                 (mouseenter)="highlightDifferences('diff-highlight')"
-                 (mouseleave)="resetHighlights()">300dpi</span>。</p>
-              <p>3. 音频采集采样率不低于<span class="diff-highlight"
-                 (mouseenter)="highlightDifferences('diff-highlight')"
-                 (mouseleave)="resetHighlights()">44.1kHz</span>。</p>
-              <p>4. 视频采集分辨率不低于<span class="diff-highlight"
-                 (mouseenter)="highlightDifferences('diff-highlight')"
-                 (mouseleave)="resetHighlights()">1080p</span>。</p>
-              <p>5. 三维模型采集精度不低于<span class="diff-highlight"
-                 (mouseenter)="highlightDifferences('diff-highlight')"
-                 (mouseleave)="resetHighlights()">0.5mm</span>。</p>
+              <p>1. 数字资源采集应遵循真实性原则,确保<span class="diff-highlight" (mousedown)="highlightVersion($event, 'diff')">内容准确</span>。</p>
+              <p>2. 图像采集分辨率不低于<span class="diff-highlight" (mousedown)="highlightVersion($event, 'diff')">300dpi</span>。</p>
+              <p>3. 音频采集采样率不低于<span class="diff-highlight" (mousedown)="highlightVersion($event, 'diff')">44.1kHz</span>。</p>
+              <p>4. 视频采集分辨率不低于<span class="diff-highlight" (mousedown)="highlightVersion($event, 'diff')">1080p</span>。</p>
+              <p>5. 三维模型采集精度不低于<span class="diff-highlight" (mousedown)="highlightVersion($event, 'diff')">0.5mm</span>。</p>
             </div>
           </div>
           
           <div class="version-card">
             <h5 class="version-title">2023版</h5>
             <div class="version-content">
-              <p>1. 数字资源采集应遵循真实性、完整性原则,确保<span class="new-highlight"
-                 (mouseenter)="highlightDifferences('new-highlight')"
-                 (mouseleave)="resetHighlights()">内容准确且完整呈现文化背景</span>。</p>
-              <p>2. 图像采集分辨率不低于<span class="new-highlight"
-                 (mouseenter)="highlightDifferences('new-highlight')"
-                 (mouseleave)="resetHighlights()">600dpi,重要文物需达1200dpi</span>。</p>
-              <p>3. 音频采集采样率不低于<span class="new-highlight"
-                 (mouseenter)="highlightDifferences('new-highlight')"
-                 (mouseleave)="resetHighlights()">48kHz,推荐使用96kHz</span>。</p>
-              <p>4. 视频采集分辨率不低于<span class="new-highlight"
-                 (mouseenter)="highlightDifferences('new-highlight')"
-                 (mouseleave)="resetHighlights()">4K,重要场景需8K</span>。</p>
-              <p>5. 三维模型采集精度不低于<span class="new-highlight"
-                 (mouseenter)="highlightDifferences('new-highlight')"
-                 (mouseleave)="resetHighlights()">0.1mm,重要结构需达0.01mm</span>。</p>
+              <p>1. 数字资源采集应遵循真实性、完整性原则,确保<span class="new-highlight" (mousedown)="highlightVersion($event, 'new')">内容准确且完整呈现文化背景</span>。</p>
+              <p>2. 图像采集分辨率不低于<span class="new-highlight" (mousedown)="highlightVersion($event, 'new')">600dpi,重要文物需达1200dpi</span>。</p>
+              <p>3. 音频采集采样率不低于<span class="new-highlight" (mousedown)="highlightVersion($event, 'new')">48kHz,推荐使用96kHz</span>。</p>
+              <p>4. 视频采集分辨率不低于<span class="new-highlight" (mousedown)="highlightVersion($event, 'new')">4K,重要场景需8K</span>。</p>
+              <p>5. 三维模型采集精度不低于<span class="new-highlight" (mousedown)="highlightVersion($event, 'new')">0.1mm,重要结构需达0.01mm</span>。</p>
             </div>
           </div>
         </div>
@@ -202,14 +182,14 @@
         <p>已上线课程</p>
         
         <div class="courses">
-          <div class="course-card" *ngFor="let course of courses">
+          <div *ngFor="let course of courses" class="course-card">
             <div class="course-img"></div>
             <div class="course-content">
-              <h5 class="course-title">智慧旅游系统设计</h5>
-              <p>学习旅游动线策划与智能导览系统开发</p>
+              <h5 class="course-title">{{course.title}}</h5>
+              <p>{{course.description}}</p>
               <div class="course-meta">
-                <span><i class="fas fa-clock"></i> 28课时</span>
-                <span><i class="fas fa-user-graduate"></i> 已报名 875人</span>
+                <span><i class="fas fa-clock"></i> {{course.duration}}</span>
+                <span><i class="fas fa-user-graduate"></i> 已报名 {{course.students}}</span>
               </div>
             </div>
           </div>

+ 0 - 0
travel-web/src/modules/pc-home/pages/page-association/page-association.component.scss → travel-web/src/modules/pc-home/pages/page-association/page-association.scss


+ 5 - 5
travel-web/src/modules/pc-home/pages/page-association/page-association.spec.ts

@@ -1,18 +1,18 @@
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 
-import { PageAssociationComponent } from './page-association.component';
+import { PageAssociation } from './page-association';
 
 describe('PageAssociation', () => {
-  let component: PageAssociationComponent;
-  let fixture: ComponentFixture<PageAssociationComponent>;
+  let component: PageAssociation;
+  let fixture: ComponentFixture<PageAssociation>;
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      imports: [PageAssociationComponent]
+      imports: [PageAssociation]
     })
     .compileComponents();
 
-    fixture = TestBed.createComponent(PageAssociationComponent);
+    fixture = TestBed.createComponent(PageAssociation);
     component = fixture.componentInstance;
     fixture.detectChanges();
   });

+ 4 - 4
travel-web/src/modules/pc-home/pages/page-association/page-association.component.ts → travel-web/src/modules/pc-home/pages/page-association/page-association.ts

@@ -3,13 +3,13 @@ import { CommonModule } from '@angular/common';
 import * as echarts from 'echarts';
 
 @Component({
-  selector: 'app-page-association.component',
+  selector: 'app-page-association',
   standalone: true,
   imports: [CommonModule],
-  templateUrl: './page-association.component.html',
-  styleUrls: ['./page-association.component.scss']
+  templateUrl: './page-association.html',
+  styleUrls: ['./page-association.scss']
 })
-export class PageAssociationComponent implements AfterViewInit {
+export class PageAssociation implements AfterViewInit {
   @ViewChild('orgChart') orgChartElement!: ElementRef;
   @ViewChild('academicCalendar') academicCalendarElement!: ElementRef;
 

+ 3 - 2
travel-web/src/modules/pc-home/pages/page-co-creation/page-co-creation.ts

@@ -2,9 +2,10 @@ import { Component } from '@angular/core';
 
 @Component({
   selector: 'app-page-co-creation',
+   imports: [],
   templateUrl: './page-co-creation.html',
-  styleUrls: ['./page-co-creation.scss']
+  styleUrl: './page-co-creation.scss'
 })
 export class PageCoCreation {
-  // You can add component logic here if needed
+  
 }

+ 0 - 0
travel-web/src/modules/pc-home/pages/page-dynamic/page-dynamic.component.html → travel-web/src/modules/pc-home/pages/page-dynamic/page-dynamic.html


+ 0 - 0
travel-web/src/modules/pc-home/pages/page-dynamic/page-dynamic.component.scss → travel-web/src/modules/pc-home/pages/page-dynamic/page-dynamic.scss


+ 5 - 5
travel-web/src/modules/pc-home/pages/page-dynamic/page-dynamic.spec.ts

@@ -1,18 +1,18 @@
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 
-import {  PageDynamicComponent } from './page-dynamic.component';
+import {  PageDynamic } from './page-dynamic';
 
 describe('PageDynamic', () => {
-  let component: PageDynamicComponent;
-  let fixture: ComponentFixture<PageDynamicComponent>;
+  let component: PageDynamic;
+  let fixture: ComponentFixture<PageDynamic>;
 
   beforeEach(async () => {
     await TestBed.configureTestingModule({
-      imports: [PageDynamicComponent]
+      imports: [PageDynamic]
     })
     .compileComponents();
 
-    fixture = TestBed.createComponent(PageDynamicComponent);
+    fixture = TestBed.createComponent(PageDynamic);
     component = fixture.componentInstance;
     fixture.detectChanges();
   });

+ 3 - 3
travel-web/src/modules/pc-home/pages/page-dynamic/page-dynamic.component.ts → travel-web/src/modules/pc-home/pages/page-dynamic/page-dynamic.ts

@@ -5,11 +5,11 @@ import { FormsModule } from '@angular/forms';
 @Component({
   selector: 'app-page-dynamic',
   standalone: true,
-  templateUrl: './page-dynamic.component.html',
-  styleUrls: ['./page-dynamic.component.scss'],
+  templateUrl: './page-dynamic.html',
+  styleUrls: ['./page-dynamic.scss'],
   imports: [FormsModule]
 })
-export class PageDynamicComponent implements AfterViewInit {
+export class PageDynamic implements AfterViewInit {
   isOcrSuccess: boolean | null = null;
   activeLanterns = false;
   isProcessing = false;

+ 16 - 68
travel-web/src/modules/pc-home/pages/page-home/page-home.html

@@ -1,7 +1,8 @@
+<!-- page-home.component.html -->
 <!-- Banner区域 -->
 <section class="banner-section">
   <!-- Swiper轮播图 -->
-  <div class="swiper-container">
+  <div class="swiper-container" #swiperContainer>
     <div class="swiper-wrapper">
       <div class="swiper-slide">
         <img src="assets/images/photo-1542662565-7e4b66bae529.avif" alt="庐山云海奇观">
@@ -63,25 +64,9 @@
         <h3>新闻动态</h3>
       </div>
       <div class="card-body">
-        <div class="news-item">
-          <div class="news-date">06-25</div>
-          <div class="news-title">"数字赋能非遗传承"研讨会在南昌成功举办</div>
-        </div>
-        <div class="news-item">
-          <div class="news-date">06-22</div>
-          <div class="news-title">江西文旅厅推出"云游江西"智慧旅游平台</div>
-        </div>
-        <div class="news-item">
-          <div class="news-date">06-18</div>
-          <div class="news-title">景德镇陶瓷数字化博物馆正式对外开放</div>
-        </div>
-        <div class="news-item">
-          <div class="news-date">06-15</div>
-          <div class="news-title">赣南采茶戏数字化保护工程启动</div>
-        </div>
-        <div class="news-item">
-          <div class="news-date">06-12</div>
-          <div class="news-title">庐山智慧景区建设取得阶段性成果</div>
+        <div class="news-item" *ngFor="let item of news">
+          <div class="news-date">{{item.date}}</div>
+          <div class="news-title">{{item.title}}</div>
         </div>
       </div>
     </div>
@@ -92,25 +77,9 @@
         <h3>文件传达</h3>
       </div>
       <div class="card-body">
-        <div class="news-item">
-          <div class="news-date">06-24</div>
-          <div class="news-title">《江西省数字文化产业发展规划》正式发布</div>
-        </div>
-        <div class="news-item">
-          <div class="news-date">06-20</div>
-          <div class="news-title">关于征集2023年度文化数字化项目的通知</div>
-        </div>
-        <div class="news-item">
-          <div class="news-date">06-17</div>
-          <div class="news-title">非遗数字化保护技术标准(试行版)</div>
-        </div>
-        <div class="news-item">
-          <div class="news-date">06-10</div>
-          <div class="news-title">文化数据资产登记与交易管理办法</div>
-        </div>
-        <div class="news-item">
-          <div class="news-date">06-05</div>
-          <div class="news-title">智慧旅游景区建设指南(2023版)</div>
+        <div class="news-item" *ngFor="let item of files">
+          <div class="news-date">{{item.date}}</div>
+          <div class="news-title">{{item.title}}</div>
         </div>
       </div>
     </div>
@@ -121,25 +90,9 @@
         <h3>学术前沿</h3>
       </div>
       <div class="card-body">
-        <div class="news-item">
-          <div class="news-date">06-23</div>
-          <div class="news-title">基于知识图谱的江西红色文化资源挖掘研究</div>
-        </div>
-        <div class="news-item">
-          <div class="news-date">06-19</div>
-          <div class="news-title">VR技术在古村落数字化保护中的应用探索</div>
-        </div>
-        <div class="news-item">
-          <div class="news-date">06-16</div>
-          <div class="news-title">区块链在非遗传承人认证体系中的实践</div>
-        </div>
-        <div class="news-item">
-          <div class="news-date">06-11</div>
-          <div class="news-title">AIGC在地方文化IP创作中的创新应用</div>
-        </div>
-        <div class="news-item">
-          <div class="news-date">06-08</div>
-          <div class="news-title">数字孪生技术在历史文化建筑保护中的实践</div>
+        <div class="news-item" *ngFor="let item of research">
+          <div class="news-date">{{item.date}}</div>
+          <div class="news-title">{{item.title}}</div>
         </div>
       </div>
     </div>
@@ -161,7 +114,7 @@
       </div>
       <div class="showcase-body">
         <p>展示由AI生成的文化创意作品,融合江西传统元素与现代设计</p>
-        <div class="chart-container" id="galleryChart"></div>
+        <div class="chart-container" #galleryChart></div>
       </div>
     </div>
     
@@ -173,12 +126,7 @@
       <div class="showcase-body">
         <p>最新文旅IP孵化排行,助力乡村振兴与文化传播</p>
         <ul class="ip-list">
-          <li>景德镇陶瓷青年计划</li>
-          <li>婺源油菜花艺术节</li>
-          <li>庐山云雾茶文化IP</li>
-          <li>赣南脐橙助农计划</li>
-          <li>鄱阳湖生态旅游IP</li>
-          <li>井冈山红色研学IP</li>
+          <li *ngFor="let ip of ipList">{{ip}}</li>
         </ul>
       </div>
     </div>
@@ -190,7 +138,7 @@
       </div>
       <div class="showcase-body">
         <p>沉浸式体验江西文化遗产,360°全景展示</p>
-        <div class="chart-container" id="xrChart"></div>
+        <div class="chart-container" #xrChart></div>
       </div>
     </div>
   </div>
@@ -226,7 +174,7 @@
         <h3>数据看板</h3>
       </div>
       <div class="dashboard-body">
-        <div class="chart-container" id="dashboardChart"></div>
+        <div class="chart-container" #dashboardChart></div>
       </div>
     </div>
   </div>
@@ -260,7 +208,7 @@
       <ul>
         <li><i class="fas fa-map-marker-alt"></i> 江西省南昌市红谷滩区</li>
         <li><i class="fas fa-phone"></i> 0791-12345678</li>
-        <li><i class="fas fa-envelope"></i> contact jxculture.cn</li>
+        <li><i class="fas fa-envelope"></i> contact&#64;jxculture.cn</li>
         <li><i class="fab fa-weixin"></i> 江西数字文化</li>
       </ul>
     </div>

+ 18 - 3
travel-web/src/modules/pc-home/pages/page-home/page-home.scss

@@ -1,5 +1,5 @@
-// 定义CSS变量
-:root {
+/* page-home.component.scss */
+:host {
   --primary-blue: #2a5daa;   /* 青花蓝 */
   --gold-yellow: #e8c34d;    /* 稻穗金 */
   --porcelain-white: #f8f9fa; /* 瓷白 */
@@ -8,7 +8,22 @@
   --river-blue: #4a86e8;     /* 赣江蓝 */
 }
 
-/* Banner区域 - 修复轮播图问题 */
+* {
+  margin: 0;
+  padding: 0;
+  box-sizing: border-box;
+}
+
+body {
+  font-family: 'Microsoft YaHei', 'Segoe UI', sans-serif;
+  background: linear-gradient(135deg, #f0f8ff 0%, #e6f7ff 100%);
+  color: var(--dark-charcoal);
+  line-height: 1.6;
+  overflow-x: hidden;
+  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M20,20 Q40,5 60,20 T100,20 L100,80 L0,80 L0,20 Z" fill="none" stroke="%232a5daa22" stroke-width="0.5"/></svg>');
+}
+
+/* Banner区域 */
 .banner-section {
   padding: 1.5rem 5%;
   margin-top: 1rem;

+ 128 - 142
travel-web/src/modules/pc-home/pages/page-home/page-home.ts

@@ -1,24 +1,87 @@
-import { Component, AfterViewInit } from '@angular/core';
+// page-home.component.ts
+import { Component, AfterViewInit, ViewChild, ElementRef, OnDestroy } from '@angular/core';
 import Swiper from 'swiper';
 import * as echarts from 'echarts';
 
 @Component({
   selector: 'app-page-home',
+  standalone: true,
+  imports: [],
   templateUrl: './page-home.html',
   styleUrls: ['./page-home.scss']
 })
-export class PageHome implements AfterViewInit {
+export class PageHome implements AfterViewInit, OnDestroy {
+  @ViewChild('swiperContainer') swiperContainer!: ElementRef;
+  @ViewChild('galleryChart') galleryChart!: ElementRef;
+  @ViewChild('xrChart') xrChart!: ElementRef;
+  @ViewChild('dashboardChart') dashboardChart!: ElementRef;
+
+  private swiper: any;
+  private galleryChartInstance: any;
+  private xrChartInstance: any;
+  private dashboardChartInstance: any;
+
+  // 示例数据 - 实际应用中可以从服务获取
+  news = [
+    { date: '06-25', title: '"数字赋能非遗传承"研讨会在南昌成功举办' },
+    { date: '06-22', title: '江西文旅厅推出"云游江西"智慧旅游平台' },
+    { date: '06-18', title: '景德镇陶瓷数字化博物馆正式对外开放' },
+    { date: '06-15', title: '赣南采茶戏数字化保护工程启动' },
+    { date: '06-12', title: '庐山智慧景区建设取得阶段性成果' }
+  ];
+
+  files = [
+    { date: '06-24', title: '《江西省数字文化产业发展规划》正式发布' },
+    { date: '06-20', title: '关于征集2023年度文化数字化项目的通知' },
+    { date: '06-17', title: '非遗数字化保护技术标准(试行版)' },
+    { date: '06-10', title: '文化数据资产登记与交易管理办法' },
+    { date: '06-05', title: '智慧旅游景区建设指南(2023版)' }
+  ];
+
+  research = [
+    { date: '06-23', title: '基于知识图谱的江西红色文化资源挖掘研究' },
+    { date: '06-19', title: 'VR技术在古村落数字化保护中的应用探索' },
+    { date: '06-16', title: '区块链在非遗传承人认证体系中的实践' },
+    { date: '06-11', title: 'AIGC在地方文化IP创作中的创新应用' },
+    { date: '06-08', title: '数字孪生技术在历史文化建筑保护中的实践' }
+  ];
+
+  ipList = [
+    '景德镇陶瓷青年计划',
+    '婺源油菜花艺术节',
+    '庐山云雾茶文化IP',
+    '赣南脐橙助农计划',
+    '鄱阳湖生态旅游IP',
+    '井冈山红色研学IP'
+  ];
 
   ngAfterViewInit(): void {
     this.initSwiper();
     this.initCharts();
+    window.addEventListener('resize', this.handleResize);
+  }
+
+  ngOnDestroy(): void {
+    if (this.swiper) {
+      this.swiper.destroy();
+    }
+    if (this.galleryChartInstance) {
+      this.galleryChartInstance.dispose();
+    }
+    if (this.xrChartInstance) {
+      this.xrChartInstance.dispose();
+    }
+    if (this.dashboardChartInstance) {
+      this.dashboardChartInstance.dispose();
+    }
+    window.removeEventListener('resize', this.handleResize);
   }
 
   private initSwiper(): void {
-    const swiper = new Swiper('.swiper-container', {
+    this.swiper = new Swiper(this.swiperContainer.nativeElement, {
       loop: true,
       autoplay: {
-        delay: 2000,
+        delay: 5000,
         disableOnInteraction: false,
       },
       pagination: {
@@ -30,42 +93,29 @@ export class PageHome implements AfterViewInit {
         prevEl: '.swiper-button-prev',
       },
       on: {
-        init: function() {
-          // let el:any = this.el
-          // el.addEventListener('mouseenter', function() {
-          //   swiper.autoplay.stop();
-          // });
-          // el.addEventListener('mouseleave', function() {
-          //   swiper.autoplay.start();
-          // });
+        init: () => {
+          this.swiperContainer.nativeElement.addEventListener('mouseenter', () => {
+            this.swiper.autoplay.stop();
+          });
+          this.swiperContainer.nativeElement.addEventListener('mouseleave', () => {
+            this.swiper.autoplay.start();
+          });
         }
       }
     });
   }
 
   private initCharts(): void {
-    // 数字文创展廊图表
-    const galleryChart = echarts.init(document.getElementById('galleryChart'));
-    galleryChart.setOption({
-      tooltip: {
-        trigger: 'axis'
-      },
-      legend: {
-        data: ['作品数量', '用户访问量']
-      },
-      grid: {
-        left: '3%',
-        right: '4%',
-        bottom: '3%',
-        containLabel: true
-      },
+    this.galleryChartInstance = echarts.init(this.galleryChart.nativeElement);
+    this.galleryChartInstance.setOption({
+      tooltip: { trigger: 'axis' },
+      legend: { data: ['作品数量', '用户访问量'] },
+      grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
       xAxis: {
         type: 'category',
         data: ['陶瓷', '书画', '剪纸', '刺绣', '竹编', '漆器']
       },
-      yAxis: {
-        type: 'value'
-      },
+      yAxis: { type: 'value' },
       series: [
         {
           name: '作品数量',
@@ -73,8 +123,8 @@ export class PageHome implements AfterViewInit {
           data: [45, 32, 28, 36, 22, 18],
           itemStyle: {
             color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
-              {offset: 0, color: '#2a5daa'},
-              {offset: 1, color: '#4a86e8'}
+              { offset: 0, color: '#2a5daa' },
+              { offset: 1, color: '#4a86e8' }
             ])
           }
         },
@@ -84,88 +134,46 @@ export class PageHome implements AfterViewInit {
           data: [120, 85, 92, 108, 75, 60],
           symbol: 'circle',
           symbolSize: 8,
-          lineStyle: {
-            color: '#e8c34d',
-            width: 3
-          },
-          itemStyle: {
-            color: '#e8c34d',
-            borderColor: '#fff',
-            borderWidth: 2
-          }
+          lineStyle: { color: '#e8c34d', width: 3 },
+          itemStyle: { color: '#e8c34d', borderColor: '#fff', borderWidth: 2 }
         }
       ]
     });
 
-    // XR云展厅图表
-    const xrChart = echarts.init(document.getElementById('xrChart'));
-    xrChart.setOption({
-      tooltip: {
-        trigger: 'item'
-      },
-      legend: {
-        orient: 'horizontal',
-        bottom: 'bottom'
-      },
-      series: [
-        {
-          name: '访问来源',
-          type: 'pie',
-          radius: ['40%', '70%'],
-          avoidLabelOverlap: false,
-          itemStyle: {
-            borderRadius: 10,
-            borderColor: '#fff',
-            borderWidth: 2
-          },
-          label: {
-            show: false,
-            position: 'center'
-          },
-          emphasis: {
-            label: {
-              show: true,
-              fontSize: '18',
-              fontWeight: 'bold'
-            }
-          },
-          labelLine: {
-            show: false
-          },
-          data: [
-            { value: 1048, name: '景德镇陶瓷馆' },
-            { value: 735, name: '庐山云海' },
-            { value: 580, name: '婺源古村落' },
-            { value: 484, name: '井冈山革命博物馆' },
-            { value: 300, name: '滕王阁' }
-          ]
-        }
-      ]
+    this.xrChartInstance = echarts.init(this.xrChart.nativeElement);
+    this.xrChartInstance.setOption({
+      tooltip: { trigger: 'item' },
+      legend: { orient: 'horizontal', bottom: 'bottom' },
+      series: [{
+        name: '访问来源',
+        type: 'pie',
+        radius: ['40%', '70%'],
+        avoidLabelOverlap: false,
+        itemStyle: { borderRadius: 10, borderColor: '#fff', borderWidth: 2 },
+        label: { show: false, position: 'center' },
+        emphasis: { label: { show: true, fontSize: '18', fontWeight: 'bold' } },
+        labelLine: { show: false },
+        data: [
+          { value: 1048, name: '景德镇陶瓷馆' },
+          { value: 735, name: '庐山云海' },
+          { value: 580, name: '婺源古村落' },
+          { value: 484, name: '井冈山革命博物馆' },
+          { value: 300, name: '滕王阁' }
+        ]
+      }]
     });
 
-    // 数据看板图表
-    const dashboardChart = echarts.init(document.getElementById('dashboardChart'));
-    dashboardChart.setOption({
-      tooltip: {
-        trigger: 'axis'
-      },
-      legend: {
-        data: ['会员数量', '项目数量', '资源总量']
-      },
-      grid: {
-        left: '3%',
-        right: '4%',
-        bottom: '3%',
-        containLabel: true
-      },
+    this.dashboardChartInstance = echarts.init(this.dashboardChart.nativeElement);
+    this.dashboardChartInstance.setOption({
+      tooltip: { trigger: 'axis' },
+      legend: { data: ['会员数量', '项目数量', '资源总量'] },
+      grid: { left: '3%', right: '4%', bottom: '3%', containLabel: true },
       xAxis: {
         type: 'category',
         boundaryGap: false,
         data: ['1月', '2月', '3月', '4月', '5月', '6月']
       },
-      yAxis: {
-        type: 'value'
-      },
+      yAxis: { type: 'value' },
       series: [
         {
           name: '会员数量',
@@ -173,21 +181,14 @@ export class PageHome implements AfterViewInit {
           stack: 'Total',
           data: [120, 132, 201, 234, 290, 330],
           smooth: true,
-          lineStyle: {
-            width: 3,
-            color: '#2a5daa'
-          },
+          lineStyle: { width: 3, color: '#2a5daa' },
           symbol: 'circle',
           symbolSize: 8,
-          itemStyle: {
-            color: '#2a5daa',
-            borderColor: '#fff',
-            borderWidth: 2
-          },
+          itemStyle: { color: '#2a5daa', borderColor: '#fff', borderWidth: 2 },
           areaStyle: {
             color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
-              {offset: 0, color: 'rgba(42, 93, 170, 0.5)'},
-              {offset: 1, color: 'rgba(42, 93, 170, 0.1)'}
+              { offset: 0, color: 'rgba(42, 93, 170, 0.5)' },
+              { offset: 1, color: 'rgba(42, 93, 170, 0.1)' }
             ])
           }
         },
@@ -197,21 +198,14 @@ export class PageHome implements AfterViewInit {
           stack: 'Total',
           data: [45, 52, 70, 83, 95, 115],
           smooth: true,
-          lineStyle: {
-            width: 3,
-            color: '#e8c34d'
-          },
+          lineStyle: { width: 3, color: '#e8c34d' },
           symbol: 'circle',
           symbolSize: 8,
-          itemStyle: {
-            color: '#e8c34d',
-            borderColor: '#fff',
-            borderWidth: 2
-          },
+          itemStyle: { color: '#e8c34d', borderColor: '#fff', borderWidth: 2 },
           areaStyle: {
             color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
-              {offset: 0, color: 'rgba(232, 195, 77, 0.5)'},
-              {offset: 1, color: 'rgba(232, 195, 77, 0.1)'}
+              { offset: 0, color: 'rgba(232, 195, 77, 0.5)' },
+              { offset: 1, color: 'rgba(232, 195, 77, 0.1)' }
             ])
           }
         },
@@ -221,32 +215,24 @@ export class PageHome implements AfterViewInit {
           stack: 'Total',
           data: [320, 382, 491, 574, 663, 795],
           smooth: true,
-          lineStyle: {
-            width: 3,
-            color: '#4a6b3d'
-          },
+          lineStyle: { width: 3, color: '#4a6b3d' },
           symbol: 'circle',
           symbolSize: 8,
-          itemStyle: {
-            color: '#4a6b3d',
-            borderColor: '#fff',
-            borderWidth: 2
-          },
+          itemStyle: { color: '#4a6b3d', borderColor: '#fff', borderWidth: 2 },
           areaStyle: {
             color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
-              {offset: 0, color: 'rgba(74, 107, 61, 0.5)'},
-              {offset: 1, color: 'rgba(74, 107, 61, 0.1)'}
+              { offset: 0, color: 'rgba(74, 107, 61, 0.5)' },
+              { offset: 1, color: 'rgba(74, 107, 61, 0.1)' }
             ])
           }
         }
       ]
     });
+  }
 
-    // 响应窗口大小变化
-    window.addEventListener('resize', function() {
-      galleryChart.resize();
-      xrChart.resize();
-      dashboardChart.resize();
-    });
+  private handleResize = () => {
+    if (this.galleryChartInstance) this.galleryChartInstance.resize();
+    if (this.xrChartInstance) this.xrChartInstance.resize();
+    if (this.dashboardChartInstance) this.dashboardChartInstance.resize();
   }
 }