📄 listhead.asp
字号:
<!-- #include file = "../include/asphead.asp" -->
<!-- #include file = "../include/function.asp" -->
<%CheckUser()%>
<link href="../include/main.css" rel="stylesheet" type="text/css">
<script src="../include/function.js" type="text/javascript"></script>
<script ID="clientEventHandlersJS" LANGUAGE="javascript">
<!--
function window_onload(){
if (parent.parent.Content.cols == '0,0,*')
{
document.all['divShowSearch'].style.visibility = 'visible'
document.all['SearchIcon'].width = 26
}
else
{
document.all['divShowSearch'].style.visibility = 'hidden'
document.all['SearchIcon'].width = 0
}
btnAdd.disabled =false;
try
{
parent.RightPanel.rows=RightHeadTable.clientHeight + ",*," + parent.RightFoot.RightFootTable.clientHeight;
}
catch(e)
{
}
window.parent.RightData.navigate("list.asp");
}
function ShowSearch()
{
document.all['SearchIcon'].width = 0
document.all['divShowSearch'].style.visibility = 'hidden'
parent.parent.window.Content.cols = "215,1,*"
}
function AddRecord() {
var SheetAndRowID;
SheetAndRowID=document.frmData.SheetID.value+JoinChar+0;
if(window.showModalDialog("viewframe.asp?target=new.asp?SheetAndRowID="+SheetAndRowID, "","dialogwidth:640px;dialogheight:480px;Status:0;center:1;resizable=1;")==true)
{
window.parent.RightData.navigate("list.asp");
}
}
function DelRecord()
{
var SelectedRow,BadRow;
BadRow=window.parent.RightData.CheckDelAuth();
if(BadRow!="")
{
alert("以下记录您没有删除权限,请检查。\n" + "ID号:" + BadRow)
}
else
{
SelectedRow=window.parent.RightData.RowSelect();
if(SelectedRow=="")
{
alert("您要删除哪些记录?请选择。")
}
else
{
var RecordCount;
RecordCount=SelectedRow.split(",").length;
if(confirm("您确定要删除这" + RecordCount + "条记录吗?")==true)
{
document.frmData.RowSelect.value =SelectedRow;
document.frmData.target ="SaveArea";
document.frmData.action="del.asp";
document.frmData.submit();
}
}
}
}
function SheetToolSelect()
{
var Tool;
Tool=parseInt(SheetTool.value);
switch(Tool)
{
case 1:
Import();
break;
case 2:
Export();
break;
case 3:
BatchModify();
break;
case 4:
SetInput();
break;
case 5:
SetList();
break;
case 6:
ManageList();
break;
case 7:
CopyRecord();
break;
case 8:
PrintList();
break;
}
SheetTool.selectedIndex =0;
}
function Import()
{
if(window.showModalDialog("frame.asp?target=../imexport/importstep1.asp", "","dialogwidth:560px;dialogheight:370px;Status:0;center:1;resizable=1;")==true)
{
window.parent.RightData.navigate("list.asp");
}
}
function Export()
{
var CurSelectedRows,PageRows,Rows,TotalCount
if(HasData())
{
CurSelectedRows=window.parent.RightData.RowSelect();
PageRows=window.parent.RightData.RowIDs.value;
TotalCount=window.parent.RightData.RecordCount.value;
Rows=CurSelectedRows+"|"+PageRows+"|"+TotalCount;
window.showModalDialog("frame.asp?target=../imexport/exportstep1.asp?Rows="+Rows,"","dialogwidth:560px;dialogheight:380px;Status:0;center:1;resizable=1;");
}
else
alert("没有数据可导出,请先查询数据再导出。");
}
function CopyRecord()
{
var CurSelectedRows,PageRows,Rows,TotalCount
if(HasData())
{
CurSelectedRows=window.parent.RightData.RowSelect();
PageRows=window.parent.RightData.RowIDs.value;
TotalCount=window.parent.RightData.RecordCount.value;
Rows=CurSelectedRows+"|"+PageRows+"|"+TotalCount;
if(window.showModalDialog("frame.asp?target=../imexport/copystep1.asp?Rows="+Rows,"","dialogwidth:560px;dialogheight:380px;Status:0;center:1;resizable=1;"))
{
window.parent.RightData.navigate("list.asp");
}
}
else
alert("没有数据可复制,请先查询数据再复制。");
}
function BatchModify()
{
var CurSelectedRows,PageRows,Rows
if(HasData())
{
CurSelectedRows=window.parent.RightData.RowSelect();
PageRows=window.parent.RightData.RowIDs.value;
Rows=CurSelectedRows+"|"+PageRows;
var Ret;
Ret=window.showModalDialog("frame.asp?target=batchstep1.asp?Rows="+Rows,"","dialogwidth:560px;dialogheight:360px;Status:0;center:1;resizable=1;");
if(Ret==true)
window.parent.RightData.navigate("list.asp");
}
else
alert("没有数据可修改,请先查询数据再修改。");
}
function SetList() {
if(window.showModalDialog("frame.asp?target=setlistframe.asp", "","dialogwidth:500px;dialogheight:510px;Status:0;center:1;resizable=1;")==true)
{
if(HasData())
{
frmData.SelectView.value="";
frmData.target ="RightHead";
frmData.action="listhead.asp";
frmData.submit();
}
else
window.parent.RightHead.navigate("listhead.asp");
}
}
function SetInput() {
window.showModalDialog("frame.asp?target=setinput.asp", "","dialogwidth:640px;dialogheight:480px;Status:0;center:1;resizable=1;");
}
function HasData()
{
if(PageNavigate.innerText!="" && document.frmData.CurPage.value>0) //用PageNavigate.innerText有无内容和CurPage.value判断list是否已经有数据
return(true);
else
return(false);
}
function ViewSelect()
{
var ViewID;
ViewID=SelectView.value;
if(ViewID<0)
{
ViewID=0;
SelectView.selectedIndex =0;
}
//由于列表头和数据列表自身都需要刷新,如果采取同步提交的方式,则无法预料哪个先完成,但本系统
//listhead的navigate部分是靠list来填写的,所以listhead必须先完成。这样解决:只提交到listhead,
//listhead完成后(window_onload)再主动去刷新list。
frmData.SelectView.value=ViewID;
frmData.target ="RightHead";
frmData.action="listhead.asp";
frmData.submit();
}
function ManageList() {
if(window.showModalDialog("frame.asp?target=listmanage.asp", "","dialogwidth:330px;dialogheight:380px;Status:0;center:1;resizable=1;")==true)
{
if(HasData())
{
frmData.SelectView.value="";
frmData.target ="RightHead";
frmData.action="listhead.asp";
frmData.submit();
}
else
window.parent.RightHead.navigate("listhead.asp");
}
}
function PrintList() {
var curPageBody,PrintBody;
curPageBody=window.document.body.innerHTML;
PrintBody=RemoveNoPrint(curPageBody);
PrintBody=PrintBody + "<br>" + window.parent.RightData.document.body.innerHTML;
if(HasData())
PrintBody=PrintBody + "<br>" + window.parent.RightFoot.document.body.innerHTML;
window.document.body.innerHTML=PrintBody;
window.print();
window.document.body.innerHTML=curPageBody;
}
function window_onresize() {
try
{
parent.RightPanel.rows=RightHeadTable.clientHeight + ",*," + parent.RightFoot.RightFootTable.clientHeight;
}
catch(e)
{
}
}
//-->
</script>
<%
dim WExcel
set WExcel=server.CreateObject("WExcel.Sheet")
dim SheetID,ViewID,ViewOption,SheetHead
SheetID=Request.Cookies("Temp")("SheetID")
'确定当前视图
ViewID=trim(Request.Form("SelectView"))
if ViewID="" then
ViewID=Request.Cookies("Sheet")("ViewSelect" & SheetID)
else
Response.Cookies("Sheet")("ViewSelect" & SheetID)=ViewID
Response.Cookies("Sheet").Expires = CookieLife
end if
if IsEmpty(ViewID) then
ViewID="-1" '表示未指定缺省视图,也未指定任何公共、私有视图
end if
WExcel.GetSheetHead cint(UserID),cint(SheetID),cint(ViewID),ViewOption,SheetHead,ActualViewID
if cint(ViewID)<>cint(ActualViewID) then
'想要的ViewID可能已经不存在了,使用ActualViewID
Response.Cookies("Sheet")("ViewSelect" & SheetID)=ActualViewID
Response.Cookies("Sheet").Expires = CookieLife
end if
CheckErr
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="window_onload()" onresize="window_onresize()">
<table id="RightHeadTable" name="RightHeadTable" width="100%" border="0" cellPadding=0 cellSpacing=0>
<tr height="20">
<td width="1%">
<!--NoPrintStart-->
<div id="divShowSearch" align="left">
<img id="SearchIcon" src="../images/show.gif" alt="显示查询条件" style="cursor:hand" onClick="ShowSearch()" width="0" height="20" border="0">
</div>
<!--NoPrintEnd-->
</td>
<td width="59%">
<p align="left" id="PageNavigate">
</p>
</td>
<td width="41%">
<!--NoPrintStart-->
<p align="right">
<input type="button" name="btnAdd" disabled value="录入" style="cursor:hand; WIDTH: 36px; HEIGHT: 24px" LANGUAGE="javascript" onclick="return AddRecord()">
<input type="button" name="btnDel" disabled value="删除" style="cursor:hand; WIDTH: 36px; HEIGHT: 24px" LANGUAGE="javascript" onclick="return DelRecord()">
<select name=SheetTool style="WIDTH: 58px" LANGUAGE=javascript onchange="return SheetToolSelect()">
<option value=0>
工具
</option>
<option value=1>
导入数据
</option>
<option value=2>
导出数据
</option>
<option value=7>
复制数据
</option>
<option value=3>
批量修改
</option>
<option value=4>
录入设置
</option>
<option value=5>
视图设置
</option>
<option value=6>
视图整理
</option>
<option value=8>
打印本页
</option>
</select>
<select name=SelectView style='width:77px' LANGUAGE='javascript' onchange='return ViewSelect()'>
<%=ViewOption%>
</select>
</p>
<!--NoPrintEnd-->
</td>
</tr>
<tr>
<td colspan="3">
<%=SheetHead%>
</td>
<iframe id="SaveArea" name="SaveArea" style="visibility:hidden" width="0" height="0" frameborder="0" src="">
</iframe>
</tr>
<form METHOD="post" name="frmData">
<input TYPE="hidden" NAME="SheetID" value="<%=SheetID%>">
<input TYPE="hidden" NAME="OrderBy" value="<%=Request.Cookies("Sheet")("OrderBy" & CoID & "-" & SheetID)%>">
<input TYPE="hidden" NAME="CurPage">
<input TYPE="hidden" NAME="RowSelect">
<input TYPE="hidden" NAME="SelectView">
</form>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -