419638610@qq.com 3 years ago
parent
commit
5224b442de

+ 1 - 1
pom.xml

@@ -12,7 +12,7 @@
     <artifactId>v2</artifactId>
     <version>0.0.1-SNAPSHOT</version>
     <name>v2</name>
-	<packaging>war</packaging>
+	<packaging>jar</packaging>
     <description>springboot-v2-pear</description>
 
     <properties>

+ 2 - 2
src/main/resources/static/maps/css/stylesTest.css

@@ -642,7 +642,7 @@
         width: 160px;
         background: #33333366;
         top: 80px;
-        left: 20px;
+        left: 40px;
         z-index: 999;
     }
     
@@ -650,7 +650,7 @@
         position: absolute;
         width: 400px;
         top: 120px;
-        left: 20px;
+        left: 40px;
         padding: 6px;
         background-color: #061F30af;
         z-index: 999;

+ 115 - 65
src/main/resources/static/maps/js/mapsTest.js

@@ -498,7 +498,7 @@ function clickQuery() {
 }
 
 function clicQueryProcess(subtitle, dataSetName, ws, _Point) {
-    Q.queryByGeometry(dataSetName, ws, _Point, function(result) {
+    Q.queryByGeometry(subtitle,undefined,dataSetName, ws, _Point, function(result) {
         if (result.result == undefined) return;
         panels.createResultPanelWithDataGrid({
             subTitle: subtitle,
@@ -804,6 +804,14 @@ panels.createPanelBase = function(layer,title, resizeCb) {
             if (resizeCb)
                 resizeCb(layero);
         },
+        full:function(layero){
+            if (resizeCb)
+                resizeCb(layero);
+        },
+        restore:function(layero){
+            if (resizeCb)
+                resizeCb(layero);
+        },
         success: function(layero, index) {}
     });
 }
@@ -848,7 +856,7 @@ panels.createPagesByFeatures = function(params) {
                 continue;
             if (tmpProperty.startsWith("SS"))
                 continue;
-            cols.push({ field: property, title: property, sort: true, width: 80 });
+            cols.push({ field: property, title: property, sort: true });
         }
     }
     let datas = [];
@@ -884,6 +892,9 @@ panels.createPagesByFeatures = function(params) {
                 page: true,
                 "lay-size": 'sm',
                 limit: 6,
+                done:function (res, curr, count){
+                    $("table").css("width", "100%");
+                },
                 cols: [cols],
                 // toolbar: true,
                 // totalrow: true,
@@ -990,8 +1001,11 @@ Q.queryBySql = function(datasetName, wsName, sql, fromIndex, toIndex, aggregatio
             }
         });
 }
-Q.queryByBounds = function(datasetName, wsName, bounds, callback) {
-
+Q.queryByBounds = function(title,datasetName, wsName, bounds, callback) {
+    var paramsTmp = {};
+    paramsTmp.title = title;
+    paramsTmp.dataSetName = datasetName;
+    paramsTmp.dataSourceName = wsName;
     // var boundsParam = new SuperMap.GetFeaturesByBoundsParameters({
     //     datasetNames: [wsName + ":" + datasetName],
     //     fromIndex: 0,
@@ -1017,15 +1031,23 @@ Q.queryByBounds = function(datasetName, wsName, bounds, callback) {
         .featureService(dataUrl)
         .getFeaturesByGeometry(geometryParam, function (serviceResult) {
             if (callback != undefined) {
-                callback(serviceResult)
+                callback(serviceResult,paramsTmp)
             }
         });
 }
-Q.queryByGeometry = function(datasetName, wsName, geometry, callback) {
+Q.queryByGeometry = function(title,distanceTmp,datasetName, wsName, geometry, callback) {
 
+    var paramsTmp = {};
+    paramsTmp.title = title;
+    paramsTmp.dataSetName = datasetName;
+    paramsTmp.dataSourceName = wsName;
+
+    if(distanceTmp == undefined){
+        distanceTmp = CONST_VALUES.QUERY_BufferDistance;
+    }
     var bufferParam = new SuperMap.GetFeaturesByBufferParameters({
         datasetNames: [wsName + ":" + datasetName],
-        bufferDistance: CONST_VALUES.QUERY_BufferDistance,
+        bufferDistance: distanceTmp,
         geometry: geometry
     });
 
@@ -1033,7 +1055,7 @@ Q.queryByGeometry = function(datasetName, wsName, geometry, callback) {
         .featureService(dataUrl)
         .getFeaturesByBuffer(bufferParam, function (serviceResult) {
             if (callback != undefined) {
-                callback(serviceResult)
+                callback(serviceResult,paramsTmp)
             }
         });
 }
@@ -1146,15 +1168,15 @@ function InitDraw() {
                                 var thatsubtitleP = layers[index].title;
 
 
-                                Q.queryByBounds(dataSetName, ws, polygonTmp, function(result) {
+                                Q.queryByBounds(thatsubtitleP, dataSetName, ws, polygonTmp, function(result,titleTmp) {
                                     if (result.result == undefined) return;
                                     panels.createResultPanelWithDataGrid({
-                                        subTitle: thatsubtitleP,
+                                        subTitle: titleTmp.title,
                                         features: result.result.features.features,
                                         title: "范围查询结果",
                                         //count: count,
-                                        dataSetName: dataSetName,
-                                        dataSourceName: ws
+                                        dataSetName: titleTmp.dataSetName,
+                                        dataSourceName: titleTmp.dataSourceName
                                     }, function() {
                                         //debugger;
                                     });
@@ -1214,50 +1236,54 @@ function InitDraw() {
                                     geometry: _Point
                                 });
 
-                                L.supermap
-                                    .featureService(dataUrl)
-                                    .getFeaturesByBuffer(bufferParam, function (result) {
-                                        if (result.result == undefined) return;
-                                        panels.createResultPanelWithDataGrid({
-                                            subTitle: thatsubtitleP,
-                                            features: result.result.features.features,
-                                            title: "范围查询结果",
-                                            //count: count,
-                                            dataSetName: dataSetName,
-                                            dataSourceName: ws
-                                        }, function() {
-                                            //debugger;
-                                        });
-                                        // 坐标系转换
-                                        var result = L.Util.transform(result.result.features, crs, L.CRS.EPSG4326);
-
-                                        L.geoJSON(result, {
-                                            style:{color: "red"},
-                                            onEachFeature: function (feature, layer) {
-
-                                                let attributes = "";
-                                                let lyrs = CONST_VALUES.GX_Datas;
-                                                for (var index = 0; index < lyrs.length; index++) {
-                                                    var lyr = lyrs[index];
-                                                    if(ws == lyr.dataSourceName && dataSetName == lyr.dataSetName){
-                                                        var showCols = lyr.cols;
-                                                        if(showCols != undefined && showCols != ""){
-                                                            var colsArr = showCols.split(",");
-                                                            for(var i = 0; i < colsArr.length; i++){
-                                                                var colArr = colsArr[i].split(":");
-                                                                let attValue = feature.properties[colArr[0]];
-                                                                let attr = colArr[1] + ":" + attValue + "<br>";
-                                                                attributes += attr;
-                                                            }
+                                Q.queryByGeometry(thatsubtitleP, jl11, dataSetName, ws, _Point, function(result,titleTmp) {
+
+                                    if (result.result == undefined) return;
+                                    panels.createResultPanelWithDataGrid({
+                                        subTitle: titleTmp.title,
+                                        features: result.result.features.features,
+                                        title: "范围查询结果",
+                                        //count: count,
+                                        dataSetName: titleTmp.dataSetName,
+                                        dataSourceName: titleTmp.dataSourceName
+                                    }, function() {
+                                        //debugger;
+                                    });
+                                    // 坐标系转换
+                                    var result = L.Util.transform(result.result.features, crs, L.CRS.EPSG4326);
+
+                                    L.geoJSON(result, {
+                                        style:{color: "red"},
+                                        onEachFeature: function (feature, layer) {
+
+                                            let attributes = "";
+                                            let lyrs = CONST_VALUES.GX_Datas;
+                                            for (var index = 0; index < lyrs.length; index++) {
+                                                var lyr = lyrs[index];
+                                                if(ws == lyr.dataSourceName && dataSetName == lyr.dataSetName){
+                                                    var showCols = lyr.cols;
+                                                    if(showCols != undefined && showCols != ""){
+                                                        var colsArr = showCols.split(",");
+                                                        for(var i = 0; i < colsArr.length; i++){
+                                                            var colArr = colsArr[i].split(":");
+                                                            let attValue = feature.properties[colArr[0]];
+                                                            let attr = colArr[1] + ":" + attValue + "<br>";
+                                                            attributes += attr;
                                                         }
-                                                        break;
                                                     }
+                                                    break;
                                                 }
-                                                layer.bindPopup(attributes);
                                             }
-                                        }).addTo(resultLayer);
+                                            layer.bindPopup(attributes);
+                                        }
+                                    }).addTo(resultLayer);
+                                })
 
-                                    });
+                                // L.supermap
+                                //     .featureService(dataUrl)
+                                //     .getFeaturesByBuffer(bufferParam, function (result,thatsubtitleP) {
+                                //
+                                //     });
 
                             }
                         }
@@ -1277,15 +1303,15 @@ function InitDraw() {
 }
 
 function polygonQueryProcess(subtitle, dataSetName, ws, bounds) {
-    Q.queryByBounds(dataSetName, ws, bounds, function(result) {
+    Q.queryByBounds(subtitle, dataSetName, ws, bounds, function(result,titleTmp) {
         if (result.result == undefined) return;
         panels.createResultPanelWithDataGrid({
-            subTitle: subtitle,
+            subTitle: titleTmp.title,
             features: result.result.features.features,
             title: "范围查询结果",
             //count: count,
-            dataSetName: dataSetName,
-            dataSourceName: ws
+            dataSetName: titleTmp.dataSetName,
+            dataSourceName: titleTmp.dataSourceName
         }, function() {
             //debugger;
         });
@@ -1421,15 +1447,15 @@ function drawPolygon() {
                         var dataSetName = layers[index].attributes.dataSetName.value;
                         var thatsubtitleP = layers[index].title;
 
-                        Q.queryByBounds(dataSetName, ws, polygonTmp, function(result) {
+                        Q.queryByBounds(thatsubtitleP,dataSetName, ws, polygonTmp, function(result,titleTmp) {
                             if (result.result == undefined) return;
                             panels.createResultPanelWithDataGrid({
-                                subTitle: thatsubtitleP,
+                                subTitle: titleTmp.title,
                                 features: result.result.features.features,
                                 title: "范围查询结果",
                                 //count: count,
-                                dataSetName: dataSetName,
-                                dataSourceName: ws
+                                dataSetName: titleTmp.dataSetName,
+                                dataSourceName: titleTmp.dataSourceName
                             }, function() {
                                 //debugger;
                             });
@@ -1554,6 +1580,17 @@ panels.createResultPanelWithChart = function(xAxis, groupBy, data, title, subTit
         let chart;
         let resizeCb = function(layerno) {
             if (chart == undefined) return;
+
+            var autoHeight = $("#panel-result").height() - 100;
+            chart.getDom().style.height = autoHeight + "px";
+            chart.getDom().childNodes[0].style.height = autoHeight + "px";
+            chart.getDom().childNodes[0].childNodes[0].setAttribute("height",autoHeight);
+            chart.getDom().childNodes[0].childNodes[0].style.height = autoHeight + "px";
+            var autoWidth = $("#panel-result").width();
+            chart.getDom().style.width = autoWidth + "px";
+            chart.getDom().childNodes[0].style.width = autoWidth + "px";
+            chart.getDom().childNodes[0].childNodes[0].setAttribute("width",autoWidth);
+            chart.getDom().childNodes[0].childNodes[0].style.width = autoWidth + "px";
             chart.resize();
         }
         var layer = layui.layer;
@@ -1617,7 +1654,7 @@ panels.createChart = function(xAxis, groupBy, data, title, subTitle, xTypeName,
         });
     });
 
-    const myChart = echarts.init(document.getElementById("statistics-Chart"), null, {width:'412px',height:'328px'});
+    const myChart = echarts.init(document.getElementById("statistics-Chart"), null);
 
     // 指定图表的配置项和数据
     const option = {
@@ -1677,7 +1714,17 @@ panels.createChart = function(xAxis, groupBy, data, title, subTitle, xTypeName,
 
     // 使用刚指定的配置项和数据显示图表。
     myChart.setOption(option);
-
+    var autoHeight = $("#panel-result").height() - 100;
+    myChart.getDom().style.height = autoHeight + "px";
+    myChart.getDom().childNodes[0].style.height = autoHeight + "px";
+    myChart.getDom().childNodes[0].childNodes[0].setAttribute("height",autoHeight);
+    myChart.getDom().childNodes[0].childNodes[0].style.height = autoHeight + "px";
+    var autoWidth = $("#panel-result").width();
+    myChart.getDom().style.width = autoWidth + "px";
+    myChart.getDom().childNodes[0].style.width = autoWidth + "px";
+    myChart.getDom().childNodes[0].childNodes[0].setAttribute("width",autoWidth);
+    myChart.getDom().childNodes[0].childNodes[0].style.width = autoWidth + "px";
+    myChart.resize();
     const thisTitle = $('.layui-layer-title');
     thisTitle.addClass("layui-layer-title-transparent");
     return myChart;
@@ -1725,7 +1772,10 @@ panels.createChartPages = function(xAxis, groupBy, data) {
                 data: datas,
                 page: true,
                 "lay-size": 'sm',
-                limit: 7,
+                limit: 6,
+                done: function (res, curr, count){
+                    $("table").css("width", "100%");
+                },
                 cols: [cols]
             });
         });
@@ -3243,7 +3293,7 @@ function layerEdit() {
                             var pt = crs.project(evt.latlng);
                             var _Point = L.marker([pt.y, pt.x]);
 
-                            Q.queryByGeometry(CONST_VALUES.JD_DataSetName, CONST_VALUES.JD_DataSourceName, _Point, function(result) {
+                            Q.queryByGeometry("",undefined,CONST_VALUES.JD_DataSetName, CONST_VALUES.JD_DataSourceName, _Point, function(result) {
                                 if (result.result == undefined || result.result.features.features.length == 0) {
                                     layui.layer.msg('附件没有发现管点信息,请重新选择!');
                                     return;
@@ -3432,7 +3482,7 @@ function layerEdit() {
                         var pt = crs.project(evt.latlng);
                         var _Point = L.marker([pt.y, pt.x]);
 
-                        Q.queryByGeometry(dataSetName, dataSourceName, _Point, function(result) {
+                        Q.queryByGeometry("",undefined,dataSetName, dataSourceName, _Point, function(result) {
                             if (result.result == undefined || result.result.features.features.length < 1) return;
                             // 坐标系转换
                             //var result = L.Util.transform(result.result.features, crs, L.CRS.EPSG4326);
@@ -3648,7 +3698,7 @@ function layerEdit() {
 
                         var polygon = L.polygon(polygonArray, {color: "#00FF00"});
                         resultLayer.addLayer(polygon);
-                        Q.queryByBounds(dataSetName, dataSourceName, polygonTmp, function(result) {
+                        Q.queryByBounds("",dataSetName, dataSourceName, polygonTmp, function(result,titleTmp) {
                             if (result.result == undefined) return;
                             var rs = result.result.features.features;
                             var ids = new Array();

File diff suppressed because it is too large
+ 1 - 1
src/main/resources/static/maps/layui/css/layui.css


+ 1 - 1
src/main/resources/static/maps/pipeNetwork/libs/leaflet/1.7.1/leaflet.css

@@ -157,7 +157,7 @@
 	margin-bottom: 10px;
 	}
 .leaflet-left .leaflet-control {
-	margin-left: 10px;
+	margin-left: 0px;
 	}
 .leaflet-right .leaflet-control {
 	margin-right: 10px;