ali преди 2 години
родител
ревизия
95d6889b57

+ 6 - 6
src/components/FormBuilderCustumComponents/FormBuilderInputEditor.vue

@@ -1,12 +1,9 @@
 <template>
-  <div class="form-builder-editor"
-       :class="customClass">
+  <div class="form-builder-editor">
     <p v-text="label" />
     <q-editor v-if="!disable && !readonly"
               ref="editor"
               v-model="inputData"
-              :class="customClass"
-              :content-class="customClass"
               :name="name"
               :dense="$q.screen.lt.md"
               :toolbar="[
@@ -79,8 +76,7 @@
                 times_new_roman: 'Times New Roman',
                 verdana: 'Verdana',
               }"
-              @update:model-value="change($event)"
-              @click="onClick"
+              @update:model-value="onChangeText"
               @paste="onPaste">
       <template v-slot:colorpicker>
         <q-btn-dropdown ref="token"
@@ -176,6 +172,10 @@ export default {
     onPaste () {
       this.inputData = this.inputData.replaceAll(/<!--\[if .*endif\]-->/gms, 'ferret')
     },
+    onChangeText (event) {
+      this.change(event)
+      this.$emit('update:value', event)
+    },
     setColor (cmd, name) {
       const edit = this.$refs.editor
       this.$refs.token.hide()

+ 4 - 12
src/components/Widgets/TestSet/AdminEventTestSetShow/AdminEventTestSetShow.vue

@@ -30,13 +30,12 @@ import { shallowRef } from 'vue'
 import { EntityEdit } from 'quasar-crud'
 import { mixinWidget } from 'src/mixin/Mixins.js'
 import { APIGateway } from 'src/api/APIGateway.js'
-import { FormBuilderAssist } from 'quasar-form-builder'
 import BtnControl from 'src/components/Control/btn.vue'
-// import QuestionsSelector from 'src/components/FormBuilderCustumComponents/QuestionsSelector/QuestionsSelector.vue'
+import FormBuilderInputEditor from 'src/components/FormBuilderCustumComponents/FormBuilderInputEditor.vue'
 import QuestionsCreateAndAppend from 'src/components/FormBuilderCustumComponents/QuestionsCreateAndAppend/QuestionsCreateAndAppend.vue'
 
 const BtnControlComp = shallowRef(BtnControl)
-// const QuestionsSelectorComp = shallowRef(QuestionsSelector)
+const FormBuilderInputEditorComp = shallowRef(FormBuilderInputEditor)
 const QuestionsCreateAndAppendComp = shallowRef(QuestionsCreateAndAppend)
 
 export default {
@@ -53,25 +52,18 @@ export default {
       entityParamKey: 'id',
       inputs: [
         { type: 'input', name: 'title', responseKey: 'title', label: 'عنوان پرسشنامه', placeholder: ' ', col: 'col-md-12 col-12' },
-        { type: 'inputEditor', name: 'description', responseKey: 'description', label: 'توضیحات پرسشنامه', col: 'col-md-12 col-12' },
+        { type: FormBuilderInputEditorComp, name: 'description', responseKey: 'description', label: 'توضیحات پرسشنامه', col: 'col-md-12 col-12' },
         { type: 'hidden', name: 'id', responseKey: 'id' },
         { type: 'hidden', name: 'type', responseKey: 'type', value: 'QUESTIONNAIRE' },
-        // { type: BtnControlComp, name: 'btnCreateQuestion', responseKey: 'btnCreateQuestion', label: 'تعریف سوال جدید', placeholder: ' ', atClick: () => {}, col: 'col-12 flex justify-end' },
-        // { type: QuestionsSelectorComp, name: 'test_set_questions', responseKey: 'test_set_questions', unitId: false, questionType: 'EVENT', col: 'col-md-12 col-12' },
         { type: QuestionsCreateAndAppendComp, name: 'test_set_questions', responseKey: 'test_set_questions', testSetId, questionType: 'EVENT', ignoreValue: true, col: 'col-md-12 col-12' },
-        { type: BtnControlComp, name: 'btn', responseKey: 'btn', label: 'تایید نهایی', placeholder: ' ', atClick: () => {}, col: 'col-12 flex justify-end' }
+        { type: BtnControlComp, name: 'btn', responseKey: 'btn', label: 'تایید نهایی', placeholder: ' ', atClick: this.edit, col: 'col-12 flex justify-end' }
       ]
     }
   },
   mounted() {
-    this.setActionBtn()
     this.mounted = true
   },
   methods: {
-    setActionBtn () {
-      FormBuilderAssist.setAttributeByName(this.inputs, 'btn', 'atClick', this.edit)
-      FormBuilderAssist.setAttributeByName(this.inputs, 'btnCreateQuestion', 'atClick', this.goToCreateQuestionPage)
-    },
     goToCreateQuestionPage () {
       this.$router.push({ name: 'Admin.Event.TestSet.Questions.Create', params: { test_set_id: this.$route.params.test_set_id } })
     },