From a17cadbf345327b2f2f42989af9c17961acec0a2 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Wed, 02 Jun 2021 18:01:09 +0800
Subject: [PATCH] 搜索框

---
 config.json                          |    3 
 widgets/searchL/manifest.json        |   17 ++
 index.html                           |    4 
 widgets/searchL/nls/es/strings.js    |    5 
 widgets/searchL/Widget.js            |  173 ++++++++++++++++++++++++++++
 widgets/searchL/nls/zh-cn/strings.js |    5 
 widgets/searchL/nls/strings.js       |    7 +
 widgets/searchL/Widget.html          |   15 ++
 widgets/searchL/css/style.css        |   94 +++++++++++++++
 9 files changed, 321 insertions(+), 2 deletions(-)

diff --git a/config.json b/config.json
index 76028ff..fbf9c5f 100644
--- a/config.json
+++ b/config.json
@@ -163,6 +163,9 @@
           "height": "360px",
           "relativeTo": "map"
         }
+      }, {
+        "name": "搜索栏",
+        "uri": "widgets/searchL/Widget"
       }
     ],
     "groups": [],
diff --git a/index.html b/index.html
index 7283975..54b7bac 100644
--- a/index.html
+++ b/index.html
@@ -209,14 +209,14 @@
 <div id="main-page">
     <div id="jimu-layout-manager"></div>
  
-    <div class="index_query">
+    <!-- <div class="index_query">
         <div>
             <input id="local_data" autocomplete="off" data-provide="typeahead" type="text" class="input-sm"
                    placeholder="输入关键字以搜索"/>
             <img class="input_img" src="images/query.png">
         </div>
         <div id="mh_query"></div>
-    </div>
+    </div> -->
  
 </div>
 <script src="env.js"></script>
