⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 复件 (2) dir_list.jsp

📁 oa 源代码
💻 JSP
📖 第 1 页 / 共 2 页
字号:
                <%}%>
                <%
				Iterator irch = leaf.getChildren().iterator();
				while (irch.hasNext()) {
					Leaf plf = (Leaf)irch.next();
				%>
                <table width="100%"  border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="3%" align="center"><img src="images/folder.gif" width="20" height="20" align="absmiddle"></td>
                    <td width="37%"><a href="dir_list.jsp?op=editarticle&dir_code=<%=plf.getCode()%>" onMouseUp="curAttachId=''"><%=plf.getName()%></a></td>
                    <td width="13%">&nbsp;</td>
                    <td width="22%">&nbsp;</td>
                    <td width="25%">&nbsp;</td>
                  </tr>
                </table>
                <%}%>
                <%
String strcurpage = StrUtil.getNullString(request.getParameter("CPages"));
if (strcurpage.equals(""))
	strcurpage = "1";
if (!StrUtil.isNumeric(strcurpage)) {
	out.print(StrUtil.makeErrMsg("标识非法!"));
	return;
}

Attachment am = new Attachment();
int pagesize = 30;
int curpage = Integer.parseInt(strcurpage);
String sql = "SELECT id FROM netdisk_document_attach WHERE doc_id=" + doc.getID() + " and page_num=1 order by ";
sql += orderBy + " " + sort;
ListResult lr = am.listResult(sql, curpage, pagesize);
int total = lr.getTotal();
Paginator paginator = new Paginator(request, total, pagesize);
// 设置当前页数和总页数
int totalpages = paginator.getTotalPages();
if (totalpages==0)
{
	curpage = 1;
	totalpages = 1;
}
			  if (doc!=null) {
				  // Vector attachments = doc.getAttachments(1);
				  Vector attachments = lr.getResult();
				  Iterator ir = attachments.iterator();
				  while (ir.hasNext()) {
				  	am = (Attachment) ir.next(); %>
					<table width="100%"  border="0" cellspacing="0" cellpadding="0" onMouseOver="this.style.backgroundColor='#FFD6DE'" onMouseOut="this.style.backgroundColor='#ffffff'">
                      <tr>
                        <td width="4%" align="center"><a title="打开文件" target=_blank href="netdisk_getfile.jsp?id=<%=doc.getID()%>&attachId=<%=am.getId()%>"><img src="images/<%=am.getIcon()%>" border="0"></a></td>
                        <td width="37%">&nbsp;
                          <span id="span<%=am.getId()%>" name="span<%=am.getId()%>"><a target=_blank title="打开文件" class="mainA" href="netdisk_getfile.jsp?id=<%=doc.getID()%>&attachId=<%=am.getId()%>" onmouseup='onMouseUp("<%=am.getId()%>", "<%=am.getName()%>")'><%=am.getName()%></a></span></td>
                        <td width="13%"><%=NumberUtil.round((double)am.getSize()/1024, 1)%>KB</td>
                        <td width="19%"><%=DateUtil.format(am.getUploadDate(), "yyyy-MM-dd HH:mm")%></td>
                        <td width="27%">&nbsp;<a href="dir_change.jsp?attachId=<%=am.getId()%>"><img src="images/rename.gif" alt="重命名或移动文件" width="16" height="16" border="0" align="absmiddle"></a> &nbsp;<a href="javascript:delAttach('<%=am.getId()%>', '<%=doc.getID()%>')"><img src="images/del.gif" alt="删除" width="16" height="16" border="0" align="absmiddle"></a>&nbsp;&nbsp;<a target="_blank" href="netdisk_downloadfile.jsp?id=<%=am.getDocId()%>&attachId=<%=am.getId()%>"><img src="images/download.gif" alt="下载" width="16" height="16" border="0" align="absmiddle"></a>
                          <%if (!StrUtil.getNullStr(am.getPublicShareDir()).equals("")) {%>
                          <a href="netdisk_public_share.jsp?attachId=<%=am.getId()%>"><font color="#FF0000">已发布</font></a>
                          <%}else{%>
                          <a href="netdisk_public_share.jsp?attachId=<%=am.getId()%>"><img src="images/share_public.gif" alt="发布" width="16" height="16" border="0" align="absmiddle"></a>
                        <%}%></td>
                      </tr>
                </table>
			  <%}
			  }
			  %></td>
            </tr>
            <tr>
              <td align=center bgcolor="#FFFFFF">
			    <table width="100%" border="0" cellspacing="0" cellpadding="0" name-"ctlTable" id="ctlTable" style="display:none">
                  <tr>
                    <td><table  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
                      <tr>
                        <td bgcolor="#FFFFFF"><%
