From 62afe1308b8bc0f6c36aaf6a2ce9f424197a02b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=82=BB=E6=8B=96?= Date: Mon, 12 Dec 2022 11:28:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E8=84=9A=E6=9C=AC=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=89=88=E6=9C=AC=E6=81=A2=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../$Main/default/toolbar/resume.png | Bin 0 -> 473 bytes .../$Main/default/toolbars.html | 2 + .../Main.js | 116 +++++++++++++++--- .../lp/en.js | 11 ++ .../lp/zh-cn.js | 13 +- 5 files changed, 122 insertions(+), 20 deletions(-) create mode 100644 o2web/source/x_component_process_ScriptDesigner/$Main/default/toolbar/resume.png diff --git a/o2web/source/x_component_process_ScriptDesigner/$Main/default/toolbar/resume.png b/o2web/source/x_component_process_ScriptDesigner/$Main/default/toolbar/resume.png new file mode 100644 index 0000000000000000000000000000000000000000..acc30b853b3740bad231e4daa8e9f5a81f3f757b GIT binary patch literal 473 zcmV;~0Ve*5P)x=~R!WME*cb6K0H8ItD70ARH|h P00000NkvXXu0mjfzPQHT literal 0 HcmV?d00001 diff --git a/o2web/source/x_component_process_ScriptDesigner/$Main/default/toolbars.html b/o2web/source/x_component_process_ScriptDesigner/$Main/default/toolbars.html index fabe005072..aeb59746cc 100644 --- a/o2web/source/x_component_process_ScriptDesigner/$Main/default/toolbars.html +++ b/o2web/source/x_component_process_ScriptDesigner/$Main/default/toolbars.html @@ -12,6 +12,8 @@ + + 自动保存 diff --git a/o2web/source/x_component_process_ScriptDesigner/Main.js b/o2web/source/x_component_process_ScriptDesigner/Main.js index 48101f6439..a2f4fad1af 100644 --- a/o2web/source/x_component_process_ScriptDesigner/Main.js +++ b/o2web/source/x_component_process_ScriptDesigner/Main.js @@ -36,7 +36,7 @@ MWF.xApplication.process.ScriptDesigner.Main = new Class({ this.actions = MWF.Actions.get("x_processplatform_assemble_designer"); //this.actions = new MWF.xApplication.process.ProcessManager.Actions.RestActions(); - + this.lp = MWF.xApplication.process.ScriptDesigner.LP; this.addEvent("queryClose", function(e){ @@ -46,7 +46,7 @@ MWF.xApplication.process.ScriptDesigner.Main = new Class({ }.bind(this)); // this.processData = this.options.processData; }, - + loadApplication: function(callback){ this.createNode(); if (!this.options.isRefresh){ @@ -325,14 +325,14 @@ MWF.xApplication.process.ScriptDesigner.Main = new Class({ //}; //this.desktop.openApplication(e, "process.ScriptDesigner", options); }, - + //loadContentNode------------------------------ loadContentNode: function(toolbarCallback, contentCallback){ this.contentToolbarNode = new Element("div#contentToolbarNode", { "styles": this.css.contentToolbarNode }).inject(this.contentNode); this.loadContentToolbar(toolbarCallback); - + this.editContentNode = new Element("div", { "styles": this.css.editContentNode }).inject(this.contentNode); @@ -537,36 +537,36 @@ MWF.xApplication.process.ScriptDesigner.Main = new Class({ // new MWF.widget.ScrollBar(this.designNode, {"distance": 100}); //}.bind(this)); }, - + //loadProperty------------------------ loadProperty: function(){ this.propertyTitleNode = new Element("div", { "styles": this.css.propertyTitleNode, "text": MWF.APPSD.LP.property }).inject(this.propertyNode); - + this.propertyResizeBar = new Element("div", { "styles": this.css.propertyResizeBar }).inject(this.propertyNode); this.loadPropertyResize(); - + this.propertyContentNode = new Element("div", { "styles": this.css.propertyContentNode }).inject(this.propertyNode); - + this.propertyDomArea = new Element("div", { "styles": this.css.propertyDomArea }).inject(this.propertyContentNode); - + this.propertyDomPercent = 0.3; this.propertyContentResizeNode = new Element("div", { "styles": this.css.propertyContentResizeNode }).inject(this.propertyContentNode); - + this.propertyContentArea = new Element("div", { "styles": this.css.propertyContentArea }).inject(this.propertyContentNode); - + this.loadPropertyContentResize(); this.setPropertyContent(); @@ -611,7 +611,7 @@ MWF.xApplication.process.ScriptDesigner.Main = new Class({ var x = (Browser.name=="firefox") ? e.event.clientX : e.event.x; var y = (Browser.name=="firefox") ? e.event.clientY : e.event.y; el.store("position", {"x": x, "y": y}); - + var size = this.propertyNode.getSize(); el.store("initialWidth", size.x); }.bind(this), @@ -622,7 +622,7 @@ MWF.xApplication.process.ScriptDesigner.Main = new Class({ var position = el.retrieve("position"); var initialWidth = el.retrieve("initialWidth").toFloat(); var dx = position.x.toFloat()-x.toFloat(); - + var width = initialWidth+dx; if (width> bodySize.x/2) width = bodySize.x/2; if (width<40) width = 40; @@ -666,16 +666,16 @@ MWF.xApplication.process.ScriptDesigner.Main = new Class({ var size = this.propertyContentNode.getSize(); var resizeNodeSize = this.propertyContentResizeNode.getSize(); var height = size.y-resizeNodeSize.y; - + var domHeight = this.propertyDomPercent*height; var contentHeight = height-domHeight; - + this.propertyDomArea.setStyle("height", ""+domHeight+"px"); this.propertyContentArea.setStyle("height", ""+contentHeight+"px"); }, - - + + //resizeNode------------------------------------------------ resizeNode: function(){ if (!this.isMax){ @@ -724,7 +724,7 @@ MWF.xApplication.process.ScriptDesigner.Main = new Class({ this.scriptListResizeNode.setStyle("height", ""+y+"px"); } }, - + //loadForm------------------------------------------ loadScript: function(){ //this.scriptTab.addTab(node, title); @@ -848,5 +848,83 @@ MWF.xApplication.process.ScriptDesigner.Main = new Class({ return status; } return {"id": this.options.id, "application": application}; - } + }, + showScriptVersion: function(){ + + this.versionNode = new Element("div"); + this.dlg = o2.DL.open({ + "title": MWF.APPSD.LP.version["title"], + "content": this.versionNode, + "offset": {"y": -100}, + "isMax": false, + "width": 500, + "height": 300, + "buttonList": [ + { + "type": "cancel", + "text": MWF.APPSD.LP.version["close"], + "action": function(){ this.close(); } + } + ], + "onPostShow": function(){ + this.loadVersionList(); + }.bind(this), + "onPostClose": function(){ + this.dlg = null; + }.bind(this) + }); + }, + loadVersionList : function(){ + var tableHtml = "" + + "" + + "" + + "" + + "
"+MWF.APPSD.LP.version["no"]+""+MWF.APPSD.LP.version["updateTime"]+""+MWF.APPSD.LP.version["op"]+"
"; + this.versionNode.set("html", tableHtml); + this.versionTable = this.versionNode.getElement("table"); + this.action = o2.Actions.load("x_processplatform_assemble_designer"); + this.action.ScriptVersionAction.listWithForm(this.options.id, function(json){ + this.versionList = json.data; + this.versionList.each(function (version,index) { + var node = new Element("tr").inject(this.versionTable); + var html = ""+(index+1)+"" + + ""+version.updateTime+"" + + ""; + node.set("html", html); + var actionNode = new Element("div",{"styles":{ + "width": "60px", + "padding": "0px 3px", + "border-radius": "20px", + "cursor" : "pointer", + "color": "#ffffff", + "background-color": "#4A90E2", + "float": "left", + "margin-right": "2px", + "text-align": "center", + "font-weight": "100" + }}).inject(node.getLast("td")); + actionNode.set("text", MWF.APPSD.LP.version["resume"]); + actionNode.addEvent("click",function (e) { + + console.log(this); + var _self = this; + this.confirm("warn", e, MWF.APPSD.LP.version["resumeConfirm"], MWF.APPSD.LP.version["resumeInfo"], 460, 120, function(){ + _self.resumeScript(version); + this.close(); + }, function(){ + this.close(); + }); + }.bind(this)); + }.bind(this)) + }.bind(this)); + }, + resumeScript : function(version){ + this.action.ScriptVersionAction.get(version.id, function( json ){ + var scriptData = JSON.parse(json.data.data); + this.script.editor.setValue(scriptData.text) + + this.dlg.close(); + this.notice(MWF.APPSD.LP.version["resumeSuccess"]); + }.bind(this), null, false); + }, }); diff --git a/o2web/source/x_component_process_ScriptDesigner/lp/en.js b/o2web/source/x_component_process_ScriptDesigner/lp/en.js index 67133b7046..8f463959be 100644 --- a/o2web/source/x_component_process_ScriptDesigner/lp/en.js +++ b/o2web/source/x_component_process_ScriptDesigner/lp/en.js @@ -26,5 +26,16 @@ MWF.xApplication.process.ScriptDesigner.LP = { "inputName": "Please enter the script name" }, + "version" : { + "title" : "View form version history", + "close" : "Close", + "no":"SerialNumber", + "updateTime":"UpdateTime", + "op":"action", + "resume" : "Resume", + "resumeConfirm" : "Resume Confirmation", + "resumeInfo" : "Are you sure you need to perform a form recovery operation? After confirming the restoration, the current form will be updated, and the current form needs to be manually saved to take effect.", + "resumeSuccess" :"Resume Successfully" + }, "isSave": "Saving, please wait..." }; diff --git a/o2web/source/x_component_process_ScriptDesigner/lp/zh-cn.js b/o2web/source/x_component_process_ScriptDesigner/lp/zh-cn.js index e0f35428da..72fa96c4e3 100644 --- a/o2web/source/x_component_process_ScriptDesigner/lp/zh-cn.js +++ b/o2web/source/x_component_process_ScriptDesigner/lp/zh-cn.js @@ -27,5 +27,16 @@ MWF.xApplication.process.ScriptDesigner.LP = { "inputName": "请输入脚本名称" }, + "version" : { + "title" : "查看脚本版本记录", + "close" : "关闭", + "no":"序号", + "updateTime":"更新时间", + "op":"操作", + "resume" : "恢复", + "resumeConfirm" : "恢复确认", + "resumeInfo" : "您确认是否需要执行脚本恢复操作?确认恢复后当前脚本会更新,需要手动保存当前脚本才会生效。", + "resumeSuccess" :"恢复成功" + }, "isSave": "正在保存,请稍候..." -}; \ No newline at end of file +}; -- GitLab