12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796 |
- MWF.xApplication.process = MWF.xApplication.process || {};
- MWF.xApplication.process.TaskCenter = MWF.xApplication.process.TaskCenter || {};
- MWF.require("MWF.widget.Mask", null, false);
- MWF.require("MWF.xDesktop.UserData", null, false);
- MWF.xDesktop.requireApp("process.TaskCenter", "TaskList", null, false);
- MWF.xDesktop.requireApp("process.TaskCenter", "TaskCompletedList", null, false);
- MWF.xDesktop.requireApp("process.TaskCenter", "ReadList", null, false);
- MWF.xDesktop.requireApp("process.TaskCenter", "ReadCompletedList", null, false);
- MWF.xDesktop.requireApp("process.TaskCenter", "ReviewList", null, false);
- MWF.xDesktop.requireApp("process.TaskCenter", "DraftList", null, false);
- MWF.xDesktop.requireApp("process.TaskCenter", "MyCreatedList", null, false);
- if (MWF.xApplication.process.TaskCenter.options) MWF.xApplication.process.TaskCenter.options.multitask = false;
- MWF.xApplication.process.TaskCenter.Main = new Class({
- Extends: MWF.xApplication.Common.Main,
- Implements: [Options, Events],
- options: {
- "style": "default",
- "name": "process.TaskCenter",
- "icon": "icon.png",
- "width": "1280",
- "height": "700",
- "title": MWF.xApplication.process.TaskCenter.LP.title,
- "filterMap": {
- "applicationList": "applicationList",
- "processList": "processList",
- "creatorUnitList": "creatorUnitList",
- "creatorCompanyList": "creatorCompanyList",
- "creatorDepartmentList": "creatorDepartmentList",
- "activityNameList": "activityNameList",
- "completedTimeMonthList": "completedTimeMonthList",
- "startTimeMonthList": "startTimeMonthList",
- "key": "key"
- }
- },
- onQueryLoad: function () {
- this.lp = MWF.xApplication.process.TaskCenter.LP;
- },
- loadApplication: function (callback) {
- this.appIcons = {};
- this.tabs = [];
- this.tabShadows = [];
- this.appStartableData = null;
- this.loadTitle();
- this.loadTab();
- this.loadFilterAction();
- this.loadContent();
- this.currentTab = "";
- this.openTab();
- if (callback) callback();
- if (layout.userLayout && !layout.userLayout.gotoWorkcenterConfirm && !layout.mobile) this.gotoWorkcenterComfirm();
- },
- gotoWorkcenterComfirm: function(){
- var _self = this;
- o2.DL.open({
- "title": "",
- "style": "user",
- "isResize": false,
- "text": this.lp.workcenter,
- "maskNode": this.content,
- "width": 500,
- "height": 150,
- "buttonList": [
- {
- "type": "ok",
- "text": MWF.LP.process.button.ok,
- "action": function (d, e) {
- this.close();
- _self.checkConfirm();
- _self.gotoWorkcenter();
- }
- },
- {
- "type": "cancel",
- "text": MWF.LP.process.button.cancel,
- "action": function () {
- _self.checkConfirm();
- this.close();
- }
- }
- ]
- });
- },
- checkConfirm: function(){
- layout.userLayout.gotoWorkcenterConfirm = true;
- },
- gotoWorkcenter: function(){
- debugger;
- layout.userLayout.flatLnks.forEach(function(lnk){
- if (lnk.name==="process.TaskCenter"){
- lnk.name="process.workcenter"
- }
- });
- this.close();
- if (layout.inBrowser && (o2.thirdparty.isDingdingPC() || o2.thirdparty.isQywxPC())) {
- var centerUrl = o2.filterUrl("../x_desktop/app.html?app=process.workcenter");
- history.replaceState(null, "work", centerUrl);
- centerUrl.toURI().go();
- } else {
- layout.openApplication(null, "process.workcenter");
- }
-
- },
- loadTitle: function () {
- this.loadTitleBar();
- if (!layout.mobile) this.loadTitleUserNode();
- this.loadStartProcessActionNode();
- if (!layout.mobile) this.loadTitleTextNode();
- this.loadSearchNode();
- },
- loadTitleBar: function () {
- this.taskTitleBar = new Element("div.mainColor_bg", {
- "styles": this.css.taskTitleBar
- }).inject(this.content);
- },
- loadTitleUserNode: function () {
- this.taskTitleUserNode = new Element("div", {
- "styles": this.css.taskTitleUserNode
- }).inject(this.taskTitleBar);
- this.taskTitleUserIconNode = new Element("div", {
- "styles": this.css.taskTitleUserIconNode
- }).inject(this.taskTitleUserNode);
- this.taskTitleUserTextNode = new Element("div", {
- "styles": this.css.taskTitleUserTextNode,
- "text": this.desktop.session.user.name
- }).inject(this.taskTitleUserNode);
- },
- loadStartProcessActionNode: function () {
- this.startProcessAction = new Element("div", {
- "styles": this.css.startProcessAction
- }).inject(this.taskTitleBar);
- this.startProcessAction.addEvents({
- "click": function (e) {
- this.showStartProcessArea(e);
- }.bind(this)
- });
- },
- loadTitleTextNode: function () {
- this.taskTitleTextNode = new Element("div", {
- "styles": this.css.taskTitleTextNode,
- "text": this.lp.title
- }).inject(this.taskTitleBar);
- var node = new Element("div.mainColor_color", {
- "styles": this.css.taskTitleInforTextNode,
- "text": this.lp.gotoWorkcenter
- }).inject(this.taskTitleBar);
- node.addEvent("click", this.gotoWorkcenter.bind(this));
- },
- loadSearchNode: function () {
- this.searchBarAreaNode = new Element("div", {
- "styles": this.css.searchBarAreaNode
- }).inject(this.taskTitleBar);
- if (layout.mobile) this.searchBarAreaNode.setStyle("margin-left", "10px");
- if (layout.mobile) this.searchBarAreaNode.setStyle("margin-right", "20px");
- this.searchBarNode = new Element("div", {
- "styles": this.css.searchBarNode
- }).inject(this.searchBarAreaNode);
- this.searchBarActionNode = new Element("div", {
- "styles": this.css.searchBarActionNode
- }).inject(this.searchBarNode);
- this.searchBarInputBoxNode = new Element("div", {
- "styles": this.css.searchBarInputBoxNode
- }).inject(this.searchBarNode);
- this.searchBarInputNode = new Element("input", {
- "type": "text",
- "value": this.lp.searchKey,
- "styles": this.css.searchBarInputNode
- }).inject(this.searchBarInputBoxNode);
- var _self = this;
- this.searchBarActionNode.addEvent("click", function () {
- this.searchTask();
- }.bind(this));
- this.searchBarInputNode.addEvents({
- "focus": function () {
- if (this.value === _self.lp.searchKey) this.set("value", "");
- },
- "blur": function () {
- if (!this.value) this.set("value", _self.lp.searchKey);
- },
- "keydown": function (e) {
- if (e.code === 13) {
- this.searchTask();
- e.preventDefault();
- }
- }.bind(this),
- "selectstart": function (e) {
- e.preventDefault();
- }
- });
- },
- loadTab: function () {
- this.tabAreaNode = new Element("div", {
- "styles": this.css.tabAreaNode
- }).inject(this.content);
- debugger;
- var size = this.content.getSize();
- if (size && size.x < 400) { //移动端屏幕宽度小的时候 5个tab会重叠
- this.tabAreaNode.setStyle("height", "80px");
- }
- this.createTabItem(this.lp.task, "task.png", "task", function () {
- this.showTask();
- }.bind(this));
- this.createTabItem(this.lp.done, "done.png", "taskCompleted", function () {
- this.showDone();
- }.bind(this));
- this.createTabItem(this.lp.read, "read.png", "read", function () {
- this.showRead();
- }.bind(this));
- this.createTabItem(this.lp.readed, "readed.png", "readCompleted", function () {
- this.showReaded();
- }.bind(this));
- this.createTabItem(this.lp.review, "review.png", "review", function () {
- this.showReview();
- }.bind(this));
- this.createTabItem(this.lp.draftTab, "draft.png", "draft", function () {
- this.showDraft();
- }.bind(this));
- this.createTabItem(this.lp.myCreated, "mycreated.png", "myCreated", function () {
- this.showMyCreated();
- }.bind(this));
- //this.createTabItem(this.lp.review, "review.png", "review", function(){this.showReview();}.bind(this));
- this.getWorkCounts();
- },
- // createTabItem: function (text, icon, countKey, action) {
- // if (COMMON.Browser.Platform.isMobile){
- // this.createTabItem_mobile(text, icon, countKey, action);
- // }else{
- // this.createTabItem_pc(text, icon, countKey, action);
- // }
- // },
- // createTabItem_mobile: function(text, icon, countKey, action){
- // var tab = new Element("div", {
- // "styles": this.css.tabItemNode
- // }).inject(this.tabAreaNode);
- //
- // var tabItem = new Element("div", {
- // "styles": this.css.tabItemAreaNode
- // }).inject(tab);
- //
- // var tabContent = new Element("div", {
- // "styles": this.css.tabItemContentNode_mobile
- // }).inject(tabItem);
- //
- // var tabText = new Element("div", {
- // "styles": this.css.tabItemTextNode_mobile,
- // "text": text
- // }).inject(tabContent);
- //
- // this[countKey+"CountNode"] = new Element("div", {
- // "styles": this.css.tabItemCountNode
- // }).inject(tabContent);
- //
- // tab.addEvent("click", function(){action();}.bind(this));
- //
- // this.tabs.push(tab);
- // },
- createTabItem: function(text, icon, countKey, action){
- var tab = new Element("div", {
- "styles": this.css.tabItemNode
- }).inject(this.tabAreaNode);
- if (!layout.mobile){
- var tabIcon = new Element("div", {
- "styles": this.css.tabItemIconNode
- }).inject(tab);
- tabIcon.setStyle("background-image", "url("+"../x_component_process_TaskCenter/$Main/default/tab/"+icon+")");
- }
- var tabText = new Element("div", {
- "styles": this.css.tabItemTextNode,
- "text": text
- }).inject(tab);
- this[countKey+"CountNode"] = new Element("div", {
- "styles": this.css.tabItemCountNode
- }).inject(tab);
- tab.addEvent("click", function(){action();}.bind(this));
- this.tabs.push(tab);
- },
- loadFilterAction: function(){
- // this.flterAction = new Element("div", {
- // "styles": this.css.tabItemNode
- // }).inject(this.tabAreaNode);
- //
- // var tabIcon = new Element("div", {
- // "styles": this.css.tabItemIconNode
- // }).inject(tab);
- // tabIcon.setStyle("background-image", "url("+"../x_component_process_TaskCenter/$Main/default/tab/"+icon+")");
- // var tabText = new Element("div", {
- // "styles": this.css.tabItemTextNode,
- // "text": text
- // }).inject(tab);
- //
- // this[countKey+"CountNode"] = new Element("div", {
- // "styles": this.css.tabItemCountNode
- // }).inject(tab);
- //
- // tab.addEvent("click", function(){action();}.bind(this));
- },
- getWorkCounts: function () {
- this.getAction(function () {
- this.action.getCount(function (json) {
- this.counts = json.data;
- this["taskCountNode"].set("text", "( " + ((this.counts.task > 100) ? "99+" : this.counts.task) + " )");
- this["taskCompletedCountNode"].set("text", "( " + ((this.counts.taskCompleted > 100) ? "99+" : this.counts.taskCompleted) + " )");
- this["readCountNode"].set("text", "( " + ((this.counts.read > 100) ? "99+" : this.counts.read) + " )");
- this["readCompletedCountNode"].set("text", "( " + ((this.counts.readCompleted > 100) ? "99+" : this.counts.readCompleted) + " )");
- this["reviewCountNode"].set("text", "[ "+((this.counts.review>100) ? "99+" : this.counts.review)+" ]");
- }.bind(this), null, this.desktop.session.user.distinguishedName);
- this.action.listDraftNext("(0)", 1, function (json) {
- this["draftCountNode"].set("text", "( " + ((json.count > 100) ? "99+" : json.count) + " )");
- }.bind(this));
- o2.Actions.load("x_processplatform_assemble_surface").ReviewAction.countWithPerson(layout.session.user.id, {
- creatorPersonList: [layout.session.user.id]
- }).then(function(json){
- var myCreated = json.data.count;
- this["myCreatedCountNode"].set("text", "( " + ((myCreated > 100) ? "99+" : myCreated) + " )");
- }.bind(this));
- }.bind(this));
- },
- loadContent: function(){
- this.contentNode = new Element("div", {"styles": this.css.contentNode}).inject(this.content);
- this.contentListAreaNode = new Element("div", {"styles": this.css.contentListAreaNode}).inject(this.contentNode);
- this.setContentNodeHeight();
- this.addEvent("resize", this.setContentNodeHeight.bind(this));
- },
- setContentNodeHeight: function(){
- var size = this.content.getSize();
- var titleSize = this.taskTitleBar.getSize();
- var tabSize = this.tabAreaNode.getSize();
- var y = size.y-titleSize.y-tabSize.y-1;
- this.contentNode.setStyle("height", ""+y+"px");
- var x = 0;
- if (this.taskList) x = x + size.x;
- if (this.taskCompletedList) x = x + size.x;
- if (this.readList) x = x + size.x;
- if (this.readCompletedList) x = x + size.x;
- this.contentListAreaNode.setStyle("width", ""+x+"px");
- },
- openTab: function () {
- var tab = "task";
- if (this.options.navi) tab = this.options.navi;
- if (this.status && this.status.navi) tab = this.status.navi;
- switch (tab) {
- case "task":
- this.showTask();
- break;
- case "done":
- this.showDone();
- break;
- case "read":
- this.showRead();
- break;
- case "readed":
- this.showReaded();
- break;
- case "review":
- this.showReview();
- break;
- case "draft":
- this.showDraft();
- break;
- case "myCreated":
- this.showMyCreated();
- break;
- default:
- this.showTask();
- break;
- }
- },
- showTask: function () {
- if (this.currentTab !== "task") {
- this.showTab(0);
- this.currentTab = "task";
- if (!this.taskList) {
- this.createTaskList();
- this.taskList.show();
- } else {
- this.taskList.show();
- if (this.taskList) this.taskList.refresh();
- }
- } else {
- if (this.taskList) this.taskList.refresh();
- }
- this.searchBarAreaNode.setStyle("display", "block");
- this.searchBarInputNode.set("value", this.lp.searchKey);
- },
- showTab: function (idx) {
- this.tabs.each(function (node, i) {
- if (i === idx) {
- node.getLast().setStyles(this.css.tabItemTextNode_current);
- if (!layout.mobile){
- node.getFirst().getNext().setStyles(this.css.tabItemTextNode_current);
- var icon = node.getFirst().getStyle("background-image");
- node.getFirst().setStyle("background-image", icon.replace(".png", "_cur.png"));
- }else{
- node.getFirst().setStyles(this.css.tabItemTextNode_current);
- }
- } else {
- node.getLast().setStyles(this.css.tabItemCountNode);
- if (!layout.mobile){
- node.getFirst().getNext().setStyles(this.css.tabItemTextNode);
- var icon = node.getFirst().getStyle("background-image");
- node.getFirst().setStyle("background-image", icon.replace("_cur.png", ".png"));
- }else{
- node.getFirst().setStyles(this.css.tabItemTextNode);
- }
- }
- }.bind(this));
- },
- createTaskList: function () {
- if (!this.contentNode) this.loadContent();
- this.taskList = new MWF.xApplication.process.TaskCenter.TaskList(this.contentListAreaNode, this);
- },
- //@todo 起草 搜索 筛选 。。。
- showStartProcessArea: function(){
- if (!this.processStarter) this.processStarter = new MWF.xApplication.process.TaskCenter.Starter(this);
- this.processStarter.load();
- // if (layout.mobile){
- // this.showStartProcessArea_mobile();
- // }else{
- // this.showStartProcessArea_pc();
- // }
- },
- // showStartProcessArea_mobile: function(){
- // if (!this.startProcessAreaNode) {
- // this.createStartProcessArea_mobile();
- // }
- // this.startProcessAreaNode.setStyle("display", "block");
- // //document.body.setStyle("-webkit-overflow-scrolling", "auto");
- // var morph = new Fx.Morph(this.startProcessAreaNode, {
- // "duration": 200,
- // "transition": Fx.Transitions.Expo.easeOut
- // });
- // morph.start({"left": "0px"});
- // },
- // showStartProcessArea_pc: function () {
- // if (!this.startProcessAreaNode) {
- // this.createStartProcessArea();
- // }
- // this.content.mask({
- // "inject": this.content,
- // "destroyOnHide": true,
- // "id": "process_taskcenter_startProcessMask",
- // "style": this.css.maskNode
- // });
- //
- // //var maskNode = this.window.node.getElement("#process_taskcenter_startProcessMask");
- // var maskNode = this.content.getParent().getElement("#process_taskcenter_startProcessMask");
- // if (maskNode){
- // if( this.inBrowser ){
- // maskNode.setStyles({"width":"100%","height":"100%"});
- // }
- // maskNode.addEvent("click", function (e) {
- // this.closeStartProcessArea(e);
- // }.bind(this));
- // }
- // //if (this.allApplicationStarter) this.allApplicationStarter.loadChild();
- // this.startProcessAreaNode.fade("in");
- // //this.startProcessTween.start("left", "-400px", "0px");
- // },
- // createStartProcessArea_mobile: function(){
- // this.startProcessAreaNode = new Element("div", {"styles": this.css.startProcessAreaNode_mobile}).inject(this.content);
- // var size = this.content.getSize();
- // this.startProcessAreaNode.setStyles({
- // "width": ""+size.x+"px",
- // "height": ""+size.y+"px",
- // "top": "0px",
- // "left": ""+size.x+"px"
- // });
- //
- // this.startProcessTopNode = new Element("div", {"styles": this.css.startProcessTopNode_mobile}).inject(this.startProcessAreaNode);
- // this.startProcessCloseNode = new Element("div", {"styles": this.css.startProcessCloseNode_mobile, "text": this.lp.back}).inject(this.startProcessTopNode);
- // this.startProcessCloseNode.addEvent("click", function (e) {
- // this.closeStartProcessArea(e);
- // }.bind(this));
- //
- // this.startProcessListNode = new Element("div", {"styles": this.css.startProcessListNode_mobile}).inject(this.startProcessAreaNode);
- // var h = size.y-this.startProcessTopNode.getSize().y;
- // this.startProcessListNode.setStyle("height", ""+h+"px");
- //
- // //this.createStartProcessScrollNode();
- // this.getAction(function () {
- // this.action.listApplicationStartable(function (appjson) {
- // this.app = this;
- // MWF.UD.getDataJson("taskCenter_startTop", function(json){
- // this.top5Data = json;
- // if (this.top5Data && this.top5Data.length){
- // new Element("div", {"styles": this.css.applicationChildTitleNode, "text": this.lp.startTop5}).inject(this.startProcessListNode);
- // var top5ChildNode = new Element("div", {"styles": this.css.applicationChildChildNode}).inject(this.startProcessListNode);
- //
- // this.top5Data.sort(function(p1, p2){
- // return 0-(p1.count-p2.count);
- // });
- // this.top5Data.each(function(process, i){
- // if (i<5) new MWF.xApplication.process.TaskCenter.Process(process, this, {"name": process.applicationName}, top5ChildNode);
- // }.bind(this));
- // }
- // appjson.data.each(function (app) {
- // new Element("div", {"styles": this.css.applicationChildTitleNode, "text": app.name}).inject(this.startProcessListNode);
- // var appChildNode = new Element("div", {"styles": this.css.applicationChildChildNode}).inject(this.startProcessListNode);
- // app.processList.each(function(process){
- // new MWF.xApplication.process.TaskCenter.Process(process, this, app, appChildNode);
- // }.bind(this));
- // }.bind(this));
- // }.bind(this));
- //
- //
- // // this.allApplicationStarter = new MWF.xApplication.process.TaskCenter.AllApplication(json.data, this);
- // // this.allApplicationStarter.selected();
- // // json.data.each(function (app) {
- // // new MWF.xApplication.process.TaskCenter.Application(app, this);
- // // }.bind(this));
- // }.bind(this));
- // }.bind(this));
- // },
- // createStartProcessArea: function () {
- // this.createStartProcessAreaNode();
- // this.createStartProcessScrollNode();
- //
- // this.listApplications();
- //
- // this.setResizeStartProcessAreaHeight();
- // this.addEvent("resize", this.setResizeStartProcessAreaHeight.bind(this));
- //
- // //this.startProcessTween = new Fx.Tween(this.startProcessAreaNode, {
- // // "duration": "200",
- // // "transition": Fx.Transitions.Quad.easeOut
- // //});
- // },
- // createStartProcessAreaNode: function () {
- // this.startProcessAreaNode = new Element("div", {"styles": this.css.startProcessAreaNode}).inject(this.content);
- // },
- // createStartProcessCloseNode: function () {
- // this.startProcessTopNode = new Element("div", {"styles": this.css.startProcessTopNode}).inject(this.startProcessRightListNode);
- // this.startProcessCloseNode = new Element("div", {"styles": this.css.startProcessCloseNode}).inject(this.startProcessTopNode);
- // this.startProcessCloseNode.addEvent("click", function (e) {
- // this.closeStartProcessArea(e);
- // }.bind(this));
- // },
- // createStartProcessSearchNode: function(){
- // this.startProcessSearchNode = new Element("div", {"styles": this.css.startProcessSearchNode}).inject(this.startProcessRightListNode);
- // this.startProcessSearchIconNode = new Element("div", {"styles": this.css.startProcessSearchIconNode}).inject(this.startProcessSearchNode);
- // this.startProcessSearchAreaNode = new Element("div", {"styles": this.css.startProcessSearchAreaNode}).inject(this.startProcessSearchNode);
- // this.startProcessSearchInputNode = new Element("input", {"styles": this.css.startProcessSearchInputNode}).inject(this.startProcessSearchAreaNode);
- // this.startProcessSearchInputNode.set("value", this.lp.searchProcess);
- // this.startProcessSearchInputNode.addEvents({
- // "focus": function(){ if (this.startProcessSearchInputNode.get("value")===this.lp.searchProcess) this.startProcessSearchInputNode.set("value", ""); }.bind(this),
- // "blur": function(){if (!this.startProcessSearchInputNode.get("value")) this.startProcessSearchInputNode.set("value", this.lp.searchProcess);}.bind(this),
- // "keydown": function(e){ if (e.code===13) this.searchStartProcess(); }.bind(this)
- // });
- // this.startProcessSearchIconNode.addEvent("click", function(){ this.searchStartProcess(); }.bind(this));
- // },
- // searchStartProcess: function(){
- // var key = this.startProcessSearchInputNode.get("value");
- // if (key && key!==this.lp.searchProcess){
- // if (this.appStartableData){
- // this.startApplications.each(function(app){ app.unselected(); });
- // if (this.searchProcessSearchchildNode) this.searchProcessSearchchildNode.destroy();
- // var text = this.lp.searchProcessResault.replace("{key}", key);
- //
- // this.searchProcessSearchchildNode = new Element("div", {"styles": this.css.applicationChildNode}).inject(this.startProcessProcessAreaNode);
- // this.searchProcessSearchchildNode.setStyle("display", "block");
- // new Element("div", {"styles": this.css.applicationChildTitleNode, "text": text}).inject(this.searchProcessSearchchildNode);
- // var proListNode = new Element("div", {"styles": this.css.applicationChildChildNode}).inject(this.searchProcessSearchchildNode);
- //
- // this.appStartableData.each(function (app) {
- // app.processList.each(function(pro){
- // if (pro.name.indexOf(key)!==-1){
- // var data = Object.clone(pro);
- // data.applicationName = app.name;
- // new MWF.xApplication.process.TaskCenter.Process(data, {"app": this}, {"name": app}, proListNode);
- // }
- // }.bind(this));
- // }.bind(this));
- // }
- // }
- // },
- // createStartProcessScrollNode: function () {
- // this.startProcessApplicationListNode = new Element("div", {"styles": this.css.startProcessApplicationListNode}).inject(this.startProcessAreaNode);
- // this.startProcessRightListNode = new Element("div", {"styles": this.css.startProcessRightListNode}).inject(this.startProcessAreaNode);
- //
- // this.createStartProcessCloseNode();
- // this.createStartProcessSearchNode();
- //
- // this.startProcessApplicationScrollNode = new Element("div", {"styles": this.css.startProcessApplicationScrollNode}).inject(this.startProcessApplicationListNode);
- // this.startProcessApplicationAreaNode = new Element("div", {"styles": this.css.startProcessApplicationAreaNode}).inject(this.startProcessApplicationScrollNode);
- //
- // this.startProcessProcessListNode = new Element("div", {"styles": this.css.startProcessProcessListNode}).inject(this.startProcessRightListNode);
- // this.startProcessProcessScrollNode = new Element("div", {"styles": this.css.startProcessProcessScrollNode}).inject(this.startProcessProcessListNode);
- // this.startProcessProcessAreaNode = new Element("div", {"styles": this.css.startProcessProcessAreaNode}).inject(this.startProcessProcessScrollNode);
- //
- // MWF.require("MWF.widget.ScrollBar", function () {
- // new MWF.widget.ScrollBar(this.startProcessApplicationScrollNode, {
- // "distance": 100,
- // "friction": 4
- // });
- // new MWF.widget.ScrollBar(this.startProcessProcessScrollNode, {
- // "distance": 100,
- // "friction": 4
- // });
- // }.bind(this));
- //
- // //this.startProcessContentNode = new Element("div", {"styles": this.css.startProcessContentNode}).inject(this.startProcessScrollNode);
- // },
- // closeStartProcessArea: function () {
- // //if (this.startProcessAreaNode) this.startProcessTween.start("left", "0px", "-400px");
- // if (layout.mobile){
- // var size = this.startProcessAreaNode.getSize();
- // var morph = new Fx.Morph(this.startProcessAreaNode, {
- // "duration": 200,
- // "transition": Fx.Transitions.Expo.easeOut,
- // "onComplete": function(){
- // this.startProcessAreaNode.setStyle("display", "none");
- // }.bind(this)
- // });
- // morph.start({"left": ""+size.x+"px"});
- // }else{
- // this.content.unmask();
- // if (this.startProcessAreaNode) this.startProcessAreaNode.fade("out");
- // }
- //
- // },
- // setResizeStartProcessAreaHeight: function () {
- // if (this.startProcessAreaNode) {
- // var size = this.content.getSize();
- // var nodeSize = this.startProcessAreaNode.getSize();
- // var x = (size.x-nodeSize.x)/2;
- // var y = (size.y-nodeSize.y)/2;
- // this.startProcessAreaNode.setStyle("top", "" + y + "px");
- // this.startProcessAreaNode.setStyle("left", "" + x + "px");
- //
- // var maskNode = this.content.getParent().getElement("#process_taskcenter_startProcessMask");
- // //var maskNode = this.window.node.getElement("#process_taskcenter_startProcessMask");
- // if (maskNode){
- // maskNode.setStyles({"width": ""+size.x+"px", "height": ""+size.y+"px"});
- // maskNode.position({
- // "relativeTo": this.content,
- // "position": "topLeft",
- // "edge": "topLeft"
- // });
- // }
- //
- // if (this.startProcessProcessListNode){
- // var topSize = this.startProcessTopNode.getSize();
- // var searchSize = this.startProcessSearchNode.getSize();
- // var h = nodeSize.y-topSize.y-searchSize.y;
- // this.startProcessProcessListNode.setStyle("height", ""+h+"px");
- // }
- //
- // }
- // },
- // listApplications: function () {
- // this.getAction(function () {
- // this.action.listApplicationStartable(function (json) {
- // this.appStartableData = json.data;
- // this.startProcessSearchNode.setStyle("display", "block");
- // this.allApplicationStarter = new MWF.xApplication.process.TaskCenter.AllApplication(json.data, this);
- // this.allApplicationStarter.selected();
- // json.data.each(function (app) {
- // new MWF.xApplication.process.TaskCenter.Application(app, this);
- // }.bind(this));
- // }.bind(this));
- // }.bind(this));
- // },
- //
- getAction: function (callback) {
- if (!this.action) {
- this.action = MWF.Actions.get("x_processplatform_assemble_surface");
- if (callback) callback();
- // MWF.xDesktop.requireApp("process.TaskCenter", "Actions.RestActions", function () {
- // this.action = new MWF.xApplication.process.TaskCenter.Actions.RestActions();
- // if (callback) callback();
- // }.bind(this));
- } else {
- if (callback) callback();
- }
- },
- refreshAll: function () {
- this.getWorkCounts();
- if (this.taskList) if (this.currentTab === "task") this.taskList.refresh();
- //if (this.taskCompletedList) if (this.currentTab == "done") this.taskCompletedList.refresh();
- //if (this.readList) if (this.currentTab == "read") this.readList.refresh();
- //if (this.readedList) if (this.currentTab == "readed") this.readedList.refresh();
- //if (this.reviewList) if (this.currentTab == "review") this.reviewList.refresh();
- if (this.draftList) if (this.currentTab === "draft") this.draftList.refresh();
- },
- createTaskCompletedList: function (filterData) {
- if (!this.contentNode) this.loadContent();
- this.taskCompletedList = new MWF.xApplication.process.TaskCenter.TaskCompletedList(this.contentListAreaNode, this, filterData);
- //if (filterData) this.taskCompletedList.filterData = filterData;
- },
- showDone: function () {
- if (this.currentTab !== "done") {
- this.showTab(1);
- this.currentTab = "done";
- if (!this.taskCompletedList) {
- this.createTaskCompletedList((this.status) ? this.status.filter : null);
- this.taskCompletedList.show();
- } else {
- this.taskCompletedList.show();
- if (this.taskCompletedList) this.taskCompletedList.refresh();
- }
- } else {
- if (this.taskCompletedList) this.taskCompletedList.refresh();
- }
- this.searchBarAreaNode.setStyle("display", "block");
- this.searchBarInputNode.set("value", this.lp.searchKey);
- },
- createReadList: function (filterData) {
- if (!this.contentNode) this.loadContent();
- this.readList = new MWF.xApplication.process.TaskCenter.ReadList(this.contentListAreaNode, this, filterData);
- //if (filterData) this.taskCompletedList.filterData = filterData;
- },
- showRead: function () {
- if (this.currentTab !== "read") {
- this.showTab(2);
- this.currentTab = "read";
- if (!this.readList) {
- this.createReadList((this.status) ? this.status.filter : null);
- this.readList.show();
- } else {
- this.readList.show();
- if (this.readList) this.readList.refresh();
- }
- } else {
- if (this.readList) this.readList.refresh();
- }
- this.searchBarAreaNode.setStyle("display", "block");
- this.searchBarInputNode.set("value", this.lp.searchKey);
- },
- createReadedList: function (filterData) {
- if (!this.contentNode) this.loadContent();
- this.readedList = new MWF.xApplication.process.TaskCenter.ReadCompletedList(this.contentListAreaNode, this, filterData);
- //if (filterData) this.taskCompletedList.filterData = filterData;
- },
- showReaded: function () {
- if (this.currentTab !== "readed") {
- this.showTab(3);
- this.currentTab = "readed";
- if (!this.readedList) {
- this.createReadedList((this.status) ? this.status.filter : null);
- this.readedList.show();
- } else {
- this.readedList.show();
- if (this.readedList) this.readedList.refresh();
- }
- } else {
- if (this.readedList) this.readedList.refresh();
- }
- this.searchBarAreaNode.setStyle("display", "block");
- this.searchBarInputNode.set("value", this.lp.searchKey);
- },
- createReviewList: function (filterData) {
- if (!this.contentNode) this.loadContent();
- this.reviewList = new MWF.xApplication.process.TaskCenter.ReviewList(this.contentListAreaNode, this, filterData);
- //if (filterData) this.taskCompletedList.filterData = filterData;
- },
- showReview: function () {
- if (this.currentTab !== "review") {
- this.showTab(4);
- this.currentTab = "review";
- if (!this.reviewList) {
- this.createReviewList((this.status) ? this.status.filter : null);
- this.reviewList.show();
- } else {
- this.reviewList.show();
- if (this.reviewList) this.reviewList.refresh();
- }
- } else {
- if (this.reviewList) this.reviewList.refresh();
- }
- this.searchBarAreaNode.setStyle("display", "block");
- },
- createDraftList: function (filterData) {
- if (!this.contentNode) this.loadContent();
- this.draftList = new MWF.xApplication.process.TaskCenter.DraftList(this.contentListAreaNode, this, filterData);
- },
- showDraft: function(){
- if (this.currentTab !== "draft") {
- this.showTab(5);
- this.currentTab = "draft";
- if (!this.draftList) {
- this.createDraftList((this.status) ? this.status.filter : null);
- this.draftList.show();
- } else {
- this.draftList.show();
- if (this.draftList) this.draftList.refresh();
- }
- } else {
- if (this.draftList) this.draftList.refresh();
- }
- this.searchBarAreaNode.setStyle("display", "none");
- },
- createMyCreatedList: function (filterData) {
- if (!this.contentNode) this.loadContent();
- this.myCreatedList = new MWF.xApplication.process.TaskCenter.MyCreatedList(this.contentListAreaNode, this, filterData);
- },
- showMyCreated: function(){
- if (this.currentTab !== "myCreated") {
- this.showTab(6);
- this.currentTab = "myCreated";
- if (!this.myCreatedList) {
- this.createMyCreatedList((this.status) ? this.status.filter : null);
- this.myCreatedList.show();
- } else {
- this.myCreatedList.show();
- if (this.myCreatedList) this.myCreatedList.refresh();
- }
- } else {
- if (this.myCreatedList) this.myCreatedList.refresh();
- }
- this.searchBarAreaNode.setStyle("display", "none");
- },
- recordStatus: function(){
- var tab = this.currentTab || "task";
- var filter = null;
- if (tab==="done"){
- filter = this.taskCompletedList.filterData;
- }
- if (tab==="read"){
- filter = this.readList.filterData;
- }
- if (tab==="readed"){
- filter = this.readedList.filterData;
- }
- if (tab==="review"){
- filter = this.reviewList.filterData;
- }
- if (tab==="draft"){
- filter = this.draftList.filterData;
- }
- return {"navi": this.currentTab || "task", "filter": filter};
- },
- searchTask: function(){
- var keyWord = this.searchBarInputNode.get("value");
- if (keyWord && (keyWord!==this.lp.searchKey)){
- var tab = this.currentTab || "task";
- switch (tab){
- case "task":
- if (!this.taskList.filterData) this.taskList.filterData = {};
- this.taskList.filterData.key = keyWord;
- this.taskList.refilter();
- break;
- case "done":
- if (!this.taskCompletedList.filterData) this.taskCompletedList.filterData = {};
- this.taskCompletedList.filterData.key = keyWord;
- this.taskCompletedList.refilter();
- break;
- case "read":
- if (!this.readList.filterData) this.readList.filterData = {};
- this.readList.filterData.key = keyWord;
- this.readList.refilter();
- break;
- case "readed":
- if (!this.readedList.filterData) this.readedList.filterData = {};
- this.readedList.filterData.key = keyWord;
- this.readedList.refilter();
- break;
- case "review":
- if (!this.reviewList.filterData) this.reviewList.filterData = {};
- this.reviewList.filterData.key = keyWord;
- this.reviewList.refilter();
- break;
- case "draft":
- if (!this.draftList.filterData) this.draftList.filterData = {};
- this.draftList.filterData.key = keyWord;
- this.draftList.refilter();
- break;
- }
- }
- }
- });
- MWF.xApplication.process.TaskCenter.Application = new Class({
- initialize: function(data, starter){
- this.bgColors = ["#30afdc", "#e9573e", "#8dc153", "#9d4a9c", "#ab8465", "#959801", "#434343", "#ffb400", "#9e7698", "#00a489"];
- this.data = data;
- this.starter = starter
- this.app = this.starter.app;
- this.container = this.starter.startProcessApplicationAreaNode;
- this.processContainer = this.starter.startProcessProcessAreaNode;
- this.css = this.app.css;
- this.isLoaded = false;
- this.load();
- },
- load: function(){
- this.node = new Element("div", {"styles": this.css.applicationNode}).inject(this.container);
- this.iconAreaNode = new Element("div", {"styles": this.css.applicationIconAreaNode}).inject(this.node);
- this.iconNode = new Element("img", {"styles": this.css.applicationIconNode}).inject(this.iconAreaNode);
- if (this.data.icon){
- this.iconNode.set("src", "data:image/png;base64,"+this.data.icon+"");
- }else{
- this.iconNode.set("src", "../x_component_process_ApplicationExplorer/$Main/default/icon/application.png");
- }
- this.textNode = new Element("div", {"styles": this.css.applicationTextNode}).inject(this.node);
- this.textNode.set("text", this.data.name);
- this.textNode.set("title", this.data.name);
- this.childNode = new Element("div", {"styles": this.css.applicationChildNode}).inject(this.processContainer);
- //this.loadChild();
- this.node.addEvent("click", function(){
- this.selected();
- }.bind(this));
- this.starter.startApplications.push(this);
- },
- unselected: function(){
- this.childNode.setStyle("display", "none");
- this.node.setStyles(this.css.applicationNode);
- },
- selected: function(){
- this.starter.startApplications.each(function(app){
- app.unselected();
- });
- if (this.starter.searchProcessSearchchildNode) this.starter.searchProcessSearchchildNode.destroy();
- if (this.starter.startProcessSearchInputNode) this.starter.startProcessSearchInputNode.set("placeholder", this.app.lp.searchProcess);
- this.childNode.setStyle("display", "block");
- this.node.setStyles(this.css.applicationNode_selected);
- if (!this.isLoaded){
- this.loadChild();
- this.isLoaded = true;
- }
- },
- loadChild: function(){
- new Element("div", {"styles": this.css.applicationChildTitleNode, "text": this.app.lp.startProcess}).inject(this.childNode);
- var childNode = new Element("div", {"styles": this.css.applicationChildChildNode}).inject(this.childNode);
- this.data.processList.each(function(process){
- new MWF.xApplication.process.TaskCenter.Process(process, this, this.data, childNode);
- }.bind(this));
- }
- });
- MWF.xApplication.process.TaskCenter.Column = new Class({
- Extends: MWF.xApplication.process.TaskCenter.Application,
- load: function(){
- this.node = new Element("div", {"styles": this.css.applicationNode}).inject(this.container);
- this.iconAreaNode = new Element("div", {"styles": this.css.applicationIconAreaNode}).inject(this.node);
- this.iconNode = new Element("img", {"styles": this.css.applicationIconNode}).inject(this.iconAreaNode);
- if (this.data.appIcon){
- this.iconNode.set("src", "data:image/png;base64,"+this.data.appIcon+"");
- }else{
- this.iconNode.set("src", "../x_component_process_ApplicationExplorer/$Main/default/icon/application.png");
- }
- this.textNode = new Element("div", {"styles": this.css.applicationTextNode}).inject(this.node);
- this.textNode.set("text", this.data.appName);
- this.textNode.set("title", this.data.appName);
- this.childNode = new Element("div", {"styles": this.css.applicationChildNode}).inject(this.processContainer);
- //this.loadChild();
- this.node.addEvent("click", function(){
- this.selected();
- }.bind(this));
- this.starter.startApplications.push(this);
- },
- loadChild: function(){
- new Element("div", {"styles": this.css.applicationChildTitleNode, "text": this.app.lp.startProcess}).inject(this.childNode);
- var childNode = new Element("div", {"styles": this.css.applicationChildChildNode}).inject(this.childNode);
- this.data.wrapOutCategoryList.each(function(category){
- new MWF.xApplication.process.TaskCenter.Category(category, this, this.data, childNode);
- }.bind(this));
- }
- });
- MWF.xApplication.process.TaskCenter.AllApplication = new Class({
- Extends: MWF.xApplication.process.TaskCenter.Application,
- initialize: function(data, starter, columnData){
- this.bgColors = ["#30afdc", "#e9573e", "#8dc153", "#9d4a9c", "#ab8465", "#959801", "#434343", "#ffb400", "#9e7698", "#00a489"];
- this.data = data;
- this.columnData = columnData;
- this.starter = starter;
- this.app = this.starter.app;
- this.container = this.starter.startProcessApplicationAreaNode;
- this.processContainer = this.starter.startProcessProcessAreaNode;
- this.css = this.starter.css;
- this.isLoaded = false;
- this.load();
- },
- load: function(){
- this.node = new Element("div", {"styles": this.css.applicationNode}).inject(this.container);
- this.iconAreaNode = new Element("div", {"styles": this.css.applicationIconAreaNode}).inject(this.node);
- this.iconNode = new Element("img", {"styles": this.css.applicationIconNode}).inject(this.iconAreaNode);
- this.iconNode.set("src", "../x_component_process_TaskCenter/$Main/default/icon/appAppliction.png");
- this.textNode = new Element("div", {"styles": this.css.applicationTextNode}).inject(this.node);
- this.textNode.set("text", this.app.lp.all);
- this.textNode.set("title", this.app.lp.all);
- this.childNode = new Element("div", {"styles": this.css.applicationChildNode}).inject(this.processContainer);
- //this.loadChild();
- this.node.addEvent("click", function(){
- this.selected();
- }.bind(this));
- this.starter.startApplications.push(this);
- },
- unselected: function(){
- this.childNode.empty();
- this.isLoaded = false;
- this.childNode.setStyle("display", "none");
- this.node.setStyles(this.css.applicationNode);
- },
- loadChild: function(){
- //this.loadSearch();
- var mapById = {};
- this.data.each(function (app) {
- if (app.processList && app.processList.length){
- app.processList.each(function (process) {
- mapById[ process.id ] = process;
- });
- }
- });
- MWF.UD.getDataJson("taskCenter_startTop", function(json){
- this.top5Data = json;
- debugger;
- if (this.top5Data && this.top5Data.length){
- new Element("div", {"styles": this.css.applicationChildTitleNode, "text": this.app.lp.startTop5}).inject(this.childNode);
- var top5ChildNode = new Element("div", {"styles": this.css.applicationChildChildNode}).inject(this.childNode);
- this.top5Data.sort(function(p1, p2){
- return 0-(p1.count-p2.count);
- });
- this.top5Data.each(function (d) {
- if( mapById[ d.id ] )d.name = mapById[ d.id ].name;
- });
- }
- var allowProcessIds = [];
- this.data.each(function (app) {
- new Element("div", {"styles": this.css.applicationChildTitleNode, "text": app.name}).inject(this.childNode);
- var appChildNode = new Element("div", {"styles": this.css.applicationChildChildNode}).inject(this.childNode);
- app.processList.each(function(process){
- allowProcessIds.push(process.id);
- new MWF.xApplication.process.TaskCenter.Process(process, this, app, appChildNode);
- }.bind(this));
- }.bind(this));
- this.columnData.each(function (column) {
- new Element("div", {"styles": this.css.applicationChildTitleNode, "text": column.appName}).inject(this.childNode);
- var appChildNode = new Element("div", {"styles": this.css.applicationChildChildNode}).inject(this.childNode);
- column.wrapOutCategoryList.each(function(category){
- // allowProcessIds.push(process.id);
- new MWF.xApplication.process.TaskCenter.Category(category, this, column, appChildNode);
- }.bind(this));
- }.bind(this));
- if (top5ChildNode){
- saveflag = false;
- this.top5Data.each(function(process, i){
- if (allowProcessIds.indexOf(process.id)!==-1){
- if (i<5) new MWF.xApplication.process.TaskCenter.Process(process, this, {"name": process.applicationName}, top5ChildNode);
- }else{
- saveflag = true;
- process.count=0;
- }
- }.bind(this));
- if (saveflag) MWF.UD.putData("taskCenter_startTop", this.top5Data);
- }
- }.bind(this));
- }
- });
- MWF.xApplication.process.TaskCenter.Process = new Class({
- initialize: function(data, application, applicationData, container){
- this.data = data;
- this.application = application;
- this.applicationData = applicationData;
- this.app = this.application.app;
- if( this.application.starter ){
- this.starter = this.application.starter;
- }else if( this.application.app && this.application.app.starter ){
- this.starter = this.application.app.starter;
- }else if( this.application.app && this.application.app.processStarter ){
- this.starter = this.application.app.processStarter;
- }else if( application.startProcessAreaNode ){
- this.starter = application;
- }
- //this.starter = this.application.starter
- this.container = container;
- this.css = this.app.css;
- this.load();
- },
- load: function(){
- this.node = new Element("div.processItem", {"styles": this.css.startProcessNode}).inject(this.container);
- this.iconNode = new Element("div", {"styles": this.css.processIconNode}).inject(this.node);
- if (this.data.icon){
- this.iconNode.setStyle("background-image", "url("+this.data.icon+")");
- }else{
- this.iconNode.setStyle("background-image", "url(../x_component_process_ProcessManager/$Explorer/default/processIcon/process.png)");
- }
- this.textNode = new Element("div", {"styles": this.css.processTextNode}).inject(this.node);
- this.actionNode = new Element("div", {"styles": this.css.processActionNode, "text": this.app.lp.start}).inject(this.node);
- var appName = "";
- if( typeOf( this.data.applicationName ) === "string" ){
- appName = this.data.applicationName || "";
- }else if( typeOf( this.data.applicationName ) === "object" && this.data.applicationName.name ){
- appName = this.data.applicationName.name || "";
- }
- this.textNode.set({
- "text": this.data.name+((this.data.applicationName) ? " -- ("+appName+")" : ""),
- "title": this.data.name+ (this.data.description ? ("-"+ this.data.description) : "")
- });
- //var _self = this;
- this.actionNode.addEvents({
- "mouseover": function(){this.actionNode.setStyles(this.css.processActionNode_over);}.bind(this),
- "mouseout": function(){this.actionNode.setStyles(this.css.processActionNode);}.bind(this),
- "click": function(e){
- this.startProcess(e);
- }.bind(this)
- });
- this.node.addEvents({
- "mouseover": function(){
- this.node.setStyles(this.css.startProcessNode_over);
- this.actionNode.setStyle("display", "block");
- }.bind(this),
- "mouseout": function(){
- this.node.setStyles(this.css.startProcessNode_out);
- //this.actionNode.setStyle("display", "none");
- }.bind(this)
- });
- },
- startProcess: function(){
- if(this.starter)this.starter.closeStartProcessArea();
- MWF.xDesktop.requireApp("process.TaskCenter", "ProcessStarter", function(){
- var starter = new MWF.xApplication.process.TaskCenter.ProcessStarter(this.data, this.app, {
- "onStarted": function(data, title, processName){
- this.afterStartProcess(data, title, processName);
- }.bind(this)
- });
- starter.load();
- }.bind(this));
- },
- recordProcessData: function(){
- MWF.UD.getDataJson("taskCenter_startTop", function(json){
- if (!json || !json.length) json = [];
- var recordProcess = null;
- this.data.lastStartTime = new Date();
- var earlyProcessIdx = 0;
- var flag = true;
- for (var i=0; i<json.length; i++){
- var process = json[i];
- if (process.id === this.data.id) recordProcess = process;
- if (flag){
- if (!process.lastStartTime){
- earlyProcessIdx = i;
- flag = false;
- }else{
- if (new Date(process.lastStartTime)<new Date(json[earlyProcessIdx].lastStartTime)){
- earlyProcessIdx = i;
- }
- }
- }
- if( o2.typeOf( process.applicationName ) === "object")process.applicationName = process.applicationName.name || "";
- }
- if (recordProcess) {
- recordProcess.lastStartTime = new Date();
- recordProcess.count = (recordProcess.count || 0)+1;
- recordProcess.applicationName = this.applicationData.name || "";
- }else{
- if (json.length<10){
- this.data.count = 1;
- this.data.applicationName = this.applicationData.name || "";
- json.push(this.data);
- }else{
- json.splice(earlyProcessIdx, 1);
- this.data.count = 1;
- this.data.applicationName = this.applicationData.name || "";
- json.push(this.data);
- }
- }
- MWF.UD.putData("taskCenter_startTop", json);
- }.bind(this));
- },
- afterStartProcess: function(data, title, processName){
- this.recordProcessData();
- if (data.work){
- this.startProcessDraft(data, title, processName);
- }else{
- this.startProcessInstance(data, title, processName);
- }
- this.starter.fireEvent("startProcess");
- },
- startProcessDraft: function(data, title, processName){
- var work = data.work;
- var options = {"draft": work, "appId": "process.Work"+(new o2.widget.UUID).toString(), "desktopReload": false};
- if( !layout.inBrowser )options.onPostLoadForm = function(app){
- this.starter.fireEvent("afterStartProcess", [app]);
- }.bind(this);
- var win = this.app.desktop.openApplication(null, "process.Work", options);
- if( layout.inBrowser ){
- this.starter.fireEvent("afterStartProcess", [win]);
- }
- // var msg = {
- // "subject": this.app.lp.processStarted,
- // "content": "<div>"+this.app.lp.processStartedMessage+"“["+processName+"]"+title+"”</div>"
- // };
- // var tooltip = layout.desktop.message.addTooltip(msg);
- // var item = layout.desktop.message.addMessage(msg);
- },
- startProcessInstance: function(data, title, processName){
- var workInfors = [];
- var currentTask = [];
- data.each(function(work){
- if (work.currentTaskIndex !== -1) currentTask.push(work.taskList[work.currentTaskIndex].work);
- workInfors.push(this.getStartWorkInforObj(work));
- }.bind(this));
- if (currentTask.length===1){
- if (layout.inBrowser && (o2.thirdparty.isDingdingPC() || o2.thirdparty.isQywxPC())) {
- var url = "../x_desktop/work.html?workid=" + currentTask[0];
- window.location = o2.filterUrl(url);
- } else {
- var options = {"workId": currentTask[0], "appId": "process.Work"+currentTask[0]};
- if( !layout.inBrowser )options.onPostLoadForm = function(app){
- this.starter.fireEvent("afterStartProcess", [app]);
- }.bind(this);
- var win = this.app.desktop.openApplication(null, "process.Work", options);
- if( layout.inBrowser ){
- this.starter.fireEvent("afterStartProcess", [win]);
- }
- }
- if (layout.desktop.message) this.createStartWorkResault(workInfors, title, processName, false);
- }else{
- if (layout.desktop.message) this.createStartWorkResault(workInfors, title, processName, true);
- }
- },
- getStartWorkInforObj: function(work){
- var users = [];
- var currentTask = "";
- work.taskList.each(function(task, idx){
- users.push(task.person+"("+task.department + ")");
- if (work.currentTaskIndex===idx) currentTask = task.id;
- }.bind(this));
- return {"activity": work.fromActivityName, "users": users, "currentTask": currentTask};
- },
- createStartWorkResault: function(workInfors, title, processName, isopen){
- var content = "";
- workInfors.each(function(infor){
- var users = [];
- infor.users.each(function(uname){
- users.push(MWF.name.cn(uname));
- });
- content += "<div><b>"+this.app.lp.nextActivity+"<font style=\"color: #ea621f\">"+infor.activity+"</font>, "+this.app.lp.nextUser+"<font style=\"color: #ea621f\">"+users.join(", ")+"</font></b>";
- if (infor.currentTask && isopen){
- content += " <span value=\""+infor.currentTask+"\">"+this.app.lp.deal+"</span></div>";
- }else{
- content += "</div>";
- }
- }.bind(this));
- var msg = {
- "subject": this.app.lp.processStarted,
- "content": "<div>"+this.app.lp.processStartedMessage+"“["+processName+"]"+title+"”</div>"+content
- };
- var tooltip = layout.desktop.message.addTooltip(msg);
- var item = layout.desktop.message.addMessage(msg);
- this.setStartWorkResaultAction(tooltip);
- this.setStartWorkResaultAction(item);
- },
- setStartWorkResaultAction: function(item){
- var node = item.node.getElements("span");
- node.setStyles(this.app.css.dealStartedWorkAction);
- var _self = this;
- node.addEvent("click", function(e){
- var options = {"taskId": this.get("value"), "appId": this.get("value")};
- _self.app.desktop.openApplication(e, "process.Work", options);
- });
- }
- });
- MWF.xApplication.process.TaskCenter.Category = new Class({
- Extends: MWF.xApplication.process.TaskCenter.Process,
- load: function(){
- this.node = new Element("div.processItem", {"styles": this.css.startProcessNode}).inject(this.container);
- this.iconNode = new Element("div", {"styles": this.css.processIconNode}).inject(this.node);
- this.iconNode.setStyle("background-image", "url(../x_component_process_ProcessManager/$Explorer/default/processIcon/process.png)");
- this.textNode = new Element("div", {"styles": this.css.processTextNode}).inject(this.node);
- this.actionNode = new Element("div", {"styles": this.css.processActionNode, "text": this.app.lp.start}).inject(this.node);
- var appName = this.data.appName;
- this.textNode.set({
- "text": this.data.categoryName+(appName ? " -- ("+appName+")" : ""),
- "title": this.data.categoryName+ (appName ? ("-"+ appName) : "")
- });
- //var _self = this;
- this.actionNode.addEvents({
- "mouseover": function(){this.actionNode.setStyles(this.css.processActionNode_over);}.bind(this),
- "mouseout": function(){this.actionNode.setStyles(this.css.processActionNode);}.bind(this),
- "click": function(e){
- this.startProcess(e);
- }.bind(this)
- });
- this.node.addEvents({
- "mouseover": function(){
- this.node.setStyles(this.css.startProcessNode_over);
- this.actionNode.setStyle("display", "block");
- }.bind(this),
- "mouseout": function(){
- this.node.setStyles(this.css.startProcessNode_out);
- //this.actionNode.setStyle("display", "none");
- }.bind(this)
- });
- },
- startProcess: function(){
- this.starter.closeStartProcessArea();
- var data = this.data;
- if( !data.categoryId ){
- data.categoryId = data.id;
- data.id = data.workflowFlag;
- if( !data.name )data.name = data.categoryName;
- }
- MWF.xDesktop.requireApp("process.TaskCenter", "ProcessStarter", function(){
- var starter = new MWF.xApplication.process.TaskCenter.ProcessStarter(this.data, this.app, {
- "workData": {
- "cmsDocument" : {
- "isNewDocument" : true,
- "title": this.app.lp.unnamed,
- // "creatorIdentity": data.identity,
- // "identity": data.identity,
- "appId" : data.appId,
- "categoryId" : data.categoryId,
- "docStatus" : "draft",
- "categoryName" : data.categoryName,
- "categoryAlias" : data.categoryAlias,
- "createTime": new Date().format("db"),
- "attachmentList" : []
- }
- },
- "onBeforeStarted": function(data){
- data.data.cmsDocument.creatorIdentity = data.identity;
- data.data.cmsDocument.identity = data.identity;
- },
- "onStarted": function(data, title, processName){
- this.afterStartProcess(data, title, processName);
- }.bind(this)
- });
- starter.load();
- }.bind(this));
- },
- afterStartProcess: function(data, title, processName){
- // this.recordProcessData();
- if (data.work){
- this.startProcessDraft(data, title, processName);
- }else{
- this.startProcessInstance(data, title, processName);
- }
- this.starter.fireEvent("startProcess");
- }
- });
- MWF.xApplication.process.TaskCenter.Starter = new Class({
- Implements: [Options, Events],
- initialize: function(app, options){
- this.setOptions(options);
- this.app = app;
- this.css = app.css;
- this.lp = app.lp;
- this.content = this.app.content;
- this.startApplications = [];
- },
- load: function(){
- if (layout.mobile){
- this.showStartProcessArea_mobile();
- }else{
- this.showStartProcessArea_pc();
- }
- },
- showStartProcessArea_pc: function () {
- if (!this.startProcessAreaNode) {
- this.createStartProcessArea();
- }
- this.content.mask({
- "destroyOnHide": true,
- "id": "process_taskcenter_startProcessMask",
- "style": this.css.maskNode
- });
- var maskNode = this.content.getParent().getElement("#process_taskcenter_startProcessMask");
- if (maskNode){
- if( this.inBrowser ){
- maskNode.setStyles({"width":"100%","height":"100%"});
- }
- maskNode.addEvent("click", function (e) {
- this.closeStartProcessArea(e);
- }.bind(this));
- }
- this.startProcessAreaNode.fade("in");
- },
- createStartProcessArea: function () {
- this.createStartProcessAreaNode();
- this.createStartProcessScrollNode();
- this.listApplications();
- this.setResizeStartProcessAreaHeight();
- this.app.addEvent("resize", this.setResizeStartProcessAreaHeight.bind(this));
- },
- createStartProcessAreaNode: function () {
- this.startProcessAreaNode = new Element("div", {"styles": this.css.startProcessAreaNode}).inject(this.content);
- },
- createStartProcessScrollNode: function () {
- this.startProcessApplicationListNode = new Element("div", {"styles": this.css.startProcessApplicationListNode}).inject(this.startProcessAreaNode);
- this.startProcessRightListNode = new Element("div", {"styles": this.css.startProcessRightListNode}).inject(this.startProcessAreaNode);
- this.createStartProcessCloseNode();
- this.createStartProcessSearchNode();
- this.startProcessApplicationScrollNode = new Element("div", {"styles": this.css.startProcessApplicationScrollNode}).inject(this.startProcessApplicationListNode);
- this.startProcessApplicationAreaNode = new Element("div", {"styles": this.css.startProcessApplicationAreaNode}).inject(this.startProcessApplicationScrollNode);
- this.startProcessProcessListNode = new Element("div", {"styles": this.css.startProcessProcessListNode}).inject(this.startProcessRightListNode);
- this.startProcessProcessScrollNode = new Element("div", {"styles": this.css.startProcessProcessScrollNode}).inject(this.startProcessProcessListNode);
- this.startProcessProcessAreaNode = new Element("div", {"styles": this.css.startProcessProcessAreaNode}).inject(this.startProcessProcessScrollNode);
- MWF.require("MWF.widget.ScrollBar", function () {
- new MWF.widget.ScrollBar(this.startProcessApplicationScrollNode, {
- "distance": 100,
- "friction": 4
- });
- new MWF.widget.ScrollBar(this.startProcessProcessScrollNode, {
- "distance": 100,
- "friction": 4
- });
- }.bind(this));
- },
- createStartProcessCloseNode: function () {
- this.startProcessTopNode = new Element("div", {"styles": this.css.startProcessTopNode}).inject(this.startProcessRightListNode);
- this.startProcessCloseNode = new Element("div", {"styles": this.css.startProcessCloseNode}).inject(this.startProcessTopNode);
- this.startProcessCloseNode.addEvent("click", function (e) {
- this.closeStartProcessArea(e);
- }.bind(this));
- },
- createStartProcessSearchNode: function(){
- this.startProcessSearchNode = new Element("div", {"styles": this.css.startProcessSearchNode}).inject(this.startProcessRightListNode);
- this.startProcessSearchIconNode = new Element("div", {"styles": this.css.startProcessSearchIconNode}).inject(this.startProcessSearchNode);
- this.startProcessSearchAreaNode = new Element("div", {"styles": this.css.startProcessSearchAreaNode}).inject(this.startProcessSearchNode);
- this.startProcessSearchInputNode = new Element("input", {"styles": this.css.startProcessSearchInputNode}).inject(this.startProcessSearchAreaNode);
- this.startProcessSearchInputNode.set("placeholder", this.lp.searchProcess);
- this.startProcessSearchInputNode.addEvents({
- "focus": function(){ if (this.startProcessSearchInputNode.get("value")===this.lp.searchProcess) this.startProcessSearchInputNode.set("value", ""); }.bind(this),
- "blur": function(){if (!this.startProcessSearchInputNode.get("value")) this.startProcessSearchInputNode.set("placeholder", this.lp.searchProcess);}.bind(this),
- "keydown": function(e){ if (e.code===13) this.searchStartProcess(); }.bind(this)
- });
- this.startProcessSearchIconNode.addEvent("click", function(){ this.searchStartProcess(); }.bind(this));
- },
- searchStartProcess: function(){
- debugger;
- var key = this.startProcessSearchInputNode.get("value");
- if (key && key!==this.lp.searchProcess){
- if (this.appStartableData){
- this.startApplications.each(function(app){ app.unselected(); });
- if (this.searchProcessSearchchildNode) this.searchProcessSearchchildNode.destroy();
- var text = this.lp.searchProcessResault.replace("{key}", key);
- this.searchProcessSearchchildNode = new Element("div", {"styles": this.css.applicationChildNode}).inject(this.startProcessProcessAreaNode);
- this.searchProcessSearchchildNode.setStyle("display", "block");
- new Element("div", {"styles": this.css.applicationChildTitleNode, "text": text}).inject(this.searchProcessSearchchildNode);
- var proListNode = new Element("div", {"styles": this.css.applicationChildChildNode}).inject(this.searchProcessSearchchildNode);
- this.appStartableData.each(function (app) {
- app.processList.each(function(pro){
- if (pro.name.indexOf(key)!==-1){
- var data = Object.clone(pro);
- data.applicationName = app.name;
- new MWF.xApplication.process.TaskCenter.Process(data, {"app": this.app, "starter": this}, {"name": app.applicationName || app.appName || app.name }, proListNode);
- }
- }.bind(this));
- }.bind(this));
- }
- }else{
- ( this.startApplications || [] ).each(function(app){ app.unselected(); });
- if (this.searchProcessSearchchildNode) this.searchProcessSearchchildNode.destroy();
- if(this.allApplicationStarter){
- this.startProcessSearchNode.setStyle("display", "block");
- this.allApplicationStarter.selected();
- }
- }
- },
- listApplications: function () {
- this.app.getAction(function () {
- // var p1 = this.app.action.listApplicationStartable();
- var p1 = o2.Actions.load("x_processplatform_assemble_surface").ApplicationAction.listWithPersonAndTerminal("client");
- var p2 = o2.Actions.load("x_cms_assemble_control").AppInfoAction.listPublishWithProcess();
- Promise.all([p1, p2]).then(function(data){
- var json_process = data[0], json_column = data[1];
- this.appStartableData = json_process.data;
- this.columnStartableData = json_column.data;
- this.startProcessSearchNode.setStyle("display", "block");
- this.allApplicationStarter = new MWF.xApplication.process.TaskCenter.AllApplication(json_process.data, this, json_column.data);
- this.allApplicationStarter.selected();
- json_process.data.each(function (app) {
- if (app.processList && app.processList.length) new MWF.xApplication.process.TaskCenter.Application(app, this);
- }.bind(this));
- json_column.data.each(function (column) {
- new MWF.xApplication.process.TaskCenter.Column(column, this);
- }.bind(this));
- }.bind(this));
- }.bind(this));
- },
- setResizeStartProcessAreaHeight: function () {
- if (this.startProcessAreaNode) {
- var size = this.content.getSize();
- var nodeSize = this.startProcessAreaNode.getSize();
- var x = (size.x-nodeSize.x)/2;
- var y = (size.y-nodeSize.y)/2;
- this.startProcessAreaNode.setStyle("top", "" + y + "px");
- this.startProcessAreaNode.setStyle("left", "" + x + "px");
- var maskNode = this.content.getParent().getElement("#process_taskcenter_startProcessMask");
- //var maskNode = this.window.node.getElement("#process_taskcenter_startProcessMask");
- if (maskNode){
- maskNode.setStyles({"width": ""+size.x+"px", "height": ""+size.y+"px"});
- maskNode.position({
- "relativeTo": this.content,
- "position": "topLeft",
- "edge": "topLeft"
- });
- }
- if (this.startProcessProcessListNode){
- var topSize = this.startProcessTopNode.getSize();
- var searchSize = this.startProcessSearchNode.getSize();
- var h = nodeSize.y-topSize.y-searchSize.y;
- this.startProcessProcessListNode.setStyle("height", ""+h+"px");
- }
- }
- },
- showStartProcessArea_mobile: function(){
- if (!this.startProcessAreaNode) {
- this.createStartProcessArea_mobile();
- }
- this.startProcessAreaNode.setStyle("display", "block");
- //document.body.setStyle("-webkit-overflow-scrolling", "auto");
- var morph = new Fx.Morph(this.startProcessAreaNode, {
- "duration": 200,
- "transition": Fx.Transitions.Expo.easeOut
- });
- morph.start({"left": "0px"});
- },
- createStartProcessArea_mobile: function(){
- this.startProcessAreaNode = new Element("div", {"styles": this.css.startProcessAreaNode_mobile}).inject(this.content);
- var size = this.content.getSize();
- this.startProcessAreaNode.setStyles({
- "width": ""+size.x+"px",
- "height": ""+size.y+"px",
- "top": "0px",
- "left": ""+size.x+"px"
- });
- this.startProcessTopNode = new Element("div", {"styles": this.css.startProcessTopNode_mobile}).inject(this.startProcessAreaNode);
- this.startProcessCloseNode = new Element("div", {"styles": this.css.startProcessCloseNode_mobile, "text": this.lp.back}).inject(this.startProcessTopNode);
- this.startProcessCloseNode.addEvent("click", function (e) {
- this.closeStartProcessArea(e);
- }.bind(this));
- this.searchProcessNode = new Element("div", {"styles": this.css.searchProcessNode_mobile}).inject(this.startProcessAreaNode);
- this.searchProcessInput = new Element("input", {
- "styles": this.css.searchProcessInput_mobile,
- "placeholder": this.lp.searchProcess
- }).inject(this.searchProcessNode);
- this.searchProcessAction = new Element("div", {"styles": this.css.searchProcessAction_mobile}).inject(this.searchProcessNode);
- this.searchProcessAction.addEvent("click", function (e) {
- var v = this.searchProcessInput.get("value");
- var flag = false;
- var top5Node = this.startProcessListNode.getElement(".top5Node");
- if(top5Node){
- top5Node.getElements(".processItem").each(function(el){
- var isShow = !v || el.get("text").contains(v);
- isShow ? el.show() : el.hide();
- if( isShow )flag = true;
- });
- flag ? top5Node.show() : top5Node.hide();
- }
- this.startProcessListNode.getElements(".appNode").each(function(appel){
- var flag1 = false;
- appel.getElements(".processItem").each(function(el){
- var isShow = !v || el.get("text").contains(v);
- isShow ? el.show() : el.hide();
- if( isShow )flag1 = true;
- });
- flag1 ? appel.show() : appel.hide();
- });
- }.bind(this));
- this.startProcessListNode = new Element("div", {"styles": this.css.startProcessListNode_mobile}).inject(this.startProcessAreaNode);
- var h = size.y-this.startProcessTopNode.getSize().y - this.searchProcessNode.getSize().y;
- this.startProcessListNode.setStyle("height", ""+h+"px");
- this.app.getAction(function () {
- o2.Actions.load("x_processplatform_assemble_surface").ApplicationAction.listWithPersonAndTerminal("mobile", function (appjson) {
- //this.app = this;
- MWF.UD.getDataJson("taskCenter_startTop", function(json){
- this.top5Data = json;
- if (this.top5Data && this.top5Data.length){
- var top5Node = new Element("div.top5Node").inject(this.startProcessListNode);
- new Element("div.top5Title", {"styles": this.css.applicationChildTitleNode, "text": this.lp.startTop5}).inject(top5Node);
- var top5ChildNode = new Element("div.top5ChildNode", {"styles": this.css.applicationChildChildNode}).inject(top5Node);
- this.top5Data.sort(function(p1, p2){
- return 0-(p1.count-p2.count);
- });
- this.top5Data.each(function(process, i){
- if (i<5) new MWF.xApplication.process.TaskCenter.Process(process, this, {"name": process.applicationName}, top5ChildNode);
- }.bind(this));
- }
- appjson.data.each(function (app) {
- if (app.processList && app.processList.length > 0) {
- var appNode = new Element("div.appNode").inject(this.startProcessListNode);
- new Element("div.appTitleNode", {"styles": this.css.applicationChildTitleNode, "text": app.name}).inject(appNode);
- var appChildNode = new Element("div.appChildNode", {"styles": this.css.applicationChildChildNode}).inject(appNode);
- app.processList.each(function(process){
- new MWF.xApplication.process.TaskCenter.Process(process, this, {"name": app.applicationName || app.appName || app.name }, appChildNode);
- }.bind(this));
- }
- }.bind(this));
- }.bind(this));
- }.bind(this));
- }.bind(this));
- },
- // getAction: function (callback) {
- // if (!this.action) {
- // this.action = MWF.Actions.get("x_processplatform_assemble_surface");
- // if (callback) callback();
- // } else {
- // if (callback) callback();
- // }
- // },
- closeStartProcessArea: function () {
- if (layout.mobile){
- var size = this.startProcessAreaNode.getSize();
- var morph = new Fx.Morph(this.startProcessAreaNode, {
- "duration": 200,
- "transition": Fx.Transitions.Expo.easeOut,
- "onComplete": function(){
- this.startProcessAreaNode.setStyle("display", "none");
- }.bind(this)
- });
- morph.start({"left": ""+size.x+"px"});
- }else{
- this.content.unmask();
- if (this.startProcessAreaNode) this.startProcessAreaNode.fade("out");
- }
- }
- });
- // MWF.xApplication.process.TaskCenter.AllApplication = new Class({
- // Extends: MWF.xApplication.process.TaskCenter.Application,
- // initialize: function(data, app){
- // this.bgColors = ["#30afdc", "#e9573e", "#8dc153", "#9d4a9c", "#ab8465", "#959801", "#434343", "#ffb400", "#9e7698", "#00a489"];
- // this.data = data;
- // this.app = app;
- // this.container = this.app.startProcessApplicationAreaNode;
- // this.processContainer = this.app.startProcessProcessAreaNode;
- // this.css = this.app.css;
- // this.isLoaded = false;
- //
- // this.load();
- // },
- // load: function(){
- // this.node = new Element("div", {"styles": this.css.applicationNode}).inject(this.container);
- // this.iconAreaNode = new Element("div", {"styles": this.css.applicationIconAreaNode}).inject(this.node);
- // this.iconNode = new Element("img", {"styles": this.css.applicationIconNode}).inject(this.iconAreaNode);
- // this.iconNode.set("src", "../x_component_process_TaskCenter/$Main/default/icon/appAppliction.png");
- //
- // this.textNode = new Element("div", {"styles": this.css.applicationTextNode}).inject(this.node);
- // this.textNode.set("text", this.app.lp.all);
- // this.textNode.set("title", this.app.lp.all);
- //
- // this.childNode = new Element("div", {"styles": this.css.applicationChildNode}).inject(this.processContainer);
- // //this.loadChild();
- // this.node.addEvent("click", function(){
- // this.selected();
- // }.bind(this));
- // this.app.startApplications.push(this);
- // },
- // unselected: function(){
- // this.childNode.empty();
- // this.isLoaded = false;
- // this.childNode.setStyle("display", "none");
- // this.node.setStyles(this.css.applicationNode);
- // },
- // loadChild: function(){
- // //this.loadSearch();
- // MWF.UD.getDataJson("taskCenter_startTop", function(json){
- // this.top5Data = json;
- // if (this.top5Data && this.top5Data.length){
- // new Element("div", {"styles": this.css.applicationChildTitleNode, "text": this.app.lp.startTop5}).inject(this.childNode);
- // var top5ChildNode = new Element("div", {"styles": this.css.applicationChildChildNode}).inject(this.childNode);
- //
- // this.top5Data.sort(function(p1, p2){
- // return 0-(p1.count-p2.count);
- // });
- // }
- //
- // var allowProcessIds = [];
- // this.data.each(function (app) {
- // new Element("div", {"styles": this.css.applicationChildTitleNode, "text": app.name}).inject(this.childNode);
- // var appChildNode = new Element("div", {"styles": this.css.applicationChildChildNode}).inject(this.childNode);
- // app.processList.each(function(process){
- // allowProcessIds.push(process.id);
- // new MWF.xApplication.process.TaskCenter.Process(process, this, app, appChildNode);
- // }.bind(this));
- // }.bind(this));
- //
- // if (top5ChildNode){
- // saveflag = false;
- // this.top5Data.each(function(process, i){
- // if (allowProcessIds.indexOf(process.id)!==-1){
- // if (i<5) new MWF.xApplication.process.TaskCenter.Process(process, this, {"name": process.applicationName}, top5ChildNode);
- // }else{
- // saveflag = true;
- // process.count=0;
- // }
- // }.bind(this));
- // if (saveflag) MWF.UD.putData("taskCenter_startTop", this.top5Data);
- // }
- //
- // }.bind(this));
- // }
- // });
|