Calendar cal = Calendar.getInstance();
String year = "" + (cal.get(cal.YEAR));
String month = "" + (cal.get(cal.MONTH) + 1);
com.redmoon.oa.Config cfg = new com.redmoon.oa.Config();
String filepath = cfg.get("file_netdisk") + "/" + userName + "/" + year + "/" + month;
%>
                            <object classid="CLSID:DE757F80-F499-48D5-BF39-90BC8BA54D8C" codebase="<%=request.getContextPath()%>/activex/webedit.cab#version=4,0,1,1" width=400 height=0 align="middle" id="webedit">
                              <param name="Encode" value="utf-8">
                              <param name="MaxSize" value="<%=Global.MaxSize%>">
                              <!--上传字节-->
                              <param name="ForeColor" value="(0,0,0)">
                              <param name="BgColor" value="(245,248,247)">
                              <param name="ForeColorBar" value="(255,255,255)">
                              <param name="BgColorBar" value="(0,0,255)">
                              <param name="ForeColorBarPre" value="(0,0,0)">
                              <param name="BgColorBarPre" value="(200,200,200)">
                              <param name="FilePath" value="<%=filepath%>">
                              <param name="Relative" value="1">
                              <!--上传后的文件需放在服务器上的路径-->
                              <param name="Server" value="<%=request.getServerName()%>">
                              <param name="Port" value="<%=request.getServerPort()%>">
                              <param name="VirtualPath" value="<%=Global.virtualPath%>">
                              <param name="PostScript" value="<%=Global.virtualPath%>/netdisk/dir_list_do.jsp">
                              <param name="PostScriptDdxc" value="<%=Global.virtualPath%>/ddxc.jsp">
                              <param name="SegmentLen" value="204800">
                          </object></td>
                      </tr>
                    </table></td>
                  </tr>
                  <tr>
                    <td align="center" height="40">&nbsp;
                      <input name="notuploadfile" type="button" class="singleboarder" value=" 上 传 " onClick="return SubmitWithoutFile()">
&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="remsg" type="button" class="singleboarder" onClick='alert(webedit.ReturnMessage)' value="返回信息">
&nbsp;<span class="p14">
<input type="hidden" name=isuploadfile value="true">
<input type="hidden" name=id value="<%=doc!=null?""+doc.getID():""%>">
<input type="hidden" name="op" value="<%=op%>">
<input type="hidden" name="title" value="<%=leaf.getName()%>">
<input type="hidden" name="dir_code" value="<%=dir_code%>">
<input type="hidden" name="examine" value="<%=Document.EXAMINE_PASS%>">
</span></td>
                  </tr>
              </table>		      </td>
            </tr>
        </form>
      </table>
   
		  <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="30" align="right">共 <b><%=paginator.getTotal() %></b> 个 每页显示 <b><%=paginator.getPageSize() %></b> 个 页次 <b><%=paginator.getCurrentPage() %>/<%=paginator.getTotalPages() %></b>
                  <%
	String querystr = "op=editarticle&orderBy=" + orderBy + "&sort=" + sort + "&dir_code=" + StrUtil.UrlEncode(dir_code);
    out.print(paginator.getCurPageBlock("?"+querystr));
