刘洋 2 ani în urmă
părinte
comite
720d12c319

+ 5 - 3
src/components/shared/ScoringPanel.vue

@@ -57,8 +57,8 @@ const props = withDefaults(
   { modal: false, toggleModal: true, score: () => [], mainNumber: null, id: null, autoVisible: true }
 )
 
-const emits = defineEmits(['submit', 'update:score', 'update:visible'])
-
+const emits = defineEmits(['submit', 'update:score', 'update:visible', 'update:modal'])
+const dialogModeBeforeSubmit = ref<boolean>(false)
 const dialogMode = ref<boolean>(props.modal)
 
 const LessRenderComponent = defineComponent({
@@ -87,8 +87,9 @@ const activeIndex = ref<number | null>(0)
 
 const scoreValidFail = ref<boolean[]>([])
 
-watch(modalVisible, () => {
+watch(modalVisible, (val) => {
   activeIndex.value = 0
+  dialogMode.value = dialogModeBeforeSubmit.value
 })
 
 const { fetch: getQuestionStruct, reset: resetQuestionStruct, result: questionStruct } = useFetch('getQuestionStruct')
@@ -136,6 +137,7 @@ const onSubmit = () => {
 }
 
 const onEnter = (index: number) => {
+  dialogModeBeforeSubmit.value = dialogMode.value
   nextTick(() => {
     if (scoreValues.value.length >= questionList.value?.length) {
       const nullScoreIndex = scoreValues.value?.findIndex((v) => !`${v}`)

+ 7 - 1
src/components/shared/ScoringPanelWithConfirm.vue

@@ -18,7 +18,13 @@
     <div class="text-center m-t-base confirm-text">确认提交?</div>
     <template #footer>
       <div class="flex items-center justify-between">
-        <el-button ref="confirmButtonRef" class="confirm-button" type="primary" @click="onConfirmSubmit">
+        <el-button
+          :disabled="!modelScore.length"
+          ref="confirmButtonRef"
+          class="confirm-button"
+          type="primary"
+          @click="onConfirmSubmit"
+        >
           是(Y)
         </el-button>
         <el-button class="confirm-button" plain @click="onCancelSubmit">否(N)</el-button>

+ 0 - 1
src/hooks/useFetch.ts

@@ -66,7 +66,6 @@ function useFetch<K extends ApiKeys>(k: K, ...args: any[]) {
 
       option.data = { ...option.data, ...((useData && data) || {}) }
       option.params = { ...option.params, ...((!useData && data) || {}) }
-      console.log('oooooo', option)
 
       result.value = await request[method](option.url, useData ? option.data : option, option)
       return result.value

+ 1 - 1
src/modules/admin-exam/edit-exam/index.vue

@@ -80,7 +80,7 @@ const items: EpFormItem[] = [
     slot: { options: [{ value: 'MOUSE', label: '键盘鼠标模式' }] },
   }),
   span8({
-    label: '在线评卷时长',
+    label: '在线评卷时长(分钟)',
     slotType: 'inputNumber',
     prop: 'maxMarkingDuration',
     slot: { stepStrictly: true, step: 1 },

+ 6 - 4
src/modules/marking/mark/index.vue

@@ -185,7 +185,9 @@ const refreshTaskPool = (force = false, isRefresh = false) => {
   }
   refreshTimer = window.setTimeout(
     () => {
-      if (currentTaskPool.length < (isRefresh ? Number.MAX_SAFE_INTEGER : CACHE_NUM)) {
+      // alert(currentTaskPool.length)
+      // if (currentTaskPool.length < (isRefresh ? Number.MAX_SAFE_INTEGER : CACHE_NUM)) {
+      if (currentTaskPool.length < Number.MAX_SAFE_INTEGER) {
         getMarkingTask().then((result) => {
           if (result?.length) {
             currentTaskPool[isRefresh ? 'unshift' : 'push'](...result)
@@ -197,7 +199,7 @@ const refreshTaskPool = (force = false, isRefresh = false) => {
         })
       }
     },
-    force ? 0 : 5000
+    force ? 0 : 8000
   )
 }
 
@@ -321,8 +323,8 @@ const onBack = () => {
 }
 
 /** 刷新 */
-const onRefresh = () => {
-  getMarkStatus()
+const onRefresh = async () => {
+  await getMarkStatus()
 
   useFetch('clearCachedTasks')
     .fetch()