`
fyjjack
  • 浏览: 32868 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

J.Office中的公文签名及签章

 
阅读更多

政府的很多系统都有涉及到电子签名及签章的管理功能,在joffice中,也有关于这部分的整合,先看以下的一界面:

电子印章、签名

 

我们提供另一种在EXT中比较容易使用J.Office控件,可以比较方便调用这些组件以实现在线的保留修改痕迹、签名、签章等。以下我们以整合金格的iWebOffice2009组件为例:

先写一OfficePanel:

 

Java代码 复制代码 收藏代码
  1. /**  
  2.  * 集成IWebOffice2009 Office控件,以方便实现签名,签章等功能  
  3.  * @class IWebOfficePanel  
  4.  * @extends Ext.Panel  
  5.  */  
  6. IWebOfficePanel=Ext.extend(Ext.Panel,{   
  7.     constructor:function(conf){   
  8.         Ext.applyIf(conf,this);   
  9.         this.initUI();   
  10.         IWebOfficePanel.superclass.constructor.call(this,{   
  11.             region:'center',   
  12.             layout:'form',   
  13.             items:[   
  14.             ]   
  15.         });   
  16.         this.on('afterrender',function(){   
  17.             this.body.appendChild(this.officeObj);   
  18.             //新建文档   
  19.             this.officeObj.CreateFile();   
  20.         },this);   
  21.            
  22.         this.on('destroy',function(){   
  23.             try{   
  24.                 //文档关闭   
  25.                 this.officeObj.WebClose();   
  26.               }catch(e){   
  27.                 alert(e.description);   
  28.               }   
  29.         },this);   
  30.     },   
  31.     initUI:function(){   
  32.         this.officeObj= document.createElement('object');   
  33.         this.officeObj.classid= "clsid:8B23EA28-2009-402F-92C4-59BE0E063499";    
  34.         this.officeObj.codebase = __ctxPath+'/js/core/iweboffice/iWebOffice2009.cab#version=10,3,0,0';   
  35.         this.officeObj.width = "100%";   
  36.         this.officeObj.height = "100%";   
  37.     },   
  38.        
  39.     openDoc:function(){   
  40.         ...   
  41.     },   
  42.     //签名   
  43.     sign:function(){   
  44.         ...   
  45.     },   
  46.         ....   
  47.  });  
/**
 * 集成IWebOffice2009 Office控件,以方便实现签名,签章等功能
 * @class IWebOfficePanel
 * @extends Ext.Panel
 */
IWebOfficePanel=Ext.extend(Ext.Panel,{
	constructor:function(conf){
		Ext.applyIf(conf,this);
		this.initUI();
		IWebOfficePanel.superclass.constructor.call(this,{
			region:'center',
			layout:'form',
			items:[
			]
		});
		this.on('afterrender',function(){
			this.body.appendChild(this.officeObj);
			//新建文档
			this.officeObj.CreateFile();
		},this);
		
		this.on('destroy',function(){
			try{
				//文档关闭
				this.officeObj.WebClose();
			  }catch(e){
			    alert(e.description);
			  }
		},this);
	},
	initUI:function(){
		this.officeObj= document.createElement('object');
		this.officeObj.classid= "clsid:8B23EA28-2009-402F-92C4-59BE0E063499"; 
		this.officeObj.codebase = __ctxPath+'/js/core/iweboffice/iWebOffice2009.cab#version=10,3,0,0';
		this.officeObj.width = "100%";
		this.officeObj.height = "100%";
	},
	
	openDoc:function(){
		...
	},
	//签名
	sign:function(){
		...
	},
        ....
 });

 简单调用示例:

 

 

Java代码 复制代码 收藏代码
  1. var officePanel=new IWebOfficePanel({   
  2.                     region:'center'  
  3.                 });   
  4.                    
  5.                 var mywin=new Ext.Window({   
  6.                     title:'J.Office中采用第三方Office控件及签章',   
  7.                     height:600,   
  8.                     width:1090,   
  9.                     layout:'border',   
  10.                     items:[officePanel]   
  11.                 });   
  12.                    
  13.                 mywin.show();  
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics