浏览代码

feat: 1. 问题卷浏览; 2. 自定义查询修改给分后刷新表格

chenhao 2 年之前
父节点
当前提交
ea9b658d16

+ 5 - 0
src/api/api-types/marking.d.ts

@@ -166,6 +166,9 @@ export namespace Marking {
 
   type MarkProblemPaper = BaseDefine<{ id?: number; scores: number[] }>
 
+  /** 问题卷浏览 */
+  type ViewProblemPaper = BaseDefine<{ id: number }>
+
   interface MarkScoreHistory {
     id: number
     markScore: number
@@ -331,6 +334,8 @@ export namespace Marking {
     getProblemHistory: GetProblemHistory
     /** 问题卷打分 */
     markProblemPaper: MarkProblemPaper
+    /** 问题卷浏览 */
+    viewProblemPaper: ViewProblemPaper
     /** 通过taskId 查询给分记录 */
     getMarkScoreHistoryListWithTask: GetMarkScoreHistoryListWithTask
     /** 打回 */

+ 2 - 0
src/api/marking.ts

@@ -40,6 +40,8 @@ const MarkingApi: DefineApiModule<Marking.ApiMap> = {
   getProblemHistory: '/api/problem/history/page',
   /** 问题卷打分 */
   markProblemPaper: '/api/problem/history/mark',
+  /** 问题卷浏览 */
+  viewProblemPaper: 'api/problem/history/view',
   /** 通过taskId 查询给分记录 */
   getMarkScoreHistoryListWithTask: '/api/mark/history/task',
   /** 打回 */

+ 3 - 2
src/modules/marking/inquiry-result/index.vue

@@ -310,9 +310,10 @@ const onConfirmSetExpert = async () => {
 }
 
 /** 确定给分 */
-const onSubmit = () => {
+const onSubmit = async () => {
   if (current.value) {
-    useFetch('updateCustomPaperScore').fetch({ taskId: current.value.taskId, scores: modelScore.value })
+    await useFetch('updateCustomPaperScore').fetch({ taskId: current.value.taskId, scores: modelScore.value })
+    await fetchTable()
   }
 }
 

+ 6 - 0
src/modules/marking/problem/index.vue

@@ -228,6 +228,12 @@ const {
   onCurrentChange,
 } = useTableCheck(problemHistory)
 
+watch(currentProblem, () => {
+  if (currentProblem.value) {
+    useFetch('viewProblemPaper').fetch({ id: currentProblem.value.id })
+  }
+})
+
 const onSearch = async () => {
   getProblemHistory(formModel)
 }