Browse Source

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

shmily1213 6 tháng trước cách đây
mục cha
commit
5aec76b570

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

@@ -10,16 +10,18 @@ export default {
       formTranslateReady: false
     }
   },
-  beforeMount() {
+  created() {
     this.loadTranslateForm()
   },
   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() {
       //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: {
     'options.queryParams': {
-      immediate: true,
+      immediate: false,
       handler: function() {
         console.log('watched options', this.options, this.propDefines, this.isFrontMaster)
         if (!this.options.queryApi) return
         this.resetQuery()
       }
+    },
+    formTranslateReady() {
+      this.resetQuery()
     }
   },
   methods: {
@@ -107,7 +110,7 @@ export default {
         ...this.options.queryParams
       }).then(res => {
         this.dataList = res.rows
-        if (this.formTranslateReady) this.dataList.forEach(this.translateForm)
+        this.dataList.forEach(this.translateForm)
         this.total = res.total
         const displayStatus = this.getLatestApplyStatus()
         this.$emit('statusComputed', displayStatus)