Bläddra i källkod

更新团队前台

jinfei 5 år sedan
förälder
incheckning
95eb150db2

+ 51 - 3
o2web/source/x_component_TeamWork/$Project/default/css.wcss

@@ -377,12 +377,26 @@
         "font-size":"13px",
         "margin-left":"10px"
     },
-
+    foldContainer:{
+        float:"left", width:"12px", height:"100%","border-left":"0px solid #ffffff","margin-left":"1px"
+    },
+    foldIcon:{
+         "width":"12px",
+         "height":"30px",
+         "line-height":"30px",
+         "background-color":"#ffffff",
+         "border-top-right-radius":"4px",
+         "border-bottom-right-radius":"4px",
+         "border-top":"1px solid #D9D9D9",
+         "border-right":"1px solid #D9D9D9",
+         "border-bottom":"1px solid #D9D9D9",
+         "cursor":"pointer"
+     },
 	taskContentLayout:{
         flex:"1",
 	    "overflow-x":"auto",
 	    "overflow-y":"hidden",
-        "padding-left":"10px",
+        //"padding-left":"10px",
         //"padding-right":"10px",
         "width":"100%",
         "height":"99%",
@@ -494,7 +508,35 @@
         "width":"230px"
     },
     taskItemTitle:{
-        "font-size":"14px"
+        "font-size":"14px",
+        "height":"24px"
+    },
+    taskItemComplete:{
+        "float":"left",
+        "width":"16px",
+        "height":"16px",
+        "margin-right":"2px",
+        "margin-top":"4px",
+        "background":"url(/x_component_TeamWork/$Project/default/icon/icon_complete.png) no-repeat center "
+    },
+    taskItemName:{
+        "float":"left",
+        "line-height":"24px",
+        "height":"24px",
+        "width":"190px",
+        "overflow":"hidden",
+        "text-overflow": "ellipsis",
+        "white-space": "nowrap"
+    },
+    taskItemExecutor:{
+        "float":"right",
+        "width":"20px",
+        "height":"20px",
+        "background-color":"#189AEE",
+        "color":"#ffffff",
+        "line-height":"20px",
+        "text-align":"center",
+        "border-radius":"10px"
     },
     taskItemDetail:{
         "font-size":"12px",
@@ -671,6 +713,12 @@
         "background-color":"#ffffff",
         "border-bottom":"1px solid #EEEEEE"
     },
