From dd0afbe390bc692a00b4c3ceaabbf46eaefef11c Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sat, 9 Jul 2022 19:24:49 +0900 Subject: [PATCH] fix ts --- hwe/ts/PartialReservedCommand.vue | 2 +- hwe/ts/components/ChiefReservedCommand.vue | 4 ++-- hwe/ts/legacy/main.ts | 8 ++++---- hwe/ts/map.ts | 2 +- hwe/ts/util/QueryActionHelper.ts | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hwe/ts/PartialReservedCommand.vue b/hwe/ts/PartialReservedCommand.vue index 97f90d2..6922321 100644 --- a/hwe/ts/PartialReservedCommand.vue +++ b/hwe/ts/PartialReservedCommand.vue @@ -457,7 +457,7 @@ async function reloadCommandList() { for (const obj of result.turn) { const [year, month] = parseYearMonth(yearMonth); let tooltip: string[] = []; - let style: Record = {}; + let style: Record = {}; const brief = obj.brief; diff --git a/hwe/ts/components/ChiefReservedCommand.vue b/hwe/ts/components/ChiefReservedCommand.vue index 65546e7..d2adc6a 100644 --- a/hwe/ts/components/ChiefReservedCommand.vue +++ b/hwe/ts/components/ChiefReservedCommand.vue @@ -282,7 +282,7 @@ type TurnObjWithTime = TurnObj & { year?: number; month?: number; tooltip?: string; - style?: Record; + style?: Record; }; const props = defineProps({ @@ -490,7 +490,7 @@ function updateCommandList() { for (const obj of props.turn) { const [year, month] = parseYearMonth(yearMonth); let tooltip: string[] = []; - let style: Record = {}; + let style: Record = {}; const brief = obj.brief; diff --git a/hwe/ts/legacy/main.ts b/hwe/ts/legacy/main.ts index 7ae06c0..33acd54 100644 --- a/hwe/ts/legacy/main.ts +++ b/hwe/ts/legacy/main.ts @@ -11,14 +11,14 @@ exportWindow(jQuery, '$'); htmlReady(() => { - for(const refreshBtn of document.querySelectorAll('.refreshPage')){ + document.querySelectorAll('.refreshPage').forEach(refreshBtn => { refreshBtn.addEventListener('click', function () { document.location.reload(); return false; }) - } + }); - for(const openWindowBtn of document.querySelectorAll('.open-window')){ + document.querySelectorAll('.open-window').forEach(openWindowBtn => { openWindowBtn.addEventListener('click', function (e) { e.preventDefault(); console.log(e); @@ -36,7 +36,7 @@ htmlReady(() => { window.open((target as HTMLAnchorElement).href); }); - } + }); activateFlip(); initTooltip(); diff --git a/hwe/ts/map.ts b/hwe/ts/map.ts index 3d04fdc..c09c84e 100644 --- a/hwe/ts/map.ts +++ b/hwe/ts/map.ts @@ -189,7 +189,7 @@ export async function reloadWorldMap(option: loadMapOption, drawTarget = '.world async function setMapBackground(obj: MapResult): Promise { function setTheme() { const oldTheme = $world_map.data('currentTheme'); - const newTheme = obj.theme; + const newTheme = (obj as unknown as Record).theme; if (oldTheme === newTheme) { return; } diff --git a/hwe/ts/util/QueryActionHelper.ts b/hwe/ts/util/QueryActionHelper.ts index 97edf66..1821657 100644 --- a/hwe/ts/util/QueryActionHelper.ts +++ b/hwe/ts/util/QueryActionHelper.ts @@ -8,7 +8,7 @@ type TurnObjWithTime = TurnObj & { year?: number; month?: number; tooltip?: string; - style?: Record; + style?: Record; }; export const getEmptyTurn = (maxTurn: number): TurnObjWithTime[] => Array.from({