提交 06a23399 编写于 作者: NoSubject's avatar NoSubject

完成查看、切换、启用流程版本等功能

上级 2725b220
......@@ -33,7 +33,8 @@
"getProcess": {"uri": "/jaxrs/process/{id}"},
"addProcess": {"uri": "/jaxrs/process","method": "POST"},
"removeProcess": {"uri": "/jaxrs/process/{id}/true","method": "DELETE"},
//"removeProcess": {"uri": "/jaxrs/process/{id}/true","method": "DELETE"},
"removeProcess": {"uri": "/jaxrs/process/{id}/true/edition","method": "DELETE"},
"updataProcess": {"uri": "/jaxrs/process/{id}","method": "PUT"},
"listFormCategory": {"uri": "/jaxrs/formCategory/list/{id}/next/{count}"},
......
......@@ -231,15 +231,20 @@ o2.xDesktop.Default = new Class({
}
var currentTaskitem = null;
Object.each(this.status.apps, function(appStatus, id){
var app = { "options": appStatus };
var app = {
"options": appStatus,
"close": function(){
this.taskitem.destroy();
},
"setCurrent": function(){
this.taskitem.textNode.click();
}
};
taskitem = layout.desktop.createTaskItem(app);
app.taskitem = taskitem;
app.close = function(){
this.taskitem.destroy();
}
this.apps[appStatus.appId] = app;
if ((this.status.currentApp === appStatus.appId)) currentTaskitem=taskitem;
}.bind(this));
if (currentTaskitem) {
......
......@@ -396,6 +396,10 @@ MWF.xApplication.process.ProcessDesigner.Process = new Class({
if (this.designer.processEditionInforNode){
var text = this.designer.lp.currentEdition+": <span class='mainColor_color'>"+this.process.editionNumber+"</span> "+this.designer.lp.editionUpdate+": <span class='mainColor_color'>"+o2.name.cn(this.process.lastUpdatePerson)+" ("+this.process.updateTime+")</span>";
this.designer.processEditionInforNode.set("html", text);
this.designer.processEditionInforNode.addEvent("click", function(e){
this.listEdition(e);
}.bind(this));
}
}
},
......
......@@ -161,16 +161,22 @@ MWF.xApplication.process.ProcessDesigner.LP = {
"hasDiffs": "与上一版本差异:",
"open": "切换",
"enable": "启用",
"rollback": "回滚",
"override": "覆盖",
"del": "删除",
"openInfor": "保存当前打开的版本,并打开选定的版本。",
"openInfor": "保存当前打开的版本,并打开版本”{v}“。",
"enableInfor": "启用流程版本”{v}“",
"rollbackInfor": "将流程设计回滚所选版本,所有所选版本之后的版本会被删除。",
"overrideInfor": "用所选版本的设计覆盖当前版本。",
"delInfor": "删除流程版本”{v}“。",
"enabledProcessTitle": "启用流程确认",
"enabledProcessInfor": "将当前流程设置为”启用“,原来已启用的流程版本将被设置为”未启用“。<br><br>已经在流转的流程实例不会受到影响,下次启动流程时,会以已启用的流程版本为模板创建流程实例。<br><br>您确定要将当前流程设置为”启用“吗?"
"enabledProcessInfor": "将当前流程设置为”启用“,原来已启用的流程版本将被设置为”未启用“。<br><br>已经在流转的流程实例不会受到影响,下次启动流程时,会以已启用的流程版本为模板创建流程实例。<br><br>您确定要将当前流程设置为”启用“吗?",
"deleteEditionTitle": "删除版本确认",
"deleteEditionInfor": "删除选中的流程版本”{v}“,同时也会删除流程版本”{v}“的流转中实例。您确定要删除流程版本”{v}“吗?",
}
};
\ No newline at end of file
......@@ -67,9 +67,12 @@
"listTable_td_right": {
"border-right-width": "0px"
},
"listTable_td_action": {
"listTable_td_icon": {
"width": "20px"
},
"listTable_td_action": {
"width": "80px"
},
"unselectIcon": {
"width": "12px",
"height": "12px",
......@@ -96,5 +99,26 @@
"diffLine": {
"padding": "5px 10px 0px 10px"
},
"enableAction": {
"width": "30px",
"padding": "0px 3px",
"border-radius": "20px",
"color": "#ffffff",
"background-color": "#4A90E2",
"float": "left",
"margin-right": "2px",
"text-align": "center",
"font-weight": "100"
},
"delAction": {
"width": "30px",
"padding": "0px 3px",
"border-radius": "20px",
"color": "#ffffff",
"background-color": "#c04444",
"float": "left",
"text-align": "center"
}
}
\ No newline at end of file
......@@ -13,7 +13,7 @@ MWF.xApplication.process.ProcessDesigner.widget.EditionList = new Class({
this.path = "/x_component_process_ProcessDesigner/widget/$EditionList/";
this.cssPath = "/x_component_process_ProcessDesigner/widget/$EditionList/"+this.options.style+"/css.wcss";
this._loadCss();
this.selectedItem = null;
this.currentItem = null;
this.items = [];
this.lp = MWF.xApplication.process.ProcessDesigner.LP;
},
......@@ -32,7 +32,10 @@ MWF.xApplication.process.ProcessDesigner.widget.EditionList = new Class({
this.resizeNode = new Element("div", {"styles": this.css.resizeNode}).inject(this.rightNode);
this.diffNode = new Element("div", {"styles": this.css.diffNode}).inject(this.rightNode);
//this.listTable = new Element("table", {"styles": this.css.listNode}).inject(this.listNode);
this.createListTable();
this.show();
},
createListTable: function(){
var tableHtml = "<table width='100%' cellspacing='0' cellpadding='3'><tr>" +
"<th></th>" +
"<th>"+this.lp.edition_list.number+"</th>" +
......@@ -40,14 +43,25 @@ MWF.xApplication.process.ProcessDesigner.widget.EditionList = new Class({
"<th>"+this.lp.edition_list.updatePerson+"</th>" +
"<th>"+this.lp.edition_list.enabled+"</th>" +
"<th>"+this.lp.edition_list.description+"</th>" +
"<th>"+this.lp.edition_list.action+"</th>" +
"</tr></table>";
this.listNode.set("html", tableHtml);
this.listTable = this.listNode.getElement("table");
this.listTable.setStyles(this.css.listTable);
var ths = this.listNode.getElements("th").setStyles(this.css.listTable_th);
ths[ths.length-1].setStyles(this.css.listTable_td_right);
},
reloadList: function(){
debugger;
this.items = [];
this.listNode.empty();
this.diffNode.empty();
this.show();
this.createListTable();
o2.Actions.load("x_processplatform_assemble_designer").ProcessAction.listEdition(this.application, this.edition, function(json){
this.editionList = json.data;
this.listEditionDlg();
}.bind(this));
},
show: function(){
if (!this.dlg){
......@@ -58,14 +72,17 @@ MWF.xApplication.process.ProcessDesigner.widget.EditionList = new Class({
"isMax": true,
"width": 900,
"height": 500,
"buttonList": [{
"text": this.lp.edition_list.open,
"action": function(){ this.openCurrentEdition(); this.dlg.close();}.bind(this),
"title": this.lp.edition_list.openInfor
},{
"text": MWF.xApplication.process.ProcessDesigner.LP.close,
"action": function(){ this.close(); }
}],
"buttonList": [
{
"text": this.lp.edition_list.open,
"action": function(){ this.openCurrentEdition(); this.dlg.close();}.bind(this),
"title": this.lp.edition_list.openInfor
},
{
"text": MWF.xApplication.process.ProcessDesigner.LP.close,
"action": function(){ this.close(); }
}
],
"onPostShow": function(){
this.setEvent();
}.bind(this)
......@@ -101,6 +118,8 @@ MWF.xApplication.process.ProcessDesigner.widget.EditionList = new Class({
var x = drag.x - e.event.x;
var w = leftSize.x-x;
w = (w/size.x)*100;
if (w<30) w = 30;
if (w>70) w = 70;
this.leftNode.setStyle("width", ""+w+"%");
w = 100-w;
this.rightNode.setStyle("width", ""+w+"%");
......@@ -108,7 +127,6 @@ MWF.xApplication.process.ProcessDesigner.widget.EditionList = new Class({
});
},
openCurrentEdition: function(){
debugger;
if (this.currentItem && this.currentItem.edition.fullProcess.id != this.process.process.id){
this.process.save(function(){
this.process.reload(this.currentItem.edition.fullProcess);
......@@ -141,21 +159,76 @@ MWF.xApplication.process.ProcessDesigner.widget.EditionList.Item = new Class({
"<td>"+this.edition.updateTime+"</td>" +
"<td>"+o2.name.cn(this.edition.lastUpdatePerson)+"</td>" +
"<td>"+(this.edition.editionEnable ? this.lp.edition_list.yes : this.lp.edition_list.no)+"</td>"+
"<td>"+(this.edition.editionDes || "")+"</td>";
"<td>"+(this.edition.editionDes || "")+"</td>"+
"<td></td>";
this.node.set("html", html);
var tds = this.node.getElements("td").setStyles((this.isCurrentEdition) ? this.css.listTable_td_current : this.css.listTable_td);
tds[tds.length-1].setStyles(this.css.listTable_td_right);
this.actionTd = tds[0].setStyles(this.css.listTable_td_action);;
this.iconTd = tds[0].setStyles(this.css.listTable_td_icon);
this.selectIconNode = new Element("div", {"styles": this.css.unselectIcon}).inject(this.iconTd);
this.actionTd = tds[tds.length-1].setStyles(this.css.listTable_td_action);
this.createActions();
this.selectIconNode = new Element("div", {"styles": this.css.unselectIcon}).inject(this.actionTd);
this.setEvent();
},
createActions: function(){
if (!this.edition.editionEnable){
this.enableAction = new Element("div.mainColor_bg", {"styles": this.css.enableAction, "text": this.lp.edition_list.enable}).inject(this.actionTd);
var text = this.lp.edition_list.enableInfor.replace(/{v}/, this.edition.editionNumber);
this.enableAction.set("title", text);
}
if (!this.isCurrentEdition && !this.edition.editionEnable){
this.delAction = new Element("div", {"styles": this.css.delAction, "text": this.lp.edition_list.del}).inject(this.actionTd);
text = this.lp.edition_list.delInfor.replace(/{v}/, this.edition.editionNumber);
this.delAction.set("title", text);
}
},
setEvent: function(){
this.node.addEvent("click", function(){
this.selected();
}.bind(this));
if (this.enableAction) this.enableAction.addEvents({
"click": function(e){ this.enable(e); e.stopPropagation();}.bind(this),
});
if (this.delAction) this.delAction.addEvents({
"click": function(e){ this.del(e); e.stopPropagation();}.bind(this),
});
},
enable: function(e){
var actions = o2.Actions.load("x_processplatform_assemble_designer").ProcessAction;
var _self = this;
this.list.process.designer.confirm("infor", e, this.lp.edition_list.enabledProcessTitle, {"html": this.lp.edition_list.enabledProcessInfor}, 600, 120, function(){
_self.list.process.save(function(){
actions.enableProcess(this.edition.id, function(json){
this.list.reloadList();
actions.get(this.list.process.process.id, function(processJson){
this.list.process.reload(processJson.data);
}.bind(this));
}.bind(this));
}.bind(_self));
this.close();
},function(){this.close();})
},
del: function(e){
var _self = this;
var infor = this.lp.edition_list.deleteEditionInfor.replace(/{v}/g, this.edition.editionNumber);
this.list.process.designer.confirm("warn", e, this.lp.edition_list.deleteEditionTitle, infor, 460, 120, function(){
_self.deleteEdition();
this.close();
}, function(){
this.close();
});
},
deleteEdition: function(callback){
o2.Actions.load("x_processplatform_assemble_designer").ProcessAction["delete"](this.edition.id, "true", function(){
this.unSelected();
this.node.destroy();
if (callback) callback();
}.bind(this));
},
selected: function(){
if (this.list.currentItem) this.list.currentItem.unSelected();
......@@ -179,9 +252,11 @@ MWF.xApplication.process.ProcessDesigner.widget.EditionList.Item = new Class({
var diffs = this.getDiffWithProcess(prevItem.edition.fullProcess);
if (diffs.length){
this.appendDiffLine(this.lp.edition_list.hasDiffs);
diffs.each(function(v){
this.appendDiffLine(v);
}.bind(this));
//for (var i=0; i<10; i++){
diffs.each(function(v){
this.appendDiffLine(v);
}.bind(this));
//}
}else{
this.appendDiffLine(this.lp.edition_list.noDiffs);
}
......@@ -274,14 +349,15 @@ MWF.xApplication.process.ProcessDesigner.widget.EditionList.Item = new Class({
return activityInfor;
//}.bind(this));
},
getFullProcess: function(callback){
getFullProcess: function(callback, async){
if (this.edition.fullProcess){
if (callback) callback();
}else{
var asyncGet = !!async;
o2.Actions.load("x_processplatform_assemble_designer").ProcessAction.get(this.edition.id, function(json){
this.edition.fullProcess = json.data;
if (callback) callback();
}.bind(this), null, false);
}.bind(this), null, asyncGet);
}
},
getPrevItem: function(){
......
......@@ -284,6 +284,30 @@ MWF.xApplication.process.ProcessManager.ProcessExplorer = new Class({
_getItemObject: function(item){
return new MWF.xApplication.process.ProcessManager.ProcessExplorer.Process(this, item)
},
showDeleteAction: function(){
if (!this.deleteItemsAction){
this.deleteItemsAction = new Element("div", {
"styles": this.css.deleteItemsAction,
"text": this.app.lp.deleteItems
}).inject(this.node);
this.deleteItemsAction.fade("in");
this.deleteItemsAction.position({
relativeTo: this.elementContentListNode,
position: 'centerTop',
edge: 'centerTop',
"offset": {"y": this.elementContentNode.getScroll().y}
});
this.deleteItemsAction.addEvent("click", function(){
var _self = this;
this.app.confirm("warn", this.deleteItemsAction, MWF.APPPM.LP.deleteProcessTitle, MWF.APPPM.LP.deleteProcess, 430, 120, function(){
_self.deleteItems();
this.close();
}, function(){
this.close();
});
}.bind(this));
}
},
deleteItems: function(){
this.hideDeleteAction();
while (this.deleteMarkItems.length){
......
......@@ -28,6 +28,9 @@ MWF.xApplication.process.ProcessManager.LP = {
"deleteElementTitle": "删除设计确认",
"deleteElement": "是否确定要删除选中的设计元素?",
"deleteProcessTitle": "删除设计确认",
"deleteProcess": "删除选中的流程,同时也会删除选中流程的流转中实例。确定要删除选中的流程吗?",
"process": {
"create": "新建流程",
"search": "搜索流程",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册