Kaynağa Gözat

در پرسشنامه‌ی رویداد،‌ دکمه‌ی ثبت حذف شود. با رفتن به سوال قبلی و بعدی، پاسخ اندیشه‌جو ثبت شود و نیازی به زدن دکمه ثبت نباشد.

hgh 1 yıl önce
ebeveyn
işleme
e1e4a8c916

+ 1 - 36
src/components/Widgets/Other/Shop/ShopCompleteInfo/components/AllQuestions.vue

@@ -68,11 +68,9 @@ import { shallowRef } from 'vue'
 import { EntityCreate } from 'quasar-crud'
 import { APIGateway } from 'src/api/APIGateway.js'
 import { AnswerBook } from 'src/models/AnswerBook.js'
-import BtnControl from 'src/components/Control/btn.vue'
 import { FormBuilderAssist } from 'quasar-form-builder'
 import QuestionChoices from 'src/components/FormBuilderCustumComponents/QuestionChoices/QuestionChoices.vue'
 
-const BtnControlComp = shallowRef(BtnControl)
 const QuestionChoicesComp = shallowRef(QuestionChoices)
 
 export default {
@@ -122,40 +120,7 @@ export default {
           { type: 'input', name: 'answer_text', label: 'متن پاسخ', placeholder: ' ', value: answerSheetItem.answer_text, inputType: 'textarea', col: 'col-12' },
           { type: 'file', name: 'answer_attachment', label: 'فایل پیوست', placeholder: ' ', value: answerSheetItem.answer_attachment, col: 'col-12' },
           { type: 'hidden', name: 'answer_book', value: this.answerBook.id },
-          { type: 'hidden', name: 'test_question', value: answerSheetItem.test_question },
-          {
-            type: BtnControlComp,
-            name: 'btn',
-            responseKey: 'btn',
-            label: 'ثبت پاسخ',
-            placeholder: ' ',
-            atClick: () => {
-              this.sendAnswer(answerSheetIndex)
-              // const answerText = FormBuilderAssist.getInputsByName(this.questionInputs[answerSheetIndex], 'answer_text').value
-              // if (!answerText && !hasChoise) {
-              //   this.$q.notify({
-              //     type: 'negative',
-              //     message: 'لطفا متن پاسخ را کامل کنید.'
-              //   })
-              //   return
-              // }
-              // const entityCreate = this.$refs['entityCreate_' + answerSheetIndex.toString()][0]
-              // entityCreate.entityLoading = true
-              // entityCreate.createEntity(false)
-              //   .then(() => {
-              //     if (this.questionPanel < this.answerBook.answer_sheet_info.list.length) {
-              //       this.changeQuestion(this.questionPanel + 1)
-              //     } else if (this.questionPanel === this.answerBook.answer_sheet_info.list.length) {
-              //       this.confirmAnswers()
-              //     }
-              //     entityCreate.entityLoading = false
-              //   })
-              //   .catch(() => {
-              //     entityCreate.entityLoading = false
-              //   })
-            },
-            col: 'col-12 flex justify-end'
-          }
+          { type: 'hidden', name: 'test_question', value: answerSheetItem.test_question }
         ]
 
         if (hasChoise) {