刘洋 1 jaar geleden
bovenliggende
commit
c6ed03dcfb
2 gewijzigde bestanden met toevoegingen van 18 en 7 verwijderingen
  1. 12 2
      src/components/common/table-loop/index.vue
  2. 6 5
      src/utils/chart.js

+ 12 - 2
src/components/common/table-loop/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="table-loop" ref="tableLoop">
-    <div class="thead">
+    <div class="thead" ref="thead">
       <div class="td index">排名</div>
       <div
         class="td"
@@ -13,7 +13,7 @@
     </div>
     <swiper
       :key="swiperKey"
-      :style="{ height: 36 * rowNum + 'px' }"
+      :style="{ height: 36 * rowNum + 'px', width: swiperWidth + 'px' }"
       :modules="modules"
       direction="vertical"
       :slides-per-view="rowNum"
@@ -69,6 +69,16 @@ const tbodyHeight = ref(1);
 const rowNum = computed(() => {
   return parseInt(tbodyHeight.value / 36);
 });
+const swiperWidth = ref(0);
+const thead = ref();
+onMounted(() => {
+  let w = 0;
+  for (let i = 0; i < thead.value.children.length; i++) {
+    let node = thead.value.children[i];
+    w += node.offsetWidth;
+  }
+  swiperWidth.value = w;
+});
 
 onMounted(() => {
   tbodyHeight.value = tableLoop.value.offsetHeight - 46;

+ 6 - 5
src/utils/chart.js

@@ -435,11 +435,12 @@ export const createWaterBallOption = (
             color: `rgba(${color},0.26)`,
           },
           outline: {
-            borderDistance: 0,
-            itemStyle: {
-              borderWidth: 10,
-              borderColor: `rgba(${color},0.5)`,
-            },
+            // borderDistance: 0,
+            // itemStyle: {
+            //   borderWidth: 10,
+            //   borderColor: `rgba(${color},0.5)`,
+            // },
+            show: false,
           },
           // amplitude: 0,
         },