Просмотр исходного кода

Merge branch 'feature/teamwork' into 'develop'

【更新团队工作前台代码】Feature/teamwork

See merge request o2oa/o2oa!557
胡起 5 лет назад
Родитель
Сommit
ad7cbf2b63
45 измененных файлов с 2714 добавлено и 566 удалено
  1. 418 0
      o2web/source/x_component_TeamWork/$Bam/default/css.wcss
  2. BIN
      o2web/source/x_component_TeamWork/$Bam/default/icon/icon_access.png
  3. BIN
      o2web/source/x_component_TeamWork/$Bam/default/icon/icon_add.png
  4. BIN
      o2web/source/x_component_TeamWork/$Bam/default/icon/icon_add_click.png
  5. BIN
      o2web/source/x_component_TeamWork/$Bam/default/icon/icon_close.png
  6. BIN
      o2web/source/x_component_TeamWork/$Bam/default/icon/icon_close_click.png
  7. BIN
      o2web/source/x_component_TeamWork/$Bam/default/icon/icon_extField.png
  8. BIN
      o2web/source/x_component_TeamWork/$Bam/default/icon/icon_ok.png
  9. BIN
      o2web/source/x_component_TeamWork/$Bam/default/icon/icon_ok_click.png
  10. BIN
      o2web/source/x_component_TeamWork/$Bam/default/icon/icon_priority.png
  11. BIN
      o2web/source/x_component_TeamWork/$Bam/default/icon/icon_right.png
  12. BIN
      o2web/source/x_component_TeamWork/$Bam/default/icon/icon_template.png
  13. BIN
      o2web/source/x_component_TeamWork/$Bam/default/icon/icon_triangle_down.png
  14. BIN
      o2web/source/x_component_TeamWork/$Bam/default/icon/icon_triangle_down_blue_click.png
  15. BIN
      o2web/source/x_component_TeamWork/$Bam/default/icon/icon_xiangmu.png
  16. 167 103
      o2web/source/x_component_TeamWork/$NewProject/default/css.wcss
  17. BIN
      o2web/source/x_component_TeamWork/$NewProject/default/icon/selected.png
  18. 6 2
      o2web/source/x_component_TeamWork/$Project/default/css.wcss
  19. 30 13
      o2web/source/x_component_TeamWork/$ProjectList/default/css.wcss
  20. BIN
      o2web/source/x_component_TeamWork/$ProjectList/default/icon/icon_group.png
  21. BIN
      o2web/source/x_component_TeamWork/$ProjectList/default/icon/icon_group_grey.png
  22. 145 2
      o2web/source/x_component_TeamWork/$ProjectSetting/default/css.wcss
  23. BIN
      o2web/source/x_component_TeamWork/$ProjectSetting/default/icon/icon_access.png
  24. BIN
      o2web/source/x_component_TeamWork/$ProjectSetting/default/icon/icon_access_click.png
  25. BIN
      o2web/source/x_component_TeamWork/$ProjectSetting/default/icon/icon_detail.png
  26. BIN
      o2web/source/x_component_TeamWork/$ProjectSetting/default/icon/icon_detail_click.png
  27. BIN
      o2web/source/x_component_TeamWork/$ProjectSetting/default/icon/icon_more.png
  28. BIN
      o2web/source/x_component_TeamWork/$ProjectSetting/default/icon/icon_more_click.png
  29. BIN
      o2web/source/x_component_TeamWork/$ProjectSetting/default/icon/icon_selected.png
  30. BIN
      o2web/source/x_component_TeamWork/$ProjectSetting/default/icon/icon_selected_click.png
  31. BIN
      o2web/source/x_component_TeamWork/$ProjectSetting/default/icon/icon_unselected.png
  32. BIN
      o2web/source/x_component_TeamWork/$ProjectSetting/default/icon/icon_unselected_click.png
  33. 91 0
      o2web/source/x_component_TeamWork/$ProjectTemplate/default/css.wcss
  34. 3 1
      o2web/source/x_component_TeamWork/$Task/default/css.wcss
  35. 655 0
      o2web/source/x_component_TeamWork/Bam.js
  36. 1 1
      o2web/source/x_component_TeamWork/GroupSelect.js
  37. 23 26
      o2web/source/x_component_TeamWork/Main.js
  38. 100 2
      o2web/source/x_component_TeamWork/NewProject.js
  39. 58 59
      o2web/source/x_component_TeamWork/Project.js
  40. 234 131
      o2web/source/x_component_TeamWork/ProjectList.js
  41. 303 3
      o2web/source/x_component_TeamWork/ProjectSetting.js
  42. 119 0
      o2web/source/x_component_TeamWork/ProjectTemplate.js
  43. 269 213
      o2web/source/x_component_TeamWork/Task.js
  44. 13 8
      o2web/source/x_component_TeamWork/TaskAttachmentList.js
  45. 79 2
      o2web/source/x_component_TeamWork/lp/zh-cn.js

+ 418 - 0
o2web/source/x_component_TeamWork/$Bam/default/css.wcss

@@ -0,0 +1,418 @@
+{
+	"topBarLayout":{
+        "height":"50px",
+        "width":"100%",
+        "background-color":"#F7F7F7",
+        "box-shadow": "0 1px 3px 0 #888888",
+        "position":"absolute"
+	},
+	"contentLayout":{
+        "position":"absolute",
+        "left":"0px",
+        "top":"51px",
+        "bottom":"0px",
+        "width":"100%",
+        "overflow":"auto",
+        "display":"flex"
+	},
+	"topBarBackContainer":{
+	    "float":"left"
+	},
+	"topBarBackHomeIcon":{
+	    "cursor":"pointer",
+	    "float":"left",
+	    "margin-left":"10px",
+	    "width":"50px",
+	    "height":"50px",
+	    "background": "url(/x_component_TeamWork/$Bam/default/icon/icon_xiangmu.png) no-repeat center "
+	},
+	"topBarBackHomeNext":{
+	    "float":"left",
+        "width":"16px",
+        "height":"50px",
+        "background": "url(/x_component_TeamWork/$Bam/default/icon/icon_right.png) no-repeat center"
+	},
+	"bamTitle":{
+        "float":"left",
+        "cursor":"pointer",
+        "height":"50px",
+        "line-height":"50px",
+        "margin-left":"10px"
+    },
+
+    "containerLayout":{
+        "position":"absolute",
+        "left":"20px",
+        "right":"20px",
+        "top":"70px",
+        "bottom":"20px",
+        "display":"flex"
+    },
+    "naviLayout":{
+        "float":"left",
+        "width":"350px",
+        "height":"100%",
+        "background-color":"#ffffff",
+        "color":"#595959",
+        "font-size":"14px",
+        "border-radius":"4px"
+    },
+    "naviMenu":{
+        "height":"45px",
+        "line-height":"45px",
+        "margin-top":"10px",
+        "padding-left":"20px"
+    },
+    "naviItem":{
+        "width":"100%",
+        "margin-top":"10px",
+        "margin-bottom":"10px",
+        "height":"30px",
+        "cursor":"pointer",
+        "border-left":"2px solid #ffffff"
+    },
+    "templateIcon":{
+        "float":"left",
+        "width":"16px",
+        "height":"16px",
+        "margin-left":"20px",
+        "margin-top":"7px",
+        "background": "url(/x_component_TeamWork/$Bam/default/icon/icon_template.png) no-repeat center"
+    },
+    "templateText":{
+        "float":"left",
+        "line-height":"30px",
+        "margin-left":"8px"
+    },
+    "priorityIcon":{
+        "float":"left",
+        "width":"16px",
+        "height":"16px",
+        "margin-left":"20px",
+        "margin-top":"7px",
+        "background": "url(/x_component_TeamWork/$Bam/default/icon/icon_priority.png) no-repeat center"
+    },
+    "priorityText":{
+        "float":"left",
+        "line-height":"30px",
+        "margin-left":"8px"
+    },
+    "fieldIcon":{
+        "float":"left",
+        "width":"16px",
+        "height":"16px",
+        "margin-left":"20px",
+        "margin-top":"7px",
+        "background": "url(/x_component_TeamWork/$Bam/default/icon/icon_extField.png) no-repeat center"
+    },
+    "fieldText":{
+        "float":"left",
+        "line-height":"30px",
+        "margin-left":"8px"
+    },
+    "accessIcon":{
+        "float":"left",
+        "width":"16px",
+        "height":"16px",
+        "margin-left":"20px",
+        "margin-top":"7px",
+        "background": "url(/x_component_TeamWork/$Bam/default/icon/icon_access.png) no-repeat center"
+    },
+    "accessText":{
+        "float":"left",
+        "line-height":"30px",
+        "margin-left":"8px"
+    },
+
+    "contentLayout":{
+        "margin-left":"20px",
+        "overflow-x":"auto",
+        "overflow-y":"hidden",
+        //"padding-left":"10px",
+        //"padding-right":"10px",
+        "width":"100%",
+        "height":"100%",
+        "background-color":"#ffffff",
+        "display":"flex",
+        "position":"relative"
+    },
+    "templateTop":{
+        "position":"absolute",
+        "top":"0px",
+        "left":"0px",
+        "width":"100%",
+        "height":"100px",
+        "overflow-x":"hidden",
+        "border-bottom":"1px solid #cccccc"
+    },
+    "templateTopContent":{
+        "float":"left",
+        "margin-left":"50px",
+        "width":"500px",
+        "height":"100%"
+    },
+    "templateTopTitle":{
+        "font-size":"20px",
+        "width":"100%",
+        "height":"60px",
+        "line-height":"60px"
+    },
+    "templateTopDes":{
+        "width":"100%",
+        "height":"40px"
+    },
+    "templateTopAddContent":{
+        "float":"right",
+        "width":"100px",
+        "height":"100%"
+    },
+    "templateTopAdd":{
+        "line-height":"100px",
+        "font-size":"14px",
+        "color":"#1b9aee",
+        "cursor":"pointer"
+    },
+    "templateContainer":{
+        "flex":"1",
+        "width":"100%",
+        "position":"absolute",
+        "top":"110px",
+        "left":"0px",
+        "bottom":"0px",
+        "overflow-y":"auto",
+    },
+    "templateItemContainer":{
+        "height":"50px",
+        "width":"100%",
+        "cursor":"pointer",
+        "border-bottom":"1px solid rgb(238, 238, 238)",
+        "overflow":"hidden"
+    },
+    "templateItemContent":{
+        "float":"left",
+        "margin-left":"20px",
+        "width":"600px",
+        "height":"100%",
+        "font-size":"12px"
+    },
+    "templateItemTitle":{
+        "height":"30px",
+        "line-height":"30px",
+        "font-size":"16px"
+    },
+    "templateItemDes":{
+        "height":"20px",
+        "line-height":"20px",
+        "font-size":"12px"
+    },
+    "templateItemLane":{
+        "float":"left",
+        "width":"300px",
+        "height":"50px",
+        "display":"table",
+        "margin":"0px auto"
+    },
+    "templateItemLaneTxt":{
+        "height":"100%",
+        "width":"100%",
+        "vertical-align":"middle",
+        "display":"table-cell"
+    },
+    "templateItemOwner":{
+        "float":"left",
+        "width":"100px",
+        "height":"50px",
+        "line-height":"50px"
+    },
+    "templateItemDate":{
+        "float":"left",
+        "width":"100px",
+        "height":"50px",
+        "line-height":"50px"
+    },
+    "templateItemActionContainer":{
+        "float":"right",
+        "width":"100px",
+        "height":"50px",
+        "line-height":"50px",
+        "margin-right":"20px"
+    },
+    "templateItemEdit":{
+        "color":"#1b9aee",
+        "float":"left",
+        "margin-right":"20px",
+        "cursor":"pointer"
+    },
+    "templateItemRemove":{
+        "color":"#1b9aee",
+        "float":"left",
+        "margin-right":"20px",
+        "cursor":"pointer"
+    },
+    "priorityTop":{
+        "position":"absolute",
+        "top":"0px",
+        "left":"0px",
+        "width":"100%",
+        "height":"100px",
+        "overflow-x":"hidden",
+        "border-bottom":"1px solid #cccccc"
+    },
+    "priorityTopContent":{
+        "float":"left",
+        "margin-left":"50px",
+        "width":"500px",
+        "height":"100%"
+    },
+    "priorityTopTitle":{
+        "font-size":"20px",
+        "width":"100%",
+        "height":"60px",
+        "line-height":"60px"
+    },
+    "priorityTopDes":{
+        "width":"100%",
+        "height":"40px"
+    },
+    "priorityTopAddContent":{
+        "float":"right",
+        "width":"100px",
+        "height":"100%"
+    },
+    "priorityContainer":{
+        "flex":"1",
+        "width":"100%",
+        "position":"absolute",
+        "top":"110px",
+        "left":"0px",
+        "bottom":"0px",
+        "overflow-y":"auto",
+    },
+    "priorityItemContainer":{
+        "width":"100%",
+        "height":"60px",
+        "border-bottom":"1px dotted #cccccc",
+        "overflow":"hidden"
+    },
+    "priorityItemContent":{
+        "width":"100%"
+    },
+    "priorityValueContainer":{
+        "float":"left",
+        "width":"200px",
+        "height":"100%",
+        "line-height":"50px",
+        "margin-left":"50px"
+    },
+    "priorityValue":{
+        "width":"100%",
+        "height":"30px",
+        "line-height":"30px",
+        "border":"1px solid #cccccc",
+        "text-indent":"10px",
+        "font-size":"14px",
+        "outline":"none"
+    },
+    "priorityColorContainer":{
+        "float":"left",
+        "height":"100%",
+        "width":"300px",
+        "margin-left":"50px",
+        "display":"flex",
+        //"justify-content":"center",
+        "align-items":"center"
+    },
+    "priorityColorItemContainer":{
+        "float":"left",
+        "width":"25px",
+        "height":"25px",
+        "background-color":"#ffffff",
+        "margin-right":"15px",
+        "display":"flex",
+        "justify-content":"center",
+        "align-items":"center",
+        "border-radius":"10px"
+    },
+    "priorityColor":{
+        "cursor":"pointer",
+        "width":"14px",
+        "height":"14px",
+        "border-radius":"100%"
+    },
+    "priorityActionContainer":{
+        "float":"right",
+        "width":"100px",
+        "height":"100%"
+    },
+    priorityActionOK:{
+        "width":"20px",
+        "height":"20px",
+        "cursor":"pointer",
+        "float":"left",
+        "margin-top":"20px",
+        "margin-left":"20px",
+        "background": "url(/x_component_TeamWork/$Bam/default/icon/icon_ok.png) no-repeat center"
+    },
+    priorityActionRemove:{
+        "width":"20px",
+        "height":"20px",
+        "cursor":"pointer",
+        "float":"left",
+        "margin-top":"20px",
+        "margin-left":"20px",
+        "background": "url(/x_component_TeamWork/$Bam/default/icon/icon_close.png) no-repeat center"
+    },
+
+
+    "priorityColorRed":{
+        "width":"14px",
+        "height":"14px",
+        "background-color":"#FFCCCC",
+        "border-radius":"100%"
+    },
+    "priorityColorOrange":{
+        "width":"14px",
+        "height":"14px",
+        "background-color":"#FFD591",
+        "border-radius":"100%"
+    },
+    "priorityColorGreen":{
+        "width":"14px",
+        "height":"14px",
+        "background-color":"#CAFAC8",
+        "border-radius":"100%"
+    },
+    "priorityColorBlue":{
+        "width":"14px",
+        "height":"14px",
+        "background-color":"#CCECFF",
+        "border-radius":"100%"
+    },
+    "priorityColorGrey":{
+        "width":"14px",
+        "height":"14px",
+        "background-color":"#E5E5E5",
+        "border-radius":"100%"
+    },
+
+    "addPriorityContainer":{
+        "margin-left":"50px",
+        "margin-top":"10px",
+        "height":"50px",
+        "width":"100px",
+        "cursor":"pointer"
+    },
+    "addPriorityIcon":{
+        "float":"left",
+        "width":"30px",
+        "height":"30px",
+        "background": "url(/x_component_TeamWork/$Bam/default/icon/icon_add.png) no-repeat center"
+    },
+    "addPriorityTxt":{
+        "color":"#1296db",
+        "float":"left",
+        "width":"50px",
+        "height":"30px",
+        "line-height":"30px"
+    },
+}

BIN
o2web/source/x_component_TeamWork/$Bam/default/icon/icon_access.png


BIN
o2web/source/x_component_TeamWork/$Bam/default/icon/icon_add.png


BIN
o2web/source/x_component_TeamWork/$Bam/default/icon/icon_add_click.png


BIN
o2web/source/x_component_TeamWork/$Bam/default/icon/icon_close.png


BIN
o2web/source/x_component_TeamWork/$Bam/default/icon/icon_close_click.png


BIN
o2web/source/x_component_TeamWork/$Bam/default/icon/icon_extField.png


BIN
o2web/source/x_component_TeamWork/$Bam/default/icon/icon_ok.png


BIN
o2web/source/x_component_TeamWork/$Bam/default/icon/icon_ok_click.png


BIN
o2web/source/x_component_TeamWork/$Bam/default/icon/icon_priority.png


BIN
o2web/source/x_component_TeamWork/$Bam/default/icon/icon_right.png


BIN
o2web/source/x_component_TeamWork/$Bam/default/icon/icon_template.png


BIN
o2web/source/x_component_TeamWork/$Bam/default/icon/icon_triangle_down.png


BIN
o2web/source/x_component_TeamWork/$Bam/default/icon/icon_triangle_down_blue_click.png


BIN
o2web/source/x_component_TeamWork/$Bam/default/icon/icon_xiangmu.png


+ 167 - 103
o2web/source/x_component_TeamWork/$NewProject/default/css.wcss

