From 36e793a7b5a3cd97085876208b2a478c99e5fe99 Mon Sep 17 00:00:00 2001
From: CJJ <Administrator@192.168.10.23>
Date: 星期二, 20 十一月 2018 11:06:57 +0800
Subject: [PATCH] 手机实时数据
---
gx_tieta/WebRoot/mobil/battM.html | 10 ++-
gx_tieta/WebRoot/mobil/testdata.html | 2
gx_tieta/WebRoot/mobil/selectbatt.html | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++
gx_tieta/WebRoot/mobil/selectcounty.html | 2
gx_tieta/WebRoot/mobil/control.html | 1
5 files changed, 159 insertions(+), 6 deletions(-)
diff --git a/gx_tieta/WebRoot/mobil/battM.html b/gx_tieta/WebRoot/mobil/battM.html
index ea2dbf0..2112e4d 100644
--- a/gx_tieta/WebRoot/mobil/battM.html
+++ b/gx_tieta/WebRoot/mobil/battM.html
@@ -56,7 +56,7 @@
}
}*/
- var temp = getCookie("county");
+ var temp = getCookie("battselect");
temp = JSON.parse(temp);
console.info(temp);
//鏍规嵁鏈烘埧id鏌ヨ鐢垫睜缁�
@@ -65,11 +65,13 @@
var data = {
StationName1: temp.StationName1,
StationName2: temp.StationName2,
- StationName5: temp.StationName5
+ StationName5: temp.StationName5,
+ StationName: temp.StationName,
+ StationId: temp.StationId
};
$.ajax({
type: "post",
- url: "BattInfAction!serchStationName3",
+ url: "BattInfAction!serchBattByStation",
async:true,
dataType:'text',
data:"json = "+JSON.stringify(data),
@@ -105,7 +107,7 @@
for (var i = 0; i < dataList.length; i++){
var _li = $('<li></li');
- var _a = $('<a href="javascript:void(0);" target="_top" data-ajax="false" value="" data-transition="slide">'+dataList[i].StationName3+'</a>');
+ var _a = $('<a href="javascript:void(0);" target="_top" data-ajax="false" value="" data-transition="slide">'+dataList[i].BattGroupName+'</a>');
// 灏哶a娣诲姞鍒癬li锛屽皢_li娣诲姞鍒癬ul涓�
_li.append(_a);
_ul.append(_li);
diff --git a/gx_tieta/WebRoot/mobil/control.html b/gx_tieta/WebRoot/mobil/control.html
index be1daec..3658a99 100644
--- a/gx_tieta/WebRoot/mobil/control.html
+++ b/gx_tieta/WebRoot/mobil/control.html
@@ -107,6 +107,7 @@
function searchBattInfo(){
var temp = getCookie("batt");
var batt = JSON.parse(temp);
+ console.info(batt);
arrTd = new Array();
$.ajax({
type: "post",
diff --git a/gx_tieta/WebRoot/mobil/selectbatt.html b/gx_tieta/WebRoot/mobil/selectbatt.html
new file mode 100644
index 0000000..87fc9cb
--- /dev/null
+++ b/gx_tieta/WebRoot/mobil/selectbatt.html
@@ -0,0 +1,150 @@
+<!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">
+<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>
+</head>
+ <body>
+ <!-- 涓夌骇鑿滃崟鍐呭 -->
+ <div data-role="page">
+ <div data-role="header" data-position="fixed">
+ <a href="machineroomM.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>
+
+ <div data-role="content">
+ <ul class="breadcrumb"></ul>
+ <div id="battList2"></div>
+ </div>
+ <div data-role="footer" data-position="fixed">
+ <!-- <h1>绂忓厜鐢靛瓙鏈夐檺鍏徃</h1> -->
+ </div>
+ </div>
+ </body>
+ <script type="text/javascript" src="js/battNav.js"></script>
+ <script type="text/javascript">
+
+ var battinlist = new Array(); //鎵�鏈夌數姹犵粍鐨勬暟缁�
+
+ $(document).ready(function(){
+ setCookie('batt', '');
+ //init();
+ searchkBattByStationid();
+ });
+
+ /* function init(){
+ var temp = getCookie("county");
+ if(temp != '' || temp != undefined) {
+ temp = eval('('+temp+')');
+
+ var data = [
+ {url: 'javascript:JumpHomePage();', txt: '棣栭〉'},
+ {url: 'machineroomM.html', txt: temp.StationName5 },
+ {url: 'javascript:;', txt: '钃勭數姹犵粍'}
+ ];
+ addBreadCrumb($('.breadcrumb').eq(0),data);
+
+ searchkBattByStationid(temp.StationId);
+ }else {
+ window.location.href="machineroomM.html";
+ }
+ }*/
+
+ var temp = getCookie("county");
+ temp = JSON.parse(temp);
+ console.info(temp);
+ //鏍规嵁鏈烘埧id鏌ヨ鐢垫睜缁�
+ function searchkBattByStationid(){
+ loadshow();
+ var data = {
+ StationName1: temp.StationName1,
+ StationName2: temp.StationName2,
+ StationName5: temp.StationName5
+ };
+ $.ajax({
+ type: "post",
+ url: "BattInfAction!serchStationName3",
+ async:true,
+ dataType:'text',
+ data:"json = "+JSON.stringify(data),
+ success: function(data){
+ data = eval('('+data+')');
+ var model = eval('('+data.result+')');
+ console.info(model);
+ if(model.code == 1){
+ battinlist = model.data;
+ createUl($('#battList2'), model.data);
+ }
+ loadclose();
+ },
+ error:function(){
+ loadclose();
+ }
+ });
+ }
+
+ /*
+ 澹版槑涓�涓嚱鏁癱reateUl,鐢ㄤ簬鐢熸垚ul鍜宭i
+ @param ulCon ul鐨勫鍣�
+ @param dataList ul鐨勬暟鎹唴瀹�
+ */
+ function createUl(ulCon, dataList) {
+ // 娓呯悊瀹瑰櫒涓嬬殑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 _a = $('<a href="javascript:void(0);" target="_top" data-ajax="false" value="" data-transition="slide">'+dataList[i].StationName3+'</a>');
+ // 灏哶a娣诲姞鍒癬li锛屽皢_li娣诲姞鍒癬ul涓�
+ _li.append(_a);
+ _ul.append(_li);
+ }
+
+ // 灏哶ul娣诲姞鍒板鍣ㄤ腑
+ ulCon.append(_ul).trigger('create');
+ loadclose();
+ }
+
+ $(document).ready(function () {
+ var aLi = -1;
+ $('#battList2').on('click', 'ul li', function () {
+ aLi = $(this).index();
+ batt = getbatt(battinlist,aLi);
+ var json=window.JSON.stringify(batt);
+ setCookie("battselect",json);
+ window.location.href="battM.html";
+ });
+ });
+
+
+
+ //鑾峰彇褰撳墠閫変腑鐨刡att
+ function getbatt(arr,index){
+ console.log(arr);
+ console.log(index);
+ if(arr.length>index){
+ return arr[index];
+ }
+ return undefined;
+ };
+
+ $(function(){
+ $('.breadcrumb').on('tap', 'a[href="#page0"]', function() {
+ list=getList(battinlist,0,batt);
+ //init();
+ });
+ });
+ </script>
+
+</html>
\ No newline at end of file
diff --git a/gx_tieta/WebRoot/mobil/selectcounty.html b/gx_tieta/WebRoot/mobil/selectcounty.html
index 2007bb1..ac27a89 100644
--- a/gx_tieta/WebRoot/mobil/selectcounty.html
+++ b/gx_tieta/WebRoot/mobil/selectcounty.html
@@ -65,7 +65,7 @@
var json=window.JSON.stringify(county);
setCookie("county",json);
- window.location.href="battM.html";
+ window.location.href="selectbatt.html";
});
});
diff --git a/gx_tieta/WebRoot/mobil/testdata.html b/gx_tieta/WebRoot/mobil/testdata.html
index 9839d58..8def9de 100644
--- a/gx_tieta/WebRoot/mobil/testdata.html
+++ b/gx_tieta/WebRoot/mobil/testdata.html
@@ -55,7 +55,7 @@
<script type="text/javascript" src="js/battNav.js"></script>
<script type="text/javascript">
$(function() {
- console.warn(111133);
+ //console.warn(111133);
console.info(batt);
var data = [
{url: 'javascript:JumpHomePage();', txt: '棣栭〉'},
--
Gitblit v1.9.1