|
@@ -30,13 +30,12 @@ import { shallowRef } from 'vue'
|
|
|
import { EntityEdit } from 'quasar-crud'
|
|
import { EntityEdit } from 'quasar-crud'
|
|
|
import { mixinWidget } from 'src/mixin/Mixins.js'
|
|
import { mixinWidget } from 'src/mixin/Mixins.js'
|
|
|
import { APIGateway } from 'src/api/APIGateway.js'
|
|
import { APIGateway } from 'src/api/APIGateway.js'
|
|
|
-import { FormBuilderAssist } from 'quasar-form-builder'
|
|
|
|
|
import BtnControl from 'src/components/Control/btn.vue'
|
|
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'
|
|
import QuestionsCreateAndAppend from 'src/components/FormBuilderCustumComponents/QuestionsCreateAndAppend/QuestionsCreateAndAppend.vue'
|
|
|
|
|
|
|
|
const BtnControlComp = shallowRef(BtnControl)
|
|
const BtnControlComp = shallowRef(BtnControl)
|
|
|
-// const QuestionsSelectorComp = shallowRef(QuestionsSelector)
|
|
|
|
|
|
|
+const FormBuilderInputEditorComp = shallowRef(FormBuilderInputEditor)
|
|
|
const QuestionsCreateAndAppendComp = shallowRef(QuestionsCreateAndAppend)
|
|
const QuestionsCreateAndAppendComp = shallowRef(QuestionsCreateAndAppend)
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -53,25 +52,18 @@ export default {
|
|
|
entityParamKey: 'id',
|
|
entityParamKey: 'id',
|
|
|
inputs: [
|
|
inputs: [
|
|
|
{ type: 'input', name: 'title', responseKey: 'title', label: 'عنوان پرسشنامه', placeholder: ' ', col: 'col-md-12 col-12' },
|
|
{ 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: 'id', responseKey: 'id' },
|
|
|
{ type: 'hidden', name: 'type', responseKey: 'type', value: 'QUESTIONNAIRE' },
|
|
{ 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: 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() {
|
|
mounted() {
|
|
|
- this.setActionBtn()
|
|
|
|
|
this.mounted = true
|
|
this.mounted = true
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- setActionBtn () {
|
|
|
|
|
- FormBuilderAssist.setAttributeByName(this.inputs, 'btn', 'atClick', this.edit)
|
|
|
|
|
- FormBuilderAssist.setAttributeByName(this.inputs, 'btnCreateQuestion', 'atClick', this.goToCreateQuestionPage)
|
|
|
|
|
- },
|
|
|
|
|
goToCreateQuestionPage () {
|
|
goToCreateQuestionPage () {
|
|
|
this.$router.push({ name: 'Admin.Event.TestSet.Questions.Create', params: { test_set_id: this.$route.params.test_set_id } })
|
|
this.$router.push({ name: 'Admin.Event.TestSet.Questions.Create', params: { test_set_id: this.$route.params.test_set_id } })
|
|
|
},
|
|
},
|