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

📄 s_addfawennigao.jsp

📁 参照saas-oa写的一个oa系统的框架
💻 JSP
📖 第 1 页 / 共 4 页
字号:
<%@ page contentType="text/html; charset=gb2312" import="java.sql.*" errorPage="" %>
<html>
<head>
<title> OA 系统</title>
<link href="<%=request.getContextPath()%>/css/oa.css" rel="stylesheet" type="text/css">
<link href="<%=request.getContextPath()%>/css/layout.css" rel="stylesheet" type="text/css">
<LINK href="<%=request.getContextPath()%>/gw_css/css.css" type="text/css" rel="stylesheet">
<LINK href="<%=request.getContextPath()%>/gw_css/test.css" type="text/css" rel="stylesheet">

<style type="text/css">
<!--
.style1 {font-family: "Courier New", Courier, mono}
.style2 {color: #FF0000}
-->
</style>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/AlicnTree.js"></script>
<link rel="stylesheet" rev="stylesheet" href="<%=request.getContextPath()%>/css/AlicnTree.css" type="text/css" />
<SCRIPT language=vbscript>
                sub SelectTemplate
                  dim template
                  template = form.template.value
                  form.WebOffice.Template=template
                  form.WebOffice.WebLoadTemplate
                end sub
</SCRIPT>

<SCRIPT language=javascript>
function StatusMsg(mString){
  StatusBar.innerText=mString;
}

function Load(){
  try{
      form.WebOffice.WebUrl="http://www.ijipin.com:80/VOA/oa/document/OfficeServer.jsp?ttt=aaa";
      form.WebOffice.RecordID="1241314277546";
      form.WebOffice.Template="";
      form.WebOffice.FileName="1241314277546.doc";
      form.WebOffice.FileType=".doc";
      form.WebOffice.EditType="1";
      form.WebOffice.UserName="test2(经理)[系统管理]";
      form.WebOffice.WebOpen();  	//打开该文档
      StatusMsg(form.WebOffice.Status);
    }catch(e){
    }
}

function UnLoad(){
  try{
  if (!form.WebOffice.WebClose()){
     StatusMsg(form.WebOffice.Status);
  }else{
     StatusMsg("关闭文档...");
  }
  }catch(e){}
}

//作用:打开文档
function LoadDocument(){
  StatusMsg("正在打开文档...");
  if (!webform.WebOffice.WebOpen()){
     StatusMsg(webform.WebOffice.Status);
  }else{
     StatusMsg(webform.WebOffice.Status);
  }
}

//作用:保存文档
function SaveDocument(){
  if (!form.WebOffice.WebSave()){
     StatusMsg(form.WebOffice.Status);
     return false;
  }else{
     StatusMsg(form.WebOffice.Status);
     return true;
  }
}

function ShowRevision(mObject){
  var mFlag=mObject.value;
  if (mFlag=="显示痕迹"){
     mObject.value="隐藏痕迹";
     form.WebOffice.WebShow(true);
     StatusMsg("显示痕迹...");
  }else{
     mObject.value="显示痕迹";
     form.WebOffice.WebShow(false);
     StatusMsg("隐藏痕迹...");
  }
}
//作用:获取痕迹
function WebGetRevisions(){
  var i;
  var Text="";
  for (i = 1;i <= webform.WebOffice.WebObject.Revisions.Count;i++){
    Text=Text + webform.WebOffice.WebObject.Revisions.Item(i).Author;
    if (webform.WebOffice.WebObject.Revisions.Item(i).Type=="1"){
    Text=Text + '插入:'+webform.WebOffice.WebObject.Revisions.Item(i).Range.Text+"\r\n";
    }else{
    Text=Text + '删除:'+form.WebOffice.WebObject.Revisions.Item(i).Range.Text+"\r\n";
    }
  }
  alert("痕迹内容:\r\n"+Text);
}
//作用:获取痕迹
function WebGetRevisions(){
  var i;
  var Text="";
  for (i = 1;i <= form.WebOffice.WebObject.Revisions.Count;i++){
    Text=Text + form.WebOffice.WebObject.Revisions.Item(i).Author;
    if (form.WebOffice.WebObject.Revisions.Item(i).Type=="1"){
    Text=Text + '插入:'+form.WebOffice.WebObject.Revisions.Item(i).Range.Text+"\r\n";
    }else{
    Text=Text + '删除:'+form.WebOffice.WebObject.Revisions.Item(i).Range.Text+"\r\n";
    }
  }
  alert("痕迹内容:\r\n"+Text);
}
//作用:刷新文档
function WebReFresh(){
  form.WebOffice.WebReFresh();
  StatusMsg("文档已刷新...");
}

//作用:打开版本
function WebOpenVersion(){
  form.WebOffice.WebOpenVersion();
  StatusMsg(form.WebOffice.Status);
}

//作用:保存版本
function WebSaveVersion(){
  form.WebOffice.WebSaveVersion();
  StatusMsg(form.WebOffice.Status);

}

//作用:填充模板
function LoadBookmarks(){
  StatusMsg("正在填充模扳...");
  if (!form.WebOffice.WebLoadBookmarks()){
     StatusMsg(form.WebOffice.Status);
  }else{
     StatusMsg(form.WebOffice.Status);
  }
}

//作用:标签管理
function WebOpenBookMarks(){
  try{
    form.WebOffice.WebOpenBookmarks();
    StatusMsg(form.WebOffice.Status);
  }catch(e){}
}

//作用:设置书签值
function SetBookmarks(vbmName,vbmValue){
  if (!form.WebOffice.WebSetBookmarks(vbmName,vbmValue)){
     StatusMsg(form.WebOffice.Status);
  }else{
     StatusMsg(form.WebOffice.Status);
  }
}

//作用:获取书签值
function GetBookmarks(vbmName){
  var vbmValue;
  vbmValue=form.WebOffice.WebGetBookmarks(vbmName);
  return vbmValue;
}

//作用:打印文档
function WebOpenPrint(){
  try{
    form.WebOffice.WebOpenPrint();
    StatusMsg(form.WebOffice.Status);
  }catch(e){}
}


//作用:页面设置
function WebOpenPageSetup(){
   try{
	if (form.WebOffice.FileType==".doc"){
	form.WebOffice.WebObject.Application.Dialogs(178).Show();
	}else{
	form.WebOffice.WebObject.Application.Dialogs(7).Show;
	}
   }catch(e){

   }
}

//作用:插入图片
function WebOpenPicture(){
  try{
    form.WebOffice.WebOpenPicture();
    StatusMsg(form.WebOffice.Status);
  }catch(e){}
}

//作用:签名印章
function WebOpenSignature(){
  try{
    form.WebOffice.WebOpenSignature();
    StatusMsg(form.WebOffice.Status);
  }catch(e){}
}

//作用:验证印章A
function WebShowSignature(){
  try{
    form.WebOffice.WebShowSignature();
    StatusMsg(form.WebOffice.Status);
  }catch(e){}
}

//作用:验证印章B
function WebCheckSignature(){
  try{
    var i=form.WebOffice.WebCheckSignature();
    alert("检测结果:"+i+"\r\n 注释: (=-1 有非法印章) (=0 没有任何印章) (>=1 有多个合法印章)");
    StatusMsg(i);
  }catch(e){}
}

//作用:存为本地文件
function WebSaveLocal(){
  try{
    form.WebOffice.WebSaveLocal();
    StatusMsg(form.WebOffice.Status);
  }catch(e){}
}

//作用:打开本地文件
function WebOpenLocal(){
  try{
    form.WebOffice.WebOpenLocal();
    StatusMsg(form.WebOffice.Status);
  }catch(e){}
}

//作用:关闭或显示工具 参数1表示工具条名称  参数2为false时,表示关闭  (名称均可查找VBA帮助)
//参数2为true时,表示显示
function WebToolsVisible(ToolName,Visible){
  try{
    form.WebOffice.WebToolsVisible(ToolName,Visible);
    StatusMsg(form.WebOffice.Status);
  }catch(e){}
}


//作用:禁止或启用工具 参数1表示工具条名称  参数2表示工具条铵钮的编号  (名称和编号均可查找VBA帮助)
//参数3为false时,表示禁止  参数3为true时,表示启用
function WebToolsEnable(ToolName,ToolIndex,Enable){
  try{
    form.WebOffice.WebToolsEnable(ToolName,ToolIndex,Enable);
    StatusMsg(form.WebOffice.Status);
  }catch(e){}
}

//作用:保护与解除  参数1为true表示保护文档  false表示解除保护
function WebProtect(value){
  try{
    form.WebOffice.WebSetProtect(value,"");
  }catch(e){}
}


//作用:插入远程图片
function WebInsertImage(){
  try{
    form.WebOffice.WebInsertImage('','GoldgridLogo.jpg',true,4);   //参数1表示标签名称  参数2表示图片文件名  参数3为true透明  false表示不透明  参数4为4表示浮于文字上方  5表示衬于文字下方
    StatusMsg(form.WebOffice.Status);
  }catch(e){}
}

//作用:表格生成及填充
function WebSetWordTable(){
  var mText="",mTmp="",iColumns,iCells,iPost,iold=-1;
  var myRange=form.WebOffice.WebObject.Range(0,0);     //光标位置

  form.WebOffice.WebSetMsgByName("COMMAND","WORDTABLE");   //OfficeServer.asp  COMMAND=WORDTABLE
  if (form.WebOffice.WebSendMessage()){                    //OfficeServer.asp  OPTION=SENDMESSAGE
	iColumns = form.WebOffice.WebGetMsgByName("COLUMNS");  //列
	iCells = form.WebOffice.WebGetMsgByName("CELLS");     //行
	mText = form.WebOffice.WebGetMsgByName("WORDCONTENT");  //内容
	form.WebOffice.WebObject.Tables.Add(myRange,iCells,iColumns);   //生成表格
	//alert(mText);
	for (var n=0; n<iColumns; n++)
	{
   	  for (var i=0; i<iCells; i++)
	  {
		iPos  = mText.indexOf(";",1+iold);
		mTmp = mText.substring(iold+1,iPos);
		form.WebOffice.WebObject.Tables(1).Columns(n+1).Cells(i+1).Range.Text=mTmp;   //填充单元值
		iold = iPos;
	   }
	}
	form.idWordTable.disabled=true;
   }
   StatusMsg(form.WebOffice.Status);
}

//作用:获取文档Txt正文
function WebGetWordContent(){
  try{
    alert(form.WebOffice.WebObject.Content.Text);
  }catch(e){}
}

//作用:写Word内容
function WebSetWordContent(){
  var mText=window.prompt("请输入内容:","测试内容");
  if (mText==null){
     return (false);
  }
  else
  {
     //下面为显示选中的文本
     //alert(form.WebOffice.WebObject.Application.Selection.Range.Text);
     //下面为在当前光标出插入文本
     form.WebOffice.WebObject.Application.Selection.Range.InsertAfter (mText+"\n");
     //下面为在第一段后插入文本
     //form.WebOffice.WebObject.Application.ActiveDocument.Range(1).InsertAfter(mText);
  }
}

//作用:用Excel求和
function WebGetExcelContent(){
    form.WebOffice.WebObject.Application.Sheets(1).Select;
    form.WebOffice.WebObject.Application.Range("C5").Select;
    form.WebOffice.WebObject.Application.ActiveCell.FormulaR1C1 = "126";
    form.WebOffice.WebObject.Application.Range("C6").Select;
    form.WebOffice.WebObject.Application.ActiveCell.FormulaR1C1 = "446";
    form.WebOffice.WebObject.Application.Range("C7").Select;
    form.WebOffice.WebObject.Application.ActiveCell.FormulaR1C1 = "556";
    form.WebOffice.WebObject.Application.Range("C5:C8").Select;
    form.WebOffice.WebObject.Application.Range("C8").Activate;
    form.WebOffice.WebObject.Application.ActiveCell.FormulaR1C1 = "=SUM(R[-3]C:R[-1]C)";
    form.WebOffice.WebObject.Application.Range("D8").Select;
    alert(form.WebOffice.WebObject.Application.Range("C8").Text);
}


//作用:保护工作表单元
function WebSheetsLock(){
    form.WebOffice.WebObject.Application.Sheets(1).Select;

    form.WebOffice.WebObject.Application.Range("A1").Select;
    form.WebOffice.WebObject.Application.ActiveCell.FormulaR1C1 = "产品";
    form.WebOffice.WebObject.Application.Range("B1").Select;

⌨️ 快捷键说明

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