Prechádzať zdrojové kódy

fix 方案缺失问题

flyzto 4 mesiacov pred
rodič
commit
a4c896d28d

+ 8 - 1
server/models/GamesPs.js

@@ -252,7 +252,14 @@ const syncBaseEvents = ({ mk, games, outrights }) => {
           match
         };
       }).filter(item => item.match.every(entry => entry.value !== 0));
-      return { ...gameInfo, matches, uptime: Math.min(evtime ?? 0, sptime ?? 0) };
+      let uptime = 0;
+      if (evtime && sptime) {
+        uptime = Math.min(evtime, sptime);
+      }
+      else if (!sptime) {
+        uptime = evtime ?? 0;
+      }
+      return { ...gameInfo, matches, uptime };
     });
 
     if (gamesList.filter(item => item.uptime > 0).length) {

+ 24 - 0
web/apps/web-antd/src/views/dashboard/workspace/index.vue

@@ -21,8 +21,11 @@ import { preferences } from '@vben/preferences';
 import { useUserStore } from '@vben/stores';
 import { openWindow } from '@vben/utils';
 
+import { requestClient } from '#/api/request';
+
 import AnalyticsVisitsSource from '../analytics/analytics-visits-source.vue';
 
+
 const userStore = useUserStore();
 
 // 这是一个示例数据,实际项目中需要根据实际情况进行调整
@@ -231,6 +234,27 @@ function navTo(nav: WorkbenchProjectItem | WorkbenchQuickNavItem) {
     console.warn(`Unknown URL for navigation item: ${nav.title} -> ${nav.url}`);
   }
 }
+
+const getGamesRelation = async () => {
+  const gamesRelation = await requestClient.get('/pstery/get_games_relation', { params: { mk: 1 } });
+  const gamesSolution = await requestClient.get('/pstery/get_solutions');
+  gamesSolution.solutions.forEach((solution: any) => {
+    const { info: { id }} = solution;
+    const relation = gamesRelation.find((relation: any) => relation.id === id);
+    if (!relation) {
+      console.log('relation not found', id);
+    }
+    else {
+      if (!relation.solutions) {
+        relation.solutions = [];
+      }
+      relation.solutions.push(solution);
+    }
+  });
+  console.log('gamesRelation', gamesRelation);
+}
+
+getGamesRelation();
 </script>
 
 <template>