| | |
| | | <link rel="stylesheet" type="text/css" href="css/nocontent.css">
|
| | | <link rel="stylesheet" type="text/css" href="css/loading.css">
|
| | | <link rel="stylesheet" type="text/css" href="css/basic-layout.css"/>
|
| | | <link rel="stylesheet" href="css/sidebar.css" />
|
| | | <link rel="stylesheet" href="css/common.css">
|
| | | <link rel="stylesheet" href="src/css/layui.css">
|
| | | <style>
|
| | | #lside {
|
| | | position: absolute;
|
| | | top: 0;
|
| | | left: 0;
|
| | | bottom: 0;
|
| | | right: 0;
|
| | | }
|
| | | </style>
|
| | | </head>
|
| | |
|
| | | <body>
|
| | |
| | | <jsp:include page="nav.jsp" flush="true"/>
|
| | | <div class="page-content">
|
| | | <div class="content-item side-bar-container">
|
| | | <div class="lside"></div>
|
| | | <div class="lside" id="lside"></div>
|
| | | </div>
|
| | | <div class="content-item data-show">
|
| | | <div class="data-container">
|
| | |
| | | <script type="text/javascript" src="jqueryui/jquery-ui.min.js"></script>
|
| | | <script type="text/javascript" src="js/equip-stats-change.jquery.ui.js"></script>
|
| | | <script type="text/javascript" src="js/basic-layout.js"></script>
|
| | | <script type="text/javascript" src="js/sidebar.js"></script>
|
| | | <script type="text/javascript" src="pages/js/pages/siderbar.js"></script>
|
| | | <script type="text/javascript" src="js/pageUtil.js"></script>
|
| | | <script type="text/javascript" src="src/layui.all.js"></script>
|
| | | <script type="text/javascript">
|
| | | var arrTh = [];
|
| | | var arrTd = [];
|
| | |
| | | pageSize:10,
|
| | | pageAll:0
|
| | | };
|
| | | /* 左侧导航点击事件 需要引入sidebar.js */
|
| | | $(function () {
|
| | | //二级左菜单的显示和隐藏
|
| | | $('.lside').on('click','.fir', function(){
|
| | | // 判断是否是第一次生成内容
|
| | | if ($(this).next().length == 0) {
|
| | | searchAllStationByProvince($(this).attr('name'));
|
| | | //createLsideSec(secObj, $(this).attr('name'));
|
| | | }else {
|
| | | //修复二级为空时的bug
|
| | | for(var i=0;i<$(this).next().children().length;i++)
|
| | | {
|
| | | if($(this).next().children().eq(i).children().eq(0).text()=='')
|
| | | {
|
| | | $(this).next().children().eq(i).children().eq(0).remove();
|
| | | $(this).next().children().eq(i).children().eq(0).next().slideToggle();
|
| | | }
|
| | | }
|
| | | $(this).next().slideToggle(function() {
|
| | | changeFirImg($(this));
|
| | | });
|
| | | }
|
| | | });
|
| | | |
| | | // 三级菜单背景色改变
|
| | | $('.lside').on('click', '.thr', function(){
|
| | | $('.lside .thr').removeClass('active');
|
| | | $('.lside .fir').removeClass('active');
|
| | | $('.lside .sec').removeClass('active');
|
| | | $(this).addClass("active");
|
| | | // 下方添加点击三级菜单触发事件
|
| | | searchDevHistoryRecord();
|
| | | });
|
| | | |
| | | //三级左菜单的显示和隐藏
|
| | | $('.lside').on('click', '.sec', function(){
|
| | | $('.lside .thr').removeClass('active');
|
| | | $('.lside .fir').removeClass('active');
|
| | | $('.lside .sec').removeClass('active');
|
| | | $(this).addClass("active");
|
| | | $(this).next().slideToggle();
|
| | | });
|
| | | });
|
| | | |
| | | var layerMsg;
|
| | |
|
| | | // 生成页面中的表格
|
| | | $(function () {
|
| | |
| | | ele.html($opt);
|
| | | }
|
| | | });
|
| | | |
| | | // 生成左侧导航
|
| | | $(function(){
|
| | | searchAllProvince();
|
| | | });
|
| | | |
| | | /**
|
| | | * 生成左侧一级导航
|
| | | * @param array mList 一级导航的数据机房名称,机房ID
|
| | | * [{StationName:string,StationId:string}...]
|
| | | */
|
| | | function createLsideFir(contain,mList){
|
| | | // 清除contain的内容
|
| | | contain.text('');
|
| | | var _ul = $('<ul></ul>'); |
| | | // 遍历mList根据其数据生成页面中的内容
|
| | | for (var i = 0; i < mList.length; i++) {
|
| | | var _li = $('<li></li>');
|
| | | var _a = $('<a href="javascript:;" class="fir" name="'+mList[i].StationName1+'"><strong class="arrow down"></strong><span></span>'+mList[i].StationName1+'</a>');
|
| | | _li.append(_a);
|
| | | _ul.append(_li);
|
| | | }
|
| | | |
| | | contain.append(_ul);
|
| | | }
|
| | | |
| | | /**
|
| | | * 生成左侧二级导航
|
| | | * @param array mList 一级导航的数据机房名称,机房ID
|
| | | * [{StationName:string,StationId:string,BattGroupId:string,BattGroupName:string}...]
|
| | | */
|
| | | function createLsideSec(mList, stationName){
|
| | | // 根据_stationId的值确定要生成二级导航的位置
|
| | | var _fir = $('.lside .fir');
|
| | | |
| | | _fir.each(function() {
|
| | | if($(this).attr('name') == stationName) {
|
| | | $(this).next('ul').remove();
|
| | | $(this).children('strong.arrow').removeClass('down').addClass('up');
|
| | | |
| | | var _ul = $('<ul style="display:block"></ul>');
|
| | | var _li = $('<li></li>');
|
| | | var _a = $('<a href="javascript:;" class="sec" id="'+mList[0].FBSDeviceId+'" value="'+mList[0].StationName+'" style="display:none"></a>');
|
| | | _li.append(_a);
|
| | | var __ul = $('<ul style="display: block"></ul>');
|
| | | var tagStr = "";
|
| | | // 遍历mList生成第二级内容
|
| | | for(var _i = 0; _i < mList.length; _i++) {
|
| | | tagStr += '<li><a href="javascript:;" class="thr" id="'+mList[_i].FBSDeviceId+'">'+mList[_i].StationName+'</a></li>';
|
| | | }
|
| | | var __li = $(tagStr);
|
| | | __ul.append(__li);
|
| | | _li.append(__ul);
|
| | | _ul.append(_li);
|
| | | $(this).after(_ul);
|
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | /**
|
| | | * 展开左边导航的第一个
|
| | | */
|
| | | function slideFirstSideBar(mList, stationname) {
|
| | | createLsideSec(mList, stationname);
|
| | | $('.lside').find('.fir').eq(0).next().find('.thr').eq(0).addClass('active');
|
| | | }
|
| | | |
| | | //查询所有的维护区
|
| | | function searchAllProvince(){
|
| | | $.ajax({ |
| | | type:"post", |
| | | //url: "BattInfAction!serchByStation", //查询所有的维护区 |
| | | url: "User_battgroup_baojigroup_battgroupAction!serchStationName1InGroup", //查询当前用户管理的维护区 |
| | | async:true, |
| | | dataType:'text',
|
| | | data:null, |
| | | success: function(data){ |
| | | data = eval('('+data+')');
|
| | | var model = eval('('+data.result+')');
|
| | | if(model.code == 1){
|
| | | //console.info('****');
|
| | | //console.info(model);
|
| | | var arr = new Array();
|
| | | for(var i=0;i<model.data.length;i++){
|
| | | arr.push({
|
| | | StationName1:model.data[i]
|
| | | });
|
| | | }
|
| | | createLsideFir($('.lside'), arr);
|
| | | searchAllStationByProvinceFir(arr[0].StationName1);
|
| | | }else{
|
| | | noContent.showNoContent("暂无管理的维护区");
|
| | | } |
| | | } |
| | | });
|
| | | }
|
| | | |
| | | //根据维护区查询所有的机房
|
| | | function searchAllStationByProvince(stationname){
|
| | | addLoadingToMenu(stationname);
|
| | | $.ajax({ |
| | | type:"post", |
| | | //url: "BattInfAction!serchByStationName",
|
| | | url: "User_battgroup_baojigroup_battgroupAction!serchStationInfoByStationName1", |
| | | async:true, |
| | | dataType:'text',
|
| | | //data:"bif.StationName1="+stationname,
|
| | | data:"json="+JSON.stringify({UNote:stationname}),
|
| | | success: function(data){ |
| | | data = eval('('+data+')');
|
| | | var model = eval('('+data.result+')');
|
| | | //console.info(model);
|
| | | removeLoadingMenu(stationname); // 移除数据加载等待
|
| | | if(model.code == 1){
|
| | | createLsideSec(model.data, stationname);
|
| | | }else{
|
| | | |
| | | } |
| | | } |
| | | });
|
| | | }
|
| | | |
| | | // 第一次生成左侧导航
|
| | | function searchAllStationByProvinceFir(stationname) {
|
| | | addLoadingToMenu(stationname);
|
| | | $.ajax({ |
| | | type:"post", |
| | | //url: "BattInfAction!serchByStationName", |
| | | url: "User_battgroup_baojigroup_battgroupAction!serchStationInfoByStationName1", |
| | | async:true, |
| | | dataType:'text',
|
| | | //data:"bif.StationName1="+stationname,
|
| | | data:"json="+JSON.stringify({UNote:stationname}),
|
| | | success: function(data){ |
| | | data = eval('('+data+')');
|
| | | var model = eval('('+data.result+')');
|
| | | removeLoadingMenu(stationname); // 移除数据加载等待
|
| | | if(model.code == 1){
|
| | | //console.info(model.data);
|
| | | slideFirstSideBar(model.data, stationname);
|
| | | searchDevHistoryRecord();
|
| | | }else{
|
| | | |
| | | } |
| | | } |
| | | });
|
| | | }
|
| | |
|
| | | //根据维护区查询所有的机房
|
| | | function searchDevHistoryRecord(){
|
| | | // 关闭msg
|
| | | layer.close(layerMsg);
|
| | | // 生成内容
|
| | | arrTd = new Array();
|
| | | loading.showLoading($('.tbl-body'));
|
| | | $.ajax({
|
| | |
| | | }
|
| | | }
|
| | | }else{
|
| | | noContent.showNoContent("未查询到状态变换记录");
|
| | | layerMsg = layer.msg("未查询到状态变换记录");
|
| | | Page.pageAll = 0;
|
| | | }
|
| | | $('#total').text(Page.pageAll);
|
| | |
| | | rec_time1:$('#record_end_time').val()+" 23:59:59", //设备id
|
| | | page:Page,
|
| | | };
|
| | | temp.dev_id = $('.lside .thr.active').attr('id');
|
| | | var battGroupInfo = getBatt();
|
| | | temp.dev_id = battGroupInfo.FBSDeviceId;
|
| | | temp.state_change_reason = $('#statsList').val();
|
| | | return temp;
|
| | | }
|
| | | |
| | | // 获取被选中电池组的信息
|
| | | function getBatt() {
|
| | | var rs = $('#lside .sider-menu-file.active').data('attr');
|
| | | return rs;
|
| | | }
|
| | |
|
| | | $(function(){
|
| | |
| | | console.info($('#tbHead .tbFixed thead th').length);
|
| | | exprotTable($('.tbl-body th'),$('.tbl-body tbody td'),$('#export_excel'),$('#table_th_arr'),$('#table_td_arr'));
|
| | | });
|
| | | |
| | | // 导出内容
|
| | | function exprotTable(eleTh,eleTd,eleform,eleTh_Text,eleTd_Text){
|
| | | //alert("导出");
|
| | | var ArrTh=new Array();
|
| | |
| | | //console.info(ArrTd);
|
| | | eleform.submit();
|
| | | }
|
| | | |
| | | // siderbar模块
|
| | | $(function() {
|
| | | var TreeView = GLOBAL.pages.TreeView;
|
| | | var first = GLOBAL.pages.siderbar.first; // 一级导航
|
| | | var second = GLOBAL.pages.siderbar.second; // 二级导航
|
| | | var third = GLOBAL.pages.siderbar.third; // 三级导航
|
| | | var fourth = GLOBAL.pages.siderbar.fourth; // 四级导航
|
| | | var treeView = new TreeView($('#lside'));
|
| | | $('#lside').width($('#ele_content').width());
|
| | | treeView.setContainer();
|
| | | // 设置页面的左侧可以左右缩放
|
| | | $('.page-content .content-item.side-bar-container').resizable({
|
| | | handles: 'e',
|
| | | maxWidth: 520,
|
| | | minWidth: 200,
|
| | | alsoResize: $('#lside'),
|
| | | resize:function() {
|
| | | treeView.setContainer();
|
| | | }
|
| | | });
|
| | | |
| | | // 生成一级导航-省
|
| | | first(treeView, treeView.container);
|
| | | |
| | | // 省->市
|
| | | treeView.ele.on('click', '.province', function() {
|
| | | var province = $(this).data('attr');
|
| | | second(treeView, $(this).parent(), province);
|
| | | });
|
| | | |
| | | // 市->机房
|
| | | treeView.ele.on('click', '.city', function() {
|
| | | var city = $(this).data('attr');
|
| | | third(treeView, $(this).parent(), city);
|
| | | });
|
| | | |
| | | battinlist = [];
|
| | | // 机房->电池组
|
| | | treeView.ele.on('click', '.home', function() {
|
| | | var home = $(this).data('attr');
|
| | | var tmp = {
|
| | | StationName1: home.StationName1,
|
| | | StationName2: home.StationName2,
|
| | | StationName: home.StationName,
|
| | | StationId: home.StationId
|
| | | };
|
| | | fourth(treeView, $(this).parent(), tmp);
|
| | | });
|
| | | |
| | | // 电池组
|
| | | treeView.ele.on('click', '.eleGroup', function() {
|
| | | var eleGroup = $(this).data('attr');
|
| | | |
| | | searchDevHistoryRecord();
|
| | | });
|
| | | });
|
| | | </script>
|
| | | </body>
|
| | | </html>
|