123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- {extend name="common/common2" /}
- {block name="main"}
- <div class="ibox">
- <div class="ibox-content">
- <div class="row">
- <div class="col-xs-12" style="text-align: right;">
- <form class="form-inline" id="form-search" action="{:url('index')}">
- <div class="input-group">
- {:widget_view('common/laydate',['name'=>'start','placeholder' => '开始时间'])}
- </div>
- <div class="input-group">
- {:widget_view('common/laydate',['name'=>'end','placeholder' => '结束时间'])}
- </div>
- <div class="input-group">
- <input type="text" class="form-control" name="title" placeholder="设备名称">
- </div>
- <div class="input-group">
- <select name="enable" class="form-control">
- <option value="">选择状态</option>
- <option value="0">未处理</option>
- <option value="1">已处理</option>
- </select>
- </div>
- <div class="input-group">
- <span class="input-group-btn">
- <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
- </span>
- <span class="input-group-btn">
- <button class="btn-sm btn-warning" type="button" id="search-clear"><i class="fa fa-undo"></i></button>
- </span>
- <span class="input-group-btn">
- <button data-url="{:url('export',[],'')}" title="导出" class="btn-sm btn-primary" onclick="excel_download(this)" type="button" ><i class="fa fa-cloud-download"></i></button>
- </span>
- </div>
- </form>
- </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 excel_download(_self){
- var url = $(_self).attr('data-url');
- var param = $('#form-search').serialize();
- window.location.href = url+'?'+param;
- }
- $(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:'security_name',security_name:'title',width:40,editable: false,sortable: false},
- {label:'报警时间',name:'alarm_time',index:'alarm_time',width:50,sortable: true},
- {label:'状态',name:'status',index:'status',width:20,editable: false,sortable: false,formatter:function (a,b,c){
- if(a == 0){
- return '<span>未处理</span>';
- } else{
- return '<span>已处理</span>';
- }
- }},
- {label:'处理人',name:'cf_user',index:'cf_user',width:20,sortable: true},
- {label:'处理时间',name:'update_time',index:'update_time',width:40,sortable: true},
- {label:'备注',name:'remark',index:'remark',width:40,sortable: true},
- {label:'操作',width:30,sortable: false,formatter: function (a, b, c) {
- if(c.status == 0){
- var editurl = "{:url('check',[],'')}/id/"+c.id;
- var btn = '<a url="'+editurl+'" href="javascript:;" data-title="处理" onclick="layer_open(this,1)"><span class="label label-primary" title="处理">处理</span></a> ';
- return btn;
- }else {
- return '';
- }
- }},
- ],
- rowNum:10,
- rowList:[10,20,30,50,100],
- pager: '#pager',
- sortname: 'sort',
- viewrecords: true,
- autowidth:true,
- mtype: 'post',
- height: 'auto',
- emptyrecords: "暂无数据",
- sortorder: "asc",
- caption:"{$meta_title}",
- loadComplete: function (xhr) {
- if(xhr.code==0){
- layer.msg(xhr.msg);
- return false;
- }
- },
- });
- });
- </script>
- {/block}
|