<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ModelItems_Report.aspx.cs" Inherits="eFrameWork.Manage.ModelItems_Report" %>
<%@ Import Namespace="EKETEAM.FrameWork" %>
<%@ Import Namespace="EKETEAM.Data" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
 <title><%=eConfig.manageName() %></title>
</head>
<body>

<asp:PlaceHolder ID="ControlGroup" runat="server">
<style>span.titleitem {display:inline-block;width:100px;text-align:right;line-height:28px; }
</style>

<a href="javascript:;" title="添加报表" onclick="addReport(this);" style="display:inline-block;margin-bottom:10px;width:30px;height:30px;font-size:1px;background:url(images/btn_add.png) center center no-repeat;background-size:100% 100%;">&nbsp;</a>

<div style="position:relative;">
<asp:Repeater id="Rep" runat="server" >
<itemtemplate>
<dl class="ePanel" erowid="<%#Eval("ReportID")%>">
<dt><h1 oncl3ick="showPanel(this);"><a href="javascript:;" class="cur" onfocus="this.blur();"></a><span><%# Eval("MC").ToString() %></span></h1></dt>
<dd style="displ3ay:none;">
<div>
<a title="删除列" href="javascript:;" onclick="delReport(this,'<%# Eval("ReportID") %>');"><img width="16" height="16" src="images/del.png" border="0"></a>
</div>
<span class="titleitem">名称：</span><input reload="false" class="text" type="text" value="<%# Eval("MC").ToString() %>" oldvalue="<%# Eval("MC").ToString() %>" onkeyup="setReportMC(this);" style="width:160px;" onBlur="setReport(this,'<%#Eval("ReportID") %>','mc');"><br />
<span class="titleitem">数据源：</span><select onchange="setReport(this,'<%#Eval("ReportID") %>','datasourceid');">
    <option value="NULL">主库</option>
    <%# eOleDB.getOptions("select DataSourceID,MC from a_eke_sysDataSources where delTag=0 order by addTime desc","mc","DataSourceID",Eval("DataSourceID").ToString()) %>
    </select><br />
<span class="titleitem">控件类型：</span><select onchange="setReport(this,'<%#Eval("ReportID") %>','controltype');">
<%# eBase.getReportControlType(Eval("controltype").ToString()) %>
</select><br />
<span class="titleitem">说明：</span><textarea  oldvalue="<%# Eval("SM").ToString() %>" onBlur="setReport(this,'<%#Eval("ReportID") %>','sm');"><%# Eval("sm").ToString() %></textarea><br />
<a href="ReportItems.aspx?ReportID=<%#Eval("ReportID") %>" target="_blank">详细设置</a>
</dd>
</dl>
</itemtemplate>
</asp:Repeater>
</div>
<script type="text/javascript">
    function end(obj) {
        var ids = "";
        $(".ePanel").each(function (index, node) {

            if (index > 0) { ids += ","; }
            ids += $(node).attr("erowid");
        });      
        if (ids.length == 0) { return; }
        showloading();
        var url = "?act=setreportorders&ModelID=" + ModelID + "&t=" + now();
        $.ajax({
            type: "POST", async: true,
            data: { ids: ids },
            url: url,
            dataType: "html",
            success: function (data) {
                hideloading();
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                hideloading();
            }
        });

    };
    $(function () {
        $('.ePanel').arrangeable({dragSelector: 'h1', dragEnd: end }); 
    });
</script>

</asp:PlaceHolder>
</body>
</html>
