Parcourir la source

逆变器、风机初始化加载默认场站查询问题

xusl il y a 6 mois
Parent
commit
dc56a59080

+ 4 - 3
cpp-ui/src/views/configManager/inverterinfo/index.vue

@@ -231,7 +231,7 @@ export default {
     this.getStationCode()
   },
   mounted() {
-    this.dataQuery()
+
   },
   computed: {},
   methods: {
@@ -425,13 +425,14 @@ export default {
         this.loading = false
       })
     },
-    getStationCode() {
-      this.$axios({url: '/electricfield/all', method: 'get'}).then(response => {
+    async getStationCode() {
+      await this.$axios({url: '/electricfield/all', method: 'get'}).then(response => {
         this.stationList = response.data
         if (this.stationList.length > 0) {
           this.stationCode = this.stationList[0].value
         }
       })
+      this.dataQuery()
     },
   }
 }

+ 6 - 5
cpp-ui/src/views/configManager/windturbineinfo/index.vue

@@ -214,7 +214,7 @@ export default {
       pageSize: 10,
       currentPage: 1,
       stationList: [],
-      stationCode: [],
+      stationCode: '',
       searchForm: {},
       tableData: [],
       loading: false,
@@ -260,7 +260,7 @@ export default {
     this.getStationCode()
   },
   mounted() {
-    this.dataQuery()
+
   },
   computed: {},
   methods: {
@@ -456,7 +456,7 @@ export default {
       this.pageSize = pageSize
       this.dataQuery();
     },
-    dataQuery() {
+    async dataQuery() {
       this.loading = true
       const param = {
         "currentPage": this.currentPage,
@@ -472,13 +472,14 @@ export default {
         this.loading = false
       })
     },
-    getStationCode() {
-      this.$axios({url: '/electricfield/all', method: 'get'}).then(response => {
+    async getStationCode() {
+      await this.$axios({url: '/electricfield/all', method: 'get'}).then(response => {
         this.stationList = response.data
         if (this.stationList.length > 0) {
           this.stationCode = this.stationList[0].value
         }
       })
+      this.dataQuery()
     },
   }
 }