From 6da78f667c6314148a871c07748d42895b65d79c Mon Sep 17 00:00:00 2001
From: wanshenmean <cathay_xy@163.com>
Date: 星期三, 28 一月 2026 15:22:33 +0800
Subject: [PATCH] 前端webpack更改vite

---
 Code/WCS/WIDESEAWCS_Client/src/views/charts/bigdata.vue |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/Code/WCS/WIDESEAWCS_Client/src/views/charts/bigdata.vue b/Code/WCS/WIDESEAWCS_Client/src/views/charts/bigdata.vue
index e75b6f9..b3a0738 100644
--- a/Code/WCS/WIDESEAWCS_Client/src/views/charts/bigdata.vue
+++ b/Code/WCS/WIDESEAWCS_Client/src/views/charts/bigdata.vue
@@ -105,7 +105,7 @@
   </div>
 </template>
 <script>
-var echarts = require("echarts");
+let echarts = null;
 let $chartLeft1,
   $chartLeft2,
   $chartLeft3,
@@ -122,6 +122,15 @@
 } from "./bigdata/chart-options";
 // import IviewCircle from "./bigdata/IviewCircle";
 import "./bigdata/layout.less";
+
+async function loadEcharts() {
+  if (!echarts) {
+    const module = await import("echarts");
+    echarts = module.default || module;
+  }
+  return echarts;
+}
+
 export default {
   components: {
     // "iview-circle": IviewCircle
@@ -132,7 +141,8 @@
   created() {
     console.log("chart");
   },
-  mounted() {
+  async mounted() {
+    echarts = await loadEcharts();
     if ($chartLeft1) {
       $chartLeft1.dispose();
       $chartLeft2.dispose();

--
Gitblit v1.9.3