From 23d659d2038481a9105f5cf6fc81fbbb28d8df3e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Sep 2021 16:59:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=BA=94=E7=94=A8=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E6=98=AF=E5=90=A6=E6=9C=89=E7=AE=A1=E7=90=86=E5=91=98?= =?UTF-8?q?=E6=9D=83=E9=99=90=E8=BF=9B=E8=A1=8C=E7=95=8C=E9=9D=A2=E5=8C=BA?= =?UTF-8?q?=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../x_component_process_Application/Main.js | 14 ++++ .../MyWorkExplorer.js | 25 +++++-- .../WorkExplorer.js | 68 +++++++++++-------- 3 files changed, 73 insertions(+), 34 deletions(-) diff --git a/o2web/source/x_component_process_Application/Main.js b/o2web/source/x_component_process_Application/Main.js index 4c823b8822..d55d39ae11 100644 --- a/o2web/source/x_component_process_Application/Main.js +++ b/o2web/source/x_component_process_Application/Main.js @@ -56,6 +56,19 @@ MWF.xApplication.process.Application.Main = new Class({ this.node = new Element("div", { "styles": {"width": "100%", "height": "100%", "overflow": "hidden", "background-color": "#ffffff"} }).inject(this.content); + }, + isManager: function(){ + if( o2.typeOf(this.managerFlag) === "boolean" )return this.managerFlag; + if( o2.AC.isProcessManager() ){ + this.managerFlag = true; + return true; + } + if( (this.options.application.controllerList || [] ).contains( layout.desktop.session.user.distinguishedName ) ){ + this.managerFlag = true; + return true; + } + this.managerFlag = false; + return false; }, loadApplication: function(callback){ this.getApplication(function(){ @@ -359,6 +372,7 @@ MWF.xApplication.process.Application.Menu = new Class({ MWF.getJSON(menuUrl, function(json){ json.each(function(navi){ + if( navi.permission === "manager" && !this.app.isManager() )return; var naviNode = new Element("div", { "styles": this.app.css.startMenuNaviNode }); diff --git a/o2web/source/x_component_process_Application/MyWorkExplorer.js b/o2web/source/x_component_process_Application/MyWorkExplorer.js index e7d4618308..bb670fc504 100644 --- a/o2web/source/x_component_process_Application/MyWorkExplorer.js +++ b/o2web/source/x_component_process_Application/MyWorkExplorer.js @@ -60,13 +60,24 @@ MWF.xApplication.process.Application.MyWorkExplorer = new Class({ return new MWF.xApplication.process.Application.WorkExplorer.Work(data, this); }, removeWork: function(work, all){ - this.actions.removeWork(work.data.id, this.app.options.id, all, function(json){ - json.data.each(function(item){ - this.items.erase(this.works[item.id]); - if (this.works[item.id]) this.works[item.id].destroy(); - MWF.release(this.works[item.id]); - delete this.works[item.id]; + if( this.app.isManager() ){ + this.actions.removeWork(work.data.id, this.app.options.id, all, function(json){ + json.data.each(function(item){ + this.items.erase(this.works[item.id]); + if (this.works[item.id]) this.works[item.id].destroy(); + MWF.release(this.works[item.id]); + delete this.works[item.id]; + }.bind(this)); }.bind(this)); - }.bind(this)); + }else{ + var workId = work.data.id; + o2.Actions.load("x_processplatform_assemble_surface").WorkAction.delete(workId, function () { + this.items.erase(this.works[workId]); + if (this.works[workId]) this.works[workId].destroy(); + MWF.release(this.works[workId]); + delete this.works[workId]; + }.bind(this)) + } + } }); diff --git a/o2web/source/x_component_process_Application/WorkExplorer.js b/o2web/source/x_component_process_Application/WorkExplorer.js index 35a750e45f..c45e3a1cad 100644 --- a/o2web/source/x_component_process_Application/WorkExplorer.js +++ b/o2web/source/x_component_process_Application/WorkExplorer.js @@ -841,14 +841,24 @@ MWF.xApplication.process.Application.WorkExplorer.Work = new Class({ }.bind(this) }); } - if (this.data.control.allowVisit) { + if (this.data.control.allowVisit ) { this.workAreaNode.addEvents({ - "mouseover": function(){if (!this.readyRemove && !this.readyFlow) this.workAreaNode.setStyles(this.css.workItemWorkNode_over);}.bind(this), - "mouseout": function(){if (!this.readyRemove && !this.readyFlow) this.workAreaNode.setStyles(this.css.workItemWorkNode);}.bind(this) + "mouseover": function(){if (!this.readyRemove && !this.readyFlow) { + this.workAreaNode.setStyles(this.css.workItemWorkNode_over); + if(!this.explorer.app.isManager())this.workAreaNode.setStyle("cursor","default"); + }}.bind(this), + "mouseout": function(){if (!this.readyRemove && !this.readyFlow){ + this.workAreaNode.setStyles(this.css.workItemWorkNode); + if(!this.explorer.app.isManager())this.workAreaNode.setStyle("cursor","default"); + }}.bind(this) }); - this.titleAreaNode.addEvent("click", function(){ - this.loadChild(); - }.bind(this)); + if(this.explorer.app.isManager()){ + this.titleAreaNode.addEvent("click", function(){ + this.loadChild(); + }.bind(this)); + }else{ + this.workAreaNode.setStyle("cursor","default"); + } } }, processWork: function(e){ @@ -1111,30 +1121,34 @@ MWF.xApplication.process.Application.WorkExplorer.Work = new Class({ this.readyRemove = true; this.explorer.app.confirm("warn", e, lp.deleteWorkTitle, text, 350, 120, function(){ this.close(); - _self.explorer.app.confirm("warn", e, lp.deleteWorkTitle, {"html": lp.deleteAllWork}, 400, 220, function(){ - var inputs = this.content.getElements("input"); - var flag = ""; - for (var i=0; i