<div ms-controller="brand">
    <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,brandCategoryTree,pCategoryTreeOpts" style="width: 198px; overflow: auto;"></ul>
                                    <br>
                                </div>
                            </td>
                        </tr>
                    </table>
                </td>
                <td width="10" valign="top">&nbsp;
                </td>
                <td valign="top">
                    <div class="boxTitlenob top10">
                        <h2>产品品牌
                            <span class="rseachbox">
                                <input class="input" type="text" ms-duplex="keyword" placeholder="请输入品牌名称" ms-keyup="onEnter">
                                <button type="button" class="inputbt" ms-click="doSearch"></button>
                            </span>
                        </h2>
                    </div>
                    <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tableList bottom10" id="tableList" style="margin-bottom: 1px;">
                        <thead>
                            <tr class="dobtn" style="background-color: rgba(0, 0, 0, 0);">
                                <td colspan="7">
                                    <a ms-if="ADD" class="doadd" href="javascript:void(0)" data-permission="ADD" ms-click="doadd">{{lang.AddBtn}}</a>
                                    <a ms-if="DELETE" data-permission="DELETE" href="javascript:void(0)" class="doalldel" ms-click="doalldel" ms-attr-title="{{lang.BtachDelBtn}}">{{lang.BtachDelBtn}}</a>
                                </td>
                            </tr>
                            <tr class="head" style="background-color: rgba(0, 0, 0, 0);">
                                <td width="2%" align="center">
                                    <input type="checkbox" name="checkAll">
                                </td>
                                <td width="10%" align="center">{{lang.BrandName|html}}
                                </td>
                                <td width="10%" align="center">LOGO
                                </td>
                                <td width="20%" align="center">{{lang.Supplier|html}}
                                </td>
                                <td width="10%" align="center">{{lang.RelCategorg}}
                                </td>
                                <td width="20%" align="center">{{lang.BrandInfo}}
                                </td>
                                <td width="5%" align="center">{{lang.Operate}}
                                </td>
                            </tr>
                        </thead>
                        <tbody ms-each-item="brandList">
                            <tr align="center">
                                <td>
                                    <input type="checkbox" name="checkbox" ms-value="item.Id">
                                </td>
                                <td align="left">
                                    <a href="javascript:void(0)" ms-click="doview" ms-value="item.Id">{{item.Name}}</a>
                                </td>
                                <td style="padding: 2px;">
                                    <span class="logotip">
                                        <img ms-visible="item.Img" ms-attr-src="item.Img" ressrc="" width="100" height="30">
                                    </span>
                                </td>
                                <td align="left">
                                    <span class="brandtip">{{item.ProviderNames|truncate(15,"...")}}
                                    </span>
                                </td>
                                <td align="left">
                                    <span class="brandtip">{{item.CategoryNames|truncate(15,"...")}}
                                    </span>
                                </td>
                                <td align="left">{{item.Info|truncate(15,"...")}}
                                </td>
                                <td>
                                    <a data-permission="BROWSE_DATA_LIST" ms-attr-title="lang.ViewBtn" href="javascript:void(0)" ms-click="doview" ms-value="item.Id" class="doview"></a>
                                    <a ms-if="item.EDIT" ms-attr-title="lang.EditBtn" href="javascript:void(0)" ms-click="doedit" ms-value="item.Id" class="doedit"></a>
                                    <a ms-if="!item.EDIT" ms-attr-title="lang.EditBtn" href="javascript:void(0)" ms-value="item.Id" class="noedit"></a>
                                    <a ms-if="item.DELETE" ms-attr-title="lang.DelBtn" href="javascript:void(0)" ms-click="dodel" ms-value="item.Id" class="dodel" ms-attr-index="$index"></a>
                                    <a ms-if="!item.DELETE" ms-attr-title="lang.DelBtn" href="javascript:void(0)" class="nodel" ms-attr-index="$index"></a>
                                </td>
                            </tr>
                        </tbody>
                        <tfoot>
                            <tr>
                                <td colspan="7" ms-widget='paging,upaing,brandpaing'></td>
                            </tr>
                        </tfoot>
                    </table>

                </td>
            </tr>
        </tbody>
    </table>

    <!--新增和编辑-->
    <noscript type="text/avalon" id="formTemplate">
        <table width="98%" cellspacing="0" cellpadding="0" border="0" class="commontable">
            <tbody>
                <tr>
                    <td height="25" width="105" align="right">{{lang.BrandName}} ：
                    </td>
                    <td height="25" width="580" align="left" colspan="3">
                        <input type="text" style="width: 206px;" ms-duplex="entity.Name"><span class="must">*</span>
                    </td>
                </tr>
                <tr>
                    <td height="25" width="90" align="right" valign="top" style="line-height: 25px">品牌LOGO ：
                    </td>
                    <td height="25" width="200" align="left" id="bindFilesView" valign="top" colspan="3">
                        <button class="mybt" type="button" ms-click="uploadpicture">{{lang.UploadPicture}}</button>
                        <br />
                        <div ms-if="entity.Img"  style="width:120px;padding:10px;position:relative;">
                            <img ms-attr-src="entity.Img" ms-duplex="entity.Img" width="100" style="margin: 10px 0;" />
                            <a ms-click="deletePicture()" href="javascript:void(0)" class="dodel" title="移除图片" style="position:absolute;top:5px;right:0px;">&nbsp;</a>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td height="25" width="105" align="right">{{lang.RelCategorg}} ：
                    </td>
                    <td height="25" width="*" align="left" colspan="3">
                        <input type="hidden" ms-duplex="entity.CategoryIds" />
                        <input type="text" ms-duplex="entity.CategoryNames" readonly="readonly" />
                        <button type="button" class="myfbt" ms-widget="dropDownPCategoryTree,categoryTree,categoryTreeOpts"><i class="customer"></i></button>
                    </td>
                </tr>
                <tr>
                    <td height="25" width="85" align="right">{{lang.Supplier|html}} ：
                    </td>
                    <td height="25" width="*" align="left" colspan="3">
                        <input type="hidden" ms-duplex="entity.ProviderIds" />
                        <input type="text" ms-duplex="entity.ProviderNames" readonly="readonly" />
                        <button type="button" class="myfbt" ms-click="selectSuplier()"><i class="iadduser"></i></button>
                    </td>
                </tr>
                <tr>
                    <td height="25" width="105" align="right" valign="top" style="line-height: 25px">{{lang.BrandInfo}} ：
                    </td>
                    <td height="25" width="*" align="left" colspan="3">
                        <textarea ms-duplex="entity.Info" rows="2" cols="20" style="height: 80px; width: 95%;"></textarea>
                    </td>
                </tr>
                <tr>
                    <td height="25" width="105" align="right">{{lang.Sort}} ：
                    </td>
                    <td height="25" width="*" align="left" colspan="3">
                        <input ms-duplex="entity.Sort" type="text" style="width: 206px;">
                    </td>
                </tr>
            </tbody>
        </table>
    </noscript>

    <!--查看-->
    <noscript type="text/avalon" id="viewTemplate">
        <table width="98%" cellspacing="1" cellpadding="0" border="0" class="tablecInfo">
            <tbody>
                <tr>
                    <td height="25" width="105" align="right">{{lang.BrandName}} ：
                    </td>
                    <td height="25" width="580" align="left" colspan="3">{{entity.Name}}
                    </td>
                </tr>
                <tr>
                    <td height="25" width="90" align="right" valign="top" style="line-height: 25px">品牌LOGO ：
                    </td>
                    <td height="25" align="left" ivalign="top" colspan="3">
                        <img ms-if="entity.Img" ms-attr-src="entity.Img" ms-duplex="entity.Img" width="270" style="margin: 10px 0;" />
                    </td>
                </tr>
                <tr>
                    <td height="25" width="105" align="right">{{lang.RelCategorg}} ：
                    </td>
                    <td height="25" width="*" align="left" colspan="3">{{entity.CategoryNames}}
                    </td>
                </tr>
                <tr>
                    <td height="25" width="85" align="right">{{lang.Supplier|html}} ：
                    </td>
                    <td height="25" width="*" align="left" colspan="3">{{entity.ProviderNames}}
                    </td>
                </tr>
                <tr>
                    <td height="25" width="105" align="right" valign="top" style="line-height: 25px">{{lang.BrandInfo}} ：
                    </td>
                    <td height="25" width="*" align="left" colspan="3">{{entity.Info}}
                    </td>
                </tr>
                <tr>
                    <td height="25" width="105" align="right">{{lang.Sort}} ：
                    </td>
                    <td height="25" width="*" align="left" colspan="3">{{entity.Sort}}
                    </td>
                </tr>
            </tbody>
        </table>
    </noscript>
</div>
