Browse Source

井筒全息快照功能优化

da-xian 1 month ago
parent
commit
fd99ee4db0

+ 3 - 4
src/main/java/com/bowintek/smartsearch/controller/WellInfoController.java

@@ -57,11 +57,10 @@ public class WellInfoController {
     }
 
     @ResponseBody
-    @GetMapping("/getMapList")
-    public BaseResponse<PageInfo<HashMap<String, Object>>> getMapList(@RequestParam("page") int page, @RequestParam("rows") int rows,
-                                                                      WellInfoParams params) throws Exception {
+    @PostMapping("/getMapList")
+    public BaseResponse<PageInfo<HashMap<String, Object>>> getMapList(@RequestBody WellInfoParams params) throws Exception {
 
-        PageInfo<HashMap<String, Object>> result = wellInfoService.getMapList(page, rows, params);
+        PageInfo<HashMap<String, Object>> result = wellInfoService.getMapList(params.getPage(), params.getRows(), params);
 
         return RespGenerstor.success(result);
     }

+ 45 - 31
vue/src/components/basic/chart/chart-map.vue

@@ -21,6 +21,7 @@
         </template>
         <a-input-search size="large" placeholder="..." enter-button></a-input-search>
       </a-auto-complete>
+      <a-button type="primary" size="large" title="在新标签页中打开地图" @click="openMap"><ShareAltOutlined/></a-button>
     </div>
     <iframe width="100%" height="100%" tyle="border: 0"
             :src="iframeSrc" ref="iframeRef" id="iframeMap"
@@ -30,7 +31,7 @@
 
 <script lang="ts">
   import {defineComponent, computed, ref, watch} from 'vue';
-  import {get} from '@/api/common';
+  import { postData} from '@/api/common';
   import {getConfig} from "@/utils/config";
 
   export  default defineComponent ({
@@ -56,20 +57,22 @@
 
       let iframeRef = ref<any>();   // 和iframe标签的ref绑定
 
-      const datas = computed(() => {
-        let propList = props.datas ? props.datas : [];
-        return propList.map((item) => {
-          item.value = item.well_common_name;
-          return {
-            value : item.well_common_name,
-            geo_description : item.geo_description,
-            well_id : item.well_id,
-            well_common_name : item.well_common_name,
-            x : item.x,
-            y : item.y
-          };
-        });
-      });
+      // const datas = computed(() => {
+      //   let propList = props.datas ? props.datas : [];
+      //   return propList.map((item) => {
+      //     item.value = item.well_common_name;
+      //     return {
+      //       value : item.well_common_name,
+      //       geo_description : item.geo_description,
+      //       well_id : item.well_id,
+      //       well_common_name : item.well_common_name,
+      //       x : item.x,
+      //       y : item.y
+      //     };
+      //   });
+      // });
+
+      const datas=[];
 
       const isSearch = computed(() => {
         return props.isSearch == null || props.isSearch == undefined ? true : props.isSearch
@@ -86,28 +89,35 @@
       // 父项目绑定一个message事件给iframe handleMessage
       window.addEventListener("message", this.handleMessage, false);
       this.iframeWindow = this.iframeRef.contentWindow;
-
       watch(
-        () => this.datas,
+        () => this.options,
         () => {
           this.handleMessage({});
-          console.log("datas changes", this.datas);
+          console.log("options changes", this.options);
         }, {deep: true}
       );
     },
     methods:{
-      getDatas:async function(){
+      getDatas:async function(params: any){
         //数据查询逻辑,如果不查询,改此方法返回数据即可
-        if(this.datas==null){
+        // if(this.datas==null || this.datas.length == 0){
           this.datas = [];
-          const result = await get('/wellInfo/getMapList',{ page: 1, rows:10000});
-          this.datas = result.list.map((item) => {
-            item.value = item.well_common_name;
-            return item;
+          const result: any = await postData('/wellInfo/getMapList', {...params, page:1, rows:10000});
+          console.log("result", result);
+          this.datas = result.list.map((item: any) => {
+            return {
+              value : item.well_common_name,
+              geo_description : item.geo_description,
+              well_id : item.well_id,
+              well_common_name : item.well_common_name,
+              x : item.x,
+              y : item.y
+            };
           });
-        }
-        console.log("getDatas", this.datas);
-        return this.datas;
+          console.log("getDatas", this.datas);
+          this.options = this.datas;
+        // }
+        // return this.datas;
       },
       onSearch:async function (searchText){
         if(searchText!=null && searchText!=undefined && searchText.length>0){
@@ -131,12 +141,15 @@
 
           (document.getElementById('iframeMap') as any).contentWindow.postMessage({
             action:'setSymbols',
-            datas : JSON.stringify(this.datas)
+            datas : JSON.stringify(this.options)
           },'*');
-          this.options = this.datas;
+          // this.options = this.datas;
         } catch (ex){
           console.log("handleMessage",ex);
         }
+      },
+      openMap: function (){
+        window.open(this.iframeSrc);
       }
     }
   })
@@ -161,9 +174,10 @@
     position: relative;
     width: 300px;
     height: 50px;
-    left: 30px;
-    top: 50px;
+    left: 0px;
+    top: 60px;
     z-index: 100;
+    display: flex;
   }
 
   .chart-map-item{

+ 4 - 1
vue/src/views/wellinfo/index.vue

@@ -308,7 +308,7 @@
         </a-spin>
       </div>
       <div :style="showOverlay&&curStepVal==5?'flex-grow: 1;overflow: auto;z-index:999;background:white;':'flex-grow: 1;overflow: auto;'" style="width:100%;height: 500px;" >
-        <ChartMap :datas="data" :isSearch="(true)" data-v-step="5"></ChartMap>
+        <ChartMap ref="chartMapRef" :isSearch="(true)" data-v-step="5"></ChartMap>
       </div>
     </div>
     <a-modal v-model:visible="isShowDoc" title="相关文档" width="800px" :footer="null" @onCancel="isShowDoc=false">
@@ -396,6 +396,7 @@ export default defineComponent({
     const docList = ref<any>([]);
     const wellTypeList = ref([{label: "直井", value: "直井"}, {label: "定向井", value: "定向井"}, {label: "分支井", value: "分支井"}]);
     const wellPurposeList = ref([{label: "探井", value: "探井"}, {label: "开发井", value: "开发井"}, {label: "水井", value: "水井"}]);
+    const chartMapRef = ref();
 
     const steps = reactive([
       {
@@ -696,6 +697,7 @@ export default defineComponent({
     }
     const onQuery = () => {
       loadData();
+      chartMapRef.value.getDatas(formState);
     }
     const treeRef = ref();
     const subjectTrees = ref({
@@ -923,6 +925,7 @@ export default defineComponent({
       onQuery,
       loadData,
       onRangeChange,
+      chartMapRef,
       showQuery,
       wellTypeList,
       wellPurposeList,