提交 62afe130 编写于 作者: 傻拖

流程脚本增加版本恢复

上级 111cab53
......@@ -12,6 +12,8 @@
<!-- -->
<!-- <span MWFnodetype="MWFToolBarButton" MWFButtonImage="help.png" title="帮助" MWFButtonAction="scriptHelp" MWFButtonText="" id="MWFScriptAutoCode"></span>-->
<span MWFnodetype="MWFToolBarSeparator"></span>
<span MWFnodetype="MWFToolBarButton" MWFButtonImage="resume.png" title="查看所有脚本版本" MWFButtonAction="showScriptVersion" MWFButtonText=""></span>
<span MWFnodetype="MWFToolBarSeparator"></span>
<input type="checkbox" value="autoSave" id="MWFScriptAutoSaveCheck">自动保存
......
......@@ -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 = "<table width='100%' cellspacing='0' cellpadding='3' style='margin-top: 1px'><tr>" +
"<th>"+MWF.APPSD.LP.version["no"]+"</th>" +
"<th>"+MWF.APPSD.LP.version["updateTime"]+"</th>" +
"<th>"+MWF.APPSD.LP.version["op"]+"</th>" +
"</tr></table>";
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 = "<td>"+(index+1)+"</td>" +
"<td>"+version.updateTime+"</td>" +
"<td></td>";
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);
},
});
......@@ -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..."
};
......@@ -27,5 +27,16 @@ MWF.xApplication.process.ScriptDesigner.LP = {
"inputName": "请输入脚本名称"
},
"version" : {
"title" : "查看脚本版本记录",
"close" : "关闭",
"no":"序号",
"updateTime":"更新时间",
"op":"操作",
"resume" : "恢复",
"resumeConfirm" : "恢复确认",
"resumeInfo" : "您确认是否需要执行脚本恢复操作?确认恢复后当前脚本会更新,需要手动保存当前脚本才会生效。",
"resumeSuccess" :"恢复成功"
},
"isSave": "正在保存,请稍候..."
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册