Преглед на файлове

修改班主任申请字典加载时机

shmily1213 преди 8 месеца
родител
ревизия
5aec76b570
променени са 2 файла, в които са добавени 14 реда и са изтрити 9 реда
  1. 9 7
      src/components/Cache/modules/mx-form-translate-mixin.js
  2. 5 2
      src/views/system/user/profile/components/headteacher-form-list.vue

+ 9 - 7
src/components/Cache/modules/mx-form-translate-mixin.js

@@ -10,16 +10,18 @@ export default {
       formTranslateReady: false
       formTranslateReady: false
     }
     }
   },
   },
-  beforeMount() {
+  created() {
     this.loadTranslateForm()
     this.loadTranslateForm()
   },
   },
   methods: {
   methods: {
-    async loadTranslateForm() {
-      this.formTypeList = await this.getFormTypeListByCache()
-      this.formStatusList = await this.getFormStatusListByCache()
-      this.formAuditList = await this.getFormAuditListByCache()
-      this.formTranslateReady = true
-      this.translateFormReady()
+    loadTranslateForm() {
+      Promise.all([this.getFormTypeListByCache(), this.getFormStatusListByCache(), this.getFormAuditListByCache()]).then(res => {
+        this.formTypeList = res[0];
+        this.formStatusList = res[1];
+        this.formAuditList = res[2];
+        this.formTranslateReady = true
+        this.translateFormReady()
+      });
     },
     },
     translateFormReady() {
     translateFormReady() {
       //to be overrided for non-computed needs
       //to be overrided for non-computed needs

+ 5 - 2
src/views/system/user/profile/components/headteacher-form-list.vue

@@ -87,12 +87,15 @@ export default {
   },
   },
   watch: {
   watch: {
     'options.queryParams': {
     'options.queryParams': {
-      immediate: true,
+      immediate: false,
       handler: function() {
       handler: function() {
         console.log('watched options', this.options, this.propDefines, this.isFrontMaster)
         console.log('watched options', this.options, this.propDefines, this.isFrontMaster)
         if (!this.options.queryApi) return
         if (!this.options.queryApi) return
         this.resetQuery()
         this.resetQuery()
       }
       }
+    },
+    formTranslateReady() {
+      this.resetQuery()
     }
     }
   },
   },
   methods: {
   methods: {
@@ -107,7 +110,7 @@ export default {
         ...this.options.queryParams
         ...this.options.queryParams
       }).then(res => {
       }).then(res => {
         this.dataList = res.rows
         this.dataList = res.rows
-        if (this.formTranslateReady) this.dataList.forEach(this.translateForm)
+        this.dataList.forEach(this.translateForm)
         this.total = res.total
         this.total = res.total
         const displayStatus = this.getLatestApplyStatus()
         const displayStatus = this.getLatestApplyStatus()
         this.$emit('statusComputed', displayStatus)
         this.$emit('statusComputed', displayStatus)