From c3bb18b5acb4c8453c6f86a376dd37bd93ae3bc3 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Tue, 22 Jun 2021 10:13:53 +0800
Subject: [PATCH] 空间分析关闭逻辑修改

---
 widgets/digTheEarth/Widget.js     |   21 +++++++++------------
 widgets/spatialAnalysis/Widget.js |   10 ++++++----
 2 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/widgets/digTheEarth/Widget.js b/widgets/digTheEarth/Widget.js
index 0280d81..2501555 100644
--- a/widgets/digTheEarth/Widget.js
+++ b/widgets/digTheEarth/Widget.js
@@ -175,21 +175,18 @@
                 that.handlerPolygon = handlerPolygon;
             },
             handlerPolygon: '',
-            closesDigTheEarth: function (froms) {
+            closesDigTheEarth: function () {
                 // console.log('gaunbi');
                 var that = this;
-                if (froms == 'frist') {
-                    // console.log('frist');
-                } else {
-                    that.map.scene.globe.removeAllExcavationRegion();
-                    if (that.handlerPolygon.polygon) {
-                        that.handlerPolygon.polygon.show = false;
-                    }
-                    if (that.handlerPolygon.polyline) {
-                        that.handlerPolygon.polyline.show = false;
-                    }
-                    that.handlerPolygon.deactivate();
+                that.map.scene.globe.removeAllExcavationRegion();
+                if (that.handlerPolygon.polygon) {
+                    that.handlerPolygon.polygon.show = false;
                 }
+                if (that.handlerPolygon.polyline) {
+                    that.handlerPolygon.polyline.show = false;
+                }
+                that.handlerPolygon.deactivate();
+
             },
             onOpen: function () {
 
diff --git a/widgets/spatialAnalysis/Widget.js b/widgets/spatialAnalysis/Widget.js
index 7b0f1c1..31006bf 100644
--- a/widgets/spatialAnalysis/Widget.js
+++ b/widgets/spatialAnalysis/Widget.js
@@ -31,7 +31,7 @@
 				var that = this;
 				// 暴露在外的接口
 
-				var domHtmls = [
+				var domHtmls = [//默认
 					{
 						name: '可视分析',
 						classs: 'visibleArea-tool',
@@ -194,7 +194,7 @@
 				})
 				//地形开挖
 				$('.digTheEarth-tool').click(function () {
-					that.closeOnceUse('frist');
+					that.closeOnceUse('digTheEarth');
 					$(".jimu-widget-digTheEarth").show();
 					topic.publish('beginDigTheEarth', 'beginDigTheEarth');
 
@@ -240,8 +240,10 @@
 				$(".jimu-widget-SQLQuery").hide();
 				topic.publish('closesSQL', 'closesSQL');
 				//关闭地形开挖
-				$(".jimu-widget-digTheEarth").hide();
-				topic.publish('closesDigTheEarth', who);
+				if (who != 'digTheEarth') {
+					$(".jimu-widget-digTheEarth").hide();
+					topic.publish('closesDigTheEarth');
+				}
 
 			},
 			onOpen: function () {

--
Gitblit v1.9.3