<div ms-controller="category">
    <table border="0" align="center" cellpadding="0" cellspacing="0" id="mian">
        <tbody>
            <tr>
                <!--leftNav-->
                <td width="198" height="450" valign="top" id="tdleft" style="border-bottom: #d2d2d2 1px solid;">
                    <div id="left" ms-widget="leftMenu,productMenu">
                    </div>
                    <!--End leftNav-->
                </td>
                <td width="10">&nbsp;</td>
                <td valign="top" bgcolor="#FFFFFF" height="1" style="vertical-align: top; width: 198px;">
                    <table cellpadding="0" cellspacing="0" height="100%" class="bordergrag top10 bottom10">
                        <tr>
                            <td style="vertical-align: top;">
                                <div class="boxTitlenoneb">
                                    <h2>
                                        <a href="javascript:void(0)" ms-click="expanCategory" style="color: #016b96; float: right; margin-right: 5px; font-size: 12px; font-weight: normal;">- 收起</a>
                                        {{lang.Category}}
                                    </h2>
                                    <ul id="productCategoryTree" class='ztree' ms-widget="productCategoryTree,categoryCategoryTree,pCategoryTreeOpts" style="width: 198px; overflow: auto;"></ul>
                                    <br>
                                </div>
                            </td>
                        </tr>
                    </table>
                </td>
                <td valign="top" style="width: 10px;">&nbsp;
                </td>
                <td valign="top">
                    <div class="top10">
                        <div class="boxTitlenob">
                            <h2>产品分类
                            </h2>
                        </div>
                        <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tableList bottom10" style="margin-bottom: 1px;">
                            <thead>
                                <tr class="dobtn">
                                    <td colspan="6">
                                        <a ms-if="auth.ADD" href="javascript:void(0);" class="doadd" ms-click="doadd(0)" title="新增分类">新增</a>
                                        <a ms-if="auth.EDIT" class="dosave" href="javascript:void(0);" ms-click="categoryMoreSave">保存</a>
                                        <a ms-if="auth.DELETE" href="javascript:void(0)" class="doalldel" ms-click="doalldel">批量删除</a>
                                        <a ms-if="auth.EDIT" href="javascript:void(0)" class="shiftype" ms-click="moveCategorys">移动分类</a>
                                    </td>
                                </tr>
                                <tr class="head">
                                    <td width="3%" align="center">
                                        <input type="checkbox" class="checkAll">
                                    </td>
                                    <td width="35%" align="center">分类名称
                                    </td>
                                    <td width="17%" align="center">排序
                                    </td>
                                    <td width="35%" align="center">关联品牌</td>
                                    <td wdith="10%">操作</td>
                                </tr>
                            </thead>
                            <tbody>
                                <tr ms-repeat-item="sublist">
                                    <td align="center">
                                        <input ms-if="item.Id!=1" type="checkbox" name="checkbox" ms-value="item.Id"></td>
                                    <td ms-if-loop="$first" style="font-weight: bold; padding-left: 5px;">{{item.Name}}
                                    </td>
                                    <td ms-if-loop="!$first">
                                        <span ms-if-loop="!$last" class="treelevel2_1 treechildnode_1">&nbsp;</span>
                                        <span ms-if-loop="$last" class="treelevel2_1 treechildlastnode_1">&nbsp;</span>
                                        <span ms-if="!item.children">{{item.Name}}</span>
                                        <a href="javascript:void(0)" ms-click="getSublist(item.$model)" ms-if="item.children">{{item.Name}}</a>
                                    </td>
                                    <td style="text-align: center;">
                                        <span ms-if="item.Id!=1 && !auth.EDIT">{{item.Sort}}</span>
                                        <input ms-if="item.Id!=1 && auth.EDIT" type="text" ms-duplex="item.Sort" style="width: 60px;" />
                                    </td>
                                    <td align="center">{{item.BrandNames|truncate(15,'...')}}</td>
                                    <td>
                                        <span ms-if="item.Id!=1">
                                            <a ms-if="auth.ADD" href="javascript:void(0);" class="doadd" style="padding: 12px 10px;" title="新增子分类" ms-click="doadd(item)"></a>
                                            <a ms-if='auth.EDIT' class="doedit" ms-attr-title="lang.EditBtn" href="javascript:void(0)" ms-click="doedit(item.Id)"></a>
                                            <a ms-if='!auth.EDIT' class="noedit" ms-attr-title="lang.EditBtn" href="javascript:void(0)"></a>
                                            <a ms-if='auth.DELETE' href="javascript:void(0)" class="dodel" ms-attr-title="lang.DelBtn" ms-click="dodel(item.Id)"></a>
                                            <a ms-if='!auth.DELETE' href="javascript:void(0)" class="nodel" ms-attr-title="lang.DelBtn"></a>
                                        </span>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>

                </td>
            </tr>
        </tbody>
    </table>
    <!-- 新增或者修改-->
    <noscript id="ProductCategory">
        <table width="100%" cellspacing="0" cellpadding="0" border="0" class="commontable">
            <tr>
                <td width="90" align="right">{{lang.CategoryParent}}&nbsp;&nbsp;
                </td>
                <td align="left">
                    <input type="hidden" ms-duplex="entity.Parent.Id">
                    <input type="text" readonly="readonly" ms-duplex="entity.Parent.Name">
                    <button type="button" class="myfbt" ms-widget="dropDownPCategoryTree,parentTree,parentTreeOpts"><i class="customer"></i></button>
                </td>
            </tr>
            <tr>
                <td>{{lang.CategoryName}}&nbsp;&nbsp;
                </td>
                <td align="left">
                    <input type="text" ms-duplex="entity.Name" /><span class="must">*</span>
                </td>
            </tr>
            <tr>
                <td>{{lang.Sort}}&nbsp;&nbsp;
                </td>
                <td align="left">
                    <input type="text" ms-duplex="entity.Sort" style="width: 60px;" /><span class="must">数值越小，越排前</span>
                </td>
            </tr>
            <tr>
                <td>关联品牌：
                </td>
                <td align="left">{{entity.BrandNames|truncate(15,'...')}}
                        <span class="helptip" title="请在产品品牌那里设置"></span>
                </td>
            </tr>
        </table>
    </noscript>
    <!--转移分类-->
    <noscript id="trunCategoryTemplate">
        <table cellspacing="0" cellpadding="0" width="100%" border="0" class="commontable">
            <tr>
                <td width="100">原分类:</td>
                <td align="left">
                    <span ms-repeat-item="originalCategorys">{{item.Name}};</span>
                </td>
            </tr>
            <tr>
                <td>目标分类:</td>
                <td align="left">
                    <input type="text" readonly="readonly" ms-duplex="targetCategory.Name" />
                    <button type="button" class="myfbt" ms-widget='dropDownPCategoryTree,setTrunCategory,setTrunCategoryTreeOpts'>
                        <i class="customer"></i>
                    </button>
                </td>
            </tr>
        </table>
    </noscript>
</div>
