index.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. {extend name="public/container"}
  2. {block name="head_top"}
  3. <script src="{__PLUG_PATH}city.js"></script>
  4. <style>
  5. .layui-btn-xs {
  6. margin-left: 0px !important;
  7. }
  8. legend {
  9. width: auto;
  10. border: none;
  11. font-weight: 700 !important;
  12. }
  13. .site-demo-button {
  14. padding-bottom: 20px;
  15. padding-left: 10px;
  16. }
  17. .layui-form-label {
  18. width: auto;
  19. }
  20. .layui-input-block input {
  21. width: 50%;
  22. height: 34px;
  23. }
  24. .layui-form-item {
  25. margin-bottom: 0;
  26. }
  27. .layui-input-block .time-w {
  28. width: 200px;
  29. }
  30. .layui-table-body {
  31. overflow-x: hidden;
  32. }
  33. .layui-btn-group button i {
  34. line-height: 30px;
  35. margin-right: 3px;
  36. vertical-align: bottom;
  37. }
  38. .back-f8 {
  39. background-color: #F8F8F8;
  40. }
  41. .layui-input-block button {
  42. border: 1px solid #e5e5e5;
  43. }
  44. .avatar {
  45. width: 50px;
  46. height: 50px;
  47. }
  48. .layui-table-body {
  49. overflow-x: unset;
  50. }
  51. </style>
  52. {/block}
  53. {block name="content"}
  54. <div class="row">
  55. <div class="col-sm-12">
  56. <div class="ibox">
  57. <div class="ibox-content">
  58. <div class="table-responsive">
  59. <div class="layui-btn-container">
  60. <button class="layui-btn layui-btn-sm"
  61. onclick="$eb.createModalFrame(this.innerText,'{:Url('create')}')">新增活动
  62. </button>
  63. </div>
  64. <table class="layui-hide" id="List" lay-filter="List"></table>
  65. <script type="text/html" id="barDemo">
  66. <button type="button" class="layui-btn layui-btn-xs " lay-event='detail'>
  67. 详情
  68. </button>
  69. <button type="button" class="layui-btn layui-btn-xs" lay-event="edit">
  70. 编辑
  71. </button>
  72. <button type="button" class="layui-btn layui-btn-xs" onclick="dropdown(this)">操作 <span
  73. class="caret"></span></button>
  74. <ul class="layui-nav-child layui-anim layui-anim-upbit">
  75. <li>
  76. <a href="javascript:void(0);" lay-event="see">
  77. <i class="layui-icon layui-icon-edit"></i> 参与详情</a>
  78. </li>
  79. </ul>
  80. </script>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  87. <script src="{__FRAME_PATH}js/content.min.js?v=1.0.0"></script>
  88. {/block}
  89. {block name="script"}
  90. <script>
  91. layList.form.render();
  92. layList.tableList('List', "{:Url('get_list')}", function () {
  93. return [
  94. {field: 'id', title: '编号', event: 'id', width: '4%', align: 'center'},
  95. {field: 'name', title: '活动标题', align: 'center'},
  96. {field: 'l1', title: '一级缴纳', align: 'center', width: '10%'},
  97. {field: 'l2', title: '二级缴纳', align: 'center', width: '10%'},
  98. {field: 'l3', title: '三级缴纳', width: '10%', align: 'center'},
  99. {field: 'explode_num', title: '分裂人数', width: '6%', align: 'center'},
  100. {field: 'type', title: '类型', align: 'center', width: '6%'},
  101. {field: 'operate', title: '操作', width: '10%', align: 'center', toolbar: '#barDemo'}
  102. ];
  103. });
  104. //监听并执行 uid 的排序
  105. layList.tool(function (event, data, obj) {
  106. var layEvent = event;
  107. switch (layEvent) {
  108. case 'edit':
  109. $eb.createModalFrame('编辑', layList.Url({a: 'create', p: {id: data.id}}));
  110. break;
  111. case 'see':
  112. $eb.createModalFrame(data.name + '-参与详情', layList.Url({a: 'see', p: {id: data.id}}), {w: 1800});
  113. break;
  114. case 'detail':
  115. $eb.createModalFrame(data.name + '-编辑', layList.U({a: 'detail', q: {id: data.id}}));
  116. break;
  117. }
  118. });
  119. layList.search('search', function (where) {
  120. layList.reload(where, true);
  121. });
  122. $('.conrelTable').find('button').each(function () {
  123. var type = $(this).data('type');
  124. $(this).on('click', function () {
  125. action[type] && action[type]();
  126. })
  127. })
  128. //下拉框
  129. $(document).click(function (e) {
  130. $('.layui-nav-child').hide();
  131. })
  132. function dropdown(that) {
  133. var oEvent = arguments.callee.caller.arguments[0] || event;
  134. oEvent.stopPropagation();
  135. var offset = $(that).offset();
  136. var top = offset.top - $(window).scrollTop();
  137. var index = $(that).parents('tr').data('index');
  138. $('.layui-nav-child').each(function (key) {
  139. if (key != index) {
  140. $(this).hide();
  141. }
  142. })
  143. if ($(document).height() < top + $(that).next('ul').height()) {
  144. $(that).next('ul').css({
  145. 'padding': 10,
  146. 'top': -($(that).parent('td').height() / 2 + $(that).height() + $(that).next('ul').height() / 2),
  147. 'left': offset.left - $(that).parents('td').offset().left - 20,
  148. 'min-width': 'inherit',
  149. 'position': 'absolute'
  150. }).toggle();
  151. } else {
  152. $(that).next('ul').css({
  153. 'padding': 10,
  154. 'top': $(that).parent('td').height() / 2 + $(that).height(),
  155. 'left': offset.left - $(that).parents('td').offset().left - 20,
  156. 'min-width': 'inherit',
  157. 'position': 'absolute'
  158. }).toggle();
  159. }
  160. }
  161. </script>
  162. {/block}