diff --git a/gulpfile.js b/gulpfile.js index c1be9588c6508090e8ed181ec731fafb3b2754f5..acae1e5f087d908d3c2cf15d1ab31d4c4f3720c4 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -510,7 +510,13 @@ function build_concat_xform(){ 'o2web/source/' + path + '/*.js', 'o2web/source/x_component_process_Work/Processor.js', '!o2web/source/' + path + '/Documenteditor.js ', - '!o2web/source/' + path + '/Office.js' + '!o2web/source/' + path + '/Office.js', + '!o2web/source/' + path + '/WpsOffice.js', + '!o2web/source/' + path + '/WpsOffice2.js', + '!o2web/source/' + path + '/YozoOffice.js', + '!o2web/source/' + path + '/IWebOffice.js', + '!o2web/source/' + path + '/OnlyOffice.js', + '!o2web/source/' + path + '/TinyMCEEditor.js' ]; var dest = 'target/o2server/servers/webServer/'+path+'/'; return gulp.src(src, {sourcemaps: true}) diff --git a/o2web/gulpfile.js b/o2web/gulpfile.js index 01b856b3ded644b95c231fdbc8fb6662288305e5..3d5ac9f090db8aa3631aafbbea8c0687a474fb87 100644 --- a/o2web/gulpfile.js +++ b/o2web/gulpfile.js @@ -213,7 +213,13 @@ function createXFormConcatTask(path, isMin, thisOptions) { 'source/' + path + '/*.js', 'source/x_component_process_Work/Processor.js', '!source/' + path + '/Documenteditor.js ', - '!source/' + path + '/Office.js' + '!source/' + path + '/Office.js', + '!source/' + path + '/WpsOffice.js', + '!source/' + path + '/WpsOffice2.js', + '!source/' + path + '/YozoOffice.js', + '!source/' + path + '/IWebOffice.js', + '!source/' + path + '/OnlyOffice.js', + '!source/' + path + '/TinyMCEEditor.js' ]; var dest = option.dest+'/' + path + '/'; return gulp.src(src, {sourcemaps: true}) diff --git a/o2web/source/o2_core/o2/xDesktop/Default.js b/o2web/source/o2_core/o2/xDesktop/Default.js index 3c0a6b896154192179eee35ac4cec621eef1bfbc..f4422cdcae69c9e8a227343a5e3091d8777d7139 100644 --- a/o2web/source/o2_core/o2/xDesktop/Default.js +++ b/o2web/source/o2_core/o2/xDesktop/Default.js @@ -365,7 +365,7 @@ o2.xDesktop.Default = new Class({ loadDefaultLnk: function(){ if (this.status && this.status.flatLnks && this.status.flatLnks.length){ this.status.flatLnks.each(function(lnkJson){ - console.log(lnkJson.name) + //console.log(lnkJson.name) this.addLnk(lnkJson); }.bind(this)); }else{ @@ -2038,7 +2038,7 @@ o2.xDesktop.Default.StartMenu.Item = new Class({ } }, _drag_leave: function(el, inObj){ - console.log("_drag_leave"); + //console.log("_drag_leave"); if (inObj.hasClass("layout_start_content_appContent")){ //this.node.inject(this.menu.appContentNode); }else if (inObj.hasClass("layout_start_groupItem_menu_content")){ @@ -2066,7 +2066,7 @@ o2.xDesktop.Default.StartMenu.Item = new Class({ }, _drag_cancel: function(dragging){ - console.log("_drag_cancel"); + //console.log("_drag_cancel"); dragging.hide(); if (this.layout.positionNode) this.layout.positionNode.hide(); if (this.dragRemoveNode) this.dragRemoveNode.hide(); diff --git a/o2web/source/x_component_process_Xform/WpsOffice2.js b/o2web/source/x_component_process_Xform/WpsOffice2.js index 8c1dc10bc997adc0c3bc289e3720e69ce21456f7..c379cf19ce870ccb62b292b7c16e35506ec2e51c 100644 --- a/o2web/source/x_component_process_Xform/WpsOffice2.js +++ b/o2web/source/x_component_process_Xform/WpsOffice2.js @@ -422,96 +422,99 @@ console.log("wps:" + this.mode); }); }.bind(this)); }, - startRevisions : async function (){ + startRevisions : function (){ //开启修订模式 - await this.wpsOffice.ready(); - const app = this.wpsOffice.Application; - - // 将当前文档的编辑状态切换成修订模式 - app.ActiveDocument.TrackRevisions = true; + this.wpsOffice.ready().then(function(){ + const app = this.wpsOffice.Application; + // 将当前文档的编辑状态切换成修订模式 + app.ActiveDocument.TrackRevisions = true; + }.bind(this)); }, - stopRevisions : async function (){ + stopRevisions : function (){ //关闭修订模式 - await this.wpsOffice.ready(); - const app = this.wpsOffice.Application; + this.wpsOffice.ready().then(function(){ + const app = this.wpsOffice.Application; + + // 将当前文档的编辑状态切换成修订模式 + app.ActiveDocument.TrackRevisions = false; + }.bind(this)); - // 将当前文档的编辑状态切换成修订模式 - app.ActiveDocument.TrackRevisions = false; }, - acceptAllRevisions : async function (callback){ + acceptAllRevisions : function (callback){ //接受所有修订 - await this.wpsOffice.ready(); - const app = this.wpsOffice.Application; - // 获取修订对象 - const revisions = await app.ActiveDocument.Revisions; - // 接受对指定文档的所有修订 - await revisions.AcceptAll(); - if(callback) callback(); - }, - rejectAllRevisions : async function (callback){ + this.wpsOffice.ready().then(function(){ + const app = this.wpsOffice.Application; + // 获取修订对象 + app.ActiveDocument.Revisions.then(function(revisions){ + // 接受对指定文档的所有修订 + revisions.AcceptAll().then(function(){ + if(callback) callback(); + }); + }.bind(this)); + + }.bind(this)); + }, + rejectAllRevisions : function (callback){ //拒绝所有修订 - await this.wpsOffice.ready(); - const app = this.wpsOffice.Application; - // 获取修订对象 - const revisions = await app.ActiveDocument.Revisions; - // 拒绝所有修订 - await revisions.RejectAll(); - if(callback) callback(); - }, - showRevisions : async function (){ - debugger + this.wpsOffice.ready().then(function(){ + const app = this.wpsOffice.Application; + // 获取修订对象 + app.ActiveDocument.Revisions.then(function(revisions){ + // 拒绝所有修订 + revisions.RejectAll().then(function(){ + if(callback) callback(); + }); + }.bind(this)); + }.bind(this)); + }, + showRevisions : function (){ //显示痕迹 - await this.wpsOffice.ready(); - - const app = this.wpsOffice.Application; - // 获取节对象 - const View = await app.ActiveDocument.ActiveWindow.View; - // 设置修订状态为最终状态 - View.RevisionsView = 0; + this.wpsOffice.ready().then(function(){ + const app = this.wpsOffice.Application; + // 获取节对象 + app.ActiveDocument.ActiveWindow.View.then(function(View){ + // 设置修订状态为最终状态 + View.RevisionsView = 0; - // 设置修订状态为 显示标记的最终状态 - View.ShowRevisionsAndComments = true; + // 设置修订状态为 显示标记的最终状态 + View.ShowRevisionsAndComments = true; + }); + }.bind(this)); }, - hideRevisions : async function (){ - - debugger - + hideRevisions : function (){ //隐藏 - await this.wpsOffice.ready(); - - const app = this.wpsOffice.Application; - // 获取节对象 - const View = await app.ActiveDocument.ActiveWindow.View; - // 设置修订状态为最终状态 - View.RevisionsView = 0; - - // 设置修订状态为 显示标记的最终状态 - View.ShowRevisionsAndComments = false; - }, - addControlButton : async function(text,callback){ - await this.wpsOffice.ready(); - const app = this.wpsOffice.Application; - controls = await app.CommandBars('StartTab').Controls; - const controlButton = await controls.Add(1); - controlButton.Caption = text; - - controlButton.OnAction = callback + this.wpsOffice.ready().then(function(){ + const app = this.wpsOffice.Application; + // 获取节对象 + app.ActiveDocument.ActiveWindow.View.then(function(View){ + // 设置修订状态为最终状态 + View.RevisionsView = 0; + // 设置修订状态为 显示标记的最终状态 + View.ShowRevisionsAndComments = false; + }); + }.bind(this)); }, - print : async function (){ - - debugger - + addControlButton : function(text,callback){ + this.wpsOffice.ready().then(function(){ + const app = this.wpsOffice.Application; + app.CommandBars('StartTab').Controls.then(function(controls){ + controls.Add(1).then(function(controlButton){ + controlButton.Caption = text; + controlButton.OnAction = callback + }); + }); + }.bind(this)); + }, + print : function (){ //隐藏 - await this.wpsOffice.ready(); - - const app = this.wpsOffice.Application; - - // 页面定制对象:更多菜单 - const printMenu = await app.CommandBars('TabPrintPreview'); - - await printMenu.Execute(); - + this.wpsOffice.ready().then(function(){ + const app = this.wpsOffice.Application; + // 页面定制对象:更多菜单 + app.CommandBars('TabPrintPreview').then(function(printMenu){ + printMenu.Execute(); + }); + }.bind(this)); }, exportPDF : function (){ var p1 = this.wpsOffice.ready(); @@ -649,35 +652,42 @@ console.log("wps:" + this.mode); this.destroy(); this.loadDocument(); }, - hasComments : async function (callback){ + hasComments : function (callback){ //是否有评论 - await this.wpsOffice.ready(); - const app = this.wpsOffice.Application; - var hasComments; - switch (this.json.officeType){ - case "word": - hasComments = await app.ActiveDocument.HasComments(); - break; - case "excel": - hasCommentsconst = await app.ActiveWorkbook.HasComments(); - break; - case "ppt": - hasComments = await app.ActivePresentation.HasComments(); - } - if(callback) callback(hasComments); - }, - showComments : async function (){ - await this.wpsOffice.ready(); - const app = this.wpsOffice.Application; - // 控制评论显示与否 - app.ActiveDocument.ActiveWindow.View.ShowComments = true; + this.wpsOffice.ready().then(function(){ + const app = this.wpsOffice.Application; + var hasComments; + switch (this.json.officeType){ + case "word": + hasComments = app.ActiveDocument.HasComments(); + break; + case "excel": + hasComments = app.ActiveWorkbook.HasComments(); + break; + case "ppt": + hasComments = app.ActivePresentation.HasComments(); + } + Promise.resolve(hasComments).then(function(comments){ + if(callback) callback(comments); + }); + }.bind(this)); + + }, + showComments : function (){ + this.wpsOffice.ready().then(function(){ + const app = this.wpsOffice.Application; + // 控制评论显示与否 + app.ActiveDocument.ActiveWindow.View.ShowComments = true; + }.bind(this)); }, - hideComments : async function (callback){ - await this.wpsOffice.ready(); - const app = this.wpsOffice.Application; - // 控制评论显示与否 - app.ActiveDocument.ActiveWindow.View.ShowComments = false; + hideComments : function (callback){ + this.wpsOffice.ready().then(function(){ + const app = this.wpsOffice.Application; + // 控制评论显示与否 + app.ActiveDocument.ActiveWindow.View.ShowComments = false; + }.bind(this)); + }, getComments : function (callback){ var p1 = this.wpsOffice.ready(); diff --git a/o2web/source/x_desktop/js/base_loader.js b/o2web/source/x_desktop/js/base_loader.js index e48e56b026ecbd8614efd3f361df6e3721b1a865..296dad28143ed3e452210d5d8ba7c022cdf17be2 100644 --- a/o2web/source/x_desktop/js/base_loader.js +++ b/o2web/source/x_desktop/js/base_loader.js @@ -188,10 +188,10 @@ if (!layout.isReady) { }; layout.openLoginQywx = function () { - console.log("开始login。。。。。。。。。。。。。"); + //console.log("开始login。。。。。。。。。。。。。"); var uri = locate.href.toURI(); - console.log("执行单点。。。。。。。。。。"); + //console.log("执行单点。。。。。。。。。。"); var action = new MWF.xDesktop.Actions.RestActions("", "x_organization_assemble_authentication", ""); action.getActions = function (actionCallback) { this.actions = {"sso": {"uri": "/jaxrs/qiyeweixin/code/{code}", "method": "GET"}}; @@ -202,8 +202,8 @@ if (!layout.isReady) { "async": true, "parameter": {"code": uri.getData("code")}, "success": function (json) { - console.log("单点成功。"); - console.log(json); + //console.log("单点成功。"); + //console.log(json); //基础数据。。。。 layout.session.user = json.data; // diff --git a/o2web/source/x_desktop/js/ddsso.js b/o2web/source/x_desktop/js/ddsso.js index 3b5a46311bb35f799327c2fbd37c11398ddcf827..83113113631e654d2bedc04cb232ba9f6ac735b9 100644 --- a/o2web/source/x_desktop/js/ddsso.js +++ b/o2web/source/x_desktop/js/ddsso.js @@ -52,7 +52,7 @@ o2.addReady(function () { action.invoke({ "name": "auth", "async": true, "parameter": { "code": info.code }, "success": function (json) { - console.debug(json); + //console.debug(json); layout.session.user = json.data; // var ua = navigator.userAgent.toLowerCase(); // console.log(ua); @@ -61,18 +61,18 @@ o2.addReady(function () { // console.log(dd.ios); // 如果有参数 开始启动流程 if (processId && applicationId) { - console.debug('获取到了流程信息 processId:'+processId+', applicationId:'+applicationId); + //console.debug('获取到了流程信息 processId:'+processId+', applicationId:'+applicationId); o2.Actions.load("x_processplatform_assemble_surface").ProcessAction.getWithProcessWithApplication(processId, applicationId, function (json) { - console.debug(json); + //console.debug(json); if (json.data) { MWF.xDesktop.requireApp("process.TaskCenter", "ProcessStarter", function () { - console.debug('启动流程'); + //console.debug('启动流程'); var starter = new MWF.xApplication.process.TaskCenter.ProcessStarter(json.data, layout.app, { "workData": {}, "identity": null, "latest": false, "onStarted": function (data, title, processName) { - console.debug('启动流程成功。。。。'); + //console.debug('启动流程成功。。。。'); var currentTask = []; data.each(function (work) { if (work.currentTaskIndex != -1) currentTask.push(work.taskList[work.currentTaskIndex].work); @@ -84,11 +84,11 @@ o2.addReady(function () { history.replaceState(null, "startProcess", uri); if (currentTask.length == 1) { var options = {"workId": currentTask[0], "appId": "process.Work"+currentTask[0]}; - console.debug(options); + //console.debug(options); layout.mobile = true; layout.openApplication(null, "process.Work", options); } else { - console.error('没有task'); + //console.error('没有task'); uri.toURI().go(); } }.bind(this)