From 2b8e498c0550d8e8bf17a9dafddb136cc7bd1e1a Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Thu, 01 Jul 2021 10:28:35 +0800
Subject: [PATCH] 导航样式

---
 widgets/LeftNavigationBar/Widget.js |  114 +++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 98 insertions(+), 16 deletions(-)

diff --git a/widgets/LeftNavigationBar/Widget.js b/widgets/LeftNavigationBar/Widget.js
index 7f15f4f..3f27068 100644
--- a/widgets/LeftNavigationBar/Widget.js
+++ b/widgets/LeftNavigationBar/Widget.js
@@ -34,24 +34,103 @@
                 var that = this;
                 this.getData();
 
+                // $('.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'
+                //         });
+                //     }
+                // })
+                var time = null;
                 $('.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'
+                        if (time != null) {
+                            clearTimeout(time);
+                            time = null;
+                        }
+                        // $('.l-n-b-b-img').attr("src", "./images/addL/xzuo.png"); //打开
+                        $('.left-navigation-bar-main').css({
+                            'display': 'block',
+                            'width': '300px',
+                            'padding': '10px',
+                            'height': 'auto',
                         });
-                        $('.jimu-widget-instructions').css({
-                            'left': '260px'
-                        });
+                        $('.l-n-b-m-search').css({
+                            'display': 'flex',
+                        })
+                        $('#left-tree-list').css({
+                            'display': 'block',
+                        })
+
                     } else {
-                        $('.l-n-b-b-img').attr("src", "./images/addL/xyou.png"); //关闭
-                        $('.jimu-widget-LeftNavigationBar').css({
-                            'left': '-250px'
+                        // $('.l-n-b-b-img').attr("src", "./images/addL/xyou.png"); //关闭
+                        $('.l-n-b-m-search').css({
+                            'display': 'none',
+                        })
+                        $('#left-tree-list').css({
+                            'display': 'none',
+                        })
+                        $('.left-navigation-bar-main').css({
+                            'width': '0px',
+                            'padding': '0px',
+                            'height': '0px',
                         });
-                        $('.jimu-widget-instructions').css({
-                            'left': '10px'
+                        if (time != null) {
+                            clearTimeout(time);
+                            time = null;
+                        }
+                        time = setTimeout(() => {
+                            $('.left-navigation-bar-main').css({
+                                'display': 'none'
+                            });
+                            clearTimeout(time);
+                            time = null;
+                        }, 500);
+                    }
+                })
+                $('#l-n-b-m-search-closeOUR').click(() => {
+                    this.changeImg = !this.changeImg;
+                    if (!this.changeImg) {
+                        if (time != null) {
+                            clearTimeout(time);
+                            time = null;
+                        }
+                        $('.l-n-b-m-search').css({
+                            'display': 'none',
+                        })
+                        $('#left-tree-list').css({
+                            'display': 'none',
+                        })
+                        $('.left-navigation-bar-main').css({
+                            'width': '0px',
+                            'padding': '0px',
+                            'height': '0px',
                         });
+                        if (time != null) {
+                            clearTimeout(time);
+                            time = null;
+                        }
+                        time = setTimeout(() => {
+                            $('.left-navigation-bar-main').css({
+                                'display': 'none'
+                            });
+                            clearTimeout(time);
+                            time = null;
+                        }, 500);
                     }
                 })
 
@@ -331,7 +410,7 @@
             },
             begin: function (data) {
                 var that = this;
-
+                window.mySanweiShujuOpens = {};//全局scene.open资源
                 var a = null;
 
                 layui.use(function () {
@@ -388,7 +467,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 +513,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 +594,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 +634,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);

--
Gitblit v1.9.3