zhangjie před 8 měsíci
rodič
revize
33a2810e3a

+ 10 - 5
src/render/views/AbsentCheck/CheckAction.vue

@@ -251,12 +251,17 @@ const questionInfo = computed(() => {
 
 const questions = ref([] as string[]);
 watch(
-  () => dataCheckStore.curPageIndex,
-  (val, oldval) => {
-    if (val !== oldval) {
-      if (!dataCheckStore.curPage || !dataCheckStore.curPage.question) return;
-      questions.value = [...dataCheckStore.curPage.question.result];
+  () => dataCheckStore.curPage?.question?.result,
+  (val) => {
+    if (!val) {
+      questions.value = [];
+      return;
     }
+    questions.value = [...val];
+  },
+  {
+    deep: true,
+    immediate: true,
   }
 );
 

+ 3 - 2
src/render/views/DataCheck/QuestionPanel.vue

@@ -76,6 +76,7 @@
         class="queston-edit"
         :style="quesionEditStyle"
         v-ele-click-outside-directive="hideEditQuestion"
+        @keydown.stop
         @keyup.enter="onSaveQuesion"
       >
         <a-input
@@ -181,7 +182,7 @@ const panelBodyRef = ref();
 function onEditQuestion(index: number) {
   curQuestionIndex.value = index;
   const qcont = questionList.value[curQuestionIndex.value];
-  curQuestion.value = qcont.split("").join(",");
+  curQuestion.value = qcont;
 
   quesionEditShow.value = true;
   updateQuestionEditPos(index);
@@ -210,7 +211,7 @@ function onSaveQuesion() {
     message.error("请输入答案!");
     return;
   }
-  const questionCont = curQuestion.value.split(",").join("");
+  const questionCont = curQuestion.value;
 
   if (!questionCont) {
     message.error("请输入答案!");