@using GBLab.Entities
@using GBLab.Common.Expand

@model T_Department
@{
    // 模板视图
    Layout = "~/Areas/Manage/Views/DefaultSkin/Shared_Back/_Layout_ContentBase.cshtml";

    // 权限列表
    var actions = ViewData["actions"] as Dictionary<string, string>;

    // 树形链接
    string dataTreeUrl = ViewData["dataTreeUrl"].ToString();
    string dataDepartmentTreeUrl = ViewData["dataDepartmentTreeUrl"].ToString();
}

@section Head{
}

@section JavaScript{
    @Html.Partial("~/Areas/Manage/Views/DefaultSkin/Shared_Back/_Layout_Head_Edit.cshtml")
}

    <div data-options="region:'center',border:true">
        @using (Html.BeginForm("Action_Edit_Add", "Department", new { action = "Post" }, FormMethod.Post, new { ID = "EditForm", name = "EditForm", fit = "true", style = "width:100%;height:100%;" }))
        {
            @*系统机制*@
            @Html.ValidationSummary()
            @Html.AntiForgeryToken()

            @*系统参数*@
            @Html.Hidden("IsNew", false)
            @Html.Hidden("ActionGUID", "")
            @Html.Hidden("Template", ViewData["Template"])
            @Html.Hidden("MvcMarkName", ViewData["MvcMarkName"])
            @Html.Hidden("MvcClassID", ViewData["MvcClassID"])

            @*字段隐藏*@
            @Html.HiddenFor(m => m.F_Id)
            @Html.HiddenFor(m => m.F_Guid)
            @Html.HiddenFor(m => m.F_MarkName)
            @Html.HiddenFor(m => m.F_TypeIds)
            @Html.HiddenFor(m => m.F_ItemAllCount)
            @Html.HiddenFor(m => m.F_ItemCount)
            @Html.HiddenFor(m => m.F_Tags)
            @Html.HiddenFor(m => m.F_Info)
            @Html.HiddenFor(m => m.F_SeoTitle)
            @Html.HiddenFor(m => m.F_SeoKeyWord)
            @Html.HiddenFor(m => m.F_SeoDescription)
            @Html.HiddenFor(m => m.F_Path)

            @*视图展示*@
            <div id="tabid" class="easyui-tabs" data-options="border:false,fit:true,plain:true">
                <div title="基本信息" style="padding:6px;">
                    <table class="table">
                        <tr>
                            <th class="tdright" style="width: 100px;">
                                ID GUID：<em></em>
                            </th>
                            <td colspan="5">
                                【@(Model.F_Id)】-【@(Model.F_Guid.ToString().ToUpper())】
                            </td>
                        </tr>
                        <tr style="display:none;">
                            <th class="tdright">
                                所属栏目：<em>*</em>
                            </th>
                            <td colspan="5">
                                @(Html.TextBoxFor(t => t.F_TypeId, "", new { @class = "easyui-combotree textbox", @style = "width:300px;", @required = "false", @url = dataTreeUrl }))
                                <span class="ico-Tree"></span>&nbsp;&nbsp;&nbsp;&nbsp;
                            </td>
                        </tr>
                        <tr>
                            <th class="tdright">
                                父节点：<em>*</em>
                            </th>
                            <td colspan="5">
                                @(Html.TextBoxFor(t => t.F_FatherId, "", new { @class = "easyui-combotree textbox", @style = "width:300px;", @required = "false", @url = dataDepartmentTreeUrl }))
                                <script>$(function () { $('#F_FatherId').combotree('setValues', [@(Model.F_FatherId)]); });</script>
                                <span class="ico-Tree"></span>排序：@(Html.TextBoxFor(t => t.F_SortOrder, new { Class = "easyui-numberspinner w60 ", required = "true" }))（由高 -> 低）@(Model.F_TypeId)
                            </td>
                        </tr>
                        <tr>
                            <th class="tdright">
                                名称：<em>*</em>
                            </th>
                            <td colspan="5">
                                @(Html.TextBoxFor(t => t.F_Name, new { @Class = "easyui-validatebox textbox w500 Title ", required = "true" }))
                            </td>
                        </tr>
                        <tr>
                            <th class="tdright">
                                信息状态：
                            </th>
                            <td>
                                @Html.DropDownListFor(t => t.F_MarkStatus, GBLab.Common.Helper.SelectItem.GetSelectListItem(GBLab.Common.Utils.Dictionarys.IsStatus), new { @class = "easyui-combobox", @style = "width:120px;", @editable = "false" })
                            </td>
                        </tr>
                        <tr>
                            <th class="tdright">
                                描述：<em></em>
                            </th>
                            <td colspan="5">
                                @Html.TextBoxFor(t => t.F_SubTitle, new { @class = "easyui-textbox", @data_options = "multiline:true,width:600,height:300" })
                            </td>
                        </tr>
                    </table>
                </div>

                <div title="图片信息" style="padding:6px;">
                    <table class="table">
                        <tr>
                            <th class="tdright">
                                封面：<em></em>
                            </th>
                            <td>
                                @RenderPage("~/Areas/Manage/Views/DefaultSkin/Modules/00Common/Partial/_UploadImage.cshtml", new { ImgID = "F_Logo", ImgPath = Model.F_Logo.DefaultIsNullOrEmpty("").Replace("|", ""), ThumbnailsWidth = 240, ThumbnailsHeight = 180, ImgIsMultiple = 0, IsImageInclude = true })
                            </td>
                        </tr>
                        <tr>
                            <th class="tdright">
                                图片列表：
                            </th>
                            <td>
                                @RenderPage("~/Areas/Manage/Views/DefaultSkin/Modules/00Common/Partial/_UploadImgs.cshtml", new { ImgID = "F_Imgs", ImgPath = Model.F_Imgs.DefaultIsNullOrEmpty("").Replace("|", ",") })
                            </td>
                        </tr>
                    </table>
                </div>

                <div title="附件信息" style="padding:6px;">
                    <table class="table">
                        <tr>
                            <th class="tdright" style="width: 100px;">
                                附件列表：<em></em>
                            </th>
                            <td colspan="5">
                                @RenderPage("~/Areas/Manage/Views/DefaultSkin/Modules/00Common/Partial/_UploadFiles.cshtml", new { FileID = "F_Files", FilePath = Model.F_Files.DefaultIsNullOrEmpty("").Replace("|", ",") })
                            </td>
                        </tr>
                    </table>
                </div>

                <div title="辅助信息" style="padding:6px;">
                    <table class="table">
                        <tr>
                            <th class="tdright" style="width: 100px;">
                                添加人：<em></em>
                            </th>
                            <td colspan="5">
                                @(Html.TextBox("F_AddUserId", Model.T_AddUser == null ? "" : Model.T_AddUser.F_Name, new { Class = "easyui-textbox w500" }))
                            </td>
                        </tr>
                        <tr>
                            <th class="tdright" style="width: 100px;">
                                添加日期：<em></em>
                            </th>
                            <td colspan="5">
                                @Html.TextBox("F_AddDate", Convert.ToDateTime(Model.F_AddDate).ToString("yyyy-MM-dd HH:mm:ss"), new { @class = "easyui-datetimebox textbox w160", @required = "true" })
                            </td>
                        </tr>
                        <tr>
                            <th class="tdright" style="width: 100px;">
                                更新人：<em></em>
                            </th>
                            <td colspan="5">
                                @(Html.TextBox("F_UpdateUserId", Model.T_UpdateUser == null ? "" : Model.T_UpdateUser.F_Name, new { Class = "easyui-textbox w500" }))
                            </td>
                        </tr>
                        <tr>
                            <th class="tdright" style="width: 100px;">
                                更新日期：<em></em>
                            </th>
                            <td colspan="5">
                                @Html.TextBox("F_UpdateDate", Convert.ToDateTime(Model.F_UpdateDate).ToString("yyyy-MM-dd HH:mm:ss"), new { @class = "easyui-datetimebox textbox w160", @required = "true" })
                            </td>
                        </tr>
                    </table>
                    <table class="table">
                        <tr>
                            <th class="tdright">
                                浏览次数：<em></em>
                            </th>
                            <td colspan="5">
                                @(Html.TextBoxFor(t => t.F_ViewNum, new { Class = "easyui-textbox w500" }))
                            </td>
                        </tr>
                        <tr>
                            <th class="tdright">
                                留言次数：<em></em>
                            </th>
                            <td colspan="5">
                                @(Html.TextBoxFor(t => t.F_GuestBookNum, new { Class = "easyui-textbox w500" }))
                            </td>
                        </tr>
                        <tr>
                            <th class="tdright">
                                点赞数量：<em></em>
                            </th>
                            <td colspan="5">
                                @(Html.TextBoxFor(t => t.F_GoodNum, new { Class = "easyui-textbox w500" }))
                            </td>
                        </tr>
                        <tr>
                            <th class="tdright">
                                差评数量：<em></em>
                            </th>
                            <td colspan="5">
                                @(Html.TextBoxFor(t => t.F_BadNum, new { Class = "easyui-textbox w500" }))
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        }
    </div>

@*底部操作*@
<div class="dialog-button TextCenter" data-options="region:'south',border:false">
    @if (Model.F_Id != 0)
    {
        @Html.Raw(T_FunctionAction.Get_Action_Buttons(actions["Edit"]))
    }
    else
    {
        @Html.Raw(T_FunctionAction.Get_Action_Buttons(actions["Add"]))
    }
    <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-no'" onclick="return window.parent.cancel();">取消</a>
</div>