From 3b01c2ec764fc5d02e2dfcb4bad233d47e924d88 Mon Sep 17 00:00:00 2001 From: heimoshuiyu Date: Thu, 16 Feb 2023 23:29:04 +0800 Subject: [PATCH] remove bgcolor --- components/Timetable.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/Timetable.tsx b/components/Timetable.tsx index 052ac14..7e29554 100644 --- a/components/Timetable.tsx +++ b/components/Timetable.tsx @@ -176,9 +176,10 @@ const Timetable = ({ if (openRecordMode) { for (const index in json) { const input = indexToElement[index]; - const td= indexToCell[index]; + const td = indexToCell[index]; if (json[index] !== user) { - td.innerHTML = json[index] + td.innerHTML = json[index]; + td.removeAttribute("bgcolor"); } else { input.checked = true; input.disabled = true; @@ -240,7 +241,9 @@ const Timetable = ({ for (const row of marks) { for (const input of row) { if (input === null) continue; - if (input.value !== "") { + if (input.checked) { + data.selections[input.name] = 1; + } else if (parseFloat(input.value)) { data.selections[input.name] = parseFloat(input.value); } }