2f4ba4558f75706cd80752dd78a80bb308312933..16cdc43d5eefa486c6c3a490003a44930b700ae9
2021-06-17 shuishen
Merge branch 'master' of http://192.168.0.105:10010/r/pyhmap
16cdc4 diff | tree
2021-06-17 shuishen
工具部分样式调整
66ef31 diff | tree
2021-06-17 shuishen
目录树调整
a653d4 diff | tree
2021-06-17 shuishen
图层管理相关调整
f30168 diff | tree
2021-06-17 shuishen
新加图标
d5f296 diff | tree
8 files modified
3 files added
538 ■■■■■ changed files
config.json 32 ●●●●● patch | view | raw | blame | history
images/icon-change.png patch | view | raw | blame | history
images/向上移动.png patch | view | raw | blame | history
images/向下移动.png patch | view | raw | blame | history
widgets/Layermanagement/Widget.html 31 ●●●●● patch | view | raw | blame | history
widgets/Layermanagement/Widget.js 159 ●●●●● patch | view | raw | blame | history
widgets/Layermanagement/css/style.css 109 ●●●●● patch | view | raw | blame | history
widgets/LeftNavigationBar/Widget.html 8 ●●●● patch | view | raw | blame | history
widgets/LeftNavigationBar/Widget.js 138 ●●●● patch | view | raw | blame | history
widgets/LeftNavigationBar/css/style.css 57 ●●●●● patch | view | raw | blame | history
widgets/SplitScreen/css/style.css 4 ●●●● patch | view | raw | blame | history
config.json
@@ -106,8 +106,8 @@
        "name": "图上量算",
        "uri": "widgets/Measurement/Widget",
        "position": {
          "right": 10,
          "top": 96,
          "right": 60,
          "top": 72,
          "width": "350px",
          "height": "320px",
          "relativeTo": "map"
@@ -117,23 +117,19 @@
        "name": "飞行路线",
        "uri": "widgets/FlyRoute/Widget",
        "position": {
          "right": 10,
          "top": 96,
          "right": 60,
          "top": 72,
          "width": "260px",
          "height": "64%",
          "relativeTo": "map"
        }
      },
      {
        "name": "查询定位",
        "uri": "widgets/Location/Widget"
      },
      {
        "name": "卷帘对比",
        "uri": "widgets/Rolling/Widget",
        "position": {
          "right": 10,
          "top": 96,
          "right": 60,
          "top": 72,
          "width": "472px",
          "height": "50px",
          "relativeTo": "map"
@@ -143,8 +139,8 @@
        "name": "场景快照",
        "uri": "widgets/MapPrinting/Widget",
        "position": {
          "right": 10,
          "top": 96,
          "right": 60,
          "top": 72,
          "width": "200px",
          "height": "40px",
          "relativeTo": "map"
@@ -154,8 +150,8 @@
        "name": "坐标定位",
        "uri": "widgets/CoorPosition/Widget",
        "position": {
          "right": 10,
          "top": 96,
          "right": 60,
          "top": 72,
          "width": "217px",
          "height": "180px",
          "relativeTo": "map"
@@ -165,8 +161,8 @@
        "name": "路线导航",
        "uri": "widgets/RouteNavigate/Widget",
        "position": {
          "right": 10,
          "top": 96,
          "right": 60,
          "top": 72,
          "width": "300px",
          "height": "780px",
          "relativeTo": "map"
@@ -176,8 +172,8 @@
        "name": "我的标记",
        "uri": "widgets/Sign/Widget",
        "position": {
          "right": 10,
          "top": 96,
          "right": 60,
          "top": 72,
          "width": "320px",
          "height": "360px",
          "relativeTo": "map"
images/icon-change.png
images/向上移动.png
images/向下移动.png
widgets/Layermanagement/Widget.html
@@ -1,24 +1,29 @@
<div>
    <div class="layer-tab">
        <button>
            <img src="./images/layer-control.png" alt="">
    <div class='layer-tab'>
        <button title='图层管理'>
            <img src='./images/layer-control.png' alt=''>
        </button>
    </div>
    <div class="layer-list">
    <div class='layer-list'>
        <h3>
            图层管理
            <span class='sign-head-th-xx'><i class='layui-icon'>&#x1006;</i></span>
        </h3>
        <ul>
            <li>
            <li class="no-data">
                <div>
                    名称
                    <button>
                        透明度设置
                    </button>
                    <button type="button" class="layui-btn layui-btn-normal layui-btn-sm"><i
                            class="layui-icon">&#xe619;</i></button>
                    <button type="button" class="layui-btn layui-btn-normal layui-btn-sm"><i
                            class="layui-icon">&#xe61a;</i></button>
                    暂无图层加载
                </div>
            </li>
        </ul>
    </div>
    <div class="tree-layer-opcity">
        <h3>图层透明度控制</h3>
        <i class="close layui-icon">&#x1006;</i>
        <ul>
        </ul>
    </div>
</div>
widgets/Layermanagement/Widget.js
@@ -15,34 +15,163 @@
        'libs/layer/layer.js'
    ],
    function (declare,
              lang,
              array,
              html,
              topic,
              BaseWidget,
              aspect,
              string,
              utils,
              layer
        lang,
        array,
        html,
        topic,
        BaseWidget,
        aspect,
        string,
        utils,
        layer
    ) {
        return declare([BaseWidget], {
            baseClass: 'jimu-widget-Layermanagement',
            name: 'Layermanagement',
            dataArr: [],
            startup: function () {
                var that = this;
                // 暴露在外的接口
                topic.subscribe("closeZtree", lang.hitch(this, this.closeZtreeBox));
                topic.subscribe("appendItem", lang.hitch(this, this.appendItem));
                topic.subscribe("removeItem", lang.hitch(this, this.removeItem));
                $(".jimu-widget-Layermanagement .layer-tab button").click(function () {
                    $(".jimu-widget-Layermanagement .layer-list").stop().toggle();
                })
                $(".jimu-widget-Layermanagement .sign-head-th-xx").click(function () {
                    $(".jimu-widget-Layermanagement .layer-list").stop().hide();
                })
                $(".jimu-widget-Layermanagement .layer-list ul").on("click", "li .layer-opacity", function () {
                    var layerId = $(this).parents('li').attr('itemid');
                    var layerTitle = $(this).parents('li').attr('itemtitle');
                    var liC = `<li>
                            <div title="${layerTitle}">
                                ${layerTitle}
                            </div>
                            <div id="${layerId + 'Layer'}">
                            </div>
                        </li>`;
                    $(".jimu-widget-Layermanagement .tree-layer-opcity ul").empty();
                    $(".jimu-widget-Layermanagement .tree-layer-opcity ul").append(liC)
                    $(".jimu-widget-Layermanagement .tree-layer-opcity").stop().show();
                    layui.use("slider", function () {
                        layui.slider.render({
                            elem: '#' + layerId + 'Layer',
                            min: 0,
                            max: 10,
                            value: that[layerId].alpha * 10,
                            step: 1,
                            theme: '#1E9FFF',
                            setTips: function (value) { //自定义提示文本
                                return value / 10;
                            },
                            change: function (value) {
                                that[layerId].alpha = value / 10
                            }
                        });
                    })
                })
                $(".jimu-widget-Layermanagement .layer-list ul").on("click", "li .setup", function () {
                    var layerId = $(this).parents('li').attr('itemid');
                    that.map.scene.imageryLayers.raise(that[layerId]);
                    if ($(this).parents('li').prev().length > 0) {
                        $(this).parents('li').prev().before($(this).parents('li'));
                    }
                })
                $(".jimu-widget-Layermanagement .layer-list ul").on("click", "li .setdown", function () {
                    var layerId = $(this).parents('li').attr('itemid');
                    that.map.scene.imageryLayers.lower(that[layerId]);
                    if ($(this).parents('li').next().length > 0) {
                        $(this).parents('li').next().after($(this).parents('li'));
                    }
                })
                $(".jimu-widget-Layermanagement .tree-layer-opcity .close").click(function () {
                    $(".jimu-widget-Layermanagement .tree-layer-opcity").stop().hide();
                })
            },
            closeZtreeBox: function (item) {
                if (item != this.name) {
                    $('#ztree_container').stop().hide();
            appendItem: function (item, obj, layer) {
                var that = this;
                if (item == this.name) {
                    $(".jimu-widget-Layermanagement .layer-list ul .no-data").stop().hide();
                    var flag = true;
                    var liList = $(".jimu-widget-Layermanagement .layer-list ul li");
                    for (var i = 0; i < liList.length; i++) {
                        if ($(liList[i]).attr('itemid') && $(liList[i]).attr('itemid') == obj.id) {
                            flag = false
                        }
                    }
                    if (flag == true) {
                        var liItem = $("<li itemid='" + obj.id + "' itemtitle='" + obj.title + "'> <div>" +
                            "<span title='" + obj.title + "'>" +
                            obj.title +
                            "</span>" +
                            "<button type='button' class='layui-btn layui-btn-normal layui-btn-sm control-btn layer-opacity' title='透明度调整'>" +
                            "<img src='./images/工具(用以切换图层的透明度).png' alt=''>" +
                            "</button>" +
                            "<button type='button' class='layui-btn layui-btn-normal layui-btn-sm control-btn setup' title='向上移动图层'>" +
                            "<img src='./images/向上移动.png' alt=''>" +
                            "</button>" +
                            "<button type='button' class='layui-btn layui-btn-normal layui-btn-sm control-btn setdown' title='向下移动图层'>" +
                            "<img src='./images/向下移动.png' alt=''>" +
                            "</button>" +
                            "</div> </li>");
                        that[obj.id] = layer;
                        $(".jimu-widget-Layermanagement .layer-list ul").prepend(liItem);
                    }
                }
            },
            removeItem: function (item, obj) {
                if (item == this.name) {
                    var liList = $(".jimu-widget-Layermanagement .layer-list ul li");
                    for (var i = 0; i < liList.length; i++) {
                        if ($(liList[i]).attr('itemid') && $(liList[i]).attr('itemid') == obj.id) {
                            $(liList[i]).remove();
                        }
                    }
                    if ($(".jimu-widget-Layermanagement .layer-list ul li").length == 1) {
                        $(".jimu-widget-Layermanagement .layer-list ul .no-data").stop().show();
                        $(".jimu-widget-Layermanagement .tree-layer-opcity").stop().hide();
                    }
                }
            },
            onOpen: function () {
            },
            onClose: function () {
widgets/Layermanagement/css/style.css
@@ -1,10 +1,10 @@
.jimu-widget-Layermanagement {
    display: none;
    color: #555;
}
.jimu-widget-Layermanagement .layer-tab {
    position: fixed;
    top: 100px;
    top: 72px;
    right: 10px;
}
@@ -22,7 +22,6 @@
    position: relative;
    border: 1px solid #444;
    border-color: #fff;
    color: #edffff;
    fill: #edffff;
    margin: 1px 2px;
    cursor: pointer;
@@ -37,10 +36,108 @@
}
.jimu-widget-Layermanagement .layer-list {
    display: none;
    position: fixed;
    top: 100px;
    top: 72px;
    right: 60px;
    width: 320px;
    height: 420px;
    min-height: 80px;
    background: #fff;
}
    border-radius: 5px;
    box-shadow: 0 0 8px #fff;
}
.jimu-widget-Layermanagement .layer-list ul {
    max-height: 360px;
    overflow-y: auto;
}
.jimu-widget-Layermanagement .layer-list h3 {
    position: relative;
    margin: 0;
    line-height: 40px;
    height: 40px;
    font-size: 16px;
    font-weight: normal;
    text-align: center;
}
.jimu-widget-Layermanagement .layer-list h3 .sign-head-th-xx {
    position: absolute;
    right: 0px;
}
.jimu-widget-Layermanagement .layer-list li {
    padding: 0 10px;
}
.jimu-widget-Layermanagement .layer-list li>div {
    display: flex;
    align-items: center;
    height: 36px;
}
.jimu-widget-Layermanagement .layer-list li>div span {
    width: calc(100% - 102px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.jimu-widget-Layermanagement .layer-list .control-btn {
    padding: 0 !important;
    width: 24px !important;
    height: 24px !important;
    line-height: 24px !important;
    margin-left: 10px;
}
.jimu-widget-Layermanagement .layer-list .layui-btn {
    border: none;
}
.jimu-widget-Layermanagement .layer-list .control-btn img{
    margin: auto;
    width: 16px;
    height: 16px;
}
.jimu-widget-Layermanagement .tree-layer-opcity {
    display: none;
    position: fixed;
    top: 72px;
    right: 390px;
    width: 260px;
    height: auto;
    background: #Fff;
    border-radius: 5px;
    box-shadow: 0 0 8px #fff;
  }
  .jimu-widget-Layermanagement .tree-layer-opcity h3 {
    margin: 0;
    height: 36px;
    line-height: 36px;
    text-align: center;
  }
  .jimu-widget-Layermanagement .tree-layer-opcity .close {
    position: absolute;
    top: 4px;
    right: 4px;
  }
  .jimu-widget-Layermanagement .tree-layer-opcity li>div:first-child {
    padding: 0 10px;
    line-height: 28px;
    overflow: hidden;
    text-overflow:ellipsis;
    white-space: nowrap;
  }
  .jimu-widget-Layermanagement .tree-layer-opcity li>div:last-child {
    margin: 10px 10px;
    width: calc(100% - 20px);
  }
widgets/LeftNavigationBar/Widget.html
@@ -17,11 +17,5 @@
        <div id="left-tree-list" class="demo-tree demo-tree-box"></div>
    </div>
    <div class="tree-layer-opcity">
        <h3>图层透明度控制</h3>
        <i class="close layui-icon">&#x1006;</i>
        <ul>
        </ul>
    </div>
</div>
widgets/LeftNavigationBar/Widget.js
@@ -78,9 +78,6 @@
                            var jqDom = $("#left-tree-list > .layui-tree > div");
                            for (var i = 0; i < jqDom.length; i++) {
                                if ($(jqDom[i]).text().indexOf("三维倾斜数据") != -1) {
                                    $(jqDom[i]).find('.layui-btn-group').remove()
                                }
                                var textList = $(jqDom[i]).find('.layui-tree-txt');
@@ -99,10 +96,6 @@
                    if (e.keyCode == 13) {
                        leftSearchItemLayer()
                    }
                })
                $(".jimu-widget-LeftNavigationBar .tree-layer-opcity .close").click(function () {
                    $(".jimu-widget-LeftNavigationBar .tree-layer-opcity").stop().hide();
                })
                function leftSearchItemLayer() {
@@ -148,9 +141,6 @@
                            var jqDom = $("#left-tree-list > .layui-tree > div");
                            for (var i = 0; i < jqDom.length; i++) {
                                if ($(jqDom[i]).text().indexOf("三维倾斜数据") != -1) {
                                    $(jqDom[i]).find('.layui-btn-group').remove()
                                }
                                var textList = $(jqDom[i]).find('.layui-tree-txt');
@@ -253,6 +243,8 @@
                            }
                            b.push(a);
                            i++;
                            if (d[k].children && d[k].children.length > 0) {
@@ -285,27 +277,6 @@
                                            var partOfUrl = that.returnStr(small.src).partOfUrl;
                                            //添加S3M图层服务
                                            that[small.id] = scene.open(host + partOfUrl);
                                        } else {
                                            if (that[small.id]) {
                                                that[small.id].show = true
                                            } else {
                                                $.ajax({
                                                    url: small.src + '/maps.json',
                                                    type: 'get',
                                                    dataType: 'JSON',
                                                    success: function (res) {
                                                        that[small.id] = that.map.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
                                                            url: res[0].path,
                                                        }));
                                                        that[small.id].alpha = small.alpha
                                                    }
                                                })
                                            }
                                        }
                                    }
@@ -409,7 +380,7 @@
                        },
                        showLine: false, //是否开启连接线
                        oncheck: function (obj) {
                            var keyId = that.getUrlKeyId("serviceId");
                            if (obj.data.children && obj.data.children.length > 0) {
@@ -462,6 +433,7 @@
                                            if (that[item.id]) {
                                                that[item.id].show = true
                                                topic.publish('appendItem', 'Layermanagement', item, that[item.id]);
                                            } else {
                                                $.ajax({
                                                    url: item.src + '/maps.json',
@@ -469,9 +441,11 @@
                                                    dataType: 'JSON',
                                                    success: function (res) {
                                                        that[item.id] = that.map.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
                                                            url: res[0].path,
                                                        }));
                                                        topic.publish('appendItem', 'Layermanagement', item, that[item.id]);
                                                        that[item.id].alpha = item.alpha
                                                        if (keyId && keyId != "") {
@@ -503,7 +477,10 @@
                                        });
                                    } else {
                                        obj.data.children.forEach(item => {
                                            if (that[item.id]) that[item.id].show = false
                                            if (that[item.id]) {
                                                topic.publish('removeItem', 'Layermanagement', item);
                                                that[item.id].show = false;
                                            }
                                        });
                                    }
@@ -557,19 +534,24 @@
                                    } else {
                                        if (that[obj.data.id]) {
                                            that[obj.data.id].show = true
                                        } else {
                                            that[obj.data.id].show = true;
                                            topic.publish('appendItem', 'Layermanagement', obj.data, that[obj.data.id]);
                                        } else {
                                            $.ajax({
                                                url: obj.data.src + '/maps.json',
                                                type: 'get',
                                                dataType: 'JSON',
                                                success: function (res) {
                                                    that[obj.data.id] = that.map.imageryLayers.addImageryProvider(new Cesium.SuperMapImageryProvider({
                                                        url: res[0].path,
                                                    }));
                                                    topic.publish('appendItem', 'Layermanagement', obj.data, that[obj.data.id]);
                                                    that[obj.data.id].alpha = obj.data.alpha
                                                    if (keyId && keyId != "") {
                                                        that[obj.data.id].getViewableRectangle().then(function (rectangle) {
                                                            return that.map.camera.flyTo({
@@ -577,12 +559,11 @@
                                                            });
                                                        });
                                                    }
                                                    console.log(that[obj.data.id])
                                                }
                                            })
                                        }
                                    }
@@ -596,7 +577,10 @@
                                    } else {
                                        if (that[obj.data.id]) that[obj.data.id].show = false
                                        if (that[obj.data.id]) {
                                            topic.publish('removeItem', 'Layermanagement', obj.data);
                                            that[obj.data.id].show = false;
                                        }
                                    }
@@ -628,87 +612,13 @@
                            }
                        },
                        edit: ['add'],
                        operate: function (obj) {
                            var type = obj.type; //得到操作类型: add、edit、 del
                            var data = obj.data; //得到当前节点的数据
                            var elem = obj.elem; //得到当前节点元素var deptId = data.id;//得到节点索引var parentId = data.parentId;l/父节点
                            var depId = data.id;
                            var parentId = data.parentId;
                            if (type == 'add') {
                                $(".jimu-widget-LeftNavigationBar .tree-layer-opcity ul").empty();
                                if (data.children) {
                                    data.children.forEach(item => {
                                        var liC = `<li>
                                        <div title="${item.title}">
                                            ${item.title}
                                        </div>
                                        <div id="${item.id + 'Layer'}">
                                        </div>
                                    </li>`;
                                        $(".jimu-widget-LeftNavigationBar .tree-layer-opcity ul").append(liC)
                                        $(".jimu-widget-LeftNavigationBar .tree-layer-opcity").stop().show();
                                        slider.render({
                                            elem: '#' + item.id + 'Layer',
                                            min: 0,
                                            max: 10,
                                            value: item.alpha * 10,
                                            step: 1,
                                            theme: '#1E9FFF',
                                            setTips: function (value) { //自定义提示文本
                                                return value / 10;
                                            },
                                            change: function (value) {
                                                item.alpha = value / 10
                                                if (that[item.id]) {
                                                    that[item.id].alpha = item.alpha
                                                }
                                            }
                                        });
                                    })
                                } else {
                                    var liC = `<li>
                                        <div title="${data.title}">
                                            ${data.title}
                                        </div>
                                        <div id="${data.id + 'Layer'}">
                                        </div>
                                    </li>`;
                                    $(".jimu-widget-LeftNavigationBar .tree-layer-opcity ul").append(liC)
                                    $(".jimu-widget-LeftNavigationBar .tree-layer-opcity").stop().show();
                                    slider.render({
                                        elem: '#' + data.id + 'Layer',
                                        min: 0,
                                        max: 10,
                                        value: data.alpha * 10,
                                        step: 1,
                                        theme: '#1E9FFF',
                                        setTips: function (value) { //自定义提示文本
                                            return value / 10;
                                        },
                                        change: function (value) {
                                            data.alpha = value / 10
                                            if (that[data.id]) {
                                                that[data.id].alpha = data.alpha
                                            }
                                        }
                                    });
                                }
                            }
                        }
                    });
widgets/LeftNavigationBar/css/style.css
@@ -162,63 +162,8 @@
}
.jimu-widget-LeftNavigationBar .layui-tree-txt {
  width: calc(100% - 48px);
  width: calc(100% - 28px);
  overflow: hidden;
  text-overflow:ellipsis;
  white-space: nowrap;
}
.jimu-widget-LeftNavigationBar .layui-btn-group {
  visibility: visible;
}
.jimu-widget-LeftNavigationBar .layui-btn-group .layui-icon {
  margin-top: 4px;
  width: 20px;
  height: 20px;
  background: url(../../../images/工具(用以切换图层的透明度).png) no-repeat;
}
.jimu-widget-LeftNavigationBar .layui-btn-group .layui-icon:before {
  content: "";
}
.jimu-widget-LeftNavigationBar .tree-layer-opcity {
  display: none;
  position: absolute;
  top: 240px;
  left: 280px;
  width: 260px;
  height: auto;
  background: #Fff;
  border-radius: 5px;
  box-shadow: 0 0 8px #fff;
}
.jimu-widget-LeftNavigationBar .tree-layer-opcity h3 {
  margin: 0;
  height: 36px;
  line-height: 36px;
  text-align: center;
}
.jimu-widget-LeftNavigationBar .tree-layer-opcity .close {
  position: absolute;
  top: 4px;
  right: 4px;
}
.jimu-widget-LeftNavigationBar .tree-layer-opcity li>div:first-child {
  padding: 0 10px;
  line-height: 28px;
  overflow: hidden;
  text-overflow:ellipsis;
  white-space: nowrap;
}
.jimu-widget-LeftNavigationBar .tree-layer-opcity li>div:last-child {
  margin: 10px 10px;
  width: calc(100% - 20px);
}
widgets/SplitScreen/css/style.css
@@ -1,7 +1,7 @@
.jimu-widget-SplitScreen {
  position: fixed !important;
  top: 96px !important;
  right: 20px !important;
  top: 72px !important;
  right: 60px !important;
  width: auto !important;
  height: auto !important;
  background-color: rgb(207, 207, 207);