浏览代码

fix: bug[4506]: 给分板弹出后,不输入分值可以直接点确定。

chenhao 2 年之前
父节点
当前提交
b29ae1ec8f
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/components/shared/ScoringPanel.vue

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

@@ -23,7 +23,7 @@
       </template>
     </div>
     <template #footer>
-      <el-button type="primary" class="full-w m-t-base" @click="onSubmit">确定</el-button>
+      <el-button type="primary" class="full-w m-t-base" :disabled="!allowSubmit" @click="onSubmit">确定</el-button>
     </template>
   </scoring-panel-container>
 </template>
@@ -116,6 +116,10 @@ const questionList = computed(() => {
   return questionList.map((q) => ({ ...q, mainNumber, mainTitle }))
 })
 
+const allowSubmit = computed(() => {
+  return scoreValues.value?.length === questionList.value?.length
+})
+
 const onSubmit = () => {
   emits('submit', questionStruct.value)
 }