flyzto 3 mesi fa
parent
commit
9234e45c77
1 ha cambiato i file con 9 aggiunte e 6 eliminazioni
  1. 9 6
      web/apps/web-antd/src/views/match/datatest/index.vue

+ 9 - 6
web/apps/web-antd/src/views/match/datatest/index.vue

@@ -115,6 +115,12 @@ const refreshData = () => {
   });
 }
 
+const showDataPretty = (data, deep) => {
+  prettyDeep.value = 0;
+  prettyData.value = data;
+  prettyDeep.value = deep;
+}
+
 const runTest = () => {
   const gamesList = gamesRelation.value.map(item => {
     const { eventId, leagueId, leagueName, teamHomeName, teamAwayName, timestamp } = item?.rel?.ps ?? {};
@@ -134,8 +140,7 @@ const runTest = () => {
       currentGame.solutions.push(sid);
     }
   });
-  prettyData.value = gamesList;
-  prettyDeep.value = 2;
+  showDataPretty(gamesList, 2);
   console.log('gamesRelation', gamesList);
 }
 
@@ -148,8 +153,7 @@ const verifyData = () => {
       invalidSolutions.push(solution)
     }
   });
-  prettyData.value = invalidSolutions;
-  prettyDeep.value = 2;
+  showDataPretty(invalidSolutions, 2);
   console.log('invalidSolutions', invalidSolutions);
 }
 
@@ -159,8 +163,7 @@ const filterLive = () => {
     const { info: { ob, hg, ps } } = solution;
     return ps.stage;
   });
-  prettyData.value = liveSolutions;
-  prettyDeep.value = 2;
+  showDataPretty(liveSolutions, 2);
   console.log('liveSolutions', liveSolutions);
 }