From 03043192ddf00f9a36b7454799a9152cd1b50a0b Mon Sep 17 00:00:00 2001
From: admin <344137771@qq.com>
Date: Tue, 06 Jan 2026 11:13:45 +0800
Subject: [PATCH] 1

---
 src/components/Transform/kline-charts/index.vue |   46 ++++++++++++++++++++++++++++++----------------
 1 files changed, 30 insertions(+), 16 deletions(-)

diff --git a/src/components/Transform/kline-charts/index.vue b/src/components/Transform/kline-charts/index.vue
index 5ffdbcd..22c8202 100644
--- a/src/components/Transform/kline-charts/index.vue
+++ b/src/components/Transform/kline-charts/index.vue
@@ -73,19 +73,34 @@
     }
   },
   computed: {
+    //时间列表
     timeList() {
-      return [
-        { id: '1min', time: '1min', text: this.$t('分时'), ts: 1 * 60 * 1000 },
-        { id: '1mins', time: '1min', text: '1' + this.$t('分'), ts: 1 * 60 * 1000 },
-        { id: '5min', time: '5min', text: '5' + this.$t('分'), ts: 5 * 60 * 1000 },
-        { id: '15min', time: '15min', text: '15' + this.$t('分'), ts: 15 * 60 * 1000 },
-        { id: '30min', time: '30min', text: '30' + this.$t('分'), ts: 30 * 60 * 1000 },
-        { id: '60min', time: '60min', text: '1' + this.$t('小时'), ts: 60 * 60 * 1000 },
-        { id: '4hour', time: '4hour', text: '4' + this.$t('小时'), ts: 4 * 60 * 60 * 1000 },
-        { id: '1day', time: '1day', text: '1' + this.$t('天'), ts: 24 * 60 * 60 * 1000 },
-        { id: '1week', time: '1week', text: '1' + this.$t('周'), ts: 7 * 24 * 60 * 60 * 1000 },
-        { id: '1mon', time: '1mon', text: '1' + this.$t('月'), ts: 30 * 24 * 60 * 60 * 1000 }
-      ]//时间列表
+      // console.log("ddddddddd", this.timeListNew, this.$route.query.type);
+      if (this.$route.query.type == 'US-stocks') {
+        return [
+          { id: '1', time: '1', text: '1s' + this.$t('分'), ts: 1 * 60 * 1000 },
+          { id: '15', time: '15', text: '15' + this.$t('分'), ts: 15 * 60 * 1000 },
+          { id: '30', time: '30', text: '30' + this.$t('分'), ts: 30 * 60 * 1000 },
+          { id: '45', time: '45', text: '45' + this.$t('分'), ts: 45 * 60 * 1000 },
+          { id: '60', time: '60', text: '60' + this.$t('分'), ts: 60 * 60 * 1000 },
+          { id: 'D', time: 'D', text: '1' + this.$t('天'), ts: 1 * 24 * 60 * 60 * 1000 },
+          { id: 'W', time: 'W', text: '1' + this.$t('周'), ts: 7 * 24 * 60 * 60 * 1000 },
+          { id: 'M', time: 'M', text: '1' + this.$t('月'), ts: 30 * 24 * 60 * 60 * 1000 },
+        ]
+      } else {
+        return [
+          { id: '1min', time: '1min', text: this.$t('分时'), ts: 1 * 60 * 1000 },
+          { id: '1mins', time: '1min', text: '1' + this.$t('分'), ts: 1 * 60 * 1000 },
+          { id: '5min', time: '5min', text: '5' + this.$t('分'), ts: 5 * 60 * 1000 },
+          { id: '15min', time: '15min', text: '15' + this.$t('分'), ts: 15 * 60 * 1000 },
+          { id: '30min', time: '30min', text: '30' + this.$t('分'), ts: 30 * 60 * 1000 },
+          { id: '60min', time: '60min', text: '1' + this.$t('小时'), ts: 60 * 60 * 1000 },
+          { id: '4hour', time: '4hour', text: '4' + this.$t('小时'), ts: 4 * 60 * 60 * 1000 },
+          { id: '1day', time: '1day', text: '1' + this.$t('天'), ts: 24 * 60 * 60 * 1000 },
+          { id: '1week', time: '1week', text: '1' + this.$t('周'), ts: 7 * 24 * 60 * 60 * 1000 },
+          { id: '1mon', time: '1mon', text: '1' + this.$t('月'), ts: 30 * 24 * 60 * 60 * 1000 }
+        ]
+      }
     }
   },
   components: {
@@ -175,7 +190,7 @@
     },
     fetchData(time) { // 获取数据
       this.chartLoading = true
-      _getKline(this.symbol, this.timeValue.time || '1min').then(data => {
+      _getKline(this.symbol, this.timeValue.time || '1').then(data => {
         this.chartLoading = false
         data.map(item => {
           item.timestamp = item.ts
@@ -213,7 +228,7 @@
     },
     setChartType() {
       let type = 'area'
-      if (this.timeValue.id === '1min') {
+      if (this.timeValue.id === '1') {
         type = 'area'
       } else {
         type = 'candle_solid'
@@ -247,5 +262,4 @@
 // #kline {
 //   // min-height: 828px;
 //   height: 1200px;
-// }
-</style>
+// }</style>

--
Gitblit v1.9.3