+    viewColor:{
+        "float":"left",
+        "width":"5px",
+        "height":"50px",
+        "background-color":""
+    },
     viewName:{
         "float":"left",
         "line-height":"50px",

BIN
o2web/source/x_component_TeamWork/$Project/default/icon/icon_complete.png


BIN
o2web/source/x_component_TeamWork/$Project/default/icon/icon_fold.png


BIN
o2web/source/x_component_TeamWork/$Project/default/icon/icon_fold_click.png


BIN
o2web/source/x_component_TeamWork/$Project/default/icon/icon_right_arrow.png


BIN
o2web/source/x_component_TeamWork/$Project/default/icon/icon_upfold.png


BIN
o2web/source/x_component_TeamWork/$Project/default/icon/icon_upfold_click.png


BIN
o2web/source/x_component_TeamWork/$Task/default/icon/icon_duty.png


+ 58 - 1
o2web/source/x_component_TeamWork/Main.js

@@ -19,7 +19,7 @@ MWF.xApplication.TeamWork.Main = new Class({
 		// "isMax": true,
 		"title": MWF.xApplication.TeamWork.LP.title
 	},
-	onQueryLoad: function(){
+	onQueryLoad: function(){ //111
 		this.lp = MWF.xApplication.TeamWork.LP;
 	},
 
@@ -67,6 +67,57 @@ MWF.xApplication.TeamWork.Main = new Class({
 		this.st = new MWF.xApplication.TeamWork.Common.Tips(this.content, target, this.app, data, opt);
 		this.st.load();
 	},
+	tips:function(target,title){
+		//if(myTips) delete myTips;
+		var myTips = new Tips(target, {
+			onShow:function(tip, el){
+
+				console.log("ttt="+title);
+				tip.setStyles({
+					visibility: 'hidden',
+					display: 'block',
+					"background-color":"#000000",
+					"border-radius":"5px",
+					"padding":"5px",
+					"color":"#ffffff",
+					"offset":{
+						x:200,
+						y:200
+					}
+				}).fade('in');
+
+			},
+			onHide:function(tip,el){
+				myTips.setTitle("");
+			},
+			title:function(){
+				return title
+			}
+		});
+
+		myTips.setTitle(title);
+		//if you want to add this after init
+		// myTips.removeEvents('show').addEvent('show', function(tip, el){
+		// 	console.log("ttt="+title)
+		// 	tip.setStyles({
+		// 		visibility: 'hidden',
+		// 		display: 'block',
+		// 		"background-color":"#000000",
+		// 		"border-radius":"5px",
+		// 		"padding":"5px",
+		// 		"color":"#ffffff",
+		// 		"offset":{
+		// 			x:200,
+		// 			y:200
+		// 		},
+		// 		title:function(){
+		// 			return title
+		// 		}
+		// 	}).fade('in');
+		// });
+	},
+
+
 	selectCalendar : function( target, container, options, callback ){
 		var type = options.type;
 		var calendarOptions = {
@@ -233,6 +284,12 @@ MWF.xApplication.TeamWork.Main = new Class({
 			});
 		}
 
+		if(this.content.getElements(".foldIcon").length>0){
+			var fo = this.content.getElements(".foldIcon")[0];
+			var p = fo.getParent();
+			var _margin_height = (p.getHeight())/2 - (fo.getHeight())/2;
+			fo.setStyles({"margin-top":_margin_height+"px"});
+		}
 
 
 

+ 132 - 17
o2web/source/x_component_TeamWork/Project.js

@@ -51,7 +51,8 @@ MWF.xApplication.TeamWork.Project = new Class({
                 var opt={
                     axis: "y"      //箭头在x轴还是y轴上展现
                 };
-                this.app.showTips(this.topBarBackHomeIcon,{_html:"<div style='margin:2px 5px;'>"+this.lp.backProject+"</div>"},opt);
+                //this.app.showTips(this.topBarBackHomeIcon,{_html:"<div style='margin:2px 5px;'>"+this.lp.backProject+"</div>"},opt);
+                //this.app.tips(this.topBarBackHomeIcon,this.lp.backProject);
             }.bind(this)
         });
         this.topBarBackHomeNext = new Element("div.topBarBackHomeNext",{styles:this.css.topBarBackHomeNext}).inject(this.topBarBackContainer);
@@ -168,9 +169,52 @@ MWF.xApplication.TeamWork.Project = new Class({
     createTaskLayout:function(){
         if(this.contentLayout) this.contentLayout.empty();
         this.createNaviContent();
+        this.createFoldContainer();
         this.createTaskContent();
 
     },
+    createFoldContainer:function(){
+        if(this.foldContainer) this.foldContainer.destroy();
+        this.foldContainer = new Element("div.foldContainer",{styles:this.css.foldContainer}).inject(this.contentLayout);
+        this.foldIcon = new Element("div.foldIcon",{styles:this.css.foldIcon,text:"<"}).inject(this.foldContainer);
+        this.app.tips(this.foldIcon,"折叠");
+        this.foldIcon.addEvents({
+            mouseover:function(){
+                this.naviLayout.setStyles({"box-shadow": "1px 2px 6px 0px #1b9aee"});
+                this.foldIcon.setStyles({"background-color":"#1b9aee","color":"#ffffff"});
+            }.bind(this),
+            mouseout:function(){
+                this.naviLayout.setStyles({"box-shadow": "0px 2px 4px 0 #888888"});
+                this.foldIcon.setStyles({"background-color":"#ffffff","color":""});
+            }.bind(this),
+            click:function(){
+                if(this.naviFold){
+                    var fx = new Fx.Tween(this.naviLayout,{duration:100});
+                    this.naviLayout.show();
+                    fx.start(["width"] ,"0", "300")
+                        .chain(function(){
+                            this.foldIcon.set("text","<");
+                            this.naviFold = false;
+                            this.app.tips(this.foldIcon,"折叠11");
+                        }.bind(this));
+
+                }else{ //aaaaa
+                    var fx = new Fx.Tween(this.naviLayout,{duration:100});
+                    fx.start(["width"] ,"300", "0")
+                        .chain(function(){
+                            this.naviLayout.hide();
+                            this.foldIcon.set("text",">");
+                            this.naviFold = true;
+                            //console.log("zzzzzzzzzzzzzzzzzzzzzk");
+                            this.app.tips(this.foldIcon,"展开22");
+                        }.bind(this));
+
+                }
+            }.bind(this)
+        })
+        var _margin_height = (this.foldContainer.getHeight())/2 - (this.foldIcon.getHeight())/2;
+        this.foldIcon.setStyles({"margin-top":_margin_height+"px"});
+    },
     createNaviContent:function(){
         if(this.naviLayout) this.naviLayout.destroy();
         this.naviLayout = new Element("div.naviLayout",{styles:this.css.naviLayout}).inject(this.contentLayout);
@@ -237,7 +281,8 @@ MWF.xApplication.TeamWork.Project = new Class({
                 this.naviTopTaskAdd.setStyles({
                     "background-image":"url(/x_component_TeamWork/$Project/default/icon/icon_zengjia_blue2_click.png)"
                 });
-                this.app.showTips(this.naviTopTaskAdd,{_html:"<div style='margin:2px 5px;'>"+this.lp.taskAdd+"</div>"});
+                //this.app.showTips(this.naviTopTaskAdd,{_html:"<div style='margin:2px 5px;'>"+this.lp.taskAdd+"</div>"});
+                this.app.tips(this.naviTopTaskAdd,this.lp.taskAdd)
             }.bind(this),
             mouseout:function(){
                 this.naviTopTaskAdd.setStyles({
@@ -273,13 +318,16 @@ MWF.xApplication.TeamWork.Project = new Class({
         this.completeLine = new Element("div.completeLine",{styles:this.css.completeLine}).inject(this.naviTopTaskLine);
         this.completeLine.addEvents({
             mouseover:function(){
-                this.app.showTips(this.completeLine,{_html:"<div style='margin:2px 5px;'>"+this.lp.taskCompleteText+":"+this.currentProjectGroupData.completedTotal+"</div>"});
+                //this.app.showTips(this.completeLine,{_html:"<div style='margin:2px 5px;'>"+this.lp.taskCompleteText+":"+this.currentProjectGroupData.completedTotal+"</div>"});
+                this.app.tips(this.completeLine,this.lp.taskCompleteText + ": " + this.currentProjectGroupData.completedTotal);
             }.bind(this)
         });
         this.overLine = new Element("div.overLine",{styles:this.css.overLine}).inject(this.naviTopTaskLine);
         this.overLine.addEvents({
             mouseover:function(){
-                this.app.showTips(this.overLine,{_html:"<div style='margin:2px 5px;'>"+this.lp.taskCompleteText+":"+this.currentProjectGroupData.overtimeTotal+"</div>"});
+                //this.app.showTips(this.overLine,{_html:"<div style='margin:2px 5px;'>"+this.lp.taskCompleteText+":"+this.currentProjectGroupData.overtimeTotal+"</div>"});
+                //alert(this.currentProjectGroupData.overtimeTotal)
+                this.app.tips(this.overLine,this.lp.taskovertimeText + ": " + this.currentProjectGroupData.overtimeTotal)
             }.bind(this)
         });
 
@@ -382,8 +430,8 @@ MWF.xApplication.TeamWork.Project = new Class({
                         this.curNaviItem = json.name;
                         this.openView(this.naviItemFlowContainer);
                     }.bind(this),
-                    mouseenter:function(){ _self.naviItemChange(this,"enter")},
-                    mouseleave:function(){_self.naviItemChange(this,"leave")}
+                    mouseenter:function(){ if(_self.curNaviItem != json.name) _self.naviItemChange(this,"enter")},
+                    mouseleave:function(){ if(_self.curNaviItem != json.name) _self.naviItemChange(this,"leave")}
                 });
             }else if(json.name==this.lp.viewItemComplete){
                 //已完成任务
@@ -402,8 +450,8 @@ MWF.xApplication.TeamWork.Project = new Class({
                         this.curNaviItem = json.name;
                         this.openView(this.naviItemCompleteContainer);
                     }.bind(this),
-                    mouseenter:function(){ _self.naviItemChange(this,"enter")},
-                    mouseleave:function(){_self.naviItemChange(this,"leave")}
+                    mouseenter:function(){ if(_self.curNaviItem != json.name) _self.naviItemChange(this,"enter")},
+                    mouseleave:function(){ if(_self.curNaviItem != json.name) _self.naviItemChange(this,"leave")}
                 });
             }else if(json.name==this.lp.viewItemOver){
                 //已逾期任务
@@ -422,8 +470,8 @@ MWF.xApplication.TeamWork.Project = new Class({
                         this.curNaviItem = json.name;
                         this.openView(this.naviItemOverContainer);
                     }.bind(this),
-                    mouseenter:function(){ _self.naviItemChange(this,"enter")},
-                    mouseleave:function(){_self.naviItemChange(this,"leave")}
+                    mouseenter:function(){ if(_self.curNaviItem != json.name) _self.naviItemChange(this,"enter")},
+                    mouseleave:function(){ if(_self.curNaviItem != json.name) _self.naviItemChange(this,"leave")}
                 });
             }else{
                 //自定义视图
@@ -488,6 +536,9 @@ MWF.xApplication.TeamWork.Project = new Class({
                     //if(i>0) return;
                     var taskGroupLayout = new Element("div.taskGroupLayout",{styles:this.css.taskGroupLayout,id:data.id}).inject(this.taskContentLayout);
                     taskGroupLayout.set("sortable",data.control.sortable); //控制是否能排序
+                    // if(!data.control.sortable){
+                    //     taskGroupLayout.set()
+                    // }
                     this.createTaskGroupItemLayout(taskGroupLayout,data);
                 }.bind(this));
                 //新建任务列表按钮
@@ -600,7 +651,7 @@ MWF.xApplication.TeamWork.Project = new Class({
         this.app.setLoading(taskGroupItemContainer);
 
         //this.actions.taskListByListId(this.data.id,data.id,function(json){
-        this.rootActions.TaskAction.listMyTaskWithTaskListId(this.data.id,data.id,function(json){
+        this.rootActions.TaskAction.listAllTaskWithTaskListId(this.data.id,data.id,function(json){
             titleCount.set("text","("+json.count+")")
             taskGroupItemContainer.empty();
             var taskListData = json.data;
@@ -870,7 +921,13 @@ MWF.xApplication.TeamWork.Project = new Class({
         if(d.priority == this.lp.urgency)taskItemHover.setStyle("background-color","#ffaf38");
         else if(d.priority == this.lp.emergency)taskItemHover.setStyle("background-color","#ff0000");
         var taskItemContent = new Element("div.taskItemContent",{styles:this.css.taskItemContent}).inject(taskItemContainer);
-        var taskItemTitle = new Element("div.taskItemTitle",{styles:this.css.taskItemTitle,text:d.name}).inject(taskItemContent);
+        var taskItemTitle = new Element("div.taskItemTitle",{styles:this.css.taskItemTitle}).inject(taskItemContent);
+        var taskItemName = new Element("div.taskItemName",{styles:this.css.taskItemName,text:d.name}).inject(taskItemTitle);
+
+        var executor = d.executor.split("@")[0];
+        var shortE = executor.substring(0,1);
+        var taskItemExecutor = new Element("div",{styles:this.css.taskItemExecutor,text:shortE,title:executor}).inject(taskItemTitle);
+
         var taskItemDetail = new Element("div.taskItemDetail",{styles:this.css.taskItemDetail}).inject(taskItemContent);
         //时限
         var taskItemLimit = new Element("div.taskItemLimit",{styles:this.css.taskItemLimit}).inject(taskItemDetail);
@@ -897,8 +954,18 @@ MWF.xApplication.TeamWork.Project = new Class({
             }.bind(this));
         }.bind(this),null,false);
 
-        taskItemHover.setStyles({"height":taskItemContainer.getHeight()});
 
+        if(d.workStatus=="completed"){ //如果已完成
+            new Element("div.",{styles:this.css.taskItemComplete,title:this.lp.taskCompleteText}).inject(taskItemTitle,"top");
+            //taskItemContainer.setStyles({"opacity":"0.5"});
+            taskItemContainer.setStyles({"color":"grey"});
+            taskItemLimit.destroy();
+
+            taskItemHover.setStyles({"background-color":"#DEDEDE"});
+            taskItemExecutor.setStyles({"opacity":"0.5"})
+        }
+
+        taskItemHover.setStyles({"height":taskItemContainer.getHeight()});
 
         // var drag = new Drag(taskItemContainer, {
         //     "stopPropagation": true,
@@ -927,7 +994,7 @@ MWF.xApplication.TeamWork.Project = new Class({
             }.bind(this)
         };
         MWF.xDesktop.requireApp("TeamWork", "Task", function(){
-            var task = new MWF.xApplication.TeamWork.Task(this,data,opt);
+            var task = new MWF.xApplication.TeamWork.Task(this,data,opt,{projectObj:this});
             task.open();
         }.bind(this));
     },
@@ -1091,7 +1158,7 @@ MWF.xApplication.TeamWork.Project = new Class({
         }
 
 
-        this.rootActions.TaskAction[action](id||"(0)",10,this.data.id,data,function(json){
+        this.rootActions.TaskAction[action](id||"(0)",20,this.data.id,data,function(json){
             this.viewListContainer.getElements(".tmpLoading").destroy();
             json.data.each(function(data){
                 this.loadViewItem(data);
@@ -1119,6 +1186,16 @@ MWF.xApplication.TeamWork.Project = new Class({
     },
     loadViewItem:function(data){
         var viewItem = new Element("div.viewItem",{styles:this.css.viewItem}).inject(this.viewListContainer);
+        var viewColor = new Element("div.viewColor",{styles:this.css.viewColor}).inject(viewItem);
+
+        if(data.priority==this.lp.urgency){
+            //紧急
+            viewColor.setStyles({"background-color":"#fa8c15"});
+        }else if(data.priority==this.lp.emergency){
+            //特级
+            viewColor.setStyles({"background-color":"#E6240E"});
+        }
+
         var viewName = new Element("div.viewName",{styles:this.css.viewName,text:data.name}).inject(viewItem);
         var viewStatus = new Element("div.viewStatus",{styles:this.css.viewStatus,text:data.priority}).inject(viewItem);
         var viewDuty = new Element("div.viewDuty",{styles:this.css.viewDuty}).inject(viewItem);
@@ -1127,6 +1204,15 @@ MWF.xApplication.TeamWork.Project = new Class({
             viewDutyIcon.set("text",data.executor.split("@")[0].substr(0,1));
             viewDutyIcon.set("title",data.executor.split("@")[0])
         }
+
+        if(data.workStatus == "completed"){
+            var completeIcon = new Element("div",{styles:this.css.taskItemComplete,title:this.lp.taskCompleteText}).inject(viewName,"top");
+            completeIcon.setStyles({"margin-top":"16px"});
+            viewItem.setStyles({"color":"#DEDEDE"});
+            viewColor.destroy();
+            viewDutyIcon.setStyles({"opacity":"0.5"});
+        }
+
         viewItem.addEvents({
             mouseover:function(){ this.setStyles({"background-color":"#F2F5F7"}) },
             mouseout:function(){ this.setStyles({"background-color":"#ffffff"}) },
@@ -1141,6 +1227,24 @@ MWF.xApplication.TeamWork.Project = new Class({
             stat.load();
         }.bind(this));
     },
+    reloadTaskGroup:function(id){
+        var node;
+        if(id) node = this.taskContentLayout.getElementById(id);
+        if(!node)node = this.taskContentLayout.getElement("div[sortable='false']");
+
+        if(node){ //alert(id)
+            //console.log("id=============="+id);
+            this.rootActions.TaskListAction.get(this.currentProjectGroupData.id,id,function(json){
+                this.createTaskGroupItemLayout(node,json.data);
+            }.bind(this))
+        }
+
+    },
+
+    reloadInfor:function(){
+        //刷新页面上的一些信息,比如数量等未想好
+
+    },
     test:function(){
 
     }
@@ -1172,6 +1276,17 @@ MWF.xApplication.TeamWork.Project.NewTask = new Class({
         //this.formTableArea
         this.titleContainer = new Element("div.titleContainer",{styles:this.css.titleContainer}).inject(this.formTableArea);
         this.titleValue = new Element("input.titleValue",{styles:this.css.titleValue,placeholder:this.lp.newTaskPlaceholder}).inject(this.titleContainer);
+        this.titleValue.addEvents({
+            keyup:function(e){
+                var keycode = (e.event.keyCode ? e.event.keyCode : e.event.which);
+                //console.log(keycode)
+                if (keycode == 13 || keycode == 10) {
+                    this.okAction.click();
+                }else if(keycode == 27){
+                    this.closeAction.click();
+                }
+            }.bind(this),
+        });
 
         this.actionContainer = new Element("div.actionContainer",{styles:this.css.actionContainer}).inject(this.formTableArea);
         this.okAction = new Element("div.okAction",{styles:this.css.okAction,text:this.lp.newTaskOk}).inject(this.actionContainer);
@@ -1193,7 +1308,7 @@ MWF.xApplication.TeamWork.Project.NewTask = new Class({
 
                         };
                         MWF.xDesktop.requireApp("TeamWork", "Task", function(){
-                            var task = new MWF.xApplication.TeamWork.Task(this,data,opt);
+                            var task = new MWF.xApplication.TeamWork.Task(this,data,opt,{projectObj:this.explorer});
                             task.open();
                         }.bind(this));
                         this.fireEvent("createTask");
@@ -1208,6 +1323,7 @@ MWF.xApplication.TeamWork.Project.NewTask = new Class({
                 this.close();
             }.bind(this)
         });
+
     }
 
 });
@@ -1335,7 +1451,6 @@ MWF.xApplication.TeamWork.Project.TaskGroupMenu = new Class({
             mouseout:function(){this.setStyles({"background-color":""})}
         });
 
-
         if(callback)callback();
     }
 

+ 39 - 32
o2web/source/x_component_TeamWork/ProjectList.js

@@ -82,7 +82,8 @@ MWF.xApplication.TeamWork.ProjectList = new Class({
                             e.stopPropagation();
                         }.bind(this),
                         mouseover:function(){
-                            this.app.showTips(this.allItemAdd,{_html:"<div style='margin:2px 5px;'>"+this.lp.content.addProjectBlockText+"</div>"});
+                            //this.app.showTips(this.allItemAdd,{_html:"<div style='margin:2px 5px;'>"+this.lp.content.addProjectBlockText+"</div>"});
+                            this.app.tips(this.allItemAdd,this.lp.content.addProjectBlockText)
                         }.bind(this)
                     });
                     this.allItem.addEvents({
@@ -307,7 +308,8 @@ MWF.xApplication.TeamWork.ProjectList = new Class({
                         e.stopPropagation();
                     }.bind(this),
                     mouseover:function(e){
-                        this.app.showTips(this.groupMenuAdd,{_html:"<div style='margin:2px 5px;'>"+this.lp.navi.addGroup+"</div>"});
+                        //this.app.showTips(this.groupMenuAdd,{_html:"<div style='margin:2px 5px;'>"+this.lp.navi.addGroup+"</div>"});
+                        this.app.tips(this.groupMenuAdd,this.lp.navi.addGroup)
                         e.stopPropagation();
                     }.bind(this)
                 });
@@ -495,9 +497,11 @@ MWF.xApplication.TeamWork.ProjectList = new Class({
         var _self = this;
         //his.actions.groupList(function(json){
         this.rootActions.ProjectGroupAction.listGroups(function(json){
-            var data = json.data;
-            if(data.length == 0) return;
+
             this.customGroup.empty();
+            var data = json.data;
+            if(!data || data.length == 0) return;
+
             data.each(function(d){
 
                 var customGroupItemContainer = new Element("div.customGroupItemContainer",{styles:this.css.customGroupItemContainer}).inject(this.customGroup);
@@ -785,37 +789,40 @@ MWF.xApplication.TeamWork.ProjectList = new Class({
                 this.addProjectListText = new Element("div.addProjectListText",{styles:this.css.addProjectListText,text:this.lp.content.addProjectListText}).inject(this.addProjectList);
 
             }else{
-                if(!projectItemData) return;
-                projectItemData.each(function(d){
-                    var projectBlockItem = new Element("div.projectBlockItem",{styles:this.css.projectBlockItem}).inject(this.layoutList);
-                    projectBlockItem.set("id",d.id);
-                    if(d.icon && d.icon!=""){
-                        projectBlockItem.setStyles({
-                            "background-image":"url('"+MWF.xDesktop.getImageSrc( d.icon )+"')"
-                        });
-                    }
-                    projectBlockItem.addEvents({
-                        click:function(){
-                            _self.openProject(d);
-                        },
-                        mouseenter:function(){
-                            this.setStyles({
-                                "box-shadow":"0px 0px 10px #4a90e2"
-                            });
-                            //projectBlockItem.getElements(".projectBlockItemIconSetting").setStyles({"display":"block"});
-                            //projectBlockItem.getElements(".projectBlockItemIconRemove").setStyles({"display":"block"});
-                        },
-                        mouseleave:function(){
-                            this.setStyles({
-                                "box-shadow":"0px 0px 0px #DFDFDF"
+                if(projectItemData) {
+
+                    projectItemData.each(function(d){
+                        var projectBlockItem = new Element("div.projectBlockItem",{styles:this.css.projectBlockItem}).inject(this.layoutList);
+                        projectBlockItem.set("id",d.id);
+                        if(d.icon && d.icon!=""){
+                            projectBlockItem.setStyles({
+                                "background-image":"url('"+MWF.xDesktop.getImageSrc( d.icon )+"')"
                             });
-                            //projectBlockItem.getElements(".projectBlockItemIconSetting").setStyles({"display":"none"});
-                            //projectBlockItem.getElements(".projectBlockItemIconRemove").setStyles({"display":"none"});
                         }
-                    });
-                    this.loadSingleBlockItem(projectBlockItem,d);
+                        projectBlockItem.addEvents({
+                            click:function(){
+                                _self.openProject(d);
+                            },
+                            mouseenter:function(){
+                                this.setStyles({
+                                    "box-shadow":"0px 0px 10px #4a90e2"
+                                });
+                                //projectBlockItem.getElements(".projectBlockItemIconSetting").setStyles({"display":"block"});
+                                //projectBlockItem.getElements(".projectBlockItemIconRemove").setStyles({"display":"block"});
+                            },
+                            mouseleave:function(){
+                                this.setStyles({
+                                    "box-shadow":"0px 0px 0px #DFDFDF"
+                                });
+                                //projectBlockItem.getElements(".projectBlockItemIconSetting").setStyles({"display":"none"});
+                                //projectBlockItem.getElements(".projectBlockItemIconRemove").setStyles({"display":"none"});
+                            }
+                        });
+                        this.loadSingleBlockItem(projectBlockItem,d);
+
+                    }.bind(this));
+                }
 
-                }.bind(this));
                 this.addProjectBlock = new Element("div.addProjectBlock",{styles:this.css.addProjectBlock}).inject(this.layoutList);
                 this.addProjectBlockIcon = new Element("div.addProjectBlockIcon",{styles:this.css.addProjectBlockIcon}).inject(this.addProjectBlock);
                 this.addProjectBlockText = new Element("div.addProjectBlockText",{styles:this.css.addProjectBlockText,text:this.lp.content.addProjectBlockText}).inject(this.addProjectBlock);

+ 8 - 3
o2web/source/x_component_TeamWork/Task.js

@@ -52,7 +52,10 @@ MWF.xApplication.TeamWork.Task = new Class({
             this.openType = "dialog"
         }
 
-
+        this.projectObj = this.explorer;
+        if(para){
+            if(para.projectObj) this.projectObj = para.projectObj
+        }
         // this.explorer = explorer;
         //
         // this.app = this.explorer.app;
@@ -1365,6 +1368,7 @@ MWF.xApplication.TeamWork.Task = new Class({
                             name:this.subTaskNewInput.get("value").trim(),
                             project:this.taskData.project,
                             parent:this.taskData.id,
+                            taskGroupId:this.taskData.taskGroupId,
                             executor:this.taskSubNewPerson || ""
                         };
 
@@ -1725,10 +1729,11 @@ MWF.xApplication.TeamWork.Task.TaskMore = new Class({
             mouseleave:function(){this.setStyles({"background-color":""})},
             click:function(e){
                 _self.app.confirm("warn",e,_self.lp.taskCopy,_self.lp.taskContent,300,120,function(){
-                    _self.rootActions.TaskAction.copyTask(_self.explorer.data.taskId,function(json){ debugger;
+                    _self.rootActions.TaskAction.copyTask(_self.explorer.data.taskId,function(json){
                         if(json.type == "success"){
                             _self.explorer.data.taskId = json.data.id;
                             _self.explorer._createTableContent();
+                            _self.explorer.projectObj.reloadTaskGroup(_self.explorer.taskData.taskListId) //ffffffffffffff
                         }
                         this.close();
                         _self.close();
@@ -1757,7 +1762,7 @@ MWF.xApplication.TeamWork.Task.TaskMore = new Class({
                 var data = this.data;
                 var opt = {};
                 MWF.xDesktop.requireApp("TeamWork", "TaskMove", function(){
-                    var taskmove = new MWF.xApplication.TeamWork.TaskMove(this.explorer,data,opt);
+                    var taskmove = new MWF.xApplication.TeamWork.TaskMove(this.explorer,data,opt,{projectObj:this.explorer.projectObj});
                     taskmove.open();
                     var fx = new Fx.Tween(this.node,{duration:200});
                     fx.start(["opacity"] ,"1", "0").chain(function(){this.close()}.bind(this));

+ 29 - 9
o2web/source/x_component_TeamWork/TaskMove.js

@@ -45,6 +45,11 @@ MWF.xApplication.TeamWork.TaskMove = new Class({
         this.rootActions = this.app.rootActions;
         this.actions = this.rootActions.TaskAction;
 
+        this.projectObj = this.explorer;
+        if(para){
+            if(para.projectObj) this.projectObj = para.projectObj;
+        }
+
         this.data = data || {};
         this.cssPath = "/x_component_TeamWork/$TaskMove/"+this.options.style+"/css.wcss";
 
@@ -160,23 +165,38 @@ MWF.xApplication.TeamWork.TaskMove = new Class({
         // var taskPerson = new Element("div.taskPerson",{styles:this.css.taskPerson,text:n}).inject(taskItem);
     },
     createBottomLayout:function(){
+
         this.bottomLayout.empty();
         this.okAction = new Element("div.okAction",{styles:this.css.okAction,text:this.lp.ok}).inject(this.bottomLayout);
         this.okAction.addEvents({
             click:function(){
                 if(this.selectedItem){
                     if(this.selectedItem.get("id")==this.data.data.taskListId){
-                        this.app.notice(this.lp.moveToSelf,"error");
+                        this.app.notice(this.lp.moveToSelf,"info");
                         return;
                     }
-                    // var data = {
-                    //     parent : this.selectedItem.get("id"),
-                    //     id:this.data.data.id
-                    // };
-                    // this.actions.save(data,function(json){
-                    //     this.explorer._createTableContent();
-                    //     this.close();
-                    // }.bind(this))
+
+                    var data = {
+                        taskId:this.data.data.id
+                    }
+
+                    this.rootActions.TaskListAction.addTask2ListWithBehindTask(this.selectedItem.get("id"),data,function(json){
+                        if(json.data.id){
+                            //this.app.notice(json.data.message,"success");
+                            this.projectObj.reloadTaskGroup(json.data.id);  //reload to list
+                            this.projectObj.reloadTaskGroup(this.data.data.taskListId); //reload from list
+
+                            //this.explorer.projectObj.reloadTaskGroup(json.data.id);
+                            //this.explorer.projectObj.reloadTaskGroup(this.data.data.taskListId);
+                            // if(this.explorer.explorer){
+                            //     this.explorer.explorer.reloadTaskGroup(json.data.id);
+                            //     this.explorer.explorer.reloadTaskGroup(this.data.data.taskListId);
+                            // }
+                        }else{
+                            this.app.notice("不允许转移到未分类列表","error")
+                        }
+                        this.close();
+                    }.bind(this))
                 }
             }.bind(this)
         })