@@ -1,106 +1,170 @@
 {
     "newProjectTop":{
-            "height":"40px",
-            "width":"100%",
-            "border-bottom":"1px solid #E6E6E6"
-        },
-        "newProjectTopText":{
-            "float":"left",
-            "height":"100%",
-            "line-height":"40px",
-            "width":"90%",
-            "text-align":"center",
-            "font-size":"16px",
-            "color":"#333333"
-        },
-        "newProjectTopClose":{
-            "cursor":"pointer",
-            "float":"right",
-            "margin-right":"2px",
-            "margin-top":"12px",
-            "width":"16px",
-            "height":"16px",
-            "background":"url(../x_component_TeamWork/$ProjectList/default/icon/icon_off.png) no-repeat center "
-        },
-        newProjectContainer:{
-            "margin-top":"10px",
-            "width":"80%",
-            "margin":"20px auto",
-            "height":"36px",
-            "border-radius": "10px",
-            "border":"1px solid #DEDEDE"
-        },
-        newProjectIn:{
-            "border":"0px",
-            "height":"32px",
-            "width":"90%",
-            "margin-left":"10px",
-            "font-size":"14px",
-            "color":"#666666",
-            "outline":"none"
-        },
-        newProjectDesContainer:{
-            "margin-top":"10px",
-            "width":"80%",
-            "margin":"20px auto",
-            "height":"36px",
-            "border-radius": "10px",
-            "border":"1px solid #DEDEDE",
-            "padding-top":"5px"
-        },
-        newProjectDesIn:{
-            "overflow":"auto",
-            "border":"0px",
-            "height":"32px",
-            "line-height":"32px",
-            "width":"92%",
-            "margin-left":"10px",
-            "font-size":"12px",
-            "color":"#666666",
-            "outline":"none",
-            "resize":"none"
-        },
-        "newProjectGroupText":{
-            "height":"20px",
-            "width":"80%",
-            "font-size":"13px",
-            "color":"#333333",
-            "margin":"20px auto 0px auto"
-        },
-        "newProjectGroupContainer":{
-            "cursor":"pointer",
-            "width":"80%",
-            "margin":"5px auto 20px auto",
-            "height":"36px",
-            "border-radius": "10px",
-            "border":"1px solid #DEDEDE"
-        },
-        "newProjectGroupValue":{
-            "width":"80%",
-            "margin-left":"6px",
-            "float":"left",
-            "height":"36px",
-            "line-height":"36px",
-            "outline":"none"
-        },
-        "newProjectGroupArrow":{
-            "float":"right",
-            "width":"16px",
-            "height":"16px",
-            "margin-top":"10px",
-            "margin-right":"10px",
-            "background":"url(../x_component_TeamWork/$ProjectList/default/icon/icon_triangle_down.png) no-repeat center "
-        },
-        newProjectAdd:{
-            "text-align":"center",
-            "font-size":"16px",
-            "color":"#666666",
-            "width":"80%",
-            "margin":"20px auto",
-            "height":"40px",
-            "line-height":"40px",
-            "background-color":"#F0F0F0",
-            "border-radius":"10px",
-            "margin":"20px auto"
-        },
+        "height":"40px",
+        "width":"100%",
+        "border-bottom":"1px solid #E6E6E6"
+    },
+    "newProjectTopText":{
+        "float":"left",
+        "height":"100%",
+        "line-height":"40px",
+        "width":"90%",
+        "text-align":"center",
+        "font-size":"16px",
+        "color":"#333333"
+    },
+    "newProjectTopClose":{
+        "cursor":"pointer",
+        "float":"right",
+        "margin-right":"2px",
+        "margin-top":"12px",
+        "width":"16px",
+        "height":"16px",
+        "background":"url(../x_component_TeamWork/$ProjectList/default/icon/icon_off.png) no-repeat center "
+    },
+    newProjectContainer:{
+        "margin-top":"10px",
+        "width":"80%",
+        "margin":"20px auto",
+        "height":"36px",
+        "border-radius": "10px",
+        "border":"1px solid #DEDEDE"
+    },
+    newProjectIn:{
+        "border":"0px",
+        "height":"32px",
+        "width":"90%",
+        "margin-left":"10px",
+        "font-size":"14px",
+        "color":"#666666",
+        "outline":"none"
+    },
+    newProjectDesContainer:{
+        "margin-top":"10px",
+        "width":"80%",
+        "margin":"20px auto",
+        "height":"36px",
+        "border-radius": "10px",
+        "border":"1px solid #DEDEDE",
+        "padding-top":"5px"
+    },
+    newProjectDesIn:{
+        "overflow":"auto",
+        "border":"0px",
+        "height":"32px",
+        "line-height":"32px",
+        "width":"92%",
+        "margin-left":"10px",
+        "font-size":"12px",
+        "color":"#666666",
+        "outline":"none",
+        "resize":"none"
+    },
+    "newProjectGroupText":{
+        "height":"20px",
+        "width":"80%",
+        "font-size":"13px",
+        "color":"#333333",
+        "margin":"20px auto 0px auto"
+    },
+    "newProjectGroupContainer":{
+        "cursor":"pointer",
+        "width":"80%",
+        "margin":"5px auto 20px auto",
+        "height":"36px",
+        "border-radius": "10px",
+        "border":"1px solid #DEDEDE"
+    },
+    "newProjectGroupValue":{
+        "width":"80%",
+        "margin-left":"6px",
+        "float":"left",
+        "height":"36px",
+        "line-height":"36px",
+        "outline":"none"
+    },
+    "newProjectGroupArrow":{
+        "float":"right",
+        "width":"16px",
+        "height":"16px",
+        "margin-top":"10px",
+        "margin-right":"10px",
+        "background":"url(../x_component_TeamWork/$ProjectList/default/icon/icon_triangle_down.png) no-repeat center "
+    },
+    "newProjectTemplateText":{
+        "height":"20px",
+        "width":"80%",
+        "font-size":"13px",
+        "color":"#333333",
+        "margin":"20px auto 0px auto"
+    },
+    "newProjectTemplateContainer":{
+        "cursor":"pointer",
+        "width":"80%",
+        "margin":"5px auto 20px auto",
+        "height":"36px",
+        "border-radius": "10px",
+        "border":"1px solid #DEDEDE"
+    },
+    "newProjectTemplateValue":{
+        "width":"80%",
+        "margin-left":"6px",
+        "float":"left",
+        "height":"36px",
+        "line-height":"36px",
+        "outline":"none"
+    },
+    "newProjectTemplateArrow":{
+        "float":"right",
+        "width":"16px",
+        "height":"16px",
+        "margin-top":"10px",
+        "margin-right":"10px",
+        "background":"url(../x_component_TeamWork/$ProjectList/default/icon/icon_triangle_down.png) no-repeat center "
+    },
+    newProjectAdd:{
+        "text-align":"center",
+        "font-size":"16px",
+        "color":"#666666",
+        "width":"80%",
+        "margin":"20px auto",
+        "height":"40px",
+        "line-height":"40px",
+        "background-color":"#F0F0F0",
+        "border-radius":"10px",
+        "margin":"20px auto"
+    },
+    "topTemplateTitle":{
+        "width":"100%",
+        "height":"30px",
+        "line-height":"30px",
+        "border-bottom":"1px solid #cccccc"
+    },
+    "tempateContainer":{
+        "width":"100%",
+        "height":"400px",
+        "overflow-y":"auto"
+    },
+    "templateItemContainer":{
+        "width":"100%",
+        "height":"30px",
+        "background-color":"#ffffff",
+        "border-bottom":"1px dashed #cccccc",
+        "cursor":"pointer"
+    },
+    "templateItemIcon":{
+        "float":"left",
+        "width":"20px",
+        "height":"30px",
+        "background-repeat":"no-repeat",
+        "background-position":"center"
+    },
+    "templateItemTitle":{
+        "float":"left",
+        "width":"200px",
+        "height":"30px",
+        "line-height":"30px",
+        "color":"rgb(102, 102, 102)",
+        "font-size":"12px"
+    }
 }

BIN
o2web/source/x_component_TeamWork/$NewProject/default/icon/selected.png


+ 6 - 2
o2web/source/x_component_TeamWork/$Project/default/css.wcss

@@ -154,7 +154,8 @@
         "width":"300px",
         "height":"100%",
         "overflow-y":"auto",
-        "box-shadow": "0 2px 4px 0 #888888",
+        //"box-shadow": "0 2px 4px 0 #888888",
+        "border-right":"1px solid #cccccc",
         "background-color":"#ffffff"
 	},
 	naviTop:{
@@ -378,7 +379,10 @@
         "margin-left":"10px"
     },
     foldContainer:{
-        float:"left", width:"12px", height:"100%","border-left":"0px solid #ffffff","margin-left":"1px"
+        float:"left",
+        width:"12px",
+        height:"100%",
+        "border-left":"0px solid #ffffff"
     },
     foldIcon:{
          "width":"12px",

+ 30 - 13
o2web/source/x_component_TeamWork/$ProjectList/default/css.wcss

@@ -17,7 +17,6 @@
         "height":"100%",
         "display":"flex"
     },
-
     naviTitle:{
         "height":"50px",
         "line-height":"50px",
@@ -26,6 +25,15 @@
         "border-bottom":"1px solid #E6E6E6",
         "color":"#333333"
     },
+    bam:{
+        "float":"right",
+         "height":"50px",
+         "line-height":"50px",
+         "font-size":"12px",
+         "margin-right":"10px",
+         "color":"rgb(102,102,102)",
+         "cursor":"pointer"
+    },
     "naviMenu":{
         "background-color":"",
         "cursor":"pointer",
@@ -269,20 +277,14 @@
         "line-height":"40px"
     },
 
-
-
-
-
-
-
     "naviContent":{
         "background-color":"#ffffff",
-        "color":"#666666",
         "font-size":"14px",
         "width":"300px",
         "height":"100%",
         "overflow-y":"auto",
-        "box-shadow":" 0 2px 4px 0 "
+        "border-right":"1px solid #cccccc"
+        //"box-shadow":" 0 2px 4px 0 "
     },
 
     "projectContent":{
@@ -386,7 +388,7 @@
         "width":"24px",
         "height":"24px",
         "float":"right",
-        "margin-right":"10px",
+        "margin-right":"5px",
         "background":"url(../x_component_TeamWork/$ProjectList/default/icon/icon_wdxx_2.png) no-repeat center "
     },
     projectBlockItemIconFavTrue:{
@@ -394,15 +396,23 @@
         "width":"24px",
         "height":"24px",
         "float":"right",
-        "margin-right":"10px",
+        "margin-right":"5px",
         "background":"url(../x_component_TeamWork/$ProjectList/default/icon/icon_wdxx_click.png) no-repeat center "
     },
+    projectBlockItemIconGroup:{
+        "cursor":"pointer",
+        "width":"24px",
+        "height":"24px",
+        "float":"right",
+        "margin-right":"5px",
+        "background":"url(/x_component_TeamWork/$ProjectList/default/icon/icon_group.png) no-repeat center "
+    },
     projectBlockItemIconSetting:{
         "cursor":"pointer",
         "width":"24px",
         "height":"24px",
         "float":"right",
-        "margin-right":"10px",
+        "margin-right":"5px",
         "display":"",
         "background":"url(../x_component_TeamWork/$ProjectList/default/icon/icon_shezhi.png) no-repeat center "
     },
@@ -411,7 +421,7 @@
         "width":"24px",
         "height":"24px",
         "float":"right",
-        "margin-right":"10px",
+        "margin-right":"5px",
         "display":"",
         "background":"url(../x_component_TeamWork/$ProjectList/default/icon/icon_delete_white.png) no-repeat center "
     },
@@ -529,6 +539,13 @@
         "display":"",
         background: "url(../x_component_TeamWork/$ProjectList/default/icon/icon_shezhi_grey.png) no-repeat center "
     },
+    projectListItemGroupIcon:{
+        "float":"right",
+        "width":"16px",
+        "height":"16px",
+        "margin":"30px 5px",
+        background: "url(/x_component_TeamWork/$ProjectList/default/icon/icon_group_grey.png) no-repeat center "
+    },
     projectListItemFavIcon:{
         "float":"right",
         "width":"16px",

BIN
o2web/source/x_component_TeamWork/$ProjectList/default/icon/icon_group.png


BIN
o2web/source/x_component_TeamWork/$ProjectList/default/icon/icon_group_grey.png


+ 145 - 2
o2web/source/x_component_TeamWork/$ProjectSetting/default/css.wcss

@@ -22,12 +22,12 @@
         "height":"16px",
         "background":"url(../x_component_TeamWork/$ProjectList/default/icon/icon_off.png) no-repeat center "
     },
