charm.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <!DOCTYPE html>
  2. <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
  3. <head>
  4. <th:block th:include="include :: header('魅力活动榜管理')" />
  5. </head>
  6. <body class="gray-bg">
  7. <div class="container-div">
  8. <div class="row">
  9. <div class="col-sm-12 search-collapse">
  10. <form id="role-form">
  11. <div class="select-list">
  12. <ul>
  13. <li>
  14. 卿卿号:<input type="text" name="erBanNo" placeholder="请输入卿卿号"/>
  15. </li>
  16. <li class="select-time">
  17. <label>创建时间: </label>
  18. <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="startTime"/>
  19. <span>-</span>
  20. <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endTime"/>
  21. </li>
  22. <li>
  23. <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
  24. <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
  25. </li>
  26. </ul>
  27. </div>
  28. </form>
  29. </div>
  30. <div class="btn-group-sm" id="toolbar" role="group">
  31. <a class="btn btn-success" onclick="add()" shiro:hasPermission="activity:charm:add">
  32. <i class="fa fa-plus"></i> 新增
  33. </a>
  34. <a class="btn btn-success" onclick="$.table.exportExcel()" shiro:hasPermission="activity:charm:excel">
  35. <i class="fa fa-cloud-download"></i> 导出Excel
  36. </a>
  37. </div>
  38. <div class="col-sm-12 select-table table-striped" style="overflow:scroll;">
  39. <table id="bootstrap-table" data-mobile-responsive="false" style="min-width:1500px;"></table>
  40. </div>
  41. </div>
  42. </div>
  43. <th:block th:include="include :: footer" />
  44. <script th:inline="javascript">
  45. var removeFlag = [[${@permission.hasPermi('activity:charm:del')}]];
  46. var prefix = ctx + "activity/charm";
  47. $(function() {
  48. $("#startTime").val(getWeekStartTime());
  49. $("#endTime").val(getWeekEndTime());
  50. var options = {
  51. url: prefix + "/list",
  52. createUrl: prefix + "/add",
  53. removeUrl: prefix + "/remove",
  54. exportUrl: prefix + "/export",
  55. modalName: "魅力活动榜",
  56. height: $(window).height()-120,
  57. columns: [
  58. {
  59. field: 'id',
  60. title: 'ID'
  61. },
  62. {
  63. field: 'uid',
  64. title: 'UID'
  65. },
  66. {
  67. field: 'erbanNo',
  68. title: '卿卿号',
  69. align : 'center'
  70. },
  71. {
  72. field: 'nick',
  73. title: '昵称',
  74. align : 'center'
  75. },
  76. {
  77. field: 'charm',
  78. title: '魅力值',
  79. align : 'center'
  80. },
  81. {
  82. field: 'createTime',
  83. title: '创建时间',
  84. align : 'center'
  85. },
  86. {
  87. field: 'adminName',
  88. title: '操作人',
  89. align : 'center'
  90. },
  91. {
  92. title: '操作',
  93. align: 'center',
  94. formatter: function(value, row, index) {
  95. var actions = [];
  96. actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i> 删除</a>');
  97. return actions.join('');
  98. }
  99. }]
  100. };
  101. $.table.init(options);
  102. });
  103. Date.prototype.Format = function (fmt) { //author: meizz
  104. var o = {
  105. "M+": this.getMonth() + 1, //月份
  106. "d+": this.getDate(), //日
  107. "H+": this.getHours(), //小时
  108. "m+": this.getMinutes(), //分
  109. "s+": this.getSeconds(), //秒
  110. "q+": Math.floor((this.getMonth() + 3) / 3), //季度
  111. "S": this.getMilliseconds() //毫秒
  112. };
  113. if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  114. for (var k in o)
  115. if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  116. return fmt;
  117. };
  118. function add(){
  119. var url = prefix + "/add";
  120. $.modal.open("新增魅力活动榜信息",url,'800','300');
  121. }
  122. var oneDayLong = 24*60*60*1000 ;
  123. var now = new Date();
  124. /**
  125. * 获得本周的开始日期和结束日期
  126. */
  127. function getWeekEndTime() {
  128. var sundayTime = now.getTime() + (7-now.getDay())*oneDayLong;
  129. return new Date(sundayTime).Format("yyyy-MM-dd");
  130. }
  131. function getWeekStartTime() {
  132. var mondayTime = now.getTime() - (now.getDay()-1)*oneDayLong;
  133. return new Date(mondayTime).Format("yyyy-MM-dd");
  134. }
  135. </script>
  136. </body>
  137. </html>