%>
                  <input name="button" type="button" class="button1" onClick="displayCtlTable(this)" value="上 传">
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
            </tr>
          </table>
		  <table width="100%"  border="0">
          
          <tr>
            <form name="form3" action="?" method="post"><td align="center">
			<input name="newname" type="hidden">
			</td></form>
          </tr>
      </table>
	</TD>
  </TR>
</TABLE>
<div id="ie5menu" class="skin0" onMouseover="highlightie5(event)" onMouseout="lowlightie5(event)" onClick="jumptoie5(event)" style="display:none">
<div class="menuitems" url="javascript:openFile()">打开</div>
<div class="menuitems" url="javascript:changeName()">重命名</div>
<div class="menuitems" url="javascript:move()">移动文件</div>
<div class="menuitems" url="javascript:del()">删除</div>
<div class="menuitems" url="javascript:download()">下载</div>
<div class="menuitems" url="javascript:publicShare()">发布</div>
<hr width=100%>
<div class="menuitems" url="dir_list.jsp?op=editarticle&dir_code=<%=StrUtil.UrlEncode(dir_code)%>">刷新</div>
</div>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<form name=form10 action="?">
<tr><td>&nbsp;
<input name="op" type="hidden" value="editarticle">
<input name="action" type="hidden">
<input name="dir_code" type="hidden" value="<%=dir_code%>">
<input name="newname" type="hidden">
<input name="attach_id" type="hidden">
<input name="doc_id" type="hidden" value="<%=id%>">
<input name="page_num" type="hidden" value="1">
<input name="CPages" type="hidden" value="<%=curpage%>"></td></tr>
</form>
</table>
<iframe id="hideframe" name="hideframe" src="fwebedit_do.jsp" width=0 height=0></iframe>
</body>
<script>
function changeAttachName(attach_id, doc_id, nm) {
	var obj = findObj(nm);
	// document.frames.hideframe.location.href = "fwebedit_do.jsp?op=changeattachname&page_num=1&doc_id=" + doc_id + "&attach_id=" + attach_id + "&newname=" + obj.value
	form3.action = "dir_list_do.jsp?op=changeattachname&page_num=1&doc_id=" + doc_id + "&attach_id=" + attach_id;
	form3.newname.value = obj.value;
	form3.submit();
}

function delAttach(attach_id, doc_id) {
	if (!window.confirm("您确定要删除吗?")) {
		return;
	}
	document.frames.hideframe.location.href = "dir_list_do.jsp?op=delAttach&page_num=1&doc_id=" + doc_id + "&attach_id=" + attach_id
}

var curOrderBy = "<%=orderBy%>";
var sort = "<%=sort%>";
function doSort(orderBy) {
	if (orderBy==curOrderBy)
		if (sort=="asc")
			sort = "desc";
		else
			sort = "asc";
	window.location.href = "?dir_code=<%=StrUtil.UrlEncode(dir_code)%>&op=editarticle&orderBy=" + orderBy + "&sort=" + sort;
}
</script>
<script language="JavaScript1.2">

//set this variable to 1 if you wish the URLs of the highlighted menu to be displayed in the status bar
var display_url=0

var ie5=document.all&&document.getElementById
var ns6=document.getElementById&&!document.all
if (ie5||ns6)
var menuobj=document.getElementById("ie5menu")

