hookehuyr

feat(教师端): 在作业管理页面添加打卡类型显示并在主页增加全部作业选项

在作业管理页面添加打卡类型的显示,方便教师快速识别不同类型的打卡任务
在作业主页的作业筛选器中增加"全部作业"选项,默认显示所有作业
<!--
* @Date: 2025-11-19 21:00:00
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-12-15 10:18:41
* @LastEditTime: 2025-12-15 11:39:57
* @FilePath: /mlaj/src/views/teacher/taskHomePage.vue
* @Description: 教师端作业主页(头部介绍、统计、日历与学生完成情况)
-->
......@@ -277,10 +277,12 @@ const selectedSubtaskId = ref('')
const subtask_list = ref([])
const subtask_columns = computed(() => {
return subtask_list.value.map(item => ({ text: item.title, value: item.id }))
const list = subtask_list.value.map(item => ({ text: item.title, value: item.id }))
return [{ text: '全部作业', value: '' }, ...list]
})
const current_subtask_name = computed(() => {
if (!selectedSubtaskId.value) return '全部作业'
const found = subtask_list.value.find(item => item.id === selectedSubtaskId.value)
return found ? found.title : ''
})
......
<!--
* @Date: 2025-11-19 10:18:00
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-12-05 22:15:53
* @LastEditTime: 2025-12-15 11:42:16
* @FilePath: /mlaj/src/views/teacher/taskManagePage.vue
* @Description: 教师端作业管理页面
-->
......@@ -24,6 +24,8 @@
<!-- 中间内容:占据剩余空间 -->
<div class="left flex-1">
<div class="taskTitle text-sm font-semibold text-gray-800">{{ task.title }}</div>
<!-- 打卡类型 -->
<div class="taskType text-xs text-gray-600 mt-1">打卡类型:{{ checkinTypeMap[task.task_type] || '未知' }}</div>
<div class="taskDates text-xs text-gray-600 mt-1">开始时间:{{ dayjs(task.begin_date).format('YYYY-MM-DD') }}</div>
<div v-if="task.end_date" class="taskDates text-xs text-gray-600 mt-1">截止时间:{{ dayjs(task.end_date).format('YYYY-MM-DD') }}</div>
</div>
......@@ -91,6 +93,12 @@ const onLoad = async () => {
}
}
const checkinTypeMap = {
'checkin': '快捷打卡',
'upload': '图文打卡',
'count': '计数打卡',
}
/**
* 格式化日期范围
* @param {string} begin_date - 开始时间
......