<%@ Page Title="" Language="C#" MasterPageFile="Main.Master" AutoEventWireup="true" CodeFile="Styles.aspx.cs" Inherits="eFrameWork.Manage.Styles" %>
<%@ Register Src="GroupMenu.ascx" TagPrefix="uc1" TagName="GroupMenu" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<uc1:GroupMenu runat="server" ID="GroupMenu" />
<script>
    function select_callback() {
        if ($("input[name='selitem']:checked").length == 0) {
            $("#btn_export").hide();
        }
        else {
            $("#btn_export").show();
        }
    };
    function Styles_Import() {
        var url = "ModelImport.aspx";
        layer.open({
            type: 2,
            skin: 'layui-layer-rim', //加上边框
            title: "样式导入",
            maxmin: false,
            shadeClose: true, //点击遮罩关闭层
            area: ['600px', '300px'],
            content: url,
            success: function (layero, index) { arrLayerIndex.push(index); },
            cancel: function (index, layero) { arrLayerIndex.pop(); },
            end: function (index) { arrLayerIndex.pop(); }
        });
    };
    function Styles_ExportConfig() {
        var sels = $("input[name='selitem']:checked");
        if (sels.length == 0) {
            return;
        }
        var ids = "";
        sels.each(function (i, elem) {
            if (ids.length > 0) { ids += ","; }
            ids += elem.value;
        });       
        var url = "Styles.aspx?act=export&ajax=true&styleids=" + ids;
        window.open(url);
    };
</script>
<div class="nav">您当前位置：<a href="Default.aspx">首页</a> -> 样式管理<a id="btn_add" style="<%=(act == "" ? "" : "display:none;" )%>" class="button" href="<%=edt.getAddURL()%>"><span><i class="add">添加</i></span></a>
     <a id="btn_import" class="button" href="javascript:;" onclick="Styles_Import();"><span><i class="set">导入</i></span></a>
    <a id="btn_export" class="button" href="javascript:;" onclick="Styles_ExportConfig();" style="display:none;"><span><i class="save">导出</i></span></a>
</div>

     <div style="margin:6px;line-height:25px;font-size:13px;">
    <div class="tips" style="margin-bottom:6px;display:none;"><b>提示</b><br>...</div>
<%if (eRegisterInfo.Base == 0 && eRegisterInfo.Loaded)
  { %>   
<div class="tips" style="margin-bottom:6px;"><b>未授权提示</b><br><a href="http://frame.eketeam.com/getSerialNumber.html" style="color:#ff0000;" target="_blank">申请临时授权</a>,享更多功能。</div>
  
 <%} %>
     </div>

