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.
208 lines
7.6 KiB
208 lines
7.6 KiB
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master"
|
|
Inherits="System.Web.Mvc.ViewPage<QMAPP.Common.Web.Models.QueryMore>" %>
|
|
|
|
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
|
|
</asp:Content>
|
|
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
|
|
<%=Html.QPEdit()%>
|
|
<div style="height: 350px;width: 410px; overflow: scroll;">
|
|
<table id="editTable" cellpadding="0" cellspacing="0" style="width: 400px;">
|
|
<tr>
|
|
<td>
|
|
<table id="dg" class="easyui-datagrid" style="width: 380px; height: 300px" data-options="onClickRow: onClickRow,singleSelect: true">
|
|
<thead>
|
|
<tr>
|
|
<th data-options="field:'attr1',width:400,editor:'text'">
|
|
条件(请不要超过400条记录)
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<%=Html.HiddenFor(p => p.HidCom)%>
|
|
<%=Html.HiddenFor(p=>p.QueryType) %>
|
|
</asp:Content>
|
|
<asp:Content ID="Content3" ContentPlaceHolderID="ToolContent" runat="server">
|
|
<table width="100%" cellpadding="0" cellspacing="0">
|
|
<tr>
|
|
<td>
|
|
<%=Html.QTButton("save", "FactoryList", QMFrameWork.WebUI.IconCls.save, "Search()", (s, f) => { return true; })%>
|
|
<%=Html.QTButton("paste", "FactoryList", QMFrameWork.WebUI.IconCls.redo, "QueryMore()", (s, f) => { return true; })%>
|
|
<%=Html.QTButton("clear", "FactoryList", QMFrameWork.WebUI.IconCls.redo, "Clear()", (s, f) => { return true; })%>
|
|
<%-- <%=Html.QTButton("import", "FactoryList", QMFrameWork.WebUI.IconCls.undo, "Import()", (s, f) => { return true; })%>
|
|
<%=Html.QTButton("template", "FactoryList", QMFrameWork.WebUI.IconCls.template, "GetTemplate()", (s, f) => { return true; })%>--%>
|
|
<%=Html.QTButton("create", "FactoryList", QMFrameWork.WebUI.IconCls.add, "AddRow()", (s, f) => { return true; })%>
|
|
<%=Html.QTButton("delete", "FactoryList", QMFrameWork.WebUI.IconCls.remove, "DelRow()", (s, f) => { return true; })%>
|
|
<%=Html.QTButtonBack("close", "CargoTypeList", "parent.closeAppWindow1();return false;")%>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<script type="text/javascript">
|
|
var _kkk
|
|
function document.onkeydown() {
|
|
if (event.ctrlKey && event.keyCode == 86) {
|
|
QueryMore();
|
|
}
|
|
}
|
|
|
|
$(function () {
|
|
_kkk = $("#QueryType").val();
|
|
var str = new Array();
|
|
str = parent.document.getElementById(_kkk).value.split(",");
|
|
append(str);
|
|
});
|
|
|
|
var editIndex = undefined;
|
|
function endEditing() {
|
|
if (editIndex == undefined) { return true }
|
|
if ($('#dg').datagrid('validateRow', editIndex)) {
|
|
var ed = $('#dg').datagrid('getEditor', { index: editIndex, field: 'attr1' });
|
|
$('#dg').datagrid('endEdit', editIndex);
|
|
editIndex = undefined;
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
function onClickRow(index) {
|
|
if (editIndex != index) {
|
|
if (endEditing()) {
|
|
$('#dg').datagrid('selectRow', index)
|
|
.datagrid('beginEdit', index);
|
|
editIndex = index;
|
|
} else {
|
|
$('#dg').datagrid('selectRow', editIndex);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
function append(copytext) {
|
|
if (copytext.length > 0) {
|
|
for (var i = 0; i < copytext.length; i++) {
|
|
$('#dg').datagrid('appendRow', { attr1: copytext[i] });
|
|
}
|
|
}
|
|
else {
|
|
$('#dg').datagrid('appendRow', { attr1: '' });
|
|
}
|
|
// if (copytext == "") {
|
|
// $('#dg').datagrid('appendRow', { attr1: '' });
|
|
// }
|
|
// else {
|
|
// $('#dg').datagrid('appendRow', { attr1: copytext });
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
function removeit() {
|
|
var bb = $('#dg').datagrid('getRows')[0]['attr1'];
|
|
if (bb == "") {
|
|
$('#dg').datagrid('cancelEdit', 0)
|
|
.datagrid('deleteRow', 0);
|
|
}
|
|
}
|
|
|
|
// function removeit() {
|
|
// debugger;
|
|
// if (editIndex == undefined) { return }
|
|
// $('#dg').datagrid('cancelEdit', editIndex)
|
|
// .datagrid('deleteRow', editIndex);
|
|
// editIndex = undefined;
|
|
// }
|
|
|
|
function QueryMore() {
|
|
var cc = window.clipboardData.getData("Text").split("\r\n");
|
|
removeit();
|
|
for (var i = 0; i < cc.length; i++) {
|
|
if (i == 400) {
|
|
debugger;
|
|
break;
|
|
}
|
|
$('#dg').datagrid('appendRow', { attr1: cc[i] });
|
|
}
|
|
}
|
|
|
|
function Search() {
|
|
$('#dg').datagrid('acceptChanges');
|
|
var hidcontent = '';
|
|
var first = $('#dg').datagrid('getRows')[0]['attr1'];
|
|
|
|
editIndex = $('#dg').datagrid('getRows').length;
|
|
for (var i = 0; i < editIndex; i++) {
|
|
if ($('#dg').datagrid('getRows')[i]['attr1'] != '') {
|
|
hidcontent = hidcontent + $('#dg').datagrid('getRows')[i]['attr1'] + ',';
|
|
}
|
|
}
|
|
|
|
_kkk = $("#QueryType").val();
|
|
_ss = $("#HidCom").val();
|
|
parent.document.getElementById(_kkk).value = hidcontent;
|
|
parent.document.getElementById(_ss).value = first;
|
|
parent.closeAppWindow1();
|
|
return false;
|
|
}
|
|
|
|
function Clear() {
|
|
$('#dg').datagrid("loadData", { total: 0, rows: [] });
|
|
append('');
|
|
}
|
|
|
|
|
|
function selectChanged() {
|
|
alert(1);
|
|
}
|
|
|
|
function Import() {
|
|
|
|
var fileName = window.showModalDialog("/File/UploadFile", "", "dialogHeight: 200px; dialogWidth: 300px; center: Yes; help: Yes;status: Yes;");
|
|
|
|
if (fileName == null)
|
|
return;
|
|
|
|
document.getElementById("fileName").value = fileName;
|
|
|
|
//处理等待
|
|
_showProgress();
|
|
|
|
submitByButton("ImportExcel");
|
|
}
|
|
|
|
//下载模板
|
|
function GetTemplate() {
|
|
submitByButton("GetTemplate");
|
|
}
|
|
|
|
function AddRow() {
|
|
// debugger;
|
|
// if (endEditing()) {
|
|
// //$('#dg').datagrid('appendRow', { status: 'P' });
|
|
// editIndex = $('#dg').datagrid('getRows').length - 1;
|
|
// $('#dg').datagrid('selectRow', editIndex)
|
|
// .datagrid('beginEdit', editIndex);
|
|
// }
|
|
|
|
editIndex = $('#dg').datagrid('getRows').length;
|
|
$('#dg').datagrid('appendRow', { attr1: '' });
|
|
editIndex++;
|
|
$('#dg').datagrid('selectRow', editIndex).datagrid('beginEdit', editIndex);
|
|
}
|
|
|
|
function DelRow() {
|
|
if (editIndex == undefined) { return }
|
|
$('#dg').datagrid('cancelEdit', editIndex)
|
|
.datagrid('deleteRow', editIndex);
|
|
editIndex = undefined;
|
|
}
|
|
|
|
function accept() {
|
|
if (endEditing()) {
|
|
$('#dg').datagrid('acceptChanges');
|
|
}
|
|
}
|
|
</script>
|
|
</asp:Content>
|
|
|