From 9427bb844f3c8edd52219f8867e2bd3d4dce6629 Mon Sep 17 00:00:00 2001
From: hdw <hdw@192.168.7.127>
Date: 星期五, 18 一月 2019 10:38:44 +0800
Subject: [PATCH] 测试数据添加机房列表搜索

---
 gx_tieta/WebRoot/mobil/battM.html           |   25 ++---
 gx_tieta/WebRoot/css/web-status-outline.css |   16 +++
 gx_tieta/WebRoot/mobil/homeList.html        |  170 ++++++++++++++++++++++++++++++++++
 gx_tieta/WebRoot/mobil/testdata.html        |    6 
 gx_tieta/WebRoot/mobil/index.html           |    2 
 gx_tieta/WebRoot/mobil/control.html         |    4 
 gx_tieta/WebRoot/Top.jsp                    |   72 ++++++++++++++
 7 files changed, 273 insertions(+), 22 deletions(-)

diff --git a/gx_tieta/WebRoot/Top.jsp b/gx_tieta/WebRoot/Top.jsp
index 1665782..65ccb66 100644
--- a/gx_tieta/WebRoot/Top.jsp
+++ b/gx_tieta/WebRoot/Top.jsp
@@ -134,6 +134,10 @@
 					<i class="fa fa-bell" title="鍏抽棴璇煶鎾姤"></i>
 					<i class="fa fa-bell-slash" title="寮�鍚闊虫挱鎶�"></i>
 				</div>
+				<!-- <div class="cell-list full-screen-top">
+					<i class="fa fa-arrows" title="閫�鍑哄叏灞�"></i>
+					<i class="fa fa-arrows-alt" title="寮�鍚叏灞�"></i>
+				</div> -->
 				<div class="cell-list server-time" style="white-space: nowrap">					
 					2018-11-26 00:00:00
 				</div>
@@ -1092,5 +1096,73 @@
 		     });
 		}
 	})(jQuery);
+	
+	// 璁剧疆椤甸潰鏄惁涓哄叏灞忔樉绀�
+	;(function($, window, document, undefined){
+		//鍒ゆ柇鏄惁鍏ㄥ睆
+		function isFull() {
+		    var fullscreenElement =
+		        document.fullscreenEnabled
+		        || document.mozFullscreenElement
+		        || document.webkitFullscreenElement;
+		    var fullscreenEnabled =
+		        document.fullscreenEnabled
+		        || document.mozFullscreenEnabled
+		        || document.webkitFullscreenEnabled;
+		    if (fullscreenElement == null)
+		    {
+		        return false;
+		    } else {
+		        return true;
+		    }
+		}
+		
+		// 鍏ㄥ睆
+		function fullScreen() {
+			if(document.documentElement.RequestFullScreen){
+                document.documentElement.RequestFullScreen();
+            }
+            //鍏煎鐏嫄
+            if(document.documentElement.mozRequestFullScreen){
+                document.documentElement.mozRequestFullScreen();
+            }
+            //鍏煎璋锋瓕绛夊彲浠ebkitRequestFullScreen涔熷彲浠ebkitRequestFullscreen
+            if(document.documentElement.webkitRequestFullScreen){
+                document.documentElement.webkitRequestFullScreen();
+            }
+            //鍏煎IE,鍙兘鍐檓sRequestFullscreen
+            if(document.documentElement.msRequestFullscreen){
+                document.documentElement.msRequestFullscreen();
+            }
+		}
+		
+		// 鍏抽棴鍏ㄥ睆
+		function exitFullScreen() {
+			if(document.exitFullScreen){
+                document.exitFullscreen()
+            }
+            //鍏煎鐏嫄
+            if(document.mozCancelFullScreen){
+                document.mozCancelFullScreen()
+            }
+            //鍏煎璋锋瓕绛�
+            if(document.webkitExitFullscreen){
+                document.webkitExitFullscreen()
+            }
+            //鍏煎IE
+            if(document.msExitFullscreen){
+                document.msExitFullscreen()
+            }
+		}
+		
+		$('.cell-list.full-screen-top').click(function() {
+			if($(this).hasClass('close-full-screen')) {
+				exitFullScreen();
+			}else {
+				fullScreen();
+			}
+			$(this).toggleClass('close-full-screen')
+		});
+	})(jQuery, window, document);
   </script>
 </html>
