<table border="0" align="center" cellpadding="0" cellspacing="0" id="mian" ms-controller="AdvertisingMaterials">
    <tbody>
        <tr>
            <!--leftNav-->
            <td width="198" height="450" valign="top" id="tdleft">
                <div id="left" ms-widget="leftMenu,advertisingMenu">
                </div>
                <!--End leftNav-->
            </td>
            <td valign="top" id="right" class="addrightbg">
                <div class="boxtip" id="boxtip">
                    <h1 ms-html='lang.AdvertisingMaterials'></h1>
                    <p ms-html='lang.AdvertisingMaterialsDsc'></p>
                    <a href="javascript:history.go(-1)" class="btn_back"></a>
                </div>
                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="seacrhTable" id="seacrhTable">
                    <tbody>
                        <tr>
                            <td width="440" class="searchico">
                                <div class="input-append" style="margin-bottom: 0px;">
                                    <input type="text" class="span4" ms-duplex='key' ms-attr-placeholder="lang.SearchKeyPlaceHolder" ms-keypress='toEnter'>
                                    <button class="add-on ibtsearch" style="height: 28px; font-size: 12px; padding: 3px 12px;" ms-click='toSearch' ms-html='lang.SearchBtn'></button>
                                    <button class="add-on ibtsearch" style="height: 28px; font-size: 12px; padding: 3px 12px;" ms-click="clearSearchItem" ms-html='lang.ShowAllBtn'></button>
                                </div>
                            </td>
                            <td class="fgray">{{lang.SearchHistory}}
                                <span class="bindSearchHistory" ms-each-h='searchHistory'>
                                    <a href="javascript:void(0)" ms-title='h' ms-live-click="findByHistoryKey">{{h|truncate(10)}}</a>
                                </span>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <table width="100%" border="0" cellspacing="0" cellpadding="0" class="seacrhField">
                    <tbody>
                        <tr class="bindQuick">
                            <td width="50%"><span>内容格式</span>
                                <div style="display: inline;" ms-each-f='contentFormat.items'>
                                    <a href="javascript:void(0)" ms-live-click='setCondition($index,contentFormat.items,"contentFormat")' ms-class-selected="f.curr" ms-html='f.label' data-key='contentFormat'></a>
                                </div>
                            </td>
                        </tr>
                        <tr class="bindQuick">
                            <td><span>素材类型</span>
                                <div style="display: inline;" ms-each-t='materialType.items'>
                                    <a href="javascript:void(0)" ms-live-click='setCondition($index,materialType.items,"materialType")' ms-class-selected="t.curr" ms-html='t.label' data-key='materialType'></a>
                                </div>
                            </td>
                        </tr>
                        <tr class="bindQuick">
                            <td><span>适用媒体</span>
                                <div style="display: inline;" ms-each-s='mediaType.items'>
                                    <a href="javascript:void(0)" ms-live-click='setCondition($index,mediaType.items,"mediaType")' ms-class-selected="s.curr" ms-html='s.label' data-key='mediaType'></a>
                                </div>
                            </td>
                        </tr>
                        <tr class="bindQuick">
                            <td><span>适用节庆</span>
                                <div style="display: inline;" ms-each-t='holidays.items'>
                                    <a href="javascript:void(0)" ms-live-click='setCondition($index,holidays.items,"holidays")' ms-class-selected="t.curr" ms-html='t.label' data-key='holidays'></a>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" class="seabox">
                                <span class="first" ms-html='lang.CurrSearchCondition'></span>
                                <div style="display: inline;" ms-with='currConditions'>
                                    <span class="searchItem" ms-if='$val'>{{$val}}
                                        <i><a href="javascript:void(0)" ms-click='removeItem'></a></i>
                                    </span>
                                </div>
                                <span class="last" ms-visible='hasCondition' ms-live-click='clearAllItem'><a href="javascript:void(0)" ms-html='lang.ClearAll'></a></span>
                            </td>
                        </tr>
                    </tbody>
                </table>
                <!--<div class="boxTitlenob">
                    <h2 ms-html="lang.AdvertisingMaterialsList"></h2>
                </div>-->
                <table width="100%" border="0" cellspacing="1" cellpadding="0" class="tableList bottom10" id="tableList">
                    <thead>
                        <tr class="dobtn">
                            <td colspan="10">
                                <a ms-if="ADD" href="javascript:void(0);" class="doadd" ms-html='lang.AddBtn' ms-click="showAdd"></a>
                                <a href="javascript:void(0)" ms-click="doRemoveAll" class="doalldel" ms-if="DELETE" ms-html='lang.BtachDelBtn'></a>
                            </td>
                        </tr>
                        <tr class="head">
                            <td width="3%" align="center">
                                <input type="checkbox" class="checkAll">
                            </td>
                            <td ms-html="'名称'" width="22%" align="center"></td>
                            <td ms-html="'内容格式'" width="6%" align="center"></td>
                            <td ms-html="'素材类型'" width="9%" align="center"></td>
                            <td ms-html="'适用媒体'" width="5%" align="center"></td>
                            <td ms-html="'录入人'" width="6%" align="center"></td>
                            <td ms-html="'录入时间'" width="6%" align="center"></td>
                            <td ms-html='lang.Opts' width="8%" align="center"></td>
                        </tr>
                    </thead>
                    <tbody ms-each-c='list'>
                        <tr ms-hover='hover'>
                            <td align="center">
                                <input type="checkbox" name="checkbox" ms-value="c.Id" />
                            </td>
                            <td><a href="javascript:void(0);" ms-click="showView">{{c.Name}}</a></td>
                            <td align="center">{{c.ContentFormatData}}</td>
                            <td align="center">{{c.MaterialTypeData}}</td>
                            <td align="center">{{c.MediaTypeData}}</td>
                            <td align="center">{{c.AddBy.FullName}}</td>
                            <td align="center">{{c.AddTime}}</td>
                            <td align="center">
                                <a href="javascript:void(0);" class="doview" title="查看" ms-click="showView"></a>
                                <a ms-if='c.EDIT' ms-click="showEdit" class="doedit" title="编辑" data-permission="EDIT"></a>
                                <a ms-if='!c.EDIT' href='javascript:void(0)' class='noedit' ms-title='lang.NotEdit'></a>
                                <a ms-if='c.DELETE' href="javascript:void(0)" class="dodel" title="删除" data-permission="DELETE" ms-live-click="doRemove"></a>
                                <a ms-if='!c.DELETE' href='javascript:void(0)' class='nodel' ms-title='lang.NotDelete'></a>
                            </td>
                        </tr>
                    </tbody>
                    <tbody>
                        <tr style="background-color: rgb(255, 255, 255);">
                            <td colspan="8" ms-widget='paging,listPage,listOpts'></td>
                        </tr>
                    </tbody>
                </table>
            </td>
        </tr>
    </tbody>
