Просмотр исходного кода

feat:修改查询行为记录时,创建时间的显示格式

wuzilong 1 год назад
Родитель
Сommit
de60701aa8
1 измененных файлов с 9 добавлено и 2 удалено
  1. 9 2
      src/views/CorrectPage/CorrectPage.vue

+ 9 - 2
src/views/CorrectPage/CorrectPage.vue

@@ -44,7 +44,11 @@
             <span>{{ scope.row.recordFileUrl }}</span>
           </template> 
         </el-table-column>
-        <el-table-column prop="time" label="时间"></el-table-column>
+        <el-table-column prop="createdAt" label="时间">
+          <template #default="scope">
+            {{ formatDateTime(scope.row.createdAt) }} <!-- 调用格式化函数 -->
+          </template>
+        </el-table-column>
         <el-table-column prop="studentId" label="学生 ID"></el-table-column>
       </el-table>
 
@@ -72,7 +76,10 @@ import { useRoute } from 'vue-router'
 import StudentEssay from "../Home/component/StudentEssay/StudentEssay.vue";
 import StudentWritingRequirements from "../Home/component/StudentEssay/StudentWritingRequirements.vue";
 import Remark from "../Home/component/Remark/Remark.vue";
-
+import dayjs from 'dayjs';
+const formatDateTime = (isoString: string): string => {
+  return dayjs(isoString).format('YYYY-MM-DD HH:mm:ss');
+};
 
 // 获得路由中的assignmentId
 const route = useRoute()