diff --git a/gx_tieta/WebRoot/css/web-status-outline.css b/gx_tieta/WebRoot/css/web-status-outline.css
index b9c976a..e76bb14 100644
--- a/gx_tieta/WebRoot/css/web-status-outline.css
+++ b/gx_tieta/WebRoot/css/web-status-outline.css
@@ -29,6 +29,22 @@
 .web-status .cell-list.voice.close-voice {
 	color: #C8C8C8;
 }
+
+.web-status .cell-list.full-screen-top {
+	font-size: 18px;
+	color: #1995DA;
+	cursor: pointer;
+}
+.web-status .cell-list.full-screen-top .fa-arrows {
+	display: none;
+}
+.web-status .cell-list.full-screen-top.close-full-screen .fa-arrows {
+	display: inline-block;
+}
+.web-status .cell-list.full-screen-top.close-full-screen .fa-arrows-alt{
+	display: none;
+}
+
 .web-status .progressbar {
 	width: 60px;
 }
diff --git a/gx_tieta/WebRoot/mobil/battM.html b/gx_tieta/WebRoot/mobil/battM.html
index 368df1b..3e44dba 100644
--- a/gx_tieta/WebRoot/mobil/battM.html
+++ b/gx_tieta/WebRoot/mobil/battM.html
@@ -14,7 +14,7 @@
 		<!-- 涓夌骇鑿滃崟鍐呭	-->
 		<div data-role="page">
 			<div data-role="header" data-position="fixed">
-				<a href="selectbatt.html" class="ui-btn ui-corner-all ui-shadow ui-icon-back ui-btn-icon-left" target="_top" style="padding-top:0.7em;padding-bottom:0.7em;">杩斿洖</a>
+				<a href="homeList.html" class="ui-btn ui-corner-all ui-shadow ui-icon-back ui-btn-icon-left" target="_top" style="padding-top:0.7em;padding-bottom:0.7em;">杩斿洖</a>
 				<h1>钃勭數姹犵粍</h1>
 			</div>
 	
