소스 검색

修改风光场站下拉框过滤

xusl 6 달 전
부모
커밋
5a47ca2516

+ 17 - 0
cpp-admin/src/main/java/com/cpp/web/controller/configManager/ElectricFieldController.java

@@ -1,5 +1,6 @@
 package com.cpp.web.controller.configManager;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.cpp.common.core.domain.R;
 import com.cpp.web.domain.datafactory.SftpChannel;
@@ -252,4 +253,20 @@ public class ElectricFieldController {
         }
         return R.ok(list);
     }
+
+    @GetMapping("/findByType")
+    public R findByType(String type) {
+        QueryWrapper wrapper = new QueryWrapper<>();
+        wrapper.eq("electric_field_type_enum", type);
+        wrapper.orderByAsc("id");
+        List<ElectricField> electricFieldList = electricFieldService.list(wrapper);
+        List<Map<String, String>> list = new ArrayList<>();
+        for (ElectricField e : electricFieldList) {
+            Map<String, String> map = new HashMap<>();
+            map.put("label", e.getName());
+            map.put("value", e.getStationCode());
+            list.add(map);
+        }
+        return R.ok(list);
+    }
 }

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

@@ -425,7 +425,10 @@ export default {
       })
     },
     async getStationCode() {
-      await this.$axios({url: '/electricfield/all', method: 'get'}).then(response => {
+      const param = {
+        "type": 'E1',
+      }
+      await this.$axios.get('/electricfield/findByType',{params: param}).then(response => {
         this.stationList = response.data
         if (this.stationList.length > 0) {
           this.stationCode = this.stationList[0].value

+ 4 - 1
cpp-ui/src/views/configManager/windturbineinfo/index.vue

@@ -472,7 +472,10 @@ export default {
       })
     },
     async getStationCode() {
-      await this.$axios({url: '/electricfield/all', method: 'get'}).then(response => {
+      const param = {
+        "type": 'E2',
+      }
+      await this.$axios.get('/electricfield/findByType',{params: param}).then(response => {
         this.stationList = response.data
         if (this.stationList.length > 0) {
           this.stationCode = this.stationList[0].value

+ 4 - 1
cpp-ui/src/views/stationDataQuery/weatherstationstatusdata/index.vue

@@ -178,7 +178,10 @@ export default {
       })
     },
     getStationCode() {
-      this.$axios({url: '/electricfield/all', method: 'get'}).then(response => {
+      const param = {
+        "type": 'E1',
+      }
+      this.$axios.get('/electricfield/findByType',{params: param}).then(response => {
         this.stationList = response.data
         if (this.stationList.length > 0) {
           this.stationCode = this.stationList[0].value

+ 4 - 1
cpp-ui/src/views/stationDataQuery/windtowerstatusdata/index.vue

@@ -779,7 +779,10 @@ export default {
       })
     },
     getStationCode() {
-      this.$axios({url: '/electricfield/all', method: 'get'}).then(response => {
+      const param = {
+        "type": 'E2',
+      }
+      this.$axios.get('/electricfield/findByType',{params: param}).then(response => {
         this.stationList = response.data
         if (this.stationList.length > 0) {
           this.stationCode = this.stationList[0].value