From 25ce610f6ecca7325e7a743dc032c4a76559c63d Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Fri, 02 Jul 2021 09:10:26 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/pyhmap
---
widgets/LeftNavigationBar/Widget.js | 141 +++++++++++++++++++++++++++++++---------------
1 files changed, 95 insertions(+), 46 deletions(-)
diff --git a/widgets/LeftNavigationBar/Widget.js b/widgets/LeftNavigationBar/Widget.js
index 7f15f4f..86a55ff 100644
--- a/widgets/LeftNavigationBar/Widget.js
+++ b/widgets/LeftNavigationBar/Widget.js
@@ -3,16 +3,16 @@
// 模块描述:显示坐标
///////////////////////////////////////////////////////////////////////////
define([
- 'dojo/_base/declare',
- 'dojo/_base/lang',
- 'dojo/_base/array',
- 'dojo/_base/html',
- 'dojo/topic',
- 'jimu/BaseWidget',
- 'jimu/utils',
- 'jimu/css!libs/zTree_v3/css/zTreeStyle/zTreeStyle.css',
- 'libs/zTree_v3/js/jquery.ztree.all'
-],
+ 'dojo/_base/declare',
+ 'dojo/_base/lang',
+ 'dojo/_base/array',
+ 'dojo/_base/html',
+ 'dojo/topic',
+ 'jimu/BaseWidget',
+ 'jimu/utils',
+ 'jimu/css!libs/zTree_v3/css/zTreeStyle/zTreeStyle.css',
+ 'libs/zTree_v3/js/jquery.ztree.all'
+ ],
function (declare,
lang,
array,
@@ -33,26 +33,60 @@
// this.begin(this.data);
var that = this;
this.getData();
+ topic.subscribe("closeNavigation", lang.hitch(this, this.closeNavigation));
+ // $('.left-navigation-bar-but').click(() => {
+ // this.changeImg = !this.changeImg;
+ // if (this.changeImg) {
+ // $('.l-n-b-b-img').attr("src", "./images/addL/xzuo.png"); //打开
+ // $('.jimu-widget-LeftNavigationBar').css({
+ // 'left': '0px'
+ // });
+ // $('.jimu-widget-instructions').css({
+ // 'left': '260px'
+ // });
+ // } else {
+ // $('.l-n-b-b-img').attr("src", "./images/addL/xyou.png"); //关闭
+ // $('.jimu-widget-LeftNavigationBar').css({
+ // 'left': '-250px'
+ // });
+ // $('.jimu-widget-instructions').css({
+ // 'left': '10px'
+ // });
+ // }
+ // })
+ $('.left-navigation-bar-but>div').click(() => {
+ topic.publish('closeTool', this.name);
+ topic.publish('closeMap', this.name);
+ $(".jimu-widget-Layermanagement .layer-list").stop().hide();
- $('.left-navigation-bar-but').click(() => {
- this.changeImg = !this.changeImg;
- if (this.changeImg) {
- $('.l-n-b-b-img').attr("src", "./images/addL/xzuo.png"); //打开
- $('.jimu-widget-LeftNavigationBar').css({
- 'left': '0px'
- });
- $('.jimu-widget-instructions').css({
- 'left': '260px'
- });
- } else {
- $('.l-n-b-b-img').attr("src", "./images/addL/xyou.png"); //关闭
- $('.jimu-widget-LeftNavigationBar').css({
- 'left': '-250px'
- });
- $('.jimu-widget-instructions').css({
- 'left': '10px'
- });
+ if ($(".jimu-widget-Layermanagement .layer-list").is(":hidden")) {
+ $(".jimu-widget-Layermanagement .tree-layer-opcity").stop().hide();
}
+
+ if ($('.left-navigation-bar-main').is(":hidden")) {
+ $('.left-navigation-bar-main').stop().css({
+ 'width': '300px',
+ 'padding': '10px',
+ 'height': 'auto'
+ }).show();
+
+
+ } else {
+ $('.left-navigation-bar-main').stop().css({
+ 'width': '0px',
+ 'padding': '0px',
+ 'height': '0px',
+ }).hide();
+ }
+
+ })
+ $('#l-n-b-m-search-closeOUR').click(() => {
+
+ $('.left-navigation-bar-main').stop().css({
+ 'width': '0px',
+ 'padding': '0px',
+ 'height': '0px',
+ }).hide();
})
@@ -102,13 +136,13 @@
var val = $('#left-navigation-bar-main-input').val();
if (val != '') {
var clearOur = () => {
- let dom = $(`[data-id]`);
- dom.removeClass('layui-tree-spread');
- let domDiv = dom.find('.layui-tree-pack');
- domDiv.css({
- 'display': 'none'
- })
- },
+ let dom = $(`[data-id]`);
+ dom.removeClass('layui-tree-spread');
+ let domDiv = dom.find('.layui-tree-pack');
+ domDiv.css({
+ 'display': 'none'
+ })
+ },
a, useit = (d) => {
for (var k in d) {
if (d[k].who == 'father') {
@@ -159,7 +193,19 @@
}
},
- closeToolBox: function (item) { },
+ closeNavigation: function (item) {
+ if (item != this.name) {
+
+ if (!$('.left-navigation-bar-main').is(":hidden")) {
+ $('.left-navigation-bar-main').stop().css({
+ 'width': '0px',
+ 'padding': '0px',
+ 'height': '0px',
+ }).hide();
+ }
+
+ }
+ },
onOpen: function () {
//面板打开的时候触发 (when open this panel trigger)
@@ -331,7 +377,7 @@
},
begin: function (data) {
var that = this;
-
+ window.mySanweiShujuOpens = {}; //全局scene.open资源
var a = null;
layui.use(function () {
@@ -343,7 +389,7 @@
tree.render({
elem: '#left-tree-list' //默认是点击节点可进行收缩
- ,
+ ,
data: data,
id: 'demoId1',
showCheckbox: true, //是否显示复选框
@@ -388,7 +434,9 @@
that[item.id] = scene.open(host + partOfUrl, undefined, {
autoSetView: false //不自动定位
});
- console.log(222)
+
+ window.mySanweiShujuOpens[item.id] = that[item.id];
+ // console.log(222)
topic.publish('appendTilt', 'Layermanagement', item);
topic.publish('appendTiltS', 'spatialAnalysis', item);
topic.publish('addLayersLegends', 'legends', item);
@@ -432,7 +480,7 @@
destination: rectangle
});
});
- console.log(444)
+ // console.log(444)
topic.publish('appendItem', 'Layermanagement', item, that[item.id]);
topic.publish('appendItemS', 'spatialAnalysis', item, that[item.id]);
topic.publish('addLayersLegends', 'legends', item);
@@ -513,7 +561,8 @@
that[obj.data.id] = scene.open(host + partOfUrl, undefined, {
autoSetView: false //不自动定位
});
- console.log(333)
+ window.mySanweiShujuOpens[obj.data.id] = that[obj.data.id];
+
topic.publish('appendTilt', 'Layermanagement', obj.data);
topic.publish('appendTiltS', 'spatialAnalysis', obj.data);
topic.publish('addLayersLegends', 'legends', obj.data);
@@ -552,7 +601,7 @@
destination: rectangle
});
});
- console.log(555)
+ // console.log(555)
topic.publish('appendItem', 'Layermanagement', obj.data, that[obj.data.id]);
topic.publish('appendItemS', 'spatialAnalysis', obj.data, that[obj.data.id]);
topic.publish('addLayersLegends', 'legends', obj.data);
@@ -704,15 +753,15 @@
title: '采集站点',
id: 1,
field: '1'
- // , checked: true
- ,
+ // , checked: true
+ ,
spread: true,
children: [{
title: '南矶山保护区',
id: 11,
field: '1-1'
- // , checked: true
- ,
+ // , checked: true
+ ,
spread: true,
children: [{
title: '北深渊',
--
Gitblit v1.9.3