flyzto hace 3 meses
padre
commit
52499049b0
Se han modificado 1 ficheros con 23 adiciones y 11 borrados
  1. 23 11
      web/apps/web-antd/src/views/match/datatest/index.vue

+ 23 - 11
web/apps/web-antd/src/views/match/datatest/index.vue

@@ -59,21 +59,21 @@
         </div>
 
         <div class="action-buttons">
-          <button class="btn btn-primary" @click="refreshData">
+          <Button @click="refreshData">
             刷新数据
-          </button>
-          <button class="btn btn-secondary" @click="runTest(true)">
+          </Button>
+          <Button @click="runTest(true)">
             有欢乐值
-          </button>
-          <button class="btn btn-secondary" @click="runTest(false)">
+          </Button>
+          <Button @click="runTest(false)">
             无欢乐值
-          </button>
-          <button class="btn btn-secondary" @click="verifyData">
+          </Button>
+          <Button @click="verifyData">
             验证数据
-          </button>
-          <button class="btn btn-secondary" @click="filterLive">
+          </Button>
+          <Button @click="filterLive">
             筛选滚球
-          </button>
+          </Button>
         </div>
       </div>
     </div>
@@ -85,8 +85,9 @@
 </template>
 
 <script setup>
-import { ref, onMounted } from 'vue';
+import { ref, watch, onMounted } from 'vue';
 import { requestClient } from '#/api/request';
+import { Button, message, InputNumber } from 'ant-design-vue';
 
 import dayjs from 'dayjs';
 import VueJsonPretty from 'vue-json-pretty';
@@ -100,6 +101,10 @@ const selectedTestMode = ref('');
 const prettyData = ref(null);
 const prettyDeep = ref(0);
 
+watch(selectedTestMode, () => {
+  refreshData();
+});
+
 const updateTime = () => {
   currentTime.value = new Date().toLocaleString('zh-CN')
 }
@@ -113,7 +118,14 @@ const refreshData = () => {
   .then(([relations, solutions]) => {
     gamesRelation.value = relations;
     gamesSolution.value = solutions;
+    prettyData.value = null;
+    prettyDeep.value = 0;
+    message.success('数据已刷新');
     console.log('数据已刷新');
+  })
+  .catch(err => {
+    message.error('数据刷新失败');
+    console.error('数据刷新失败', err);
   });
 }