From 423fe1e277984948787937a2f6a467da6458e18e Mon Sep 17 00:00:00 2001 From: testusuke Date: Tue, 8 Oct 2024 15:41:38 +0900 Subject: [PATCH] =?UTF-8?q?change:=20=E5=8B=9D=E3=81=A1=E7=82=B9=E6=8E=A1?= =?UTF-8?q?=E7=82=B9=E6=96=B9=E6=B3=95=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/league/legacy/GameEditFields.tsx | 5 +++++ components/league/legacy/GameForm.tsx | 4 ++-- components/league/table/leagueTable.tsx | 13 ++++++++++--- src/models/GameModel.ts | 2 +- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/components/league/legacy/GameEditFields.tsx b/components/league/legacy/GameEditFields.tsx index 75b6371..166915d 100644 --- a/components/league/legacy/GameEditFields.tsx +++ b/components/league/legacy/GameEditFields.tsx @@ -138,6 +138,11 @@ export default function GameEditFields(props: GameEditFieldsProps) { > 得失点 + + 勝ち点 + diff --git a/components/league/legacy/GameForm.tsx b/components/league/legacy/GameForm.tsx index 8ff0137..3793f3b 100644 --- a/components/league/legacy/GameForm.tsx +++ b/components/league/legacy/GameForm.tsx @@ -42,8 +42,8 @@ export default function GameForm(props: GameFormProps) { } // calculationType invalid - if (calculationTypeState !== "total_score" && calculationTypeState !== "diff_score") { - alert("合計得点もしくは得失点差が選択可能です。") + if (calculationTypeState !== "total_score" && calculationTypeState !== "diff_score" && calculationTypeState !== "win_score") { + alert("勝ち点、合計得点もしくは得失点差が選択可能です。") return } diff --git a/components/league/table/leagueTable.tsx b/components/league/table/leagueTable.tsx index 6abf3bd..950b957 100644 --- a/components/league/table/leagueTable.tsx +++ b/components/league/table/leagueTable.tsx @@ -126,9 +126,16 @@ export default async function LeagueTable(props: LeagueTableProps) { ) } } else { - rows.push( - - ) + if (results.teams.some(r => r.rank === result.rank && r.teamId !== result.teamId)) { + rows.push( + + ) + } else { + rows.push( + + ) + } + } } } diff --git a/src/models/GameModel.ts b/src/models/GameModel.ts index 0878228..42b75de 100644 --- a/src/models/GameModel.ts +++ b/src/models/GameModel.ts @@ -16,7 +16,7 @@ export type Game = { } export type GameType = "tournament" | "league" -export type GameCalculationType = "total_score" | "diff_score" +export type GameCalculationType = "total_score" | "diff_score" | "win_score" export type TournamentResult = { gameId: number,