From 577a0ffeb5b9adfb7a52e9afd95f4778aaa8a754 Mon Sep 17 00:00:00 2001 From: xixiibn5100 <1584914306@qq.com> Date: Mon, 4 Nov 2024 15:09:21 +0800 Subject: [PATCH] fix(freeRoom): fix NaN in payload --- src/components/RoomPicker/index.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/RoomPicker/index.vue b/src/components/RoomPicker/index.vue index 7833c89b..c7224367 100644 --- a/src/components/RoomPicker/index.vue +++ b/src/components/RoomPicker/index.vue @@ -53,7 +53,7 @@ const selectorChecked = ref([ selectorData[2][new Date().getDay() - 1], `第${getCurrentSection()}节` ]); -const selectorValue = reactive([ +const selectorValue = ref([ 0, props.week < 20 && props.week > 0 ? props.week - 1 : 0, new Date().getDay() - 1, @@ -64,14 +64,14 @@ const onChange = (e) => { selectorChecked.value = selector.map( (item, index) => item[e.detail.value[index]] ); - selectorValue.values = e.detail.value; + selectorValue.value = e.detail.value; emit("changed", { year: systemStore.generalInfo.termYear, term: systemStore.generalInfo.term, campus: campus[e.detail.value[0]], week: Math.pow(2, e.detail.value[1]).toString(), - weekday: (selectorValue.values[2] + 1).toString(), + weekday: (selectorValue.value[2] + 1).toString(), sections: Math.pow(2, e.detail.value[3]).toString() }); }; @@ -80,9 +80,9 @@ onMounted(() => { emit("changed", { year: systemStore.generalInfo.termYear, term: systemStore.generalInfo.term, - campus: campus[selectorValue[0]], - week: Math.pow(2, selectorValue[1]).toString(), - weekday: (selectorValue[2] + 1).toString(), + campus: campus[selectorValue.value[0]], + week: Math.pow(2, selectorValue.value[1]).toString(), + weekday: (selectorValue.value[2] + 1).toString(), sections: Math.pow(2, getCurrentSection()).toString() }); });