ali 2 роки тому
батько
коміт
611d39e81f
1 змінених файлів з 6 додано та 3 видалено
  1. 6 3
      src/pages/User/Profile/projectInfo.vue

+ 6 - 3
src/pages/User/Profile/projectInfo.vue

@@ -27,6 +27,7 @@
         <q-separator class="q-my-lg" />
         <entity-create v-if="projectLoaded && project.is_enabled_answering"
                        ref="entityCreate"
+                       :key="entityCreateKey"
                        v-model:value="attendanceSheetsInputs"
                        :api="attendanceSheetsApi"
                        :default-layout="false" />
@@ -71,6 +72,7 @@ export default {
     return {
       mounted: false,
       entityLoading: false,
+      entityCreateKey: Date.now(),
       projectLoaded: false,
       classroomLoaded: false,
       project: new Project(),
@@ -143,8 +145,7 @@ export default {
             to: { name: 'UserPanel.Profile.ClassroomInfo', params: { id: this.classroom.id } }
           },
           {
-            label: this.classroom.title,
-            to: { name: 'UserPanel.Profile.ClassroomInfo', params: { classroom_id: this.classroom.id, project_id: this.project.id } }
+            label: this.project.title
           }
         ]
       })
@@ -175,6 +176,7 @@ export default {
         })
         .catch(() => {
           this.entityLoading = false
+          this.entityCreateKey = Date.now()
           this.reloadProject()
         })
     },
@@ -198,8 +200,9 @@ export default {
       this.projectLoaded = true
     },
     setAttendanceSheetsInputsValues () {
+      const answerAttachment = this.currentUserAttendanceSheet?.answer_attachment // ? this.currentUserAttendanceSheet.answer_attachment : false
       FormBuilderAssist.setAttributeByName(this.attendanceSheetsInputs, 'answer_text', 'value', this.currentUserAttendanceSheet?.answer_text)
-      FormBuilderAssist.setAttributeByName(this.attendanceSheetsInputs, 'answer_attachment', 'value', this.currentUserAttendanceSheet?.answer_attachment)
+      FormBuilderAssist.setAttributeByName(this.attendanceSheetsInputs, 'answer_attachment', 'value', answerAttachment)
     },
     reloadProject () {
       this.$refs.projectEntityEdit.getData()