地质所 沉降监测网建设项目
a999c9084ba7b6f410a9743da11c8ce469cdf41b..5e697a70c7e49e18bc3bc2f75c2e9ad5bda17489
2024-05-17 zmk
Merge branch 'master' of ssh://117.78.1.188:29418/dkyChenJiang
5e697a 对比 | 目录
2024-05-17 zmk
提交代码
5338d8 对比 | 目录
3个文件已修改
44 ■■■■ 已修改文件
javaweb-plus/javaweb-admin/src/main/java/com/javaweb/web/controller/system/SysIndexController.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
javaweb-plus/javaweb-admin/src/main/resources/static/js/custom/main.js 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
javaweb-plus/javaweb-admin/src/main/resources/templates/main.html 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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;
    }
}
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) {
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" />