case.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /*大屏*/
  2. $(function(){
  3. init();
  4. moreSpan();
  5. table();
  6. })
  7. //初始化显示查询条件
  8. function init(){
  9. var len=$("#caseFindBox div").length;
  10. for(i=0;i<len;i++){
  11. $("#caseFindBox").find(".caseFind_p").eq(i).find("ul li:gt(9)").hide();
  12. }
  13. }
  14. function moreSpan(){
  15. $("#caseFindBox span").click(function(){
  16. var text=$(this).text();
  17. if(text=="+"){
  18. $(this).text("-");
  19. $(this).parent().find("ul li:gt(9)").show();
  20. }
  21. if(text=="-"){
  22. $(this).text("+");
  23. $(this).parent().find("ul li:gt(9)").hide();
  24. }
  25. })
  26. }
  27. //表格部分
  28. function table(){
  29. $('#table').bootstrapTable({
  30. method: "get",
  31. url: "json/case.json",
  32. striped: true,
  33. singleSelect: false,
  34. dataType: "json",
  35. pagination: true, //分页
  36. pageSize: 10,
  37. pageNumber: 1,
  38. search: false, //显示搜索框
  39. contentType: "application/x-www-form-urlencoded",
  40. queryParams: null,
  41. //sidePagination: "server", //服务端请求
  42. columns: [
  43. {
  44. title: "",
  45. field: 'ch',
  46. align: 'center',
  47. width:'30px',
  48. valign: 'middle',
  49. formatter:function(val,row){
  50. return '<div class="cliclRed"></div>';
  51. }
  52. }
  53. ,
  54. {
  55. title: "事项名称",
  56. field: 'name',
  57. align: 'center',
  58. valign: 'middle'
  59. },
  60. {
  61. title: '负责部门',
  62. field: 'part',
  63. align: 'center',
  64. valign: 'middle'
  65. },
  66. {
  67. title: '操作',
  68. field: 'opear',
  69. width:'250px',
  70. align: 'center',
  71. formatter: function (value, row) {
  72. var e = '<a href="javascript:void(0)" title="咨询" onclick="edit(\'' + row.id + '\')">编辑</a> ';
  73. var c = '<a href="javascript:void(0)" title="删除" onclick="del(\'' + row.id + '\')">删除</a> ';
  74. return e+c ;
  75. }
  76. }
  77. ]
  78. });
  79. }
  80. // 公用弹出框
  81. function edit(){
  82. layer.open({
  83. type: 2,
  84. title: '信息详情页面',
  85. shade: 0.5,
  86. skin: 'layui-layer-rim',
  87. area: ['1000px', '610px'],
  88. shadeClose: true,
  89. closeBtn: 1,
  90. content: 'caseTail.html'
  91. });
  92. }