<%
    if (act == "add" || act == "edit" || act == "copy")
{
%>
<div style="margin:6px;">
    <asp:PlaceHolder ID="eFormControlGroup" runat="server">
	<form name="frmaddoredit" id="frmaddoredit" method="post" action="<%=edt.getSaveURL()%>">
	<input name="id" type="hidden" id="id" value="<%=edt.ID%>">
    <input name="act" type="hidden" id="act" value="save">  
	<input name="fromurl" type="hidden" id="fromurl" value="<%=edt.FromURL%>">  
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="eDataView">
    <colgroup>
<col width="120" />
<col />
<col width="120" />
<col />
</colgroup>
      <tr>
        <td class="title"><ins>*</ins>名称：</td>
        <td class="content"><span class="eform">
		 <ev:eFormControl ID="f1" Field="Name" width="600" notnull="true" fieldname="名称" runat="server" />
		</span></td>
          <td class="title"><ins>*</ins>类型：</td>
          <td class="content"><span class="eform">
		  <ev:eFormControl ID="f2" ControlType="select" Field="Type" notnull="true" DefaultValue="1" Options="[{text:电脑端,value:1},{text:移动端,value:2},{text:电脑端+移动端,value:3}]" runat="server" /> 
		  </span></td>
        </tr>
        <tr>
            <td class="title"><ins>*</ins>样式名：</td>
            <td class="content"><span class="eform">
		   <ev:eFormControl ID="f3" ControlType="text" fieldname="样式名" notnull="true" Field="cssName" htmlTag="false" runat="server" />
		   </span></td>
             <td class="title"><ins>*</ins>版本：</td>
            <td class="content"><span class="eform">
		   <ev:eFormControl ID="f4" ControlType="text" fieldname="版本" notnull="true" Field="Version" DefaultValue="1.0" htmlTag="false" runat="server" />
		   </span></td>
        </tr>
        <tr>
              <td class="title">样式：</td>
             <td class="content"><span class="eform">
		   <ev:eFormControl ID="f5" ControlType="textarea" fieldname="样式" notnull="false" Field="cssText" width="600" height="150" htmlTag="true" runat="server" />
		   </span></td>
              <td class="title">完整预览HTML：</td>
             <td class="content"><span class="eform">
		   <ev:eFormControl ID="f6" ControlType="textarea" fieldname="完整预览HTML" notnull="false" Field="viewHTML" width="600" height="150" htmlTag="true" runat="server" />
		   </span></td>
        </tr>
         <tr>
              <td class="title">开始HTML：</td>
              <td class="content"><span class="eform">
		   <ev:eFormControl ID="f7" ControlType="textarea" fieldname="开始HTML" notnull="false" Field="HeaderTemplate" width="600" height="80" htmlTag="true" runat="server" />
		   </span></td>
              <td class="title">数据项HTML：</td>
              <td class="content"><span class="eform">
		   <ev:eFormControl ID="f8" ControlType="textarea" fieldname="数据项HTML" notnull="false" Field="ItemTemplate" width="600" height="80" htmlTag="true" runat="server" />
		   </span></td>
        </tr>
        <tr>
            <td class="title">结束HTML：</td>
            <td class="content"><span class="eform">
		   <ev:eFormControl ID="f9" ControlType="textarea" fieldname="结束HTML" notnull="false" Field="FooterTemplate" width="600" height="80" htmlTag="true" runat="server" />
		   </span></td>
            <td class="title">脚本：</td>
            <td class="content"><span class="eform">
		   <ev:eFormControl ID="f10" ControlType="textarea" fieldname="脚本" notnull="false" Field="jsText" width="600" height="80" htmlTag="true" runat="server" />
		   </span></td>
        </tr>
        <tr>
            
             <td class="title"><ins>*</ins>启用：</td>
            <td class="content" colspan="3"><span class="eform">
		   <ev:eFormControl ID="f11" ControlType="radio" fieldname="启用" notnull="true" Field="Active" DefaultValue="1" Options="[{text:启用,value:1},{text:不启用,value:0}]" htmlTag="false" runat="server" />
		   </span></td>
        </tr>
  		<tr>
          
          <td class="title">说明：</td>
          <td class="content" colspan="3"><span class="eform">
		   <ev:eFormControl ID="f12" ControlType="textarea" Field="remark" width="600" height="60" htmlTag="true" runat="server" />
		   </span></td>
        </tr>
        <tr>
       <td colspan="4" class="title"  style="text-align:left;padding-left:100px;padding-top:10px;padding-bottom:10px;">		
		<a class="button" href="javascript:;" onclick="if(frmaddoredit.onsubmit()!=false){frmaddoredit.submit();}" style="display:none;"><span><i class="save">保存</i></span></a>
		<a class="button" href="javascript:;" onclick="ajaxSubmit(frmaddoredit);" style="<% =(act == "view" ? "display:none;" : "")%>"><span><i class="save">保存</i></span></a>
		<a class="button" href="javascript:;" style="margin-left:30px;" onclick="history.back();"><span><i class="back">返回</i></span></a>
		</td>
	   </tr>
	 
    </table>
	 </form>
</asp:PlaceHolder>
	 </div>
<%}else{%>
<div style="margin:6px;overflow-x:auto;overflow-y:hidden;">
<dl id="eSearchBox" class="ePanel">
<dt><h1 onclick="showPanel(this);" class="search"><a href="javascript:;" class="cur" onfocus="this.blur();"></a>搜索</h1></dt>
<dd style="display:none;">
<asp:PlaceHolder ID="eSearchControlGroup" runat="server">
<form id="frmsearch" name="frmsearch" method="post" onsubmit="return goSearch(this);" action="<%=elist.getSearchURL()%>">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="eDataView">
<colgroup>
<col width="120" />
<col />
</colgroup>
<tr>
<td class="title">名称：</td>
<td class="content"><span class="eform"><ev:eSearchControl ID="s1" Name="s1" ControlType="text" Field="Name" Operator="like" FieldName="名称" DataType="string" Width="300px" runat="server" /></span></td>
<td class="title">编号：</td>
<td class="content"><span class="eform"><ev:eSearchControl ID="s2" Name="s2" ControlType="text" Field="StyleID" Operator="like" FieldName="编号" DataType="string" Width="300px" runat="server" /></span></td>
</tr>
<tr>
<td class="title">备注：</td>
<td class="content" colspan="3"><span class="eform"><ev:eSearchControl ID="s4" Name="s4" ControlType="text" Field="remark" Operator="like" FieldName="说明" DataType="string" Width="300px" runat="server" /></span></td>
</tr>
<tr>
<td colspan="4" class="title" style="text-align:left;padding-left:125px;"><a class="button" href="javascript:;" onclick="if(frmsearch.onsubmit()!=false){frmsearch.submit();}"><span><i class="search">搜索</i></span></a></td>
</tr>
</table>
</form>
</asp:PlaceHolder>
</dd>
</dl>
<%}%>
<asp:Repeater id="Rep" runat="server">
<headertemplate>
<table id="eDataTable" class="eDataTable" border="0" cellpadding="0" cellspacing="1" width="100%">
<thead>
<tr bgcolor="#f2f2f2">
<td width="35"><input type="checkbox" name="selallitem" value="0" onclick="selectAllItems(this);"></td>
<td width="260">编号</td>
<td>名称</td>
<td>报表类型</td>
<td>预览</td>
<td>备注</td>
<td width="100">添加时间</td>
<td width="150">操作</td>
</tr>
</thead>
</headertemplate>
<itemtemplate>
<tr erowid="<%# Eval("StyleID").ToString()%>" <%# ((Container.ItemIndex+1) % 2 == 0 ? " class=\"alternating\" eclass=\"alternating\"" : " eclass=\"\"") %>>
 <td height="32"><input type="checkbox" name="selitem" value="<%# Eval("StyleID").ToString()%>"></td>
<td><a class="copy" href="javascript:;" data-clipboard-action="copy" data-clipboard-text="<%# Eval("StyleID")%>"></a><%# Eval("StyleID")%></td>
<td><%# Eval("Name")%></td>
<td><%# Eval("Type").ToString().Replace("1","电脑端").Replace("2","移动端").Replace("3","电脑端+移动端") %></td>
<td><a href="javascript:;" onclick="viewStyle('<%# Eval("StyleID").ToString()%>');">预览</a></td>
<td><%# Eval("remark").ToString()%></td>
<td><%# Eval("addTime","{0:yyyy-MM-dd}") %></td>
<td>
<a href="?act=copy&id=<%#  Eval("StyleID").ToString()%>">复制</a>
<a href="?act=edit&id=<%#  Eval("StyleID").ToString()%>">修改</a>
<a href="?act=del&id=<%#  Eval("StyleID").ToString()%>" onclick="javascript:return confirm('确认要删除吗？');">删除</a>
</td>
</tr>
</itemtemplate>
<footertemplate></table></footertemplate>
</asp:Repeater>
</div>
<div style="margin:6px;"><ev:ePageControl ID="ePageControl1" PageSize="20" PageNum="9" runat="server" /></div>
</asp:Content>