list.html 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script class="include" system="" path="inc/" file="head">include()</script>
  5. <!--<link rel="stylesheet" href="../script/lib/layui/admin/modules/plugin/formselects/formselects.css" media="all" />-->
  6. </head>
  7. <body>
  8. <style id="addstyle">
  9. </style>
  10. <style>
  11. .table {
  12. /*box-shadow: 10px 11px 33px -14px;*/
  13. }
  14. .layui-table-cell .layui-select,.layui-table-cell .layui-input
  15. {
  16. height: 25px;
  17. }
  18. .layui-table-cell {
  19. height: auto;
  20. }
  21. .layui-card-header {
  22. padding: 0px 5px;
  23. }
  24. .table th,.table td {
  25. min-width: 60px;
  26. }
  27. #table_2,#table_1 {
  28. /*overflow: auto;*/
  29. }
  30. .layui-btn-xs
  31. {
  32. margin-top:1px;
  33. }
  34. .dever-emoji img {
  35. width:16px;
  36. }
  37. .layui-tab-title {
  38. height: 100%;
  39. white-space: inherit;
  40. }
  41. .layui-form-item .layui-input-inline {
  42. display: block;
  43. float: none;
  44. left: -3px;
  45. margin: 0px 0px 0px 0px;
  46. }
  47. .chart {
  48. width: 100%;
  49. height:300px;
  50. }
  51. .table-header-fixed {
  52. top: -1px;
  53. position: sticky;
  54. z-index: 999;
  55. }
  56. .goods_table {
  57. width: 100%;
  58. }
  59. .goods_table th
  60. {
  61. text-align: center;
  62. }
  63. .goods_table td
  64. {
  65. text-align: center;
  66. }
  67. .layui-table-tool-temp{
  68. display: none;
  69. }
  70. .layadmin-carousel {
  71. height: 90px!important;
  72. }
  73. </style>
  74. <div id="load_style" style="display:none;">
  75. </div>
  76. <span id="dever-name" style="display:none;"></span>
  77. <div class="topbar">
  78. <div class="banner dever-layout" style="display:none;">
  79. <a target="_blank"></a>
  80. <span>项目名称</span>
  81. </div>
  82. </div>
  83. <div id="content_1" style="display:none;"></div>
  84. <div id="content_2">
  85. <div class="layui-fluid">
  86. <div class="layui-card" id="stat_data_card">
  87. <div class="layui-card-header">数据概览</div>
  88. <div class="layui-card-body">
  89. <div class="layui-carousel layadmin-carousel layadmin-backlog">
  90. <div carousel-item>
  91. <ul class="layui-row layui-col-space10" id="stat_data">
  92. <li class="layui-col-xs3">
  93. <a class="layadmin-backlog-body">
  94. <h3>待审评论</h3>
  95. <p><cite>66</cite></p>
  96. </a>
  97. </li>
  98. </ul>
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. <div class="layui-card">
  104. <input type="hidden" name="url1" id="url" value=""/>
  105. <form id="form1" name="form1" method="get" target="f1">
  106. <input type="hidden" name="l" id="l" value="msg"/>
  107. <input type="hidden" name="project" id="project" value="msg"/>
  108. <input type="hidden" name="table" id="tables" value="msg"/>
  109. <input type="hidden" name="menu" id="menu" value="msg"/>
  110. <input type="hidden" name="menu_id" id="menu_id" value="msg"/>
  111. <input type="hidden" name="dever_submit" id="dever_submit" />
  112. <input type="hidden" name="search_option_state" id="search_option_state" value="msg"/>
  113. <input type="hidden" name="function" id="function" value="msg"/>
  114. <input type="hidden" name="method" id="method" value="search"/>
  115. <div id="search_param"></div>
  116. <iframe id="f1" name="f1" style="display:none;"></iframe>
  117. <div class="layui-card-header" style="display: none;"><span id="list-project">网站设置</span> > <span id="list-name"></span></div>
  118. <div class="layui-card-body" id="search_content">
  119. <div class="layui-form layui-card-header layuiadmin-card-header-auto">
  120. <div class="layui-form-item">
  121. <div id="search"></div>
  122. </div>
  123. </div>
  124. </div>
  125. <div class="layui-card-body">
  126. <div id="list-button" style="padding-bottom: 10px;">
  127. <a class="layui-btn layuiadmin-btn-list" data-type="add" id="list-parent" style="display:none;margin-right: 10px;">返回上一页</a>
  128. <a class="layui-btn layuiadmin-btn-list" data-type="add" id="list-add" style="margin-left: 0px;">新增</a>
  129. </div>
  130. <div class="dever_desc" id="info"></div>
  131. <div id="table_1" style="display:none;"></div>
  132. <div id="table_2">
  133. <div id="chart" class="chart"></div>
  134. <table class="table layui-table layui-table-body" id="table">
  135. <thead id="list-thead">
  136. <tr>
  137. <th>Company</th>
  138. </tr>
  139. </thead>
  140. <tbody id="list-tbody">
  141. <tr>
  142. <th></th>
  143. </tr>
  144. </tbody>
  145. </table>
  146. <div id="mul"></div>
  147. <div id="page" style="display:none"></div>
  148. <div class="dever_desc" id="desc"></div>
  149. </div>
  150. </div>
  151. </div>
  152. </div>
  153. </form>
  154. <form id="form2" name="form2" method="get" style="display: none;"></form>
  155. <div id="struct" style="display:none;"></div>
  156. </div>
  157. </div>
  158. </div>
  159. <script class="include" system="" path="inc/" file="script">include()</script>
  160. <script id="list-thead-data">
  161. config.table = {};
  162. config.table.limit = 20;
  163. config.table.cols = [];
  164. </script>
  165. <script id="list-tbody-data">
  166. config.table.data = [];
  167. </script>
  168. <script>
  169. var form;
  170. layui.config({
  171. base: '../script/lib/layui/admin/' //静态资源所在路径
  172. ,version:false
  173. }).extend({
  174. //formSelects: 'plugin/formselects/formselects',
  175. index: 'lib/index' //主入口模块
  176. }).use(['index', 'contlist', 'table', 'form', 'console'], function(){
  177. var table = layui.table;
  178. form = layui.form;
  179. //var formSelects = layui.formSelects;
  180. if ($('#content_2').css('display') != 'none') {
  181. var bw = document.body.scrollWidth;
  182. var sw = $('#content_2').width();
  183. if (sw > 0 && bw > sw) {
  184. $('body').css({'width' : 'fit-content'});
  185. }
  186. } else {
  187. //$('#table_1').css({'overflow' : 'auto'});
  188. //$('#table_2').css({'overflow' : 'auto'});
  189. }
  190. if (config.table.cols.length > 0) {
  191. table.render({
  192. elem: '#table'
  193. ,page: false
  194. ,limit:config.table.limit
  195. //,toolbar:'default'
  196. //,defaultToolbar:["filter","exports","print"]
  197. ,cols: config.table.cols
  198. ,data: config.table.data
  199. ,done:function(res, curr, count) {
  200. $('#page').show();
  201. let headerTop = $('.layui-table-header').offset().top; //获取表格头到文档顶部的距离
  202. $(window).scroll(function () {
  203. if (count > 3 && (headerTop - $(window).scrollTop()) < 0) { //超过了
  204. $('.layui-table-header').addClass('table-header-fixed'); //添加样式,固定住表头
  205. } else { //没超过
  206. $('.layui-table-header').removeClass('table-header-fixed'); //移除样式
  207. }
  208. });
  209. }
  210. });
  211. } else {
  212. $('#page').show();
  213. var count = $('#list-tbody tr').length;
  214. let headerTop = $('#list-thead').offset().top; //获取表格头到文档顶部的距离
  215. $(window).scroll(function () {
  216. if (count > 3 && (headerTop - $(window).scrollTop()) < 100) { //超过了
  217. $('#list-thead').addClass('table-header-fixed'); //添加样式,固定住表头
  218. /*
  219. $('#list-thead th').each(function (k, v) {
  220. var width = $('#list-tbody td').eq(k).width() + 0.9;
  221. //$(v).width(width + 1);
  222. $(v).css({'min-width': width});
  223. });*/
  224. } else { //没超过
  225. $('#list-thead').removeClass('table-header-fixed'); //移除样式
  226. }
  227. });
  228. }
  229. init();
  230. if ($('.dever-manage').length) {
  231. $('.dever-manage').dblclick(function()
  232. {
  233. showMsg('数据结构', $(this), '#struct');
  234. })
  235. }
  236. //滚动body,header跟随滚动
  237. $('.layui-table-body').on('scroll', function(e) {
  238. var leftPx = $(e.target).scrollLeft(); //获取表格body,滚动条距离左边的长度
  239. var left = 'translateX(-' + leftPx + 'px)';
  240. $('.layui-table-header .layui-table').css('transform', left); //设置表格header的内容反向(-)移动
  241. });
  242. });
  243. </script>
  244. </body>
  245. </html>