周壕 пре 10 месеци
родитељ
комит
17382cf51d
2 измењених фајлова са 29 додато и 13 уклоњено
  1. 10 6
      src/main/resources/static/a4gis/index.html
  2. 19 7
      vue/src/components/basic/chart/chart-map.vue

+ 10 - 6
src/main/resources/static/a4gis/index.html

@@ -187,19 +187,19 @@
       right: 20px;
     }
   </style>
-  <!--测试环境使用
+  <!--测试环境使用-->
   <link href='https://js.arcgis.com/3.27/esri/css/esri.css' rel='stylesheet' />
   <script src='jquery.min.js'></script>
   <script src='https://js.arcgis.com/3.27/init.js' type='text/javascript'></script>
   <script src='init-gmap.js?v=1.15.9' type='text/javascript'></script>
-  <script src='init-gcontrols.js?v=1.0.5' type='text/javascript'></script>-->
+  <script src='init-gcontrols.js?v=1.0.5' type='text/javascript'></script>
 
-  <!--正式环境使用-->
+  <!--正式环境使用
   <link href='http://a4.petrochina/gisapi/esri/css/esri.css' rel='stylesheet' />
   <script src='http://a4.petrochina/gisapi/third/jquery/jquery-1.9.1.min.js'></script>
   <script src='http://a4.petrochina/gisapi/init.js' type='text/javascript'></script>
   <script src='http://a4.petrochina/gisapi/lib/init-gmap.js?v=1.15.9' type='text/javascript'></script>
-  <script src='http://a4.petrochina/gisapi/lib/init-gcontrols.js?v=1.0.5' type='text/javascript'></script>
+  <script src='http://a4.petrochina/gisapi/lib/init-gcontrols.js?v=1.0.5' type='text/javascript'></script>-->
 
   <script>
     var map = null, app = { token: "d4b2b740-9814-4d75-9cda-dac96fc2bc10" };
@@ -285,9 +285,10 @@
           if(graLayer==null) {
             graLayer = new GraphicsLayer();
             map.MainMap._innerAddLayer(graLayer);
+
+            //通知父页面,加载完成
+            window.parent.postMessage({action:'test', message:'hello,我即将传给父项目'}, "*");
           }
-          //通知父页面,加载完成
-          window.parent.postMessage({action:'test', message:'hello,我即将传给父项目'}, "*");
         });
         map.MainMap.on("click", function (event){
           //testers.push({x:event.mapPoint2.x, y:event.mapPoint2.y});
@@ -311,6 +312,9 @@
           if(graLayer==null) {
             graLayer = new GraphicsLayer();
             map.MainMap._innerAddLayer(graLayer);
+
+            //通知父页面,加载完成
+            window.parent.postMessage({action:'test', message:'hello,我即将传给父项目'}, "*");
           }
 
           // 地图级别更改事件

+ 19 - 7
vue/src/components/basic/chart/chart-map.vue

@@ -48,7 +48,7 @@
     },
     setup(props, context){
       console.log("ChartMap setup" , props, context);
-      let iframeSrc = ref<string>("http://192.168.0.68:8077/a4gis/index.html");
+      let iframeSrc = ref<string>("http://10.73.178.206:8077/a4gis/index.html");
       let iframeRef = ref<any>();   // 和iframe标签的ref绑定
 
       const wellId = computed(() => {
@@ -66,7 +66,7 @@
       window.addEventListener("message", this.handleMessage, false);
       this.iframeWindow = this.iframeRef.contentWindow;
       //加载数据
-      this.options = this.getDatas();
+      //this.options = this.getDatas();
       console.log("mounted options", this.options);
     },
     methods:{
@@ -74,12 +74,23 @@
         //数据查询逻辑,如果不查询,改此方法返回数据即可
         if(this.datas==null){
           this.datas = [];
-          const result = await get('/wellInfo/getMapList',{ page: 1, rows:1000,well_id: this.wellId});
-          this.datas = result.list.map((item, index) => {
-            item.value = item.well_id;
-            item.index = index;
+          const result = await get('/wellInfo/getMapList',{ page: 1, rows:10000});
+          this.datas = result.list.map((item) => {
+            item.value = item.well_common_name;
             return item;
           });
+
+          /*
+          for(let i=0;i<10000;i++){
+            this.datas?.push({
+              value:'华李1-26-'+i,
+              geo_description:'内蒙古锡林浩特市阿尔善宝力格达莱因29'+i,
+              well_common_name:'华李1-26-'+i,
+              well_id:'华李1-26-'+i,
+              x : result.list[i % result.list.length].x,
+              y : result.list[i % result.list.length].y
+            });
+          }*/
         }
         console.log("getDatas", this.datas);
         return this.datas;
@@ -102,10 +113,11 @@
         },'*');
       },
       handleMessage:async function (event){
-        console.log("parent handle Message", event.data);
         //(document.getElementById('iframeMap') as any).contentWindow.postMessage({message:'父页面传过来的数据'},'*');
         //显示坐标点
         let datas = await this.getDatas();
+        console.log("parent handle Message", event.data, datas);
+
         (document.getElementById('iframeMap') as any).contentWindow.postMessage({
           action:'setSymbols',
           datas : JSON.stringify(datas)