topic.html 44.1 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 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785
<!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">
                                    <div class="btn-group margin-bottom hide" id="hide_select_area">
                                        <button type="button" class="btn btn-success btn-sm margin-r-5 action_bottom"
                                                id="more_pass">批量通过
                                        </button>
                                        <button type="button" class="btn btn-danger btn-sm margin-r-5 action_bottom"
                                                id="more_reject">批量拒绝
                                        </button>
                                    </div>

                                    <div class="btn-group margin-bottom hide" id="receive_select">
                                        <button type="button" class="btn btn-success btn-sm margin-r-5 action_bottom"
                                                onclick="receive(0);">认领
                                        </button>
                                        <button type="button" class="btn btn-success btn-sm margin-r-5 action_bottom"
                                                onclick="receive(10);">认领10条
                                        </button>
                                        <button type="button" class="btn btn-success btn-sm margin-r-5 action_bottom"
                                                onclick="receive(100);">认领100条
                                        </button>
                                        <button type="button" class="btn btn-warning btn-sm margin-r-5 action_bottom"
                                                onclick="retReceive();">退领
                                        </button>
                                        <button type="button" class="btn btn-danger btn-sm margin-r-5 action claim"
                                                value="2" data="claim1000" id="claim1000" data-toggle="modal"
                                                data-target="#modal" onclick="repulse();">拒绝
                                        </button>
                                        <button type="button" class="btn btn-success btn-sm margin-r-5 action_bottom"
                                                id="morePass" onclick="morePass();">批量通过
                                        </button>
                                    </div>

                                </div>

                                <div class="btn-group margin-bottom pull-right">
                                    <div class="btn-group margin-bottom">
                                        <button type="button" id="quanbu"
                                                class="btn btn-sm margin-r-5 action_bottom"
                                                th:onclick="'javascript:quanbu()'">查询
                                        </button>
                                        <button type="button" id="daishen"
                                                class="btn btn-sm margin-r-5 action_bottom"
                                        >全部待领
                                        </button>
                                        <button type="button" id="Mydaishen"
                                                class="btn btn-sm margin-r-5 action_bottom hide"
                                        >我的待审
                                        </button>
                                        <button type="button" id="yishen"
                                                class="btn btn-sm margin-r-5 action_bottom"
                                        >我的已审
                                        </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;float: left;">
                                <div class="btn-group margin-bottom col-md-6"
                                     style="padding: 0;width: 15%;float: left;">
                                    <div class="col-md-6" style="padding: 0;width: 100%;">
                                        <label for="topicId" class="control-label cb-toolbar">话题id:</label>
                                        <div class="col-sm-7" style="padding: 0;">
                                            <input class="form-control" type="text" th:value="${Topic_id}" value="" id="topicId"
                                                   name="topicId">
                                        </div>
                                    </div>
                                </div>

                                <div class="btn-group margin-bottom col-md-6"
                                     style="padding-left:0px;width: 13%;float: left;">
                                    <div class="col-md-5" style="padding: 0;width: 100%;">
                                        <label for="shenhe_status" class="control-label cb-toolbar">状态:</label>
                                        <div class="col-sm-7" style="padding: 0;">
                                            <select class="form-control" id="shenhe_status" name="shenhe_status">
                                                <option value="">全部</option>
                                                <option value="0" th:selected="${TopicStatus==0}">未审核</option>
                                                <option value="1" th:selected="${TopicStatus==1}">已通过</option>
                                                <option value="2" th:selected="${TopicStatus==2}">已拒绝</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="btn-group margin-bottom col-md-6"
                                     style="padding-left: 0px;width: 15%;float: left;">
                                    <div class="col-md-5" style="padding: 0;width: 100%;">
                                        <label for="topic_name" class="control-label cb-toolbar">话题标题:</label>
                                        <div class="col-sm-7" style="padding: 0;">
                                            <input class="form-control" type="text" th:value="${Topic_name}" value="" id="topic_name"
                                                   name="topic_name">
                                        </div>
                                    </div>
                                </div>
                                <div class="btn-group margin-bottom col-md-6"
                                     style="padding-left: 0px;width: 15%;float: left;">
                                    <div class="col-md-6" style="padding: 0;width: 100%;"
                                         th:if="${session.sessionUser.spid==0}">
                                        <label for="sp_desc" class="control-label cb-toolbar">sp简称:</label>
                                        <div class="col-sm-7" style="padding: 0;">
                                            <input class="form-control" type="text" th:value="${Sp_desc}" value="" id="sp_desc">
                                        </div>
                                    </div>
                                </div>
                                <div class="btn-group margin-bottom col-md-6"
                                     style="padding-left: 0px;width: 20%;float: left;">
                                    <div class="col-md-12" style="padding: 0;width: 100%;">
                                        <label for="start_date" class="control-label cb-toolbar">预计时间:</label>
                                        <div class="input-group col-md-8 date">
                                            <input class="form-control date" name="start_date" type="text"
                                                   id="start_date" th:value="${Start_date}">
                                            <span class="input-group-addon">
                                                <span class="glyphicon glyphicon-calendar"></span>
                                                </span>
                                        </div>
                                    </div>
                                </div>
                                <div class="btn-group margin-bottom col-md-6"
                                     style="padding-left: 0px;width: 18%;float: left;">
                                    <div class="col-md-9" style="padding: 0;width: 100%;">
                                        <label for="start_date" class="control-label cb-toolbar"></label>
                                        <div class="input-group col-md-8 date">
                                            <input class="form-control date" name="end_date" type="text"
                                                   id="end_date" th:value="${End_date}">
                                            <span class="input-group-addon">
                                                <span class="glyphicon glyphicon-calendar"></span>
                                                </span>
                                        </div>
                                    </div>
                                </div>
                            </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: 3%; "
                                                    data-field="topic_user_name" tabindex="0">
                                                    <div class="th-inner ">话题ID</div>
                                                    <div class="fht-cell"></div>
                                                </th>
                                                <th style="text-align: center; width: 4%; "
                                                    data-field="topic_user_name" tabindex="0">
                                                    <div class="th-inner ">sp名称</div>
                                                    <div class="fht-cell"></div>
                                                </th>
                                                <th style="text-align: center; width: 5%; " data-field="topic_user_ip"
                                                    tabindex="0">
                                                    <div class="th-inner ">话题图片</div>
                                                    <div class="fht-cell"></div>
                                                </th>
                                                <th style="text-align: center; width: 16%; "
                                                    data-field="topic_user_avatar" tabindex="0">
                                                    <div class="th-inner ">话题标题
                                                    </div>
                                                    <div class="fht-cell"></div>
                                                </th>
                                                <th style="text-align: center; width: 20%; " data-field="topic_user_ip"
                                                    tabindex="0">
                                                    <div class="th-inner ">话题描述</div>
                                                    <div class="fht-cell"></div>
                                                </th>
                                                <th style="text-align: center; width: 3%; " data-field="content"
                                                    tabindex="0">
                                                    <div class="th-inner ">审核类型
                                                    </div>
                                                    <div class="fht-cell"></div>
                                                </th>
                                                <th style="text-align: center; width: 3%; " data-field="updater"
                                                    tabindex="0">
                                                    <div class="th-inner ">审核状态</div>
                                                    <div class="fht-cell"></div>
                                                </th>
                                                <th style="text-align: center; width: 3%; " data-field="topic_title"
                                                    tabindex="0">
                                                    <div class="th-inner ">审核员
                                                    </div>
                                                    <div class="fht-cell"></div>
                                                </th>

                                                <th style="text-align: center; width: 8%; " data-field="is_hot_name"
                                                    tabindex="0">
                                                    <div class="th-inner ">审核消息</div>
                                                    <div class="fht-cell"></div>
                                                </th>
                                                <th style="text-align: center ; width: 8%; " data-field="topic_time"
                                                    tabindex="0">
                                                    <div class="th-inner ">话题创建时间</div>
                                                    <div class="fht-cell"></div>
                                                </th>
                                                <th style="text-align: center; width: 8%; " data-field="topic_time"
                                                    tabindex="0">
                                                    <div class="th-inner ">话题送审时间</div>
                                                    <div class="fht-cell"></div>
                                                </th>
                                                <th style="text-align: center; width: 6%; " data-field="action"
                                                    tabindex="0">
                                                    <div class="th-inner ">操作
                                                    </div>
                                                    <div class="fht-cell"></div>
                                                </th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr th:data-index="${topicStat.index}"
                                                th:each="topic : ${topicPage.list}">
                                                <td class="bs-checkbox "
                                                    style="text-align: center; vertical-align:middle;width: 3%;">
                                                    <input data-index="0" name="btSelectItem" type="checkbox"
                                                           th:value="${topic.id}"></td>
                                                <td style="text-align: center; vertical-align:middle;width: 3%;"
                                                    th:text="${topic.topic_id}">网加加
                                                </td>
                                                <td style="text-align: center; vertical-align:middle; width: 6%;"
                                                    th:text="${topic.sp_desc}">1083_00014
                                                </td>
                                                <td style="text-align: center;  vertical-align:middle;width: 6%;">
                                                    <div width="60px" height="60px"><img
                                                            th:src="@{${topic.topic_image}}" width="60px" height="60px"
                                                            alt="话题图片"
                                                            th:if="${topic.topic_image!=null and topic.topic_image!=''}">
                                                    </div>
                                                </td>
                                                <td style="text-align: center; vertical-align:middle; "
                                                    th:text="${topic.title}">
                                                    <!--                                                     <textarea class="form-control" name="title" cols="50" rows="3" -->
                                                    <!-- 														id="title" th:text="${topic.title}">优秀传统文化与现代幼儿教育 教师研修班</textarea> -->
                                                </td>
                                                <td style="text-align: center; vertical-align:middle; "
                                                    th:text="${topic.topic_text}">
                                                    <!--                                                     <textarea class="form-control" name="title_text" cols="50" rows="3" -->
                                                    <!-- 														id="title_text" th:text="${topic.topic_text}">优秀传统文化与现代幼儿教育 教师研修班</textarea> -->
                                                </td>
                                                <td style="text-align: center; vertical-align:middle; width: 3%;">
                                                    <span th:if="${topic.shenhe_type==1}">免审</span>
                                                    <span th:if="${topic.shenhe_type==2}">机审</span>
                                                    <span th:if="${topic.shenhe_type==3}">人工审</span>
                                                </td>
                                                <td style="text-align: center; vertical-align:middle; width: 3%;">
                                                    <span class="btn btn-sm btn-warning"
                                                          th:if="${topic.shenhe_status==0}">待审核</span>
                                                    <span class="btn btn-sm btn-success"
                                                          th:if="${topic.shenhe_status==1}">已通过</span>
                                                    <span class="btn btn-sm btn-danger"
                                                          th:if="${topic.shenhe_status==2}">已拒绝</span>
                                                </td>
                                                <td style="text-align: center; vertical-align:middle; width: 3%;"
                                                    th:text="${topic.updater}">
                                                    openadmin9@cnlive.com
                                                </td>
                                                <td style="text-align: center; vertical-align:middle; width: 10%;"
                                                    th:text="${topic.shenhe_msg}">审核消息
                                                </td>
                                                <!--                                                  <td style="text-align: center; width: 3%;"> -->
                                                <!-- 	                                                <span  th:if="${topic.offline==0}">正常</span> -->
                                                <!-- 	                                                <span  th:if="${topic.offline==1}">下线</span> -->
                                                <!--                                             	</td> -->
                                                <td style="text-align: center; vertical-align:middle; width: 8%;"
                                                    th:text="${topic.topic_time}">
                                                    2018-11-28 16:08:00
                                                </td>
                                                <td style="text-align: center; vertical-align:middle; width: 8%;"
                                                    th:text="${#dates.format(topic.create_date, 'yyyy-MM-dd HH:mm:ss')}">
                                                    2018-11-28 16:08:00
                                                </td>
                                                <td style="text-align: center; vertical-align:middle; width: 16%;">
                                                    <span> &nbsp;</span>
                                                    <a class="pass_one"
                                                       th:href="@{'javascript:topic('+${topic.id}+',1)'}">
                                                        <button class="btn btn-success btn-sm">通过</button>
                                                    </a>
                                                    <span> &nbsp;</span>
                                                    <a class="failed_one"
                                                       th:href="@{'javascript:topic('+${topic.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="'共 '+${topicPage.total}+' 条记录,每页显示'">总共 0 条记录</span>
                                            <select class="" id="pageSize" name="pageSize" onchange="selectPageSize()">
                                                <option value="10" th:selected="${pageSize==10}">10</option>
                                                <option value="20" th:selected="${pageSize==20}">20</option>
                                                <option value="50" th:selected="${pageSize==50}">50</option>
                                                <option value="100" th:selected="${pageSize==100}">100</option>
                                            </select>
                                            <span class="pagination-info">条记录</span>
                                        </div>
                                        <div class="pull-right pagination">
                                            <ul class="pagination" th:if="${topicPage.pages>1}">
                                                <li class="page-pre"><a th:href="'javascript:fanye(1);'">‹‹</a></li>
                                                <li class="page-pre" th:if="${!topicPage.isFirstPage}"><a
                                                        th:onclick="'javascript:fanye(\''+${topicPage.pageNum-1}+'\');'"></a>
                                                </li>

                                                <li class="page-number" th:if="${topicPage.pageNum-3>=1}"><a
                                                        th:onclick="'javascript:fanye(\''+${topicPage.pageNum-3}+'\');'"
                                                        th:text="${topicPage.pageNum-3}">2</a></li>
                                                <li class="page-number" th:if="${topicPage.pageNum-2>=1}"><a
                                                        th:onclick="'javascript:fanye(\''+${topicPage.pageNum-2}+'\');'"
                                                        th:text="${topicPage.pageNum-2}">2</a></li>
                                                <li class="page-number" th:if="${topicPage.pageNum-1>=1}"><a
                                                        th:onclick="'javascript:fanye(\''+${topicPage.pageNum-1}+'\');'"
                                                        th:text="${topicPage.pageNum-1}">2</a></li>
                                                <li class="page-number active"><a href="javaScript:void(0);"
                                                                                  th:text="${topicPage.pageNum}">2</a>
                                                </li>
                                                <li class="page-number" th:if="${topicPage.pageNum+1<=topicPage.pages}">
                                                    <a
                                                            th:onclick="'javascript:fanye(\''+${topicPage.pageNum+1}+'\');'"
                                                            th:text="${topicPage.pageNum+1}">2</a></li>
                                                <li class="page-number" th:if="${topicPage.pageNum+2<=topicPage.pages}">
                                                    <a
                                                            th:onclick="'javascript:fanye(\''+${topicPage.pageNum+2}+'\');'"
                                                            th:text="${topicPage.pageNum+2}">2</a></li>
                                                <li class="page-number" th:if="${topicPage.pageNum+3<=topicPage.pages}">
                                                    <a
                                                            th:onclick="'javascript:fanye(\''+${topicPage.pageNum+3}+'\');'"
                                                            th:text="${topicPage.pageNum+3}">2</a></li>

                                                <li class="page-next" th:if="${!topicPage.isLastPage}"><a
                                                        th:onclick="'javascript:fanye(\''+${topicPage.pageNum+1}+'\');'"></a>
                                                </li>
                                                <li class="page-next"><a
                                                        th:onclick="'javascript:fanye(\''+${topicPage.pages}+'\');'">››</a>
                                                </li>
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="clearfix"></div>

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


        </section><!-- /.content -->
    </div>
    <!-- /.content-wrapper -->
    <!-- 模态框(Modal) -->
    <div class="modal fade" id="msgModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <input type="hidden" id="topic_id_hidden" name="topic_id_hidden">
        <div class="modal-dialog">
            <div class="modal-content" style="margin-top: 30%;">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title" id="myModalLabel">审核意见</h4>
                </div>
                <div class="modal-body">
                    <div class="form-group" style="margin-bottom: 0;">
                        <textarea id="reviewMsg" style="width: 100%;height: 80px;"></textarea>
                    </div>
                    <div class="form-group">
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary" onclick="javascript:repulseSubmit();">提交</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
    <!-- /.modal -->
    <script th:inline="javascript">
        //      获取路径参数
        function GetQueryString(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return unescape(r[2]);
            return null;
        }

        $(function () {
            if (GetQueryString("expand_list_state") == "2") {
                $("#query").click();
            }
            //按钮颜色设置
            var state = [[${param.shenhe_status}]] ? [[${param.shenhe_status}]][0] : null;
            var receive = [[${param.receive}]] ? [[${param.receive}]][0] : null;
            var stateIsNull = $.trim(state) == "";
            var receiveIsNull = $.trim(receive) == "";
            if (receive == '0' && state != '0') {
                $("#quanbu").addClass("btn-info");
            } else if (state == '0' && receive == '0') {
                $("#daishen").addClass("btn-warning");
            } else if (state != '0' && receive == '1') {
                $("#yishen").addClass("btn-danger");
            }

        })

        //选择每页数量触发函数
        function selectPageSize() {
            var pageSize = $("#pageSize").val();
            var param = location.search;
            if (param.indexOf("pageSize=") != -1) {
                var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
                var split = se.split("&");
                var h = "";
                for (var i = 0; i < split.length; i++) {
                    var s = split[i];
                    if (s.indexOf("pageSize=") < 0 && s.indexOf("page=") < 0) h = h + "&" + split[i];
                }
                h = h.substring(1, h.length);
                window.location.href = "/topic/page?" + h +"&page=" + 1 + "&pageSize=" + pageSize;
            } else {
                var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
                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];
                }
                h = h.substring(1, h.length);
                window.location.href = "/topic/page?" + h +"&page=" + 1  + "&pageSize=" + pageSize;
            }
        }

        //翻页函数
        function fanye(page) {
            var param = location.search;
            if (param.indexOf("page=") != -1) {
                var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
                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];
                }
                h = h.substring(1, h.length);
                window.location.href = "/topic/page?" + h + "&page=" + page;
            } else {
                param = param.substring(1, param.length);
                window.location.href = "/topic/page?" + param + "&page=" + page;
            }
        }

        var topic_id = "";//话题id
        var topic_name = "";//话题标题
        var shenhe_status = "";//审核状态
        var start_date = "";//开始时间
        var end_date = "";//结束时间
        var count = "";//每页显示数量
        var sp_desc = "";//sp昵称
        var receive = "";//领取状态,用来区分是否是自己审核的内容

        function query() {
            topic_id = $("#topicId").val();
            topic_name = $("#topic_name").val();
            start_date = $("#start_date").val();
            end_date = $("#end_date").val();
            count = $("#pageSize").val();
            sp_desc = $("#sp_desc").val();
            var expand_list_state = $("#forms").attr("expand_list_state");
            window.location.href = "/topic/page?topic_id=" + topic_id + "&start_date=" + start_date + "&end_date=" + end_date + "&topic_name=" + topic_name + "&page=" + 1  + "&pageSize=" + count + "&shenhe_status=" + shenhe_status + "&receive=" + receive + "&sp_desc=" + sp_desc + "&expand_list_state=" + expand_list_state;
        }

        //全部
        function quanbu() {
            receive = 0;
            shenhe_status = $("#shenhe_status").val();
            query();
        }

        //全部待领
        $('#daishen').click(function () {
            shenhe_status = $("#shenhe_status").val();
            if ($.trim(shenhe_status) == '') shenhe_status = 0;
            receive = 0;
            query();
        });
        //我的已审核
        $('#yishen').click(function () {
            shenhe_status = $("#shenhe_status").val();
            if ($.trim(shenhe_status) == '') shenhe_status = 3;//审核状态,3代表通过和拒绝都查询
            receive = 1;
            query();
        });


        //审核操作,status=1为通过
        function topic(ids, status) {
            if (status == 1) {
                var r = confirm("您确定通过本条内容吗?");
                if (r == true) {
                    $.post("/topic/pass?ids=" + ids, function (data) {
                        if (data.errorCode == 0) {
                            alert(data.errorMessage);
                            location.href = location.href;
                        } else {
                            alert(data.errorMessage);
                        }
                    })
                }
            } else {
                var r = confirm("您确定要拒绝本条内容吗?");
                if (r == true) {
                    $('#topic_id_hidden').val(ids);
                    $('#msgModal').modal('show');
                }
            }

        }

        //提交打回
        function repulseSubmit() {
            var ids = $('#topic_id_hidden').val();
            var msg = $("#reviewMsg").val();
            if (msg == '') {
                alert('请输入审核意见!');
                return false;
            }
            $.post("/topic/refuse?ids=" + ids + "&msg=" + msg, 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();
                $("#forms").attr("expand_list_state", "1");
            } else {
                $(id_name).slideDown(350);
                $('#a_up').hide();
                $('#a_down').show();
                $("#forms").attr("expand_list_state", "2");
            }
        }

        //===========================以下未使用===============================


        /*全选的操作*/
        $('#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);
                    topic(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);
                    topic(ids, 2);
                }
            } else {
                alert("没有选中的数据!");
            }
        });

        /**
         * 认领
         */
        function receive(n) {
            if (n > 0) {
                applyReceiveNum(n);
            } else {
                var rows = $("[name=btSelectItem]:checkbox:checked");
                if (rows.length > 0) {
                    var ids = "";
                    rows.each(function (i, e) {
                        ids = ids + "," + e.value;
                    })
                    ids = ids.substring(1);
                    applyReceive(ids);
                } else {
                    alert("请选择要认领的内容!");
                }
            }
        }

        //认领选中请求
        function applyReceive(ids) {
            $.post("/topics/receive?ids=" + ids, function (data) {
                if (data.errorCode == 0) {
                    alert(data.errorMessage);
                    location.href = location.href;
                } else {
                    alert(data.errorMessage);
                }
            })
        }

        //认领多条请求
        function applyReceiveNum(num) {
            $.post("/topics/receive?num=" + num, function (data) {
                if (data.errorCode == 0) {
                    alert(data.errorMessage);
                    location.href = location.href;
                } else {
                    alert(data.errorMessage);
                }
            })
        }

        //退领选中内容
        function retReceive() {
            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);
                    applyRetReceive(ids);
                }
            } else {
                alert("没有选中的数据!");
            }
        }

        //退领
        function applyRetReceive(ids) {
            $.post("/topics/retReceive?ids=" + ids, function (data) {
                if (data.errorCode == 0) {
                    alert(data.errorMessage);
                    location.href = location.href;
                } else {
                    alert(data.errorMessage);
                }
            })
        }


        //批量提交
        function morePass() {
            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);
                    $.post("/topics/pass?ids=" + ids, function (data) {
                        if (data.errorCode == 0) {
                            alert(data.errorMessage);
                            location.href = location.href;
                        } else {
                            alert(data.errorMessage);
                        }
                    })
                }
            } else {
                alert("没有选中的数据!");
            }
        }
    </script>
    <script>
        /*时间插件*/
        $('.date').datetimepicker({
//             format: 'YYYY-MM-DD HH:mm:ss',
            format: 'YYYY-MM-DD',
            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>