diff --git a/widgets/searchL/Widget.html b/widgets/searchL/Widget.html
new file mode 100644
index 0000000..191a4a2
--- /dev/null
+++ b/widgets/searchL/Widget.html
@@ -0,0 +1,15 @@
+<div>
+	<div id="i-f-gjz" class="input-font"
+		style="border-radius: 5px 0 0px 5px;width:4.7rem;background-color: #3E9FFC;color: #fff;">关键字</div>
+	<div id="i-f-zb" class="input-font" style="width:3.5rem">坐标</div>
+	<!-- <input type="text" placeholder="输入关键字以搜索" class="input-sm /> -->
+	<input id="local_data" autocomplete="off" data-provide="typeahead" type="text" class="input-sms"
+		placeholder="输入关键字以搜索" />
+	<div id="inputTwo">
+		<input id="local_data1" autocomplete="off" data-provide="typeahead" type="text" class="input-sms1"
+			placeholder="输入经度" />
+		<input id="local_data2" autocomplete="off" data-provide="typeahead" type="text" class="input-sms1"
+			placeholder="输入纬度" />
+	</div>
+	<img class="input_img" src="images/query.png">
+</div>
\ No newline at end of file
diff --git a/widgets/searchL/Widget.js b/widgets/searchL/Widget.js
new file mode 100644
index 0000000..3c6bffa
--- /dev/null
+++ b/widgets/searchL/Widget.js
@@ -0,0 +1,173 @@
+///////////////////////////////////////////////////////////////////////////
+// Copyright © 2019 zhongsong. All Rights Reserved.
+// 模块描述:显示坐标
+///////////////////////////////////////////////////////////////////////////
+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'
+],
+	function (declare,
+		lang,
+		array,
+		html,
+		topic,
+		BaseWidget,
+		aspect,
+		string,
+		utils
+	) {
+		return declare([BaseWidget], {
+			baseClass: 'jimu-widget-searchL',
+			name: 'searchL',
+			layers: {},
+			startup: function () {
+
+				//关键词&&坐标
+				$("#i-f-gjz").click(function () {
+					console.log("gjz");
+					$("#i-f-zb").css({ 'backgroundColor': '#fff', 'color': '#000' });
+					$("#i-f-gjz").css({ 'backgroundColor': '#3E9FFC', 'color': '#fff' });
+					$("#inputTwo").css({ 'display': 'none' });
+					$("#local_data").css({ 'display': 'inline-block' });
+				})
+				$("#i-f-zb").click(function () {
+					console.log("zb");
+					$("#i-f-gjz").css({ 'backgroundColor': '#fff', 'color': '#000' });
+					$("#i-f-zb").css({ 'backgroundColor': '#3E9FFC', 'color': '#fff' });
+					$("#local_data").css({ 'display': 'none' });
+					$("#inputTwo").css({ 'display': 'inline-block' });
+				})
+
+				// 暴露在外的接口
+				// topic.subscribe("closeTool", lang.hitch(this, this.closeToolBox));
+				// this.inherited(arguments);
+				// $('.tool-bar .tool-btn span').click(function () {
+				// 	topic.publish('closeMap', this.name);
+				// 	topic.publish('closeZtree', this.name);
+				// 	$('.tool-y-box').toggle();
+				// })
+
+
+				// 查询定位
+				// $('.location-tool').click(function () {
+				// 	$('.jimu-widget-Location').show();
+				// 	$('.jimu-widget-FlyRoute').hide();
+				// 	$('.jimu-widget-Sign').hide();
+				// 	$('.jimu-widget-DynamicRiver').hide();
+				// 	$('.jimu-widget-Measurement').hide();
+				// 	$('.tool-y-box').toggle()
+				// })
+
+
+				// 图上量算
+				// $('.measure-tool').click(function () {
+				// 	$('.jimu-widget-Location').hide();
+				// 	$('.jimu-widget-Measurement').show();
+				// 	$('.jimu-widget-Sign').hide();
+				// 	$('.jimu-widget-FlyRoute').hide();
+				// 	$('.jimu-widget-DynamicRiver').hide();
+				// 	$('.tool-y-box').toggle()
+				// })
+
+				// 我的标记
+				// $('.sign-tool').click(function () {
+				// 	topic.publish('openSign', 'Sign');
+				// 	$('.jimu-widget-Location').hide();
+				// 	$('.jimu-widget-Sign').show();
+				// 	$('.jimu-widget-Measurement').hide();
+				// 	$('.jimu-widget-FlyRoute').hide();
+				// 	$('.jimu-widget-DynamicRiver').hide();
+				// 	$('.tool-y-box').toggle()
+				// })
+
+				// 卷帘对比
+				// $('.rolling-tool').click(function () {
+				// 	topic.publish('openRolling', 'Rolling');
+				// 	$('.jimu-widget-Location').hide();
+				// 	$('.jimu-widget-Rolling').show();
+				// 	$('#widgets_Rolling_Widget_17').show();
+				// 	$('.jimu-widget-Measurement').hide();
+				// 	$('.jimu-widget-FlyRoute').hide();
+				// 	$('.jimu-widget-DynamicRiver').hide();
+				// 	$('.tool-y-box').toggle();
+				// })
+
+				// 坐标定位
+				// $('.CoorPosition-tool').click(function () {
+				// 	$('.jimu-widget-CoorPosition').show();
+				// 	$('.jimu-widget-Location').hide();
+				// 	$('.jimu-widget-Measurement').hide();
+				// 	$('.jimu-widget-Sign').hide();
+				// 	$('.jimu-widget-FlyRoute').hide();
+				// 	$('.jimu-widget-DynamicRiver').hide();
+				// 	$('.tool-y-box').toggle()
+				// })
+
+				// 地图打印
+				// $('.MapPrinting-tool').click(function () {
+				// 	$('.jimu-widget-Location').hide();
+				// 	$('.jimu-widget-MapPrinting').show();
+				// 	$('.jimu-widget-CoorPosition').hide();
+				// 	$('.jimu-widget-Measurement').hide();
+				// 	$('.jimu-widget-Sign').hide();
+				// 	$('.jimu-widget-FlyRoute').hide();
+				// 	$('.jimu-widget-DynamicRiver').hide();
+				// 	$('.tool-y-box').toggle()
+				// })
+
+				// 路线导航
+				// $('.RouteNavigate-tool').click(function () {
+				// 	$('.jimu-widget-RouteNavigate').show();
+				// 	$('.jimu-widget-MapPrinting').hide();
+				// 	$('.jimu-widget-CoorPosition').hide();
+				// 	$('.jimu-widget-Measurement').hide();
+				// 	$('.jimu-widget-Sign').hide();
+				// 	$('.jimu-widget-FlyRoute').hide();
+				// 	$('.jimu-widget-DynamicRiver').hide();
+				// 	$('.tool-y-box').toggle()
+				// })
+			},
+
+			closeToolBox: function (item) {
+				// if (item != this.name) {
+				// 	$('.tool-y-box').hide();
+				// }
+			},
+
+			onOpen: function () {
+				//面板打开的时候触发 (when open this panel trigger)
+			},
+
+			onClose: function () {
+				//面板关闭的时候触发 (when this panel is closed trigger)
+			},
+
+			onMinimize: function () {
+				this.resize();
+			},
+
+			onMaximize: function () {
+				this.resize();
+			},
+
+			resize: function () {
+
+			},
+
+
+			destroy: function () {
+				//销毁的时候触发
+				//todo
+				//do something before this func
+				this.inherited(arguments);
+			}
+
+		});
+	});
\ No newline at end of file
diff --git a/widgets/searchL/css/style.css b/widgets/searchL/css/style.css
new file mode 100644
index 0000000..fd82dbd
--- /dev/null
+++ b/widgets/searchL/css/style.css
@@ -0,0 +1,94 @@
+.jimu-widget-searchL {
+  position: fixed;
+  font-size: 14px;
+  height: 35px !important;
+  line-height: 32px;
+  width: 300px !important;
+  top: 20px !important;
+  left: calc(50% - 150px) !important;
+  /* left: calc(100%-300); */
+  /* 240px */
+  background: rgba(255, 255, 255, 1);
+  color: #000;
+  border-right: 1px solid #000;
+  border-radius: 6px 6px 6px 6px;
+  text-align: center;
+  /* cursor: pointer; */
+  z-index: 10 !important;
+  display: flex;
+  align-items: center;
+}
+
+.jimu-widget-searchL .input-font {
+  /* width: 3rem; */
+  height: 35px;
+  /* color: #fff; */
+  display: flex;
+  font-size: 16px;
+  align-items: center;
+  justify-content: center;
+  border-right: 1px solid rgba(0, 0, 0, .2);
+}
+
+.jimu-widget-searchL .input-sms {
+  width: 260px;
+  height: 35px;
+  line-height: 40px;
+  font-size: 16px;
+  text-indent: 8px;
+  outline: 0;
+  float: left;
+  border: none;
+  /* box-shadow: 0 2px 6px #3a3c42; */
+  border-top-left-radius: 2px;
+  border-bottom-left-radius: 2px;
+  color: #000;
+  /* background-color: rgba(63, 72, 84, .7); */
+  border: none;
+  border-radius: 0px 5px 5px 0px;
+}
+
+.jimu-widget-searchL #inputTwo {
+  display: none;
+  width: 260px;
+  height: 35px;
+  font-size: 16px;
+  align-items: center;
+  justify-content: center;
+}
+
+.jimu-widget-searchL .input-sms1 {
+  width: 90px;
+  height: 35px;
+  line-height: 40px;
+  font-size: 16px;
+  text-indent: 8px;
+  outline: 0;
+  float: left;
+  border: none;
+  /* box-shadow: 0 2px 6px #3a3c42; */
+  border-top-left-radius: 2px;
+  border-bottom-left-radius: 2px;
+  color: #000;
+  /* background-color: rgba(63, 72, 84, .7); */
+  border: none;
+  /* border-radius: 0px 5px 5px 0px; */
+}
+
+.jimu-widget-searchL .input-sms1::-webkit-input-placeholder, .jimu-widget-searchL .input-sms::-webkit-input-placeholder {
+  color: #000;
+}
+
+.jimu-widget-searchL .input-sms1::-moz-placeholder, .jimu-widget-searchL .input-sms::-moz-placeholder {
+  /* Mozilla Firefox 19+ */
+  color: #000;
+}
+
+.jimu-widget-searchL .input-sms1:-moz-placeholder, .jimu-widget-searchL .input-sms:-moz-placeholder {
+  /* Mozilla Firefox 4 to 18 */
+  color: #000;
+}
+
+.jimu-widget-searchL .input-sms1::-ms-input-placeholder, .jimu-widget-searchL .input-sms::-ms-input-placeholder {
+  Internet Explorer 10-11 color: #000;
+}
\ No newline at end of file
diff --git a/widgets/searchL/manifest.json b/widgets/searchL/manifest.json
new file mode 100644
index 0000000..d86f5a6
--- /dev/null
+++ b/widgets/searchL/manifest.json
@@ -0,0 +1,17 @@
+{
+  "name": "searchL",
+  "2D": true,
+  "3D": true,
+  "platform": "HTML",
+  "version": "2.10",
+  "wabVersion": "2.10",
+  "author": "yuanjy",
+  "description": "",
+  "copyright": "",
+  "license": "",
+  "properties": {
+    "hasConfig": false,
+    "inPanel": false,
+    "hasVersionManager": false
+  }
+}
\ No newline at end of file
diff --git a/widgets/searchL/nls/es/strings.js b/widgets/searchL/nls/es/strings.js
new file mode 100644
index 0000000..4cf0b87
--- /dev/null
+++ b/widgets/searchL/nls/es/strings.js
@@ -0,0 +1,5 @@
+define(
+   ({
+    _widgetLabel: "searchL"
+  })
+);
\ No newline at end of file
diff --git a/widgets/searchL/nls/strings.js b/widgets/searchL/nls/strings.js
new file mode 100644
index 0000000..461bde8
--- /dev/null
+++ b/widgets/searchL/nls/strings.js
@@ -0,0 +1,7 @@
+define({
+  root: ({
+    _widgetLabel: "searchL"
+  }),
+  "es": 1,
+  "zh-cn": 1
+});
\ No newline at end of file
diff --git a/widgets/searchL/nls/zh-cn/strings.js b/widgets/searchL/nls/zh-cn/strings.js
new file mode 100644
index 0000000..6a74ad6
--- /dev/null
+++ b/widgets/searchL/nls/zh-cn/strings.js
@@ -0,0 +1,5 @@
+define(
+   ({
+    _widgetLabel: "搜索栏"
+  })
+);
\ No newline at end of file

--
Gitblit v1.9.3