刘洋 2 years ago
parent
commit
81a2b621db
2 changed files with 25 additions and 13 deletions
  1. 0 11
      src/hooks/useSetImgBg.ts
  2. 25 2
      src/modules/marking/mark/index.vue

+ 0 - 11
src/hooks/useSetImgBg.ts

@@ -130,17 +130,6 @@ export const useSetImgBg = (option: Ref<SetImgBgOption>, frontColor?: Ref<string
 
           if (!image) return
           createImageBitmap(image).then((imageBitMap) => {
-            console.log('imageBitMap:', imageBitMap)
-            console.log('22222', {
-              type: 'init',
-              imageBitMap,
-              basePoint: opt.basePoint,
-              enableSharpen: opt.enableSharpen,
-              distance: opt.distance,
-              scale: opt.scale,
-              rotate: opt.rotate,
-            })
-
             imageWorker.postMessage(
               {
                 type: 'init',

+ 25 - 2
src/modules/marking/mark/index.vue

@@ -252,6 +252,10 @@ const onSubmit: InstanceType<typeof ScoringPanelWithConfirm>['onSubmit'] = async
       taskId: currentTask.value.taskId,
       taskType: currentTask.value.taskType,
     })
+    let bool = await checkMarkStatus()
+    if (!bool) {
+      return false
+    }
     await getNextTask(true, submitResult?.refresh)
   } catch (error) {
     console.error(error)
@@ -289,6 +293,10 @@ const onSubmitProblem = async () => {
     taskId: currentTask.value.taskId,
     taskType: currentTask.value.taskType,
   })
+  let bool = await checkMarkStatus()
+  if (!bool) {
+    return false
+  }
   await getNextTask(true, submitResult?.refresh)
 }
 
@@ -320,10 +328,25 @@ const onBack = () => {
     })
   }
 }
-
+const checkMarkStatus = async (): Promise<boolean> => {
+  let res: any = await getMarkStatus()
+  if (!!res.personDayCount && res.markedCount === res.personDayCount) {
+    ElMessage.success(`您当天的任务量${res.persionDayCount}已完成`)
+    return false
+  } else if (!!res.totalCount && res.markedCount === res.totalCount) {
+    ElMessage.success(`任务量${res.totalCount}已完成`)
+    return false
+  } else {
+    return true
+  }
+}
 /** 刷新 */
 const onRefresh = async () => {
-  await getMarkStatus()
+  // await getMarkStatus()
+  let bool = await checkMarkStatus()
+  if (!bool) {
+    return false
+  }
 
   // useFetch('clearCachedTasks')
   //   .fetch()