xiaoyong931011
2022-09-08 ab6603d889f482459c1812e52ce2c5c04fe8e3e7
20220902
1 files added
2 files modified
88 ■■■■■ changed files
src/main/java/cc/mrbird/febs/mall/controller/ViewMallTeamLeaderController.java 9 ●●●●● patch | view | raw | blame | history
src/main/resources/templates/febs/views/modules/leader/leaderMapSetting.html 75 ●●●●● patch | view | raw | blame | history
src/main/resources/templates/index.html 4 ●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/mall/controller/ViewMallTeamLeaderController.java
@@ -83,4 +83,13 @@
        model.addAttribute("leaderBonusSetting", adminLeaderBonusSettingVo);
        return FebsUtil.view("modules/leader/leaderBonusSetting");
    }
    /**
     * 团长区域--电子围栏
     */
    @GetMapping("leaderMapSetting")
    @RequiresPermissions("leaderMapSetting:view")
    public String leaderMapSetting() {
        return FebsUtil.view("modules/leader/leaderMapSetting");
    }
}
src/main/resources/templates/febs/views/modules/leader/leaderMapSetting.html
New file
@@ -0,0 +1,75 @@
<div class="layui-fluid layui-anim febs-anim" id="febs-map-demo-test" lay-title="高德地图">
    <div class="layui-row febs-container">
        <div class="layui-card">
            <form class="layui-form layui-table-form" lay-filter="user-table-form">
                <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area">
                    <div class="input-card" style="width: 120px">
                        <button type="button" class="layui-btn layui-btn-danger" id="createPolygon" style="margin-bottom: 2px">新建围栏</button>
                    </div>
                    <div class="input-card" style="width: 120px">
                        <button type="button" class="layui-btn layui-btn-danger" id="open" style="margin-bottom: 2px">开始编辑</button>
                    </div>
                    <div class="input-card" style="width: 120px">
                        <button type="button" class="layui-btn layui-btn-danger" id="close" style="margin-bottom: 2px">结束编辑</button>
                    </div>
                </div>
            </form>
            <div style="padding: .1rem;">
                <div id="container" class="map"></div>
            </div>
        </div>
    </div>
</div>
<script data-th-inline="javascript" type="text/javascript">
    layui.use([ 'jquery', 'form', 'table', 'febs'], function () {
        var $ = layui.jquery,
            febs = layui.febs,
            $view = $('#febs-map-demo-test'),
            $createPolygon = $view.find('#createPolygon'),
            $open = $view.find('#open'),
            $close = $view.find('#close');
        $view.find('#container').css({"height": document.documentElement.clientHeight - 97 + 'px'});
        var map = new AMap.Map("container", {
            center: [116.368904,39.913423],
            zoom: 16.8
        });
        var polyEditor = new AMap.PolygonEditor(map);
        // 折线的节点坐标数组,每个元素为 AMap.LngLat 对象
        var path = [
            new AMap.LngLat(116.368904,39.913423),
            new AMap.LngLat(116.382122,39.901176),
            new AMap.LngLat(116.387271,39.912501),
            new AMap.LngLat(116.398258,39.904600)
        ];
        // 创建折线实例
        var polyline = new AMap.Polyline({
            path: path,
            borderWeight: 2, // 线条宽度,默认为 1
            strokeColor: 'red', // 线条颜色
            lineJoin: 'round' // 折线拐点连接处样式
        });
        // 将折线添加至地图实例
        map.add(polyline);
        //为地图注册click事件获取鼠标点击出的经纬度坐标
        map.on('click', function (e) {
            febs.alert.success('经度:' + e.lnglat.getLng() + ',纬度:' + e.lnglat.getLat());
        });
        $createPolygon.on('click', function () {
            febs.alert.success('点击新建');
        });
        $open.on('click', function () {
            febs.alert.success('开始编辑');
        });
        $close.on('click', function () {
            febs.alert.success('结束编辑');
        });
    });
</script>
src/main/resources/templates/index.html
@@ -15,9 +15,11 @@
    <link rel="stylesheet" th:href="@{febs/css/apexcharts.min.css}" media="all">
    <link rel="stylesheet" th:href="@{febs/css/formSelects-v4.css}" media="all">
    <!-- 高德地图,key为演示作用,请勿滥用-->
    <script src="https://webapi.amap.com/maps?v=1.4.15&key=0e8a587317998a5e03cf608649b229d6&plugin=AMap.Autocomplete"></script>
    <script src="https://webapi.amap.com/maps?v=1.4.15&key=04934a2cf5cfa8a29ffcf0fdcfaabb5f&plugin=AMap.Autocomplete,AMap.PolygonEditor"></script>
    <link href="https://unpkg.com/@wangeditor/editor@5.0.1/dist/css/style.css" rel="stylesheet">
    <script src="https://unpkg.com/@wangeditor/editor@latest/dist/index.js"></script>
    <link rel="stylesheet" href="https://a.amap.com/jsapi_demos/static/demo-center/css/demo-center.css" />
    <script src="https://a.amap.com/jsapi_demos/static/demo-center/js/demoutils.js"></script>
    <link rel="icon" th:href="@{febs/images/favicon.ico}" type="image/x-icon"/>
</head>
<body>