li.shaoyi 4 سال پیش
والد
کامیت
07a27a901a

+ 3 - 3
src/common/components/echart/echart-kline/index.vue

@@ -1,5 +1,5 @@
 <template>
-    <echart-base :options="[options]" :empty="isEmpty" v-model:loading="loading"></echart-base>
+  <echart-base :options="[options]" :empty="isEmpty" v-model:loading="loading"></echart-base>
 </template>
 
 <script lang="ts">
@@ -83,9 +83,9 @@ export default defineComponent({
 
             if (source.length >= count) {
                 // 均线起始位置
-                const startIndex = historyIndexs[count - 1] ?? count;
+                const startIndex = historyIndexs[count - 1];
                 for (let i = 0; i < source.length; i++) {
-                    if (i > startIndex) {
+                    if (startIndex !== undefined && i > startIndex) {
                         const j = historyIndexs.findIndex((val) => val === i);
                         // 判断是否补充数据
                         if (j === -1) {

+ 3 - 3
src/common/components/echart/echart-timeline/index.vue

@@ -1,5 +1,5 @@
 <template>
-    <echart-base :options="[options]" :empty="isEmpty" v-model:loading="loading"></echart-base>
+  <echart-base :options="[options]" :empty="isEmpty" v-model:loading="loading"></echart-base>
 </template>
 
 <script lang="ts">
@@ -105,9 +105,9 @@ export default defineComponent({
             const result: string[] = [];
             if (data.length >= count) {
                 // 均线起始位置
-                const startIndex = historyIndexs[count - 1] ?? count;
+                const startIndex = historyIndexs[count - 1];
                 for (let i = 0; i < data.length; i++) {
-                    if (i < startIndex) {
+                    if (startIndex === undefined || i < startIndex) {
                         result.push('-');
                     } else {
                         const j = historyIndexs.findIndex((val) => val === i);