Skip to content

Commit 81d8d58

Browse files
committed
bug修复:对局无法查看他人战绩详情
1 parent ea4db17 commit 81d8d58

File tree

5 files changed

+23
-13
lines changed

5 files changed

+23
-13
lines changed

electron/types/opgg_rank_type.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ export const positionMap = {
2929

3030
export const assignedPositionNameMap = {
3131
top: "上单",
32-
mid: "中单",
33-
adc: "射手",
32+
middle: "中单",
33+
bottom: "下路",
3434
jungle: "打野",
35-
support: "辅助"
35+
utility: "辅助"
3636
} as Record<string, string>;
3737

3838
export interface ChampionPopularData {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "joi",
3-
"version": "0.5.2",
3+
"version": "0.5.3",
44
"main": "dist-electron/main.js",
55
"repository": {
66
"type": "git",

src/components/GameDetailInfo.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import PlayerGameInfo from "@/components/PlayerGameInfo.vue";
33
import { toRefs } from "vue";
44
import { GameDetail } from "@@/types/lcuType";
55
6-
const props = defineProps<{ detail: GameDetail; puuid?: string }>();
6+
const props = defineProps<{ detail?: GameDetail; puuid?: string }>();
77
const { detail } = toRefs(props);
88
defineOptions({
99
inheritAttrs: false
@@ -17,9 +17,9 @@ defineOptions({
1717
<PlayerGameInfo
1818
v-bind="$attrs"
1919
:info="data"
20-
:play-info="detail.participantIdentities[i]"
20+
:play-info="detail!.participantIdentities[i]"
2121
:class="[
22-
props.puuid === detail.participantIdentities[i].player.puuid ? 'highlight-row' : ''
22+
props.puuid === detail!.participantIdentities[i].player.puuid ? 'highlight-row' : ''
2323
]"></PlayerGameInfo>
2424
<n-divider v-if="i === 4"></n-divider>
2525
</template>

src/components/gameFlow/teamAnalysis.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ const showSummonerName = ref("");
102102
103103
function handleClick(event: any) {
104104
showDetail.value = true;
105-
showSummonerName.value = event.name;
106-
historyListData.value = teamMap.value[event.name].gameDetail || [];
105+
showSummonerName.value = teams.value[event.dataIndex].summonerName;
106+
historyListData.value = teams.value[event.dataIndex].gameDetail || [];
107107
}
108108
</script>
109109

src/utils/gameAnalysis.ts

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,20 @@ export function computeScore(gameDetail?: GameDetail[]) {
3131
const info = detail.participants[0];
3232
let { kills, assists, deaths } = info.stats;
3333
deaths = deaths || 1;
34-
let score =
35-
info.timeline.role !== "SUPPORT"
36-
? (kills * 1.2 + assists * 0.8) / (deaths * 1.2)
37-
: (kills * 1.2 + assists * 1.2) / (deaths * 1.2);
34+
let score;
35+
if (info.timeline.role === "SUPPORT" && detail.gameMode !== "ARAM") {
36+
score = (kills + assists * 1.2) / deaths; //非大乱斗模式的辅助英雄
37+
} else {
38+
score = (kills + assists) / deaths;
39+
}
40+
if (detail.gameMode === "ARAM" || info.timeline.role !== "SUPPORT") {
41+
if (deaths > 15 && kills <= 10) {
42+
score -= 1;
43+
}
44+
if (deaths > 20 && kills <= 10) {
45+
score -= 1;
46+
}
47+
}
3848
if (info.stats.win) {
3949
score += 1;
4050
} else {

0 commit comments

Comments
 (0)