-    projectSettingContent:{
+    "projectSettingContent":{
         "position":"absolute",
         "top":"40px",
         "bottom":"0px"
     },
-    projectSettingNaviLayout:{
+    "projectSettingNaviLayout":{
         "float":"left",
         "width":"200px",
         "height":"100%",
@@ -232,6 +232,149 @@
          "text-align":"center",
          "border-radius":"100px"
      },
+     "authTitle":{
+        "padding-left":"20px",
+        "height":"30px",
+        "line-height":"30px"
+     },
+     "authContainer":{
+        "margin-left":"20px",
+        "margin-top":"20px",
+        "height":"60px",
+        "border-bottom":"1px dotted #cccccc"
+     },
+     "authItemContainer":{
+        "cursor":"pointer",
+        "float":"left",
+        "margin-right":"10px",
+        "height":"20px",
+        "display":"flex",
+        "justify-content":"center",
+        "align-items":"center"
+     },
+     "authItemIcon":{
+        "float":"left",
+        "width":"16px",
+        "height":"16px",
+        "background":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_unselected.png) no-repeat center "
+     },
+     "authItemTitle":{
+        "float":"left",
+        "margin-left":"6px",
+        "height":"20px",
+        "line-height":"20px"
+     },
+     "detailTopContainer":{
+        "height":"50px",
+        "line-height":"50px",
+        "margin-left":"50px",
+        "color":"#666666",
+        "font-size":"15px",
+        "margin-top":"20px"
+     },
+     "detailStatTitle":{
+        "margin-left":"50px",
+        "height":"30px",
+        "line-height":"30px"
+     },
+     "detailStatContainer":{
+         "padding-left":"50px"
+      },
+     "detailStatTotal":{
+        "margin-top":"5px",
+        "height":"120px",
+        "width":"100px",
+        "float":"left",
+        "margin-right":"20px"
+     },
+     "detailStatTotalTitle":{
+        "height":"30px",
+        "line-height":"30px",
+        "color":"#8c8c8c",
+        "font-size":"12px"
+     },
+     "detailStatTotalCount":{
+        "margin-top":"10px",
+        "margin-bottom":"5px",
+        "font-size":"28px",
+        "color":"#000000"
+     },
+     "detailStatTotalBar":{
+        "transition":"width 0.6s ease",
+        "background-color":"#ff8478",
+        "width":"40px",
+        "height":"3px",
+        "border-radius":"3px"
+     },
+     "moreActionTitle":{
+        "margin-top":"20px",
+        "font-size":"16px",
+        "color":"",
+        "height":"30px",
+        "line-height":"30px",
+        "padding-left":"50px"
+     },
+     "moreActionDescription":{
+        "font-size":"12px",
+        "color":"",
+        "height":"20px",
+        "line-height":"20px",
+        "padding-left":"50px"
+     },
+     "moreActionContainer":{
+        "padding-left":"50px",
+        "margin-top":"20px"
+     },
+     "moreActionComplete":{
+        "float":"left",
+        "color":"#e62412",
+        "height":"30px",
+        "width":"100px",
+        "line-height":"30px",
+        "text-align":"center",
+        "border-radius":"2px",
+        "border":"1px solid #ffcccc",
+        "margin-right":"20px",
+        "cursor":"pointer"
+     },
+     "moreActionUnComplete":{
+         "float":"left",
+         "color":"#e62412",
+         "height":"30px",
+         "width":"100px",
+         "line-height":"30px",
+         "text-align":"center",
+         "border-radius":"2px",
+         "border":"1px solid #ffcccc",
+         "margin-right":"10px",
+         "cursor":"pointer"
+     },
+     "moreActionRemove":{
+         "float":"left",
+         "color":"#ffffff",
+         "height":"30px",
+         "width":"100px",
+         "line-height":"30px",
+         "text-align":"center",
+         "border-radius":"2px",
+         "border":"1px solid #e62412",
+         "background-color":"#e62412",
+         "margin-right":"10px",
+         "cursor":"pointer"
+     },
+     "moreActionRecover":{
+        "float":"left",
+        "color":"#ffffff",
+        "height":"30px",
+        "width":"100px",
+        "line-height":"30px",
+        "text-align":"center",
+        "border-radius":"2px",
+        "border":"1px solid #e62412",
+        "background-color":"#e62412",
+        "margin-right":"10px",
+        "cursor":"pointer"
+     },
 
      customTopLayout:{
         "height":"40px",

BIN
o2web/source/x_component_TeamWork/$ProjectSetting/default/icon/icon_access.png


BIN
o2web/source/x_component_TeamWork/$ProjectSetting/default/icon/icon_access_click.png


BIN
o2web/source/x_component_TeamWork/$ProjectSetting/default/icon/icon_detail.png


BIN
o2web/source/x_component_TeamWork/$ProjectSetting/default/icon/icon_detail_click.png


BIN
o2web/source/x_component_TeamWork/$ProjectSetting/default/icon/icon_more.png


BIN
o2web/source/x_component_TeamWork/$ProjectSetting/default/icon/icon_more_click.png


BIN
o2web/source/x_component_TeamWork/$ProjectSetting/default/icon/icon_selected.png


BIN
o2web/source/x_component_TeamWork/$ProjectSetting/default/icon/icon_selected_click.png


BIN
o2web/source/x_component_TeamWork/$ProjectSetting/default/icon/icon_unselected.png


BIN
o2web/source/x_component_TeamWork/$ProjectSetting/default/icon/icon_unselected_click.png


+ 91 - 0
o2web/source/x_component_TeamWork/$ProjectTemplate/default/css.wcss

@@ -0,0 +1,91 @@
+{
+    "topTitleContainer":{
+        "width":"100%",
+        "height":"40px",
+        "border-bottom":"1px solid #cccccc"
+    },
+    "topTitle":{
+        "line-height":"40px",
+        "font-size":"16px"
+    },
+    "templateNameTxt":{
+        "margin-top":"10px",
+        "height":"30px",
+        "line-height":"30px"
+    },
+    "templateNameContainer":{
+        "height":"40px",
+        "width":"460px"
+    },
+    "templateNameInput":{
+        "width":"100%",
+        "height":"30px",
+        "text-indent":"2px",
+        "font-size":"14px",
+        "color":"#333333",
+        "outline":"none",
+        "border":"1px solid #cccccc"
+    },
+    "templateDesTxt":{
+        "height":"30px",
+        "line-height":"30px"
+    },
+    "templateDesContainer":{
+        "height":"85px",
+        "width":"460px"
+    },
+    "templateDesInput":{
+        "width":"100%",
+        "height":"80px",
+        "resize":"none",
+        "border":"1px solid #cccccc",
+        "outline":"none"
+    },
+    "templateLaneTxt":{
+        "height":"30px",
+        "line-height":"30px"
+    },
+    "templateLaneContainer":{
+        "height":"40px",
+        "width":"460px"
+    },
+    "templateLaneInput":{
+        "width":"100%",
+        "height":"30px",
+        "text-indent":"2px",
+        "font-size":"14px",
+        "color":"#333333",
+        "border":"1px solid #cccccc",
+        "outline":"none"
+    },
+    "templateActionContainer":{
+        "width":"460px",
+        "height":"40px",
+        "margin-top":"20px"
+    },
+    "okAction":{
+        "float":"right",
+        "width":"70px",
+        "height":"30px",
+        "line-height":"30px",
+        "background-color":"#1b9aee",
+        "color":"#ffffff",
+        "text-align":"center",
+        "font-size":"14px",
+        "border-radius":"2px",
+        "margin-right":"10px",
+        "cursor":"pointer"
+    },
+    "closeAction":{
+        "float":"right",
+        "width":"70px",
+        "height":"30px",
+        "line-height":"30px",
+        "background-color":"#1b9aee",
+        "color":"#ffffff",
+        "text-align":"center",
+        "font-size":"14px",
+        "border-radius":"2px",
+        "cursor":"pointer"
+    }
+}

+ 3 - 1
o2web/source/x_component_TeamWork/$Task/default/css.wcss

@@ -357,7 +357,9 @@
         "line-height":"50px"
     },
     taskPriorityValueText:{
-        "width":"50px",
+        //"min-width":"50px",
+        "padding-left":"10px",
+        "padding-right":"10px",
         "height":"25px",
         "line-height":"25px",
         "text-align":"center",

+ 655 - 0
o2web/source/x_component_TeamWork/Bam.js

@@ -0,0 +1,655 @@
+
+MWF.xApplication.TeamWork = MWF.xApplication.TeamWork || {};
+MWF.xDesktop.requireApp("TeamWork", "Common", null, false);
+
+MWF.xApplication.TeamWork.Bam = new Class({
+    Extends: MWF.widget.Common,
+    Implements: [Options, Events],
+    options: {
+        "style": "default"
+    },
+    initialize: function (container, app, data, options) {
+        this.setOptions(options);
+        this.container = container;
+
+        this.app = app;
+        this.lp = this.app.lp.bam;
+        this.rootActions = this.app.rootActions;
+        this.actions = this.rootActions.ProjectTemplateAction;
+
+        this.path = "/x_component_TeamWork/$Bam/";
+        this.cssPath = this.path+this.options.style+"/css.wcss";
+        this._loadCss();
+
+        this.data = data;
+    },
+    load: function () {
+        this.container.empty();
+        this.createTopBarLayout();
+        this.createContainerLayout();
+    },
+    createTopBarLayout:function(){
+        var _self = this;
+        this.topBarLayout = new Element("div.topBarLayout",{styles:this.css.topBarLayout}).inject(this.container);
+        this.topBarBackContainer = new Element("div.topBarBackContainer",{styles:this.css.topBarBackContainer}).inject(this.topBarLayout);
+        this.topBarBackHomeIcon = new Element("div.topBarBackHomeIcon",{styles:this.css.topBarBackHomeIcon}).inject(this.topBarBackContainer);
+        this.topBarBackHomeIcon.addEvents({
+            click:function(){
+                var pl = new MWF.xApplication.TeamWork.ProjectList(this.container,this.app,this.actions,{});
+                pl.load();
+            }.bind(this),
+            mouseover:function(){
+                var opt={
+                    axis: "y"      //箭头在x轴还是y轴上展现
+                };
+                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);
+        this.bamTitle = new Element("div.bamTitle",{styles:this.css.bamTitle,text:this.lp.title}).inject(this.topBarBackContainer);
+    },
+    createContainerLayout: function(){
+        this.containerLayout = new Element("div.containerLayout",{styles:this.css.containerLayout}).inject(this.container);
+        this.createNaviLayout();
+        this.createContentLayout();
+        this.templateDiv.click();
+    },
+
+    createNaviLayout:function(){
+        var _self = this;
+        this.naviLayout = new Element("div.naviLayout",{styles:this.css.naviLayout}).inject(this.containerLayout);
+
+        new Element("div.naviMenu",{styles:this.css.naviMenu, text:this.lp.base}).inject(this.naviLayout);
+
+        //模板管理
+        this.templateDiv = new Element("div.templateDiv",{styles:this.css.naviItem}).inject(this.naviLayout);
+        this.templateDiv.addEvents({
+            mouseenter:function(){
+                if(this.curNavi == this.templateDiv) return;
+                this.templateDiv.setStyles({"border-left":"2px solid #1b9aee","color":"#000000"});
+            }.bind(this),
+            mouseleave:function(){
+                if(this.curNavi == this.templateDiv) return;
+                this.templateDiv.setStyles({"border-left":"2px solid #ffffff","color":"#595959"});
+            }.bind(this),
+            click:function(){
+                if(this.curNavi)this.curNavi.setStyles({"border-left":"2px solid #ffffff","color":"#595959"});
+                this.curNavi = this.templateDiv;
+                this.curNavi.setStyles({"border-left":"2px solid #0171c2","color":"#000000"});
+                this.createTemplateLayout();
+            }.bind(this)
+        });
+        new Element("div.templateIcon",{ styles: this.css.templateIcon }).inject(this.templateDiv);
+        new Element("div.templateText",{styles: this.css.templateText, text: this.lp.navi.template}).inject(this.templateDiv);
+
+        //优先级设置
+        this.priorityDiv = new Element("div.priorityDiv",{styles:this.css.naviItem}).inject(this.naviLayout);
+        this.priorityDiv.addEvents({
+            mouseenter:function(){
+                if(this.curNavi == this.priorityDiv) return;
+                this.priorityDiv.setStyles({"border-left":"2px solid #1b9aee","color":"#000000"});
+            }.bind(this),
+            mouseleave:function(){
+                if(this.curNavi == this.priorityDiv) return;
+                this.priorityDiv.setStyles({"border-left":"2px solid #ffffff","color":"#595959"});
+            }.bind(this),
+            click:function(){
+                if(this.curNavi)this.curNavi.setStyles({"border-left":"2px solid #ffffff","color":"#595959"});
+                this.curNavi = this.priorityDiv;
+                this.curNavi.setStyles({"border-left":"2px solid #0171c2","color":"#000000"});
+                this.createPriorityLayout();
+
+            }.bind(this)
+        });
+        new Element("div.priorityIcon",{ styles: this.css.priorityIcon }).inject(this.priorityDiv);
+        new Element("div.priorityText",{styles: this.css.priorityText, text: this.lp.navi.priority}).inject(this.priorityDiv);
+
+        //自定义字段
+        this.fieldDiv = new Element("div.fieldDiv",{styles:this.css.naviItem}).inject(this.naviLayout);
+        this.fieldDiv.addEvents({
+            mouseenter:function(){
+                if(this.curNavi == this.fieldDiv) return;
+                this.fieldDiv.setStyles({"border-left":"2px solid #1b9aee","color":"#000000"});
+            }.bind(this),
+            mouseleave:function(){
+                if(this.curNavi == this.fieldDiv) return;
+                this.fieldDiv.setStyles({"border-left":"2px solid #ffffff","color":"#595959"});
+            }.bind(this),
+            click:function(){
+                if(this.curNavi)this.curNavi.setStyles({"border-left":"2px solid #ffffff","color":"#595959"});
+                this.curNavi = this.fieldDiv;
+                this.curNavi.setStyles({"border-left":"2px solid #0171c2","color":"#000000"});
+
+            }.bind(this)
+        });
+        new Element("div.fieldIcon",{ styles: this.css.fieldIcon }).inject(this.fieldDiv);
+        new Element("div.fieldText",{styles: this.css.fieldText, text: this.lp.navi.extField}).inject(this.fieldDiv);
+
+        //权限设置
+        this.accessDiv = new Element("div.accessDiv",{styles:this.css.naviItem}).inject(this.naviLayout);
+        this.accessDiv.addEvents({
+            mouseenter:function(){
+                if(this.curNavi == this.accessDiv) return;
+                this.accessDiv.setStyles({"border-left":"2px solid #1b9aee","color":"#000000"});
+            }.bind(this),
+            mouseleave:function(){
+                if(this.curNavi == this.accessDiv) return;
+                this.accessDiv.setStyles({"border-left":"2px solid #ffffff","color":"#595959"});
+            }.bind(this),
+            click:function(){
+                if(this.curNavi)this.curNavi.setStyles({"border-left":"2px solid #ffffff","color":"#595959"});
+                this.curNavi = this.accessDiv;
+                this.curNavi.setStyles({"border-left":"2px solid #0171c2","color":"#000000"});
+
+            }.bind(this)
+        });
+        new Element("div.accessIcon",{ styles: this.css.accessIcon }).inject(this.accessDiv);
+        new Element("div.accessText",{styles: this.css.accessText, text: this.lp.navi.access}).inject(this.accessDiv);
+
+    },
+    createContentLayout:function(){
+        this.contentLayout = new Element("div.contentLayout",{styles:this.css.contentLayout}).inject(this.containerLayout);
+    },
+    createPriorityLayout:function(){
+        var _self = this;
+        this.contentLayout.empty();
+
+        var priorityTop = new Element("div.priorityTop",{styles:this.css.priorityTop}).inject(this.contentLayout);
+        var priorityTopContent = new Element("div.priorityTopContent",{styles:this.css.priorityTopContent}).inject(priorityTop);
+        var priorityTopTitle = new Element("div.priorityTopTitle",{styles:this.css.priorityTopTitle,text:this.lp.priority.title}).inject(priorityTopContent);
+        var priorityTopDes = new Element("div.priorityTopDes",{styles:this.css.priorityTopDes,text:this.lp.priority.tips}).inject(priorityTopContent);
+
+        // var templateTopAddContent = new Element("div.templateTopAddContent",{styles:this.css.templateTopAddContent}).inject(templateTop);
+        // var templateTopAdd = new Element("div.templateTopAdd",{styles:this.css.templateTopAdd,text:this.lp.template.add}).inject(templateTopAddContent);
+        // templateTopAdd.addEvents({
+        //     mouseover:function(){
+        //         this.setStyles({"color":"#0171c2"})
+        //     },
+        //     mouseout:function(){
+        //         this.setStyles({"color":"#1b9aee"})
+        //     },
+        //     click:function(){
+        //         _self.openTemplate();
+        //     }
+        // });
+
+        var priorityContainer = new Element("div.priorityContainer",{styles:this.css.priorityContainer}).inject(this.contentLayout);
+        this.priorityItemContent = new Element("div.priorityItemContent",{styles:this.css.priorityItemContent}).inject(priorityContainer);
+        this.app.setLoading(this.priorityItemContent);
+        this.rootActions.GlobalAction.priorityList(function(json){
+            this.priorityItemContent.empty();
+            json.data.each(function(data){
+                this.createPriorityItem(data);
+            }.bind(this))
+        }.bind(this))
+
+        var addPriorityContainer = new Element("div.addPriorityContainer",{styles:this.css.addPriorityContainer}).inject(priorityContainer,"bottom");
+        var addPriorityIcon = new Element("div.addPriorityIcon",{styles:this.css.addPriorityIcon}).inject(addPriorityContainer);
+        var addPriorityTxt = new Element("div.addPriorityTxt",{styles:this.css.addPriorityTxt, text: this.lp.priority.add}).inject(addPriorityContainer);
+        addPriorityContainer.addEvents({
+            mouseenter:function(){
+                addPriorityIcon.setStyles({"background-image":"url(/x_component_TeamWork/$Bam/default/icon/icon_add_click.png)"});
+                addPriorityTxt.setStyles({"color":"#13227a"})
+            },
+            mouseleave:function(){
+                addPriorityIcon.setStyles({"background-image":"url(/x_component_TeamWork/$Bam/default/icon/icon_add.png)"});
+                addPriorityTxt.setStyles({"color":"#1296db"})
+            },
+            click:function(){ //fffffffff
+                this.createPriorityItem();
+            }.bind(this)
+        })
+    },
+    createPriorityColorItem:function(content,data,vColor,bColor){
+
+        var priorityColorItem = new Element("div.priorityColorItem",{styles:this.css.priorityColorItemContainer}).inject(content);
+        var priorityColor = new Element("div.priorityColor",{styles:this.css.priorityColor}).inject(priorityColorItem);
+        priorityColor.setStyles({"background-color":vColor});
+
+        if(data && data.priorityColor.toUpperCase() == bColor.toUpperCase()){
+            priorityColor.setStyles({
+                "width":"18px",
+                "height":"18px",
+                "background-color":bColor,
+                "border":"3px solid " + vColor + " "
+            });
+            priorityColor.set("name","active");
+        }
+
+        priorityColor.addEvents({
+            mouseover:function(){
+                if(this.get("name")=="active") return;
+                this.setStyles({"background-color":bColor ,"width":"18px","height":"18px"});
+            },
+            mouseout:function(){
+                if(this.get("name")=="active") return;
+                this.setStyles({"background-color":vColor,"width":"14px","height":"14px"});
+            },
+            click:function(){
+                if(this.get("name")=="active") return;
+                var actName = content.getElements("div[name='active']");
+                if(actName.length>0){
+                    actName[0].removeProperty("name");
+                    var color = actName[0].getStyle("border-left-color");
+                    actName[0].setStyles({
+                        "border":"0px",
+                        "width":"14px",
+                        "height":"14px",
+                        "background-color":color
+                    });
+                }
+
+                this.set("name","active");
+                this.setStyles({
+                    "width":"18px",
+                    "height":"18px",
+                    "background-color": bColor,
+                    "border":"3px solid " + vColor
+                });
+
+            }
+        });
+
+    },
+    createPriorityItem:function(data){
+        var _self = this;
+        var id = data ? data.id : "";
+        var priorityItemContainer = new Element("div.priorityItemContainer",{styles:this.css.priorityItemContainer,index:data ? data.order:""}).inject(this.priorityItemContent);
+        //var priorityItemMove = new Element("div.priorityItemMove",{styles:this.css.priorityItemMove}).inject(priorityItemContainer);
+
+        var priorityValueContainer = new Element("div.priorityValueContainer",{styles:this.css.priorityValueContainer}).inject(priorityItemContainer);
+        var priorityValue = new Element("input",{styles:this.css.priorityValue,type:"input",value:data?data.priority:""}).inject(priorityValueContainer);
+        priorityValue.addEvents({
+            blur:function(){
+                if(this.get("value").trim()=="") this.setStyles({"border":"1px solid #ff0000"});
+                else this.setStyles({"border":"1px solid #cccccc"});
+            },
+            focus:function(){
+                this.setStyles({"border":"1px solid #1296db"})
+            },
+            keyup:function(){
+                var v = this.get("value").trim();
+                if(v=="") this.setStyles({"border":"1px solid #ff0000"})
+                else this.setStyles({"border":"1px solid #1296db"})
+            }
+        });
+        var priorityColorContainer = new Element("div.priorityColorContainer",{styles:this.css.priorityColorContainer}).inject(priorityItemContainer);
+
+        // red
+        this.createPriorityColorItem(priorityColorContainer, data,"#FFCCCC", "#E62412");
+        // orange
+        this.createPriorityColorItem(priorityColorContainer, data,"#FFD591", "#FA8C15");
+        // green
+        this.createPriorityColorItem(priorityColorContainer, data,"#CAFAC8", "#15AD31");
+        // blue
+        this.createPriorityColorItem(priorityColorContainer, data,"#CCECFF", "#1B9AEE");
+        // grey
+        this.createPriorityColorItem(priorityColorContainer, data,"#E5E5E5", "#8C8C8C");
+
+
+        //actions
+        var priorityActionContainer = new Element("div.priorityActionContainer",{styles:this.css.priorityActionContainer}).inject(priorityItemContainer);
+        var priorityActionOK = new Element("div.priorityActionOK",{styles:this.css.priorityActionOK}).inject(priorityActionContainer);
+        priorityActionOK.addEvents({
+            mouseover:function(){
+                this.setStyles({"background-image":"url(/x_component_TeamWork/$Bam/default/icon/icon_ok_click.png)"})
+            },
+            mouseout:function(){
+                this.setStyles({"background-image":"url(/x_component_TeamWork/$Bam/default/icon/icon_ok.png)"})
+            },
+            click:function(){
+                var colorObj = priorityColorContainer.getElements("div[name='active']");
+                if(priorityValue.get("value").trim()==""){
+                    priorityValue.setStyles({"border":"1px solid #ff0000"});
+                    window.setTimeout(function(){
+                        priorityValue.setStyles({"border":"1px solid #cccccc"});
+                        window.setTimeout(function(){
+                            priorityValue.setStyles({"border":"1px solid #ff0000"});
+                        },200)
+                    },200);
+                    return;
+                }
+                if(colorObj.length == 0){
+                    //priorityColorContainer.setStyles({"border":"1px solid #ff0000"});
+                    var objs = priorityColorContainer.getElements(".priorityColorItem");
+                    objs.each(function(obj,i){
+                        var time = (i + 1) * 50;
+                        window.setTimeout(function(){
+                            //obj.setStyles({"width":"18px","height":"18px"});
+                            obj.setStyles({"background-color":"#ff0000"});
+                            window.setTimeout(function(){
+                                //obj.setStyles({"width":"14px","height":"14px"});
+                                obj.setStyles({"background-color":""});
+                            },50);
+                        },time)
+                    })
+                    return;
+                }
+
+                var data = {
+                    id:id,
+                    priority:priorityValue.get("value").trim(),
+                    priorityColor:colorObj[0].getStyle("background-color"),
+                    order:priorityItemContainer.get("index")
+                };
+
+                this.rootActions.GlobalAction.prioritySave(data,function(json){
+                    id = json.data.id
+                    this.app.notice(this.lp.priority.success,"success")
+                }.bind(this))
+
+            }.bind(this)
+        });
+        var priorityActionRemove = new Element("div.priorityActionRemove",{styles:this.css.priorityActionRemove}).inject(priorityActionContainer);
+        priorityActionRemove.addEvents({
+            mouseover:function(){
+                this.setStyles({"background-image":"url(/x_component_TeamWork/$Bam/default/icon/icon_close_click.png)"})
+            },
+            mouseout:function(){
+                this.setStyles({"background-image":"url(/x_component_TeamWork/$Bam/default/icon/icon_close.png)"})
+            },
+            click:function(e){
+                if(id==""){
+                    var fx = new Fx.Tween(priorityItemContainer,{duration:200});
+                    fx.start(["height"] ,"60px", "0px").chain(function(){
+                        priorityItemContainer.destroy();
+                    }.bind(this));
+                    //priorityItemContainer.destroy();
+                }else{
+                    _self.app.confirm("warn",e,_self.app.lp.common.confirm.removeTitle,_self.app.lp.common.confirm.removeContent,300,120,function(){
+                        _self.rootActions.GlobalAction.priorityDelete(id,function(){
+                            var fx = new Fx.Tween(priorityItemContainer,{duration:200});
+                            fx.start(["height"] ,"60px", "0px").chain(function(){
+                                priorityItemContainer.destroy();
+                                this.close();
+                            }.bind(this));
+
+
+                            //priorityItemContainer.destroy();
+                            //this.close();
+                        }.bind(this))
+                    },function(){
+                        this.close();
+                    });
+                }
+            }
+        });
+
+
+        return;
+
+
+
+
+
+
+
+        //
+        //
+        //
+        //
+        // this.priorityColorRedItem = new Element("div.priorityColorRedItem",{styles:this.css.priorityColorItemContainer}).inject(priorityColorContainer);
+        // var priorityColorRed = new Element("div.priorityColorRed",{styles:this.css.priorityColorRed}).inject(this.priorityColorRedItem);
+        // if(data.priorityColor == "#FFCCCC"){
+        //     priorityColorRed.setStyles({
+        //         "width":"18px",
+        //         "height":"18px",
+        //         "background-color":"#E62412",
+        //         "border":"3px solid #FFCCCC"
+        //     });
+        //     priorityColorRed.set("name","active");
+        // }else{
+        //     priorityColorRed.addEvents({
+        //         mouseover:function(){
+        //             if(this.get("name")=="active") return;
+        //             this.setStyles({"background-color":"#E62412","width":"18px","height":"18px"});
+        //         },
+        //         mouseout:function(){
+        //             if(this.get("name")=="active") return;
+        //             this.setStyles({"background-color":"#FFCCCC","width":"14px","height":"14px"});
+        //         },
+        //         click:function(){
+        //             if(this.get("name")=="active") return;
+        //             var actName = priorityColorContainer.getElements("div[name='active']");
+        //             if(actName.length>0){
+        //                 actName[0].removeProperty("name");
+        //                 var color = actName[0].getStyle("border-left-color");
+        //                 actName[0].setStyles({
+        //                     "border":"0px",
+        //                     "width":"14px",
+        //                     "height":"14px",
+        //                     "background-color":color
+        //                 });
+        //             }
+        //
+        //             this.set("name","active");
+        //             this.setStyles({
+        //                 "width":"18px",
+        //                 "height":"18px",
+        //                 "background-color":"#E62412",
+        //                 "border":"3px solid #FFCCCC"
+        //             });
+        //
+        //         }
+        //     });
+        //
+        // }
+        //
+        //
+        //
+        // this.priorityColorOrangeItem = new Element("div.priorityColorOrangeItem",{styles:this.css.priorityColorItemContainer}).inject(priorityColorContainer);
+        // var priorityColorOrange = new Element("div.priorityColorOrange",{styles:this.css.priorityColorOrange}).inject(this.priorityColorOrangeItem);
+        // if(data.priorityColor == "#FFD591"){
+        //     priorityColorOrange.setStyles({
+        //         "width":"18px",
+        //         "height":"18px",
+        //         "background-color":"#FA8C15",
+        //         "border":"3px solid #FFD591"
+        //     });
+        //     priorityColorOrange.set("name","active");
+        // }else{
+        //     priorityColorOrange.addEvents({
+        //         mouseover:function(){
+        //             if(this.get("name")=="active") return;
+        //             this.setStyles({"background-color":"#FA8C15","width":"18px","height":"18px"});
+        //         },
+        //         mouseout:function(){
+        //             if(this.get("name")=="active") return;
+        //             this.setStyles({"background-color":"#FFD591","width":"14px","height":"14px"});
+        //         },
+        //         click:function(){
+        //             if(this.get("name")=="active") return;
+        //             var actName = priorityColorContainer.getElements("div[name='active']");
+        //             if(actName.length>0){
+        //                 actName[0].removeProperty("name");
+        //                 var color = actName[0].getStyle("border-left-color");
+        //                 actName[0].setStyles({
+        //                     "border":"0px",
+        //                     "width":"14px",
+        //                     "height":"14px",
+        //                     "background-color":color
+        //                 });
+        //             }
+        //
+        //             this.set("name","active");
+        //             this.setStyles({
+        //                 "width":"18px",
+        //                 "height":"18px",
+        //                 "background-color":"#FA8C15",
+        //                 "border":"3px solid #FFD591"
+        //             });
+        //
+        //         }
+        //     });
+        // }
+        //
+        //
+        //
+        // this.priorityColorGreenItem = new Element("div.priorityColorGreenItem",{styles:this.css.priorityColorItemContainer}).inject(priorityColorContainer);
+        // var priorityColorGreen = new Element("div.priorityColorGreen",{styles:this.css.priorityColorGreen}).inject(this.priorityColorGreenItem);
+        // if(data.priorityColor == "#CAFAC8"){
+        //     priorityColorGreen.setStyles({
+        //         "width":"18px",
+        //         "height":"18px",
+        //         "background-color":"#15AD31",
+        //         "border":"3px solid #CAFAC8"
+        //     });
+        //     priorityColorGreen.set("name","active");
+        // }else{
+        //     priorityColorGreen.addEvents({
+        //         mouseover:function(){
+        //             this.setStyles({"background-color":"#15AD31","width":"18px","height":"18px"});
+        //         },
+        //         mouseout:function(){
+        //             this.setStyles({"background-color":"#CAFAC8","width":"14px","height":"14px"});
+        //         }
+        //     });
+        // }
+        //
+        //
+        // this.priorityColorBlueItem = new Element("div.priorityColorBlueItem",{styles:this.css.priorityColorItemContainer}).inject(priorityColorContainer);
+        // var priorityColorBlue = new Element("div.priorityColorBlue",{styles:this.css.priorityColorBlue}).inject(this.priorityColorBlueItem);
+        // if(data.priorityColor == "#CCECFF"){
+        //     priorityColorBlue.setStyles({
+        //         "width":"18px",
+        //         "height":"18px",
+        //         "background-color":"#1B9AEE",
+        //         "border":"3px solid #CCECFF"
+        //     });
+        //     priorityColorBlue.set("name","active");
+        // }else{
+        //     priorityColorBlue.addEvents({
+        //         mouseover:function(){
+        //             this.setStyles({"background-color":"#1B9AEE","width":"18px","height":"18px"});
+        //         },
+        //         mouseout:function(){
+        //             this.setStyles({"background-color":"#CCECFF","width":"14px","height":"14px"});
+        //         }
+        //     });
+        // }
+        //
+        //
+        // this.priorityColorGreyItem = new Element("div.priorityColorGreyItem",{styles:this.css.priorityColorItemContainer}).inject(priorityColorContainer);
+        // var priorityColorGrey = new Element("div.priorityColorGrey",{styles:this.css.priorityColorGrey}).inject(this.priorityColorGreyItem);
+        // if(data.priorityColor == "#E5E5E5"){
+        //     priorityColorGrey.setStyles({
+        //         "width":"18px",
+        //         "height":"18px",
+        //         "background-color":"#8C8C8C",
+        //         "border":"3px solid #E5E5E5"
+        //     });
+        //     priorityColorGrey.set("name","active");
+        // }else{
+        //     priorityColorGrey.addEvents({
+        //         mouseover:function(){
+        //             this.setStyles({"background-color":"#8C8C8C","width":"18px","height":"18px"});
+        //         },
+        //         mouseout:function(){
+        //             this.setStyles({"background-color":"#E5E5E5","width":"14px","height":"14px"});
+        //         }
+        //     });
+        // }
+
+
+    },
+    createTemplateLayout:function(){
+        var _self = this;
+        this.contentLayout.empty();
+        var templateTop = new Element("div.templateTop",{styles:this.css.templateTop}).inject(this.contentLayout);
+        var templateTopContent = new Element("div.templateTopContent",{styles:this.css.templateTopContent}).inject(templateTop);
+        var templateTopTitle = new Element("div.templateTopTitle",{styles:this.css.templateTopTitle,text:this.lp.template.title}).inject(templateTopContent);
+        var templateTopDes = new Element("div.templateTopDes",{styles:this.css.templateTopDes,text:this.lp.template.tips}).inject(templateTopContent);
+
+        var templateTopAddContent = new Element("div.templateTopAddContent",{styles:this.css.templateTopAddContent}).inject(templateTop);
+        var templateTopAdd = new Element("div.templateTopAdd",{styles:this.css.templateTopAdd,text:this.lp.template.add}).inject(templateTopAddContent);
+        templateTopAdd.addEvents({
+            mouseover:function(){
+                this.setStyles({"color":"#0171c2"})
+            },
+            mouseout:function(){
+                this.setStyles({"color":"#1b9aee"})
+            },
+            click:function(){
+                _self.openTemplate();
+            }
+        });
+
+        this.templateContainer = new Element("div.templateContainer",{styles:this.css.templateContainer}).inject(this.contentLayout);
+        this.app.setLoading(this.templateContainer);
+        this.rootActions.ProjectTemplateAction.listNextWithFilter("(0)",100,{},function(json){
+            this.templateContainer.empty();
+            json.data.each(function(data){
+                this.createTemplateItem(data);
+            }.bind(this))
+        }.bind(this))
+    },
+    createTemplateItem:function(data){
+        var _self = this;
+        var templateItemContainer = new Element("div.templateItemContainer",{ styles:this.css.templateItemContainer }).inject(this.templateContainer);
+        templateItemContainer.addEvents({
+            mouseenter:function(){
+                templateItemContainer.setStyles({"background-color":"rgb(242,245,247)"});
+            }.bind(this),
+            mouseleave:function(){
+                templateItemContainer.setStyles({"background-color":""});
+            }.bind(this),
+            click:function(){
+                // this.openTemplate(data.id)
+            }.bind(this)
+        });
+        var templateItemContent = new Element("div.templateItemContent",{styles:this.css.templateItemContent}).inject(templateItemContainer);
+        var templateItemTitle = new Element("div.templateItemTitle",{styles:this.css.templateItemTitle,text:data.title}).inject(templateItemContent);
+        var templateItemDes = new Element("div.templateItemDes",{styles:this.css.templateItemDes,text:data.description==""?"无":data.description}).inject(templateItemContent);
+
+        var templateItemLane = new Element("div.templateItemLane",{styles:this.css.templateItemLane}).inject(templateItemContainer);
+        var templateItemLaneTxt = new Element("div.templateItemLaneTxt",{styles:this.css.templateItemLaneTxt,text:data.taskList.join(",")}).inject(templateItemLane);
+        var templateItemOwner = new Element("div.templateItemOwner",{styles:this.css.templateItemOwner,text:data.owner.split("@")[0]}).inject(templateItemContainer);
+        var templateItemDate = new Element("div.templateItemDate",{styles:this.css.templateItemDate,text:data.updateTime.split(" ")[0]}).inject(templateItemContainer);
+
+        var templateItemActionContainer = new Element("div.templateItemActionContainer",{styles:this.css.templateItemActionContainer}).inject(templateItemContainer);
+        var templateItemEdit = new Element("div.templateItemEdit",{ styles:this.css.templateItemEdit,text:this.lp.template.edit }).inject(templateItemActionContainer);
+        templateItemEdit.addEvents({
+            click:function(){
+                this.openTemplate(data.id)
+            }.bind(this)
+        });
+        var templateItemRemove = new Element("div.templateItemRemove",{ styles:this.css.templateItemRemove,text:this.lp.template.remove }).inject(templateItemActionContainer);
+        templateItemRemove.addEvents({
+            click:function(e){
+                _self.app.confirm("warn",e,_self.app.lp.common.confirm.removeTitle,_self.app.lp.common.confirm.removeContent,300,120,function(){
+                    _self.rootActions.ProjectTemplateAction.delete(data.id,function(){
+                        _self.createTemplateLayout();
+                        this.close();
+                    }.bind(this))
+                },function(){
+                    this.close();
+                });
+            }
+        });
+    },
+    openTemplate:function(id){
+        var data = {
+            id:id || ""
+        }
+        MWF.xDesktop.requireApp("TeamWork", "ProjectTemplate", function(){
+            this.np = new MWF.xApplication.TeamWork.ProjectTemplate(this,data,
+                {"width": 500,"height": 400,
+                    onPostOpen:function(){
+                        this.np.formAreaNode.setStyles({"top":"10px"});
+                        var fx = new Fx.Tween(this.np.formAreaNode,{duration:200});
+                        fx.start(["top"] ,"10px", "100px");
+
+                    }.bind(this),
+                    onPostClose:function(json){
+                        if(json){
+                            this.createTemplateLayout();
+                        }
+                    }.bind(this)
+                }
+            );
+            this.np.open();
+        }.bind(this));
+
+    }
+});

+ 1 - 1
o2web/source/x_component_TeamWork/GroupSelect.js

@@ -14,7 +14,7 @@ MWF.xApplication.TeamWork.GroupSelect = new Class({
 
         if(callback)callback();
     },
-    createFirstPage:function(data){ //alert(JSON.stringify(this.data))
+    createFirstPage:function(data){
         var _self = this;
         if(this.contentNode)this.contentNode.empty();
         this.topBar = new Element("div.topBar",{styles:this.css.topBar}).inject(this.contentNode);

+ 23 - 26
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(){ //111
+	onQueryLoad: function(){ //
 		this.lp = MWF.xApplication.TeamWork.LP;
 	},
 
@@ -36,7 +36,6 @@ MWF.xApplication.TeamWork.Main = new Class({
 		this.rootActions = MWF.Actions.load("x_teamwork_assemble_control");
 		this.orgActions = MWF.Actions.load("x_organization_assemble_express");
 
-
 		this.path = "../x_component_TeamWork/$Main/";
 		if(!this.css){
 			this.cssPath = this.path+this.options.style+"/css.wcss";
@@ -71,7 +70,6 @@ MWF.xApplication.TeamWork.Main = new Class({
 		//if(myTips) delete myTips;
 		var myTips = new Tips(target, {
 			onShow:function(tip, el){
-
 				console.log("ttt="+title);
 				tip.setStyles({
 					visibility: 'hidden',
@@ -85,36 +83,35 @@ MWF.xApplication.TeamWork.Main = new Class({
 						y:200
 					}
 				}).fade('in');
-
-			},
-			onHide:function(tip,el){
-				myTips.setTitle("");
 			},
+			// onHide:function(tip,el){
+			// 	//myTips.setTitle("");
+			// 	tip.destroy();
+			// },
 			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');
-		// });
+		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');
+		});
 	},
 
 

+ 100 - 2
o2web/source/x_component_TeamWork/NewProject.js

@@ -148,6 +148,51 @@ MWF.xApplication.TeamWork.NewProject = new Class({
         });
 
 
+        this.newProjectTemplateText = new Element("div.newProjectTemplateText",{styles:this.css.newProjectTemplateText,text:this.lp.template}).inject(this.formTableArea);
+        this.newProjectTemplateContainer = new Element("div.newProjectTemplateContainer",{styles:this.css.newProjectTemplateContainer}).inject(this.formTableArea);
+        this.newProjectTemplateValue = new Element("div.newProjectTemplateValue",{styles:this.css.newProjectTemplateValue,text:""}).inject(this.newProjectTemplateContainer);
+        this.newProjectTemplateArrow = new Element("div.newProjectTemplateArrow",{styles:this.css.newProjectTemplateArrow}).inject(this.newProjectTemplateContainer);
+        this.newProjectTemplateContainer.addEvents({
+            click:function(){
+                var tm = new MWF.xApplication.TeamWork.NewProject.TemplateSelect(this.container, this.newProjectTemplateContainer, this.app, {}, {
+                    css:this.css, lp:this.lp, axis : "y",
+                    position : { //node 固定的位置
+                        x : "auto",
+                        y : "middle"
+                    },
+                    nodeStyles : {
+                        "min-width":"200px",
+                        "width":"265px",
+                        "padding":"2px",
+                        "border-radius":"5px",
+                        "box-shadow":"0px 0px 4px 0px #999999",
+                        "z-index" : "201"
+                    },
+                    onPostLoad:function(){
+                        tm.node.setStyles({"opacity":"0","top":(tm.node.getStyle("top").toInt()+4)+"px"});
+                        var fx = new Fx.Tween(tm.node,{duration:400});
+                        fx.start(["opacity"] ,"0", "1");
+                    },
+                    onClose:function(rd){
+                        this.newProjectTemplateContainer.setStyles({"border":"1px solid #cccccc"});
+                        if(!rd) return;
+                        this.newProjectTemplateValue.set("text",rd.title);
+                        this.templateId = rd.id;
+                        // if(rd.act == "remove"){
+                        //     this.close(rd);
+                        //     if(this.data.projectObj){ //reload project
+                        //         this.data.projectObj.createTaskGroup()
+                        //     }
+                        // }
+                    }.bind(this)
+                },null,this);
+                tm.load();
+
+                this.newProjectTemplateContainer.setStyles({"border":"1px solid #4A90E2"});
+
+            }.bind(this)
+        });
+
         this.newProjectAdd = new Element("div.newProjectAdd",{styles:this.css.newProjectAdd,text:this.lp.add}).inject(this.formTableArea);
         this.newProjectAdd.addEvents({
             click:function(){
@@ -164,7 +209,8 @@ MWF.xApplication.TeamWork.NewProject = new Class({
                 var data = {
                     "title":v,
                     "description":des,
-                    "groups":groups
+                    "groups":groups,
+                    "templateId":this.templateId || ""
                 };
 
                 //this.actions.projectSave(data,function(json){
@@ -193,5 +239,57 @@ MWF.xApplication.TeamWork.NewProject = new Class({
     }
 
 
-
 });
+
+
+MWF.xApplication.TeamWork.NewProject.TemplateSelect = new Class({
+    Extends: MWF.xApplication.TeamWork.Common.ToolTips,
+    options : {
+        // displayDelay : 300,
+        hasArrow:false,
+        event:"click"
+    },
+    _loadCustom : function( callback ){
+        this.rootActions = this.app.rootActions;
+        var _self = this;
+        this.css = this.options.css;
+        this.lp = this.options.lp;
+        //this.data
+        //this.contentNode
+        //debugger;
+
+        var topTemplateTitle = new Element("div.topTemplateTitle",{ styles:this.css.topTemplateTitle, text: this.lp.templateTitle }).inject(this.contentNode);
+        this.tempateContainer = new Element("div.tempateContainer",{ styles:this.css.tempateContainer }).inject(this.contentNode);
+
+        this.rootActions.ProjectTemplateAction.listNextWithFilter("(0)",100,{},function(json){
+            //alert(json.data.length)
+            json.data.each(function(data){
+                this.templateItem(data)
+            }.bind(this))
+        }.bind(this));
+
+        if(callback)callback();
+    },
+    templateItem:function(data){
+        var _self = this;
+        var templateItemContainer = new Element("div.templateItemContainer",{styles:this.css.templateItemContainer, id:data.id}).inject(this.tempateContainer);
+        var templateItemIcon = new Element("div.templateItemIcon",{styles:this.css.templateItemIcon}).inject(templateItemContainer);
+        var templateItemTitle = new Element("div.templateItemTitle",{styles:this.css.templateItemTitle,text:data.title}).inject(templateItemContainer);
+
+        templateItemContainer.addEvents({
+            mouseover:function(){
+                this.setStyles({"background-color":"rgb(242,245,247)"});
+            },
+            mouseout:function(){
+                this.setStyles({"background-color":"#ffffff"});
+            },
+            click:function(){
+                var res = {};
+                res.id = data.id;
+                res.title = data.title;
+                this.close(res)
+            }.bind(this)
+        });
+
+    }
+});

+ 58 - 59
o2web/source/x_component_TeamWork/Project.js

@@ -30,6 +30,9 @@ MWF.xApplication.TeamWork.Project = new Class({
         this.data = data;
     },
     load: function () {
+        this.actions.get(this.data.id,function(json){ debugger ;})
+
+
         this.container.setStyles({display:"flex"});
         this.container.empty();
         this.createTopBarLayout();
@@ -51,7 +54,7 @@ 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)
         });
@@ -114,54 +117,52 @@ MWF.xApplication.TeamWork.Project = new Class({
 
         //************************************
 
+        if(this.data.control && this.data.control.founder){
+            this.topBarSettingContainer = new Element("div.topBarSettingContainer",{styles:this.css.topBarSettingContainer}).inject(this.topBarLayout);
+            this.topBarSettingMenuContainer = new Element("div.topBarSettingMenuContainer",{styles:this.css.topBarSettingMenuContainer}).inject(this.topBarSettingContainer);
+            this.topBarSettingMenuContainer.addEvents({
+                click:function(){
+                    MWF.xDesktop.requireApp("TeamWork", "ProjectSetting", function(){
+                        var ps = new MWF.xApplication.TeamWork.ProjectSetting(this,this.data,
+                            {"width": "800","height": "80%",
+                                onPostOpen:function(){
+                                    ps.formAreaNode.setStyles({"top":"10px"});
+                                    var fx = new Fx.Tween(ps.formAreaNode,{duration:200});
+                                    fx.start(["top"] ,"10px", "100px");
+                                },
+                                onPostClose:function(json){
 
-
-
-        this.topBarSettingContainer = new Element("div.topBarSettingContainer",{styles:this.css.topBarSettingContainer}).inject(this.topBarLayout);
-        this.topBarSettingMenuContainer = new Element("div.topBarSettingMenuContainer",{styles:this.css.topBarSettingMenuContainer}).inject(this.topBarSettingContainer);
-        this.topBarSettingMenuContainer.addEvents({
-            click:function(){
-                MWF.xDesktop.requireApp("TeamWork", "ProjectSetting", function(){
-                    var ps = new MWF.xApplication.TeamWork.ProjectSetting(this,this.data,
-                        {"width": "800","height": "80%",
-                            onPostOpen:function(){
-                                ps.formAreaNode.setStyles({"top":"10px"});
-                                var fx = new Fx.Tween(ps.formAreaNode,{duration:200});
-                                fx.start(["top"] ,"10px", "100px");
-                            },
-                            onPostClose:function(json){
+                                }
+                            },{
+                                container : this.container,
+                                lp : this.app.lp.projectSetting,
+                                css:_self.css
 
                             }
-                        },{
-                            container : this.container,
-                            lp : this.app.lp.projectSetting,
-                            css:_self.css
-
-                        }
-                    );
-                    ps.open();
-                }.bind(this));
-            }.bind(this),
-            mouseover:function(){
-                this.topBarSettingMenuContainer.getElements(".topBarSettingMenuIcon").setStyles({
-                    "background-image":"url(../x_component_TeamWork/$Project/default/icon/icon_caidan_click.png)"
-                });
-                this.topBarSettingMenuContainer.getElements(".topBarSettingMenuText").setStyles({
-                    "color":"#4A90E2"
-                });
-            }.bind(this),
-            mouseout:function(){
-                this.topBarSettingMenuContainer.getElements(".topBarSettingMenuIcon").setStyles({
-                    "background-image":"url(../x_component_TeamWork/$Project/default/icon/icon_caidan.png)"
-                });
-                this.topBarSettingMenuContainer.getElements(".topBarSettingMenuText").setStyles({
-                    "color":"#666666"
-                });
-            }.bind(this)
-        });
-        this.topBarSettingMenuIcon = new Element("div.topBarSettingMenuIcon",{styles:this.css.topBarSettingMenuIcon}).inject(this.topBarSettingMenuContainer);
-        this.topBarSettingMenuText = new Element("div.topBarSettingMenuText",{styles:this.css.topBarSettingMenuText,text:this.lp.setting}).inject(this.topBarSettingMenuContainer);
-
+                        );
+                        ps.open();
+                    }.bind(this));
+                }.bind(this),
+                mouseover:function(){
+                    this.topBarSettingMenuContainer.getElements(".topBarSettingMenuIcon").setStyles({
+                        "background-image":"url(../x_component_TeamWork/$Project/default/icon/icon_caidan_click.png)"
+                    });
+                    this.topBarSettingMenuContainer.getElements(".topBarSettingMenuText").setStyles({
+                        "color":"#4A90E2"
+                    });
+                }.bind(this),
+                mouseout:function(){
+                    this.topBarSettingMenuContainer.getElements(".topBarSettingMenuIcon").setStyles({
+                        "background-image":"url(../x_component_TeamWork/$Project/default/icon/icon_caidan.png)"
+                    });
+                    this.topBarSettingMenuContainer.getElements(".topBarSettingMenuText").setStyles({
+                        "color":"#666666"
+                    });
+                }.bind(this)
+            });
+            this.topBarSettingMenuIcon = new Element("div.topBarSettingMenuIcon",{styles:this.css.topBarSettingMenuIcon}).inject(this.topBarSettingMenuContainer);
+            this.topBarSettingMenuText = new Element("div.topBarSettingMenuText",{styles:this.css.topBarSettingMenuText,text:this.lp.setting}).inject(this.topBarSettingMenuContainer);
+        }
     },
     createContentLayout:function(){
         this.contentLayout = new Element("div.contentLayout",{styles:this.css.contentLayout}).inject(this.container);
@@ -177,36 +178,34 @@ MWF.xApplication.TeamWork.Project = new Class({
         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.naviLayout.setStyles({"border-right": "1px solid #1b9aee"});
+                //this.foldContainer.setStyles({"border-left":"1px solid #1b9aee"});
                 this.foldIcon.setStyles({"background-color":"#1b9aee","color":"#ffffff"});
             }.bind(this),
             mouseout:function(){
-                this.naviLayout.setStyles({"box-shadow": "0px 2px 4px 0 #888888"});
+                this.naviLayout.setStyles({"border-right": "1px solid #cccccc"});
                 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();
+                    //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")
+                    var fx1 = new Fx.Tween(this.naviLayout,{duration:100});
+                    fx1.start(["width"] ,"300", "0")
                         .chain(function(){
-                            this.naviLayout.hide();
+                            //this.naviLayout.hide();
                             this.foldIcon.set("text",">");
                             this.naviFold = true;
-                            //console.log("zzzzzzzzzzzzzzzzzzzzzk");
-                            this.app.tips(this.foldIcon,"展开22");
                         }.bind(this));
 
                 }
@@ -326,7 +325,7 @@ MWF.xApplication.TeamWork.Project = new Class({
         this.overLine.addEvents({
             mouseover:function(){
                 //this.app.showTips(this.overLine,{_html:"<div style='margin:2px 5px;'>"+this.lp.taskCompleteText+":"+this.currentProjectGroupData.overtimeTotal+"</div>"});
-                //alert(this.currentProjectGroupData.overtimeTotal)
+                ////alert(this.currentProjectGroupData.overtimeTotal)
                 this.app.tips(this.overLine,this.lp.taskovertimeText + ": " + this.currentProjectGroupData.overtimeTotal)
             }.bind(this)
         });
@@ -390,8 +389,8 @@ MWF.xApplication.TeamWork.Project = new Class({
                         this.curNaviItem = json.name;
                         this.openView(this.naviItemAllContainer);
                     }.bind(this),
-                    mouseenter:function(){ if(_self.curNaviItem != json.name) _self.naviItemChange(this,"enter")},
-                    mouseleave:function(){ if(_self.curNaviItem != json.name) _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.viewItemMy){
                 //我的任务

+ 234 - 131
o2web/source/x_component_TeamWork/ProjectList.js

@@ -60,11 +60,21 @@ MWF.xApplication.TeamWork.ProjectList = new Class({
                 }).inject(this.naviTable);
 
                 var naviTitle = new Element("div.naviTitle",{styles:this.css.naviTitle,text:this.lp.navi.title}).inject(this.naviContent);
-                naviTitle.addEvents({
-                    click:function(){
+                this.rootActions.GlobalAction.isManager(function(json){
+                    if(json.data == "yes"){ //有权限后台管理
+                        var bam = new Element("div.bam",{ styles: this.css.bam, text: this.lp.navi.bam }).inject(naviTitle);
+                        bam.addEvents({
+                            click:function(){
+                                MWF.xDesktop.requireApp("TeamWork", "Bam", function(){
+                                    var b = new MWF.xApplication.TeamWork.Bam(this.container,this.app);
+                                    b.load();
+                                }.bind(this));
+                            }.bind(this)
+                        });
+                    }
+                }.bind(this))
+
 
-                    }.bind(this)
-                });
 
                 //全部项目
                 if(resData.hasOwnProperty("allCount")){
@@ -235,37 +245,37 @@ MWF.xApplication.TeamWork.ProjectList = new Class({
                         }.bind(this)
                     });
                 }
-
-                //已归档
-                if(resData.hasOwnProperty("archiveCount")){
-                    this.historyItem = new Element("div.historyItem",{styles:this.css.naviItem}).inject(this.naviContent);
-                    this.historyItemImg = new Element("div.historyItemImg",{styles:this.css.historyItemImg}).inject(this.historyItem);
-                    this.historyItemText = new Element("div.historyItemText",{styles:this.css.historyItemText,text:this.lp.navi.historyItem}).inject(this.historyItem);
-                    this.historyItemCount = new Element("div.historyItemCount",{styles:this.css.historyItemCount,text:resData.archiveCount}).inject(this.historyItem);
-                    // this.historyItemIcon = new Element("div.historyItemIcon",{styles:this.css.historyItemIcon}).inject(this.historyItem);
-                    this.historyItem.addEvents({
-                        mouseover:function(){
-                            this.historyItem.setStyles({
-                                "background-color":"#F2F5F7"
-                            });
-                            this.historyItemImg.setStyles({
-                                "background-image":"url(../x_component_TeamWork/$ProjectList/default/icon/icon_lsck_xm_click.png)"
-                            });
-                            this.historyItemText.setStyles({
-                                "color":"#4A90E2"
-                            });
-                        }.bind(this),
-                        mouseout:function(){
-                            this.historyItem.setStyles(this.css.naviItem);
-                            this.historyItemImg.setStyles(this.css.historyItemImg);
-                            this.historyItemText.setStyles(this.css.historyItemText);
-                        }.bind(this),
-                        click:function(){
-                            this.openItem({type:"archive"});
-                            this.currentNavi = "archive"
-                        }.bind(this)
-                    });
-                }
+                //
+                // //已归档
+                // if(resData.hasOwnProperty("archiveCount")){
+                //     this.historyItem = new Element("div.historyItem",{styles:this.css.naviItem}).inject(this.naviContent);
+                //     this.historyItemImg = new Element("div.historyItemImg",{styles:this.css.historyItemImg}).inject(this.historyItem);
+                //     this.historyItemText = new Element("div.historyItemText",{styles:this.css.historyItemText,text:this.lp.navi.historyItem}).inject(this.historyItem);
+                //     this.historyItemCount = new Element("div.historyItemCount",{styles:this.css.historyItemCount,text:resData.archiveCount}).inject(this.historyItem);
+                //     // this.historyItemIcon = new Element("div.historyItemIcon",{styles:this.css.historyItemIcon}).inject(this.historyItem);
+                //     this.historyItem.addEvents({
+                //         mouseover:function(){
+                //             this.historyItem.setStyles({
+                //                 "background-color":"#F2F5F7"
+                //             });
+                //             this.historyItemImg.setStyles({
+                //                 "background-image":"url(/x_component_TeamWork/$ProjectList/default/icon/icon_lsck_xm_click.png)"
+                //             });
+                //             this.historyItemText.setStyles({
+                //                 "color":"#4A90E2"
+                //             });
+                //         }.bind(this),
+                //         mouseout:function(){
+                //             this.historyItem.setStyles(this.css.naviItem);
+                //             this.historyItemImg.setStyles(this.css.historyItemImg);
+                //             this.historyItemText.setStyles(this.css.historyItemText);
+                //         }.bind(this),
+                //         click:function(){
+                //             this.openItem({type:"archive"});
+                //             this.currentNavi = "archive"
+                //         }.bind(this)
+                //     });
+                // }
 
                 //回收站
                 if(resData.hasOwnProperty("deleteCount")){
@@ -383,7 +393,7 @@ MWF.xApplication.TeamWork.ProjectList = new Class({
     addNewProject:function(){
         MWF.xDesktop.requireApp("TeamWork", "NewProject", function(){
             this.np = new MWF.xApplication.TeamWork.NewProject(this,{},
-                {"width": 350,"height": 350,
+                {"width": 350,"height": 430,
                     onPostOpen:function(){
                         this.np.formAreaNode.setStyles({"top":"10px"});
                         var fx = new Fx.Tween(this.np.formAreaNode,{duration:200});
@@ -522,6 +532,8 @@ MWF.xApplication.TeamWork.ProjectList = new Class({
                     },
                     click:function(){
                         //alert(this.get("text"))
+                        _self.openItem({group:d.id});
+                        _self.currentNavi = d.id;
                     }
                 });
                 var customGroupItem = new Element("div.customGroupItem",{styles:this.css.customGroupItem,text:d.name}).inject(customGroupItemContainer);
@@ -715,25 +727,32 @@ MWF.xApplication.TeamWork.ProjectList = new Class({
             var projectItemData = json.data;
 
             if(options && options.type && options.type=="all"){
-                this.menuTitle.set("text","全部项目");
+                this.menuTitle.set("text",this.lp.navi.allItem);
             }else if(options && options.type && options.type=="star"){
-                this.menuTitle.set("text","我的星标")
+                this.menuTitle.set("text",this.lp.navi.starItem);
             }else if(options && options.type && options.type=="my"){
-                typeAction = "projectMyListNext"
+                this.menuTitle.set("text",this.lp.navi.myItem);
+                //typeAction = "projectMyListNext"
             }else if(options && options.type && options.type=="complete"){
-                typeAction = "projectCompleteListNext"
+                this.menuTitle.set("text",this.lp.navi.completeItem);
+                //typeAction = "projectCompleteListNext"
             }else if(options && options.type && options.type=="archive"){
-                typeAction = "projectArchiveListNext"
+                //typeAction = "projectArchiveListNext";
             }else if(options && options.type && options.type=="remove"){
-                typeAction = "projectRemoveListNext"
+                this.menuTitle.set("text",this.lp.navi.removeItem);
+                //typeAction = "projectRemoveListNext"
             }else if(options && options.type && options.type=="unGroup"){
-                typeAction = "projectUnGroupListNext"
+                this.menuTitle.set("text",this.lp.navi.unGroupItem);
+                //typeAction = "projectUnGroupListNext"
             }
 
             if(options && options.group){
                 groupId = options.group;
                 //typeAction = "projectListNext";
                 filter = {group:groupId};
+                this.rootActions.ProjectGroupAction.get(groupId,function(json){
+                    this.menuTitle.set("text",json.data.name||"");
+                }.bind(this))
             }
 
             this.menuCount.set("text","("+json.count+")");
@@ -790,7 +809,6 @@ MWF.xApplication.TeamWork.ProjectList = new Class({
 
             }else{
                 if(projectItemData) {
-
                     projectItemData.each(function(d){
                         var projectBlockItem = new Element("div.projectBlockItem",{styles:this.css.projectBlockItem}).inject(this.layoutList);
                         projectBlockItem.set("id",d.id);
@@ -857,7 +875,7 @@ MWF.xApplication.TeamWork.ProjectList = new Class({
         var projectBlockItemContainer = new Element("div.projectBlockItemContainer",{styles:this.css.projectBlockItemContainer}).inject(container);
         var projectBlockItemIconContainer = new Element("div.projectBlockItemIconContainer",{styles:this.css.projectBlockItemIconContainer}).inject(projectBlockItemContainer);
 
-        var projectBlockItemIconFav = new Element("div.projectBlockItemIconFav",{styles:this.css.projectBlockItemIconFav}).inject(projectBlockItemIconContainer);
+        var projectBlockItemIconFav = new Element("div.projectBlockItemIconFav",{styles:this.css.projectBlockItemIconFav,title: this.lp.icon.star}).inject(projectBlockItemIconContainer);
         projectBlockItemIconFav.addEvents({
             click:function(e){
                 _self.setFav(d,function(data){
@@ -877,57 +895,94 @@ MWF.xApplication.TeamWork.ProjectList = new Class({
             });
         }
 
-        var projectBlockItemIconSetting = new Element("div.projectBlockItemIconSetting",{styles:this.css.projectBlockItemIconSetting}).inject(projectBlockItemIconContainer);
-        projectBlockItemIconSetting.addEvents({
+        var projectBlockItemIconGroup = new Element("div.projectBlockItemIconGroup",{styles:this.css.projectBlockItemIconGroup,title:this.lp.icon.group}).inject(projectBlockItemIconContainer);
+        projectBlockItemIconGroup.addEvents({
             click:function(e){
-                MWF.xDesktop.requireApp("TeamWork", "ProjectSetting", function(){
-                    var ps = new MWF.xApplication.TeamWork.ProjectSetting(_self,d,
-                        {"width": "800","height": "80%",
-                            onPostOpen:function(){
-                                ps.formAreaNode.setStyles({"top":"10px"});
-                                var fx = new Fx.Tween(ps.formAreaNode,{duration:200});
-                                fx.start(["top"] ,"10px", "100px");
+                this.getProject(d.id,function(json){
+                    var pdata = json;
+                    var data = {groups:json.groups};
+                    MWF.xDesktop.requireApp("TeamWork", "GroupSelect", function(){
+                        var gs = new MWF.xApplication.TeamWork.GroupSelect(this.container, projectBlockItemIconGroup, this.app, data, {
+                            axis : "y",
+                            nodeStyles : {
+                                "min-width":"190px",
+                                "z-index" : "102"
                             },
-                            onPostClose:function(json){
-                                // _self.actions.projectGet(d.id,function(json){
-                                //     _self.loadSingleBlockItem(container,json.data)
-                                // });
-                                //_self.reload();
-
-                            }
-                        },{
-                            container : _self.container,
-                            lp : _self.lp.projectSetting,
-                            css:_self.css
-
-                        }
-                    );
-                    ps.open();
-                });
-
-                e.stopPropagation();
-            }
-        });
-        var projectBlockItemIconRemove = new Element("div.projectBlockItemIconRemove",{styles:this.css.projectBlockItemIconRemove}).inject(projectBlockItemIconContainer);
-        projectBlockItemIconRemove.set("title","删除");
-        projectBlockItemIconRemove.addEvents({
-            click:function(e){
-                _self.app.confirm("warn",e,_self.app.lp.common.confirm.removeTitle,_self.app.lp.common.confirm.removeContent,300,120,function(){
-                    var id = d.id;
-                    _self.actions.delete(id,function(){
-                        //刷新代码
-                        this.close();
-                        _self.reload();
+                            onClose:function(rs){
+                                if(rs){
+                                    var ddata={
+                                        id:pdata.id,
+                                        title:pdata.title,
+                                        description:pdata.description,
+                                        groups:rs
+                                    };
+
+                                    this.rootActions.ProjectAction.save(ddata,function(json){
+                                        //debugger;
+                                    }.bind(this))
+                                }
+                            }.bind(this)
+                        });
+                        gs.load();
                     }.bind(this));
-                },function(){
-                    this.close();
-                });
+                }.bind(this));
 
                 e.stopPropagation();
-
             }.bind(this)
         });
 
+
+        if(d.control.founder){
+            var projectBlockItemIconSetting = new Element("div.projectBlockItemIconSetting",{styles:this.css.projectBlockItemIconSetting,title:this.lp.icon.setting}).inject(projectBlockItemIconContainer);
+            projectBlockItemIconSetting.addEvents({
+                click:function(e){
+                    MWF.xDesktop.requireApp("TeamWork", "ProjectSetting", function(){
+                        var ps = new MWF.xApplication.TeamWork.ProjectSetting(_self,d,
+                            {"width": "800","height": "80%",
+                                onPostOpen:function(){
+                                    ps.formAreaNode.setStyles({"top":"10px"});
+                                    var fx = new Fx.Tween(ps.formAreaNode,{duration:200});
+                                    fx.start(["top"] ,"10px", "100px");
+                                },
+                                onPostClose:function(json){
+                                    if(json)_self.openItem({type:_self.currentNavi});
+                                }
+                            },{
+                                container : _self.container,
+                                lp : _self.lp.projectSetting,
+                                css:_self.css
+                            }
+                        );
+                        ps.open();
+                    });
+
+                    e.stopPropagation();
+                }
+            });
+        }
+
+        // if(d.control.delete){
+        //     var projectBlockItemIconRemove = new Element("div.projectBlockItemIconRemove",{styles:this.css.projectBlockItemIconRemove}).inject(projectBlockItemIconContainer);
+        //     projectBlockItemIconRemove.set("title","删除");
+        //     projectBlockItemIconRemove.addEvents({
+        //         click:function(e){
+        //             _self.app.confirm("warn",e,_self.app.lp.common.confirm.removeTitle,_self.app.lp.common.confirm.removeContent,300,120,function(){
+        //                 var id = d.id;
+        //                 _self.actions.delete(id,function(){
+        //                     //刷新代码
+        //                     this.close();
+        //                     _self.reload();
+        //                 }.bind(this));
+        //             },function(){
+        //                 this.close();
+        //             });
+        //
+        //             e.stopPropagation();
+        //
+        //         }.bind(this)
+        //     });
+        // }
+
         var projectBlockItemName = new Element("div.projectBlockItemName",{styles:this.css.projectBlockItemName,text:d.title}).inject(projectBlockItemContainer);
         var projectBlockItemDes = new Element("div.projectBlockItemDes",{styles:this.css.projectBlockItemDes,text:d.description||""}).inject(projectBlockItemContainer);
     },
@@ -948,7 +1003,7 @@ MWF.xApplication.TeamWork.ProjectList = new Class({
         var projectListItemDes = new Element("div.projectListItemDes",{styles:this.css.projectListItemDes,text:d.description||""}).inject(projectListItemInforContainer);
         var projectListItemIconContainer = new Element("div.projectListItemIconContainer",{styles:this.css.projectListItemIconContainer}).inject(projectListItemContainer);
 
-        var projectListItemFavIcon = new Element("div.projectListItemFavIcon",{styles:this.css.projectListItemFavIcon}).inject(projectListItemIconContainer);
+        var projectListItemFavIcon = new Element("div.projectListItemFavIcon",{styles:this.css.projectListItemFavIcon,title:this.lp.icon.star}).inject(projectListItemIconContainer);
         projectListItemFavIcon.addEvents({
             click:function(e){
                 _self.setFav(d,function(data){
@@ -966,7 +1021,6 @@ MWF.xApplication.TeamWork.ProjectList = new Class({
                         "background-image":"url(../x_component_TeamWork/$ProjectList/default/icon/icon_wdxx_click.png)"
                     })
                 }
-
                 e.stopPropagation();
             }
         });
@@ -976,53 +1030,96 @@ MWF.xApplication.TeamWork.ProjectList = new Class({
                 "background-image":"url(../x_component_TeamWork/$ProjectList/default/icon/icon_wdxx_click.png)"
             });
         }
-        var projectListItemSettingIcon = new Element("div.projectListItemSettingIcon",{styles:this.css.projectListItemSettingIcon}).inject(projectListItemIconContainer);
-        projectListItemSettingIcon.addEvents({
-            click:function(e){
 
-                MWF.xDesktop.requireApp("TeamWork", "ProjectSetting", function(){
-                    var ps = new MWF.xApplication.TeamWork.ProjectSetting(_self,d,
-                        {"width": "800","height": "80%",
-                            onPostOpen:function(){
-                                ps.formAreaNode.setStyles({"top":"10px"});
-                                var fx = new Fx.Tween(ps.formAreaNode,{duration:200});
-                                fx.start(["top"] ,"10px", "100px");
-                            },
-                            onPostClose:function(json){
-                                _self.actions.get(d.id,function(json){
-                                    _self.loadSingleListItem(container,json.data)
-                                });
-                            }
-                        },{
-                            container : _self.container,
-                            lp : _self.lp.projectSetting,
-                            css:_self.css
-
-                        }
-                    );
-                    ps.open();
-                });
-
-                e.stopPropagation();
-            }
-        });
-        var projectListItemRemoveIcon = new Element("div.projectListItemRemoveIcon",{styles:this.css.projectListItemRemoveIcon}).inject(projectListItemIconContainer);
-        projectListItemRemoveIcon.addEvents({
+        var projectListItemGroupIcon = new Element("div.projectListItemGroupIcon",{styles:this.css.projectListItemGroupIcon,title:this.lp.icon.group}).inject(projectListItemIconContainer);
+        projectListItemGroupIcon.addEvents({
             click:function(e){
-                _self.app.confirm("warn",e,_self.app.lp.common.confirm.removeTitle,_self.app.lp.common.confirm.removeContent,300,120,function(){
-                    var id = d.id;
-                    _self.actions.delete(id,function(){
-                        //刷新代码
-                        this.close();
-                        _self.reload();
+                this.getProject(d.id,function(json){
+                    var pdata = json;
+                    var data = {groups:json.groups};
+                    MWF.xDesktop.requireApp("TeamWork", "GroupSelect", function(){
+                        var gs = new MWF.xApplication.TeamWork.GroupSelect(this.container, projectListItemGroupIcon, this.app, data, {
+                            axis : "y",
+                            nodeStyles : {
+                                "min-width":"190px",
+                                "z-index" : "102"
+                            },
+                            onClose:function(rs){
+                                if(rs){
+                                    var ddata={
+                                        id:pdata.id,
+                                        title:pdata.title,
+                                        description:pdata.description,
+                                        groups:rs
+                                    };
+
+                                    this.rootActions.ProjectAction.save(ddata,function(json){
+                                        //debugger;
+                                    }.bind(this))
+                                }
+                            }.bind(this)
+                        });
+                        gs.load();
                     }.bind(this));
-                },function(){
-                    this.close();
-                });
+                }.bind(this));
 
                 e.stopPropagation();
-            }
+            }.bind(this)
         });
+
+
+        if(d.control.founder){
+            var projectListItemSettingIcon = new Element("div.projectListItemSettingIcon",{styles:this.css.projectListItemSettingIcon,title:this.lp.icon.setting}).inject(projectListItemIconContainer);
+            projectListItemSettingIcon.addEvents({
+                click:function(e){
+
+                    MWF.xDesktop.requireApp("TeamWork", "ProjectSetting", function(){
+                        var ps = new MWF.xApplication.TeamWork.ProjectSetting(_self,d,
+                            {"width": "800","height": "80%",
+                                onPostOpen:function(){
+                                    ps.formAreaNode.setStyles({"top":"10px"});
+                                    var fx = new Fx.Tween(ps.formAreaNode,{duration:200});
+                                    fx.start(["top"] ,"10px", "100px");
+                                },
+                                onPostClose:function(json){
+                                    _self.actions.get(d.id,function(json){
+                                        _self.loadSingleListItem(container,json.data)
+                                    });
+                                }
+                            },{
+                                container : _self.container,
+                                lp : _self.lp.projectSetting,
+                                css:_self.css
+
+                            }
+                        );
+                        ps.open();
+                    });
+
+                    e.stopPropagation();
+                }
+            });
+        }
+
+        // if(d.control.delete){
+        //     var projectListItemRemoveIcon = new Element("div.projectListItemRemoveIcon",{styles:this.css.projectListItemRemoveIcon}).inject(projectListItemIconContainer);
+        //     projectListItemRemoveIcon.addEvents({
+        //         click:function(e){
+        //             _self.app.confirm("warn",e,_self.app.lp.common.confirm.removeTitle,_self.app.lp.common.confirm.removeContent,300,120,function(){
+        //                 var id = d.id;
+        //                 _self.actions.delete(id,function(){
+        //                     //刷新代码
+        //                     this.close();
+        //                     _self.reload();
+        //                 }.bind(this));
+        //             },function(){
+        //                 this.close();
+        //             });
+        //
+        //             e.stopPropagation();
+        //         }
+        //     });
+        // }
     },
     setFav:function(d,callback){
         if(d.star){
@@ -1047,6 +1144,12 @@ MWF.xApplication.TeamWork.ProjectList = new Class({
             p.load();
         }.bind(this));
     },
+    getProject:function(id,callback){
+        this.rootActions.ProjectAction.get(id,function(json){
+            var data = json.data;
+            if(callback) callback(data);
+        }.bind(this))
+    },
     test:function(){
 
     }

+ 303 - 3
o2web/source/x_component_TeamWork/ProjectSetting.js

@@ -1,3 +1,4 @@
+//projectData 项目业务数据
 MWF.xApplication.TeamWork = MWF.xApplication.TeamWork || {};
 MWF.xApplication.TeamWork.ProjectSetting = new Class({
     Extends: MWF.xApplication.TeamWork.Common.Popup,
@@ -52,8 +53,9 @@ MWF.xApplication.TeamWork.ProjectSetting = new Class({
         this.naviGeneralHover = new Element("div.naviItemHover",{styles:this.css.naviItemHover}).inject(this.naviGeneral);
         this.naviGeneralHover.setStyles({"height":"58px","margin-top":"2px"});
         this.naviGeneralIcon = new Element("div.naviItemIcon",{styles:this.css.naviItemIcon}).inject(this.naviGeneral);
+
         this.naviGeneralIcon.setStyles({"background-image":"url(../x_component_TeamWork/$ProjectSetting/default/icon/icon_general.png)"});
-        this.naviGeneralText = new Element("div.naviItemText",{styles:this.css.naviItemText,text:this.lp.general}).inject(this.naviGeneral);
+        this.naviGeneralText = new Element("div.naviItemText",{styles:this.css.naviItemText,text:this.lp.projectGeneral}).inject(this.naviGeneral);
         this.naviGeneral.addEvents({
             mouseover:function(){
                 if(_self.curNavi == "general") return;
@@ -72,6 +74,84 @@ MWF.xApplication.TeamWork.ProjectSetting = new Class({
             }
         });
 
+        //项目详情
+        this.naviDetail = new Element("div.naviGeneral",{styles:this.css.naviItem}).inject(this.projectSettingNaviLayout);
+        this.naviDetailHover = new Element("div.naviItemHover",{styles:this.css.naviItemHover}).inject(this.naviDetail);
+        this.naviDetailHover.setStyles({"height":"58px","margin-top":"2px"});
+        this.naviDetailIcon = new Element("div.naviItemIcon",{styles:this.css.naviItemIcon}).inject(this.naviDetail);
+        this.naviDetailIcon.setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_detail.png)"});
+        this.naviDetailText = new Element("div.naviItemText",{styles:this.css.naviItemText,text:this.lp.projectDetail}).inject(this.naviDetail);
+        this.naviDetail.addEvents({
+            mouseover:function(){
+                if(_self.curNavi == "detail") return;
+                this.getElements(".naviItemIcon").setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_detail_click.png)"});
+                this.getElements(".naviItemText").setStyles({"color":"#4a90e2"});
+            },
+            mouseout:function(){
+                if(_self.curNavi == "detail") return;
+                this.getElement(".naviItemIcon").setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_detail.png)"});
+                this.getElement(".naviItemText").setStyles({"color":""});
+            },
+            click:function(){
+                _self.curNavi = "detail";
+                _self.changeNavi(this);
+                _self.loadDetail();
+            }
+        });
+
+        //权限设置
+        this.naviAccess = new Element("div.naviAccess",{styles:this.css.naviItem}).inject(this.projectSettingNaviLayout);
+        this.naviAccessHover = new Element("div.naviItemHover",{styles:this.css.naviItemHover}).inject(this.naviAccess);
+        this.naviAccessHover.setStyles({"height":"58px","margin-top":"2px"});
+        this.naviAccessIcon = new Element("div.naviItemIcon",{styles:this.css.naviItemIcon}).inject(this.naviAccess);
+        this.naviAccessIcon.setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_access.png)"});
+        this.naviAccessText = new Element("div.naviItemText",{styles:this.css.naviItemText,text:this.lp.projectAccess}).inject(this.naviAccess);
+        this.naviAccess.addEvents({
+            mouseover:function(){
+                if(_self.curNavi == "access") return;
+                this.getElements(".naviItemIcon").setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_access_click.png)"});
+                this.getElements(".naviItemText").setStyles({"color":"#4a90e2"});
+            },
+            mouseout:function(){
+                if(_self.curNavi == "access") return;
+                this.getElement(".naviItemIcon").setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_access.png)"});
+                this.getElement(".naviItemText").setStyles({"color":""});
+            },
+            click:function(){
+                _self.curNavi = "access";
+                _self.changeNavi(this);
+                _self.loadAccess();
+            }
+        });
+
+        //更多设置
+        this.naviMore = new Element("div.naviMore",{styles:this.css.naviItem}).inject(this.projectSettingNaviLayout);
+        this.naviMoreHover = new Element("div.naviItemHover",{styles:this.css.naviItemHover}).inject(this.naviMore);
+        this.naviMoreHover.setStyles({"height":"58px","margin-top":"2px"});
+        this.naviMoreIcon = new Element("div.naviItemIcon",{styles:this.css.naviItemIcon}).inject(this.naviMore);
+        this.naviMoreIcon.setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_more.png)"});
+        this.naviMoreText = new Element("div.naviItemText",{styles:this.css.naviItemText,text:this.lp.projectMore}).inject(this.naviMore);
+        this.naviMore.addEvents({
+            mouseover:function(){
+                if(_self.curNavi == "more") return;
+                this.getElements(".naviItemIcon").setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_more_click.png)"});
+                this.getElements(".naviItemText").setStyles({"color":"#4a90e2"});
+            },
+            mouseout:function(){
+                if(_self.curNavi == "more") return;
+                this.getElement(".naviItemIcon").setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_more.png)"});
+                this.getElement(".naviItemText").setStyles({"color":""});
+            },
+            click:function(){
+                _self.curNavi = "more";
+                _self.changeNavi(this);
+                _self.loadMore();
+            }
+        });
+
+        this.naviGeneral.click()
+        /*
+
         //自定义字段
         this.naviCustom = new Element("div.naviCustom",{styles:this.css.naviItem}).inject(this.projectSettingNaviLayout);
         this.naviCustomHover = new Element("div.naviItemHover",{styles:this.css.naviItemHover}).inject(this.naviCustom);
@@ -141,8 +221,8 @@ MWF.xApplication.TeamWork.ProjectSetting = new Class({
                 _self.loadCustom()
             }
         });
+        */
 
-        this.naviGeneral.click()
     },
     changeNavi:function(obj){
         this.projectSettingNaviLayout.getElements(".naviItemHover").setStyles({"background-color":"#ffffff"});
@@ -435,6 +515,227 @@ MWF.xApplication.TeamWork.ProjectSetting = new Class({
         //this.projectSettingAction = new Element("div.projectSettingAction",{styles:this.css.projectSettingAction,text:this.lp.confirm}).inject(this.formTableArea);
 
     },
+    loadDetail:function(){
+        var _self = this;
+        this.projectSettingLayout.empty();
+        //var authTaskTitle = new Element("div.authTaskTitle",{styles:this.css.authTitle,text:this.lp.auth.task}).inject(this.projectSettingLayout);
+        var tips = this.projectData.creatorPerson.split("@")[0] + " " + this.lp.projectDetails.at+this.projectData.createTime +this.lp.projectDetails.create;
+        var detailTopContainer = new Element("div.detailTopContainer",{ styles: this.css.detailTopContainer, text:tips }).inject(this.projectSettingLayout);
+        var detailStatTitle = new Element("div.detailStatTitle",{styles:this.css.detailStatTitle, text:this.lp.projectDetails.taskStat}).inject(this.projectSettingLayout);
+        var detailStatContainer = new Element("div.detailStatContainer",{styles:this.css.detailStatContainer}).inject(this.projectSettingLayout);
+
+        var detailStatTotal = new Element("div.detailStatTotal",{styles:this.css.detailStatTotal}).inject(detailStatContainer);
+        new Element("div.detailStatTotalTitle",{styles:this.css.detailStatTotalTitle,text:this.lp.projectDetails.total}).inject(detailStatTotal);
+        new Element("div.detailStatTotalCount",{styles:this.css.detailStatTotalCount,text:this.projectData.taskTotal}).inject(detailStatTotal);
+        var tbar = new Element("div.detailStatTotalBar",{styles:this.css.detailStatTotalBar}).inject(detailStatTotal);
+        tbar.setStyles({"background-color":"#95b9e4"});
+
+        var detailStatProcess = new Element("div.detailStatTotal",{styles:this.css.detailStatTotal}).inject(detailStatContainer);
+        new Element("div.detailStatTotalTitle",{styles:this.css.detailStatTotalTitle,text:this.lp.projectDetails.process}).inject(detailStatProcess);
+        new Element("div.detailStatTotalCount",{styles:this.css.detailStatTotalCount,text:this.projectData.progressTotal}).inject(detailStatProcess);
+        var pbar = new Element("div.detailStatTotalBar",{styles:this.css.detailStatTotalBar}).inject(detailStatProcess);
+        pbar.setStyles({"background-color":"#ecedf4"});
+
+        var detailStatCompleted = new Element("div.detailStatTotal",{styles:this.css.detailStatTotal}).inject(detailStatContainer);
+        new Element("div.detailStatTotalTitle",{styles:this.css.detailStatTotalTitle,text:this.lp.projectDetails.complete}).inject(detailStatCompleted);
+        new Element("div.detailStatTotalCount",{styles:this.css.detailStatTotalCount,text:this.projectData.completedTotal}).inject(detailStatCompleted);
+        var cbar = new Element("div.detailStatTotalBar",{styles:this.css.detailStatTotalBar}).inject(detailStatCompleted);
+        cbar.setStyles({"background-color":"#f1f9eb"});
+
+        var detailStatOver = new Element("div.detailStatTotal",{styles:this.css.detailStatTotal}).inject(detailStatContainer);
+        var detailStatTotalTitle = new Element("div.detailStatTotalTitle",{styles:this.css.detailStatTotalTitle,text:this.lp.projectDetails.over}).inject(detailStatOver);
+        var detailStatTotalCount = new Element("div.detailStatTotalCount",{styles:this.css.detailStatTotalCount,text:this.projectData.overtimeTotal}).inject(detailStatOver);
+        var detailStatTotalBar = new Element("div.detailStatTotalBar",{styles:this.css.detailStatTotalBar}).inject(detailStatOver);
+
+    },
+    loadAccess:function(){
+        var _self = this;
+        this.projectSettingLayout.empty();
+
+        var authTaskTitle = new Element("div.authTaskTitle",{styles:this.css.authTitle,text:this.lp.auth.task}).inject(this.projectSettingLayout);
+        authTaskTitle.setStyle("margin-top","20px");
+        var authTaskContainer = new Element("div.authTaskContainer",{styles:this.css.authContainer}).inject(this.projectSettingLayout);
+
+
+        this.getProjectAuth(this.projectData.id,function(){
+            //alert(JSON.stringify(this.projectAuthData))
+
+            //创建任务
+            //var taskCreateFlag = true;
+            taskCreateFlag=this.projectAuthData.hasOwnProperty("taskCreate") ? this.projectAuthData.taskCreate:true;
+
+            var newTaskContainer = new Element("div.authItemContainer",{styles:this.css.authItemContainer}).inject(authTaskContainer);
+            var newTaskIcon = new Element("div.authItemIcon",{styles:this.css.authItemIcon}).inject(newTaskContainer);
+            var newTaskTitle = new Element("div.authItemTitle",{styles:this.css.authItemTitle,text:this.lp.auth.taskCreate}).inject(newTaskContainer);
+
+            if(!taskCreateFlag) newTaskIcon.setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_unselected.png)"});
+            else newTaskIcon.setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_selected.png)"});
+
+            var isChanged = false;
+            newTaskContainer.addEvents({
+                mouseenter:function(){
+                    if(isChanged) return;
+                    if(taskCreateFlag){
+                        newTaskIcon.setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_selected_click.png)"});
+                    }else{
+                        newTaskIcon.setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_unselected_click.png)"});
+                    }
+                },
+                mouseleave:function(){
+                    if(isChanged) { isChanged = false ; return;}
+                    if(taskCreateFlag){
+                        newTaskIcon.setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_selected.png)"});
+                    }else{
+                        newTaskIcon.setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_unselected.png)"});
+                    }
+                },
+                click:function(){
+                    if(taskCreateFlag){
+                        this.projectAuthData.taskCreate = false;
+                        taskCreateFlag = false;
+                        newTaskIcon.setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_unselected.png)"});
+                    }else{
+                        this.projectAuthData.taskCreate = true;
+                        taskCreateFlag = true;
+                        newTaskIcon.setStyles({"background-image":"url(/x_component_TeamWork/$ProjectSetting/default/icon/icon_selected.png)"});
+                    }
+
+                    this.saveProjectAuth();
+                    isChanged = true;
+                }.bind(this)
+            });
+
+        }.bind(this));
+
+    },
+    getProjectAuth:function(id,callback){
+        this.rootActions.GlobalAction.projectConfigGetByProject(id,function(json){
+            if(json.type == "error"){
+                this.projectAuthData = {};
+            }else{
+                this.projectAuthData = json.data||{};
+            }
+            if(callback)callback(json)
+        }.bind(this),function(json){
+            this.projectAuthData = {};
+            if(callback)callback(json)
+        }.bind(this));
+    },
+    loadAccessItem:function(container,data){
+
+    },
+    saveProjectAuth:function(callback){
+        var data = {
+            id:this.projectAuthData.id||"",
+            project:this.projectData.id,
+            taskCreate:this.projectAuthData.taskCreate || false,
+            taskCopy:this.projectAuthData.taskCopy || false,
+            taskRemove:this.projectAuthData.taskRemove || false,
+            laneCreate:this.projectAuthData.laneCreate || false,
+            laneEdit:this.projectAuthData.laneEdit || false,
+            laneRemove:this.projectAuthData.laneRemove || false,
+            attachmentUpload:this.projectAuthData.attachmentUpload || false,
+            comment:this.projectAuthData.comment || false
+
+        };
+        this.rootActions.GlobalAction.projectConfigSave(data,function(json){
+            this.rootActions.GlobalAction.projectConfigGet(json.data.id,function(d){
+                this.projectAuthData = d.data;
+                if(callback)callback(json);
+            }.bind(this))
+
+        }.bind(this))
+
+    },
+    loadMore:function(){
+        var _self = this;
+        this.projectSettingLayout.empty();
+        this.moreActionTitle = new Element("div.moreActionTitle",{styles:this.css.moreActionTitle,text:this.lp.moreActionTitle}).inject(this.projectSettingLayout);
+        this.moreActionDescription = new Element("div.moreActionDescription",{styles:this.css.moreActionDescription,text:this.lp.moreActionDescription}).inject(this.projectSettingLayout);
+        this.moreActionContainer = new Element("div.moreActionContainer",{ styles:this.css.moreActionContainer }).inject(this.projectSettingLayout);
+        if(this.projectData.completed){
+            this.moreActionUnComplete = new Element("div.moreActionUnComplete",{styles:this.css.moreActionUnComplete, text:this.lp.moreActionUnComplete}).inject(this.moreActionContainer);
+            this.moreActionUnComplete.addEvents({
+                mouseover:function(){
+                    this.setStyles({"background-color":"#ffeded"})
+                },
+                mouseout:function(){
+                    this.setStyles({"background-color":"#ffffff"})
+                },
+                click:function(e){
+                    _self.app.confirm("warn",e,_self.lp.moreActionUnComplete,_self.lp.moreActionUnCompleteTips,450,100,function(){
+                        _self.rootActions.ProjectAction.completeProject(_self.projectData.id,{completed:false},function(){
+                            this.close();
+                            _self.close({"action":"reload"});
+                        }.bind(this))
+                    },function(){
+                        this.close();
+                    });
+                }
+            });
+        }else{
+            this.moreActionComplete = new Element("div.moreActionComplete",{styles:this.css.moreActionComplete, text:this.lp.moreActionComplete}).inject(this.moreActionContainer);
+            this.moreActionComplete.addEvents({
+                mouseover:function(){
+                    this.setStyles({"background-color":"#ffeded"})
+                },
+                mouseout:function(){
+                    this.setStyles({"background-color":"#ffffff"})
+                },
+                click:function(e){
+                    _self.app.confirm("warn",e,_self.lp.moreActionComplete,_self.lp.moreActionCompleteTips,450,100,function(){
+                        _self.rootActions.ProjectAction.completeProject(_self.projectData.id,{completed:true},function(){
+                            this.close();
+                            _self.close({"action":"reload"});
+                        }.bind(this))
+                    },function(){
+                        this.close();
+                    });
+                }
+            });
+        }
+        if(this.projectData.deleted){
+            this.moreActionRecover = new Element("div.moreActionRemove",{styles:this.css.moreActionRecover, text:this.lp.moreActionRecover}).inject(this.moreActionContainer);
+            this.moreActionRecover.addEvents({
+                mouseover:function(){
+                    this.setStyles({"background-color":"#c21c07"})
+                },
+                mouseout:function(){
+                    this.setStyles({"background-color":"#e62412"})
+                },
+                click:function(e){
+                    _self.app.confirm("warn",e,_self.lp.moreActionRecover,_self.lp.moreActionRecoverTips,450,100,function(){
+                        _self.rootActions.ProjectAction.recoveryProject(_self.projectData.id,function(){
+                            this.close();
+                            _self.close({"action":"reload"});
+                        }.bind(this))
+                    },function(){
+                        this.close();
+                    });
+                }
+            });
+        }else{
+            this.moreActionRemove = new Element("div.moreActionRemove",{styles:this.css.moreActionRemove, text:this.lp.moreActionRemove}).inject(this.moreActionContainer);
+            this.moreActionRemove.addEvents({
+                mouseover:function(){
+                    this.setStyles({"background-color":"#c21c07"})
+                },
+                mouseout:function(){
+                    this.setStyles({"background-color":"#e62412"})
+                },
+                click:function(e){
+                    _self.app.confirm("warn",e,_self.lp.moreActionRemove,_self.lp.moreActionRemoveTips,450,100,function(){
+                        _self.rootActions.ProjectAction.delete(_self.projectData.id,function(){
+                            this.close();
+                            _self.close({"action":"reload"});
+                        }.bind(this))
+                    },function(){
+                        this.close();
+                    });
+                }
+            });
+        }
+    },
     projectInfor:function(callback){
         if(this.data.id){
             this.actions.get(this.data.id,function(json){
@@ -454,5 +755,4 @@ MWF.xApplication.TeamWork.ProjectSetting = new Class({
         }.bind(this))
     }
 
-
 });

+ 119 - 0
o2web/source/x_component_TeamWork/ProjectTemplate.js

@@ -0,0 +1,119 @@
+MWF.xApplication.TeamWork = MWF.xApplication.TeamWork || {};
+MWF.xApplication.TeamWork.ProjectTemplate = new Class({
+    Extends: MWF.xApplication.TeamWork.Common.Popup,
+    options: {
+        "closeByClickMask": false
+    },
+    open: function (e) {
+        //设置css 和 lp等
+        var css = this.css;
+        this.cssPath = "/x_component_TeamWork/$ProjectTemplate/" + this.options.style + "/css.wcss";
+        this._loadCss();
+        if (css) this.css = Object.merge(css, this.css);
+
+        this.lp = this.app.lp.bam.template;
+
+
+        this.fireEvent("queryOpen");
+        this.isNew = false;
+        this.isEdited = false;
+        this._open();
+        this.fireEvent("postOpen");
+    },
+
+    _createTableContent: function () {
+        if(this.data.id && this.data.id!=""){
+            this.isEdited = true
+        }else{
+            this.isEdited = false;
+        }
+
+        var topTitleContainer = new Element("div.topTitleContainer",{styles:this.css.topTitleContainer}).inject(this.formTableArea);
+        var topTitle = new Element("div.topTitle",{styles:this.css.topTitle,text:this.lp.title}).inject(topTitleContainer);
+
+        var templateNameTxt = new Element("div.templateNameTxt",{styles:this.css.templateNameTxt,text:this.lp.name}).inject(this.formTableArea);
+        var templateNameContainer = new Element("div.templateNameContainer",{styles:this.css.templateNameContainer}).inject(this.formTableArea);
+        this.templateNameInput = new Element("input",{type:"text",styles:this.css.templateNameInput,value:""}).inject(templateNameContainer);
+        this.templateNameInput.addEvents({
+            focus:function(){
+                this.setStyles({"border":"1px solid #1b9aee"});
+            },
+            blur:function(){
+                if(this.get("value").trim()==""){
+                    this.setStyles({"border":"1px solid #ff0000"});
+                }else{
+                    this.setStyles({"border":"1px solid #cccccc"});
+                }
+            }
+        })
+
+        var templateDesTxt = new Element("div.templateDesTxt",{styles:this.css.templateDesTxt,text:this.lp.description}).inject(this.formTableArea);
+        var templateDesContainer = new Element("div.templateDesContainer",{styles:this.css.templateDesContainer}).inject(this.formTableArea);
+        this.templateDesInput = new Element("textarea.templateDesInput",{styles:this.css.templateDesInput}).inject(templateDesContainer);
+        this.templateDesInput.addEvents({
+            focus:function(){
+                this.setStyles({"border":"1px solid #1b9aee"});
+            }
+        })
+        var templateLaneTxt = new Element("div.templateLaneTxt",{styles:this.css.templateLaneTxt,text:this.lp.lane+"("+this.lp.laneTip+")"}).inject(this.formTableArea);
+        var templateLaneContainer = new Element("div.templateLaneContainer",{styles:this.css.templateLaneContainer}).inject(this.formTableArea);
+        this.templateLaneInput = new Element("input",{type:"text",styles:this.css.templateLaneInput,value:"",placeholder:this.lp.laneTip}).inject(templateLaneContainer);
+        this.templateLaneInput.addEvents({
+            focus:function(){
+                this.setStyles({"border":"1px solid #1b9aee"});
+            },
+            blur:function(){
+                if(this.get("value").trim()==""){
+                    this.setStyles({"border":"1px solid #ff0000"});
+                }else{
+                    this.setStyles({"border":"1px solid #cccccc"});
+                }
+            }
+        })
+
+        var templateActionContainer = new Element("div.templateActionContainer",{styles:this.css.templateActionContainer}).inject(this.formTableArea);
+        this.closeAction = new Element("div.okAction",{styles:this.css.closeAction,text:this.lp.close}).inject(templateActionContainer);
+        this.closeAction.addEvent("click",function(){ this.close(); }.bind(this))
+        this.okAction = new Element("div.okAction",{styles:this.css.okAction,text:this.lp.ok}).inject(templateActionContainer);
+        this.okAction.addEvents({
+            click:function(){
+                var flag = true;
+                if(this.templateNameInput.get("value").trim()==""){
+                    this.templateNameInput.setStyles({"border":"1px solid #ff0000"});
+                    flag = false;
+                }
+                if(this.templateLaneInput.get("value").trim()==""){
+                    this.templateLaneInput.setStyles({"border":"1px solid #ff0000"});
+                    flag = false;
+                }
+
+                if(flag){
+                    var data = {}
+                    if(this.isEdited) data.id = this.data.id;
+                    data.title = this.templateNameInput.get("value").trim();
+                    data.description = this.templateDesInput.get("value").trim();
+                    data.taskList = this.templateLaneInput.get("value").split(",");
+
+                    this.rootActions.ProjectTemplateAction.save(data,function(json){
+                        this.close(json);
+                    }.bind(this))
+                }
+            }.bind(this)
+        })
+
+        if(this.isEdited){
+            this.getTemplate(this.data.id,function(json){
+                this.templateNameInput.set("value",json.title);
+                this.templateDesInput.set("value",json.description);
+                this.templateLaneInput.set("value",json.taskList.join(","));
+            }.bind(this))
+        }
+
+    },
+    getTemplate:function(id,callback){
+        this.rootActions.ProjectTemplateAction.get(id,function(json){
+            callback(json.data)
+        }.bind(this));
+    }
+
+});

+ 269 - 213
o2web/source/x_component_TeamWork/Task.js

@@ -119,6 +119,14 @@ MWF.xApplication.TeamWork.Task = new Class({
         //data { taskId:xxx }
         var _self = this;
         this.getTaskData(function(){
+            this.control = {};
+            this.control.isEdit = this.taskData.control.edit;
+            this.control.isDelete = this.taskData.control.delete;
+            this.control.isFounder = this.taskData.control.founder;
+            this.control.isCreate = true;
+
+
+
             if(this.openType == "window"){
                 this.app.setTitle(this.taskData.name);
             }
@@ -345,29 +353,32 @@ MWF.xApplication.TeamWork.Task = new Class({
         this.taskParticipateContainer.empty();
         this.participateTitle = new Element("div.participateTitle",{styles:this.css.participateTitle}).inject(this.taskParticipateContainer);
         this.participateTitleText = new Element("div.participateTitleText",{styles:this.css.participateTitleText}).inject(this.participateTitle);
-        this.participateTitleIcon = new Element("div.participateTitleIcon",{styles:this.css.participateTitleIcon,title:this.lp.taskReaderAdd}).inject(this.participateTitle);
-        this.participateTitleIcon.addEvents({
-            click:function(){
-                this.selectPerson(this.participateTitleIcon,null,["identity","unit"],0,
-                    function(json){
-                        if(json.length>0){
-                            this.taskData.participantList = this.taskData.participantList.concat(json);
-                            //this.actions.updateParticipantList(this.taskData.id,{participantList:this.taskData.participantList},function(json){
-                            this.actions.updateParticipant(this.taskData.id,{participantList:this.taskData.participantList},function(json){
-                                if(json.data.dynamics){
-                                    json.data.dynamics.each(function(dd){
-                                        this.loadDynamicItem(dd,"bottom")
-                                    }.bind(this))
-                                }
-                                this.dynamicContent.scrollTo(0,this.dynamicContent.getScrollSize().y);
+        if(this.control.isEdit){
+            this.participateTitleIcon = new Element("div.participateTitleIcon",{styles:this.css.participateTitleIcon,title:this.lp.taskReaderAdd}).inject(this.participateTitle);
+            this.participateTitleIcon.addEvents({
+                click:function(){
+                    this.selectPerson(this.participateTitleIcon,null,["identity","unit"],0,
+                        function(json){
+                            if(json.length>0){
+                                this.taskData.participantList = this.taskData.participantList.concat(json);
+                                //this.actions.updateParticipantList(this.taskData.id,{participantList:this.taskData.participantList},function(json){
+                                this.actions.updateParticipant(this.taskData.id,{participantList:this.taskData.participantList},function(json){
+                                    if(json.data.dynamics){
+                                        json.data.dynamics.each(function(dd){
+                                            this.loadDynamicItem(dd,"bottom")
+                                        }.bind(this))
+                                    }
+                                    this.dynamicContent.scrollTo(0,this.dynamicContent.getScrollSize().y);
+
+                                    this.createParticipateContainer();
+                                }.bind(this))
+                            }
+                        }.bind(this)
+                    );
+                }.bind(this)
+            });
+        }
 
-                                this.createParticipateContainer();
-                            }.bind(this))
-                        }
-                    }.bind(this)
-                );
-            }.bind(this)
-        });
 
         this.participateValue = new Element("div.participateValue",{styles:this.css.participateValue}).inject(this.taskParticipateContainer);
         this.setScrollBar(this.participateValue);
@@ -745,7 +756,7 @@ MWF.xApplication.TeamWork.Task = new Class({
     loadNameValue:function(){  //名称
         var _self = this;
         this.taskNameContainer.set("text",this.taskData.name);
-        if(true){ //权限修改
+        if(this.control.isEdit){ //权限修改
             var node = this.taskNameContainer;
             var nameEdit = false;
             var overStatus = null;
@@ -835,7 +846,7 @@ MWF.xApplication.TeamWork.Task = new Class({
         }
 
 
-        if(true){ //权限
+        if(this.control.isEdit){ //权限
             this.taskStatusValueContainer.addEvents({
                 click:function(){
                     var sc = new MWF.xApplication.TeamWork.Task.StatusCheck(this.container, this.taskStatusValueContainer, this.app, {data:this.taskData}, {
@@ -894,7 +905,8 @@ MWF.xApplication.TeamWork.Task = new Class({
         var _self = this;
         if(this.taskDutyValue) this.taskDutyValue.empty();
         this.taskDutyValueContainer = new Element("div.taskDutyValueContainer",{styles:this.css.taskDutyValueContainer}).inject(this.taskDutyValue);
-        if(true){//权限
+
+        if(this.control.isEdit){//权限
             if(this.taskData.executor==""){
                 this.taskDutyAddIcon = new Element("div.taskDutyAddIcon",{styles:this.css.taskDutyAddIcon}).inject(this.taskDutyValueContainer);
                 this.taskDutyAddText = new Element("div.taskDutyAddText",{styles:this.css.taskDutyAddText,text:this.lp.addDuty}).inject(this.taskDutyValueContainer);
@@ -912,7 +924,7 @@ MWF.xApplication.TeamWork.Task = new Class({
                     }.bind(this)
                 })
             }else{
-                this.loadTaskPerson(this.taskDutyValueContainer,this.taskData.executor,true);
+                this.loadTaskPerson(this.taskDutyValueContainer,this.taskData.executor,this.taskData.control.founder);
             }
         }else{
             if(this.taskData.executor!=""){
@@ -939,7 +951,7 @@ MWF.xApplication.TeamWork.Task = new Class({
         }else{
             this.taskEndTime.set("text",this.lp.taskTimeEnd);
         }
-        if(true){ //权限
+        if(this.control.isEdit){ //权限
             this.taskStartTime.setStyles({"background-color":"#f5f5f5","cursor":"pointer"});
             this.taskEndTime.setStyles({"background-color":"#f5f5f5","cursor":"pointer"});
             this.taskStartTime.addEvents({
@@ -998,7 +1010,7 @@ MWF.xApplication.TeamWork.Task = new Class({
             this.taskRemarkValue.getFirst("p").setStyles({"margin-top":"0px"})
         }
         if(this.editor) delete this.editor;
-        if(true){ //权限
+        if(this.control.isEdit){ //权限
             if(value == ""){
                 this.taskRemarkValue.set("text",this.lp.editTip);
             }
@@ -1024,66 +1036,73 @@ MWF.xApplication.TeamWork.Task = new Class({
     loadPriorityValue:function(){
         if(this.taskPriorityValue)this.taskPriorityValue.empty();
         var node = new Element("div.taskPriorityValueText",{styles:this.css.taskPriorityValueText}).inject(this.taskPriorityValue);
-        var curColor = "#999999";
+        var dColor = "#999999";
         if(this.taskData.priority){
-            node.set("text",this.taskData.priority);
-            if(this.taskData.priority == this.lp.priority.urgency) curColor = "#ffaf38";
-            else if(this.taskData.priority == this.lp.priority.emergency) curColor = "#ff4f3e";
+            var arr = this.taskData.priority.split("||");
+            var name = arr[0]?arr[0]:this.lp.priority.normal;
+            var color = arr[1]?arr[1]:dColor;
+
+            node.set("text",name);
+            // if(this.taskData.priority == this.lp.priority.urgency) curColor = "#ffaf38";
+            // else if(this.taskData.priority == this.lp.priority.emergency) curColor = "#ff4f3e";
+
+            node.setStyles({"color":color,"border":"1px solid "+color+""});
 
-            node.setStyles({"color":curColor,"border":"1px solid "+curColor+""})
         }else{
             node.set("text",this.lp.priority.normal)
         }
-
-        node.addEvents({
-            click:function(){
-                var pc = new MWF.xApplication.TeamWork.Task.PriorityCheck(this.container, node, this.app, {data:this.taskData}, {
-                    css:this.css, lp:this.lp, axis : "y",
-                    position : { //node 固定的位置
-                        x : "right",
-                        y : "middle"
-                    },
-                    nodeStyles : {
-                        "min-width":"200px",
-                        "padding":"2px",
-                        "border-radius":"5px",
-                        "box-shadow":"0px 0px 4px 0px #999999",
-                        "z-index" : "201"
-                    },
-                    onPostLoad:function(){
-                        pc.node.setStyles({"opacity":"0","top":(pc.node.getStyle("top").toInt()+4)+"px"});
-                        var fx = new Fx.Tween(pc.node,{duration:400});
-                        fx.start(["opacity"] ,"0", "1");
-                    },
-                    onClose:function(rd){
-                        if(!rd) return;
-                        if(rd.value){
-                            if(rd.value != this.taskData.priority){
-                                var sd = {
-                                    taskId:this.taskData.id,
-                                    property:"priority",
-                                    mainValue:rd.value,
-                                    secondaryValue:""
-                                };
-                                this.updateSingleProperty(sd,function(){
-                                    this.taskData.priority = rd.value;
-                                    this.loadPriorityValue();
-                                }.bind(this))
+        if(this.control.isEdit){
+            node.addEvents({
+                click:function(){
+                    var pc = new MWF.xApplication.TeamWork.Task.PriorityCheck(this.container, node, this.app, {data:this.taskData}, {
+                        css:this.css, lp:this.lp, axis : "y",
+                        position : { //node 固定的位置
+                            x : "right",
+                            y : "middle"
+                        },
+                        nodeStyles : {
+                            "min-width":"200px",
+                            "padding":"2px",
+                            "border-radius":"5px",
+                            "box-shadow":"0px 0px 4px 0px #999999",
+                            "z-index" : "201"
+                        },
+                        onPostLoad:function(){
+                            pc.node.setStyles({"opacity":"0","top":(pc.node.getStyle("top").toInt()+4)+"px"});
+                            var fx = new Fx.Tween(pc.node,{duration:400});
+                            fx.start(["opacity"] ,"0", "1");
+                        },
+                        onClose:function(rd){
+                            if(!rd) return;
+                            if(rd.value){
+                                if(rd.value != this.taskData.priority){
+                                    var sd = {
+                                        taskId:this.taskData.id,
+                                        property:"priority",
+                                        mainValue:rd.value,
+                                        secondaryValue:""
+                                    };
+                                    this.updateSingleProperty(sd,function(){
+                                        this.taskData.priority = rd.value;
+                                        this.loadPriorityValue();
+                                    }.bind(this))
+                                }
                             }
-                        }
 
-                        this.loadPriorityValue();
-                    }.bind(this)
-                });
-                pc.load();
-            }.bind(this),
-            mouseover:function(){
-                this.setStyles({"border":"1px solid #4A90E2","color":"#4A90E2"})
-            },
-            mouseout:function(){
-                this.setStyles({"border":"1px solid "+curColor+"","color":curColor})
-            }
-        })
+                            this.loadPriorityValue();
+                        }.bind(this)
+                    });
+                    pc.load();
+                }.bind(this),
+                mouseover:function(){
+                    this.setStyles({"border":"1px solid #4A90E2","color":"#4A90E2"})
+                },
+                mouseout:function(){
+                    this.setStyles({"border":"1px solid "+color+"","color":color})
+                }
+            })
+        }
+
     },
     loadTagValue:function(){
         if(this.taskTagValue)this.taskTagValue.empty();
@@ -1323,79 +1342,82 @@ MWF.xApplication.TeamWork.Task = new Class({
         this.loadSubTask();
 
         //添加子任务
-        this.subTaskNewContent = new Element("div.subTaskNewContent",{styles:this.css.subTaskNewContent}).inject(this.subTaskAddContainer);
-        this.subTaskNewIcon = new Element("div.subTaskNewIcon",{styles:this.css.subTaskNewIcon}).inject(this.subTaskNewContent);
-        this.subTaskNewText = new Element("div.subTaskNewText",{styles:this.css.subTaskNewText,text:this.lp.taskSubText}).inject(this.subTaskNewContent);
-        this.subTaskNewContent.addEvents({
-            click:function(){
-                this.subTaskNewContent.hide();
-                if(this.subTaskNewContainer)this.subTaskNewContainer.destroy();
-                this.subTaskNewContainer = new Element("div.subTaskNewContainer",{styles:this.css.subTaskNewContainer}).inject(this.subTaskAddContainer);
+        if(this.control.isEdit){ //权限
+            this.subTaskNewContent = new Element("div.subTaskNewContent",{styles:this.css.subTaskNewContent}).inject(this.subTaskAddContainer);
+            this.subTaskNewIcon = new Element("div.subTaskNewIcon",{styles:this.css.subTaskNewIcon}).inject(this.subTaskNewContent);
+            this.subTaskNewText = new Element("div.subTaskNewText",{styles:this.css.subTaskNewText,text:this.lp.taskSubText}).inject(this.subTaskNewContent);
+            this.subTaskNewContent.addEvents({
+                click:function(){
+                    this.subTaskNewContent.hide();
+                    if(this.subTaskNewContainer)this.subTaskNewContainer.destroy();
+                    this.subTaskNewContainer = new Element("div.subTaskNewContainer",{styles:this.css.subTaskNewContainer}).inject(this.subTaskAddContainer);
 
-                this.subTaskNewValue = new Element("div.subTaskNewValue",{styles:this.css.subTaskNewValue}).inject(this.subTaskNewContainer);
-                this.subTaskNewInput = new Element("input.subTaskNewInput",{styles:this.css.subTaskNewInput,placeholder:this.lp.taskSubNamePlaceholder}).inject(this.subTaskNewValue);
-                this.subTaskNewPerson = new Element("div.subTaskNewPerson",{styles:this.css.subTaskNewPerson}).inject(this.subTaskNewValue);
+                    this.subTaskNewValue = new Element("div.subTaskNewValue",{styles:this.css.subTaskNewValue}).inject(this.subTaskNewContainer);
+                    this.subTaskNewInput = new Element("input.subTaskNewInput",{styles:this.css.subTaskNewInput,placeholder:this.lp.taskSubNamePlaceholder}).inject(this.subTaskNewValue);
+                    this.subTaskNewPerson = new Element("div.subTaskNewPerson",{styles:this.css.subTaskNewPerson}).inject(this.subTaskNewValue);
 
-                this.subTaskNewPerson.addEvent("click",function(){
-                    this.selectPerson(this.subTaskNewPerson,"identity",null,1,
-                        function(json){
-                            if(json.length>0){
-                                this.taskSubNewPerson = json[0];
-                                this.loadSubTaskPerson(this.subTaskNewPerson,json[0],true)
-                            }
-                        }.bind(this)
-                    );
-                }.bind(this));
-                this.subTaskNewAction = new Element("div.subTaskNewAction",{styles:this.css.subTaskNewAction}).inject(this.subTaskNewContainer);
-                this.subTaskNewCancel = new Element("div.subTaskNewCancel",{styles:this.css.subTaskNewCancel,text:this.lp.cancel}).inject(this.subTaskNewAction);
-                this.subTaskNewCancel.addEvents({
-                    click:function(){
-                        this.subTaskNewContent.show();
-                        this.subTaskNewContainer.destroy()
-                    }.bind(this),
-                    mouseover:function(){
-                        this.setStyles({"color":"#4A90E2"})
-                    },
-                    mouseout:function(){
-                        this.setStyles({"color":"#666666"})
-                    }
-                });
-                this.subTaskNewOK = new Element("div.subTaskNewOK",{styles:this.css.subTaskNewOK,text:this.lp.save}).inject(this.subTaskNewAction);
-                this.subTaskNewOK.addEvents({
-                    click:function(){
-                        if(this.subTaskNewInput.get("value").trim()=="") return;
-                        var data = {
-                            name:this.subTaskNewInput.get("value").trim(),
-                            project:this.taskData.project,
-                            parent:this.taskData.id,
-                            taskGroupId:this.taskData.taskGroupId,
-                            executor:this.taskSubNewPerson || ""
-                        };
-
-                        this.actions.save(data,function(json){
-                            this.taskSubNewPerson = "";
-                            if(json.data.id){
-                                //this.actions.taskGet(json.data.id,function(d){
-                                this.actions.get(json.data.id,function(d){
-                                    this.loadSubTaskItem(this.subTaskListContent,d.data);
-                                }.bind(this))
-                            }
+                    this.subTaskNewPerson.addEvent("click",function(){
+                        this.selectPerson(this.subTaskNewPerson,"identity",null,1,
+                            function(json){
+                                if(json.length>0){
+                                    this.taskSubNewPerson = json[0];
+                                    this.loadSubTaskPerson(this.subTaskNewPerson,json[0],true)
+                                }
+                            }.bind(this)
+                        );
+                    }.bind(this));
+                    this.subTaskNewAction = new Element("div.subTaskNewAction",{styles:this.css.subTaskNewAction}).inject(this.subTaskNewContainer);
+                    this.subTaskNewCancel = new Element("div.subTaskNewCancel",{styles:this.css.subTaskNewCancel,text:this.lp.cancel}).inject(this.subTaskNewAction);
+                    this.subTaskNewCancel.addEvents({
+                        click:function(){
                             this.subTaskNewContent.show();
-                            this.subTaskNewContainer.destroy();
+                            this.subTaskNewContainer.destroy()
+                        }.bind(this),
+                        mouseover:function(){
+                            this.setStyles({"color":"#4A90E2"})
+                        },
+                        mouseout:function(){
+                            this.setStyles({"color":"#666666"})
+                        }
+                    });
+                    this.subTaskNewOK = new Element("div.subTaskNewOK",{styles:this.css.subTaskNewOK,text:this.lp.save}).inject(this.subTaskNewAction);
+                    this.subTaskNewOK.addEvents({
+                        click:function(){
+                            if(this.subTaskNewInput.get("value").trim()=="") return;
+                            var data = {
+                                name:this.subTaskNewInput.get("value").trim(),
+                                project:this.taskData.project,
+                                parent:this.taskData.id,
+                                taskGroupId:this.taskData.taskGroupId,
+                                executor:this.taskSubNewPerson || ""
+                            };
+
+                            this.actions.save(data,function(json){
+                                this.taskSubNewPerson = "";
+                                if(json.data.id){
+                                    //this.actions.taskGet(json.data.id,function(d){
+                                    this.actions.get(json.data.id,function(d){
+                                        this.loadSubTaskItem(this.subTaskListContent,d.data);
+                                    }.bind(this))
+                                }
+                                this.subTaskNewContent.show();
+                                this.subTaskNewContainer.destroy();
 
-                            if(json.data.dynamics){
-                                json.data.dynamics.each(function(dd){
-                                    this.loadDynamicItem(dd,"bottom")
-                                }.bind(this));
-                            }
-                            this.dynamicContent.scrollTo(0,this.dynamicContent.getScrollSize().y);
+                                if(json.data.dynamics){
+                                    json.data.dynamics.each(function(dd){
+                                        this.loadDynamicItem(dd,"bottom")
+                                    }.bind(this));
+                                }
+                                this.dynamicContent.scrollTo(0,this.dynamicContent.getScrollSize().y);
 
-                        }.bind(this))
-                    }.bind(this)
-                })
+                            }.bind(this))
+                        }.bind(this)
+                    })
+
+                }.bind(this)
+            });
+        }
 
-            }.bind(this)
-        });
     },
     loadSubTask:function(){
         var node = this.subTaskListContent;
@@ -1718,6 +1740,7 @@ MWF.xApplication.TeamWork.Task.TaskMore = new Class({
         var _self = this;
         this.css = this.options.css;
         this.lp = this.options.lp;
+        //alert(JSON.stringify(this.data))
         //this.data
         //this.contentNode
         //debugger;
@@ -1809,26 +1832,27 @@ MWF.xApplication.TeamWork.Task.TaskMore = new Class({
         subTaskIcon.setStyles({"background":"url(../x_component_TeamWork/$Task/default/icon/tasksub.png) no-repeat center"});
         var subTaskText = new Element("div.subTaskText",{styles:this.css.topMoreItemText,text:this.lp.taskSub}).inject(subTask);
 
-        var removeTask = new Element("div.removeTask",{styles:this.css.topMoreItem}).inject(this.contentNode);
-        removeTask.addEvents({
-            click:function(e){
-                _self.app.confirm("warn",e,_self.app.lp.common.confirm.removeTitle,_self.app.lp.common.confirm.removeContent,300,120,function(){
-                    _self.rootActions.TaskAction.delete(_self.data.data.id,function(){
-                        var rd = {"act":"remove"};
-                        _self.close(rd);
-                        this.close()
-                    }.bind(this))
-                },function(){
-                    this.close();
-                });
-            },
-            mouseenter:function(){this.setStyles({"background-color":"#F7F7F7"})},
-            mouseleave:function(){this.setStyles({"background-color":""})}
-        });
-        var removeTaskIcon = new Element("div.removeTaskIcon",{styles:this.css.topMoreItemIcon}).inject(removeTask);
-        removeTaskIcon.setStyles({"background":"url(../x_component_TeamWork/$Task/default/icon/taskremove.png) no-repeat center"});
-        var removeTaskText = new Element("div.removeTaskText",{styles:this.css.topMoreItemText,text:this.lp.taskRemove}).inject(removeTask);
-
+        if(this.data.data.control && this.data.data.control.delete){
+            var removeTask = new Element("div.removeTask",{styles:this.css.topMoreItem}).inject(this.contentNode);
+            removeTask.addEvents({
+                click:function(e){
+                    _self.app.confirm("warn",e,_self.app.lp.common.confirm.removeTitle,_self.app.lp.common.confirm.removeContent,300,120,function(){
+                        _self.rootActions.TaskAction.delete(_self.data.data.id,function(){
+                            var rd = {"act":"remove"};
+                            _self.close(rd);
+                            this.close()
+                        }.bind(this))
+                    },function(){
+                        this.close();
+                    });
+                },
+                mouseenter:function(){this.setStyles({"background-color":"#F7F7F7"})},
+                mouseleave:function(){this.setStyles({"background-color":""})}
+            });
+            var removeTaskIcon = new Element("div.removeTaskIcon",{styles:this.css.topMoreItemIcon}).inject(removeTask);
+            removeTaskIcon.setStyles({"background":"url(../x_component_TeamWork/$Task/default/icon/taskremove.png) no-repeat center"});
+            var removeTaskText = new Element("div.removeTaskText",{styles:this.css.topMoreItemText,text:this.lp.taskRemove}).inject(removeTask);
+        }
 
         if(callback)callback();
     }
@@ -1911,6 +1935,7 @@ MWF.xApplication.TeamWork.Task.PriorityCheck = new Class({
         var _self = this;
         this.css = this.options.css;
         this.lp = this.options.lp;
+        this.rootActions = this.app.rootActions;
         //this.data
         //this.contentNode
 
@@ -1920,9 +1945,9 @@ MWF.xApplication.TeamWork.Task.PriorityCheck = new Class({
             "width":"100%"
         };
         var text={
-            "height":"25px","line-height":"25px","float":"left","width":"50px","text-align":"center",
+            "height":"25px","line-height":"25px","float":"left","text-align":"center",
             "margin-left":"6px","margin-top":"8px",
-            "font-size":"13px","color":"#666666","border-radius":"2px"
+            "font-size":"13px","color":"#666666","border-radius":"2px","padding-left":"10px","padding-right":"10px"
         };
         var icon = {
             "float":"right","width":"24px","height":"24px",
@@ -1930,52 +1955,83 @@ MWF.xApplication.TeamWork.Task.PriorityCheck = new Class({
             "background":"url(../x_component_TeamWork/$Task/default/icon/icon_dagou.png) no-repeat center"
         };
 
-        var normalContainer = new Element("div",{styles:container}).inject(this.contentNode);
-        var normalText = new Element("div",{styles:text,text:this.lp.priority.normal}).inject(normalContainer);
-        normalText.setStyles({"color":"#999999","border":"1px solid #999999"});
-        if(this.data.data.priority == this.lp.priority.normal){
-            new Element("div",{styles:icon}).inject(normalContainer);
-        }
-        normalContainer.addEvents({
-            click:function(){
-                var data = {"value":this.lp.priority.normal};
-                this.close(data)
-            }.bind(this),
-            mouseover:function(){this.setStyles({"background-color":"#f2f5f7"})},
-            mouseout:function(){this.setStyles({"background-color":""})}
-        });
+        var arr = this.data.data.priority.split("||");
+        var priorityName = arr[0];
+        var priorityColor = arr[1];
 
-        var urgencyContainer = new Element("div",{styles:container}).inject(this.contentNode);
-        var urgencyText = new Element("div",{styles:text,text:this.lp.priority.urgency}).inject(urgencyContainer);
-        urgencyText.setStyles({"color":"#ffaf38","border":"1px solid #ffaf38"});
-        if(this.data.data.priority == this.lp.priority.urgency){
-            new Element("div",{styles:icon}).inject(urgencyContainer);
-        }
-        urgencyContainer.addEvents({
-            click:function(){
-                var data = {"value":this.lp.priority.urgency};
-                this.close(data)
-            }.bind(this),
-            mouseover:function(){this.setStyles({"background-color":"#f2f5f7"})},
-            mouseout:function(){this.setStyles({"background-color":""})}
-        });
-
-        var emergencyContainer = new Element("div",{styles:container}).inject(this.contentNode);
-        var emergencyText = new Element("div",{styles:text,text:this.lp.priority.emergency}).inject(emergencyContainer);
-        emergencyText.setStyles({"color":"#ff4f3e","border":"1px solid #ff4f3e"});
-        if(this.data.data.priority == this.lp.priority.emergency){
-            new Element("div",{styles:icon}).inject(emergencyContainer);
-        }
-        emergencyContainer.addEvents({
-            click:function(){
-                var data = {"value":this.lp.priority.emergency};
-                this.close(data)
-            }.bind(this),
-            mouseover:function(){this.setStyles({"background-color":"#f2f5f7"})},
-            mouseout:function(){this.setStyles({"background-color":""})}
-        });
+        this.rootActions.GlobalAction.priorityList(function(json){
+            json.data.each(function(data){
+                var vContainer = new Element("div",{styles:container}).inject(this.contentNode);
+                var value = new Element("div",{styles:text,text:data.priority}).inject(vContainer);
+                value.setStyles({"color":data.priorityColor,"border":"1px solid "+ data.priorityColor});
+                if(priorityName == data.priority && priorityColor.toUpperCase() == data.priorityColor.toUpperCase()){
+                    new Element("div",{styles:icon}).inject(vContainer);
+                }
+                vContainer.addEvents({
+                    click:function(){
+                        var d = {"value":data.priority+"||"+data.priorityColor};
+                        this.close(d)
+                    }.bind(this),
+                    mouseover:function(){this.setStyles({"background-color":"#f2f5f7"})},
+                    mouseout:function(){this.setStyles({"background-color":""})}
+                });
 
+            }.bind(this))
+        }.bind(this));
         if(callback)callback();
+        return;
+
+
+
+
+
+
+        // var normalContainer = new Element("div",{styles:container}).inject(this.contentNode);
+        // var normalText = new Element("div",{styles:text,text:this.lp.priority.normal}).inject(normalContainer);
+        // normalText.setStyles({"color":"#999999","border":"1px solid #999999"});
+        // if(this.data.data.priority == this.lp.priority.normal){
+        //     new Element("div",{styles:icon}).inject(normalContainer);
+        // }
+        // normalContainer.addEvents({
+        //     click:function(){
+        //         var data = {"value":this.lp.priority.normal};
+        //         this.close(data)
+        //     }.bind(this),
+        //     mouseover:function(){this.setStyles({"background-color":"#f2f5f7"})},
+        //     mouseout:function(){this.setStyles({"background-color":""})}
+        // });
+        //
+        // var urgencyContainer = new Element("div",{styles:container}).inject(this.contentNode);
+        // var urgencyText = new Element("div",{styles:text,text:this.lp.priority.urgency}).inject(urgencyContainer);
+        // urgencyText.setStyles({"color":"#ffaf38","border":"1px solid #ffaf38"});
+        // if(this.data.data.priority == this.lp.priority.urgency){
+        //     new Element("div",{styles:icon}).inject(urgencyContainer);
+        // }
+        // urgencyContainer.addEvents({
+        //     click:function(){
+        //         var data = {"value":this.lp.priority.urgency};
+        //         this.close(data)
+        //     }.bind(this),
+        //     mouseover:function(){this.setStyles({"background-color":"#f2f5f7"})},
+        //     mouseout:function(){this.setStyles({"background-color":""})}
+        // });
+        //
+        // var emergencyContainer = new Element("div",{styles:container}).inject(this.contentNode);
+        // var emergencyText = new Element("div",{styles:text,text:this.lp.priority.emergency}).inject(emergencyContainer);
+        // emergencyText.setStyles({"color":"#ff4f3e","border":"1px solid #ff4f3e"});
+        // if(this.data.data.priority == this.lp.priority.emergency){
+        //     new Element("div",{styles:icon}).inject(emergencyContainer);
+        // }
+        // emergencyContainer.addEvents({
+        //     click:function(){
+        //         var data = {"value":this.lp.priority.emergency};
+        //         this.close(data)
+        //     }.bind(this),
+        //     mouseover:function(){this.setStyles({"background-color":"#f2f5f7"})},
+        //     mouseout:function(){this.setStyles({"background-color":""})}
+        // });
+        //
+        // if(callback)callback();
     }
 
 });

+ 13 - 8
o2web/source/x_component_TeamWork/TaskAttachmentList.js

@@ -39,15 +39,20 @@ MWF.xApplication.TeamWork.TaskAttachmentList = new Class({
             }.bind(this));
         }.bind(this));
 
+        this.rootActions.TaskAction.get(this.data.id,function(json){
+            this.taskData = json.data;
+            if(this.taskData.control && this.taskData.control.edit){  //权限
+                this.addContainer = new Element("div.addContainer",{styles:this.css.addContainer}).inject(this.valueContent);
+                this.addIcon = new Element("div.addIcon",{styles:this.css.addIcon}).inject(this.addContainer);
+                this.addText = new Element("div.addText",{styles:this.css.addText,text:this.lp.attachmentAdd}).inject(this.addContainer);
+                this.addContainer.addEvents({
+                    click:function(){
+                        this.uploadAttachment()
+                    }.bind(this)
+                });
+            }
+        }.bind(this))
 
-        this.addContainer = new Element("div.addContainer",{styles:this.css.addContainer}).inject(this.valueContent);
-        this.addIcon = new Element("div.addIcon",{styles:this.css.addIcon}).inject(this.addContainer);
-        this.addText = new Element("div.addText",{styles:this.css.addText,text:this.lp.attachmentAdd}).inject(this.addContainer);
-        this.addContainer.addEvents({
-            click:function(){
-                this.uploadAttachment()
-            }.bind(this)
-        });
 
     },
     loadAttachmentItem:function(att){

+ 79 - 2
o2web/source/x_component_TeamWork/lp/zh-cn.js

@@ -1,8 +1,42 @@
 MWF.xApplication.TeamWork.LP = {
 	"title": "TeamWork",
+	"bam":{
+		"title":"后台管理",
+		"backProject":"返回主页",
+		"base" :"基础",
+		"navi":{
+			"template":"模板管理",
+			"priority":"优先级设定",
+			"extField":"自定义字段",
+			"access":"权限管理"
+		},
+		"template":{
+			"title":"模板管理",
+			"tips":"项目所属类别,可设置默认泳道等。",
+			"description":"描述",
+			"add":"新建模板",
+			"edit":"编辑",
+			"remove":"删除",
+			"name":"模板名称",
+			"lane":"泳道",
+			"laneTip":"多个泳道逗号隔开",  //用于项目中得默认泳道,可以在项目中自由更改.
+			"ok":"确定",
+			"close":"关闭"
+		},
+		"priority":{
+			"title":"优先级设定",
+			"tips":"用来定义任务的优先处理等级。",
+			"description":"列表顺序由上至下为:最高优先级 至 最低优先级",
+			"add":"添加",
+			"success":"保存成功"
+
+		}
+
+	},
 	"ProjectList":{
 		"navi":{
 			"title":"TeamWork",
+			"bam":"后台管理",
 			"newItem":"新建项目",
 			"allItem":"全部项目",
 			"starItem":"我的星标",
@@ -28,6 +62,11 @@ MWF.xApplication.TeamWork.LP = {
 			"addProjectListText":"创建新项目",
 			"listTip":"列表视图",
 			"blockTip":"卡片视图"
+		},
+		"icon":{
+			"star":"星标",
+			"setting":"设置",
+			"group":"分组"
 		}
 	},
 	"newProject":{
@@ -35,10 +74,13 @@ MWF.xApplication.TeamWork.LP = {
 		"name":"项目名称",
 		"description":"项目简介",
 		"group":"项目分组",
+		"template":"模板",
+		"templateTitle":"选择模板",
+
 		"add":"创建"
 	},
 	"projectSetting":{
-		"general":"概述",
+		"projectGeneral":"概述",
 		"customField":"自定义字段",
 		"title":"项目设置",
 		"projectSettingBgText":"项目封面",
@@ -54,7 +96,42 @@ MWF.xApplication.TeamWork.LP = {
 		"remove":"删除",
 		"description":"描述",
 		"updateTime":"最后更新时间",
-		"option":"选项"
+		"option":"选项",
+		"projectDetail":"项目详情",
+		"projectDetails":{
+			"title":"项目详情",
+			"total":"总数",
+			"process":"进行中",
+			"complete":"已完成",
+			"over":"已逾期",
+			"taskStat":"任务统计",
+			"create":"创建",
+			"at":"于"
+		},
+		"projectAccess":"权限管理",
+		"projectMore":"更多设置",
+		"auth":{
+			"task":"项目",
+			"taskCreate":"新建项目",
+			"taskCopy":"复制项目",
+			"taskDelete":"删除项目",
+			"list":"列表",
+			"listCreate":"新建列表",
+			"attachment":"附件",
+			"attachmentUpload":"上传附件",
+			"comment":"评论",
+			"canComment":"允许评论"
+		},
+		"moreActionTitle":"项目操作",
+		"moreActionDescription":"您可以执行以下操作",
+		"moreActionComplete":"完成项目",
+		"moreActionCompleteTips":"一旦完成项目,则该项目下的所有任务都会被设置为已完成,只能查看项目,不能对项目进行编辑等操作。",
+		"moreActionUnComplete":"取消完成",
+		"moreActionUnCompleteTips":"取消完成,任务恢复成可新建状态",
+		"moreActionRemove":"删除项目",
+		"moreActionRemoveTips":"一旦删除项目,则该项目下的所有任务都会被设置为删除,其中的项目等内容不会被搜索和统计收录。",
+		"moreActionRecover":"恢复项目",
+		"moreActionRecoverTips":"恢复项目,该项目下的所有任务都会被恢复到删除前的状态,"
 	},
 	"extField":{
 		"field":"字段",