1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- {extend name="common/common2" /}
- {block name="main"}
- <div class="ibox">
- <div class="ibox-content">
- <div class="row">
- <div class="col-sm-3">
- <a href="{$screen_url1}" target="_blank" class="btn btn-sm btn-primary">能耗大屏</a>
- </div>
- <div class="col-sm-9" style="text-align: right;">
- <a onclick="layerOpen(this)" data-title="近7日用电量" url="{:url('tj1',[],'')}" href="javascript:;" class="btn btn-sm btn-primary" >近7日用电量</a>
- <a onclick="layerOpen(this)" data-title="近30日用电量" url="{:url('tj2',[],'')}" href="javascript:;" class="btn btn-sm btn-primary" >近30日用电量</a>
- </div>
- </div>
- </div>
- <div class="ibox-content">
- <div class="jqGrid_wrapper">
- <table id="table" style="border-collapse: collapse"></table>
- <div id="pager"></div>
- </div>
- </div>
- </div>
- {/block}
- {block name="script"}
- <script>
- $(function () {
- $(window).bind("resize",function(){
- var width=$(".jqGrid_wrapper").width();
- $("#table").setGridWidth(width);
- });
- $.jgrid.defaults.styleUI="Bootstrap";
- $("#table").jqGrid({
- url:"{:url('index')}",
- datatype: "json",
- colModel:[
- {label:'数值',name:'num',index:'num',width:80,editable: false,sortable: false},
- {label:'时间',name:'add_time',index:'add_time',width:80,editable: false,sortable: false},
- // {label:'报表',width:120,sortable: false,formatter: function (a, b, c) {
- // var tjurl2 = "{:url('tj2',[],'')}/id/"+c.snaddr;
- // var tjurl3 = "{:url('tj3',[],'')}/id/"+c.snaddr;
- // btn+= '<a onclick="layerOpen(this)" data-title="近7日用电量" url="'+tjurl2+'" href="javascript:;" ><span class="label label-info" title="近7日用电量">近7日用电量</span></a> ';
- // btn+= '<a onclick="layerOpen(this)" data-title="近30日用电量" url="'+tjurl3+'" href="javascript:;" ><span class="label label-info" title="近30日用电量">近30日用电量</span></a>';
- // return btn;
- // }},
- ],
- rowNum:10,
- rowList:[10,20,30,50,100],
- pager: '#pager',
- sortname: 'id',
- viewrecords: true,
- autowidth:true,
- mtype: 'post',
- height: 'auto',
- emptyrecords: "暂无数据",
- sortorder: "desc",
- caption:"{$meta_title}",
- loadComplete: function (xhr) {
- if(xhr.code==0){
- layer.msg(xhr.msg);
- return false;
- }
- },
- });
- });
- </script>
- {/block}
|