function showmenuie5(e){
if (curAttachId=="")
	return;
//Find out how close the mouse is to the corner of the window
var rightedge=ie5? document.body.clientWidth-event.clientX : window.innerWidth-e.clientX
var bottomedge=ie5? document.body.clientHeight-event.clientY : window.innerHeight-e.clientY

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<menuobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
menuobj.style.left=ie5? document.body.scrollLeft+event.clientX-menuobj.offsetWidth : window.pageXOffset+e.clientX-menuobj.offsetWidth
else
//position the horizontal position of the menu where the mouse was clicked
menuobj.style.left=ie5? document.body.scrollLeft+event.clientX : window.pageXOffset+e.clientX

//same concept with the vertical position
if (bottomedge<menuobj.offsetHeight)
menuobj.style.top=ie5? document.body.scrollTop+event.clientY-menuobj.offsetHeight : window.pageYOffset+e.clientY-menuobj.offsetHeight
else
menuobj.style.top=ie5? document.body.scrollTop+event.clientY : window.pageYOffset+e.clientY

menuobj.style.visibility="visible"
return false
}

function hidemenuie5(e){
menuobj.style.visibility="hidden"
}

function highlightie5(e){
var firingobj=ie5? event.srcElement : e.target
if (firingobj.className=="menuitems"||ns6&&firingobj.parentNode.className=="menuitems"){
if (ns6&&firingobj.parentNode.className=="menuitems") firingobj=firingobj.parentNode //up one node
firingobj.style.backgroundColor="highlight"
firingobj.style.color="white"
if (display_url==1)
window.status=event.srcElement.url
}
}

function lowlightie5(e){
var firingobj=ie5? event.srcElement : e.target
if (firingobj.className=="menuitems"||ns6&&firingobj.parentNode.className=="menuitems"){
if (ns6&&firingobj.parentNode.className=="menuitems") firingobj=firingobj.parentNode //up one node
firingobj.style.backgroundColor=""
firingobj.style.color="black"
window.status=''
}
}

function jumptoie5(e){
var firingobj=ie5? event.srcElement : e.target
if (firingobj.className=="menuitems"||ns6&&firingobj.parentNode.className=="menuitems"){
if (ns6&&firingobj.parentNode.className=="menuitems") firingobj=firingobj.parentNode
if (firingobj.getAttribute("target"))
window.open(firingobj.getAttribute("url"),firingobj.getAttribute("target"))
else
window.location=firingobj.getAttribute("url")
}
}

if (ie5||ns6){
menuobj.style.display=''
document.oncontextmenu=showmenuie5
document.onclick=hidemenuie5
}

function onMouseUp(attachId, attachName) {
	// 左键
	curAttachId = attachId;
	curAttachName = attachName;
	if (event.button==1) {
		// alert(id + "_" + attachId);
	}
	// 右键
	if (event.button==2) {
		// alert(id + "_" + attachId);
	}
}

var spanInnerHTML = "";
function changeName() {
	if (curAttachId!="") {
		spanObj = findObj("span" + curAttachId);
		spanInnerHTML = spanObj.innerHTML;
		spanObj.innerHTML = "<input name='newName' class=singleboarder size=22 value='" + curAttachName + "' onblur=\"doChange('" + curAttachId + "',this.value,'" + curAttachName + "'," + spanObj.name + ")\" onKeyDown=\"if (event.keyCode==13) this.blur()\">";
		addform.newName.focus();
		addform.newName.select();
	}
}

function doChange(attachId, newName, oldName, spanObj) {
	if (newName!=oldName) {
		form10.action.value = "changeName";
		form10.attach_id.value = attachId;
		form10.newname.value = newName;
		form10.submit();
	}
	else {
		spanObj.innerHTML = spanInnerHTML;
	}
	curAttachId = "";
}

function move() {
	window.location.href = "dir_change.jsp?attachId=" + curAttachId;
}

function del() {
	delAttach(curAttachId, id);
}

function openFile() {
	window.open("netdisk_getfile.jsp?id=" + id + "&attachId=" + curAttachId);
}

function download() {
	window.open("netdisk_downloadfile.jsp?id=" + id + "&attachId=" + curAttachId);
}

function publicShare() {
	window.location.href = "netdisk_public_share.jsp?attachId=" + curAttachId;
}
</script>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -