From fcb00a66b4053550b473a29d7299c7a4737eea75 Mon Sep 17 00:00:00 2001
From: lxf <1371462558@qq.com>
Date: Wed, 16 Jul 2025 14:41:04 +0800
Subject: [PATCH] 翻译

---
 src/components/list-quotation/index.vue |   25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/src/components/list-quotation/index.vue b/src/components/list-quotation/index.vue
index 184fa78..6a47449 100644
--- a/src/components/list-quotation/index.vue
+++ b/src/components/list-quotation/index.vue
@@ -219,6 +219,7 @@
       type: "left", //left 从左往右 right 从有王座
       sortVal: 0,
       kLineData: this.generateKLineData(),
+      klineDataList: [],
     };
   },
   props: {
@@ -247,7 +248,10 @@
   },
   mounted() {
     this.listData.forEach((item) => {
-      item.kLineData = this.generateKLineData();
+      if (!item.kLineData) {
+        item.kLineData = this.generateKLineData();
+        this.klineDataList.push(item.kLineData);
+      }
     });
     this.$nextTick(() => {
       this.drawKLine();
@@ -281,7 +285,16 @@
 
       canvasList.forEach((canvas, index) => {
         if (!canvas) return;
-
+        if (!this.listData[index].kLineData) {
+          this.listData[index].kLineData =
+            this.klineDataList[index] || this.generateKLineData();
+          this.klineDataList.push(this.listData[index].kLineData);
+        }
+        // console.log(
+        //   "kLineData",
+        //   this.listData[index].kLineData,
+        //   this.klineDataList
+        // );
         const ctx = canvas.getContext("2d");
         const width = canvas.width;
         const height = canvas.height;
@@ -312,6 +325,8 @@
 
         ctx.stroke();
       });
+
+      // console.log("listData: ", this.listData);
     },
     //排序
     listSort(val) {
@@ -382,6 +397,12 @@
   },
   watch: {
     listData() {
+      this.drawKLine();
+      // this.listData.forEach((item) => {
+      //   if (!item.kLineData) {
+      //     item.kLineData = this.generateKLineData();
+      //   }
+      // });
       if (this.active == 0) {
         this.showList = [...this.listData];
       } else if (this.active == 1) {

--
Gitblit v1.9.3