提交 02119b30 编写于 作者: qq_15299447's avatar qq_15299447

Merge branch 'develop' into 'master'

增加项目工作脑图查看

See merge request o2oa/teamwork!17
......@@ -463,12 +463,13 @@
"width":"500px",
"padding":"0px 0px",
"height":"30px",
"margin-top":"10px",
"border":"1px solid #cccccc"
},
"searchInput":{
"float":"left",
"width":"400px",
"height":"24px",
"height":"28px",
"border":"0px",
"text-indent":"2px"
},
......@@ -509,7 +510,8 @@
"height":"50px",
"color":"#1b9aee",
"cursor":"pointer",
"min-width":"500px"
"min-width":"500px",
"padding-left":"5px"
},
"projectItemCreator":{
"height":"50px",
......@@ -529,6 +531,18 @@
"text-align":"center",
"width":"80px"
},
"projectItemTaskCount":{
"height":"50px",
"line-height":"50px",
"text-align":"center",
"width":"80px"
},
"projectItemTaskStatus":{
"height":"50px",
"line-height":"50px",
"text-align":"center",
"width":"50px"
},
"projectItemAction":{
"width":"100px",
"text-align":"center"
......
{
"maskDiv":{
"position":"absolute",
"left":"0px",
"top":"0px",
"right":"0px",
"bottom":"0px",
"z-index":"9998",
"opacity":"0.3",
"background":"url('../x_component_TeamWork/$Minder/default/icon/icon_off_click40.png') no-repeat 99% 1%",
"background-color":"#000000"
},
"container":{
"position":"absolute",
"width":"1200px",
"height":"900px",
"left":"100px",
"top":"100px",
"border-radius":"5px",
"z-index":"9999",
"background-color":"#cccccc"
}
}
\ No newline at end of file
......@@ -697,10 +697,7 @@ MWF.xApplication.TeamWork.Bam = new Class({
createProjectLayout:function(){
var _self = this;
this.curPage = 0;
this.curCount = 0;
this.contentLayout.empty();
var projectTop = new Element("div.projectTop", {
......@@ -732,13 +729,8 @@ MWF.xApplication.TeamWork.Bam = new Class({
var sHeight = this.getScrollHeight();
var cHeight = this.getHeight();
//console.log("top="+sTop);
//console.log("scrollheight="+sHeight);
//console.log("cHeight="+cHeight);
if(sHeight - sTop < cHeight+2){
if(!_self.pageLoading && _self.curCount<_self.projectTotal){
//console.log("doooooooooooooo");
_self.loadProjectData()
}
}
......@@ -747,11 +739,31 @@ MWF.xApplication.TeamWork.Bam = new Class({
var searchLayout = new Element("div.searchLayout", {styles: this.css.searchLayout}).inject(this.projectTableLayout);
this.searchInput = new Element("input",{styles:this.css.searchInput,placeholder:this.lp.project.searchHolder}).inject(searchLayout);
this.searchInput.addEvents({
"keypress":function(e){
var keycode = (e.event.keyCode ? e.event.keyCode : e.event.which);
if ((keycode == 13 || keycode == 10)) {
var value = this.get("value").trim();
if(value=="") return;
var json = {
"title":value
};
_self.createProjectTable(json);
searchReset.show();
}
}
})
var searchAction = new Element("div.searchAction",{styles:this.css.searchAction}).inject(searchLayout);
searchAction.addEvents({
"click":function(){
var value = _self.searchInput.get("value").trim();
if(value=="") return;
var json = {
"title":value
};
_self.createProjectTable(json);
searchReset.show();
}
})
......@@ -760,9 +772,17 @@ MWF.xApplication.TeamWork.Bam = new Class({
"click":function(){
_self.searchInput.set("value","");
this.hide();
_self.createProjectTable();
}
})
this.createProjectTable();
},
createProjectTable:function(filter){
this.curPage = 0;
this.curCount = 0;
if(this.projectTable) this.projectTable.destroy();
var table = this.projectTable = new Element("table.projectTable",{styles:this.css.projectTable}).inject(this.projectTableLayout);
var tr = new Element("tr.tr",{styles:this.css.projectTr}).inject(table);
......@@ -770,10 +790,12 @@ MWF.xApplication.TeamWork.Bam = new Class({
new Element("th.th",{styles:this.css.projectTh,text:this.lp.project.creator}).inject(tr);
new Element("th.th",{styles:this.css.projectTh,text:this.lp.project.createTime}).inject(tr);
new Element("th.th",{styles:this.css.projectTh,text:this.lp.project.total}).inject(tr);
new Element("th.th",{styles:this.css.projectTh,text:this.lp.project.status}).inject(tr);
new Element("th.th",{styles:this.css.projectTh}).inject(tr);
this.loadProjectData();
this.loadingContainer = new Element("div.loadingContainer",{styles:this.css.loadingContainer}).inject(this.projectTableLayout);
this.app.setLoading(this.loadingContainer);
this.loadProjectData(filter);
},
loadProjectData:function(filter){
......@@ -784,7 +806,8 @@ MWF.xApplication.TeamWork.Bam = new Class({
var filter = filter || {};
this.pageLoading = true;
this.rootActions.ProjectAction.listPageWithFilter(page,pageCount,filter,function(json){
this.rootActions.ProjectAction.listPageWithFilterByManager(page,pageCount,filter,function(json){
if(this.loadingContainer) this.loadingContainer.destroy();
this.curPage = page;
this.projectTotal = json.count;
json.data.each(function(data){
......@@ -815,9 +838,14 @@ MWF.xApplication.TeamWork.Bam = new Class({
new Element("td",{styles:this.css.projectItemCreator,text:data.creatorPerson.split("@")[0]}).inject(tr);
new Element("td",{styles:this.css.projectItemCreateTime,text:data.createTime}).inject(tr);
new Element("td",{styles:this.css.projectItemTaskCount,text:data.count||88}).inject(tr);
new Element("td",{styles:this.css.projectItemTaskCount,text:data.taskTotal||0}).inject(tr);
var status = new Element("td",{styles:this.css.projectItemTaskStatus}).inject(tr);
var statusText = this.lp.project.progress;
if(data.completed) statusText = this.lp.project.completed;
if(data.deleted) statusText = this.lp.project.deleted;
status.set("text",statusText);
var action = new Element("td",{styles:this.css.projectItemAction}).inject(tr);
var mind = new Element("span.mind",{styles:this.css.actionTxt,text:this.lp.project.open}).inject(action);
var mind = new Element("span.mind",{styles:this.css.actionTxt,text:this.lp.project.minder}).inject(action);
mind.addEvents({
"click":function(){
this.openMind(data);
......@@ -826,14 +854,18 @@ MWF.xApplication.TeamWork.Bam = new Class({
},
openProject:function(d){
MWF.xDesktop.requireApp("TeamWork", "Project", function(){
var p = new MWF.xApplication.TeamWork.Project(this.container,this.app,d,{
}
);
var p = new MWF.xApplication.TeamWork.Project(this.container,this.app,d,{ });
p.load();
}.bind(this));
},
openMind:function(data){
MWF.xDesktop.requireApp("TeamWork", "Minder", function(){
var minder = new MWF.xApplication.TeamWork.Minder(this.container,this.app,data,{
onClose:function(){
if(minder) delete minder;
}
});
minder.open();
}.bind(this));
}
});
......@@ -306,7 +306,17 @@ MWF.xApplication.TeamWork.Main = new Class({
//taskGroupItemContainer
//taskGroupLayout,taskGroupItemContainer 自定义高度
//bam
if(this.content.getElement(".bam_mind_container")){
var container = this.content.getElement(".bam_mind_container");
var size = this.content.getSize();
container.setStyles({
"width":(size.x-200)+"px",
"height":(size.y-200)+"px",
"left":"100px",
"top":"100px"
})
}
},
});
MWF.xApplication.TeamWork = MWF.xApplication.TeamWork || {};
MWF.xApplication.TeamWork.Minder = new Class({
Extends: MPopupForm,
Implements: [Options, Events],
options: {
"style": "default",
"template" : "default", //fish-bone
"theme": "fresh-blue", //"fresh-blue-compat"
"hasNavi" : true,
"align" : "center"
},
initialize: function (content, app, data, options) {
this.setOptions(options);
this.content = content;
this.app = app;
this.lp = this.app.lp.minder;
this.rootActions = this.app.rootActions;
this.path = "../x_component_TeamWork/$Minder/";
this.cssPath = this.path+this.options.style+"/css.wcss";
this._loadCss();
this.data = data;
this.data = {
"root":{
"data":{
"id":"root",
"text":"服务器服务费服务器服务费服务器服务费"
},
"children":[
{
"data": {
"id": "ccxu85jy16o111110",
//"created": 1626771098258,
"text": "呵呵呵呵呵呵呵呵咯咯咯二咯咯咯"
},
"children": [
{
"data": {
"id": "ccxu85jy16o0",
//"created": 1626771098258,
"text": "每一天要么明天明天明天明天明天明天明天"
},
"children": []
},
{
"data": {
"id": "ccxu85jy16o0",
//"created": 1626771098258,
"text": "微软微软微软微软微软微软微软微软微软为"
},
"children": []
}
]
},
{
"data": {
"id": "ccxu85jy16o0",
//"created": 1626771098258,
"text": "胜多负少打发发发发发啊啊打发打法发啊发"
}
},
{
"data": {
"id": "ccxu85jy16o0",
//"created": 1626771098258,
"text": "胜多负少打发发发发发啊啊打发打法发啊发"
}
},
{
"data": {
"id": "ccxu85jy16o0",
//"created": 1626771098258,
"text": "胜多负少打发发发发发啊啊打发打法发啊发"
}
},
{
"data": {
"id": "ccxu85jy16o0",
//"created": 1626771098258,
"text": "胜多负少打发发发发发啊啊打发打法发啊发"
},
"children": [
{
"data": {
"id": "ccxu85jy16o0",
//"created": 1626771098258,
"text": "每一天要么明天明天明天明天明天明天明天"
},
"children": [
{
"data": {
"id": "ccxu85jy16o0",
//"created": 1626771098258,
"text": "每一天要么明天明天明天明天明天明天明天"
},
"children": []
},
{
"data": {
"id": "ccxu85jy16o0",
//"created": 1626771098258,
"text": "微软微软微软微软微软微软微软微软微软为"
},
"children": []
}
]
},
{
"data": {
"id": "ccxu85jy16o0",
//"created": 1626771098258,
"text": "微软微软微软微软微软微软微软微软微软为"
},
"children": []
}
]
},
{
"data": {
"id": "ccxu85jy16o0",
//"created": 1626771098258,
"text": "胜多负少打发发发发发啊啊打发打法发啊发"
}
},
{
"data": {
"id": "ccxu85jy16o0",
//"created": 1626771098258,
"text": "胜多负少打发发发发发啊啊打发打法发啊发"
}
},
{
"data": {
"id": "ccxu85jy16o0",
//"created": 1626771098258,
"text": "胜多负少打发发发发发啊啊打发打法发啊发"
},
"children": [
{
"data": {
"id": "ccxu85jy16o0",
//"created": 1626771098258,
"text": "每一天要么明天明天明天明天明天明天明天"
},
"children": []
},
{
"data": {
"id": "ccxu85jy16o0",
//"created": 1626771098258,
"text": "微软微软微软微软微软微软微软微软微软为"
},
"children": []
}
]
},
{
"data": {
"id": "ccxu85jy16o0",
//"created": 1626771098258,
"text": "胜多负少打发发发发发啊啊打发打法发啊发"
}
},
{
"data": {
"id": "ccxu85jy16o0",
//"created": 1626771098258,
"text": "胜多负少打发发发发发啊啊打发打法发啊发"
}
}
]
},
"template": "default",
"theme": "fresh-blue",
"version": "1.4.33"
}
},
close:function(){
this.maskDiv.destroy();
this.container.destroy();
this.fireEvent("close");
delete this;
},
open:function(){
this.maskDiv = new Element("div",{styles:this.css.maskDiv,title:this.lp.clickClose}).inject(this.content);
this.maskDiv.addEvents({
"click":function(){
this.close()
}.bind(this)
})
this.container = new Element("div.bam_mind_container",{styles:this.css.container}).inject(this.content);
this.computeSize();
this.load()
},
load:function(){
this.container.empty();
this.loadResource( function(){
this.loadKityMinder( this.data );
}.bind(this) );
this.attachEvent();
},
loadResource: function (callback) {
var kityminderPath = "../o2_lib/kityminder/";
COMMON.AjaxModule.loadCss(kityminderPath + "core/src/kityminder.css", function () {
COMMON.AjaxModule.load("kity", function () {
COMMON.AjaxModule.load("kityminder", function () {
if (callback)callback();
}.bind(this));
}.bind(this))
}.bind(this))
},
loadKityMinder: function ( data ) {
var _self = this;
this.isMovingCenter = true;
// 创建 km 实例
/* global kityminder */
var km = this.km = new kityminder.Minder();
//var target = document.querySelector('#minder-view');
km.renderTo(this.container);
data.theme = data.theme || this.options.theme;
data.template = data.template || this.options.template;
// this.deepestLevel = 0;
// km.on("import", function (e) {
// if ( !_self.alreadyBind ) {
// var nodes = km.getAllNode();
// nodes.forEach(function (node) {
// var level = node.getLevel();
// _self.deepestLevel = level > _self.deepestLevel ? level : _self.deepestLevel;
// _self.fireEvent( "postLoadNode", node );
// });
// _self.alreadyBind = true;
// if( _self.options.hasNavi )_self.loadNavi();
// _self.fireEvent( "postLoad" , _self );
// }
// });
// //km.on("execCommand", function(e){
// // if (e.commandName === "template" ) {
// // _self.moveToCenter();
// // }
// //})
// km.on("layoutallfinish",function(){
// if( _self.templateChanged || _self.isMovingCenter ){
// _self.moveToCenter();
// _self.templateChanged = false;
// _self.isMovingCenter = false;
// }
// });
km.importJson(data);
km.execCommand('hand');
},
moveToCenter: function(){
//setTimeout( this._moveToCenter.bind(this) , 100 );
this._moveToCenter();
},
_moveToCenter: function(){
if( this.options.align != "center")return;
//图形居中
var minderView = this.km.getRenderContainer().getRenderBox('screen'); //.getBoundaryBox();
var containerView = this.container.getCoordinates();
var root = this.km.getRoot();
var rootView = root.getRenderContainer().getRenderBox('screen'); //getRenderBox('top');
var rootClientTop = rootView.top - minderView.top;
var rootClientLeft = rootView.left - minderView.left;
var rootChildrenLength = root.getChildren().length;
var template = this.km.queryCommandValue("template");
var left, top, isCamera = false;
if( minderView.width > containerView.width ){ //如果图形宽度大于容器宽度
if( template == "fish-bone" || rootChildrenLength < 2 ){
left = 50;
}else{
isCamera = true;
}
}else{
left = parseInt( ( containerView.width - minderView.width ) / 2 + rootClientLeft + 50 );
}
if( minderView.height > containerView.height ){ //如果图形高度大于容器高度
if( rootClientTop > containerView.height ){
if( template == "fish-bone" ) {
top = containerView.height - rootView.height
}else if( rootChildrenLength < 2){
top = parseInt( containerView.width / 2 );
}else{
isCamera = true;
}
}else{
top = rootClientTop + 50;
}
}else{
top = parseInt( ( containerView.height - minderView.height ) / 2 ) + rootClientTop;
}
if( isCamera ){
this.km.execCommand('camera', this.km.getRoot(), 600);
}else{
var dragger = this.km.getViewDragger();
dragger.moveTo(new kity.Point(left, top) , 300 );
}
},
attachEvent: function(){
this.container.addEvent("mousewheel", function(ev){ //鼠标滚轮事件
//console.log(ev.wheel);
if( ev.wheel > 0){ //向上滚动,放大
this.km.execCommand('zoomIn');
//console.log("放大")
// if( this.navi && this.navi.navZoompanIndicator ){
// var marginTop = parseInt( this.navi.navZoompanIndicator.getStyle("margin-top"));
// if( marginTop > 0 ){
// this.navi.navZoompanIndicator.setStyle( "margin-top", (marginTop - 10) + "px" );
// }
// }
}else{ //向下滚动,缩小
this.km.execCommand('zoomOut');
//console.log("缩小")
// if( this.navi && this.navi.navZoompanIndicator ){
// var totalHeight = parseInt( this.navi.navZoompan.getStyle("height") );
// var marginTop = parseInt( this.navi.navZoompanIndicator.getStyle("margin-top"));
// if( marginTop < totalHeight ){
// this.navi.navZoompanIndicator.setStyle( "margin-top", (marginTop + 10 ) + "px" );
// }
// }
}
this.moveToCenter();
}.bind(this))
},
computeSize:function(){
var size = this.content.getSize();
this.container.setStyles({
"width":(size.x-200)+"px",
"height":(size.y-200)+"px",
"left":"100px",
"top":"100px"
})
}
});
\ No newline at end of file
......@@ -39,12 +39,20 @@ MWF.xApplication.TeamWork.LP = {
"creator":"创建者",
"createTime":"创建时间",
"total":"任务总数",
"status":"状态",
"open":"查看",
"minder":"跟踪",
"remove":"删除",
"searchHolder":"项目搜索"
"searchHolder":"项目搜索",
"deleted":"已删除",
"completed":"已完成",
"progress":"进行中",
}
},
"minder":{
"clickClose":"点击关闭"
},
"ProjectList":{
"navi":{
"title":"工作管理",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册