|
|
@@ -84,7 +84,7 @@
|
|
|
|
|
|
<uni-calendar ref="calendarRef" :insert="true" :lunar="false" :readonly="true" :showMonth="false"
|
|
|
:sundayFirst="false" :highlightToday="false" :showToolbar="false" :displayMode="displayMode"
|
|
|
- :weekNumber="calendarWeekNumber" :selected="selected" :date="currentDate"
|
|
|
+ :weekNumber="calendarWeekNumber" :selected="[]" :date="currentDate"
|
|
|
@change-week="handleCalendarWeekChange" @monthSwitch="handleCalendarMonthSwitch">
|
|
|
<template #calendar-item="{ weeks }">
|
|
|
<view class="calendar-item" :class="{
|
|
|
@@ -153,18 +153,12 @@ const form = ref({
|
|
|
|
|
|
// 年份列表(当前年份前后各2年,但不能超过当前年份)
|
|
|
const yearList = computed(() => {
|
|
|
- const currentYearValue = currentYear.value;
|
|
|
- const today = new Date();
|
|
|
- const currentYearToday = today.getFullYear();
|
|
|
- const years = [];
|
|
|
-
|
|
|
- for (let i = currentYearValue - 2; i <= currentYearToday; i++) {
|
|
|
- years.push({
|
|
|
- label: i.toString(),
|
|
|
- value: i.toString()
|
|
|
- });
|
|
|
- }
|
|
|
- return years;
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ label: '2025',
|
|
|
+ value: '2025'
|
|
|
+ }
|
|
|
+ ];
|
|
|
});
|
|
|
|
|
|
// 月份列表(不能超过当前月份)
|
|
|
@@ -188,30 +182,30 @@ const monthList = computed(() => {
|
|
|
|
|
|
// 周列表 - 根据当前月份动态生成,不显示未来周数
|
|
|
const weekList = computed(() => {
|
|
|
- const weeks = [];
|
|
|
- const totalWeeks = currentWeekRange.value?.totalWeeks || 1;
|
|
|
-
|
|
|
- // 计算当前周数
|
|
|
- const today = new Date();
|
|
|
- const current = new Date(currentYear.value, currentMonth.value - 1, 1);
|
|
|
- const isCurrentMonth = current.getFullYear() === today.getFullYear() &&
|
|
|
- current.getMonth() === today.getMonth();
|
|
|
-
|
|
|
- let maxWeek = totalWeeks;
|
|
|
- if (isCurrentMonth) {
|
|
|
- // 当前月份,只显示到当前周
|
|
|
- const firstDayOfMonth = new Date(current.getFullYear(), current.getMonth(), 1);
|
|
|
- const firstWeekday = firstDayOfMonth.getDay() === 0 ? 7 : firstDayOfMonth.getDay();
|
|
|
- const currentWeekInMonth = Math.ceil((today.getDate() + firstWeekday - 1) / 7);
|
|
|
- maxWeek = Math.min(totalWeeks, currentWeekInMonth);
|
|
|
- }
|
|
|
-
|
|
|
- for (let i = 1; i <= maxWeek; i++) {
|
|
|
- weeks.push({
|
|
|
- label: `第${i}周`,
|
|
|
- value: i.toString()
|
|
|
- });
|
|
|
- }
|
|
|
+ const weeks: { label: string, value: string }[] = [];
|
|
|
+ // const totalWeeks = currentWeekRange.value?.totalWeeks || 1;
|
|
|
+
|
|
|
+ // // 计算当前周数
|
|
|
+ // const today = new Date();
|
|
|
+ // const current = new Date(currentYear.value, currentMonth.value - 1, 1);
|
|
|
+ // const isCurrentMonth = current.getFullYear() === today.getFullYear() &&
|
|
|
+ // current.getMonth() === today.getMonth();
|
|
|
+
|
|
|
+ // let maxWeek = totalWeeks;
|
|
|
+ // if (isCurrentMonth) {
|
|
|
+ // // 当前月份,只显示到当前周
|
|
|
+ // const firstDayOfMonth = new Date(current.getFullYear(), current.getMonth(), 1);
|
|
|
+ // const firstWeekday = firstDayOfMonth.getDay() === 0 ? 7 : firstDayOfMonth.getDay();
|
|
|
+ // const currentWeekInMonth = Math.ceil((today.getDate() + firstWeekday - 1) / 7);
|
|
|
+ // maxWeek = Math.min(totalWeeks, currentWeekInMonth);
|
|
|
+ // }
|
|
|
+
|
|
|
+ // for (let i = 1; i <= maxWeek; i++) {
|
|
|
+ // weeks.push({
|
|
|
+ // label: `第${i}周`,
|
|
|
+ // value: i.toString()
|
|
|
+ // });
|
|
|
+ // }
|
|
|
return weeks;
|
|
|
});
|
|
|
|
|
|
@@ -267,7 +261,8 @@ const calendarButtonClass = computed(() => {
|
|
|
const options1 = computed(() => {
|
|
|
return {
|
|
|
title: {
|
|
|
- text: statistics.value.totalQuestions.toString(),
|
|
|
+ // text: statistics.value.totalQuestions.toString(),
|
|
|
+ text: '0',
|
|
|
subtext: '{a|刷题总量}',
|
|
|
left: 'center',
|
|
|
top: '34%',
|
|
|
@@ -322,7 +317,8 @@ const options1 = computed(() => {
|
|
|
});
|
|
|
|
|
|
const options2 = computed(() => {
|
|
|
- const accuracy = Math.round(statistics.value.averageAccuracy * 100);
|
|
|
+ // const accuracy = Math.round(statistics.value.averageAccuracy * 100);
|
|
|
+ const accuracy = 0;
|
|
|
|
|
|
return {
|
|
|
title: {
|
|
|
@@ -404,19 +400,24 @@ const tableColumns = ref<TableColumnConfig[]>([
|
|
|
|
|
|
// 表格数据(从 selected 数据转换)
|
|
|
const tableDate = computed(() => {
|
|
|
- return selected.value.map(item => ({
|
|
|
- date: item.date.replace(/-/g, '.'),
|
|
|
- questionNum: item.questionNum, // 使用 composable 中的数据
|
|
|
- correctNum: Math.round(item.info * 100) + '%' // 四舍五入到整数
|
|
|
- }));
|
|
|
+ // return selected.value.map(item => ({
|
|
|
+ // date: item.date.replace(/-/g, '.'),
|
|
|
+ // questionNum: item.questionNum, // 使用 composable 中的数据
|
|
|
+ // correctNum: Math.round(item.info * 100) + '%' // 四舍五入到整数
|
|
|
+ // }));
|
|
|
+ return [];
|
|
|
});
|
|
|
|
|
|
// 练习天数统计
|
|
|
-const practiceDate = computed(() => statistics.value.practiceDays);
|
|
|
+const practiceDate = computed(() => {
|
|
|
+ // return statistics.value.practiceDays;
|
|
|
+ return 0;
|
|
|
+});
|
|
|
|
|
|
// 累计刷题天数统计
|
|
|
const totalPracticeDays = computed(() => {
|
|
|
- return statistics.value.totalPracticeDays;
|
|
|
+ // return statistics.value.totalPracticeDays;
|
|
|
+ return 0;
|
|
|
});
|
|
|
|
|
|
// 日历标题
|