| | |
| | | var form = layui.form; // 获取表单模块
|
| | | var layer = layui.layer; // 获取弹出框模块
|
| | | var element = layui.element; // 获取元素操作模块
|
| | | |
| | | |
| | | var isNewLoad = true;
|
| | | var pre_province = getQueryString('province');
|
| | | // 查询省下拉框
|
| | |
| | | ,toolbar: false
|
| | | ,cellMinWidth: 80
|
| | | ,cols: [[
|
| | | {fileld: 'Staionanme', title: '机房名称', align: 'center', width: 380}
|
| | | {field: 'Staionanme', title: '机房名称', align: 'center', width: 450}
|
| | | ,{field:'dev_id', title:'设备id', align:'center', width: 150}
|
| | | ,{field:'battgroup_id1', title:'电池组1', align:'center', width: 150}
|
| | | ,{field:'battgroup_id2', title:'电池组2', align:'center', width: 150}
|
| | | ,{field:'battgroup_id3', title:'电池组3', align:'center', width: 150}
|
| | | ,{field:'battgroup_id4', title:'电池组4', align:'center', width: 150}
|
| | | ,{field:'connet_time', title:'设备连接时间', align:'center'}
|
| | | ,{field: 'dev_comm_runtime', title: '设备运行时长', align: 'center'}
|
| | | ,{field: 'dev_comm_runtime', title: '设备运行时间', align: 'center'}
|
| | | ,{field:'break_type_txt', title:'连接状态', align:'center', templet: '#breakTypeTpl', width: 150}
|
| | | ]]
|
| | | ,data:[
|
| | |
| | | table.render(tOptions);
|
| | |
|
| | | var Page = new TblPage();
|
| | | Page.set(1, 100, 10);
|
| | | Page.set(1, 0, 10);
|
| | | //console.log(Page);
|
| | |
|
| | | // 查询后台数据
|
| | |
| | | function search(temp, newLoad) {
|
| | | var load;
|
| | | if(newLoad) {
|
| | | load = layer.load(1)
|
| | | load = layer.load(1);
|
| | | }
|
| | | console.log(temp);
|
| | | setTimeout(function() {
|
| | | setPageVal(Page);
|
| | | layer.close(load);
|
| | | }, 1000);
|
| | | //console.log(temp); |
| | | $.ajax({
|
| | | type:'post',
|
| | | async:true,
|
| | | url: 'App_bts_comm_taskAction!serchByCondition',
|
| | | data: "json="+JSON.stringify(temp),
|
| | | dataType: 'json',
|
| | | success:function(result) {
|
| | | var model = JSON.parse(result.result);
|
| | | //console.info(model);
|
| | | var arr_td = new Array();
|
| | | if(model.code == 1){
|
| | | for(var i=0;i<model.data.length;i++){
|
| | | var _data = model.data[i];
|
| | | var _tmp = {};
|
| | | _tmp.Staionanme = _data.stationName;
|
| | | _tmp.dev_id = _data.dev_id;
|
| | | _tmp.battgroup_id1 = _data.battgroup_id1;
|
| | | _tmp.battgroup_id2 = _data.battgroup_id2;
|
| | | _tmp.battgroup_id3 = _data.battgroup_id3;
|
| | | _tmp.battgroup_id4 = _data.battgroup_id4;
|
| | | _tmp.connet_time = _data.connet_time;
|
| | | _tmp.dev_comm_runtime = _data.dev_comm_runtime;
|
| | | _tmp.break_type = _data.break_type;
|
| | | arr_td.push(_tmp);
|
| | | Page.setAll(_data.num);
|
| | | }
|
| | | }
|
| | | //console.info(arr_td);
|
| | | tOptions.data = arr_td;
|
| | | // 生成表格数据
|
| | | table.render(tOptions);
|
| | | setPageVal(Page);
|
| | | layer.close(load);
|
| | | },error:function(e){
|
| | | layer.close(load);
|
| | | }
|
| | | });
|
| | | |
| | | }
|
| | | |
| | |
|
| | | // 构造查询条件
|
| | | function createSearchParam() {
|
| | | var sid = $('#home').attr('stationid')?$('#home').attr('stationid'): 0;
|
| | | var sid = $('#home').find('option:selected').attr('stationid')?$('#home').find('option:selected').attr('stationid'): 0;
|
| | | var temp = {
|
| | | StationId: sid
|
| | | ,page: Page.getPage()
|
| | | StationId: sid,
|
| | | StationName1:$('#province').attr('value'),
|
| | | StationName2:$('#city').attr('value'),
|
| | | StationName5:$('#county').attr('value'),
|
| | | page: Page.getPage(),
|
| | | };
|
| | | |
| | | return temp;
|
| | | |
| | | |
| | | }
|
| | | |
| | | //点击查询按钮
|
| | | $('#paging .search').click(function(){
|
| | | search(createSearchParam(), false);
|
| | | });
|
| | |
|
| | | //首页
|
| | | $('#page_home').click(function(){
|
| | | alert(123);
|
| | | if(Page != undefined){
|
| | | if(Page.curr != 1){
|
| | | Page.setCurr(1);
|
| | |
| | | //尾页
|
| | | $('#page_last').click(function(){
|
| | | if(Page != undefined){
|
| | | if(Page.pageCurr < Page.num){
|
| | | if(Page.curr < Page.num){
|
| | | Page.setCurr(Page.num);
|
| | | search(createSearchParam(), true);
|
| | | }
|