|
@@ -61,7 +61,7 @@
|
|
|
this.webOfficeObj.UserName = this.fileData.user;
|
|
|
this.webOfficeObj.FileName = this.fileData.filePath;
|
|
|
this.webOfficeObj.getResultJson = {};
|
|
|
- this.webOfficeObj.SaveServlet = "/common/upload";
|
|
|
+ this.webOfficeObj.SaveServlet = "/content/upload";
|
|
|
this.webOfficeObj.FileType = "."+this.fileData.filePath.split(".")[ this.fileData.filePath.split(".").length-1]; //FileType:文档类型 .doc .xls
|
|
|
this.webOfficeObj.ShowWindow = false; //显示/隐藏进度条
|
|
|
this.webOfficeObj.EditType = "1"; //设置加载文档类型 0 锁定文档,1无痕迹模式,2带痕迹模式
|
|
@@ -92,48 +92,7 @@
|
|
|
console.log(e.description);
|
|
|
}
|
|
|
},
|
|
|
- //服务端Servlet方式打开文档
|
|
|
- LoadServlet() {
|
|
|
- this.webOfficeObj = new WebOffice2015();
|
|
|
- try {
|
|
|
- this.webOfficeObj.ServerUrl = "http://localhost/dev-api/"; // 用来保存文件的Server
|
|
|
- var downloadLink = "profile/doc/web.docx";
|
|
|
- this.webOfficeObj.ShowMenu = 1;
|
|
|
- this.webOfficeObj.ShowToolBar = 0;
|
|
|
- this.SetGraySkin(); //设置控件皮肤
|
|
|
- if (this.webOfficeObj.WebOpen3(downloadLink)) // 文件在服务器上的相对路径 FileName
|
|
|
- {
|
|
|
- this.StatusMsg(this.webOfficeObj.Status);
|
|
|
- }
|
|
|
- } catch (e) {
|
|
|
- this.StatusMsg(e.description);
|
|
|
- }
|
|
|
- },
|
|
|
- //URL地址打开文档
|
|
|
- LoadURL() {
|
|
|
|
|
|
- try {
|
|
|
- this.webOfficeObj.ServerUrl = "http://localhost/dev-api/"; //服务器地址
|
|
|
- this.webOfficeObj.ShowMenu = 1;
|
|
|
- this.webOfficeObj.ShowToolBar = 0;
|
|
|
- this.webOfficeObj.UserName = "xqx";
|
|
|
- this.webOfficeObj.FileName = "web.docx";
|
|
|
- this.webOfficeObj.FileType = ".docx"; //FileType:文档类型 .doc .xls
|
|
|
- this.webOfficeObj.ShowWindow = true; //显示/隐藏进度条
|
|
|
- this.webOfficeObj.EditType = "1"; //设置加载文档类型 0 锁定文档,1无痕迹模式,2带痕迹模式
|
|
|
- this.webOfficeObj.setObj(document.getElementById('WebOffice'));
|
|
|
- if (!this.webOfficeObj.WebSetSkin(0xdbdbdb, 0xeaeaea, 0xeaeaea, 0xdbdbdb, 0xdbdbdb, 0xdbdbdb, 0x000000)) {
|
|
|
- alert(this.webOfficeObj.Status);
|
|
|
- } //设置控件皮肤 //设置控件皮肤
|
|
|
- alert("1")
|
|
|
- if (this.webOfficeObj.WebOpen2("/profile/doc/web.docx")) // 文件在服务器上的相对路径 FileName
|
|
|
- {
|
|
|
- this.StatusMsg(this.webOfficeObj.Status);
|
|
|
- }
|
|
|
- } catch (e) {
|
|
|
- this.StatusMsg(e.description);
|
|
|
- }
|
|
|
- },
|
|
|
//设置页面中的状态值
|
|
|
StatusMsg(mValue) {
|
|
|
try {
|
|
@@ -178,6 +137,48 @@
|
|
|
default:;return;
|
|
|
}
|
|
|
},
|
|
|
+ //服务端Servlet方式打开文档
|
|
|
+ LoadServlet() {
|
|
|
+ this.webOfficeObj = new WebOffice2015();
|
|
|
+ try {
|
|
|
+ this.webOfficeObj.ServerUrl = "http://localhost/dev-api/"; // 用来保存文件的Server
|
|
|
+ var downloadLink = "profile/doc/web.docx";
|
|
|
+ this.webOfficeObj.ShowMenu = 1;
|
|
|
+ this.webOfficeObj.ShowToolBar = 0;
|
|
|
+ this.SetGraySkin(); //设置控件皮肤
|
|
|
+ if (this.webOfficeObj.WebOpen3(downloadLink)) // 文件在服务器上的相对路径 FileName
|
|
|
+ {
|
|
|
+ this.StatusMsg(this.webOfficeObj.Status);
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ this.StatusMsg(e.description);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //URL地址打开文档
|
|
|
+ LoadURL() {
|
|
|
+
|
|
|
+ try {
|
|
|
+ this.webOfficeObj.ServerUrl = "http://localhost/dev-api/"; //服务器地址
|
|
|
+ this.webOfficeObj.ShowMenu = 1;
|
|
|
+ this.webOfficeObj.ShowToolBar = 0;
|
|
|
+ this.webOfficeObj.UserName = "xqx";
|
|
|
+ this.webOfficeObj.FileName = "web.docx";
|
|
|
+ this.webOfficeObj.FileType = ".docx"; //FileType:文档类型 .doc .xls
|
|
|
+ this.webOfficeObj.ShowWindow = true; //显示/隐藏进度条
|
|
|
+ this.webOfficeObj.EditType = "1"; //设置加载文档类型 0 锁定文档,1无痕迹模式,2带痕迹模式
|
|
|
+ this.webOfficeObj.setObj(document.getElementById('WebOffice'));
|
|
|
+ if (!this.webOfficeObj.WebSetSkin(0xdbdbdb, 0xeaeaea, 0xeaeaea, 0xdbdbdb, 0xdbdbdb, 0xdbdbdb, 0x000000)) {
|
|
|
+ alert(this.webOfficeObj.Status);
|
|
|
+ } //设置控件皮肤 //设置控件皮肤
|
|
|
+ alert("1")
|
|
|
+ if (this.webOfficeObj.WebOpen2("/profile/doc/web.docx")) // 文件在服务器上的相对路径 FileName
|
|
|
+ {
|
|
|
+ this.StatusMsg(this.webOfficeObj.Status);
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ this.StatusMsg(e.description);
|
|
|
+ }
|
|
|
+ },
|
|
|
//烟枪灰皮肤
|
|
|
SetGraySkin(){
|
|
|
//参数顺序依次为:控件标题栏颜色、自定义菜单开始颜色、自定义工具栏按钮开始颜色、自定义工具栏按钮结束颜色、
|