| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- <!DOCTYPE HTML>
- <html xmlns:th="http://www.thymeleaf.org"
- xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
- layout:decorate="~{admin/common/common}">
- <head>
- <title>活动管理列表</title>
- </head>
- <body layout:fragment="content">
- <nav class="breadcrumb">
- <i class="Hui-iconfont"></i>
- 首页 <span class="c-gray en">></span>
- 活动管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
- href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont"></i></a>
- </nav>
- <form id="myForm" th:action="@{/activity/review}" th:method="get">
- <div class="page-container">
- <div style="text-align:center">
- <label>类型:</label>
- <span class="select-box" style="width:200px; margin-right: 20px;">
- <select class="select" th:name="activity_type">
- <option value="">--请选择类型--</option>
- <option th:each="item : ${activity_type}" th:value="${item.value}" th:text="${item.name}"
- th:selected="${condition.activity_type}==${item.value}">
- </option>
- </select>
- </span>
- <input type="text" class="input-text" style="width:200px" placeholder="请输入活动标题" name="title"
- th:value="${condition.title}"/>
- <button type="submit" class="btn btn-primary">
- 搜索
- </button>
- </div>
- <div class="cl pd-5 bg-1 bk-gray mt-20">
- <span class="l">
- <a th:onclick="'javascript:activity_add(\'新增\',\'/activity/review/add\');'"
- class="btn btn-primary radius"><i class="Hui-iconfont"></i> 新增</a>
- <a onClick="bacthUpdate(1)" class="btn btn-primary radius"><i class="Hui-iconfont"></i> 启用</a>
- <a onclick="bacthUpdate(0)" class="btn btn-default radius"><i class="Hui-iconfont"></i> 禁用</a>
- <a onclick="batchDelete()" class="btn btn-danger radius"><i class="Hui-iconfont"></i> 批量删除</a>
- </span>
- <span class="r">共有数据:<strong th:text="${pageInfo?.total}" id="total">0</strong> 条</span>
- </div>
- <table class="table table-border table-bordered table-bg table-hover" style="table-layout: fixed;width:100%;">
- <thead>
- <tr class="text-c">
- <th width="25"><input type="checkbox"></th>
- <th>标题</th>
- <th>关联活动名称</th>
- <th width="120">发布时间</th>
- <th>发布人</th>
- <th>置顶</th>
- <th>状态</th>
- <th width="180">操作</th>
- </tr>
- </thead>
- <tbody>
- <tr class="text-c" th:each="m,iterStat:${pageInfo.list}">
- <td>
- <input type="checkbox" th:value="${m.id}" th:id="${iterStat.index+1}" name="id"/>
- </td>
- <td class="text-overflow" th:text="${m.title}" th:title="${m.title}"></td>
- <td th:text="${m.activity_title}" th:title="${m.activity_title}"></td>
- <td th:text="${#strings.substring(m.activity_publishtime,0,16)}"></td>
- <td th:text="${m.publisher}"></td>
- <td th:if="${m.is_top} == false">否</td>
- <td th:if="${m.is_top} == true">是</td>
- <td th:if="${m.status} == 0">草稿</td>
- <td th:if="${m.status} == 1">启用</td>
- <td th:if="${m.status} == 2">停用</td>
- <td class="td-manage">
- <a class="ml-5" th:onclick="'javascript:editActivity(\'编辑活动回顾\',\'/activity/review/edit/'+${m.id}+'\');'">编辑</a>
- <a class="ml-5" th:onclick="'javascript:activityDetail(\'查看活动详情\',\'/activity/review/detail/'+${m.id}+'\');'">详情</a>
- <a th:if="${m.is_top} == false" class="ml-5" th:onclick="'javascript:isTop(\'true\',\''+${m.id}+'\');'">置顶</a>
- <a th:if="${m.is_top == true}" class="ml-5" th:id="${m.id}"
- th:onclick="'javascript:isTop(\'false\',\''+${m.id}+'\');'">取消置顶</a>
- </td>
- </tr>
- </tbody>
- </table>
- <div th:replace="admin/common/page :: page"></div>
- </div>
- </form>
- <script type="text/javascript" th:src="@{/js/common/page.js}"></script>
- <script>
- /*新增活动*/
- function activity_add(title,url,w,h){
- var index = layer_show(title,pagePath+url,w,h);
- layer.full(index);
- }
- /*编辑*/
- function editActivity(title,url,w,h) {
- var index = layer_show(title,pagePath+url,w,h);
- layer.full(index);
- }
- /*详情*/
- function activityDetail(title,url,w,h) {
- var index = layer_show(title,pagePath+url,w,h);
- layer.full(index);
- }
- function isTop(is_top, id) {
- var message = "确定取消吗?";
- console.log(is_top);
- if(is_top === 'true'){
- console.log(message);
- message = "确定置顶吗?"
- }
- layer.confirm(message, function (index) {
- $.ajax({
- type:"get",
- dataType:"json",
- url: pagePath + "/activity/review/isTop/"+ id,
- data:{
- "is_top":is_top
- },
- success: function (result) {
- if (result.success) {
- smileMessage(result.message)
- setTime();
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- });
- }
- function bacthUpdate(status) {
- getSelectedItem();
- var ids = [];
- if(null != item_selected_arr){
- ids = getIdsFromItemArr(item_selected_arr);
- }
- var obj = $("input[name='id']:checked");
- if (obj.length == 0) {
- errorMessage("请选择活动反馈");
- return false;
- }
- layer.confirm('确认要启用吗?', function (index) {
- $.ajax({
- type: "POST",
- dataType: "json",
- url: pagePath + "/activity/review/batch",
- data: {
- "ids" : ids,
- "status" : status
- },
- success: function (result) {
- if (result.success) {
- smileMessage(result.message);
- window.location.href=pagePath + "/activity/review";
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- });
- }
- function batchDelete() {
- getSelectedItem();
- var ids = [];
- if(null != item_selected_arr){
- ids = getIdsFromItemArr(item_selected_arr);
- }
- var obj = $("input[name='id']:checked");
- if (obj.length == 0) {
- errorMessage("请选择活动反馈");
- return false;
- }
- layer.confirm('确认要删除吗?', function (index) {
- $.ajax({
- type: "POST",
- dataType: "json",
- url: pagePath + "/activity/review/batch",
- data: {
- "ids" : ids,
- "del_flag" : true
- },
- success: function (result) {
- if (result.success) {
- smileMessage(result.message);
- window.location.href=pagePath + "/activity/review";
- } else {
- errorMessage(result.message);
- }
- },
- error: function () {
- errorMessage('系统错误!');
- }
- });
- });
- }
- </script>
- </body>
- </html>
|