Ver código fonte

增加验证数据

flyzto 4 meses atrás
pai
commit
d59e530330
1 arquivos alterados com 16 adições e 1 exclusões
  1. 16 1
      web/apps/web-antd/src/views/match/datatest/index.vue

+ 16 - 1
web/apps/web-antd/src/views/match/datatest/index.vue

@@ -65,6 +65,9 @@
           <button class="btn btn-secondary" @click="runTest">
             运行测试
           </button>
+          <button class="btn btn-secondary" @click="verifyData">
+            验证数据
+          </button>
         </div>
       </div>
     </div>
@@ -97,7 +100,7 @@ const refreshData = () => {
   });
 }
 
-const runTest = async () => {
+const runTest = () => {
   gamesSolution.value.solutions.forEach((solution) => {
     const { info: { id }} = solution;
     const relation = gamesRelation.value.find((relation) => relation.id === id);
@@ -114,6 +117,18 @@ const runTest = async () => {
   console.log('gamesRelation', gamesRelation);
 }
 
+const verifyData = () => {
+  const solutions = gamesSolution.value.solutions;
+  const invalidSolutions = [];
+  solutions.forEach((solution) => {
+    const { sol: { win_average, win_profit_rate } } = solution;
+    if (win_average * win_profit_rate < 0) {
+      invalidSolutions.push(solution)
+    }
+  });
+  console.log('invalidSolutions', invalidSolutions);
+}
+
 // const currentTime = ref('')
 
 // const updateTime = () => {