You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
258 lines
11 KiB
258 lines
11 KiB
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master" Inherits="System.Web.Mvc.ViewPage<QMAPP.Common.Web.Models.TemplateEditModel>" %>
|
|
|
|
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
|
|
编辑查询模板
|
|
</asp:Content>
|
|
|
|
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
|
|
|
|
<%=Html.QPEdit("编辑查询模板", string.IsNullOrEmpty(Model.TEMPLATEID) ? QMFrameWork.WebUI.panelType.Add : QMFrameWork.WebUI.panelType.Update)%>
|
|
<div id="tab_qt" style="height:390px;">
|
|
<div title="基本信息" style="padding:5px;" align="left">
|
|
<table id="editTable">
|
|
<tr>
|
|
<th align=right><%=Html.QV(p=>p.TEMPLATENAME) %></th><td><%=Html.QC(p=>p.TEMPLATENAME) %></td>
|
|
<th align=right><%=Html.QV(p=>p.PAGESIZE) %></th><td><%=Html.QC(p=>p.PAGESIZE) %></td>
|
|
<th align=right><%=Html.QV(p=>p.ISPUBLISH) %></th><td><%=Html.QC(p=>p.ISPUBLISH) %></td>
|
|
</tr>
|
|
<tr>
|
|
<th align=right><%=Html.QV(p=>p.REMARK) %></th><td colspan=5><%=Html.QC(p=>p.REMARK) %></td>
|
|
</tr>
|
|
<tr><th align=right><%=Html.QV(p=>p.CREATEUSERNAME) %></th><td><%=Html.QC(p=>p.CREATEUSERNAME) %></td><th align=right><%=Html.QV(p=>p.CREATEDATE) %></th><td colspan=3><%=Html.QC(p=>p.CREATEDATE) %></td></tr>
|
|
|
|
</table>
|
|
</div>
|
|
<div title="查询设置" style="padding:5px;" align="left">
|
|
<table id="tblWhere" class="BlueHeaderTable" singleSelect="true" iconCls="icon-edit" cellpadding="0" cellspacing="0">
|
|
<thead>
|
|
<tr class="CssColumnLabel">
|
|
<th align="center" width="200">查询条件</th>
|
|
<th width="60" align="center">是否显示</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<%foreach (var item in Model.Wheres)
|
|
{ %>
|
|
<tr class="CssColumnLabel">
|
|
<td><%=item.QUERYCOLUMNLABEL %></td>
|
|
<td align=center><input type="checkbox" name="WHEREDISPLAY" <%=item.ISDISPLAY%> value="<%=item.QUERYCOLUMN%>" /></td>
|
|
</tr>
|
|
<%} %>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div title="显示设置" style="padding:5px;" align="left">
|
|
<table id="tblColumns" width="98%" align=center class="BlueHeaderTable" cellpadding="0" cellspacing="0" singleSelect="true" iconCls="icon-edit">
|
|
<thead>
|
|
<tr class="CssColumnLabel">
|
|
<th style="display:none"></th>
|
|
<th align="center" width="200">列名</th>
|
|
<th width="60" align="center">显示</th>
|
|
<th width="60" align="center">对齐方式</th>
|
|
<th width="60" align="center">列宽</th>
|
|
<th width="60" align="center">冻结</th>
|
|
<th width="60" align="center">移动</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<%foreach (var item in Model.Columns)
|
|
{ %>
|
|
<tr class="CssColumnLabel">
|
|
<td style="display:none"><%=Html.Hidden("COLUMNNAME", item.COLUMNNAME)%></td>
|
|
<td><%=item.COLUMNLABEL%></td>
|
|
<td align=center>
|
|
|
|
<input type="checkbox" name="COLUMNDISPLAY" <%=item.CBXDISPLAY == "checked=checked"?"checked":""%> value="<%=item.COLUMNNAME%>" /></td>
|
|
<td align=center>
|
|
<%=Html.QC("DATAALIGN", item.DATAALIGN)%>
|
|
<%--
|
|
<select name="COLUMNALIGN">
|
|
<option value="left">居左</option>
|
|
<option value="center">居中</option>
|
|
<option value="right">居右</option>
|
|
</select>--%>
|
|
</td>
|
|
<td align=center><input style="width:60px" max="500" min="0" name="COLUMNWIDTH" type="text" value="<%=item.WIDTH %>" /></td>
|
|
<td align=center><input type="checkbox" name="COLUMNFROZEN" <%=item.CBXISFROZEN == "checked=checked"?"checked":""%> value="<%=item.COLUMNNAME%>" /></td>
|
|
<td align=center>
|
|
<a href="#" onclick="Move(this,-1)" >上移</a>
|
|
<a href="#" onclick="Move(this,1)" >下移</a>
|
|
</td>
|
|
</tr>
|
|
<%} %>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div title="排序设置" style="padding:5px;" align="left">
|
|
<table>
|
|
<tr>
|
|
<td valign=top>
|
|
<table id="UnSortGrid" style="width:240px;height:auto"
|
|
title="未选列" iconCls="icon-edit"
|
|
idField="COLUMNNAME">
|
|
<thead>
|
|
<tr>
|
|
<th field="COLUMNLABEL" width="150">列</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
|
|
</td>
|
|
<td>
|
|
<a href="#" class="easyui-linkbutton" onclick="SelectSortColumn();" >>></a>
|
|
<br />
|
|
<br />
|
|
<a href="#" class="easyui-linkbutton" onclick="RemoveSortColumn()"><<</a>
|
|
</td>
|
|
<td valign=top>
|
|
<table id="EnSortGrid" style="width:240px;height:auto" singleSelect="true"
|
|
title="已选列" iconCls="icon-edit"
|
|
idField="COLUMNNAME">
|
|
<thead>
|
|
<tr>
|
|
<th field="COLUMNLABEL" width="150">列</th>
|
|
<th field="SORTMODE" width="60" formatter="SortModeFormatter" editor="{type:'combobox',options:{valueField:'id',textField:'des',data:sortModes,required:true}}">排序</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<%=Html.QPEnd() %>
|
|
<%=Html.HiddenFor(p=>p.CREATEUSER) %>
|
|
<%=Html.HiddenFor(p=>p.QUERYPROGRAM) %>
|
|
<%=Html.HiddenFor(p=>p.TEMPLATEID) %>
|
|
<%=Html.HiddenFor(p=>p.UPDATEDATE) %>
|
|
<%=Html.Hidden("SelectedSortColumn") %>
|
|
</asp:Content>
|
|
|
|
<asp:Content ID="Content3" ContentPlaceHolderID="ToolContent" runat="server">
|
|
<table width="100%" cellpadding=0 cellspacing=0>
|
|
<tr>
|
|
<td>
|
|
<%=Html.QTButtonSave("QueryTL", "QueryTLSave", "return Save();")%>
|
|
<%=Html.QTButtonBack("QueryTL", "CLose", "return Close();")%>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<script type="text/javascript">
|
|
var whereData;
|
|
var lastIndex;
|
|
var sortModes = [
|
|
{ id: 'ASC', des: '升序' },
|
|
{ id: 'DESC', des: '降序' }
|
|
];
|
|
var unSortColumns=<%=QMFrameWork.Common.Serialization.JsonConvertHelper.GetSerializes(Model.UnSorts) %>;
|
|
var enSortColumns=<%=QMFrameWork.Common.Serialization.JsonConvertHelper.GetSerializes(Model.EnSorts) %>;
|
|
var showColumns = <%=QMFrameWork.Common.Serialization.JsonConvertHelper.GetSerializes(Model.Columns) %>;
|
|
|
|
function Move(t,i){
|
|
var row = $(t).closest("tr");
|
|
var rows = $("#tblColumns").find("tbody tr").clone(true);
|
|
var rowTemp;
|
|
var rowIndex = $(row).index();
|
|
rowTemp = rows.eq(rowIndex+i).clone(true);
|
|
rows[rowIndex+i] = row.clone(true);
|
|
rows[rowIndex] = rowTemp.clone(true);
|
|
$("#tblColumns").find("tbody tr").remove();
|
|
rows.each(function()
|
|
{
|
|
$("#tblColumns").find("tbody").append("<tr class='CssColumnLabel'>"+$(this).html() +"</tr>");
|
|
});
|
|
$("#tblColumns").find("tbody").find("input[name='COLUMNWIDTH']").addClass("easyui-numberbox");
|
|
}
|
|
|
|
//初始化
|
|
$(function () {
|
|
//初始化tab
|
|
$('#tab_qt').tabs({
|
|
});
|
|
|
|
//初始化未选列表格
|
|
$('#UnSortGrid').datagrid({
|
|
});
|
|
$('#UnSortGrid').datagrid("loadData", unSortColumns);
|
|
|
|
//初始化已选列表格
|
|
$('#EnSortGrid').datagrid({
|
|
onClickRow:function(rowIndex){
|
|
if (lastIndex != rowIndex){
|
|
$('#EnSortGrid').datagrid('endEdit', lastIndex);
|
|
$('#EnSortGrid').datagrid('beginEdit', rowIndex);
|
|
}
|
|
lastIndex = rowIndex;
|
|
}
|
|
|
|
});
|
|
$('#EnSortGrid').datagrid("loadData", enSortColumns);
|
|
|
|
|
|
$("input[name='COLUMNWIDTH']").addClass("easyui-numberbox");
|
|
});
|
|
|
|
//排序方式格式化
|
|
function SortModeFormatter(value) {
|
|
for (var i = 0; i < sortModes.length; i++) {
|
|
if (sortModes[i].id == value) return sortModes[i].des;
|
|
}
|
|
return value;
|
|
}
|
|
|
|
//添加排序列
|
|
function SelectSortColumn()
|
|
{
|
|
var data = $('#EnSortGrid').datagrid("getData");
|
|
|
|
var rows = $('#UnSortGrid').datagrid('getSelections');
|
|
for(var i=0;i<rows.length;i++){
|
|
var sortColumn = JSON.parse("{}");
|
|
sortColumn["COLUMNNAME"] = rows[i].COLUMNNAME;
|
|
sortColumn["COLUMNLABEL"] = rows[i].COLUMNLABEL;
|
|
sortColumn["SORTMODE"] = "ASC";
|
|
data.rows.push(sortColumn);
|
|
var index = $('#UnSortGrid').datagrid('getRowIndex', rows[i]);
|
|
$('#UnSortGrid').datagrid('deleteRow', index);
|
|
}
|
|
$('#EnSortGrid').datagrid("loadData", data);
|
|
}
|
|
|
|
//移除排序列
|
|
function RemoveSortColumn()
|
|
{
|
|
var data = $('#UnSortGrid').datagrid("getData");
|
|
|
|
var rows = $('#EnSortGrid').datagrid('getSelections');
|
|
for(var i=0;i<rows.length;i++){;
|
|
var sortColumn = JSON.parse("{}");
|
|
sortColumn["COLUMNNAME"] = rows[i].COLUMNNAME;
|
|
sortColumn["COLUMNLABEL"] = rows[i].COLUMNLABEL;
|
|
data.rows.push(sortColumn);
|
|
var index = $('#EnSortGrid').datagrid('getRowIndex', rows[i]);
|
|
$('#EnSortGrid').datagrid('deleteRow', index);
|
|
}
|
|
$('#UnSortGrid').datagrid("loadData", data);
|
|
}
|
|
|
|
|
|
//保存
|
|
function Save() {
|
|
if (isValidate() == false) {
|
|
return false;
|
|
}
|
|
|
|
var sortData = $('#EnSortGrid').datagrid("getData");
|
|
$('#SelectedSortColumn').val(JSON.stringify(sortData.rows));
|
|
|
|
submitByButton("QueryTLSave");
|
|
}
|
|
|
|
//关闭
|
|
function Close() {
|
|
parent.closeAppWindow1();
|
|
parent.ListQueryTL($("#QUERYPROGRAM").val());
|
|
return false;
|
|
}
|
|
</script>
|
|
</asp:Content>
|
|
|