</table>

<!--新增-->
<noscript type="text/avalon" id="AdvertisingMaterialsformTemplate">
    <div>
        <ul class="tabWarp">
            <li ms-class-1="hover:tab=='tab1'" ms-class-2="normal:tab!='tab1'" val="tab1" ms-click="tabChange">基本信息</li>
            <li ms-class-1="hover:tab=='tab2'" ms-class-2="normal:tab!='tab2'" val="tab2" ms-click="tabChange">附件上传</li>
        </ul>
    </div>

    <div id="tab1" ms-visible="tab=='tab1'">
        <table width="100%" cellspacing="0" cellpadding="0" border="0" class="commontable shortSelect">
            <tbody>
                <tr>
                    <th style="width: 70px;">素材名称：</th>
                    <td style="">
                        <input style="width: 130px;" type="text" ms-duplex="entity.Name" />
                        <span class="must">*</span>
                    </td>
                    <th style="width: 90px;">有效时间：</th>
                    <td>
                        <input type="text" style="width: 90px;" ms-duplex="entity.StartDate" ms-widget='date,birthday,birthdayOpts' readonly="readonly" /><span>至</span>
                        <input type="text" style="width: 90px;" ms-duplex="entity.EndDate" ms-widget='date,birthday,birthdayOpts2' readonly="readonly" />
                        <span class="must">*</span>
                    </td>
                </tr>
                <tr>
                    <th>内容格式：</th>
                    <td style="height: 38px;">
                        <select ms-duplex-text="entity.ContentFormat">
                            <option ms-repeat-r="contentFormat1" ms-value="r.val" ms-text="r.label"></option>
                        </select></td>
                    <th>素材类型：</th>
                    <td style="height: 38px;">
                        <select ms-duplex-text="entity.MaterialType">
                            <option ms-repeat-r="materialType1" ms-value="r.val" ms-text="r.label"></option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <th>适用媒体：</th>
                    <td colspan="3" style="height: 38px;" ms-each-r="mediaType1">
                        <input ms-duplex="entity.MediaType" type="checkbox" ms-value="r.val" />{{r.label}}
                    </td>
                </tr>
                <tr>
                    <th>适用节庆：</th>
                    <td>

                        <select ms-duplex-text="entity.Holidays">
                            <option ms-repeat-r="holidays1" ms-value="r.val" ms-text="r.label"></option>
                        </select>
                    </td>
                    <th>尺寸规格：</th>
                    <td>
                        <input type="text" ms-duplex="entity.Specifications" style="width: 90px;" />
                        <span class="helptip"><a href="javascript:void(0)" data-toggle="tooltip" data-placement="top" title="例如：20*60">&nbsp;&nbsp; </a></span>
                    </td>
                </tr>
                <tr>
                    <th>素材说明：</th>
                    <td colspan="3">
                        <textarea rows="2" cols="20" style="height: 40px; width: 530px;" ms-duplex="entity.Description"></textarea>
                    </td>
                </tr>
                <tr>
                    <th>录入人：</th>
                    <td>{{entity.AddBy.FullName}}
                    </td>

                    <th>录入时间：</th>
                    <td>{{entity.AddTime}}
                    </td>
                </tr>
            </tbody>
        </table>
    </div>

    <div id="tab2" ms-visible="tab=='tab2'">
        <table width="100%" cellspacing="0" cellpadding="0" border="0" class="commontable shortSelect">
            <tbody>
                <tr>
                    <th style="width: 70px; height: 35px;">附件：</th>
                    <td style="" colspan="3">
                        <input style="width: 528px;" type="text" ms-duplex="entity.Path" ms-readonly="entity.UploadType==1" />
                    </td>
                </tr>
                <tr>
                    <th style="height: 40px;">上传形式：</th>
                    <td style="width: 35%;" colspan="3">
                        <input type="radio" value="1" ms-duplex-text="entity.UploadType" />本地Web上传
                        <input type="radio" value="2" ms-duplex-text="entity.UploadType" />Ftp软件上传
                        <input class="mybt" ms-if="entity.UploadType==1" type="button" ms-click="uploadFiles" ms-value="'上传文件'" />
                        <span ms-if="entity.UploadType==2" class="tipContent">请用Ftp软件上传到目录：/upload/ 下，并把文件名填写到附件框中。</span>
                    </td>
                </tr>
                <tr>
                    <th style="height: 40px;">大小：</th>
                    <td style="width: 35%;">
                        <input type="text" ms-duplex="entity.Size" readonly="readonly" />
                    </td>
                    <th style="width: 80px;">格式：</th>
                    <td>
                        <input type="text" ms-duplex="entity.FileFormat" readonly="readonly" />
                    </td>
                </tr>
                <tr>
                    <td style="height: 240px; text-align: center;" colspan="4" align="center">
                        <img ms-if="previewPath != ''" ms-src="previewPath" width="400" height="250" />
                        <span ms-if="previewPath == '' && entity.Path!=''" class="tipContent">该类型文件无法预览</span>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</noscript>

