hookehuyr

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

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