notesdraft_update.jsp
来自「java jsp教程」· JSP 代码 · 共 445 行 · 第 1/2 页
JSP
445 行
<!--\webapps\jsp\notesdraft_update.jsp by zhangl-->
<%@ page contentType="text/html;charset=GBK" %>
<%@ page import=" java.util.* "%>
<%@ page import="com.icss.cnpc.msgnote.vo.*"%>
<%@ page import="com.icss.j2ee.util.PageScrollUtil" %>
<%@ page import="com.icss.cnpc.msgnote.util.CommonUtil" %>
<%@ page import="com.icss.cnpc.msgnote.util.StringUtility" %>
<%@ page import="com.icss.cnpc.msgnote.util.DateUtility" %>
<%
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
%>
<%
String contextpath = request.getContextPath();
NoteInfoVO vo = (NoteInfoVO)request.getAttribute("notevo");
List attlist = (List)request.getAttribute("attlist");
int attatchnum = new Integer((String)request.getAttribute("attnums")).intValue();//当前允许最大附件数
int curattnum = attlist.size();//当前附件数
int number = new Integer((String)request.getAttribute("num")).intValue();
System.out.println("[check]notesdraft_update--attatchnum|curattnum|number---->"+attatchnum+"|"+curattnum+"|"+number);
String arg_noteTitle = StringUtility.filterNullObject((String)request.getAttribute("arg_noteTitle"));
String arg_sendPerson = StringUtility.filterNullObject((String)request.getAttribute("arg_sendPerson"));
String arg_sendUnit = StringUtility.filterNullObject((String)request.getAttribute("arg_sendUnit"));
String arg_status = StringUtility.filterNullObject((String)request.getAttribute("arg_status"));
String arg_impdegree = StringUtility.filterNullObject((String)request.getAttribute("arg_impdegree"));
String pagenumber = StringUtility.filterNullObject((String)request.getAttribute("pagenumber"));
String right = StringUtility.filterNullObject((String)request.getAttribute("right"));
System.out.println("right in jsp======================"+right);
String argnoteTitle = StringUtility.filterNullObject((String)request.getAttribute("argnoteTitle"));
String argimpdegree = StringUtility.filterNullObject((String)request.getAttribute("argimpdegree"));
String argnoteBody = StringUtility.filterNullObject((String)request.getAttribute("argnoteBody"));
String argdate = StringUtility.filterNullObject((String)request.getAttribute("argdate"));
String argcurUnit = StringUtility.filterNullObject((String)request.getAttribute("argcurUnit"));
System.out.println("argcurUnit in new jsp======================"+argcurUnit);
int attachsize = CommonUtil.getAttachSize();
String attsize = String.valueOf(attachsize);
String islarge = (String)request.getAttribute("islarge");
String rootorgid = (String)request.getAttribute("rootorgid");
String isAudit = (String)request.getAttribute("isAudit");
String isState = (String)request.getAttribute("isState");
%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html;charset=GBK">
<link rel="stylesheet" href="<%=contextpath%>/css/style.css" type="text/css">
<script language="JavaScript" src="<%=contextpath%>/include/common.js"></script>
<SCRIPT language=JavaScript>
function updatedraft(flag1,CurID)
{
if(!_CheckForm1()){
return false
}
if(getLength(document.NotesForm.noteBody.value) > 2056){
alert("输入内容不能超过1028个汉字!");
return false;
}
NotesForm.operate.value=flag1;
NotesForm.ID.value=CurID;
var sform = document.NotesForm;
var filesnum=0;
for(var ii=0;ii<sform.length;ii++){
if(sform.elements[ii].type == "file")
filesnum++;
}
document.NotesForm.filesnumber.value = filesnum;
document.NotesForm.action="<%=contextpath%>/servlet/NoteSaveServlet";
document.NotesForm.submit();
}
function opencommit(flag,CurID)
{
if(!_CheckForm()){
return false
}
var str2 = document.NotesForm.validDate.value;
if(Compare_Date("<%=DateUtility.getCurrentDate()%>",str2))
{
alert("有效期小于当前日期!");
return false;
}
if(getLength(document.NotesForm.noteBody.value) > 2056){
alert("输入内容不能超过1028个汉字!");
return false;
}
NotesForm.ID.value=CurID;
NotesForm.operate.value=flag;
var sform = document.NotesForm;
var filesnum=0;
for(var ii=0;ii<sform.length;ii++){
if(sform.elements[ii].type == "file")
filesnum++;
}
document.NotesForm.filesnumber.value = filesnum;
document.NotesForm.action="<%=contextpath%>/servlet/NoteSaveServlet";
document.NotesForm.submit();
}
function _CheckForm()
{
return !Is_Null(document.NotesForm.noteTitle,1,'请填写公告标题!')
&& !Is_Null(document.NotesForm.noteBody,1,'请填写公告内容!')
&& !Is_Null(document.NotesForm.validDate,1,'请填写有效期!')
&& is_date(document.NotesForm.validDate,1,'请输入\'2005-06-01\'形式日期')
&& !Is_Null(document.NotesForm.orgname,1,'请填写公告发布范围!');
}
function _CheckForm1()
{
return !Is_Null(document.NotesForm.noteTitle,1,'请填写公告标题!')
&& !Is_Null(document.NotesForm.noteBody,1,'请填写公告内容!');
}
function _Add()
{
if(!_CheckForm()){
return false;
}
if (NotesForm.FullFileName.value==""){
document.NotesForm.action="/officeaffair/noteswriteservlet?HasFJFlag=0";
}
else{
document.NotesForm.action="/officeaffair/noteswriteservlet?HasFJFlag=1";
}
document.NotesForm.submit();
}
function _Reset()
{
document.NotesForm.Notes_Title.value="";
document.NotesForm.Notes_Body.value="";
document.NotesForm.Notes_Title.focus;
}
function _BackTo()
{
if(NotesForm.right.value == 3){
window.location ="<%=contextpath%>/servlet/NoteManageListServlet?noteTitle="+NotesForm.noteTitle1.value+"&sendPerson="+NotesForm.sendPerson1.value
+"&sendUnit="+NotesForm.sendUnit1.value+"&status="+NotesForm.status1.value+"&impdegree="+NotesForm.impdegree1.value+"&_page_num="+NotesForm.pagenumber.value;}
if(NotesForm.right.value == 1){
window.location ="<%=contextpath%>/servlet/MyNoteInfoServlet?noteTitle="+NotesForm.noteTitle1.value+"&sendPerson="+NotesForm.sendPerson1.value
+"&sendUnit="+NotesForm.sendUnit1.value+"&status="+NotesForm.status1.value+"&impdegree="+NotesForm.impdegree1.value+"&_page_num="+NotesForm.pagenumber.value;}
}
var attachnum = <%=attatchnum%>;
var curnum = 0;
var allnum = 0;
function addatt(src)
{
if(allnum > (attachnum-1) || curnum > (attachnum-1))
{
alert("附件最多不能超过10个!!");
return false;
}
maxNum = <%=attatchnum%>;
//alert(maxNum);
for(var i=0; i<maxNum; i++)
{
var obj = document.all["file" + i];
if(obj != null && obj.style)
{
if(obj.style.display && obj.style.display != "block")
{
obj.style.display = "block";
break;
}
}
}
curnum ++;
allnum ++;
if(i >= maxNum - 1)
{
src.parentElement.parentElement.parentElement.style.display = "none";
}
}
var delnum="";
function delatt(flag,j)
{
curfile = eval("document.all."+flag+".style");
var fileTD = document.getElementById("fileTD" + j);
if(fileTD)
{
fileTD.innerHTML = "<input name=\"uploadfile" + j + "\" type=\"file\">";
}
curfile.display = "none";
//attnums--;
curnum --;
allnum --;
delnum=","+j+delnum;
document.NotesForm.deletenum.value = delnum;;
if(allnum <= 0)//if(attnums < 0)
{
//document.all.display1.style.display = "none";
document.all.display.style.display = "";
}
else
{
if(allnum > attachnum-1)
{
//document.all.display1.style.display = "none";
document.all.display.style.display = "none";
document.all.display2.style.display = "none";
}
else
{
document.all.display.style.display = "";
//document.all.display1.style.display = "";
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?