<%@ page language="C#" autoeventwireup="true" inherits="ims.detailLayout, ims.web" enableviewstatemac="false" enableEventValidation="false" %>
<!DOCTYPE html>
<html id="detailLayout">
<head runat="server">
    <title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" /><meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body class="waiting" onbeforeunload="confirmExit();">
    <div class="hide"><img src="images/loading.gif" />处理中，请稍候 …</div>
    <form id="form1" runat="server">
        <asp:ScriptManager runat="server" ID="sm" OnAsyncPostBackError="AsyncError" />
        <div id="pageTitle" runat="server" class="pageTitle"></div>
        <div class="ui-tabs noborder" id="tabs">
	        <ul>
		        <li><a href="#tableArea">表格版式</a></li>
		        <li><a href="#free">自由排版</a>
                    <asp:UpdatePanel ID="freeList" RenderMode="Inline" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
                        <ContentTemplate>：<asp:DropDownList runat="server" ID="ddlLayouts" AutoPostBack="true" OnSelectedIndexChanged="ddlLayoutsChanged" onmousedown="oriLayout=$(this).val();" onchange="return preChange();"></asp:DropDownList></ContentTemplate>
                    </asp:UpdatePanel>
		        </li>
	        </ul>
	        <div id="tableArea">
                <table id="tabLayout" class="comm pconly">
			        <tr>
				        <td class="zone" style="width:43%" runat="server" id="zone0">
                            <table><tr><td class="caption"><div class="shell"><div class="drag">➜|</div>A 区</div></td></tr></table>
                        </td>
				        <td class="zone" style="width:43%" runat="server" id="zone1">
                            <table><tr><td class="caption"><div class="shell"><div class="drag">➜|</div>B 区</div></td></tr></table>
                        </td>
				        <td rowspan="3" class="zone" style="width:14%" runat="server" id="recycle">
					        <table><tr><td class="caption"><div class="shell left">&nbsp;<img src="images/recycle.gif" align="absMiddle" /> 回收站</div></td></tr></table>
                        </td>
			        </tr>
			        <tr>
				        <td colspan="2" class="zone" runat="server" id="zone2">
					        <table><tr><td class="caption"><div class="shell"><div class="drag">➜|</div>C 区</div></td></tr></table>
                        </td>
			        </tr>
			        <tr>
				        <td colspan="2" class="vtop">
                            <div class="gray"> <img src="images/info.gif" align="absMiddle" /> 拖动字段名称调整位置；拖动“➜|”标记调整列宽度；拖入回收站以隐藏字段。</div>
                            <div class="footBtnArea bigger">
                                <input type="button" id="btnSaveTable" accesskey="L" title="保存排版结果&#13;快捷键：Alt+L" value="保存" onclick="return setLayout();" class="btn" runat="server" onserverclick="SaveLayout" />
                                <input type="button" id="btnM1" accesskey="M" value="管理版式" onclick="ShowPop('manage_popup');" class="btn" />
                                <input type="button" accesskey="B" onclick="toBack();" value="返回" class="btn" />
                                <input type="button" value="帮助" accesskey="H" onclick="return showHelp('tableLayout');" class="btn" />
                            </div>
                        </td>
			        </tr>
                </table>
                <div class="msgarea mtop_m mobileonly">若需调整表格版式，请在电脑上操作！</div>
            </div>
	        <div id="free">
                <asp:UpdatePanel ID="upEditor" OnPreRender="MakeEditor" ChildrenAsTriggers="false" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                    <asp:TextBox runat="server" ID="ckHtml" Height="300" Width="100%" CssClass="ck" TextMode="MultiLine"></asp:TextBox>
                </ContentTemplate>
                <Triggers><asp:AsyncPostBackTrigger ControlID="ddlLayouts" EventName="SelectedIndexChanged" /></Triggers>
                </asp:UpdatePanel>
                <div id="divQuerys">
                    <div class="zoneTitle">查询定义<select class="hidden"></select></div>
                    <asp:UpdatePanel ID="upq" runat="server" RenderMode="Block" UpdateMode="Conditional">
                        <ContentTemplate>
                            <ul runat="server" id="ulQuerys"></ul>
                            <div runat="server" id="divAdd"><asp:LinkButton runat="server" ID="lbAddQuery" OnClick="ShowQuery" CssClass="u" Text="添加查询定义…"></asp:LinkButton></div>
                            <asp:Button runat="server" ID="btnDel" OnClick="DelQuery" CssClass="hide" />
                        </ContentTemplate>
                        <Triggers><asp:AsyncPostBackTrigger ControlID="saveLayout" EventName="serverclick" /></Triggers>
                    </asp:UpdatePanel>
                </div>
                <div id="divCodes">
                    <div class="zoneTitle">代码速查：<asp:DropDownList runat="server" ID="ddlTemplets" OnSelectedIndexChanged="TempletChanged" AutoPostBack="true"></asp:DropDownList></div>
                    <asp:UpdatePanel ID="up" runat="server" RenderMode="Block" UpdateMode="Conditional">
                        <ContentTemplate>
                            <asp:DropDownList runat="server" ID="ddlfs"></asp:DropDownList><select id="ddlFmts" onchange="fmtsChanged();">
                                    <option value="">正常显示</option>
                                    <option value="BarCode_1D">条形码</option>
                                    <option value="BarCode_2D">二维码</option>
                                    <option value="UpperNumeric">大写数字</option>
                                    <option value="OriSize">原始图片</option>
                                    <option value="OptionsH">横排选项</option>
                                    <option value="OptionsV">竖排选项</option>
                                    </select><select id="ddlBarCodes" class="forBarcode hide" onchange="showTag();">
                                    <option value="CODE39">CODE 39</option>
                                    <option value="CODE39Ext">CODE 39 Extended</option>
                                    <option value="CODE128">CODE 128</option>
                                    <option value="EAN13">EAN-13</option>
                                    <option value="EAN8">EAN-8</option>
                                    <option value="UPCA">UPC-A</option>
                                    <option value="UPCE">UPC-E</option>
                                    <option value="Codabar">Codabar</option>
                                    <option value="JAN13">JAN-13</option>
                                    <option value="BOOKLAND">BOOKLAND</option>
                                    <option value="ISBN">ISBN</option>
                                    <option value="PostNet">PostNet</option>
                                    <option value="Sta2of5">Standard 2 of 5</option>
                                    <option value="Ind2of5">Industrial 2 of 5</option>
                                    <option value="Int2of5">Interleaved 2 of 5</option>
                                    <option value="USD8">USD 8</option>
                                    <option value="UCC12">UCC 12</option>
                                    <option value="UCC13">UCC 13</option>
                                    <option value="CODE11">CODE 11</option>
                                    <option value="CODE128A">CODE 128-A</option>
                                    <option value="CODE128B">CODE 128-B</option>
                                    <option value="CODE128C">CODE 128-C</option>
                                    <option value="LOGMARS">LOGMARS</option>
                                    <option value="UPC2Ext">UPC 2 Digit Ext</option>
                                    <option value="UPC5Ext">UPC 5 Digit Ext</option>
                                    <option value="TELEPEN">TELEPEN</option>
                                    <option value="FIM">FIM</option>
                                    <option value="Mod_Plessey">Modified_Plessey</option>
                                    <option value="MSI_Mod10">MSI Mod10</option>
                                    <option value="MSI_Mod11">MSI Mod11</option>
                                    <option value="MSI_2Mod10">MSI-2 Mod10</option>
                                    <option value="UNSPECIFIED">Unspecified</option>
                                    </select><select id="ddlSize" class="hide" onchange="showTag();" title="选择尺寸">
                                    <option value="small">小</option>
                                    <option value="smaller">较小</option>
                                    <option value="medium" selected="selected">适中</option>
                                    <option value="larger">较大</option>
                                    <option value="large">大</option>
                                    </select><span class="forBarcode hide"><input type="checkbox" id="cbLabel" onchange="showTag();" /><label for="cbLabel">包含文字</label></span>：<span id="fieldTag"></span>
                        </ContentTemplate>
                        <Triggers>
                            <asp:AsyncPostBackTrigger ControlID="ddlTemplets" EventName="SelectedIndexChanged" />
                        </Triggers>
                    </asp:UpdatePanel>
                </div>
                <div class="bigger" id="btns">
                    <input type="button" id="saveLayout" accesskey="L" title="保存当前版式&#13;快捷键：Alt+L" value="保存" onclick="return setLayout();" class="btn" runat="server" onserverclick="SaveLayout" />
                    <input type="button" id="addLayout" accesskey="A" title="添加一个新的自由排版版式" value="添加版式" onclick="toAddLayout();" class="btn" />
                    <input type="button" id="btnM2" accesskey="M" value="管理版式" onclick="ShowPop('manage_popup');" class="btn" />
                    <span class="block320">
                        <input type="button" accesskey="B" onclick="toBack();" value="返回" class="btn" />
                        <input type="button" value="帮助" accesskey="H" onclick="return showHelp('freeLayout');" class="btn" />
                    </span>
                </div>
	        </div>
        </div>

        <ims:Pop runat="server" ID="pop" Title="查询设置" OnOkClick="SaveQuery" OnClientUpdated="setCode();" Width="460" OnOkClientClick="return preSaveQuery();" HideOnOkClientClick="false" CustomCss="noline" ShowProgress="false">
        <ContentTemplate>
            <asp:UpdatePanel ID="upQuery" runat="server" RenderMode="inline" ChildrenAsTriggers="true" UpdateMode="conditional">
            <ContentTemplate>
            <div class="middle">名称：<asp:TextBox runat="server" ID="qName" Width="160"></asp:TextBox>，引用标记：<asp:DropDownList runat="server" ID="ddlVarName" onchange="setCode();"></asp:DropDownList></div>
            <fieldset class="mtop_n"><legend>查询： <asp:DropDownList ID="ddlQueryTemplets" AutoPostBack="true" OnSelectedIndexChanged="InitByTemplet" runat="server"></asp:DropDownList></legend>
            <div runat="server" id="queryCond">
            <asp:CheckBox ID="cbCond1" Text="过滤器：" runat="server" /><asp:DropDownList ID="ddlFilters"
            runat="server"></asp:DropDownList>
            <asp:HyperLink ID="hlAddFilter" Text="添加过滤器" runat="server"></asp:HyperLink>
            <div id="d1" runat="server"><asp:RadioButtonList runat="server" ID="rbl1" RepeatDirection="Horizontal" RepeatLayout="Flow" CssClass="rblCond"><asp:ListItem Value="And" Selected="True">并且</asp:ListItem><asp:ListItem Value="Or">或者</asp:ListItem></asp:RadioButtonList>
            <asp:CheckBox ID="cbCond2" Checked="true" runat="server" /><asp:DropDownList ID="ddlSourceFields" runat="server"></asp:DropDownList>
                <asp:DropDownList ID="ddlCondOperators" onchange="checkCondMode(this);" runat="server" Width="52"></asp:DropDownList>
                当前 <asp:DropDownList ID="ddlTargetFields" runat="server"></asp:DropDownList>
            <a runat="server" id="add1" href="#" onclick="return addCond();">增加条件</a>
            </div>
            <div id="d2" runat="server"><asp:RadioButtonList runat="server" ID="rbl2" RepeatDirection="Horizontal" RepeatLayout="Flow" CssClass="rblCond"><asp:ListItem Value="And" Selected="True">并且</asp:ListItem><asp:ListItem Value="Or">或者</asp:ListItem></asp:RadioButtonList>
            <asp:CheckBox ID="cbCond3" runat="server" /><asp:DropDownList ID="ddlSourceFields3" runat="server"></asp:DropDownList>
                <asp:DropDownList ID="ddlCondOperators3" onchange="checkCondMode(this);" runat="server" Width="52"></asp:DropDownList>
                当前 <asp:DropDownList ID="ddlTargetFields3" runat="server"></asp:DropDownList>
            <a runat="server" id="add2" href="#" onclick="return addCond();">增加条件</a>
            </div>
            <div id="d3" runat="server"><asp:RadioButtonList runat="server" ID="rbl3" RepeatDirection="Horizontal" RepeatLayout="Flow" CssClass="rblCond"><asp:ListItem Value="And" Selected="True">并且</asp:ListItem><asp:ListItem Value="Or">或者</asp:ListItem></asp:RadioButtonList>
            <asp:CheckBox ID="cbCond4" runat="server" /><asp:DropDownList ID="ddlSourceFields4" runat="server"></asp:DropDownList>
                <asp:DropDownList ID="ddlCondOperators4" onchange="checkCondMode(this);" runat="server" Width="52"></asp:DropDownList>
                当前 <asp:DropDownList ID="ddlTargetFields4" runat="server"></asp:DropDownList>
            <a runat="server" id="add3" href="#" onclick="return addCond();">增加条件</a>
            </div>
            <div id="d4" runat="server"><asp:RadioButtonList runat="server" ID="rbl4" RepeatDirection="Horizontal" RepeatLayout="Flow" CssClass="rblCond"><asp:ListItem Value="And" Selected="True">并且</asp:ListItem><asp:ListItem Value="Or">或者</asp:ListItem></asp:RadioButtonList>
            <asp:CheckBox ID="cbCond5" runat="server" /><asp:DropDownList ID="ddlSourceFields5" runat="server"></asp:DropDownList>
                <asp:DropDownList ID="ddlCondOperators5" onchange="checkCondMode(this);" runat="server" Width="52"></asp:DropDownList>
                当前 <asp:DropDownList ID="ddlTargetFields5" runat="server"></asp:DropDownList></div>
            </div>
            <div runat="server" id="msg" class="padcenter gray">请选择要查询的对象！</div>
            </fieldset>
            <div runat="server" id="divOptions">排序： <asp:DropDownList ID="ddlResultSortFields" runat="server"></asp:DropDownList>
                <asp:DropDownList ID="ddlSortDirection" runat="server">
                <asp:ListItem Value="Ascending" Selected="true">从小到大</asp:ListItem>
                <asp:ListItem Value="Descending">从大到小</asp:ListItem>
                </asp:DropDownList>
            </div>
            <fieldset class="mtop_n"><legend>引用代码</legend>
                <ul id="ulRefCode">
                    <li>表格：<a id="aTable" title="点击复制该代码，或选中后拖入编辑区"></a>， <a href="javascript:void(0);" runat="server" id="aRender" onclick="return showRender();">设置表格</a></li>
                    <li>报表：<a id="aReport" title="点击复制该代码，或选中后拖入编辑区"></a>， <asp:DropDownList runat="server" ID="ddlReports" onchange="updateReportCode();"></asp:DropDownList></li>
                    <li>图表：<a id="aChart" title="点击复制该代码，或选中后拖入编辑区"></a>， <asp:DropDownList runat="server" ID="ddlCharts" onchange="updateChartCode();"></asp:DropDownList></li>
                </ul>
            </fieldset>
            </ContentTemplate>
            </asp:UpdatePanel>
        </ContentTemplate>
        </ims:Pop>
        <ims:Pop runat="server" ID="add" Title="添加版式" OnOkClientClick="preAddLayout();" HideOnOkClientClick="false" OnOkClick="AddNewLayout" ShowProgress="false">
            <ContentTemplate>
                <div class="footBtnArea">
                    <div class="left inlineBlock">
                        版式名称：<asp:TextBox runat="server" ID="tbName" Width="200"></asp:TextBox><br />
                        初始化为：<asp:DropDownList runat="server" ID="ddlFrom"></asp:DropDownList>
                    </div>
                </div>
            </ContentTemplate>
        </ims:Pop>
        <ims:Pop runat="server" ID="manage" Title="管理版式" ShowOkButton="false" CanelButtonText="关闭" HelpSubject="detailLayoutManage" OnOkClick="AddNewLayout" Width="420" CustomCss="noline" ShowProgress="false">
            <ContentTemplate>
                <table class="normal" id="layouts">
                    <tr><th>版 式</th><th style="width:60px">设为默认</th><th style="width:32px">更名</th><th style="width:32px">编辑</th><th style="width:32px">删除</th></tr>
                    <asp:PlaceHolder runat="server" ID="phLayouts"></asp:PlaceHolder>
                </table>
                <fieldset class="mtop_n mbottom_s"><legend>默认版式规则</legend>
                    <div class="padbox">
                        <ol runat="server" id="olRules" class="olRules"></ol>
                        <div class="right"><a href="#" id="aAddRule" onclick="return toAddRule();" runat="server" onserverclick="ToAddRule" class="u">添加规则</a></div>
                    </div>
                </fieldset>
                <asp:CheckBox runat="server" ID="cbDisChange" Text="禁止普通用户切换版式" onclick="switchChange();" />
            </ContentTemplate>
        </ims:Pop>
        <ims:Pop runat="server" ID="rule" ShowProgress="false" CustomCss="noline" OnClientUpdated="setTimeout(initRule,0);" OnOkClick="SaveRule" HideOnOkClientClick="false">
            <ContentTemplate>
                <fieldset><legend>以下情况，默认版式为：<asp:DropDownList runat="server" ID="ddlAll"></asp:DropDownList></legend>
                    <div id="rulediv" class="notfocus">
                        <asp:CheckBox runat="server" ID="cbFilter" Text="条件：" /><a href="#" class="u" onclick="return ShowFilter(getUrlParam('tid'),'DefaultLayoutCond');">设置条件</a>
                        <asp:RadioButtonList runat="server" ID="rblOpera" CssClass="rblCond" RepeatLayout="Flow" RepeatDirection="Horizontal"><asp:ListItem Value="And">并且</asp:ListItem><asp:ListItem Value="Or" Selected="True">或者</asp:ListItem></asp:RadioButtonList>
                        <asp:CheckBox runat="server" ID="cbRoles" Text="角色：" /><asp:TextBox runat="server" ID="tbRoles" Width="300" acfid="RoleName" chars=";；,，、" ToolTip="输入角色名。多项之间以逗号、分号或顿号分隔"></asp:TextBox>
                        <asp:RadioButtonList runat="server" ID="rblOpera2" CssClass="rblCond" RepeatLayout="Flow" RepeatDirection="Horizontal"><asp:ListItem Value="And">并且</asp:ListItem><asp:ListItem Value="Or" Selected="True">或者</asp:ListItem></asp:RadioButtonList>
                        <asp:CheckBox runat="server" ID="cbDevice" Text="设备：" /><asp:DropDownList runat="server" ID="ddlDevice"><asp:ListItem Value="PC">电脑</asp:ListItem><asp:ListItem Value="Mobile" Selected="True">移动设备</asp:ListItem></asp:DropDownList>
                    </div>
                </fieldset>
            </ContentTemplate>
        </ims:Pop>
        <div id="ts" class="pop noline" style="width:670px">
        <div class="head">
            <div class="title">设置表格</div><div class="close" onclick="HideDialog();">×</div>
        </div>
            <div class="body notfocus">
                <fieldset><legend>选择字段 <img src='images/selectall.gif' class='slt' title='全选/全不选' onclick="SelectAll('divFields');" /><img src='images/revselect.gif' class='slt' title='反选' onclick="RevSelect('divFields');" /></legend>
                    <asp:UpdatePanel ID="fs" runat="server" UpdateMode="conditional">
                    <ContentTemplate>
                        <div class="padbox colorText" runat="server" id="divFields"></div>
                    </ContentTemplate>
                    </asp:UpdatePanel>
                </fieldset>
                <input type="checkbox" id="cbNo" /><label for="cbNo">显示序号</label>
                <input type="checkbox" id="cbBackcolor" /><label for="cbBackcolor">标题行底色</label>
                <input type="checkbox" id="cbFit" /><label for="cbFit">宽度自适应</label>
                <input type="checkbox" id="cbPagesize" /><label for="cbPagesize">打印时每</label><input type="text" id="tbPagesize" style="width:28px" /> <label for="cbPagesize">行分页</label>
                <input type="checkbox" id="cbClass" /><label for="cbClass" class="reset">添加样式类：</label><input type="text" id="tbClass" style="width:54px" /><img src="images/what.gif" title="解释" onclick="What('TableClass')" class="what" />
                <div id="previewArea">
                    <div id="container">
                        <table id="previewTable" class="normal autoWidth center"><tr id="preview"></tr></table>
                    </div>
                </div>
                <div class="gray middle"><img src="images/info.gif" /> 鼠标拖动列标题调整顺序，拖动列边界调整宽度</div>
            </div>
            <div class="btnArea">
                <input type="button" runat="server" value="确定" id="btnOk" onclick="saveTable();" class="btn" />
                <input type="button" class="btn" value="取消" runat="server" id="btnCancel" onclick="HideDialog();" />
            </div>
        </div>
        <asp:Button runat="server" ID="btnManage" OnClick="OperaLayout" CssClass="hide" />
    <script src="js/comm.js"></script><script src="js/detailLayout.js"></script>
    </form>
</body>
</html>