From 5338d8f2688bea54664e49907d233486d06d4513 Mon Sep 17 00:00:00 2001 From: zmk <496160012@qq.com> Date: 星期五, 17 五月 2024 15:40:07 +0800 Subject: [PATCH] 提交代码 --- javaweb-plus/javaweb-admin/src/main/java/com/javaweb/web/controller/system/SysIndexController.java | 21 +++++++++++++++++---- javaweb-plus/javaweb-admin/src/main/resources/static/js/custom/main.js | 22 ++++++++++++++++++---- javaweb-plus/javaweb-admin/src/main/resources/templates/main.html | 1 - 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/javaweb-plus/javaweb-admin/src/main/java/com/javaweb/web/controller/system/SysIndexController.java b/javaweb-plus/javaweb-admin/src/main/java/com/javaweb/web/controller/system/SysIndexController.java index ec7023d..cee5d1e 100644 --- a/javaweb-plus/javaweb-admin/src/main/java/com/javaweb/web/controller/system/SysIndexController.java +++ b/javaweb-plus/javaweb-admin/src/main/java/com/javaweb/web/controller/system/SysIndexController.java @@ -8,6 +8,8 @@ import com.javaweb.common.core.domain.AjaxResult; import com.javaweb.common.utils.Arith; import com.javaweb.common.utils.StringUtils; +import com.javaweb.geo.domain.Project; +import com.javaweb.geo.service.IProjectService; import com.javaweb.system.service.ISysConfigService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -40,6 +42,9 @@ @Autowired private ISysConfigService configService; + + @Autowired + private IProjectService projectService; private String getAdminIndex(){ return configService.selectConfigByKey(CmsConstants.KEY_ADMIN_INDEX); @@ -98,9 +103,17 @@ return "main"; } - - private Double getValue(int a,int b) { - - return Arith.div((double)a*100, (double)b, 4); + + // 绯荤粺浠嬬粛 + @ResponseBody + @GetMapping("/system/project") + public AjaxResult project() + { + AjaxResult ajaxResult = AjaxResult.success(); + List<Project> projects = projectService.selectProjectList(new Project()); + ajaxResult.put("projects",projects); + return ajaxResult; } + + } diff --git a/javaweb-plus/javaweb-admin/src/main/resources/static/js/custom/main.js b/javaweb-plus/javaweb-admin/src/main/resources/static/js/custom/main.js index 95016c1..2bacfb2 100644 --- a/javaweb-plus/javaweb-admin/src/main/resources/static/js/custom/main.js +++ b/javaweb-plus/javaweb-admin/src/main/resources/static/js/custom/main.js @@ -1,15 +1,16 @@ $(function() { loadMap(); - //getReallyData(); + getReallyData(); //getRegulatoryUnitChartData("",""); //bindEvent(); }) // 鍔犺浇鍦板浘 +let map=null; var countries = []; var countriesOverlay = new T.D3Overlay(init,redraw); var countriesOverlay1 = new T.D3Overlay(init1,redraw1); function loadMap() { - let map = new T.Map('map_div'); + map = new T.Map('map_div'); map.centerAndZoom(new T.LngLat(116.38, 39.9), 11); var control = new T.Control.Zoom(); @@ -71,11 +72,24 @@ // 鑾峰彇鏁版嵁搴撶湡瀹炴暟鎹� function getReallyData() { - let url = window.location.protocol + "//" + window.location.host + "/bjfw/geotdp/index/indexCollect"; + let url = window.location.protocol + "//" + window.location.host + "/bjfw/system/project"; $.get(url,function(res){ - + var data = res.projects; + showProjectPoint(data); }) } +//鍦板浘涓婂睍绀洪」鐩偣 +function showProjectPoint(data){ + var projectIcon = new T.Icon({ + iconUrl: '/bjfw/images/icons/6.png', + iconSize: new T.Point(30, 30), + iconAnchor: new T.Point(6, 40), + }); + var centerMarker = new T.Marker(new T.LngLat(center.lng, center.lat), { title: "椤圭洰",icon:icon}); + + var proj = infoWindowProject(onProject); + addClickHandler(proj, centerMarker); +} // 椤甸潰鏁版嵁璧嬪�� function pageAssignment(reallyData) { for ( let key in reallyData) { diff --git a/javaweb-plus/javaweb-admin/src/main/resources/templates/main.html b/javaweb-plus/javaweb-admin/src/main/resources/templates/main.html index 0dd78b1..b91925c 100644 --- a/javaweb-plus/javaweb-admin/src/main/resources/templates/main.html +++ b/javaweb-plus/javaweb-admin/src/main/resources/templates/main.html @@ -67,7 +67,6 @@ <script th:src="@{/js/custom/main.js}"></script> - <th:block th:include="include :: sparkline-js" /> <th:block th:include="include :: footer" /> -- Gitblit v1.9.1