index.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <style>
  4. .line1 {
  5. overflow: hidden;
  6. text-overflow: ellipsis;
  7. display: box;
  8. display: -webkit-box;
  9. line-clamp: 1;
  10. box-orient: vertical;
  11. -webkit-line-clamp: 1;
  12. -webkit-box-orient: vertical;
  13. word-break: break-all;
  14. }
  15. .screen-box{
  16. width: 100%;
  17. height: 150px;
  18. position: relative;
  19. overflow: hidden;
  20. margin-bottom: 15px;
  21. }
  22. .screen-box:hover .screen-body{
  23. display: block;
  24. }
  25. .screen-box:hover .screen-body-title2{
  26. display: none;
  27. }
  28. .screen-box .screen-img{
  29. width: 100%;
  30. height: 100%;
  31. object-fit: cover;
  32. }
  33. .screen-box .screen-body{
  34. position: absolute;
  35. z-index: 1;
  36. top: 0;
  37. left: 0;
  38. right: 0;
  39. bottom: 0;
  40. background-color: rgba(0,0,0,0.5);
  41. color: #ffffff;
  42. padding: 15px;
  43. text-align: center;
  44. display: none;
  45. }
  46. .screen-body-title{
  47. font-size: 16px;
  48. font-weight: 600;
  49. padding-top: 30px;
  50. padding-bottom: 10px;
  51. }
  52. .screen-body-title2{
  53. position: absolute;
  54. z-index: 1;
  55. height: 40px;
  56. line-height: 40px;
  57. left: 0;
  58. right: 0;
  59. bottom: 0;
  60. background-color: rgba(0,0,0,0.6);
  61. color: #ffffff;
  62. padding: 0 15px;
  63. text-align: center;
  64. }
  65. </style>
  66. <div class="ibox">
  67. <div class="ibox-content">
  68. <div class="row">
  69. <div class="col-xs-3">
  70. <a href="{:url('add')}" class="btn btn-sm btn-primary">新增</a>
  71. </div>
  72. </div>
  73. </div>
  74. <div class="ibox-content">
  75. <div class="row">
  76. {volist name="lists" id="vo"}
  77. <div class="col-xs-3">
  78. <div class="screen-box">
  79. <img class="screen-img" src="{$vo.img|default='/admin/img/screenbg.png'}" alt="">
  80. <div class="screen-body">
  81. <div class="screen-body-title">
  82. {$vo.title}
  83. </div>
  84. <div class="screen-body-footer">
  85. <a target="_blank" href="{$vo.surl}"><span class="label label-info" title="查看">查看</span></a>&nbsp;
  86. <a href="{:url('add',['id'=>$vo['id']])}"><span class="label label-primary" title="编辑">编辑</span></a>&nbsp;
  87. {if condition="$vo['org_id'] gt 0"}
  88. <a href="{:url('del',['id'=>$vo['id']])}" {if !btnAuth(session("user_auth.id"),"Screen/del")} style="display:none"{/if} class="confirm ajax-get data-reload" data-confirm="确定要删除此记录吗?"><span class="label label-danger" title="删除">删除</span></a>
  89. {/if}
  90. </div>
  91. </div>
  92. <div class="screen-body-title2 line1">
  93. {$vo.title}
  94. </div>
  95. </div>
  96. </div>
  97. {/volist}
  98. </div>
  99. </div>
  100. </div>
  101. {/block}
  102. {block name="script"}
  103. <script>
  104. $(function () {
  105. $(window).bind("resize",function(){
  106. var width=$(".jqGrid_wrapper").width();
  107. $("#table").setGridWidth(width);
  108. });
  109. $.jgrid.defaults.styleUI="Bootstrap";
  110. $("#table").jqGrid({
  111. url:"{:url('index')}",
  112. datatype: "json",
  113. colModel:[
  114. {label:'编号',name:'id',index:'id',width:50,sortable: false},
  115. {label:'名称',name:'title',index:'title', sortable: false},
  116. {label:'模板',name:'temp_title',index:'temp_title', sortable: false},
  117. {label:'备注',name:'remark',index:'remark', sortable: false},
  118. {label:'操作',width:80,sortable: false,formatter: function (a, b, c) {
  119. var editurl = "{:url('add',[],'')}/id/"+c.id;
  120. var delurl = "{:url('del',[],'')}/id/"+c.id;
  121. var btn = '<a target="_blank" href="'+c.surl+'"><span class="label label-info" title="查看">查看</span></a>&nbsp;';
  122. btn += '<a href="'+editurl+'"><span class="label label-primary" title="编辑">编辑</span></a>&nbsp;';
  123. btn += '<a href="'+delurl+'" class="confirm ajax-get" data-confirm="确定要删除此记录吗?" data-table="1"><span class="label label-danger" title="删除">删除</span></a>';
  124. return btn;
  125. }},
  126. ],
  127. rowNum:10,
  128. rowList:[10,20,30,50,100],
  129. pager: '#pager',
  130. sortname: 'sort',
  131. viewrecords: true,
  132. autowidth:true,
  133. mtype: 'post',
  134. height: 'auto',
  135. emptyrecords: "暂无数据",
  136. sortorder: "asc",
  137. caption:"大屏列表",
  138. loadComplete: function (xhr) {
  139. if(xhr.code==0){
  140. layer.msg(xhr.msg);
  141. return false;
  142. }
  143. },
  144. });
  145. });
  146. </script>
  147. {/block}