comment.html 29 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head th:replace="../templates/common/head::head"></head>

<body class="skin-blue sidebar-mini">

<div class="wrapper">

    <div th:replace="../templates/common/frame::frame"></div>

    <div class="content-wrapper" style="min-height: 788px;">
        <section class="content-header">
            <h1>
                评论审核
            </h1>
            <ol class="breadcrumb">
                <li>首页</li>
                <li class="active">评论审核</li>
            </ol>
        </section>
        <section class="content">
            <div class="row">
                <div class="col-md-12">
                    <div class="box box-info">
                        <div class="box-body">
                            <div class="clearfix">
                                <div class="btn-group margin-bottom pull-left">
                                    <input type="hidden" name="state" id="state" value="2">
                                    <div class="btn-group margin-bottom" id="hide_select_area" style="">
                                        <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">批量通过
                                        </button>
                                        <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">批量拒绝
                                        </button>
                                    </div>

                                </div>

                                <div class="btn-group margin-bottom pull-right">
                                    <div class="btn-group margin-bottom"  style="">
                                        <button type="button" class="btn btn-info btn-sm margin-r-5 action_bottom" onclick="searchStatus('')">全部</button>
                                        <button type="button" class="btn btn-success btn-sm margin-r-5 action_bottom" onclick="searchStatus('1,2')">已审</button>
                                        <button type="button" class="btn btn-danger btn-sm margin-r-5 action_bottom"  onclick="searchStatus('0')">未审</button>
                                    </div>
                                    <button type="button" class="btn btn-primary btn-sm margin-r-5" id="query"
                                            onclick="openOrClose(&#39;forms&#39;)">高级查询
                                        <span id="a_up"></span><span id="a_down" style="display: none;"></span>
                                    </button>
                                </div>
                            </div>


                            <div class="form-horizontal form-group-sm" id="forms" style="display: none;">
                                <form id="commentForm">
                                    <input class="hide" name="state" th:value="${param.state}"/>
                                    <div class="btn-group margin-bottom col-md-6" style="padding: 0;">
                                        <div class="col-md-5" style="padding: 0">
                                            <label for="activity_id" class="control-label cb-toolbar">活动id:</label>
                                            <div class="col-sm-9" style="padding: 0;">
                                                <input class="form-control" name="activity_id" type="text" id="activity_id" th:value="${param.activity_id}">
                                            </div>
                                        </div>
                                        <div class="col-md-4" style="padding: 0">
                                            <label for="content" class="control-label cb-toolbar">内容:</label>
                                            <div class="col-sm-9" style="padding: 0;">
                                                <input class="form-control" name="content" type="text" id="content" th:value="${param.content}">
                                            </div>
                                        </div>
                                        <div class="col-md-3" style="padding: 0">
                                            <label for="is_hot" class="control-label cb-toolbar">是否热点:</label>
                                            <div class="col-sm-7" style="padding: 0;">
                                                <select class="form-control col-sm-2" id="is_hot" name="is_hot">
                                                    <option value="">全部</option>
                                                    <option value="2"></option>
                                                    <option value="1"></option>
                                                </select>
                                            </div>
                                        </div>
                                        <script th:inline="javascript">
                                            var isHot = [[${param.is_hot}]];
                                            if(isHot!=null&&isHot[0]!=""){
                                                $("#is_hot").val(isHot[0]);
                                            }
                                        </script>

                                    </div>

                                    <div class="btn-group margin-bottom col-md-6 pull-right" style="padding: 0">
                                        <div class="col-md-11" style="width: 88%;padding: 0;">
                                            <div class="col-md-6" style="padding: 0;width: 45%;">
                                                <label for="start_date" class="control-label cb-toolbar">时间:</label>
                                                <div class="input-group col-md-9 date">
                                                    <input class="form-control date" name="start_date" type="text"
                                                           id="start_date" th:value="${param.start_date}">
                                                    <span class="input-group-addon">
                    <span class="glyphicon glyphicon-calendar"></span>
                </span>
                                                </div>
                                            </div>
                                            <div class="col-md-6" style="padding: 0;width: 45%;">
                                                <label for="start_date" class="control-label cb-toolbar"></label>
                                                <div class="input-group col-md-9 date">
                                                    <input class="form-control date" name="end_date" type="text" th:value="${param.end_date}">
                                                    <span class="input-group-addon">
                     <span class="glyphicon glyphicon-calendar"></span>
                 </span>
                                                </div>
                                            </div>
                                            <div class="col-md-6" style="padding: 0;width: 2%;" >
                                                <button type="button" class="btn btn-info btn-sm" id="comments_query" onclick="javascript:$('#commentForm').submit();">查 询
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                </form>

                            </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">
                                        <table id="table" data-toggle="table"
                                               class="table  table-hover coma-base-table fixed_headers table-striped"
                                               style="word-break:break-all;">
                                            <thead>
                                            <tr>
                                                <th class="bs-checkbox " style="width: 3%; " data-field="state"
                                                    tabindex="0">
                                                    <div class="th-inner "><input name="btSelectAll" type="checkbox" id="select_all">
                                                    </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 ">用户头像
                                                    </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 ">评论内容
                                                    </div>
                                                    <div class="fht-cell"></div>
                                                </th>
                                                <th style="text-align: center; width: 15%; " data-field="comment_title"
                                                    tabindex="0">
                                                    <div class="th-inner ">原文标题
                                                    </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="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 ">状态
                                                    </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 ">操作
                                                    </div>
                                                    <div class="fht-cell"></div>
                                                </th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr th:data-index="${commentStat.index}" th:each="comment : ${commentPage.list}">
                                                <td class="bs-checkbox ">
                                                    <input data-index="0" name="btSelectItem" type="checkbox" th:value="${comment.id}"></td>
                                                <td style="text-align: center; width: 5%;" th:text="${session.sessionUser.company}">网加加</td>
                                                <td style="text-align: center; width: 5%;" th:text="${comment.comment_user_name}"></td>
                                                <td style="text-align: center; width: 6%;">
                                                    <div width="60px" height="60px"><img  th:src="@{${comment.comment_user_avatar}}" width="60px"
                                                            alt="用户头像"></div>
                                                </td>
                                                <td style="text-align: center; width: 6%;" th:text="${comment.comment_user_ip}">114.242.177.100</td>
                                                <td style="text-align: center; width: 22%;"><a th:title="${comment.comment_content}"
                                                                                                style="font-weight:bold;font-size:16px;"
                                                                                                data-toggle="tooltip"
                                                                                                data-placement="right" th:text="${comment.comment_content}">哈哈哈</a>
                                                </td>
                                                <td style="text-align: center; width: 15%;" th:text="${comment.comment_title}">
                                                </td>
                                                <td style="text-align: center; width: 6%;" th:text="${comment.auditor}">发布
                                                    openadmin9@cnlive.com
                                                </td>
                                                <td style="text-align: center; width: 4%;" th:if="${comment.is_hot==1}"></td>
                                                <td style="text-align: center; width: 4%;" th:if="${comment.is_hot==2}"></td>
                                                <td style="text-align: center; width: 4%;" th:if="${comment.is_hot!=2&&comment.is_hot!=1}">全部</td>
                                                <td style="text-align: center; width: 5%;">
                                                    <span  class="btn btn-sm btn-warning" th:if="${comment.state==0}">待审</span>
                                                    <span  class="btn btn-sm btn-success" th:if="${comment.state==1}">已审</span>
                                                    <span  class="btn btn-sm btn-danger" th:if="${comment.state==2}">拒绝</span>
                                                </td>
                                                <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>
                                                <td style="text-align: center; width: 22%;">
                                                    <a class="detail" th:href="@{'/comments/details/'+${comment.id}}">
                                                        <button class="btn btn-info btn-sm">查看</button>
                                                    </a>
                                                    <span> &nbsp;</span>
                                                    <a class="pass_one" th:href="@{'javascript:comment('+${comment.id}+',1)'}">
                                                        <button class="btn btn-success btn-sm">通过</button>
                                                    </a>
                                                    <span> &nbsp;</span>
                                                    <a class="failed_one" th:href="@{'javascript:comment('+${comment.id}+',2)'}">
                                                        <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" th:text="'共 '+${commentPage.total}+' 条记录'">总共 0 条记录</span>
                                        </div>
                                        <div class="pull-right pagination" >
                                            <ul class="pagination" th:if="${commentPage.pages>1}" id="pageUl">
                                                <li class="page-pre"><a th:href="@{'/comments/page'}">‹‹</a></li>
                                                <li class="page-pre" th:if="${!commentPage.isFirstPage}"><a th:href="@{'/comments/page?page='+${commentPage.pageNum-1}}"></a></li>

                                                <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>
                                                <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>
                                                <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>
                                                <li class="page-number active"><a href="javaScript:void(0);" th:text="${commentPage.pageNum}">2</a></li>
                                                <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>
                                                <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>
                                                <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>

                                                <li class="page-next" th:if="${!commentPage.isLastPage}"><a th:href="@{'/comments/page?page='+${commentPage.pageNum+1}}"></a></li>
                                                <li class="page-next"><a th:href="@{'/comments/page?page='+${commentPage.pages}}">››</a></li>
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="clearfix"></div>

                        </div>
                    </div>
                </div>
            </div>



        </section><!-- /.content -->
    </div>
    <!-- /.content-wrapper -->

    <script th:inline="javascript">
        var pages = [[${param.page}]];
        var pageNum = 1;
        var sea = location.search;
        $(function () {
            //判断除页数参数外是否还有其他参数
            if(sea!=""){
                if(pages!=null){
                    pageNum = pages[0];
                }
                //有其他参数,页脚链接加上参数
                if(sea!="?page="+pageNum){
                    sea = sea.replace("page="+pageNum,"");//去掉page参数
                    $("#pageUl li a").each(function(i,e){
                        var h = $(e).attr("href");
                        if(h.indexOf("page=")>=0){
                            sea = sea.replace("?","");//去掉问号
                            if(!sea.startsWith("&"))sea = "&" + sea;
                            h = h+sea;
                            $(e).attr("href",h);
                        }else if(h.endsWith("page")){
                            sea = sea.replace("?&","?");
                            h = h+sea;
                            $(e).attr("href",h);
                        }
                    })
                }
            }
        })
        //已审、未审、全部,状态切换
        function searchStatus(commentStatus){
            var href = location.href;
            if(sea==""){//没有参数
                if(href.endsWith("?"))href = href.substring(0,href.length-1);
                href = href+"?state="+commentStatus;
            }else if(sea.indexOf("state=")<0){//没有参数state
                var se = sea.replace("?","");//去掉问号,防止问号和要去掉的参数相连
                if(sea.indexOf("page=")>=0){//有参数page,去掉
                    var split = se.split("&");
                    var h = "";
                    for (var i = 0; i < split.length; i++) {
                        var s = split[i];
                        if(s.indexOf("page=")<0) h = h+"&"+split[i];
                    }
                    se = h.substring(1);
                }
                href = location.origin+location.pathname+"?"+se+"&state="+commentStatus;
            }else{//有参数state
                if(href.indexOf("&")>=0){//有其他参数,去掉page和旧的state
                    var se = sea.replace("?","");//去掉问号
                    var split = se.split("&");
                    var h = "";
                    for (var i = 0; i < split.length; i++) {
                        var s = split[i];
                        if(s.indexOf("state=")<0&&s.indexOf("page=")<0) h = h+"&"+split[i];
                    }
                    href =location.origin+location.pathname+"?"+ h.substring(1);
                }else{//只有state参数,直接拼接链接
                    href = location.origin+location.pathname+"?state="+commentStatus;
                }
            }
            location.href = href;
        }

        /*全选的操作*/
        $('#select_all').click(function () {
           if($("[name=btSelectItem]:checkbox:not(:checked)").length>0){
               $("#select_all").prop('checked', true);
               $("[name=btSelectItem]:checkbox").each(function () {
                    $(this).prop('checked', true);
                });
            }else{
               $("#select_all").prop('checked', false);
               $("[name=btSelectItem]:checkbox").each(function () {
                    $(this).prop('checked', false);
                });
            }
        });

        //批量通过
        $('#more_pass').click(function () {
            var rows = $("[name=btSelectItem]:checkbox:checked");
            if (rows.length > 0) {
                var r=confirm("您确定通过选中的"+rows.length+"条评论吗?");
                if(r==true){
                    var ids = "";
                    rows.each(function(i,e){
                        ids = ids + "," + e.value;
                    })
                    ids = ids.substring(1);
                    comment(ids,1);
                }
            } else {
               alert("没有选中的数据!");
            }

        });
        //批量拒绝
        $('#more_reject').click(function () {
            var rows = $("[name=btSelectItem]:checkbox:checked");
            if (rows.length > 0) {
                var r=confirm("您确定拒绝选中的"+rows.length+"条评论吗?");
                if(r == true){
                    var ids = "";
                    rows.each(function(i,e){
                        ids = ids + "," + e.value;
                    })
                    ids = ids.substring(1);
                    comment(ids,2);
                }
            } else {
                alert("没有选中的数据!");
            }
        });

        //审核操作,status=1为通过
        function comment(ids,status){
            if(status==1){
                $.post("/comments/pass?ids="+ids,function (data) {
                    if (data.errorCode==0){
                        alert(data.errorMessage);
                        location.href = location.href;
                    } else{
                        alert(data.errorMessage);
                    }
                })
            }else{
                $.post("/comments/refuse?ids="+ids,function (data) {
                    if (data.errorCode==0){
                        alert(data.errorMessage);
                        location.href = location.href;
                    } else{
                        alert(data.errorMessage);
                    }
                })
            }

        }
        /*查询*/
        function openOrClose(id_name_str) {
            var id_name = '#' + id_name_str;
            if ($(id_name).css('display') == 'block') {
                $(id_name).slideUp(350);
                $('#a_up').show();
                $('#a_down').hide();
            } else {
                $(id_name).slideDown(350);
                $('#a_up').hide();
                $('#a_down').show();
            }
        }
    </script>
    <script>
        /*时间插件*/
        $('.date').datetimepicker({
            format: 'YYYY-MM-DD HH:mm:ss',
            locale: "zh-CN",
            toolbarPlacement: 'bottom',
            showClear: true,
        });
        $(function () {
            $("[data-toggle='tooltip']").tooltip();
        });
    </script>

    <footer th:replace="../templates/common/foot::foot"></footer>

    <!-- Add the sidebar's background. This div must be placed
         immediately after the control sidebar -->
    <div class="control-sidebar-bg" style="position: fixed; height: auto;"></div>

</div><!-- ./wrapper -->


<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script type="text/javascript">
    $('div.alert').not('.alert-danger').delay(3000).slideUp(300);
</script>

<!-- AdminLTE App -->
<script src="../../static/js/app.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../../static/js/sidebar.js"></script>


</body>
</html>