@@ -33,11 +33,8 @@
 		var battinlist = new Array();			//鎵�鏈夌數姹犵粍鐨勬暟缁�
 		var temp = getCookie("battselect");
 		$(document).ready(function(){
-		setCookie('batt', '');
-		//temp = JSON.parse(temp);
-		console.info(temp);
+			setCookie('batt', '');
 			init();
-			//searchkBattByStationid();
 		});
 		
 		function init(){
@@ -47,10 +44,7 @@
 				
 				var data = [
 					{url: 'javascript:JumpHomePage();', txt: '棣栭〉'},
-					{url: 'javascript:JumpFirstPage();', txt:temp.StationName1},
-					{url: 'javascript:JumpcityPage();', txt: temp.StationName2},
-					{url: 'selectcounty.html', txt: temp.StationName5 },
-					{url: 'selectbatt.html', txt: temp.StationName3},
+					{url: 'homeList.html', txt: temp.StationName},
 					{url: 'javascript:;', txt: '钃勭數姹犵粍'}
 				];
 				addBreadCrumb($('.breadcrumb').eq(0),data);
@@ -66,12 +60,13 @@
 		function searchkBattByStationid(){
 			loadshow();
 			var data = {
-						StationName1: temp.StationName1,
-						StationName2: temp.StationName2,
-						StationName5: temp.StationName5,
-						StationName: temp.StationName,
-						StationId: temp.StationId
-					};
+				StationName1: temp.StationName1,
+				StationName2: temp.StationName2,
+				StationName5: temp.StationName5,
+				StationName: temp.StationName,
+				StationId: temp.StationId
+			};
+			console.log(data);
 			$.ajax({ 	
 		        type: "post", 				
 		        url: "BattInfAction!serchBattByStation",				
diff --git a/gx_tieta/WebRoot/mobil/control.html b/gx_tieta/WebRoot/mobil/control.html
index 5b58311..4888c9d 100644
--- a/gx_tieta/WebRoot/mobil/control.html
+++ b/gx_tieta/WebRoot/mobil/control.html
@@ -23,7 +23,7 @@
 	</div>
 
 	<div data-role="content">
-		<ul class="breadcrumb"></ul>
+		<!-- <ul class="breadcrumb"></ul> -->
 		<ul data-role="listview" data-inset="true">
 			<li>
 				<a href="voltageM.html" target="_top">1.鍗曚綋鐢靛帇 </a>
@@ -475,7 +475,7 @@
 			if(batt.install_user||batt.install_user==0){
 				
 			}else{
-				addBreadCrumb($('.breadcrumb').eq(0), data);
+				//addBreadCrumb($('.breadcrumb').eq(0), data);
 			}
 		});
 		
diff --git a/gx_tieta/WebRoot/mobil/homeList.html b/gx_tieta/WebRoot/mobil/homeList.html
new file mode 100644
index 0000000..320ac9d
--- /dev/null
+++ b/gx_tieta/WebRoot/mobil/homeList.html
@@ -0,0 +1,170 @@
+<!doctype html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>鏈烘埧鍒楄〃</title>
+<meta name="viewport" content="width=device-width,initial-scale=1">
+<link rel="stylesheet" href="mobilCss/jquery.mobile-1.4.5.min.css"/>
+<link rel="stylesheet" href="css/breadcrumb.css">
+<link rel="stylesheet" type="text/css" href="css/defined.popup.css"/>
+<link rel="stylesheet" type="text/css" href="src/css/layui.css">
+<style type="text/css">
+	
+</style>
+</head>
+	<body>
+		<div data-role="page"  tabindex="0" id="page0">
+			<div data-role="header" data-position="fixed">
+				<a href="index.html"  target="_top" style="padding-top:0.7em;padding-bottom:0.7em;">杩斿洖</a>
+				<h1>鏈烘埧鍒楄〃</h1>
+			</div>
+			<div data-role="content">
+				<div class="home-search-input-container">
+					<input type="text" data-type="search" name="search" id="searchInput" placeholder="鎼滅储鍐呭...">
+				</div>
+				<div id="battList"></div>
+			</div>
+		</div>
+		<!-- 瀛樺偍鏈烘埧淇℃伅鍒楄〃 -->
+    	<div id="searchHomeIframe"></div>
+	</body>
+	<script type="text/javascript" src="mobilJs/jquery-1.8.2.js"></script>
+	<script type="text/javascript" src="mobilJs/jquery.mobile-1.4.5.min.js"></script>
+	<script type="text/javascript" src="mobilJs/base.js"></script>
+	<script type="text/javascript" src="js/battNav.js"></script>
+	<script type="text/javascript" src="src/layui.all.js"></script>
+	 <script src="app/js/common.js"></script>
+	<script type="text/javascript">
+		var stationlist = new Array();
+		
+		// 鍒濆鍖栭〉闈㈠唴瀹�
+		$(document).ready(function(){
+			setCookie("station",null);
+			setCookie("batt",null);
+		});
+		
+		// 椤甸潰鍒濆鍖栧畬鎴�
+		$(document).on('pageinit', function(event) {
+			setTimeout(function() {
+				findHome();		// 鏌ヨ鎵�鏈夌殑鏈烘埧
+			}, 10);
+		});
+		
+		// 鐐瑰嚮鏈烘埧浜嬩欢
+		var homeSource = [];
+		// 瀹炰緥鍖栨暟鎹娴�
+        var checkHomeData = new CheckData();
+        
+		$(function () {
+			// 鏇存敼鏂囨湰妗嗙殑鍊艰幏鍙�
+            $('#searchInput').on('input propertychange', function() {
+                var _val = $(this).val();
+                $(this).data('homeInfo', '');
+                var data = checkHomeData.getData(_val);
+                createUl($('#battList'), data);
+            });
+			
+			// 娓呯┖鏂囨湰妗�
+			$('.home-search-input-container').on('click.hdw123', '.ui-input-clear',function() {
+				// 鏄剧ず鍏ㄩ儴鐨勬満鎴垮垪琛�
+				var data = checkHomeData.getData('');
+				createUl($('#battList'), data);
+			});
+			
+			var aLi = -1;
+			$('#battList').on('click', 'ul li a', function () {
+				var homeData = $(this).data('homedata');
+				
+				// 鏍规嵁瀛樺偍鍐呭鏋勯�犲璞�
+				var temp = {
+					StationName1: homeData.province,
+					StationName2: homeData.city,
+					StationName5: homeData.county,
+					StationName: homeData.home,
+					StationId: homeData.homeid
+				};
+				
+				
+				var json=window.JSON.stringify(temp);
+				setCookie("battselect",json);
+				window.location.href="battM.html";
+			});
+		});
+		
+		// 鏌ヨ鎵�鏈夌殑鏈烘埧
+		function findHome() {
+			var tmp = {
+				StationName1:'',
+				StationName2: '',
+				StationName5:''
+			};
+			var loading = layer.load(1);
+			// 鏌ヨ鏈烘埧淇℃伅
+			$.post("BattInfAction!serchStationName3","json="+JSON.stringify(tmp),function(result){
+				var rs = JSON.parse(result.result);
+				if(rs.code==1){
+					homeSource = [];
+					var data = rs.data;
+					for(var i=0; i<data.length; i++) {
+						var _data = data[i];
+						var tmp = {
+							label: _data.StationName+'('+_data.StationId+')',
+							province: _data.StationName1,
+							city: _data.StationName2,
+							county: _data.StationName5,
+							home: _data.StationName,
+							homeid: _data.StationId
+						};
+						// console.log(tmp);
+						// 娣诲姞鍒拌祫婧�
+						homeSource.push(tmp);
+					}
+					createUl($('#battList'), homeSource);
+					
+					// 璁剧疆璧勬簮鍐呭
+					checkHomeData.setSource(homeSource);
+				}
+				layer.close(loading);
+			});
+			
+		}
+		
+		/*
+			澹版槑涓�涓嚱鏁癱reateUl,鐢ㄤ簬鐢熸垚ul鍜宭i
+			@param ulCon ul鐨勫鍣�
+			@param dataList  ul鐨勬暟鎹唴瀹�
+		*/
+		function createUl(ulCon, dataList) {
+			//console.info(index);
+			// 娓呯悊瀹瑰櫒涓嬬殑ul
+			ulCon.find('ul').remove();
+			
+			// 鍒涘缓ul
+			var _ul = $('<ul data-role="listview" data-inset="true"></ul>');
+			
+			// 閬嶅巻dataList鐢熸垚li鍜宎
+			for (var i = 0; i < dataList.length; i++){
+				var _li = $('<li></li');
+				var _dataList = dataList[i];
+				var _a = $('<a href="javascript:;" value=""  data-transition="slide">'+_dataList.home+'</a>');
+				_a.data('homedata', _dataList);		// 缁欒繛鎺ユ坊鍔犱俊鎭�				
+				// 灏哶a娣诲姞鍒癬li锛屽皢_li娣诲姞鍒癬ul涓�
+				_li.append(_a);
+				_ul.append(_li);
+			}
+			
+			// 灏哶ul娣诲姞鍒板鍣ㄤ腑
+			ulCon.append(_ul).trigger('create');			
+			loadclose();
+		}
+		
+		//鑾峰彇褰撳墠閫変腑鐨刡att
+		function getbatt(arr,index){
+			if(arr.length>index){
+				return arr[index];
+			}
+			return undefined;
+		};
+	</script>
+	
+</html>
\ No newline at end of file
diff --git a/gx_tieta/WebRoot/mobil/index.html b/gx_tieta/WebRoot/mobil/index.html
index dcee04e..b2ac67b 100644
--- a/gx_tieta/WebRoot/mobil/index.html
+++ b/gx_tieta/WebRoot/mobil/index.html
@@ -20,7 +20,7 @@
 	<div data-role="content" >
 		<ul data-role="listview"  data-icon="false" data-inset="true">
 			<li>
-				<a href="machineroomM.html" target="_top" data-i18n="main.index">娴嬭瘯鏁版嵁</a>
+				<a href="homeList.html" target="_top" data-i18n="main.index">娴嬭瘯鏁版嵁</a>
 			</li>
 			<li>
 				<a href="ele-param2.html" target="_top" data-i18n="main.warningmanagement">鐢垫睜瀹夎鐢宠</a>
diff --git a/gx_tieta/WebRoot/mobil/testdata.html b/gx_tieta/WebRoot/mobil/testdata.html
index 068db47..3b77dc1 100644
--- a/gx_tieta/WebRoot/mobil/testdata.html
+++ b/gx_tieta/WebRoot/mobil/testdata.html
@@ -66,10 +66,8 @@
 				console.info(batt);
 					var data = [
 						{url: 'javascript:JumpHomePage();', txt: '棣栭〉'},
-						{url: 'machineroomM.html', txt: batt.StationName1},	// 鐪�
-						{url: 'selectcity.html' , txt:batt.StationName2},//甯�
-						{url: 'selectcounty.html' , txt:batt.StationName5},
-						{url: 'battM.html', txt: batt.StationName3},	// 鐢垫睜缁�
+						{url: 'homeList.html' , txt:batt.StationName},
+						{url: 'battM.html', txt: batt.BattGroupName},	// 鐢垫睜缁�
 						{url: 'javascript:;', txt: '鐢垫睜缁勬暟鎹�'}	// 褰撳墠椤甸潰
 					];
 					console.info(data);

--
Gitblit v1.9.1