<%@ Page Language="c#" Inherits="Web.User.auditMore" CodeBehind="auditMore.aspx.cs" %>

<%@ Register Src="~/Module/pageNavi.ascx" TagPrefix="uc1" TagName="pageNavi" %>
<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head>
    <title>投稿批量审核</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!--#include file = "../Css/head.htm" -->
</head>
<body>
    <form method="post" runat="server">
        <div class="list-func-box func-box">
            <div class="hd b">
                <!--/breadcrumb-->
                 <div class="user-service pull-right">
                    <span data-original-title="帮助" data-placement="left" data-rel="popover" data-content="此页可通过多选方式完成批量审核" data-trigger="hover"><i class="fa fa-question-circle bigger-120 white"></i></span>
                </div>
                <!--/user-service-->
            </div>
             <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
            <div class="bd">
                    <div class="action-field">
                        批量审核列表:
                    </div>
                    <asp:GridView ID="GridView1" runat="server" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="pkId" CssClass="table table-striped table-bordered table-hover table-sorting"
                         OnRowDataBound="GridView1_RowDataBound" EmptyDataText="暂时没有要审核的投稿文章" OnRowCommand="GridView1_RowCommand" OnSorting="GridView1_Sorting">
                        <Columns>
                            <asp:BoundField Visible="False" DataField="pkId" HeaderText="ID号" ></asp:BoundField>
                            <asp:TemplateField HeaderStyle-CssClass="text-center" ItemStyle-CssClass="text-center" ItemStyle-Width="36px">
                        <HeaderTemplate>
                            <asp:CheckBox ID="checkAll" Text=" " runat="server" onclick="GridSelectAll('GridView1',this.checked)" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:CheckBox ID="chk" runat="server" Text=" "></asp:CheckBox>
                        </ItemTemplate>
                    </asp:TemplateField>
                            <asp:TemplateField HeaderText="标题"  SortExpression="intactTitle"  >
                                <ItemTemplate>
                                    <asp:HyperLink ID="intactTitle" runat="server" Text='<%# Eval("intactTitle") %>'
                                        Target="_blank" NavigateUrl='<%# Eval( "pkId", "../ShwContribute.aspx?pkId={0}") %>'> 
                                    </asp:HyperLink>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="userName" HeaderText="发布人账号"  SortExpression="userName"  ></asp:BoundField>
                            <asp:TemplateField HeaderText="发布人昵称"  SortExpression="fullName"  >
                                <ItemTemplate>
                                    <span data-placement="right" data-rel="popover" data-content="<%# "发布IP："+Eval( "updateIp") %>" data-trigger="hover">
                                        <asp:Label ID="info" runat="server" Text='<%#Eval("fullName") %>'></asp:Label></span>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="发布时间" SortExpression="updateTime"  >
                                <ItemTemplate>
                                            <span data-placement="right" data-rel="popover" data-content="<%# Eval("updateTime") %>" data-trigger="hover">
                                        <asp:Label ID="lbtime" runat="server" Text='<%# Eval("updateTime", "{0:yyyy-M-d}") %>'></asp:Label></span>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="审核状态" SortExpression="state"  >
                                <ItemTemplate>
                                    <asp:DropDownList ID="state" runat="server" Visible="False">
                                    </asp:DropDownList>
                                    <asp:Label ID="LabelState" runat="server"></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <%--<asp:TemplateField HeaderText="投稿栏目" HeaderStyle-CssClass="title">
                                <ItemTemplate>
                                    <asp:Label ID="lbBCName" runat="server"></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>--%>
                            <asp:BoundField DataField="contributename" HeaderText="投稿栏目" SortExpression="contributename"  ></asp:BoundField>
                            <asp:TemplateField HeaderText="管理"  ItemStyle-CssClass="td-a">
                                <ItemTemplate>
                                    <div class="action-buttons">
                                        <asp:LinkButton ID="audit" CssClass="FBox3" runat="server" CommandName="audit" CommandArgument='<%# Eval("pkId") %>' data-toggle="tooltip" data-placement="bottom" title="审核"  Visible="false"><i class="ace-icon fa fa-check-square-o bigger-120 blue"></i></asp:LinkButton>
                                         <asp:LinkButton ID="audit1" runat="server" data-toggle="tooltip" data-placement="bottom" title="对不起，您没有权限审核！" Visible="false" Enabled="false" ><i class="ace-icon fa fa-check-square-o  grey"></i></asp:LinkButton>
                                    </div>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="state" HeaderText="状态" Visible="False" ></asp:BoundField>
                            <asp:BoundField DataField="contributeId" HeaderText="" Visible="False"></asp:BoundField>
                        </Columns>
                    </asp:GridView>
                     <div class="grid-pager">                              
                              <uc1:pageNavi runat="server" id="pageNavi"  dataCtlName="GridView1" />
                        </div>  
            </div>
            <%--<div class="ft">
                <div class="pagination">
                    <asp:Label ID="showPage" runat="server"></asp:Label>
                </div>
            </div>--%>
            <table class="edit-table" id="Table1">
                <tr>
                    <td colspan="8">
                        <div class="more-edit">
                            <div class="more-edit-fn">
                                <span class="pull-left blue">审核状态：</span>
                                <asp:RadioButtonList ID="StateRadioButtonList" CssClass="pull-left blue" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" onclick="javascript:call(4)">
                                </asp:RadioButtonList>
                            </div>
                        </div>
                    </td>
                </tr>
                <tr id="submenu1" style="display: none;">
                    <th>所属专题：
                    </th>
                    <td>
                        <asp:DropDownList ID="special1" runat="server" DataTextField="name" DataValueField="pkId" class="input-md">
                        </asp:DropDownList>
                    </td>
                    <th>部门：
                    </th>
                    <td>
                        <asp:DropDownList ID="department" runat="server" DataTextField="name" DataValueField="pkId" class="input-md">
                        </asp:DropDownList>
                    </td>
                    <th>浏览权限：
                    </th>
                    <td>
                        <asp:DropDownList ID="gate" runat="server" class="input-md">
                            <asp:ListItem Value="0">无限制</asp:ListItem>
                            <asp:ListItem Value="1">仅内网可见</asp:ListItem>
                            <asp:ListItem Value="2">仅登录可见</asp:ListItem>
                            <asp:ListItem Value="3">内网或登录可见</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <th>显示等级：
                    </th>
                    <td>
                        <asp:DropDownList ID="grade" runat="server" DataTextField="name" DataValueField="pkId" class="input-md">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr id="submenu2" style="display: none;">
                    <th>文章模板：
                    </th>
                    <td>
                        <asp:DropDownList ID="itemType" runat="server" DataTextField="name" DataValueField="pkId" class="input-md">
                        </asp:DropDownList>
                    </td>
                    <th>文章固顶：
                    </th>
                    <td>
                        <asp:DropDownList ID="SetTop" runat="server" class="input-md">
                        </asp:DropDownList>
                    </td>
                    <th>文章推荐：
                    </th>
                    <td>
                        <asp:DropDownList ID="Setrecommand" runat="server" class="input-md">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr id="submenu3" style="display: none;">
                    <th>已有批注：
                    </th>
                    <td>
                        <asp:DropDownList ID="ddlContributePostil" CssClass="input-md" runat="server" DataTextField="title" DataValueField="content" onchange="javascript:InitContributePostil(this.value)">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr id="submenu4" style="display: none;">
                    <th>投稿批注：
                    </th>
                    <td>
                        <asp:TextBox ID="RemarkTextBox" runat="server" TextMode="MultiLine" Width="550px" Height="70px"></asp:TextBox>
                    </td>
                </tr>
            </table>

            <div class="ft  text-center">
                    <asp:Button ID="save" class="btn btn-sm btn-primary" runat="server" Text="保 存" OnClientClick="return checkAll();" OnClick="save_Click"></asp:Button>
                    &nbsp;&nbsp;
                <input id="Button1" class="btn btn-sm btn-primary" type="button" value="关 闭" onclick="window.close()" />
            </div>
                        </div>
                </div>
             </div>
            <!--#include file="../Css/foot.htm"-->
            ​
    <script language="javascript" type="text/javascript">


        function openViewWin(flag) {
            //arr = window.open("viewAuditRemark.aspx?pkId="+flag +"","查看审核批注","scrollbars=yes,width=300,height=190");
            $.fancybox({
                'width': 400,
                'height': 200,
                'hideOnOverlayClick': false,
                'transitionIn': 'elastic',
                'transitionOut': 'fade',
                'type': 'iframe',
                'padding': '0',
                'href': 'viewAuditRemark.aspx?pkId=' + flag
            });
        }


        //审核状态判断
        function call(sid) {
            //        for (var i = 0; i < 4; i++) {
            //            if (document.getElementById("StateRadioButtonList_" + i).checked && document.getElementById("StateRadioButtonList_" + i).value == 1) {
            //            
            //                eval("submenu1.style.display=\"\";");
            //                eval("submenu2.style.display=\"\";");
            //                break;
            //            }
            //            else {
            //                eval("submenu1.style.display=\"none\";");
            //                eval("submenu2.style.display=\"none\";");

            //            }
            //        }

            try {
                for (var i = 0; i < 5; i++) {

                    if (document.getElementById("StateRadioButtonList_" + i).checked && document.getElementById("StateRadioButtonList_" + i).value == 1) {
                        eval("submenu1.style.display=\"\";");
                        eval("submenu2.style.display=\"\";");
                        eval("submenu3.style.display=\"none\";");
                        eval("submenu4.style.display=\"none\";");

                        break;
                    }
                    else if (document.getElementById("StateRadioButtonList_" + i).checked && (document.getElementById("StateRadioButtonList_" + i).value == 4 || document.getElementById("StateRadioButtonList_" + i).value == 3)) {

                        eval("submenu1.style.display=\"none\";");
                        eval("submenu2.style.display=\"none\";");

                        eval("submenu3.style.display=\"\";");
                        eval("submenu4.style.display=\"\";");
                        break;
                    }
                    else {

                        eval("submenu1.style.display=\"none\";");
                        eval("submenu2.style.display=\"none\";");
                        eval("submenu3.style.display=\"none\";");
                        eval("submenu4.style.display=\"none\";");

                    }
                }
            }
            catch (e) { }
        }

        //全选
        function checkall(check) {
            var theBox = check;
            xState = theBox.checked;
            elm = theBox.form.elements;
            for (i = 0; i < elm.length; i++) {
                if (elm[i].type == "checkbox" && elm[i].id != theBox.id) {
                    if (elm[i].checked != xState)
                        elm[i].click();
                }
            }
        }

        //在保存之前,验证输入是否正确；将有效日期值转换成相应的有效天数
        function checkAll() {
            //验证
            try {
                for (var i = 0; i < 5; i++) {

                    if (document.getElementById("StateRadioButtonList_" + i).checked && (document.getElementById("StateRadioButtonList_" + i).value == 4 || document.getElementById("StateRadioButtonList_" + i).value == 3)) {
                        var remarktxt = document.getElementById("<%= RemarkTextBox.ClientID%>").value;
                        if (remarktxt == "" || remarktxt == null) {
                            alert("退稿或锁定退稿时，请添加原因批注！");
                            return false;
                        }
                    }
                }
            }
            catch (e) { }
            return true;
        }
    </script>
     <script type="text/javascript" language="javascript">
                //判断页面是否加载完毕
                document.onreadystatechange = function () {
                    if (document.readyState == "complete") {
                        call(4);
                    }
                }

                function InitContributePostil(content) {
                    document.getElementById("<%= RemarkTextBox.ClientID%>").value = content;
                }
            </script>

        </div>
    </form>
</body>
</html>
