Commit e76ffc9b26c8cbd9dfbbd232d7eacb0c11cca86d
1 parent
376a743f
评论列表页修改
Showing
6 changed files
with
404 additions
and
675 deletions
src/main/java/com/cnlive/shenhe/api/CommentsControllerApi.java
| 1 | package com.cnlive.shenhe.api; | 1 | package com.cnlive.shenhe.api; |
| 2 | + | ||
| 2 | import com.alibaba.fastjson.JSONObject; | 3 | import com.alibaba.fastjson.JSONObject; |
| 3 | import com.cnlive.shenhe.bean.ErrorEnum; | 4 | import com.cnlive.shenhe.bean.ErrorEnum; |
| 4 | import com.cnlive.shenhe.bean.ResponseBean; | 5 | import com.cnlive.shenhe.bean.ResponseBean; |
| @@ -14,8 +15,10 @@ import org.springframework.web.bind.annotation.PostMapping; | @@ -14,8 +15,10 @@ import org.springframework.web.bind.annotation.PostMapping; | ||
| 14 | import org.springframework.web.bind.annotation.RequestBody; | 15 | import org.springframework.web.bind.annotation.RequestBody; |
| 15 | import org.springframework.web.bind.annotation.RequestMapping; | 16 | import org.springframework.web.bind.annotation.RequestMapping; |
| 16 | import org.springframework.web.bind.annotation.ResponseBody; | 17 | import org.springframework.web.bind.annotation.ResponseBody; |
| 18 | + | ||
| 17 | import java.util.Arrays; | 19 | import java.util.Arrays; |
| 18 | import java.util.List; | 20 | import java.util.List; |
| 21 | + | ||
| 19 | @Controller | 22 | @Controller |
| 20 | @RequestMapping("/api/comments") | 23 | @RequestMapping("/api/comments") |
| 21 | public class CommentsControllerApi { | 24 | public class CommentsControllerApi { |
| @@ -24,6 +27,7 @@ public class CommentsControllerApi { | @@ -24,6 +27,7 @@ public class CommentsControllerApi { | ||
| 24 | AuditPass Pass; | 27 | AuditPass Pass; |
| 25 | @Autowired | 28 | @Autowired |
| 26 | CommentsServiceImpl commentsService; | 29 | CommentsServiceImpl commentsService; |
| 30 | + | ||
| 27 | /** | 31 | /** |
| 28 | * @Auther: chenhao | 32 | * @Auther: chenhao |
| 29 | * @Date: 2018/12/6 11:17 | 33 | * @Date: 2018/12/6 11:17 |
| @@ -31,33 +35,32 @@ public class CommentsControllerApi { | @@ -31,33 +35,32 @@ public class CommentsControllerApi { | ||
| 31 | */ | 35 | */ |
| 32 | @PostMapping("/import") | 36 | @PostMapping("/import") |
| 33 | @ResponseBody | 37 | @ResponseBody |
| 34 | - public ResponseBean impotComment(@RequestBody JSONObject json){ | 38 | + public ResponseBean impotComment(@RequestBody JSONObject json) { |
| 35 | ShyComments shyComments = new ShyComments(); | 39 | ShyComments shyComments = new ShyComments(); |
| 36 | ShySites shySites = new ShySites(); | 40 | ShySites shySites = new ShySites(); |
| 37 | shyComments.setState(CommonConst.AUDIT_INTT); | 41 | shyComments.setState(CommonConst.AUDIT_INTT); |
| 38 | //判断是否白名单 | 42 | //判断是否白名单 |
| 39 | shySites.setSpid(json.getInteger("spId")); | 43 | shySites.setSpid(json.getInteger("spId")); |
| 40 | List<ShySites> shySitesList = commentsService.getBusiness(shySites); | 44 | List<ShySites> shySitesList = commentsService.getBusiness(shySites); |
| 41 | - if(!shySitesList.isEmpty()){ | ||
| 42 | - if(CommonUtils.isNotEmpty(shySitesList.get(0).getWrite_business())){ | 45 | + if (!shySitesList.isEmpty()) { |
| 46 | + if (CommonUtils.isNotEmpty(shySitesList.get(0).getWrite_business())) { | ||
| 43 | String write_business = shySitesList.get(0).getWrite_business(); | 47 | String write_business = shySitesList.get(0).getWrite_business(); |
| 44 | String[] business = write_business.split(","); | 48 | String[] business = write_business.split(","); |
| 45 | List<String> asList = Arrays.asList(business); | 49 | List<String> asList = Arrays.asList(business); |
| 46 | - if(asList.contains(CommonConst.BUSINESS_COMMENT+"")){ | 50 | + if (asList.contains(CommonConst.BUSINESS_COMMENT + "")) { |
| 47 | shyComments.setState(CommonConst.AUDIT_SUCCESS); | 51 | shyComments.setState(CommonConst.AUDIT_SUCCESS); |
| 48 | //封装json数据传参进行回调 | 52 | //封装json数据传参进行回调 |
| 49 | JSONObject json1 = new JSONObject(); | 53 | JSONObject json1 = new JSONObject(); |
| 50 | - json1.put("activity_id",json.getString("activityId")); | ||
| 51 | - json1.put("state",CommonConst.AUDIT_SUCCESS); | ||
| 52 | - json1.put("attr_tags",""); | ||
| 53 | - json1.put("msg",""); | 54 | + json1.put("activity_id", json.getString("activityId")); |
| 55 | + json1.put("state", 3); | ||
| 56 | + json1.put("attr_tags", ""); | ||
| 57 | + json1.put("msg", ""); | ||
| 54 | JSONObject result = Pass.commentPass(json1); | 58 | JSONObject result = Pass.commentPass(json1); |
| 55 | Integer code = result.getInteger("errorCode"); | 59 | Integer code = result.getInteger("errorCode"); |
| 56 | if (code != 0) { | 60 | if (code != 0) { |
| 57 | return new ResponseBean(code, result.getString("errorMessage")); | 61 | return new ResponseBean(code, result.getString("errorMessage")); |
| 58 | } | 62 | } |
| 59 | - }else { | ||
| 60 | - shyComments.setState(CommonConst.AUDIT_INTT); | 63 | + shyComments.setState(CommonConst.AUDIT_SUCCESS); |
| 61 | } | 64 | } |
| 62 | } | 65 | } |
| 63 | } | 66 | } |
| @@ -78,10 +81,10 @@ public class CommentsControllerApi { | @@ -78,10 +81,10 @@ public class CommentsControllerApi { | ||
| 78 | shyComments.setIs_hot(json.getBoolean("priority")); | 81 | shyComments.setIs_hot(json.getBoolean("priority")); |
| 79 | shyComments.setCallback(json.getString("callback")); | 82 | shyComments.setCallback(json.getString("callback")); |
| 80 | int i = commentsService.impotComments(shyComments); | 83 | int i = commentsService.impotComments(shyComments); |
| 81 | - if(i>0){ | ||
| 82 | - return new ResponseBean(ErrorEnum.SUCCESS); | ||
| 83 | - }else { | ||
| 84 | - return new ResponseBean(ErrorEnum.ERROR); | 84 | + if (i > 0) { |
| 85 | + return new ResponseBean(ErrorEnum.SUCCESS); | ||
| 86 | + } else { | ||
| 87 | + return new ResponseBean(ErrorEnum.ERROR); | ||
| 85 | } | 88 | } |
| 86 | } | 89 | } |
| 87 | 90 |
src/main/java/com/cnlive/shenhe/api/VideosControllerApi.java
| @@ -50,14 +50,12 @@ public class VideosControllerApi { | @@ -50,14 +50,12 @@ public class VideosControllerApi { | ||
| 50 | String[] business = write_business.split(","); | 50 | String[] business = write_business.split(","); |
| 51 | List<String> asList = Arrays.asList(business); | 51 | List<String> asList = Arrays.asList(business); |
| 52 | if (asList.contains(CommonConst.BUSINESS_VIDEO + "")) { | 52 | if (asList.contains(CommonConst.BUSINESS_VIDEO + "")) { |
| 53 | - shyVideos.setState(CommonConst.AUDIT_SUCCESS); | ||
| 54 | - JSONObject result = Pass.auditPass(json.getString("videoId"), CommonConst.AUDIT_SUCCESS, "", ""); | 53 | + JSONObject result = Pass.auditPass(json.getString("videoId"), 3, "", ""); |
| 55 | Integer code = result.getInteger("code"); | 54 | Integer code = result.getInteger("code"); |
| 56 | if (code != 0) { | 55 | if (code != 0) { |
| 57 | return new ResponseBean(code, result.getString("msg")); | 56 | return new ResponseBean(code, result.getString("msg")); |
| 58 | } | 57 | } |
| 59 | - } else { | ||
| 60 | - shyVideos.setState(CommonConst.AUDIT_INTT); | 58 | + shyVideos.setState(CommonConst.AUDIT_SUCCESS); |
| 61 | } | 59 | } |
| 62 | } | 60 | } |
| 63 | } | 61 | } |
src/main/java/com/cnlive/shenhe/controller/CommentsController.java
| @@ -4,14 +4,21 @@ import com.alibaba.fastjson.JSONObject; | @@ -4,14 +4,21 @@ import com.alibaba.fastjson.JSONObject; | ||
| 4 | import com.cnlive.shenhe.bean.ErrorEnum; | 4 | import com.cnlive.shenhe.bean.ErrorEnum; |
| 5 | import com.cnlive.shenhe.bean.ResponseBean; | 5 | import com.cnlive.shenhe.bean.ResponseBean; |
| 6 | import com.cnlive.shenhe.bean.SessionUser; | 6 | import com.cnlive.shenhe.bean.SessionUser; |
| 7 | +import com.cnlive.shenhe.entity.ShyComments; | ||
| 8 | +import com.cnlive.shenhe.entity.ShyUsers; | ||
| 7 | import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl; | 9 | import com.cnlive.shenhe.serviceImpl.CommentsServiceImpl; |
| 10 | +import com.cnlive.shenhe.serviceImpl.UsersServiceImpl; | ||
| 8 | import com.cnlive.shenhe.utils.AuditPass; | 11 | import com.cnlive.shenhe.utils.AuditPass; |
| 9 | import com.cnlive.shenhe.utils.CommonUtils; | 12 | import com.cnlive.shenhe.utils.CommonUtils; |
| 13 | +import com.github.pagehelper.PageInfo; | ||
| 10 | import org.springframework.beans.factory.annotation.Autowired; | 14 | import org.springframework.beans.factory.annotation.Autowired; |
| 11 | import org.springframework.stereotype.Controller; | 15 | import org.springframework.stereotype.Controller; |
| 16 | +import org.springframework.ui.Model; | ||
| 12 | import org.springframework.web.bind.annotation.*; | 17 | import org.springframework.web.bind.annotation.*; |
| 13 | 18 | ||
| 14 | import javax.servlet.http.HttpSession; | 19 | import javax.servlet.http.HttpSession; |
| 20 | +import java.util.Date; | ||
| 21 | +import java.util.List; | ||
| 15 | 22 | ||
| 16 | 23 | ||
| 17 | @Controller | 24 | @Controller |
| @@ -22,6 +29,9 @@ public class CommentsController { | @@ -22,6 +29,9 @@ public class CommentsController { | ||
| 22 | @Autowired | 29 | @Autowired |
| 23 | CommentsServiceImpl commentsService; | 30 | CommentsServiceImpl commentsService; |
| 24 | 31 | ||
| 32 | + @Autowired | ||
| 33 | + UsersServiceImpl usersService; | ||
| 34 | + | ||
| 25 | /** | 35 | /** |
| 26 | * 评论修改状态接口 | 36 | * 评论修改状态接口 |
| 27 | * | 37 | * |
| @@ -55,20 +65,52 @@ public class CommentsController { | @@ -55,20 +65,52 @@ public class CommentsController { | ||
| 55 | * @param start_date | 65 | * @param start_date |
| 56 | * @param end_date | 66 | * @param end_date |
| 57 | * @param state | 67 | * @param state |
| 58 | - * @param auditor | ||
| 59 | * @param page | 68 | * @param page |
| 60 | * @param pageSize | 69 | * @param pageSize |
| 61 | * @param orderByClause | 70 | * @param orderByClause |
| 62 | * @return | 71 | * @return |
| 63 | */ | 72 | */ |
| 64 | - @RequestMapping("/page") | ||
| 65 | - @ResponseBody | ||
| 66 | - public Object getListComments(String activity_id, String content, Integer is_hot, String start_date, String end_date, Integer state, String auditor, Integer page, Integer pageSize, String orderByClause, HttpSession session) { | 73 | + @GetMapping("/page") |
| 74 | + public String getPage(Model model, String activity_id, String content, Integer is_hot, | ||
| 75 | + String start_date, String end_date, String state, | ||
| 76 | + Integer page, Integer pageSize, String orderByClause, HttpSession session) { | ||
| 67 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); | 77 | SessionUser sessionUser = (SessionUser) session.getAttribute(SessionUser.getSessionKey()); |
| 68 | Integer spid = sessionUser.getSpid(); | 78 | Integer spid = sessionUser.getSpid(); |
| 79 | + if (spid == 0) spid = 82; | ||
| 69 | if (CommonUtils.isNull(page)) page = 1; | 80 | if (CommonUtils.isNull(page)) page = 1; |
| 70 | if (CommonUtils.isNull(pageSize)) pageSize = 10; | 81 | if (CommonUtils.isNull(pageSize)) pageSize = 10; |
| 71 | - return commentsService.getListComments(activity_id, content, is_hot, start_date, end_date, state, auditor, page, pageSize, orderByClause, spid); | 82 | + Date sDate = null; |
| 83 | + Date eDate = null; | ||
| 84 | + | ||
| 85 | + if (CommonUtils.isNotEmpty(start_date)) { | ||
| 86 | + try { | ||
| 87 | + sDate = CommonUtils.parseDate(start_date, "yyyy-MM-dd hh:mm"); | ||
| 88 | + } catch (Exception e) { | ||
| 89 | + } | ||
| 90 | + } | ||
| 91 | + if (CommonUtils.isNotEmpty(end_date)) { | ||
| 92 | + try { | ||
| 93 | + eDate = CommonUtils.parseDate(end_date, "yyyy-MM-dd hh:mm"); | ||
| 94 | + } catch (Exception e) { | ||
| 95 | + } | ||
| 96 | + } | ||
| 97 | + PageInfo<ShyComments> commentPage = commentsService.getPage(activity_id, content, is_hot, sDate, eDate, state, null, page, pageSize, orderByClause, spid); | ||
| 98 | + List<ShyComments> list = commentPage.getList(); | ||
| 99 | + if (!list.isEmpty()) { | ||
| 100 | + for (ShyComments comment : list) { | ||
| 101 | + String auditor = "白名单"; | ||
| 102 | + String auditor_id = comment.getAuditor_id(); | ||
| 103 | + if (CommonUtils.isNotEmpty(auditor_id)) { | ||
| 104 | + ShyUsers user = new ShyUsers(); | ||
| 105 | + user.setUser_id(auditor_id); | ||
| 106 | + user = usersService.select(user); | ||
| 107 | + if (CommonUtils.isNotNull(user)) auditor = user.getUsername() + user.getEmail(); | ||
| 108 | + } | ||
| 109 | + comment.setAuditor(auditor); | ||
| 110 | + } | ||
| 111 | + } | ||
| 112 | + model.addAttribute("commentPage", commentPage); | ||
| 113 | + return "page/comment.html"; | ||
| 72 | } | 114 | } |
| 73 | 115 | ||
| 74 | /** | 116 | /** |
| @@ -83,13 +125,5 @@ public class CommentsController { | @@ -83,13 +125,5 @@ public class CommentsController { | ||
| 83 | return commentsService.getDetailsComment(id); | 125 | return commentsService.getDetailsComment(id); |
| 84 | } | 126 | } |
| 85 | 127 | ||
| 86 | - @GetMapping("/detail") | ||
| 87 | - public String detail() { | ||
| 88 | - return "page/commentDetail.html"; | ||
| 89 | - } | ||
| 90 | - @GetMapping("/list") | ||
| 91 | - public String list() { | ||
| 92 | - return "page/comment.html"; | ||
| 93 | - } | ||
| 94 | 128 | ||
| 95 | } | 129 | } |
src/main/java/com/cnlive/shenhe/entity/ShyComments.java
| @@ -64,6 +64,11 @@ public class ShyComments { | @@ -64,6 +64,11 @@ public class ShyComments { | ||
| 64 | * 审核员id | 64 | * 审核员id |
| 65 | */ | 65 | */ |
| 66 | private String auditor_id; | 66 | private String auditor_id; |
| 67 | + /** | ||
| 68 | + * 审核员 | ||
| 69 | + */ | ||
| 70 | + @Transient | ||
| 71 | + private String auditor; | ||
| 67 | 72 | ||
| 68 | /** | 73 | /** |
| 69 | * 回调函数 | 74 | * 回调函数 |
| @@ -483,4 +488,12 @@ public class ShyComments { | @@ -483,4 +488,12 @@ public class ShyComments { | ||
| 483 | public void setUpdated_at(Date updated_at) { | 488 | public void setUpdated_at(Date updated_at) { |
| 484 | this.updated_at = updated_at; | 489 | this.updated_at = updated_at; |
| 485 | } | 490 | } |
| 491 | + | ||
| 492 | + public String getAuditor() { | ||
| 493 | + return auditor; | ||
| 494 | + } | ||
| 495 | + | ||
| 496 | + public void setAuditor(String auditor) { | ||
| 497 | + this.auditor = auditor; | ||
| 498 | + } | ||
| 486 | } | 499 | } |
| 487 | \ No newline at end of file | 500 | \ No newline at end of file |
src/main/java/com/cnlive/shenhe/serviceImpl/CommentsServiceImpl.java
| @@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired; | @@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired; | ||
| 12 | import org.springframework.stereotype.Service; | 12 | import org.springframework.stereotype.Service; |
| 13 | import tk.mybatis.mapper.entity.Example; | 13 | import tk.mybatis.mapper.entity.Example; |
| 14 | 14 | ||
| 15 | +import java.util.Date; | ||
| 15 | import java.util.List; | 16 | import java.util.List; |
| 16 | 17 | ||
| 17 | /** | 18 | /** |
| @@ -45,13 +46,15 @@ public class CommentsServiceImpl { | @@ -45,13 +46,15 @@ public class CommentsServiceImpl { | ||
| 45 | return shyCommentsMapper.updateByPrimaryKeySelective(shyComments); | 46 | return shyCommentsMapper.updateByPrimaryKeySelective(shyComments); |
| 46 | } | 47 | } |
| 47 | 48 | ||
| 48 | - public PageInfo<ShyComments> getListComments(String activity_id, String content, Integer is_hot, String start_date, String end_date, Integer state, String auditor, Integer page, Integer pageSize, String orderByClause, Integer spid) { | 49 | + public PageInfo<ShyComments> getPage(String activity_id, String content, Integer is_hot, Date start_date, Date end_date, String states, String auditor, Integer page, Integer pageSize, String orderByClause, Integer spid) { |
| 49 | Example example = new Example(ShyComments.class); | 50 | Example example = new Example(ShyComments.class); |
| 50 | Example.Criteria criteria = example.createCriteria(); | 51 | Example.Criteria criteria = example.createCriteria(); |
| 51 | if (CommonUtils.isNotEmpty(orderByClause)) { | 52 | if (CommonUtils.isNotEmpty(orderByClause)) { |
| 52 | example.setOrderByClause(orderByClause); | 53 | example.setOrderByClause(orderByClause); |
| 54 | + }else { | ||
| 55 | + example.setOrderByClause("comment_time desc"); | ||
| 53 | } | 56 | } |
| 54 | - if (CommonUtils.isNotEmpty(start_date) && CommonUtils.isNotEmpty(end_date)) { | 57 | + if (CommonUtils.isNotNull(start_date) && CommonUtils.isNotNull(end_date)) { |
| 55 | criteria.andGreaterThanOrEqualTo("comment_time", start_date); | 58 | criteria.andGreaterThanOrEqualTo("comment_time", start_date); |
| 56 | criteria.andLessThanOrEqualTo("comment_time", end_date); | 59 | criteria.andLessThanOrEqualTo("comment_time", end_date); |
| 57 | } | 60 | } |
| @@ -68,17 +71,23 @@ public class CommentsServiceImpl { | @@ -68,17 +71,23 @@ public class CommentsServiceImpl { | ||
| 68 | criteria.andEqualTo("is_hot", is_hot); | 71 | criteria.andEqualTo("is_hot", is_hot); |
| 69 | } | 72 | } |
| 70 | if (CommonUtils.isNotEmpty(activity_id)) { | 73 | if (CommonUtils.isNotEmpty(activity_id)) { |
| 71 | - criteria.andEqualTo("activity_id", activity_id); | 74 | + criteria.andLike("activity_id", "%" + activity_id + "%"); |
| 75 | + } | ||
| 76 | + if (CommonUtils.isNotEmpty(states)) { | ||
| 77 | + Example.Criteria criteria1 = example.createCriteria(); | ||
| 78 | + String[] stas = states.split(","); | ||
| 79 | + for (String s:stas) { | ||
| 80 | + criteria1.orEqualTo("state", Integer.parseInt(s)); | ||
| 81 | + } | ||
| 82 | + example.and(criteria1); | ||
| 72 | } | 83 | } |
| 73 | - //默认按上传时间倒序排序 | ||
| 74 | - example.setOrderByClause("comment_time desc"); | ||
| 75 | PageHelper.startPage(page, pageSize, true); | 84 | PageHelper.startPage(page, pageSize, true); |
| 76 | List<ShyComments> commentsList = shyCommentsMapper.selectByExample(example); | 85 | List<ShyComments> commentsList = shyCommentsMapper.selectByExample(example); |
| 77 | PageInfo<ShyComments> pageInfo = new PageInfo<>(commentsList); | 86 | PageInfo<ShyComments> pageInfo = new PageInfo<>(commentsList); |
| 78 | return pageInfo; | 87 | return pageInfo; |
| 79 | } | 88 | } |
| 80 | 89 | ||
| 81 | - public Object getDetailsComment(Integer id) { | 90 | + public ShyComments getDetailsComment(Integer id) { |
| 82 | ShyComments comment = shyCommentsMapper.selectByPrimaryKey(id); | 91 | ShyComments comment = shyCommentsMapper.selectByPrimaryKey(id); |
| 83 | return comment; | 92 | return comment; |
| 84 | } | 93 | } |
src/main/resources/templates/page/comment.html
| @@ -16,7 +16,7 @@ | @@ -16,7 +16,7 @@ | ||
| 16 | 16 | ||
| 17 | </h1> | 17 | </h1> |
| 18 | <ol class="breadcrumb"> | 18 | <ol class="breadcrumb"> |
| 19 | - <li><a href="http://shenhe.cnlive.com/index"><i class="fa fa-dashboard"></i> 首页</a></li> | 19 | + <li>首页</li> |
| 20 | <li class="active">评论审核</li> | 20 | <li class="active">评论审核</li> |
| 21 | </ol> | 21 | </ol> |
| 22 | </section> | 22 | </section> |
| @@ -25,253 +25,98 @@ | @@ -25,253 +25,98 @@ | ||
| 25 | <div class="col-md-12"> | 25 | <div class="col-md-12"> |
| 26 | <div class="box box-info"> | 26 | <div class="box box-info"> |
| 27 | <div class="box-body"> | 27 | <div class="box-body"> |
| 28 | - <div class="modal fade" id="modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | ||
| 29 | - <div class="modal-dialog"> | ||
| 30 | - <div class="modal-content"> | ||
| 31 | - <div class="modal-header"> | ||
| 32 | - <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> ×</button> | ||
| 33 | - <h4 class="modal-title">温馨提示</h4> | ||
| 34 | - </div> | ||
| 35 | - <div class="modal-body" id="msg">您确认删除该条信息吗?</div> | ||
| 36 | - <div class="modal-footer"> | ||
| 37 | - <button type="button" class="btn btn-default" data-dismiss="modal">取消</button> | ||
| 38 | - <button type="button" class="btn btn-primary" id="modal_remove">确认</button> | ||
| 39 | - </div> | 28 | + <div class="clearfix"> |
| 29 | + <div class="btn-group margin-bottom pull-left"> | ||
| 30 | + <input type="hidden" name="state" id="state" value="2"> | ||
| 31 | + <div class="btn-group margin-bottom" id="hide_select_area" style=""> | ||
| 32 | + <button type="button" class="btn btn-success btn-sm margin-r-5 action_bottom" | ||
| 33 | + value="2" data="claim" data-toggle="modal" data-target="#modal" | ||
| 34 | + id="more_pass">批量通过 | ||
| 35 | + </button> | ||
| 36 | + <button type="button" class="btn btn-danger btn-sm margin-r-5 action_bottom" | ||
| 37 | + value="2" data="claim" data-toggle="modal" data-target="#modal" | ||
| 38 | + id="more_reject">批量拒绝 | ||
| 39 | + </button> | ||
| 40 | </div> | 40 | </div> |
| 41 | - </div> | ||
| 42 | - </div> <div class="clearfix"> | ||
| 43 | - <div class="btn-group margin-bottom pull-left"> | ||
| 44 | - <input type="hidden" name="state" id="state" value="2"> | ||
| 45 | - <div class="btn-group margin-bottom" id="hide_select_area_2" style="display: none;"> | ||
| 46 | - <button type="button" class="btn btn-success btn-sm margin-r-5 action claim" value="2" data="claim" id="claim" data-toggle="modal" data-target="#modal">认领 | ||
| 47 | - </button> | ||
| 48 | - <button type="button" class="btn btn-success btn-sm margin-r-5 action claim" value="2" data="claim100" id="claim100" data-toggle="modal" data-target="#modal">认领100条 | ||
| 49 | - </button> | ||
| 50 | - <button type="button" class="btn btn-success btn-sm margin-r-5 action claim" value="2" data="claim1000" id="claim1000" data-toggle="modal" data-target="#modal">认领1000条 | ||
| 51 | - </button> | ||
| 52 | - <button type="button" class="btn btn-success btn-sm margin-r-5 action claim" value="2" data="claim10000" id="claim10000" data-toggle="modal" data-target="#modal">认领10000条 | ||
| 53 | - </button> | ||
| 54 | - </div> | ||
| 55 | 41 | ||
| 56 | - <div class="btn-group margin-bottom" id="hide_select_area" style=""> | ||
| 57 | - <button type="button" class="btn btn-success btn-sm margin-r-5 action_bottom" value="2" data="claim" data-toggle="modal" data-target="#modal" id="more_pass">批量通过 | ||
| 58 | - </button> | ||
| 59 | - <button type="button" class="btn btn-danger btn-sm margin-r-5 action_bottom" value="2" data="claim" data-toggle="modal" data-target="#modal" id="more_reject">批量拒绝 | ||
| 60 | - </button> | ||
| 61 | </div> | 42 | </div> |
| 62 | 43 | ||
| 63 | - </div> | ||
| 64 | - | ||
| 65 | - <div class="btn-group margin-bottom pull-right"> | ||
| 66 | - <button type="button" class="btn btn-sm margin-r-5 filter" id="" value="0"> | ||
| 67 | - 全部 | ||
| 68 | - </button> | ||
| 69 | - <button type="button" class="btn btn-sm margin-r-5 filter" value="1">全部待领 | ||
| 70 | - </button> | ||
| 71 | - <button type="button" class="btn btn-sm margin-r-5 filter btn-info" value="2">我的待审 | ||
| 72 | - </button> | ||
| 73 | - <!-- <button type="button" class="btn btn-sm margin-r-5 filter" | ||
| 74 | - value="3">我的已审核 | 44 | + <div class="btn-group margin-bottom pull-right"> |
| 45 | + <div class="btn-group margin-bottom" style=""> | ||
| 46 | + <button type="button" class="btn btn-info btn-sm margin-r-5 action_bottom" onclick="searchStatus('')">全部</button> | ||
| 47 | + <button type="button" class="btn btn-success btn-sm margin-r-5 action_bottom" onclick="searchStatus('1,2')">已审</button> | ||
| 48 | + <button type="button" class="btn btn-danger btn-sm margin-r-5 action_bottom" onclick="searchStatus('0')">未审</button> | ||
| 49 | + </div> | ||
| 50 | + <button type="button" class="btn btn-primary btn-sm margin-r-5" id="query" | ||
| 51 | + onclick="openOrClose('forms')">高级查询 | ||
| 52 | + <span id="a_up">▼</span><span id="a_down" style="display: none;">▲</span> | ||
| 75 | </button> | 53 | </button> |
| 76 | - <button type="button" class="btn btn-sm margin-r-5 filter" | ||
| 77 | - value="4">我的未通过 | ||
| 78 | - </button> --> | ||
| 79 | - <button type="button" class="btn btn-sm margin-r-5 filter" value="7">我的已审 | ||
| 80 | - </button> | ||
| 81 | - | ||
| 82 | - <button type="button" class="btn btn-primary btn-sm margin-r-5" id="query" onclick="openOrClose('forms')">查询 | ||
| 83 | - <span id="a_up">▼</span><span id="a_down" style="display: none;">▲</span> | ||
| 84 | - </button> | 54 | + </div> |
| 85 | </div> | 55 | </div> |
| 86 | - </div> | ||
| 87 | 56 | ||
| 88 | 57 | ||
| 89 | <div class="form-horizontal form-group-sm" id="forms" style="display: none;"> | 58 | <div class="form-horizontal form-group-sm" id="forms" style="display: none;"> |
| 90 | - <div class="btn-group margin-bottom col-md-6" style="padding: 0;"> | ||
| 91 | - <div class="col-md-5" style="padding: 0"> | ||
| 92 | - <label for="activity_id" class="control-label cb-toolbar">活动id:</label> | ||
| 93 | - <div class="col-sm-9" style="padding: 0;"> | ||
| 94 | - <input class="form-control" name="activity_id" type="text" id="activity_id"> | 59 | + <form id="commentForm"> |
| 60 | + <input class="hide" name="state" th:value="${param.state}"/> | ||
| 61 | + <div class="btn-group margin-bottom col-md-6" style="padding: 0;"> | ||
| 62 | + <div class="col-md-5" style="padding: 0"> | ||
| 63 | + <label for="activity_id" class="control-label cb-toolbar">活动id:</label> | ||
| 64 | + <div class="col-sm-9" style="padding: 0;"> | ||
| 65 | + <input class="form-control" name="activity_id" type="text" id="activity_id"> | ||
| 66 | + </div> | ||
| 95 | </div> | 67 | </div> |
| 96 | - </div> | ||
| 97 | - <div class="col-md-4" style="padding: 0"> | ||
| 98 | - <label for="content" class="control-label cb-toolbar">内容:</label> | ||
| 99 | - <div class="col-sm-9" style="padding: 0;"> | ||
| 100 | - <input class="form-control" name="content" type="text" id="content"> | 68 | + <div class="col-md-4" style="padding: 0"> |
| 69 | + <label for="content" class="control-label cb-toolbar">内容:</label> | ||
| 70 | + <div class="col-sm-9" style="padding: 0;"> | ||
| 71 | + <input class="form-control" name="content" type="text" id="content"> | ||
| 72 | + </div> | ||
| 101 | </div> | 73 | </div> |
| 102 | - </div> | ||
| 103 | - <div class="col-md-3" style="padding: 0"> | ||
| 104 | - <label for="is_hot" class="control-label cb-toolbar">是否热点:</label> | ||
| 105 | - <div class="col-sm-7" style="padding: 0;"> | ||
| 106 | - <select class="form-control col-sm-2" id="is_hot" name="is_hot"><option value="0">全部</option><option value="2">是</option><option value="1">否</option></select> | 74 | + <div class="col-md-3" style="padding: 0"> |
| 75 | + <label for="is_hot" class="control-label cb-toolbar">是否热点:</label> | ||
| 76 | + <div class="col-sm-7" style="padding: 0;"> | ||
| 77 | + <select class="form-control col-sm-2" id="is_hot" name="is_hot"> | ||
| 78 | + <option value="0">全部</option> | ||
| 79 | + <option value="2">是</option> | ||
| 80 | + <option value="1">否</option> | ||
| 81 | + </select> | ||
| 82 | + </div> | ||
| 107 | </div> | 83 | </div> |
| 108 | - </div> | ||
| 109 | 84 | ||
| 110 | 85 | ||
| 111 | - </div> | 86 | + </div> |
| 112 | 87 | ||
| 113 | - <div class="btn-group margin-bottom col-md-6 pull-right" style="padding: 0"> | ||
| 114 | - <div class="col-md-11" style="width: 88%;padding: 0;"> | ||
| 115 | - <div class="col-md-6" style="padding: 0"> | ||
| 116 | - <label for="start_date" class="control-label cb-toolbar">时间:</label> | ||
| 117 | - <div class="input-group col-md-9 date"> | ||
| 118 | - <input class="form-control date" name="start_date" type="text" id="start_date"> | ||
| 119 | - <span class="input-group-addon"> | ||
| 120 | - <span class="glyphicon glyphicon-calendar"></span> | ||
| 121 | - </span> | 88 | + <div class="btn-group margin-bottom col-md-6 pull-right" style="padding: 0"> |
| 89 | + <div class="col-md-11" style="width: 88%;padding: 0;"> | ||
| 90 | + <div class="col-md-6" style="padding: 0;width: 45%;"> | ||
| 91 | + <label for="start_date" class="control-label cb-toolbar">时间:</label> | ||
| 92 | + <div class="input-group col-md-9 date"> | ||
| 93 | + <input class="form-control date" name="start_date" type="text" | ||
| 94 | + id="start_date"> | ||
| 95 | + <span class="input-group-addon"> | ||
| 96 | + <span class="glyphicon glyphicon-calendar"></span> | ||
| 97 | + </span> | ||
| 98 | + </div> | ||
| 122 | </div> | 99 | </div> |
| 123 | - </div> | ||
| 124 | - <div class="col-md-6" style="padding: 0"> | ||
| 125 | - <label for="start_date" class="control-label cb-toolbar">至</label> | ||
| 126 | - <div class="input-group col-md-9 date"> | ||
| 127 | - <input class="form-control date" name="end_date" type="text"> | ||
| 128 | - <span class="input-group-addon"> | ||
| 129 | - <span class="glyphicon glyphicon-calendar"></span> | ||
| 130 | - </span> | 100 | + <div class="col-md-6" style="padding: 0;width: 45%;"> |
| 101 | + <label for="start_date" class="control-label cb-toolbar">至</label> | ||
| 102 | + <div class="input-group col-md-9 date"> | ||
| 103 | + <input class="form-control date" name="end_date" type="text"> | ||
| 104 | + <span class="input-group-addon"> | ||
| 105 | + <span class="glyphicon glyphicon-calendar"></span> | ||
| 106 | + </span> | ||
| 107 | + </div> | ||
| 108 | + </div> | ||
| 109 | + <div class="col-md-6" style="padding: 0;width: 2%;" > | ||
| 110 | + <button type="button" class="btn btn-info btn-sm" id="comments_query">查 询 | ||
| 111 | + </button> | ||
| 131 | </div> | 112 | </div> |
| 132 | </div> | 113 | </div> |
| 133 | </div> | 114 | </div> |
| 115 | + </form> | ||
| 134 | 116 | ||
| 135 | - </div> | ||
| 136 | - | ||
| 137 | - <div class="btn-group margin-bottom col-md-6" style="padding: 0;"> | ||
| 138 | - | ||
| 139 | - <div class="col-md-4" style="padding: 0"> | ||
| 140 | - <label for="auditor" class="control-label cb-toolbar">审核员:</label> | ||
| 141 | - <div class="col-sm-7" style="padding: 0;"> | ||
| 142 | - <input class="form-control" name="auditor" type="text" id="auditor"> | ||
| 143 | - </div> | ||
| 144 | - </div> | ||
| 145 | - <div class="col-md-1 text-center" style="width: 12%;padding: 0"> | ||
| 146 | - <button type="button" class="btn btn-info btn-sm" id="comments_query">查 询</button> | ||
| 147 | - </div> | ||
| 148 | - </div> | ||
| 149 | </div> | 117 | </div> |
| 150 | 118 | ||
| 151 | <script> | 119 | <script> |
| 152 | - | ||
| 153 | - //定义一个存储状态 | ||
| 154 | - var form_state = | ||
| 155 | - | ||
| 156 | - $(function () { | ||
| 157 | -// $(this).addClass('btn-info'); | ||
| 158 | -// $(this).siblings().removeClass('btn-info'); | ||
| 159 | - | ||
| 160 | - }); | ||
| 161 | - /*批量操作 --认领*/ | ||
| 162 | - var claim_open = false; | ||
| 163 | - var remove_open = false; | ||
| 164 | - $("#modal_remove").delegate(this, "click", function () { | ||
| 165 | - | ||
| 166 | - var flag = $(this).attr('claim'); | ||
| 167 | - var rows = $('#table').bootstrapTable('getSelections'); | ||
| 168 | - | ||
| 169 | - if (flag == 'more_pass') { //批量通过 | ||
| 170 | - var ids = []; | ||
| 171 | - for (var i = 0; i < rows.length; i++) { | ||
| 172 | - ids[ids.length] = rows[i].id; | ||
| 173 | - } | ||
| 174 | -// var state = 7; | ||
| 175 | - $.ajax({ | ||
| 176 | - url: '/comments/morepassreject', | ||
| 177 | - type: 'POST', | ||
| 178 | - data: {'_token': 'YnS6uzLnUDRQyeB4E2tTFbRCDmYio9gvdqwsGiu8', 'ids': ids, 'flag': flag}, | ||
| 179 | - success: function () { | ||
| 180 | - window.location.reload(); | ||
| 181 | -// window.location.href = '/comments'+ '?state=' + state; | ||
| 182 | - } | ||
| 183 | - }); | ||
| 184 | - } else if (flag == 'more_reject') { //批量拒绝 | ||
| 185 | - // alert('more_reject');return false; | ||
| 186 | - var ids = []; | ||
| 187 | - for (var i = 0; i < rows.length; i++) { | ||
| 188 | - ids[ids.length] = rows[i].id; | ||
| 189 | - } | ||
| 190 | -// var state = 7; | ||
| 191 | - $.ajax({ | ||
| 192 | - url: '/comments/morepassreject', | ||
| 193 | - type: 'POST', | ||
| 194 | - data: {'_token': 'YnS6uzLnUDRQyeB4E2tTFbRCDmYio9gvdqwsGiu8', 'ids': ids, 'flag': flag}, | ||
| 195 | - success: function () { | ||
| 196 | - window.location.reload(); | ||
| 197 | -// window.location.href = '/comments'+ '?state=' + state; | ||
| 198 | - } | ||
| 199 | - }); | ||
| 200 | - } else { | ||
| 201 | - // alert('claim');return false; | ||
| 202 | - if (claim_open == true) { | ||
| 203 | - return false; | ||
| 204 | - } | ||
| 205 | - if (remove_open == true) { //这样的话是true,就是单个操作 | ||
| 206 | - return false; | ||
| 207 | - } | ||
| 208 | - var status = $('.action').val(); | ||
| 209 | - | ||
| 210 | - | ||
| 211 | - if (flag == 'claim') { | ||
| 212 | - var ids = []; | ||
| 213 | - for (var i = 0; i < rows.length; i++) { | ||
| 214 | - ids[ids.length] = rows[i].id; | ||
| 215 | - } | ||
| 216 | - } else { | ||
| 217 | - $ids = ''; | ||
| 218 | - } | ||
| 219 | - var state =2; | ||
| 220 | - | ||
| 221 | - $.ajax({ | ||
| 222 | - url: '/comments/status/' + status, | ||
| 223 | - type: 'POST', | ||
| 224 | - data: {'_token': 'YnS6uzLnUDRQyeB4E2tTFbRCDmYio9gvdqwsGiu8', 'ids': ids, 'flag': flag}, | ||
| 225 | - success: function () { | ||
| 226 | - window.location.href = '/comments'+ '?state=' + state; | ||
| 227 | - } | ||
| 228 | - }); | ||
| 229 | - } | ||
| 230 | - | ||
| 231 | - }); | ||
| 232 | - | ||
| 233 | - | ||
| 234 | - /* 筛选 状态 */ | ||
| 235 | - $('.filter').click(function () { | ||
| 236 | - var object = $('#forms input').serializeObject(); | ||
| 237 | - object['state'] = $(this).val(); | ||
| 238 | - switch ($(this).val()) { | ||
| 239 | - case "1": | ||
| 240 | - $(this).addClass('btn-info'); | ||
| 241 | - $(this).siblings().removeClass('btn-info'); | ||
| 242 | - $('#hide_select_area').hide(); | ||
| 243 | - $('#hide_select_area_2').show(); | ||
| 244 | - form_state = 1; //待领 | ||
| 245 | - break; | ||
| 246 | - case "2": | ||
| 247 | - $(this).addClass('btn-info'); | ||
| 248 | - $(this).siblings().removeClass('btn-info'); | ||
| 249 | - $('#hide_select_area').show(); | ||
| 250 | - $('#hide_select_area_2').hide(); | ||
| 251 | - form_state = 2; //待审 | ||
| 252 | - break; | ||
| 253 | - case "7": | ||
| 254 | - $(this).addClass('btn-info'); | ||
| 255 | - $(this).siblings().removeClass('btn-info'); | ||
| 256 | - $('#hide_select_area_2').hide(); | ||
| 257 | - $('#hide_select_area').hide(); | ||
| 258 | - form_state = 7; //我的已审 | ||
| 259 | - break; | ||
| 260 | - default: | ||
| 261 | - $(this).addClass('btn-info'); | ||
| 262 | - $(this).siblings().removeClass('btn-info'); | ||
| 263 | - $('#hide_select_area').hide(); | ||
| 264 | - $('#hide_select_area_2').hide(); | ||
| 265 | - form_state = 0; //全部 | ||
| 266 | - break; | ||
| 267 | - } | ||
| 268 | - object['_token'] = 'YnS6uzLnUDRQyeB4E2tTFbRCDmYio9gvdqwsGiu8'; | ||
| 269 | - $('#state').val(object['state']); | ||
| 270 | - $('#table').bootstrapTable('selectPage', 1); | ||
| 271 | - $('#table').bootstrapTable('refresh', {query: object}); | ||
| 272 | - }); | ||
| 273 | - | ||
| 274 | - $('#a_down').hide(); | ||
| 275 | /*查询*/ | 120 | /*查询*/ |
| 276 | function openOrClose(id_name_str) { | 121 | function openOrClose(id_name_str) { |
| 277 | var id_name = '#' + id_name_str; | 122 | var id_name = '#' + id_name_str; |
| @@ -294,82 +139,196 @@ | @@ -294,82 +139,196 @@ | ||
| 294 | showClear: true, | 139 | showClear: true, |
| 295 | }); | 140 | }); |
| 296 | 141 | ||
| 297 | - /*认领弹框操作*/ | ||
| 298 | - $('.action').click(function () { | ||
| 299 | - claim_open = false; | ||
| 300 | - var rows = $('#table').bootstrapTable('getSelections'); | ||
| 301 | - | ||
| 302 | - var flag = $(this).attr('data'); | ||
| 303 | - if (flag == 'claim') { | ||
| 304 | - if (rows.length > 0) { | ||
| 305 | - $('#msg').html('您确认认领这<strong><span class="text-danger">' + rows.length + '</span></strong>条信息吗?'); | ||
| 306 | - $('#modal_remove').show(); | ||
| 307 | - $('#modal_remove').attr('claim', 'claim'); | ||
| 308 | - } else { | ||
| 309 | - $('#msg').html('请选择要认领的数据!'); | ||
| 310 | - $('#modal_remove').hide(); | ||
| 311 | - } | ||
| 312 | - } else if (flag == 'claim100') { | ||
| 313 | - $('#msg').html('您确认认领这前<strong><span class="text-danger">' + '100' + '</span></strong>条信息吗?'); | ||
| 314 | -// $('#claim100').show(); | ||
| 315 | - $('#modal_remove').show(); | ||
| 316 | - $('#modal_remove').attr('claim', 'claim100'); | ||
| 317 | - } else if (flag == 'claim1000') { | ||
| 318 | - $('#msg').html('您确认认领这前<strong><span class="text-danger">' + '1000' + '</span></strong>条信息吗?'); | ||
| 319 | - $('#modal_remove').show(); | ||
| 320 | - $('#modal_remove').attr('claim', 'claim1000'); | ||
| 321 | - } else { | ||
| 322 | - $('#msg').html('您确认认领这前<strong><span class="text-danger">' + '10000' + '</span></strong>条信息吗?'); | ||
| 323 | - $('#modal_remove').show(); | ||
| 324 | - $('#modal_remove').attr('claim', 'claim10000'); | ||
| 325 | - } | ||
| 326 | - }); | ||
| 327 | 142 | ||
| 328 | - </script> <div class="modal fade common" id="modal_comment" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | ||
| 329 | - <div class="modal-dialog"> | ||
| 330 | - <div class="modal-content"> | ||
| 331 | - <div class="modal-header"> | ||
| 332 | - <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> ×</button> | ||
| 333 | - <h4 class="modal-title" id="modal_title"></h4> | 143 | + </script> |
| 144 | + <div class="modal fade common" id="modal_comment" tabindex="-1" role="dialog" | ||
| 145 | + aria-labelledby="myModalLabel" aria-hidden="true"> | ||
| 146 | + <div class="modal-dialog"> | ||
| 147 | + <div class="modal-content"> | ||
| 148 | + <div class="modal-header"> | ||
| 149 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true"> | ||
| 150 | + × | ||
| 151 | + </button> | ||
| 152 | + <h4 class="modal-title" id="modal_title"></h4> | ||
| 153 | + </div> | ||
| 154 | + <div class="modal-body"> | ||
| 155 | + <div class="alert alert-danger" id="window_msg" style="display: none;"> | ||
| 156 | + <p></p> | ||
| 157 | + </div> | ||
| 158 | + <div id="contents"> | ||
| 159 | + </div> | ||
| 160 | + </div> | ||
| 161 | + </div> | ||
| 162 | + </div> | ||
| 163 | + </div> | ||
| 164 | + <div class="bootstrap-table"> | ||
| 165 | + <div class="fixed-table-toolbar"></div> | ||
| 166 | + <div class="fixed-table-container" style="padding-bottom: 0px;"> | ||
| 167 | + <div class="fixed-table-header" style="display: none;"> | ||
| 168 | + <table></table> | ||
| 334 | </div> | 169 | </div> |
| 335 | - <div class="modal-body"> | ||
| 336 | - <div class="alert alert-danger" id="window_msg" style="display: none;"> | ||
| 337 | - <p></p> | 170 | + <div class="fixed-table-body"> |
| 171 | + <table id="table" data-toggle="table" | ||
| 172 | + class="table table-hover coma-base-table fixed_headers table-striped" | ||
| 173 | + style="word-break:break-all;"> | ||
| 174 | + <thead> | ||
| 175 | + <tr> | ||
| 176 | + <th class="bs-checkbox " style="width: 3%; " data-field="state" | ||
| 177 | + tabindex="0"> | ||
| 178 | + <div class="th-inner "><input name="btSelectAll" type="checkbox"> | ||
| 179 | + </div> | ||
| 180 | + <div class="fht-cell"></div> | ||
| 181 | + </th> | ||
| 182 | + <th style="text-align: center; width: 5%; " data-field="sp_id_brief" | ||
| 183 | + tabindex="0"> | ||
| 184 | + <div class="th-inner ">sp简称</div> | ||
| 185 | + <div class="fht-cell"></div> | ||
| 186 | + </th> | ||
| 187 | + <th style="text-align: center; width: 5%; " | ||
| 188 | + data-field="comment_user_name" tabindex="0"> | ||
| 189 | + <div class="th-inner ">用户昵称</div> | ||
| 190 | + <div class="fht-cell"></div> | ||
| 191 | + </th> | ||
| 192 | + <th style="text-align: center; width: 6%; " | ||
| 193 | + data-field="comment_user_avatar" tabindex="0"> | ||
| 194 | + <div class="th-inner ">用户头像 | ||
| 195 | + </div> | ||
| 196 | + <div class="fht-cell"></div> | ||
| 197 | + </th> | ||
| 198 | + <th style="text-align: center; width: 6%; " data-field="comment_user_ip" | ||
| 199 | + tabindex="0"> | ||
| 200 | + <div class="th-inner ">用户IP</div> | ||
| 201 | + <div class="fht-cell"></div> | ||
| 202 | + </th> | ||
| 203 | + <th style="text-align: center; width: 22%; " data-field="content" | ||
| 204 | + tabindex="0"> | ||
| 205 | + <div class="th-inner ">评论内容 | ||
| 206 | + </div> | ||
| 207 | + <div class="fht-cell"></div> | ||
| 208 | + </th> | ||
| 209 | + <th style="text-align: center; width: 15%; " data-field="comment_title" | ||
| 210 | + tabindex="0"> | ||
| 211 | + <div class="th-inner ">原文标题 | ||
| 212 | + </div> | ||
| 213 | + <div class="fht-cell"></div> | ||
| 214 | + </th> | ||
| 215 | + <th style="text-align: center; width: 6%; " data-field="auditor" | ||
| 216 | + tabindex="0"> | ||
| 217 | + <div class="th-inner ">审核员</div> | ||
| 218 | + <div class="fht-cell"></div> | ||
| 219 | + </th> | ||
| 220 | + | ||
| 221 | + <th style="text-align: center; width: 4%; " data-field="is_hot_name" | ||
| 222 | + tabindex="0"> | ||
| 223 | + <div class="th-inner ">热点</div> | ||
| 224 | + <div class="fht-cell"></div> | ||
| 225 | + </th> | ||
| 226 | + <th style="text-align: center; width: 5%; " | ||
| 227 | + data-field="state_name_short" tabindex="0"> | ||
| 228 | + <div class="th-inner ">状态 | ||
| 229 | + </div> | ||
| 230 | + <div class="fht-cell"></div> | ||
| 231 | + </th> | ||
| 232 | + <th style="text-align: center; width: 8%; " data-field="comment_time" | ||
| 233 | + tabindex="0"> | ||
| 234 | + <div class="th-inner ">评论上传时间</div> | ||
| 235 | + <div class="fht-cell"></div> | ||
| 236 | + </th> | ||
| 237 | + <th style="text-align: center; width: 22%; " data-field="action" | ||
| 238 | + tabindex="0"> | ||
| 239 | + <div class="th-inner ">操作 | ||
| 240 | + </div> | ||
| 241 | + <div class="fht-cell"></div> | ||
| 242 | + </th> | ||
| 243 | + </tr> | ||
| 244 | + </thead> | ||
| 245 | + <tbody> | ||
| 246 | + <tr th:data-index="${commentStat.index}" th:each="comment : ${commentPage.list}"> | ||
| 247 | + <td class="bs-checkbox "><input data-index="0" name="btSelectItem" | ||
| 248 | + type="checkbox"></td> | ||
| 249 | + <td style="text-align: center; width: 5%;" th:text="${session.sessionUser.company}">网加加</td> | ||
| 250 | + <td style="text-align: center; width: 5%;" th:text="${comment.comment_user_name}">鱼</td> | ||
| 251 | + <td style="text-align: center; width: 6%;"> | ||
| 252 | + <div width="60px" height="60px"><img th:src="@{${comment.comment_user_avatar}}" width="60px" | ||
| 253 | + alt="用户头像"></div> | ||
| 254 | + </td> | ||
| 255 | + <td style="text-align: center; width: 6%;" th:text="${comment.comment_user_ip}">114.242.177.100</td> | ||
| 256 | + <td style="text-align: center; width: 22%;"><a th:title="${comment.comment_content}" | ||
| 257 | + style="font-weight:bold;font-size:16px;" | ||
| 258 | + data-toggle="tooltip" | ||
| 259 | + data-placement="right" th:text="${comment.comment_content}">哈哈哈</a> | ||
| 260 | + </td> | ||
| 261 | + <td style="text-align: center; width: 15%;" th:text="${comment.comment_title}"> | ||
| 262 | + </td> | ||
| 263 | + <td style="text-align: center; width: 6%;" th:text="${comment.auditor}">发布 | ||
| 264 | + openadmin9@cnlive.com | ||
| 265 | + </td> | ||
| 266 | + <td style="text-align: center; width: 4%;" th:if="${comment.is_hot==1}">否</td> | ||
| 267 | + <td style="text-align: center; width: 4%;" th:if="${comment.is_hot==2}">是</td> | ||
| 268 | + <td style="text-align: center; width: 4%;" th:if="${comment.is_hot!=2&&comment.is_hot!=1}">全部</td> | ||
| 269 | + <td style="text-align: center; width: 5%;"> | ||
| 270 | + <span class="btn btn-sm btn-warning" th:if="${comment.state==0}">待审</span> | ||
| 271 | + <span class="btn btn-sm btn-warning" th:if="${comment.state==1}">已审</span> | ||
| 272 | + <span class="btn btn-sm btn-warning" th:if="${comment.state==2}">拒绝</span> | ||
| 273 | + </td> | ||
| 274 | + <td style="text-align: center; width: 8%;" th:text="${#dates.format(comment.comment_time, 'yyyy-MM-dd HH:mm:ss')}">2018-11-28 16:08:00</td> | ||
| 275 | + <td style="text-align: center; width: 22%;"> | ||
| 276 | + <a class="detail" href="javascript:void(0)"> | ||
| 277 | + <button class="btn btn-info btn-sm">查看</button> | ||
| 278 | + </a> | ||
| 279 | + <span> </span> | ||
| 280 | + <a class="pass_one" href="javascript:void(0)"> | ||
| 281 | + <button class="btn btn-success btn-sm">通过</button> | ||
| 282 | + </a> | ||
| 283 | + <span> </span> | ||
| 284 | + <a class="failed_one" href="javascript:void(0)"> | ||
| 285 | + <button class="btn btn-danger btn-sm">拒绝</button> | ||
| 286 | + </a> | ||
| 287 | + </td> | ||
| 288 | + </tr> | ||
| 289 | + </tbody> | ||
| 290 | + </table> | ||
| 291 | + </div> | ||
| 292 | + <div class="fixed-table-footer" style="display: none;"> | ||
| 293 | + <table> | ||
| 294 | + <tbody> | ||
| 295 | + <tr></tr> | ||
| 296 | + </tbody> | ||
| 297 | + </table> | ||
| 298 | + </div> | ||
| 299 | + <div class="fixed-table-pagination" style="display: block;"> | ||
| 300 | + <div class="pull-left pagination-detail"> | ||
| 301 | + <span class="pagination-info" th:text="'共 '+${commentPage.total}+' 条记录'">总共 0 条记录</span> | ||
| 338 | </div> | 302 | </div> |
| 339 | - <div id="contents"> | 303 | + <div class="pull-right pagination" > |
| 304 | + <ul class="pagination" th:if="${commentPage.pages>1}" id="pageUl"> | ||
| 305 | + <li class="page-pre"><a th:href="@{'/comments/page'}">‹‹</a></li> | ||
| 306 | + <li class="page-pre" th:if="${!commentPage.isFirstPage}"><a th:href="@{'/comments/page?page='+${commentPage.pageNum-1}}">‹</a></li> | ||
| 307 | + | ||
| 308 | + <li class="page-number" th:if="${commentPage.pageNum-3>=1}"><a th:href="@{'/comments/page?page='+${commentPage.pageNum-3}}" th:text="${commentPage.pageNum-3}">2</a></li> | ||
| 309 | + <li class="page-number" th:if="${commentPage.pageNum-2>=1}"><a th:href="@{'/comments/page?page='+${commentPage.pageNum-2}}" th:text="${commentPage.pageNum-2}">2</a></li> | ||
| 310 | + <li class="page-number" th:if="${commentPage.pageNum-1>=1}"><a th:href="@{'/comments/page?page='+${commentPage.pageNum-1}}" th:text="${commentPage.pageNum-1}">2</a></li> | ||
| 311 | + <li class="page-number active"><a href="javaScript:void(0);" th:text="${commentPage.pageNum}">2</a></li> | ||
| 312 | + <li class="page-number" th:if="${commentPage.pageNum+1<=commentPage.pages}"><a th:href="@{'/comments/page?page='+${commentPage.pageNum+1}}" th:text="${commentPage.pageNum+1}">2</a></li> | ||
| 313 | + <li class="page-number" th:if="${commentPage.pageNum+2<=commentPage.pages}"><a th:href="@{'/comments/page?page='+${commentPage.pageNum+2}}" th:text="${commentPage.pageNum+2}">2</a></li> | ||
| 314 | + <li class="page-number" th:if="${commentPage.pageNum+3<=commentPage.pages}"><a th:href="@{'/comments/page?page='+${commentPage.pageNum+3}}" th:text="${commentPage.pageNum+3}">2</a></li> | ||
| 315 | + | ||
| 316 | + <li class="page-next" th:if="${!commentPage.isLastPage}"><a th:href="@{'/comments/page?page='+${commentPage.pageNum+1}}">›</a></li> | ||
| 317 | + <li class="page-next"><a th:href="@{'/comments/page?page='+${commentPage.pages}}">››</a></li> | ||
| 318 | + </ul> | ||
| 340 | </div> | 319 | </div> |
| 341 | </div> | 320 | </div> |
| 342 | </div> | 321 | </div> |
| 343 | </div> | 322 | </div> |
| 344 | - </div> <div class="bootstrap-table"><div class="fixed-table-toolbar"></div><div class="fixed-table-container" style="padding-bottom: 0px;"><div class="fixed-table-header" style="display: none;"><table></table></div><div class="fixed-table-body"><div class="fixed-table-loading" style="top: 41px; display: none;">正在努力地加载数据中,请稍候……</div><table id="table" data-toggle="table" class="table table-hover coma-base-table fixed_headers table-striped" style="word-break:break-all;"> | ||
| 345 | - <thead><tr><th class="bs-checkbox " style="width: 3%; " data-field="state" tabindex="0"><div class="th-inner "><input name="btSelectAll" type="checkbox"></div><div class="fht-cell"></div></th><th style="text-align: center; width: 5%; " data-field="sp_id_brief" tabindex="0"><div class="th-inner ">sp简称</div><div class="fht-cell"></div></th><th style="text-align: center; width: 5%; " data-field="comment_user_name" tabindex="0"><div class="th-inner ">用户昵称</div><div class="fht-cell"></div></th><th style="text-align: center; width: 6%; " data-field="comment_user_avatar" tabindex="0"><div class="th-inner ">用户头像 | ||
| 346 | - </div><div class="fht-cell"></div></th><th style="text-align: center; width: 6%; " data-field="comment_user_ip" tabindex="0"><div class="th-inner ">用户IP</div><div class="fht-cell"></div></th><th style="text-align: center; width: 22%; " data-field="content" tabindex="0"><div class="th-inner ">评论内容 | ||
| 347 | - </div><div class="fht-cell"></div></th><th style="text-align: center; width: 15%; " data-field="comment_title" tabindex="0"><div class="th-inner ">原文标题 | ||
| 348 | - </div><div class="fht-cell"></div></th><th style="text-align: center; width: 6%; " data-field="auditor" tabindex="0"><div class="th-inner ">审核员</div><div class="fht-cell"></div></th><th style="text-align: center; width: 4%; " data-field="mark_name" tabindex="0"><div class="th-inner ">白名单</div><div class="fht-cell"></div></th><th style="text-align: center; width: 4%; " data-field="is_hot_name" tabindex="0"><div class="th-inner ">热点</div><div class="fht-cell"></div></th><th style="text-align: center; width: 5%; " data-field="state_name_short" tabindex="0"><div class="th-inner ">状态 | ||
| 349 | - </div><div class="fht-cell"></div></th><th style="text-align: center; width: 8%; " data-field="comment_time" tabindex="0"><div class="th-inner ">评论上传时间</div><div class="fht-cell"></div></th><th style="text-align: center; width: 22%; " data-field="action" tabindex="0"><div class="th-inner ">操作 | ||
| 350 | - </div><div class="fht-cell"></div></th></tr></thead><tbody><tr data-index="0"><td class="bs-checkbox "><input data-index="0" name="btSelectItem" type="checkbox"></td><td style="text-align: center; width: 5%; ">网加加</td><td style="text-align: center; width: 5%; ">鱼</td><td style="text-align: center; width: 6%; "><div width="60px" height="60px"><img src="./审核云平台内容管理系统pl_files/1532077438500.jpg" width="60px" alt="用户头像"></div></td><td style="text-align: center; width: 6%; ">114.242.177.100</td><td style="text-align: center; width: 22%; "><a title="哈哈哈" style="font-weight:bold;font-size:16px;" data-toggle="tooltip" data-placement="right">哈哈哈</a></td><td style="text-align: center; width: 15%; "><a href="http://shenhe.cnlive.com/comments" target="_blank"></a></td><td style="text-align: center; width: 6%; ">发布 | ||
| 351 | - openadmin9@cnlive.com</td><td style="text-align: center; width: 4%; ">否</td><td style="text-align: center; width: 4%; ">否</td><td style="text-align: center; width: 5%; "><span class="btn btn-sm btn-warning">待审</span></td><td style="text-align: center; width: 8%; ">2018-11-28 16:08:00</td><td style="text-align: center; width: 22%; "><a class="claim" href="javascript:void(0)"><button class="btn btn-default btn-sm" disabled="disabled">认领</button></a><span> </span><a class="detail" href="javascript:void(0)"><button class="btn btn-info btn-sm">查看</button></a><span> </span><a class="back" href="javascript:void(0)"><button class="btn btn-danger btn-sm" data-toggle="modal" data-target="#modal">退领</button></a><br><br><span style="margin-right:50px;"> </span><a class="pass_one" href="javascript:void(0)"><button class="btn btn-success btn-sm">通过</button></a><span> </span><a class="failed_one" href="javascript:void(0)"><button class="btn btn-danger btn-sm">拒绝</button></a></td></tr><tr data-index="1"><td class="bs-checkbox "><input data-index="1" name="btSelectItem" type="checkbox"></td><td style="text-align: center; width: 5%; ">网加加</td><td style="text-align: center; width: 5%; ">178xxxx3068</td><td style="text-align: center; width: 6%; "><div width="60px" height="60px"><img src="./审核云平台内容管理系统pl_files/head_c.png" width="60px" alt="用户头像"></div></td><td style="text-align: center; width: 6%; ">120.253.57.223</td><td style="text-align: center; width: 22%; "><a title="不错" style="font-weight:bold;font-size:16px;" data-toggle="tooltip" data-placement="right">不错</a></td><td style="text-align: center; width: 15%; "><a href="http://shenhe.cnlive.com/comments" target="_blank"></a></td><td style="text-align: center; width: 6%; ">发布 | ||
| 352 | - openadmin9@cnlive.com</td><td style="text-align: center; width: 4%; ">否</td><td style="text-align: center; width: 4%; ">否</td><td style="text-align: center; width: 5%; "><span class="btn btn-sm btn-warning">待审</span></td><td style="text-align: center; width: 8%; ">2018-11-28 14:25:00</td><td style="text-align: center; width: 22%; "><a class="claim" href="javascript:void(0)"><button class="btn btn-default btn-sm" disabled="disabled">认领</button></a><span> </span><a class="detail" href="javascript:void(0)"><button class="btn btn-info btn-sm">查看</button></a><span> </span><a class="back" href="javascript:void(0)"><button class="btn btn-danger btn-sm" data-toggle="modal" data-target="#modal">退领</button></a><br><br><span style="margin-right:50px;"> </span><a class="pass_one" href="javascript:void(0)"><button class="btn btn-success btn-sm">通过</button></a><span> </span><a class="failed_one" href="javascript:void(0)"><button class="btn btn-danger btn-sm">拒绝</button></a></td></tr></tbody></table></div><div class="fixed-table-footer" style="display: none;"><table><tbody><tr></tr></tbody></table></div><div class="fixed-table-pagination" style="display: block;"><div class="pull-left pagination-detail"><span class="pagination-info">显示第 1 到第 2 条记录,总共 2 条记录</span><span class="page-list" style="display: none;">每页显示 <span class="btn-group dropup"><button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="page-size">20</span> <span class="caret"></span></button><ul class="dropdown-menu" role="menu"><li><a href="javascript:void(0)">10</a></li></ul></span> 条记录</span></div><div class="pull-right pagination" style="display: none;"><ul class="pagination"><li class="page-pre"><a href="javascript:void(0)">‹</a></li><li class="page-number active"><a href="javascript:void(0)">1</a></li><li class="page-next"><a href="javascript:void(0)">›</a></li></ul></div></div></div></div><div class="clearfix"></div> | 323 | + <div class="clearfix"></div> |
| 353 | 324 | ||
| 354 | </div> | 325 | </div> |
| 355 | </div> | 326 | </div> |
| 356 | </div> | 327 | </div> |
| 357 | </div> | 328 | </div> |
| 358 | - <!-- <div class="btn-group margin-bottom" id="hide_select_area"> --> | ||
| 359 | 329 | ||
| 360 | - <!-- <button type="button" class="btn btn-sm margin-r-5" | ||
| 361 | - id="select_all">全选 | ||
| 362 | - </button> | ||
| 363 | 330 | ||
| 364 | - <button type="button" class="btn btn-sm margin-r-5" | ||
| 365 | - id="no_select_all">反选 | ||
| 366 | - </button> | ||
| 367 | - <button type="button" class="btn btn-sm margin-r-5" | ||
| 368 | - id="delete_all">清除 | ||
| 369 | - </button> --> | ||
| 370 | 331 | ||
| 371 | - | ||
| 372 | - <!-- </div> --> | ||
| 373 | </section><!-- /.content --> | 332 | </section><!-- /.content --> |
| 374 | </div> | 333 | </div> |
| 375 | <!-- /.content-wrapper --> | 334 | <!-- /.content-wrapper --> |
| @@ -393,253 +352,73 @@ | @@ -393,253 +352,73 @@ | ||
| 393 | </div> | 352 | </div> |
| 394 | </div> | 353 | </div> |
| 395 | 354 | ||
| 396 | - | ||
| 397 | - <script> | ||
| 398 | - // $('#hide_select_area').hide(); | ||
| 399 | - | ||
| 400 | - /*查询字段效果*/ | ||
| 401 | - $('#comments_query').click(function () { | ||
| 402 | - $('#table').bootstrapTable('selectPage', 1); | ||
| 403 | - }); | ||
| 404 | - /*查询按钮操作*/ | ||
| 405 | - $('#table').bootstrapTable({ | ||
| 406 | - method: 'get', | ||
| 407 | - url: '/comments/table', | ||
| 408 | - pagination: true, | ||
| 409 | - pageNumber: 1, | ||
| 410 | - pageSize: 20, | ||
| 411 | - pageList: [10, 25, 50, 100], | ||
| 412 | - sidePagination: 'server', | ||
| 413 | - clickToSelect: true, | ||
| 414 | - striped: true, | ||
| 415 | - queryParams: function (params) { | ||
| 416 | - var object = $('#forms input').serializeObject(); | ||
| 417 | - object['is_hot'] = $('#is_hot').val(); | ||
| 418 | - object['state'] = $('#state').val(); | ||
| 419 | - object['_token'] = 'YnS6uzLnUDRQyeB4E2tTFbRCDmYio9gvdqwsGiu8'; | ||
| 420 | - object['offset'] = params.offset; | ||
| 421 | - object['limit'] = params.limit; | ||
| 422 | - return object; | ||
| 423 | - }, | ||
| 424 | - }); | ||
| 425 | - | ||
| 426 | - | ||
| 427 | - /*认领---操作中按钮控制*/ | ||
| 428 | - function actionFormatter(value, row, index) { | ||
| 429 | - var disabled_claim = ''; | ||
| 430 | - var disabled_passed = ''; | ||
| 431 | - var disabled_nopass = ''; | ||
| 432 | - var disabled_fail = ''; | ||
| 433 | - | ||
| 434 | - if (row.state_name == '未认领') { //如果是认领,查看和退领按钮不能用 | ||
| 435 | - switch (row.state_name) { | ||
| 436 | - case '未认领': | ||
| 437 | - disabled_claim = 'disabled="disabled"'; | ||
| 438 | - break; | ||
| 439 | - } | ||
| 440 | - return [ | ||
| 441 | - '<a class="claim" href="javascript:void(0)"><button class="btn btn-success btn-sm" >认领</button></a>', | ||
| 442 | - '<span> </span>', | ||
| 443 | - '<a class="detail" href="javascript:void(0)"><button class="btn btn-default btn-sm" ' + disabled_claim + '>查看</button></a>', | ||
| 444 | - '<span> </span>', | ||
| 445 | - '<a class="back" href="javascript:void(0)"><button class="btn btn-default btn-sm" ' + disabled_claim + ' data-toggle="modal" data-target="#modal" >退领</button></a>', | ||
| 446 | - | ||
| 447 | - ].join(''); | ||
| 448 | - | ||
| 449 | - } | ||
| 450 | - else if (row.state_name == '已认领,未审核') { //如果是未审核和已审核,则认领不能用 | ||
| 451 | - switch (row.state_name) { | ||
| 452 | - case '已认领,未审核': | ||
| 453 | - disabled_passed = 'disabled="disabled"'; | ||
| 454 | - break; | ||
| 455 | - } | ||
| 456 | - return [ | ||
| 457 | - '<a class="claim" href="javascript:void(0)"><button class="btn btn-default btn-sm" ' + disabled_passed + '>认领</button></a>', | ||
| 458 | - '<span> </span>', | ||
| 459 | - '<a class="detail" href="javascript:void(0)"><button class="btn btn-info btn-sm" >查看</button></a>', | ||
| 460 | - '<span> </span>', | ||
| 461 | - '<a class="back" href="javascript:void(0)"><button class="btn btn-danger btn-sm" data-toggle="modal" data-target="#modal" >退领</button></a>', | ||
| 462 | - '<br/>', | ||
| 463 | - '<br/>', | ||
| 464 | - '<span style="margin-right:50px;"> </span>', | ||
| 465 | - '<a class="pass_one" href="javascript:void(0)" ><button class="btn btn-success btn-sm" >通过</button></a>', | ||
| 466 | - '<span> </span>', | ||
| 467 | - '<a class="failed_one" href="javascript:void(0)"><button class="btn btn-danger btn-sm" >拒绝</button></a>', | ||
| 468 | - ].join(''); | ||
| 469 | - | ||
| 470 | - } else if (row.state_name == '我的已审核') { | ||
| 471 | - switch (row.state_name) { | ||
| 472 | - case '我的已审核': | ||
| 473 | - disabled_nopass = 'disabled="disabled"'; | ||
| 474 | - break; | 355 | + <script th:inline="javascript"> |
| 356 | + var pages = [[${param.page}]]; | ||
| 357 | + var pageNum = 1; | ||
| 358 | + var sea = location.search; | ||
| 359 | + $(function () { | ||
| 360 | + //判断除页数参数外是否还有其他参数 | ||
| 361 | + if(sea!=""){ | ||
| 362 | + if(pages!=null){ | ||
| 363 | + pageNum = pages[0]; | ||
| 475 | } | 364 | } |
| 476 | - return [ | ||
| 477 | - '<a class="claim" href="javascript:void(0)"><button class="btn btn-default btn-sm" ' + disabled_nopass + '>认领</button></a>', | ||
| 478 | - '<span style="margin-right:50px;"> </span>', | ||
| 479 | - '<a class="detail" href="javascript:void(0)"><button class="btn btn-info btn-sm" >查看</button></a>', | ||
| 480 | - '<br/>', | ||
| 481 | - '<span> </span>', | ||
| 482 | - '<br/>', | ||
| 483 | - '<a class="back" href="javascript:void(0)"><button class="btn btn-default btn-sm" ' + disabled_nopass + ' data-toggle="modal" data-target="#modal" >退领</button></a>', | ||
| 484 | - '<span style="margin-right:50px;"> </span>', | ||
| 485 | - '<a class="log" href="javascript:void(0)"><button class="btn btn-primary btn-sm" >日志</button></a>', | ||
| 486 | - ].join(''); | ||
| 487 | - } else { | ||
| 488 | - switch (row.state_name) { | ||
| 489 | - case '我的未通过': | ||
| 490 | - disabled_fail = 'disabled="disabled"'; | ||
| 491 | - break; | 365 | + //有其他参数,页脚链接加上参数 |
| 366 | + if(sea!="?page="+pageNum){ | ||
| 367 | + sea = sea.replace("page="+pageNum,"");//去掉page参数 | ||
| 368 | + $("#pageUl li a").each(function(i,e){ | ||
| 369 | + var h = $(e).attr("href"); | ||
| 370 | + if(h.indexOf("page=")>=0){ | ||
| 371 | + sea = sea.replace("?","");//去掉问号 | ||
| 372 | + if(!sea.startsWith("&"))sea = "&" + sea; | ||
| 373 | + h = h+sea; | ||
| 374 | + $(e).attr("href",h); | ||
| 375 | + }else if(h.endsWith("page")){ | ||
| 376 | + sea = sea.replace("?&","?"); | ||
| 377 | + h = h+sea; | ||
| 378 | + $(e).attr("href",h); | ||
| 379 | + } | ||
| 380 | + }) | ||
| 492 | } | 381 | } |
| 493 | - return [ | ||
| 494 | - '<a class="claim" href="javascript:void(0)"><button class="btn btn-default btn-sm" ' + disabled_fail + '>认领</button></a>', | ||
| 495 | - '<span style="margin-right:50px;"> </span>', | ||
| 496 | - '<a class="detail" href="javascript:void(0)"><button class="btn btn-info btn-sm" >查看</button></a>', | ||
| 497 | - '<br/>', | ||
| 498 | - '<span> </span>', | ||
| 499 | - '<br/>', | ||
| 500 | - '<a class="back" href="javascript:void(0)"><button class="btn btn-default btn-sm" ' + disabled_fail + ' data-toggle="modal" data-target="#modal" >退领</button></a>', | ||
| 501 | - '<span style="margin-right:50px;"> </span>', | ||
| 502 | - '<a class="log" href="javascript:void(0)"><button class="btn btn-primary btn-sm" >日志</button></a>', | ||
| 503 | - | ||
| 504 | - ].join(''); | ||
| 505 | - } | ||
| 506 | - } | ||
| 507 | - | ||
| 508 | - $("#modal_remove").click(function () { | ||
| 509 | - var row_id = $(this).data('id'); | ||
| 510 | - | ||
| 511 | - if (typeof(row_id) == "undefined") { | ||
| 512 | - return false; | ||
| 513 | } | 382 | } |
| 514 | -// $(".back").each(function(){ | ||
| 515 | - var rows = $('#table').bootstrapTable('getSelections'); | ||
| 516 | - if (rows[0].state_name == '已审核') { | ||
| 517 | - $(this).attr('disabled', 'disabled'); | ||
| 518 | - alert('未审核的不能退领!'); | ||
| 519 | - return false; | ||
| 520 | - } | ||
| 521 | -// }); | ||
| 522 | - | ||
| 523 | - $.ajax({ | ||
| 524 | - type: 'get', | ||
| 525 | - data: {'_token': 'YnS6uzLnUDRQyeB4E2tTFbRCDmYio9gvdqwsGiu8'}, | ||
| 526 | - url: '/comments/back/' + row_id, | ||
| 527 | - success: function (data) { | ||
| 528 | - window.location.href = '/comments'; | ||
| 529 | - } | ||
| 530 | - }); | ||
| 531 | - }); | ||
| 532 | - | ||
| 533 | - | ||
| 534 | - // $('#modal').modal('hide'); | ||
| 535 | - $('#modal').on('hide.bs.modal', function (event) { | ||
| 536 | - | ||
| 537 | - }); | ||
| 538 | - | ||
| 539 | - /*操作按钮的点击事件*/ | ||
| 540 | - window.actionEvents = { | ||
| 541 | - 'click .claim': function (e, value, row, index) { | ||
| 542 | - var state = 2; | ||
| 543 | - $.ajax({ | ||
| 544 | - type: 'get', | ||
| 545 | - data: {'_token': 'YnS6uzLnUDRQyeB4E2tTFbRCDmYio9gvdqwsGiu8'}, | ||
| 546 | - url: '/comments/claim/' + row.id, | ||
| 547 | - success: function (data) { | ||
| 548 | - if (data['status_code'] == 403) { | ||
| 549 | - window.location.href = '/comments' + '?state=' + 1; | ||
| 550 | - } else { | ||
| 551 | - window.location.href = '/comments' + '?state=' + state; | ||
| 552 | - } | 383 | + }) |
| 384 | + | ||
| 385 | + function searchStatus(commentStatus){ | ||
| 386 | + var href = location.href; | ||
| 387 | + if(sea==""){//没有参数 | ||
| 388 | + if(href.endsWith("?"))href = href.substring(0,href.length-1); | ||
| 389 | + href = href+"?state="+commentStatus; | ||
| 390 | + }else if(sea.indexOf("state=")<0){//没有参数state | ||
| 391 | + if(sea.indexOf("page=")>=0){//有参数page,去掉 | ||
| 392 | + var se = sea.replace("?","");//去掉问号,防止问号和要去掉的参数相连 | ||
| 393 | + var split = se.split("&"); | ||
| 394 | + var h = ""; | ||
| 395 | + for (var i = 0; i < split.length; i++) { | ||
| 396 | + var s = split[i]; | ||
| 397 | + if(s.indexOf("page=")<0) h = h+"&"+split[i]; | ||
| 553 | } | 398 | } |
| 554 | - }); | ||
| 555 | - }, | ||
| 556 | - 'click .detail': function (e, value, row, index) { | ||
| 557 | - var state = form_state; | ||
| 558 | - window.location.href = '/comments/detail/' + row.id + '?state=' + state; | ||
| 559 | - }, | ||
| 560 | - | ||
| 561 | - 'click .back': function (e, value, row, index) { | ||
| 562 | - remove_open = true; | ||
| 563 | - $('#msg').html('您确认要退领该条评论信息吗?'); | ||
| 564 | - $('#modal_remove').show(); | ||
| 565 | - $('#modal_remove').data('id', row.id); | ||
| 566 | - }, | ||
| 567 | - 'click .log': function (e, value, row, index) { | ||
| 568 | - var act_id = row.activity_id; | ||
| 569 | - $.ajax({ | ||
| 570 | - type: 'get', | ||
| 571 | - data: {'_token': 'YnS6uzLnUDRQyeB4E2tTFbRCDmYio9gvdqwsGiu8', 'act_id': act_id}, | ||
| 572 | - url: '/comments/get_msg/', | ||
| 573 | - success: function (data) { | ||
| 574 | - if (data['status_code'] == 200) { | ||
| 575 | - var msg = eval("(" + data['data'] + ")") | ||
| 576 | - console.log(msg) | ||
| 577 | - if (msg == '') { | ||
| 578 | - alert('没有审核记录'); | ||
| 579 | - return false; | ||
| 580 | - } else { | ||
| 581 | - alert(msg); | ||
| 582 | - } | ||
| 583 | - } | ||
| 584 | - } | ||
| 585 | - }); | ||
| 586 | - // $('#msg').html('操作日志:'+ act_id ); | ||
| 587 | - // $('#modal_remove').show(); | ||
| 588 | - // $('#modal_remove').data('id', row.id); | ||
| 589 | - }, | ||
| 590 | - | ||
| 591 | - 'click .pass_one': function (e, value, row, index) { | ||
| 592 | - //var row_id = $("#comment_id").val(); | ||
| 593 | - var attr_tags = '';//获取标签属性信息 | ||
| 594 | - var msg = '首页-单条通过-操作'; //获取审核msg | ||
| 595 | - | ||
| 596 | - var state = form_state; | ||
| 597 | - $.ajax({ | ||
| 598 | - type: 'get', | ||
| 599 | - data: {'_token': 'YnS6uzLnUDRQyeB4E2tTFbRCDmYio9gvdqwsGiu8', 'attr_tags': attr_tags, 'msg': msg}, | ||
| 600 | - url: '/comments/pass/' + row.id, | ||
| 601 | - success: function (data) { | ||
| 602 | - window.location.href = '/comments' + '?state=' + form_state; | ||
| 603 | - } | ||
| 604 | - }); | ||
| 605 | - }, | ||
| 606 | - 'click .failed_one': function (e, value, row, index) { | ||
| 607 | - //拒绝弹出框 | ||
| 608 | - $('#msg2').html('您确认要拒绝该条评论信息吗?'); | ||
| 609 | - $('#action_note').show(); | ||
| 610 | - $("#action_note_type").val('failed_one'); | ||
| 611 | - $("#action_note_id").val(row.id); | ||
| 612 | - | ||
| 613 | - }, | ||
| 614 | - | ||
| 615 | - }; | ||
| 616 | - //弹出框取消 | ||
| 617 | - $("#action_note_no").click(function () { | ||
| 618 | - $("#action_note").hide(); | ||
| 619 | - }); | ||
| 620 | - //弹出框确认 | ||
| 621 | - $("#action_note_yes").click(function () { | ||
| 622 | - var action_note_type = $("#action_note_type").val(); | ||
| 623 | - var id = $("#action_note_id").val(); | ||
| 624 | - if (action_note_type == 'failed_one') { | ||
| 625 | - //var row_id = $("#comment_id").val(); | ||
| 626 | - var attr_tags = '';//获取标签属性信息 | ||
| 627 | - var msg = '首页-单条拒绝-操作'; //获取审核msg | ||
| 628 | - var state = form_state; | ||
| 629 | - $.ajax({ | ||
| 630 | - type: 'get', | ||
| 631 | - data: {'_token': 'YnS6uzLnUDRQyeB4E2tTFbRCDmYio9gvdqwsGiu8', 'attr_tags': attr_tags, 'msg': msg}, | ||
| 632 | - url: '/comments/reject/' + id, | ||
| 633 | - success: function (data) { | ||
| 634 | - window.location.href = '/comments' + '?state=' + form_state; | 399 | + se = h.substring(1); |
| 400 | + } | ||
| 401 | + href = location.origin+location.pathname+"?"+se+"&state="+commentStatus; | ||
| 402 | + }else{//有参数state | ||
| 403 | + if(href.indexOf("&")>=0){//有其他参数,去掉page和旧的state | ||
| 404 | + var se = sea.replace("?","");//去掉问号 | ||
| 405 | + var split = se.split("&"); | ||
| 406 | + var h = ""; | ||
| 407 | + for (var i = 0; i < split.length; i++) { | ||
| 408 | + var s = split[i]; | ||
| 409 | + if(s.indexOf("state=")<0&&s.indexOf("page=")<0) h = h+"&"+split[i]; | ||
| 635 | } | 410 | } |
| 636 | - }); | 411 | + href =location.origin+location.pathname+"?"+ h.substring(1); |
| 412 | + }else{//只有state参数,直接拼接链接 | ||
| 413 | + href = location.origin+location.pathname+"?state="+commentStatus; | ||
| 414 | + } | ||
| 637 | } | 415 | } |
| 416 | + location.href = href; | ||
| 417 | + } | ||
| 638 | 418 | ||
| 639 | - }); | ||
| 640 | - //关闭 | ||
| 641 | - $('#close').click(function () { | ||
| 642 | - $('.action_note').attr('display', 'none'); | 419 | + /*查询字段效果*/ |
| 420 | + $('#comments_query').click(function () { | ||
| 421 | + $('#table').bootstrapTable('selectPage', 1); | ||
| 643 | }); | 422 | }); |
| 644 | 423 | ||
| 645 | 424 | ||
| @@ -679,34 +458,6 @@ | @@ -679,34 +458,6 @@ | ||
| 679 | } | 458 | } |
| 680 | 459 | ||
| 681 | 460 | ||
| 682 | - /** | ||
| 683 | - * js截取字符串,中英文都能用 | ||
| 684 | - * @param str:需要截取的字符串 | ||
| 685 | - * @param len: 需要截取的长度 | ||
| 686 | - */ | ||
| 687 | - function cutstr(str, len) { | ||
| 688 | - var str_length = 0; | ||
| 689 | - var str_len = 0; | ||
| 690 | - str_cut = new String(); | ||
| 691 | - str_len = str.length; | ||
| 692 | - for (var i = 0; i < str_len; i++) { | ||
| 693 | - a = str.charAt(i); | ||
| 694 | - str_length++; | ||
| 695 | - if (escape(a).length > 4) { | ||
| 696 | - //中文字符的长度经编码之后大于4 | ||
| 697 | - str_length++; | ||
| 698 | - } | ||
| 699 | - str_cut = str_cut.concat(a); | ||
| 700 | - if (str_length >= len) { | ||
| 701 | - str_cut = str_cut.concat("..."); | ||
| 702 | - return str_cut; | ||
| 703 | - } | ||
| 704 | - } | ||
| 705 | - //如果给定字符串小于指定长度,则返回源字符串; | ||
| 706 | - if (str_length < len) { | ||
| 707 | - return str; | ||
| 708 | - } | ||
| 709 | - } | ||
| 710 | 461 | ||
| 711 | function contentFormatter(value, row, index) { | 462 | function contentFormatter(value, row, index) { |
| 712 | var shot_content = cutstr(row.content, 100); | 463 | var shot_content = cutstr(row.content, 100); |
| @@ -717,12 +468,12 @@ | @@ -717,12 +468,12 @@ | ||
| 717 | var f_str = s_str = ''; | 468 | var f_str = s_str = ''; |
| 718 | for (var i = 0; i < full_content.length; i++) { | 469 | for (var i = 0; i < full_content.length; i++) { |
| 719 | f_str += full_content.charAt(i); | 470 | f_str += full_content.charAt(i); |
| 720 | - if(i % 10 == 0 && i > 0){ | 471 | + if (i % 10 == 0 && i > 0) { |
| 721 | f_str += " "; | 472 | f_str += " "; |
| 722 | } | 473 | } |
| 723 | 474 | ||
| 724 | s_str += shot_content.charAt(i); | 475 | s_str += shot_content.charAt(i); |
| 725 | - if(i % 10 == 0 && i > 0){ | 476 | + if (i % 10 == 0 && i > 0) { |
| 726 | s_str += " "; | 477 | s_str += " "; |
| 727 | } | 478 | } |
| 728 | 479 | ||
| @@ -732,86 +483,28 @@ | @@ -732,86 +483,28 @@ | ||
| 732 | ] | 483 | ] |
| 733 | } | 484 | } |
| 734 | 485 | ||
| 735 | - //全选 | ||
| 736 | - // $("#select_all").click(function(){ | ||
| 737 | - | ||
| 738 | - // //$("input[name='btSelectItem']").attr("checked","true"); | ||
| 739 | - // // $("[name=btSelectItem]:checkbox").each(function(){ //遍历每一个复选框 | ||
| 740 | - // // //$(this).attr("checked",!$(this).attr("checked")); //jQuery方法取复选框的反向值 | ||
| 741 | - // // this.checked=true; //js方法 | ||
| 742 | - // // }); | ||
| 743 | - // $("#select_all_button").trigger("click"); | ||
| 744 | - | ||
| 745 | - | ||
| 746 | - // }); | ||
| 747 | /*全选的操作*/ | 486 | /*全选的操作*/ |
| 748 | $('#select_all').click(function () { | 487 | $('#select_all').click(function () { |
| 749 | 488 | ||
| 750 | $("[name=btSelectItem]:checkbox").each(function () { | 489 | $("[name=btSelectItem]:checkbox").each(function () { |
| 751 | $(this).prop('checked', true); | 490 | $(this).prop('checked', true); |
| 752 | - //$(this).addClass('checked_input'); | ||
| 753 | - | ||
| 754 | }); | 491 | }); |
| 755 | - //$("#select_all_button").trigger('click'); | ||
| 756 | - | ||
| 757 | - | ||
| 758 | }); | 492 | }); |
| 759 | //反选 | 493 | //反选 |
| 760 | $("#no_select_all").click(function () { | 494 | $("#no_select_all").click(function () { |
| 761 | $("[name=btSelectItem]:checkbox").each(function () { //遍历每一个复选框 | 495 | $("[name=btSelectItem]:checkbox").each(function () { //遍历每一个复选框 |
| 762 | - //$(this).attr("checked",!$(this).attr("checked")); //jQuery方法取复选框的反向值 | ||
| 763 | - // if(!this.checked){ | ||
| 764 | - // $(this).addClass('checked_input'); | ||
| 765 | - // }else{ | ||
| 766 | - // $(this).removeClass('checked_input'); | ||
| 767 | - // } | ||
| 768 | this.checked = !this.checked; //js方法 | 496 | this.checked = !this.checked; //js方法 |
| 769 | - | ||
| 770 | - | ||
| 771 | }); | 497 | }); |
| 772 | }); | 498 | }); |
| 773 | //清除 | 499 | //清除 |
| 774 | $("#delete_all").click(function () { | 500 | $("#delete_all").click(function () { |
| 775 | $("input[name='btSelectItem']").removeAttr("checked"); | 501 | $("input[name='btSelectItem']").removeAttr("checked"); |
| 776 | - // $("[name=btSelectItem]:checkbox").each(function () { | ||
| 777 | - | ||
| 778 | - // $(this).removeClass('checked_input'); | ||
| 779 | - | ||
| 780 | - // }); | ||
| 781 | }); | 502 | }); |
| 782 | 503 | ||
| 783 | - // $("#select_all_button").click(function(){ | ||
| 784 | - | ||
| 785 | - // }); | ||
| 786 | - | ||
| 787 | - // $("input[name='btSelectItem']").click(function(){ | ||
| 788 | - // alert('od');return false; | ||
| 789 | - // if($(this).prop('checked')){ | ||
| 790 | - // $(this).addClass('checked_input'); | ||
| 791 | - // }else{ | ||
| 792 | - // $(this).removeClass('checked_input'); | ||
| 793 | - // } | ||
| 794 | - // }); | ||
| 795 | 504 | ||
| 796 | - $("#select_all_button").click(function () { | ||
| 797 | - | ||
| 798 | - //$(":checkbox").prop("checked",true); | ||
| 799 | - alert("ok"); | ||
| 800 | - | ||
| 801 | - }); | ||
| 802 | - // $("#delete_all").click(function(){ | ||
| 803 | - // $(":checkbox").prop("checked",false); | ||
| 804 | - // }); | ||
| 805 | - // $("#no_select_all").click(function(){ | ||
| 806 | - // $(":checkbox").each(function(){ | ||
| 807 | - // $(this).prop("checked",!$(this).prop("checked")); | ||
| 808 | - // }) | ||
| 809 | - // }); | ||
| 810 | 505 | ||
| 811 | $('#more_pass').click(function () { | 506 | $('#more_pass').click(function () { |
| 812 | - | ||
| 813 | var rows = $('#table').bootstrapTable('getSelections'); | 507 | var rows = $('#table').bootstrapTable('getSelections'); |
| 814 | - | ||
| 815 | if (rows.length > 0) { | 508 | if (rows.length > 0) { |
| 816 | $('#msg').html('您确认通过这<strong><span class="text-danger">' + rows.length + '</span></strong>条信息吗?'); | 509 | $('#msg').html('您确认通过这<strong><span class="text-danger">' + rows.length + '</span></strong>条信息吗?'); |
| 817 | $('#modal_remove').show(); | 510 | $('#modal_remove').show(); |
| @@ -824,9 +517,7 @@ | @@ -824,9 +517,7 @@ | ||
| 824 | }); | 517 | }); |
| 825 | 518 | ||
| 826 | $('#more_reject').click(function () { | 519 | $('#more_reject').click(function () { |
| 827 | - | ||
| 828 | var rows = $('#table').bootstrapTable('getSelections'); | 520 | var rows = $('#table').bootstrapTable('getSelections'); |
| 829 | - | ||
| 830 | if (rows.length > 0) { | 521 | if (rows.length > 0) { |
| 831 | $('#msg').html('<span style="color:red;">您确认批量拒绝这<strong><span class="text-danger">' + rows.length + '</span></strong>条信息吗?</span>'); | 522 | $('#msg').html('<span style="color:red;">您确认批量拒绝这<strong><span class="text-danger">' + rows.length + '</span></strong>条信息吗?</span>'); |
| 832 | $('#modal_remove').show(); | 523 | $('#modal_remove').show(); |
| @@ -835,27 +526,8 @@ | @@ -835,27 +526,8 @@ | ||
| 835 | $('#msg').html('请选择要拒绝的数据!'); | 526 | $('#msg').html('请选择要拒绝的数据!'); |
| 836 | $('#modal_remove').hide(); | 527 | $('#modal_remove').hide(); |
| 837 | } | 528 | } |
| 838 | - | ||
| 839 | }); | 529 | }); |
| 840 | 530 | ||
| 841 | - function faceFormatter(value, row, index) { | ||
| 842 | - var face = row.comment_user_avatar; //头像 | ||
| 843 | - if (face) { | ||
| 844 | - return [ | ||
| 845 | - '<div width="60px" height="60px">' + | ||
| 846 | - '<img src="' + face + '" width="60px" alt="用户头像">' + '</div>', | ||
| 847 | - // '<span src="+ row.face +">' + row.state_name + '</span>', | ||
| 848 | - ].join(''); | ||
| 849 | - } else { | ||
| 850 | - return [ | ||
| 851 | - '<div width="60px" height="60px">' + | ||
| 852 | - '<img src="/uploads/images/default.jpg" width="60px" alt="用户头像">' + '</div>', | ||
| 853 | - // '<span src="+ row.face +">' + row.state_name + '</span>', | ||
| 854 | - ].join(''); | ||
| 855 | - } | ||
| 856 | - | ||
| 857 | - } | ||
| 858 | - | ||
| 859 | 531 | ||
| 860 | </script> | 532 | </script> |
| 861 | <script> | 533 | <script> |
| @@ -864,7 +536,7 @@ | @@ -864,7 +536,7 @@ | ||
| 864 | }); | 536 | }); |
| 865 | </script> | 537 | </script> |
| 866 | 538 | ||
| 867 | - <footer th:replace="../templates/common/foot::foot" ></footer> | 539 | + <footer th:replace="../templates/common/foot::foot"></footer> |
| 868 | 540 | ||
| 869 | <!-- Add the sidebar's background. This div must be placed | 541 | <!-- Add the sidebar's background. This div must be placed |
| 870 | immediately after the control sidebar --> | 542 | immediately after the control sidebar --> |
| @@ -873,7 +545,6 @@ | @@ -873,7 +545,6 @@ | ||
| 873 | </div><!-- ./wrapper --> | 545 | </div><!-- ./wrapper --> |
| 874 | 546 | ||
| 875 | 547 | ||
| 876 | - | ||
| 877 | <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip --> | 548 | <!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip --> |
| 878 | <script type="text/javascript"> | 549 | <script type="text/javascript"> |
| 879 | $('div.alert').not('.alert-danger').delay(3000).slideUp(300); | 550 | $('div.alert').not('.alert-danger').delay(3000).slideUp(300); |
| @@ -885,4 +556,5 @@ | @@ -885,4 +556,5 @@ | ||
| 885 | <script src="../../static/js/sidebar.js"></script> | 556 | <script src="../../static/js/sidebar.js"></script> |
| 886 | 557 | ||
| 887 | 558 | ||
| 888 | -</body></html> | ||
| 889 | \ No newline at end of file | 559 | \ No newline at end of file |
| 560 | +</body> | ||
| 561 | +</html> | ||
| 890 | \ No newline at end of file | 562 | \ No newline at end of file |