Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
mlaj
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2025-12-08 10:23:26 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
af98e007a484dd920f70980b4ddb56aa05ed7bb7
af98e007
1 parent
99ed82e7
feat(任务管理): 统一日期显示格式并使用dayjs格式化
在任务管理和主页页面中,将日期显示从原始格式改为使用dayjs统一格式化为'YYYY-MM-DD'格式
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
src/views/teacher/taskHomePage.vue
src/views/teacher/taskManagePage.vue
src/views/teacher/taskHomePage.vue
View file @
af98e00
<!--
* @Date: 2025-11-19 21:00:00
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-12-0
2 22:28:25
* @LastEditTime: 2025-12-0
5 22:31:03
* @FilePath: /mlaj/src/views/teacher/taskHomePage.vue
* @Description: 教师端作业主页(头部介绍、统计、日历与学生完成情况;数据Mock)
-->
...
...
@@ -19,7 +19,8 @@
<div class="details text-sm text-gray-600">
<div class="detailItem">周期:{{ task_details.cycle }}</div>
<div class="detailItem">频次:{{ task_details.frequency }}</div>
<div class="detailItem">时间段:{{ task_details.time_range }}</div>
<div class="detailItem">开始时间:{{ task_details.begin_date }}</div>
<div class="detailItem">截止时间:{{ task_details.end_date }}</div>
<div class="detailItem">附件类型:{{ task_details.attachment_type }}</div>
</div>
</div>
...
...
@@ -111,6 +112,7 @@ import { useRoute, useRouter } from 'vue-router'
import { useTitle } from '@vueuse/core'
import checkCorner from '@/assets/images/dui.png'
import { getTeacherTaskDetailAPI } from '@/api/teacher'
import dayjs from 'dayjs'
const $route = useRoute()
const $router = useRouter()
...
...
@@ -263,7 +265,9 @@ async function fetchData() {
task_details.value = {
cycle: cycleText,
frequency: `每周期${res.data.frequency || 1}次`,
time_range: `${res.data.begin_date || '00:00'} ~ ${res.data.end_date || '23:59'}`, // 注意:API返回的begin_date/end_date可能是日期也可能是时间,这里暂且直接展示
begin_date: dayjs(res.data.begin_date).format('YYYY-MM-DD'),
end_date: dayjs(res.data.end_date).format('YYYY-MM-DD'),
// time_range: `${res.data.begin_date || '00:00'} ~ ${res.data.end_date || '23:59'}`, // 注意:API返回的begin_date/end_date可能是日期也可能是时间,这里暂且直接展示
attachment_type: attachmentText
}
...
...
src/views/teacher/taskManagePage.vue
View file @
af98e00
<!--
* @Date: 2025-11-19 10:18:00
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-12-0
1 14:30:47
* @LastEditTime: 2025-12-0
5 22:15:53
* @FilePath: /mlaj/src/views/teacher/taskManagePage.vue
* @Description: 教师端作业管理页面
-->
...
...
@@ -24,7 +24,8 @@
<!-- 中间内容:占据剩余空间 -->
<div class="left flex-1">
<div class="taskTitle text-sm font-semibold text-gray-800">{{ task.title }}</div>
<div class="taskDates text-xs text-gray-600 mt-1">{{ format_date_range(task.begin_date, task.end_date) }}</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>
<!-- 右侧按钮:占用较小空间,右对齐 -->
<div class="right flex items-center justify-end w-20 ml-3">
...
...
@@ -42,6 +43,7 @@ import { ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useTitle } from '@vueuse/core'
import { getTeacherTaskListAPI } from '@/api/teacher'
import dayjs from 'dayjs'
const $route = useRoute()
const $router = useRouter()
...
...
Please
register
or
login
to post a comment