<div ms-controller="MessageTmpl">
    <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,productStorageMenu">
                    </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">
                        <tr>
                            <td style="vertical-align: top;">
                                <div class="boxTitlenoneb">
                                    <h2>模板分类
                                    </h2>
                                    <ul id="MessageTmplTree" class='ztree' ms-widget="productCategoryTree,MessageTmplTree,MessageTmplTreeOpts" style="width: 198px; overflow: auto;"></ul>
                                    <br>
                                </div>
                            </td>
                        </tr>
                    </table>
                </td>
                <td width="10">&nbsp;</td>
                <td valign="top" style="padding-right: 5px;">
                    <div class="boxTitlenob top10">
                        <h2>模板管理
                            <span class="rseachbox">
                                <input class="input" type="text" ms-duplex="queryData.name.val" 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="8">
                                    <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="grid1.removeAll" ms-attr-title="{{lang.BtachDelBtn}}">{{lang.BtachDelBtn}}</a>
                                </td>
                            </tr>
                            <tr class="head" style="background-color: rgba(0, 0, 0, 0);">
                                <td width="5%" align="center">
                                    <input type="checkbox" ms-duplex-radio="grid1.checkall">
                                </td>
                                <td width="70%" align="center">模板标题
                                </td>
                                <td width="15%" align="center">添加时间
                                </td>
                                <td width="10%" align="center">{{lang.Operate}}
                                </td>
                            </tr>
                        </thead>
                        <tbody>
                            <tr align="center" ms-repeat-item="grid1.list">
                                <td>
                                    <input type="checkbox" ms-duplex-radio="item.checked">
                                </td>
                                <td align="left">
                                    <a href="javascript:void(0)" ms-click="doview(item.Id)">{{item.Name|truncate(50,"...")}}</a>
                                </td>
                                <td align="left">{{item.AddTime}}
                                </td>
                                <td>
                                    <a ms-attr-title="lang.ViewBtn" href="javascript:void(0)" ms-click="doview(item.Id)" class="doview"></a>
                                    <a ms-if="EDIT" ms-attr-title="lang.EditBtn" href="javascript:void(0)" ms-click="doedit(item.Id)" class="doedit"></a>
                                    <a ms-if="!EDIT" ms-attr-title="lang.EditBtn" href="javascript:void(0)" class="noedit"></a>
                                    <a ms-if="DELETE" ms-attr-title="lang.DelBtn" href="javascript:void(0)" ms-click="grid1.remove(item)" class="dodel"></a>
                                    <a ms-if="!DELETE" ms-attr-title="lang.DelBtn" href="javascript:void(0)" class="nodel"></a>
                                </td>
                            </tr>
                        </tbody>
                        <tfoot>
                            <tr>
                                <td colspan="4" ms-widget='paging,MessageTmplpage,listpaing'></td>
                            </tr>
                        </tfoot>
                    </table>

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

    <!--新增和编辑-->
    <noscript id="formTemplate">
        <div class="tabContent2">
            <table width="98%" cellspacing="2" cellpadding="0" border="0" class="commontable">
                <tbody>
                    <tr>
                        <th style="width: 70px;">模板分类：
                        </th>
                        <td style="width: 250px;">
                            <input type="text" readonly="readonly" ms-duplex="entity.Category.Name" style="width: 130px;" />
                            <button type="button" class="myfbt" id="Button2" ms-widget='dropDownPCategoryTree,MessageTmplSetTree,MessageTmplSetTreeOpts'>
                                <i class="customer"></i>
                            </button>
                            <span class="must">*</span>
                        </td>
                        <th style="width: 80px;"></th>
                        <td>
                            <p class="tip">
                                点击标签分类显示该类标签在列表中
                                <br />
                                双击具体标签会把该标签放入内容区
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <th>模板标题：
                        </th>
                        <td>
                            <input type="text" ms-duplex="entity.Name" style="width: 220px;" /><span class="must">*</span>
                        </td>
                        <th>标签分类：
                        </th>
                        <td style="vertical-align: top;">
                            <span ms-repeat-v="tables" class="label5" ms-class-1="label5-warning:curTable==v" ms-click="changeCurTable(v)">{{v}}</span>
                        </td>
                    </tr>
                    <tr>
                        <th>模板内容：</th>
                        <td>
                            <textarea ms-duplex="entity.Data" rows="2" style="height: 120px; width: 220px;"></textarea><span class="must">*</span>
                        </td>
                        <th>标签列表：</th>
                        <td>
                            <select multiple="multiple" style="height: 125px; width: 200px;">
                                <option ms-repeat-r="curFields" ms-value="r.FieldName" ms-dblclick="selectField(r)">{{r.TableName}}_{{r.FieldName}}</option>
                            </select>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </noscript>

    <!--查看-->
    <noscript id="viewTemplate">
        <div class="tabContent2">
            <table width="98%" cellspacing="1" cellpadding="2" border="0" class="tablecInfo">
                <tbody>
                    <tr>
                        <td style="width: 90px;">模板分类
                        </td>
                        <td>{{entity.Category? entity.Category.Name:""}}
                        </td>
                    </tr>
                    <tr>
                        <td>模板标题
                        </td>
                        <td>{{entity.Name}}
                        </td>
                    </tr>
                    <tr>
                        <td>模板内容
                        </td>
                        <td>{{entity.Data}}
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </noscript>
</div>
