New file |
| | |
| | | <!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="selectcounty.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(); //所有电池组的数组
|
| | | var temp = getCookie("county");
|
| | | $(document).ready(function(){
|
| | | setCookie('batt', '');
|
| | | init(); |
| | | //searchkBattByStationid();
|
| | | });
|
| | | |
| | | function init(){
|
| | | //var temp = getCookie("county");
|
| | | |
| | | console.info(temp);
|
| | | if(temp != '' || temp != undefined) {
|
| | | temp = JSON.parse(temp);
|
| | | //temp = eval('('+temp+')');
|
| | | |
| | | 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: 'javascript:;', txt: '机房'}
|
| | | ];
|
| | | addBreadCrumb($('.breadcrumb').eq(0),data);
|
| | | |
| | | searchkBattByStationid();
|
| | | }else {
|
| | | window.location.href="machineroomM.html";
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | //根据机房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();
|
| | | } |
| | | });
|
| | | }
|
| | | |
| | | /*
|
| | | 声明一个函数createUl,用于生成ul和li
|
| | | @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和a
|
| | | 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";
|
| | | });
|
| | | });
|
| | | |
| | | |
| | | |
| | | //获取当前选中的batt
|
| | | 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>
|