index.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="ibox">
  4. <div class="ibox-content">
  5. <div class="row">
  6. <div class="col-xs-3">
  7. <a url="{:url('add')}" href="javascript:;" data-title="新增" onclick="layer_open(this,1)" class="btn btn-sm btn-primary">新增</a>
  8. </div>
  9. <div class="col-xs-9" style="text-align: right;">
  10. <form class="form-inline" id="form-search" action="{:url('index')}">
  11. <div class="input-group">
  12. <input type="text" class="form-control" name="name" placeholder="名称">
  13. </div>
  14. <div class="input-group">
  15. <select class="form-control" name="type">
  16. <option value="">选择类型</option>
  17. {volist name="type_list" id="v"}
  18. <option value="{$key}">{$v}</option>
  19. {/volist}
  20. </select>
  21. </div>
  22. <!-- <div class="input-group">-->
  23. <!-- <select class="form-control" name="group">-->
  24. <!-- <option value="">选择分组</option>-->
  25. <!-- {volist name="group_list" id="v"}-->
  26. <!-- <option value="{$key}">{$v}</option>-->
  27. <!-- {/volist}-->
  28. <!-- </select>-->
  29. <!-- </div>-->
  30. <div class="input-group">
  31. <select class="form-control" name="group">
  32. <option value="">选择属性</option>
  33. <option value="1">系统配置</option>
  34. <option value="2">项目配置</option>
  35. </select>
  36. </div>
  37. <div class="input-group">
  38. <span class="input-group-btn">
  39. <button class="btn-sm btn-primary" type="button" id ="search-btn" ><i class="fa fa-search"></i></button>
  40. </span> &nbsp;
  41. <span class="input-group-btn">
  42. <button class="btn-sm btn-warning " type="button" id="search-clear"><i class="fa fa-undo"></i></button>
  43. </span>
  44. </div>
  45. </form>
  46. </div>
  47. </div>
  48. </div>
  49. <div class="ibox-content">
  50. <div class="jqGrid_wrapper">
  51. <table id="table" style="border-collapse: collapse"></table>
  52. <div id="pager"></div>
  53. </div>
  54. </div>
  55. </div>
  56. {/block}
  57. {block name="script"}
  58. <script>
  59. $(function () {
  60. $(window).bind("resize",function(){
  61. var width=$(".jqGrid_wrapper").width();
  62. $("#table").setGridWidth(width);
  63. });
  64. $.jgrid.defaults.styleUI="Bootstrap";
  65. var lastsel;
  66. $("#table").jqGrid({
  67. url:"{:url('index')}",
  68. datatype: "json",
  69. colModel:[
  70. {label:'ID',name:'id',index:'id', width:30,sortable: false},
  71. {label:'名称',name:'name',index:'name',width:80,editable: false,sortable: false},
  72. {label:'标题',name:'title',index:'title',width:80,editable: false,sortable: false},
  73. {label:'分组',name:'group',index:'group',width:80,editable: false,sortable: false},
  74. {label:'类型',name:'type',index:'type',width:80,editable: false,sortable: false},
  75. {label:'属性',name:'cate',index:'cate',width:80,editable: false,sortable: false,formatter: function (a, b, c) {
  76. if(a == 1){
  77. return '系统配置';
  78. }else{
  79. return '组织配置'
  80. }
  81. }},
  82. {label:'操作',width:100,sortable: false,align:'left',formatter: function (a, b, c) {
  83. var editurl = "{:url('add',[],'')}/id/"+c.id;
  84. var delurl = "{:url('del',[],'')}/id/"+c.id;
  85. var btn= '<a url="'+editurl+'" href="javascript:;" data-title="编辑" onclick="layer_open(this,1)"><span class="label label-primary" title="编辑">编辑</span></a>&nbsp;';
  86. // var btn = '<a href="'+editurl+'" data-table="1"><span class="label label-info" title="编辑">编辑</span></a>&nbsp;';
  87. btn += '<a href="'+delurl+'" class="confirm ajax-get" data-confirm="确定要删除此记录吗?" data-table="1"><span class="label label-danger" title="删除">删除</span></a>';
  88. return btn;
  89. }},
  90. ],
  91. rowNum:10,
  92. rowList:[10,20,30],
  93. pager: '#pager',
  94. sortname: 'id',
  95. viewrecords: true,
  96. autowidth:true,
  97. mtype: 'post',
  98. height: 'auto',
  99. emptyrecords: "暂无数据",
  100. sortorder: "asc",
  101. caption:"{$meta_title}",
  102. loadComplete: function (xhr) {
  103. if(xhr.code==0){
  104. layer.msg(xhr.msg);
  105. return false;
  106. }
  107. },
  108. });
  109. });
  110. </script>
  111. {/block}