flyzto 2 mesiacov pred
rodič
commit
b6119eaaed

+ 4 - 8
web/apps/web-antd/src/views/match/components/solution_item.vue

@@ -1,5 +1,5 @@
 <script setup>
-import { ref, computed, defineProps, defineEmits } from 'vue';
+import { ref, computed } from 'vue';
 import dayjs from 'dayjs';
 
 import MatchCard from './match_card.vue';
@@ -172,20 +172,16 @@ const switchSolution = (index) => {
   }
 };
 
-const topSolutions = computed(() => {
-  return props.solutions.slice(0, 5);
-});
-
 const currentIndex = computed(() => {
   const index = selectedIndex.value;
-  if (topSolutions.value[index]) {
+  if (props.solutions[index]) {
     return index;
   }
   return 0;
 });
 
 const currentSolution = computed(() => {
-  return topSolutions.value[currentIndex.value];
+  return props.solutions[currentIndex.value];
 });
 
 const currentRelation = computed(() => {
@@ -236,7 +232,7 @@ const hg = computed(() => {
     <div class="league-name">{{ currentRelation.leagueName }}</div>
     <div class="date-time">{{ currentRelation.dateTime }}</div>
     <div class="switch-btns">
-      <a href="javascript:;" v-for="(solution, index) in topSolutions" :key="index" :class="{ 'selected': index === currentIndex }" @click="switchSolution(index)">{{ solution.sol.win_average_rate ?? fixFloat(solution.sol.win_average / solution.sol.inner_base * 100) }}</a>
+      <a href="javascript:;" v-for="(solution, index) in solutions" :key="index" :class="{ 'selected': index === currentIndex }" @click="switchSolution(index)">{{ solution.sol.win_average_rate ?? fixFloat(solution.sol.win_average / solution.sol.inner_base * 100) }}</a>
     </div>
   </div>
   <div class="solution-content">

+ 2 - 1
web/apps/web-antd/src/views/match/solutions/index.vue

@@ -40,7 +40,8 @@ const headerStyle = computed(() => {
 const solutionsList = computed(() => {
   return solutions.value.map(item => {
     const selected = selectedSolutions.findIndex(sol => sol.id == item.id) >= 0;
-    return { ...item, selected };
+    const topSolutions = item.solutions.slice(0, 5);
+    return { ...item, solutions: topSolutions, selected };
   });
 });