<!--查看-->
<noscript type="text/avalon" id="AdvertisingMaterialsviewTemplate">
    <table cellspacing="1" cellpadding="0" width="98%" border="0" class="tablecInfo">
        <tbody>
            <tr>
                <td>素材名称
                </td>
                <td>{{entity.Name}}
                </td>
                <td>有效时间：
                </td>
                <td>{{entity.StartDate}} 至 {{entity.EndDate}}
                </td>
            </tr>
            <tr>
                <td width="80">内容格式：
                </td>
                <td width="250">{{entity.ContentFormatData}}
                </td>
                <td width="80">素材类型：
                </td>
                <td width="250">{{entity.MaterialTypeData}}
                </td>
            </tr>
            <tr>
                <td>适用媒体：
                </td>
                <td colspan="3">{{entity.MediaTypeData}}
                </td>
            </tr>
            <tr>
                <td width="80">适用节庆：
                </td>
                <td width="250">{{entity.HolidaysData}}
                </td>
                <td width="80">尺寸规格：
                </td>
                <td width="250">{{entity.Specifications}}
                </td>
            </tr>
            <tr>
                <td valign="top">素材说明：
                </td>
                <td colspan="3" style="height: 150px;">{{entity.Description|html}}
                </td>
            </tr>
            <tr>
                <td>附件：
                </td>
                <td colspan="3">
                    <a ms-if="entity.Path !=''" ms-href="entity.Path" target="_blank">点击查看</a>
                    <span ms-if="entity.Path ==''">无附件</span>
                </td>
            </tr>
            <tr>
                <td width="80">附件大小：
                </td>
                <td width="250">{{entity.Size}}
                </td>
                <td width="80">附件格式：
                </td>
                <td width="250">{{entity.FileFormat}}
                </td>
            </tr>
            <tr>
                <td>录&nbsp;入&nbsp;人：
                </td>
                <td>{{entity.AddBy.FullName}}
                </td>
                <td>录入时间：
                </td>
                <td>{{entity.AddTime}}
                </td>
            </tr>
        </tbody>
    </table>
</noscript>
