NodeInfo.js 50.1 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298
function WfNodeInfo(editorUi, container) {
    this.editorUi = editorUi;
    var editor = editorUi.editor;
    this.container = container;
    var graph = editor.graph;
	
	this.preCells = null;
	this.nodePanelHide = false;
	this.update = mxUtils.bind(this, function(sender, evt)
	{
		this.clearSelectionState();
		!this.noNeedRefresh && this.refresh();
		this.noNeedRefresh = false;
	});
	
	graph.getSelectionModel().addListener(mxEvent.CHANGE, this.update);
	graph.addListener(mxEvent.EDITING_STARTED, this.update);
	graph.addListener(mxEvent.EDITING_STOPPED, this.update);
	graph.getModel().addListener(mxEvent.CHANGE, this.update);
	graph.addListener(mxEvent.ROOT, mxUtils.bind(this, function()
	{
		this.refresh();
    }));
    this.refresh();
	this.nodeNameRef = null;
}
// paint header
WfNodeInfo.prototype.drawHeader = function(){
	var graph = this.editorUi.editor.graph;
    var cells = graph.getSelectionCells();

	var headerStr = wfGetLabel(32210,'流程信息');
	if(cells.length == 1){
		if(!cells[0].isGroupArea && !cells[0].isHelpfulText){
			if(cells[0].edge){
				headerStr = wfGetLabel(15606,'出口信息');
			}else{
				headerStr = wfGetLabel(15615,'节点信息');;
			}
		}
	}
	var elDiv;
	if(document.getElementById('nodeInfo-header')){
		elDiv = document.getElementById('nodeInfo-header')
		elDiv.innerHTML = headerStr;
	}else{
		elDiv = document.createElement('div');
		elDiv.id = 'nodeInfo-header';
		elDiv.style.position = 'relative';
		elDiv.style.zIndex = '11';
		elDiv.innerHTML = headerStr;
		this.container.appendChild(elDiv);
	}
}

WfNodeInfo.prototype.refresh = function(){
	var graph = this.editorUi.editor.graph;
	var nowCell = graph.getSelectionCell();
	if(!this.editorUi.isFromWfForm){
		// if(!this.preCells || (this.preCells && nowCell && nowCell.id != this.preCells.id)){
			this.drawHeader();
			this.drawFoder();
			this.nodeActions();
		// }
	}
}
/**
 * Returns information about the current selection.
 */
WfNodeInfo.prototype.clearSelectionState = function()
{
	this.selectionState = null;
};

/**
 * Returns information about the current selection.
 */
WfNodeInfo.prototype.getSelectionState = function()
{
	if (this.selectionState == null)
	{
		this.selectionState = this.createSelectionState();
	}
	
	return this.selectionState;
};
/**
 * Returns information about the current selection.
 */
WfNodeInfo.prototype.createSelectionState = function()
{
	var cells = this.editorUi.editor.graph.getSelectionCells();
	var result = this.initSelectionState();
	
	// for (var i = 0; i < cells.length; i++)
	// {
	// 	this.updateSelectionStateForCell(result, cells[i], cells);
	// }
	
	return result;
};/**
* Returns information about the current selection.
*/
WfNodeInfo.prototype.initSelectionState = function()
{
   return {vertices: [], edges: [], x: null, y: null, width: null, height: null, style: {},
       containsImage: false, containsLabel: false, fill: true, glass: true, rounded: true,
       comic: true, autoSize: false, image: true, shadow: true, lineJumps: true};
};

WfNodeInfo.prototype.nodeActions = function(){
	var graph = this.editorUi.editor.graph;
	var _workflowDetailDatas = graph.workflowDetailDatas;
    var cells = graph.getSelectionCells();

	jQuery('.ant-dropdown').addClass('ant-dropdown-hidden');
	if(!mxClient.IS_IE && window.console != null){
		console.log(cells,'celsss');
	}
	var haveNode = false , noNodeOrLinkId = false;
	
	if(document.getElementById('nodeInfo-detail-shouldSaveFirst') != null){
		this.container.removeChild(document.getElementById('nodeInfo-detail-shouldSaveFirst'));
	}
	for(var i = 0 ; i<cells.length;++i){
		if(cells[i].isGroupArea){ //区域分组
			graph.orderCells(true)
		}
		if(cells[i] instanceof mxCell &&  cells.length==1 && !cells[i].isGroupArea && !cells[i].isHelpfulText ){ //点击选中节点 v.edge != 1 && 不是区域分组 并且有nodeId linkId(校验下nodeId为0的情况)
			if(cells[i].nodeId || cells[i].linkId){
				if(document.getElementById('nodeInfo-no-node1') != null){
					this.container.removeChild(document.getElementById('nodeInfo-no-node1'));
				}
				this.drawNodeDetail();
			}else{
				noNodeOrLinkId = true;
			}
			haveNode = true;
		}
	}
	if(!haveNode){//
		this.renderWorkdlowItem();
	}
	if(haveNode && noNodeOrLinkId){
		this.renderWorkdlowItem();
		if(document.getElementById('nodeInfo-detail-shouldSaveFirst') != null){
			var re_elP = document.getElementById('nodeInfo-detail-shouldSaveFirst');
			this.container.removeChild(re_elP);
		}
		if(document.getElementById('nodeInfo-detail-nodeLinkDetail') != null){
			var _elDiv = document.getElementById('nodeInfo-detail-nodeLinkDetail');
			_elDiv.style.display = 'none';
			// this.container.removeChild(_elDiv);
		}
		var _elP = document.createElement('p');
		_elP.id = 'nodeInfo-detail-shouldSaveFirst';
		_elP.innerHTML = wfGetLabel(390419,'温馨提示:需要先保存流程图才能对新增节点和出口进行详细属性设置!');
		this.container.appendChild(_elP);
	}
	if(!haveNode || noNodeOrLinkId){
		if(document.getElementById('nodeName-container')){
			var nodeNameContainer = document.getElementById('nodeName-container');
			if(nodeNameContainer){
				nodeNameContainer.parentNode.removeChild(nodeNameContainer)
			}
		}
	}
}

/**
创建流程名称一栏
 */
WfNodeInfo.prototype.renderWorkdlowItem = function(){
	var graph = this.editorUi.editor.graph;
	var _workflowDetailDatas = graph.workflowDetailDatas;

	var elP = document.getElementById('nodeInfo-no-node1');
	if(document.getElementById('nodeInfo-node-detail') != null){
		var _elDiv = document.getElementById('nodeInfo-node-detail');
		// this.container.removeChild(_elDiv); // 会报react minify错 找不到元素了
		_elDiv.style.display = 'none';
	}
	if(elP == null){
		elP = document.createElement('p');
		var elSpanLeft = document.createElement('span');
		var elSpanRight = document.createElement('div');
		elP.id = 'nodeInfo-no-node1';
		elP.className = 'nodeInfo-detail-item';
		elSpanLeft.className = 'detail-item-left detail-item-span';
		elSpanRight.className = 'detail-item-right detail-item-span';
		elP.appendChild(elSpanLeft);
		elP.appendChild(elSpanRight);
		
		elSpanLeft.innerHTML = wfGetLabel(81651,'路径名称');
		elSpanRight.innerHTML = _workflowDetailDatas&&_workflowDetailDatas.workflowDatas&&_workflowDetailDatas.workflowDatas.workflowName || 'workflowName';

		this.container.appendChild(elP);
	}else{
		elP.childNodes[1].innerHTML = _workflowDetailDatas&&_workflowDetailDatas.workflowDatas&&_workflowDetailDatas.workflowDatas.workflowName || 'workflowName';
	}
}
WfNodeInfo.prototype.drawNodeDetail = function(){
	var graph = this.editorUi.editor.graph;
	var view = graph.view;
	var _workflowDetailDatas = graph.workflowDetailDatas;
	var nowCell = graph.getSelectionCell();
	var nowCellState = view.getState(nowCell);
	// if(this.preCells && this.preCells.id == nowCell.id){
	// 	return;
	// }
	this.preCells = nowCell;
	var isEage = false ,//是否是连接线
		detailDatas = {} , //当前显示数据
		isCouldShow = false;//是否设置完成,在返回数据当中存在,不存在提示保存后显示

	if(nowCell.edge) isEage = true;
	
	if(nowCell.nodeId != null)  isCouldShow = true;

	if(_workflowDetailDatas != null){
		var mapDatas = null;
		if(isEage){
			mapDatas = _workflowDetailDatas.linkDatas || {};
		}else{
			mapDatas = _workflowDetailDatas.nodeDatas || {};
		}
		for(var i in mapDatas){
			if((!isEage && i == nowCell.nodeId) || (isEage && i == nowCell.linkId)){
				detailDatas = mapDatas[i];
			}
		}
	}

	if(document.getElementById('nodeInfo-node-detail') != null){
		var _elDiv = document.getElementById('nodeInfo-node-detail');
		this.container.removeChild(_elDiv);
	}

	var nodeDetailArr = [
		{label:wfGetLabel(15070,'节点名称'),value:'',key:'name'},
		{label:wfGetLabel(99,'操作者'),value:'',key:'operators'},
		{label:wfGetLabel(33473,'表单内容'),value:'',key:'formContent'},
		{label:wfGetLabel(16380,'操作菜单'),value:'',key:'hasCusRigKey'},
		{label:wfGetLabel(18009,'节点前附加操作'),value:'',key:'hasNodeBefAddOpr'},
		{label:wfGetLabel(18010,'节点后附加操作'),value:'',key:'hasNodeAftAddOpr'},
		{label:wfGetLabel(33483,'签字意见设置'),value:'',key:'hasOperateSign'},
		{label:wfGetLabel(33482,'标题显示设置'),value:'',key:'hasOperateTitle'},
		{label:wfGetLabel(21584,'子流程设置'),value:'',key:'hasOperateSubwf'},
		{label:wfGetLabel(390420,'流程异常处理'),value:'',key:'hasOperateException'},
		// {label:'节点字段校验',value:'',key:'hasNodePro'}, //暂时去掉,功能未找到
		{label:wfGetLabel(387604,'类型'),value:'',key:'changeNodeType'},
		{label:'指定流转',value:'',key:'selectNextFlow'},
	];
	if(!isEage && _workflowDetailDatas.workflowDatas.isOpenOverTime === 1 && (nowCell.nodeType == 1 || nowCell.nodeType == 2)){
		nodeDetailArr.push({label:wfGetLabel(18818,'超时设置'),value:'',key:'overtimeSet'});
	}
	if(nowCell.nodeAttriBute && (nowCell.nodeAttriBute == 3||nowCell.nodeAttriBute == 4||nowCell.nodeAttriBute == 5)){//分支合并节点
		nodeDetailArr.push(
			{label:wfGetLabel(390421,'合并类型'),value:'',key:'branchToOneType'}
		);
		nodeDetailArr.push({label:nowCell.nodeAttriBute == 5 ? wfGetLabel(390422,'通过比例(%)') : 
					nowCell.nodeAttriBute == 4 ? wfGetLabel(390423,'指定通过分支') : wfGetLabel(21396,'通过分支数合并'),
			value:'',key:'branchToOneSubType'});
	}
	var linkDetailArr = [
		{label:wfGetLabel(15611,'出口名称'),value:'',key:'name'},
		{label:wfGetLabel(15074,'目标节点'),value:'',key:'targetCell'},
		{label:wfGetLabel(20576,'生成编号'),value:'',key:'isBuildCode'},
		{label:wfGetLabel(15364,'条件'),value:'',key:'hasCondition'},
		{label:wfGetLabel(15610,'附加规则'),value:'',key:'hasRole'},
		{label:wfGetLabel(21642,'出口提示信息'),value:'',key:'remindMsg'}
	];
	if(isEage && nowCell.source && nowCell.source.nodeType == '1'){//添加审批节点退回操作(出口 && 起始点是审批节点)
		linkDetailArr.splice(2,0,{label:wfGetLabel(15075,'是否退回'),value:'',key:'linkNeedBack'});
	}
	if(!isEage && _workflowDetailDatas.workflowDatas.isModifyLog){//添加一个查看签字意见范围
		nodeDetailArr.splice(9,0,{label:wfGetLabel(33485,'表单日志查看范围'),value:'',key:'formLogViewRange'});
	}

	if(!isEage && _workflowDetailDatas.workflowDatas.isSecondAuth){		//二次认证设置
		nodeDetailArr.push({label : wfGetLabel(506288,'二次认证设置'),value:'',key:'hasSecondAuth'});
	}
	var labelShowDatas = isEage ? linkDetailArr : nodeDetailArr;
	var elDiv = document.createElement('div');
	elDiv.id = 'nodeInfo-node-detail';

	var elNodeLinkDetail;
	elNodeLinkDetail = document.createElement('div');
	elNodeLinkDetail.id = 'nodeInfo-detail-nodeLinkDetail';
	for(var i = 0 ; i<labelShowDatas.length;++i){
		var item = this.createNodeItem(isEage,labelShowDatas[i],detailDatas,nowCell);
		item&&elNodeLinkDetail.appendChild(item);
	}
	elDiv.appendChild(elNodeLinkDetail);
	this.container.appendChild(elDiv);
	jQuery('#nodeInfo-detail-nodeLinkDetail').bind('scroll',function(e){
		jQuery('#nodeName-container').css('top',47 - jQuery('#nodeInfo-detail-nodeLinkDetail').scrollTop());
	})
}
/**
创建节点信息 || 出口信息的每项信息
 */
WfNodeInfo.prototype.createNodeItem = function(isEage,v,detailDatas,nowCell){
	var elP = document.createElement('p');
	var elSpanLeft = document.createElement('span');
	var elSpanRight = document.createElement('div');

	elP.className = 'nodeInfo-detail-item';
	elSpanLeft.className = 'detail-item-left detail-item-span';
	elSpanRight.className = "detail-item-right detail-item-span "+(
		v.key === 'operators' || v.key === 'name' || v.key === 'targetCell' || v.key === 'isBuildCode' ||
		 v.key === 'remindMsg' || v.key === 'changeNodeType' || v.key === 'branchToOneType' || v.key === 'branchToOneSubType' 
		   ? 'isEcComs-item':'');
	/**
	//类型:处理和审批类型互换 1审批 2  处理
	/类型单独判断
	
	*/
	if(v.key === 'changeNodeType'){
		if(nowCell.nodeType == 1 || nowCell.nodeType == 2 || nowCell.nodeAttriBute==1 || nowCell.nodeAttriBute==2 ||
		(nowCell.nodeType == 3 &&(nowCell.nodeAttriBute==3 || nowCell.nodeAttriBute==4 || nowCell.nodeAttriBute==5))){
			var operatorArea = document.createElement('div');
			operatorArea.id = 'changeNodeType-container';
			elSpanRight.appendChild(operatorArea);

			var _sb = this;
			setTimeout(function() {
				_sb.createChangeNodeTypeElement(isEage,v.key,detailDatas,nowCell);
			}, 0);
		}else{
			return false;
		}
	}
	// 
	if(v.key === 'name'){//节点名称 ||  出口名称
		var operatorArea
		if(document.getElementById('nodeName-container')){
			operatorArea = document.getElementById('nodeName-container');
			operatorArea.style.display = 'block';
			operatorArea.style.top = '47px';
		}else{
			operatorArea = document.createElement('div');
			operatorArea.id = 'nodeName-container';
			// elSpanRight.appendChild(operatorArea);
			operatorArea.style.position = 'absolute';
			operatorArea.style.zIndex = '10';
			operatorArea.style.top = '47px';
			operatorArea.style.right = '10px';
			operatorArea.style.width = '110px';
			// document.body.appendChild(operatorArea);
			this.container.appendChild(operatorArea);
		}
		if(this.nodePanelHide){
			operatorArea.style.visibility = 'hidden';
		}
		var _sb = this;
		setTimeout(function() {
			_sb.createNodeNameElement(isEage,v.key,detailDatas,nowCell);
		}, 0);

	}else if(v.key === 'operators'){ //操作者
		var operatorArea = document.createElement('div');
		operatorArea.id = 'operators-container';
		elSpanRight.appendChild(operatorArea);

		var _sb = this;
		setTimeout(function(){
			_sb.createOperatorElement(isEage,v.key,detailDatas,nowCell);
		}, 0);
	}else if(v.key === 'branchToOneType'){ //合并类型 (分叉合并节点)
		var branchToOneTypeArea = document.createElement('div');
		branchToOneTypeArea.id = 'branchToOneType-container';
		elSpanRight.appendChild(branchToOneTypeArea);

		var _sb = this;
		setTimeout(function() {
			_sb.createBranchToOneTypeElement(isEage,v.key,detailDatas,nowCell);
		}, 0);
	}else if(v.key === 'branchToOneSubType'){ //合并类型 子项详细设置(分叉合并节点)
		var branchToOneSubType = document.createElement('div');
		branchToOneSubType.id = 'branchToOneSubType-container';
		elSpanRight.appendChild(branchToOneSubType);

		var _sb = this;
		setTimeout(function() {
			_sb.createBranchToOneTypeSubElement(isEage,v.key,detailDatas,nowCell);
		}, 0);
	}else if(v.key === 'targetCell'){//出口-目标节点
		var operatorArea = document.createElement('div');
		operatorArea.id = 'targetCell-container';
		elSpanRight.appendChild(operatorArea);

		var _sb = this;
		setTimeout(function() {
			_sb.createTargetNodeElement(isEage,v.key,detailDatas,nowCell);
		}, 0);
	}else if(v.key === 'isBuildCode'){//出口-生成编号
		var operatorArea = document.createElement('div');
		operatorArea.id = 'isBuildCode-container';
		elSpanRight.appendChild(operatorArea);

		var _sb = this;
		setTimeout(function() {
			_sb.createBuildCodeElement(isEage,v.key,detailDatas,nowCell);
		}, 0);
	}else if(v.key === 'linkNeedBack'){//出口-审批-是否退回
		var operatorArea = document.createElement('div');
		operatorArea.id = 'linkNeedBack-container';
		elSpanRight.appendChild(operatorArea);

		var _sb = this;
		setTimeout(function() {
			_sb.createLinkNeedBackElement(isEage,v.key,detailDatas,nowCell);
		}, 0);
	}else if(v.key === 'remindMsg'){//出口-出口提示信息
		var operatorArea = document.createElement('div');
		operatorArea.id = 'remindMsg-container';
		elSpanRight.appendChild(operatorArea);

		var _sb = this;
		setTimeout(function(){
			_sb.createRemindMsgElement(isEage,v.key,detailDatas,nowCell);
		}, 0);
	}else if(v.key === 'formContent'){//节点-表单内容
		var formContentArea = document.createElement('a');
		formContentArea.innerHTML = detailDatas[v.key];
		// formContentArea.className = 'icon-workflow-shezhi';
		formContentArea.onclick = this.createDetailDialog.bind(this,v.key,v.label,nowCell.nodeId?nowCell.nodeId:nowCell.linkId,'','',isEage);
		elSpanRight.appendChild(formContentArea);
	}else{
		if(v.key !== 'changeNodeType'){
			var checkSpanIcon = document.createElement('span');
			checkSpanIcon.className = 'icon-workflow-shezhi';
			checkSpanIcon.onclick = this.createDetailDialog.bind(this,v.key,v.label,nowCell.nodeId?nowCell.nodeId:nowCell.linkId,'','',isEage);
			elSpanRight.appendChild(checkSpanIcon);
			if(detailDatas[v.key] == 'true' || v.key == 'formLogViewRange'){//已经设置打√
				var checkSpanIcon = document.createElement('span');
				checkSpanIcon.className = 'icon-workflow-duigou';
				elSpanRight.appendChild(checkSpanIcon);
			}
		}
	}
	
	elSpanLeft.innerHTML = v.label;

	elP.appendChild(elSpanLeft);
	elP.appendChild(elSpanRight);

	return elP;
}
/**
合并节点,分叉合并类型
 */
WfNodeInfo.prototype.createBranchToOneTypeElement = function(isEage,key,detailDatas,nowCell){
	
	var graph = this.editorUi.editor.graph;
	var model = graph.model;
	var WeaSelect = window.ecCom.WeaSelect;
	//(nowCell.nodeAttriBute == 3||nowCell.nodeAttriBute == 4||nowCell.nodeAttriBute == 5)
	var selectOptions = [
		{key: "3",selected: nowCell.nodeAttriBute == 3,showname: wfGetLabel(390424,'通过分支数')},
		{key: "4",selected: nowCell.nodeAttriBute == 4,showname: wfGetLabel(390423,'指定通过分支')},
		{key: "5",selected: nowCell.nodeAttriBute == 5,showname: wfGetLabel(126603,'比例合并')},
	]
	var sb = this;
	var edges = nowCell.edges || [] , typeComsViewAttr = 2;
	for(var i = 0 ; i<edges.length;++i){
		if(edges[i].linkId == null || edges[i].linkId == undefined || edges[i].linkId == ''){
			typeComsViewAttr = 1;
		}
	}
	
	ReactDOM.render(
		React.createElement(WeaSelect,
		{
			viewAttr:typeComsViewAttr,
			options:selectOptions,
			onChange:function(value, showname){
				nowCell.nodeAttriBute = value;
				sb.refresh();
			}
		}),
		document.getElementById("branchToOneType-container")
	);
}
/**
合并节点,分叉合并类型 子项的设置详细设置项
 */
WfNodeInfo.prototype.createBranchToOneTypeSubElement = function(isEage,key,detailDatas,nowCell){
	
	var graph = this.editorUi.editor.graph;
	var model = graph.model;
	var WeaSelect = window.ecCom.WeaSelect;
	var WeaInput = window.ecCom.WeaInput;
	// nowCell.edges &&  //(nowCell.nodeAttriBute == 3||nowCell.nodeAttriBute == 4||nowCell.nodeAttriBute == 5)
	var selectOptions = [];
	if(nowCell.nodeAttriBute == 4 && nowCell.edges && nowCell.edges.length>0){
		var edges = nowCell.edges;
		for(var i = 0 ; i<edges.length;++i){
			if(edges[i].target.id == nowCell.id){
				var obj = {key:edges[i].id,selected: false,showname: edges[i].value || (wfGetLabel(15587,'出口')+edges[i].id)};
				selectOptions.push(obj);
			}
		}
	}
	if(nowCell.nodeAttriBute == 4 && nowCell.targetBranchValue && nowCell.targetBranchValue.indexOf('link_')>-1){//初次从后端返回的value : link_1,link_2,link_3
		var valArr = nowCell.targetBranchValue.split(',');
		var linkIds = [];
		for(var i = 0 ; i<valArr.length;++i){
			linkIds.push(Number(valArr[i].split('_')[1]));
		}
		var xmlIds = [];

		var view = graph.view;
		var scale = view.scale;
		var startX = graph.minimumGraphSize.x || 0;
		var startY = graph.minimumGraphSize.y || 0;
		var graphWidth = graph.minimumGraphSize.width * scale || 100000;
		var graphHeight = graph.minimumGraphSize.height * scale || 100000;

		var allCells = graph.getAllCells(startX,startY,graphWidth,graphHeight);

		for(var i = 0 ; i<allCells.length;++i){
			if(allCells[i].edge && linkIds.indexOf(Number(allCells[i].linkId))>-1){//是edge,并且linkId存在targetBranchValue内
				xmlIds.push(allCells[i].id);
			}
		}
		nowCell.targetBranchValue = xmlIds.join(',');
	}

	var edges = nowCell.edges || [] , typeComsViewAttr = 2;
	for(var i = 0 ; i<edges.length;++i){
		if(edges[i].linkId == null || edges[i].linkId == undefined || edges[i].linkId == ''){
			typeComsViewAttr = 1;
		}
	}

	var nowComs = nowCell.nodeAttriBute == 4 ? WeaSelect : WeaInput;
	var nowParams = nowCell.nodeAttriBute == 4 ? {
		multiple : true,
		viewAttr:typeComsViewAttr,
		value:nowCell.targetBranchValue || '',
		options:selectOptions,
		onChange:function(value, showname){
			nowCell.targetBranchValue = value;
		}
	} : {//通过分支数和比例合并组件参数
		viewAttr:typeComsViewAttr,
		value:nowCell.nodeAttriBute == 3 ? (nowCell.passBranchNum || '0') : (nowCell.proportMerge || '0'),
		onChange:function(value){
			value > 100 ? value = 100 : '';
			nowCell.nodeAttriBute == 3 ? nowCell.passBranchNum = value : nowCell.proportMerge = value ;
		}
	};
	ReactDOM.render(
		React.createElement(nowComs,nowParams),
		document.getElementById("branchToOneSubType-container")
	);
}
/**
类型切换:处理-审批(分叉其实点多一个 创建 选项;合并节点多一个 归档 选项)
1审批 2  处理
 */
WfNodeInfo.prototype.createChangeNodeTypeElement = function(isEage,key,detailDatas,nowCell){
	var graph = this.editorUi.editor.graph;
	var model = graph.model;
	var WeaSelect = window.ecCom.WeaSelect;

	var view = graph.view;
	var scale = view.scale;
	var startX = graph.minimumGraphSize.x || 0;
	var startY = graph.minimumGraphSize.y || 0;
	var graphWidth = graph.minimumGraphSize.width * scale || 100000;
	var graphHeight = graph.minimumGraphSize.height * scale || 100000;

	var allCells = graph.getAllCells(startX,startY,graphWidth,graphHeight);

	var options = [
		{key:'2',selected:nowCell.nodeType==2,showname:wfGetLabel(553,'处理')},
		{key:'1',selected:nowCell.nodeType==1,showname:wfGetLabel(83518,'审批')},
		];
	if(nowCell.nodeAttriBute == 1){//分叉起始点
		options.unshift({key:'0',selected:nowCell.nodeType==0,showname:wfGetLabel(125,'创建')});
	}else if(nowCell.nodeAttriBute == 3 || nowCell.nodeAttriBute == 4 || nowCell.nodeAttriBute == 5){//合并节点 3 通过分支数,4指定分支,5比例合并
		options.unshift({key:'3',selected:nowCell.nodeType==3,showname:wfGetLabel(251,'归档')});
	}
	var edges = nowCell.edges || [] , typeComsViewAttr = 2;
	for(var i = 0 ; i<edges.length;++i){
		if(edges[i].linkId == null || edges[i].linkId == undefined || edges[i].linkId == ''){
			typeComsViewAttr = 1;
		}
	}
	ReactDOM.render(
		React.createElement(WeaSelect,
		{
			viewAttr:typeComsViewAttr,
			options:options,
			onChange:function(value, showname){
				var haveStartNode = false;
				for(var i = 0 ; i<allCells.length;++i){
					if(!allCells[i].edge && allCells[i].nodeType == 0){
						haveStartNode = true;
					}
				}
				if(haveStartNode && value == 0){
					wfModal.warning({
						title: wfGetLabel(131329, "信息确认"),
						content:wfGetLabel(390412, "只能有一个创建节点!"),
						okText: wfGetLabel(83446, "确定"),
						onOk:function(){},
					});
				}else{
					
					var newStyle = '';
					// var nowGeometry = nowCell.geometry;
					var nowGeometry = new mxGeometry(nowCell.geometry.x,nowCell.geometry.y,nowCell.geometry.width,nowCell.geometry.height);
					model.beginUpdate();
					try
					{
						if(value == 1 && nowCell.nodeType!=1){//审批
							nowCell.style.indexOf('rounded=0;') != -1 ? newStyle = nowCell.style.replace(/rounded=0;/,'rhombus;') : 
							nowCell.style.indexOf('shape=ellipse;') != -1 ? newStyle = nowCell.style.replace(/shape=ellipse;/,'rhombus;') : '';
							var arr = newStyle.split(';');
							nowGeometry.height = 100;
							nowGeometry.width = 110;

							for(var i = 0 ; i<arr.length;++i){
								if((arr[i].indexOf('icon-workflow-ceshi')>=0 && arr[i].indexOf('icon-workflow-fencha')>=0) || 
									(arr[i].indexOf('icon-workflow-tingzhi')>=0 && arr[i].indexOf('icon-workflow-hebing')>=0)){
									var obj = JSON.parse(arr[i].split('=')[1]);
									delete obj.right;
									arr[i] = "icons="+JSON.stringify(obj);
								}
							}
						}else if(value == 2 && nowCell.nodeType!=2){
							nowGeometry.height = 70;
							nowGeometry.width = 108;

							nowCell.style.indexOf('rhombus;') != -1 ? newStyle = nowCell.style.replace(/rhombus;/,'rounded=0;') : 
							nowCell.style.indexOf('shape=ellipse;') != -1 ? newStyle = nowCell.style.replace(/shape=ellipse;/,'rounded=0;') : '';
							var arr = newStyle.split(';');
							for(var i = 0 ; i<arr.length;++i){
								if((arr[i].indexOf('icon-workflow-ceshi')>=0 && arr[i].indexOf('icon-workflow-fencha')>=0) || 
									(arr[i].indexOf('icon-workflow-tingzhi')>=0 && arr[i].indexOf('icon-workflow-hebing')>=0)){
									var obj = JSON.parse(arr[i].split('=')[1]);
									delete obj.right;
									arr[i] = "icons="+JSON.stringify(obj);
								}
							}
						}else if(value == 0 && nowCell.nodeType!=0){//创建
							nowGeometry.height = 93;
							nowGeometry.width = 93;
							nowCell.style.indexOf('rounded=0;') != -1 ? newStyle = nowCell.style.replace(/rounded=0;/,'shape=ellipse;') : 
							nowCell.style.indexOf('rhombus;') != -1 ? newStyle = nowCell.style.replace(/rhombus;/,'shape=ellipse;') : '';
							
							var arr = newStyle.split(';');
							for(var i = 0 ; i<arr.length;++i){
								if(arr[i].indexOf('icons')>=0){
									var obj = JSON.parse(arr[i].split('=')[1]);
									obj['left'] = 'icon-workflow-fencha';
									obj['right'] = 'icon-workflow-ceshi';
									arr[i] = "icons="+JSON.stringify(obj);
								}
							}
						}else if(value == 3 && nowCell.nodeType!=3){//归档
							nowGeometry.height = 93;
							nowGeometry.width = 93;
							nowCell.style.indexOf('rounded=0;') != -1 ? newStyle = nowCell.style.replace(/rounded=0;/,'shape=ellipse;') : 
							nowCell.style.indexOf('rhombus;') != -1 ? newStyle = nowCell.style.replace(/rhombus;/,'shape=ellipse;') : '';
							var arr = newStyle.split(';');
							for(var i = 0 ; i<arr.length;++i){
								if(arr[i].indexOf('icons')>=0){
									var obj = JSON.parse(arr[i].split('=')[1]);
									obj['left'] = 'icon-workflow-hebing';
									obj['right'] = 'icon-workflow-tingzhi';
									arr[i] = "icons="+JSON.stringify(obj);
								}
							}
							
						}
						// nowCell.nodeType = value;
						model.setNodeType(nowCell,value);
						// nowCell.setAttribute('nodeType',value);
						model.setStyle(nowCell, arr.join(';'));
						model.setGeometry(nowCell, nowGeometry);
					}
					finally
					{
						model.endUpdate();
						// graph.refresh();
					}
				}
				
			}
		}),
		document.getElementById("changeNodeType-container")
	);
}
/**
创建出口-目标节点
 */
WfNodeInfo.prototype.createTargetNodeElement = function(isEage,key,detailDatas,nowCell){
	
	var graph = this.editorUi.editor.graph;
	var model = graph.model;
	var WeaSelect = window.ecCom.WeaSelect;

	var view = graph.view;
	var scale = view.scale;
	var startX = graph.minimumGraphSize.x || 0;
	var startY = graph.minimumGraphSize.y || 0;
	var graphWidth = graph.minimumGraphSize.width * scale || 100000;
	var graphHeight = graph.minimumGraphSize.height * scale || 100000;

	var allCells = graph.getAllCells(startX,startY,graphWidth,graphHeight);

	var cellsExceptEdges = [];
	for(var i = 0 ; i<allCells.length;++i){
		if(!(allCells[i].isGroupArea || allCells[i].isHelpfulText)){
			if(nowCell.source.nodeAttriBute == 2 && !allCells[i].edge){//分叉中间点
				if(allCells[i].nodeAttriBute == 2 || (allCells[i].nodeAttriBute == 3 || allCells[i].nodeAttriBute == 4 || allCells[i].nodeAttriBute == 5)  ){//中间节点 || 合并节点
					cellsExceptEdges.push(allCells[i]);
				}
			}else if((nowCell.source.nodeAttriBute == 3 || nowCell.source.nodeAttriBute == 4 || nowCell.source.nodeAttriBute == 5) && !allCells[i].edge ){//合并节点
				if(allCells[i].nodeAttriBute != 2){//不能是分叉中间点
					cellsExceptEdges.push(allCells[i]);
				}
			}
			else{
				if(!allCells[i].edge){//&& allCells[i].nodeAttriBute != 2
					if(allCells[i].nodeAttriBute == 2){
						(nowCell.source.nodeAttriBute == 2 || nowCell.target.nodeAttriBute == 2) && cellsExceptEdges.push(allCells[i]);;
					}else{
						cellsExceptEdges.push(allCells[i]);
					}
				}
			}
		}
	}
	
	var selectOptions = [];
	for(var i = 0 ; i<cellsExceptEdges.length;++i){
		var obj = {};
		obj['key'] = ''+cellsExceptEdges[i].id;
		obj['selected'] = cellsExceptEdges[i].id == nowCell.target.id ? true : false;
		obj['showname'] = wfFormatMultiLang(cellsExceptEdges[i].value);
		selectOptions.push(obj);
	}
	var sb = this;
	ReactDOM.render(
		React.createElement(WeaSelect,
		{
			options:selectOptions,
			onChange:function(value, showname){
				wfModal.confirm({
					title: wfGetLabel(131329, "信息确认"),
					content:wfGetLabel(390408, "确定要将出口:")+nowCell.value+wfGetLabel(390409, "的目标节点从")+nowCell.target.value+wfGetLabel(21623, "改为")+showname+wfGetLabel(82179, "吗?"),
					okText: wfGetLabel(83446, "确定"),
					cancelText: wfGetLabel(31129, "取消"),
					onOk:function(){
						var selectItem = [];
						for(var i = 0 ; i<cellsExceptEdges.length;++i){
							if(cellsExceptEdges[i].id == value){
								selectItem.push(cellsExceptEdges[i]);
							}
						}
						model.beginUpdate();
						try
						{
							graph.cellConnected(nowCell,selectItem[0],false,{name:'',perimeter:true,point:{x:0,y:0.5}});
						}
						finally
						{
							model.endUpdate();
						}
					},
					onCancel:function(){sb.refresh();}
				});
				
			}
		}),
		document.getElementById("targetCell-container")
	);
}
/**
创建出口-是否退回
 */
WfNodeInfo.prototype.createLinkNeedBackElement = function(isEage,key,detailDatas,nowCell){
	
	var graph = this.editorUi.editor.graph;
	var model = graph.model;
	var WeaCheckbox = window.ecCom.WeaCheckbox;

	ReactDOM.render(
		React.createElement(WeaCheckbox,
		{
			value:nowCell.isreject?nowCell.isreject:false,
			onChange:function(v){
				nowCell.isreject = v;
			}
		}),
		document.getElementById("linkNeedBack-container")
	);
}
/**
创建出口-生成编号
 */
WfNodeInfo.prototype.createBuildCodeElement = function(isEage,key,detailDatas,nowCell){
	
	var graph = this.editorUi.editor.graph;
	var model = graph.model;
	var WeaCheckbox = window.ecCom.WeaCheckbox;

	ReactDOM.render(
		React.createElement(WeaCheckbox,
		{
			value:nowCell.isBuildCode?nowCell.isBuildCode:detailDatas[key] == 'true' ? true : false,
			onChange:function(v){
				nowCell.isBuildCode = v;
			}
		}),
		document.getElementById("isBuildCode-container")
	);
}
/**
创建出口-出口提示信息
 */
WfNodeInfo.prototype.createRemindMsgElement = function(isEage,key,detailDatas,nowCell){
	
	var graph = this.editorUi.editor.graph;
	var model = graph.model;
	var WeaInput = window.ecCom.WeaInput;

	ReactDOM.render(
		React.createElement(WeaInput,
		{
			viewAttr:2,
			value:nowCell.exitInfo  ? nowCell.exitInfo  : detailDatas[key] ,
			inputType:"multilang",
			isBase64:true,
			layout:document.getElementById("remindMsg-container"),
			onBlur:function(v){
				nowCell.exitInfo = v;
			}
			
		}),
		document.getElementById("remindMsg-container")
	);
}
/**
创建节点名称元素
 */
WfNodeInfo.prototype.noNeedRefresh = false;//修改名称时 不刷新,刷新会将当前dom结构清楚 会出现一些问题
WfNodeInfo.prototype.createNodeNameElement = function(isEage,key,detailDatas,nowCell){
	
	var graph = this.editorUi.editor.graph;
	var model = graph.model;
	var WeaInput = window.ecCom.WeaInput;
	var sb = this;

	if(isEage && (!nowCell.value)){
		nowCell.value = wfGetLabel(15587, "出口")+nowCell.id; //给出口添加默认名称
	}
	ReactDOM.render(
		React.createElement(WeaInput,
		{
			viewAttr:3,
			value:nowCell.value ?  nowCell.value : detailDatas[key] ,
			inputType:"multilang",
			isBase64:true,
			layout:document.getElementById("nodeName-container"),
			customBlur : function(v){
				// sb.noNeedRefresh = true;
				var newValue = v;
				if(wfFormatMultiLang(v).trim() == ''){
					wfModal.warning({
						title: wfGetLabel(131329, "信息确认"),
						content:isEage?wfGetLabel(390417, "当前语言出口名称不能为空!"):wfGetLabel(390418, "当前语言节点名称不能为空!"),
						okText: wfGetLabel(83446, "确定"),
						onOk:function(){
							jQuery('#nodeName-container .ant-input').val(wfFormatMultiLang(nowCell.value));
						},
					});
				}else{
					model.beginUpdate();
					try
					{
						model.setValue(nowCell,v);
					}
					finally
					{
						model.endUpdate();
					}
				}
				
			},
			onBlur:function(v){
				
			},
			ref:function(ref){sb.nodeNameRef = ref}
		}),
		document.getElementById("nodeName-container")
	);
}
/**
创建操作者元素
 */
WfNodeInfo.prototype.createOperatorElement = function(isEage,key,detailDatas,nowCell){
	var browserComs = window.ecCom.WeaBrowser;
	for(var i = 0 ; i < detailDatas.operatorGroups.length;++i){
		detailDatas.operatorGroups[i].name = 
		// `<a onclick="window.workflowUi.wfNodeInfo.createDetailDialog('operator','操作组',${nowCell.nodeId},${nowCell.nodeType},${detailDatas.operatorGroups[i].id},${nowCell}")>${wfFormatMultiLang(detailDatas.operatorGroups[i].name)}</a>`
		'<a onclick="window.workflowUi.wfNodeInfo.createDetailDialog('+"'operator','"+wfGetLabel(15072,'操作组')+"','"+
		nowCell.nodeId+"','"+nowCell.nodeType+"','"+detailDatas.operatorGroups[i].id+"',"+isEage+')">'+
		wfFormatMultiLang(detailDatas.operatorGroups[i].name)+"</a>";//wfFormatMultiLang
	}
	var sb = this;
	ReactDOM.render(
		React.createElement(browserComs,
		{
			viewAttr : 1 ,
			hasAddBtn:true,
			isSingle:false,
			replaceDatas:detailDatas.operatorGroups || [],
			whiteBackground:true,
			hasBorder:true,
			addOnClick:function(){sb.createDetailDialog('operator',wfGetLabel(15072,'操作组'),nowCell.nodeId,nowCell.nodeType,'-1',isEage)},
			layout:document.body,
		}),
		document.getElementById("operators-container")
	);	

}
/**
*绘制折叠展开按钮
*
*/
WfNodeInfo.prototype.drawFoder = function(){
	var elDiv;
	if(document.getElementById('nodeInfo-panel-folder')){
		return;
	}else{
		elDiv = document.createElement('div');
    	elDiv.id = 'nodeInfo-panel-folder';
		elDiv.className = 'nodeInfo-panel-close';
		this.container.appendChild(elDiv);

		elDiv.onclick = this.clickNodeFolder.bind(this,elDiv);
	}

}
WfNodeInfo.prototype.clickNodeFolder = function(elt){
	var wfEditor = this.editorUi.wfEditor;
	var diagramContainer = this.editorUi.diagramContainer;
	var wfPanelContainer = this.editorUi.wfPanelContainer;
	var graph = this.editorUi.editor.graph;
	var model = graph.model;

	this.nodePanelHide = !this.nodePanelHide;
	var wfTestPanel = document.getElementById('workflow-test-detail-panel');
	var vertSplit = document.getElementById('test-panel-split');
	if(wfTestPanel){
		this.nodePanelHide ? wfTestPanel.style.width = '100%' : wfTestPanel.style.width = 'calc(100% - 250px)' ;
	}
	if(vertSplit){
		this.nodePanelHide ? vertSplit.style.right = '0' : vertSplit.style.right = '250px';
	}
	//加与不加update都一样
	// model.beginUpdate();
	try
	{
		var rowCanvas = document.getElementById('wf-row-rule-canvas');
		var	colCanvas = document.getElementById('wf-col-rule-canvas');
		var wfEditorContainer = wfEditor.container;
		if(this.nodePanelHide){//隐藏 向右移动隐藏
			if(document.getElementById("nodeName-container")){
				document.getElementById("nodeName-container").style.display = 'none';
			}

			wfEditor.container.style.width = '100%';
			wfPanelContainer.style.top = wfEditorContainer.clientHeight +'px';
			wfPanelContainer.style.width = '100%';
			rowCanvas ? rowCanvas.width = wfPanelContainer.clientWidth : '';
			
			graph.pageFormat.width = window.innerWidth-(graph.isRuleEnabled()?30:18);
			// graph.pageFormat.height = window.innerheight-(graph.isRuleEnabled()?30:18);

			this.container.style.right = '-240px';
			this.container.style.zIndex = 14;
			elt.style.left = '-18px';
			elt.className = 'nodeInfo-panel-open';
		}else{//显示 向左移动显示
			if(document.getElementById("nodeName-container")){
				document.getElementById("nodeName-container").style.display = 'block';
				document.getElementById("nodeName-container").style.visibility = 'visible';
			}
			this.container.style.zIndex = 10;
			// this.container.style.transform = 'translateX(0)';
			this.container.style.right = '0';
			elt.style.left = '-2px';
			elt.className = 'nodeInfo-panel-close';
			wfEditor.container.style.width = 'calc(100% - 240px)';
			wfPanelContainer.style.width = 'calc(100% - 240px)';
			wfPanelContainer.style.top = wfEditorContainer.clientHeight +'px';
			rowCanvas ? rowCanvas.width = wfPanelContainer.clientWidth : '';
			graph.pageFormat.width = window.innerWidth - (graph.isRuleEnabled()?270:258);
		}
		graph.pageFormat.height = (window.innerHeight - wfEditorContainer.clientHeight) - (graph.isRuleEnabled()?32:18);

		graph.refresh();
	}
	finally
	{
		// model.endUpdate();
	}
	
}
/**
创建每项设置对应弹框
*/
var workflowDesignE9_dialog,workflowDesignE9_dialog_params={};
WfNodeInfo.prototype.createDetailDialog = function(key,modalName,nodeId,nodetype,groupid,isEage){
	var WeaTools = window.ecCom.WeaTools;
	var graph = this.editorUi.editor.graph;
	var view = graph.view;
	var scale = view.scale;
	var startX = graph.minimumGraphSize.x || 0;
	var startY = graph.minimumGraphSize.y || 0;
	var graphWidth = graph.minimumGraphSize.width * scale || 100000;
	var graphHeight = graph.minimumGraphSize.height * scale || 100000;

	var allCells = graph.getAllCells(startX,startY,graphWidth,graphHeight);
	var nowCell;
	for(var i = 0 ; i < allCells.length;++i){
		if(isEage){
			if(allCells[i].edge && allCells[i].linkId == nodeId){
				nowCell = allCells[i];
				break;
			}
		}else{
			if(!allCells[i].edge && allCells[i].nodeId == nodeId ){
				nowCell = allCells[i];
				break;
			}
		}
	}
	workflowDesignE9_dialog_params = {key:key,modalName:modalName,nodetype:nodetype,groupid:groupid,nowCell:nowCell};
	if(key == 'hasRole' || key == 'hasCondition'){
		workflowDesignE9_dialog_params['linkId'] = nodeId;
	}else{
		workflowDesignE9_dialog_params['nodeId'] = nodeId;
	}
	var _workflowDetailDatas = this.editorUi.editor.graph.workflowDetailDatas;
	var isCreate = nodetype == 0 ? 1 : '';
	var curType = isEage ? nowCell.source.nodeType : '';
	/**
		*操作组 :#/main/workflowengine/path/pathSet/operatorSet?isSingle=true&workflowId=&nodeid=&nodetype=&isCreate=&groupid=-1
		*操作菜单 : #/main/workflowengine/path/pathset/perationMenuSet?nodeid=284&workflowId=81&isRoute=true&_key=2r5y2t
		*表单内容 : #/main/workflowengine/path/pathset/formcontent?nodeid=284&workflowId=81&isRoute=true&_key=6vyr0l
		*节点前附加操作 : #/main/workflowengine/path/pathSet/addInOperate?isRoute=true&workflowId=9244&nodeId=11995&ispreoperator=1
		*节点后附加操作 : #/main/workflowengine/path/pathSet/addInOperate?isRoute=true&workflowId=9244&nodeId=11995&ispreoperator=0
		*签字意见设置 : #/main/workflowengine/path/pathSet/nodeMore?_key=hsdkby&workflowId=9604&nodeId=12459&type=sign&isSingle=true
		*标题显示设置 : #/main/workflowengine/path/pathSet/nodeMore?_key=hsdkby&workflowId=9604&nodeId=12457&type=title&isSingle=true
		*子流程设置 : #/main/workflowengine/path/pathSet/nodeMore?_key=hsdkby&workflowId=9604&nodeId=12456&type=subWf&isSingle=true
		*流程异常处理 : #/main/workflowengine/path/pathSet/nodeMore?_key=hsdkby&workflowId=9604&nodeId=12458&type=exception&isSingle=true
		*表单意见查看范围 : #/main/workflowengine/path/pathSet/formLog?isSingle=true&isClose4e9=true&workflowId=9544&nodeid=12315&design=1&action=
		*
		*附加规则 : #/main/workflowengine/path/pathSet/addInOperate?isRoute=true&workflowId=9244&linkId=20015
		条件 : /formmode/interfaces/showconditionContent.jsp?design=1&rulesrc=1&formid=-953&isbill=1&linkid=26876&wfid=15406&isreject=&curtype=1
		 #/main/workflowengine/path/exportConditionSetting?rulesrc=6&formid=111&isbill=111&linkid=111&isnew=1&wfid=11&rownum=&isSinglePage=1
		
		*
		{label:'节点名称',value:'',key:'name'},
		{label:'操作者',value:'',key:'operators'},
		{label:'表单内容',value:'',key:'formContent'},
		{label:'操作菜单',value:'',key:'hasCusRigKey'},
		{label:'节点前附加操作',value:'',key:'hasNodeBefAddOpr'},
		{label:'节点后附加操作',value:'',key:'hasNodeAftAddOpr'},
		{label:'签字意见设置',value:'',key:'hasOperateSign'},
		{label:'标题显示设置',value:'',key:'hasOperateTitle'},
		{label:'子流程设置',value:'',key:'hasOperateSubwf'},
		{label:'流程异常处理',value:'',key:'hasOperateException'},
		{label:'节点字段校验',value:'',key:'hasNodePro'}

		{label:'条件',value:'',key:'hasCondition'},
		{label:'附加规则',value:'',key:'hasRole'},
		{label:'二次验证设置',value:'',key:'hasSecondAuth'},
	*/
	var workflowId = window.urlParams.workflowId || '';
	// 功能地址
	var IE_E8 = false;
	var urlObj = {
		'operator' : "#/main/workflowengine/path/pathSet/operatorSet?isSingle=true&workflowId="+workflowId+"&wfid="+workflowId+"&nodeid="+nodeId+"&nodetype="+nodetype+"&groupid="+groupid+
					"&isCreate="+isCreate+"&isClose4e9=true&formid="+_workflowDetailDatas.workflowDatas.formId+"&isbill="+_workflowDetailDatas.workflowDatas.isBill,
		'hasCusRigKey' : "#/main/workflowengine/path/pathset/perationMenuSet?nodeId="+nodeId+"&workflowId="+workflowId+"&isRoute=true&isClose4e9=true&_key=2r5y2t",
		'formContent' : "#/main/workflowengine/path/pathset/formcontent?nodeid="+nodeId+"&workflowId="+workflowId+"&isRoute=true&isClose4e9=true&_key=6vyr0l",
		'hasNodeBefAddOpr' : "#/main/workflowengine/path/pathSet/addInOperate?isRoute=true&workflowId="+workflowId+"&nodeId="+nodeId+"&ispreoperator=1&isClose4e9=true",
		'hasNodeAftAddOpr' : "#/main/workflowengine/path/pathSet/addInOperate?isRoute=true&workflowId="+workflowId+"&nodeId="+nodeId+"&ispreoperator=0&isClose4e9=true",
		'hasOperateSign' : "#/main/workflowengine/path/pathSet/nodeMore?_key=hsdkby&workflowId="+workflowId+"&nodeId="+nodeId+"&type=sign&isSingle=true&isClose4e9=true",
		'hasOperateTitle' : "#/main/workflowengine/path/pathSet/nodeMore?_key=hsdkby&workflowId="+workflowId+"&nodeId="+nodeId+"&type=title&isSingle=true&isClose4e9=true",
		'hasOperateSubwf' : "#/main/workflowengine/path/pathSet/nodeMore?_key=hsdkby&workflowId="+workflowId+"&nodeId="+nodeId+"&type=subWf&isSingle=true&isClose4e9=true",
		'hasOperateException' : "#/main/workflowengine/path/pathSet/nodeMore?_key=hsdkby&workflowId="+workflowId+"&nodeId="+nodeId+"&type=exception&isSingle=true&isClose4e9=true",
		'formLogViewRange' : "#/main/workflowengine/path/pathSet/formLog?isSingle=true&isClose4e9=true&workflowId="+workflowId+"&nodeid="+nodeId+"&design=1&action=",
		// 出口
		'hasRole' : "#/main/workflowengine/path/pathSet/addInOperate?isRoute=true&workflowId="+workflowId+"&linkId="+nodeId+"&isClose4e9=true",
		// 'hasCondition' : "/formmode/interfaces/showconditionContent.jsp?design=1&rulesrc=1&linkid="+nodeId+"&wfid="+workflowId+"&isreject=&curtype=1&formid="+_workflowDetailDatas.workflowDatas.formId+"&isbill="+_workflowDetailDatas.workflowDatas.isBill+"&isClose4e9=true"
		'hasCondition' : IE_E8?"/formmode/interfaces/showconditionContent.jsp?design=1&rulesrc=1&linkid="+nodeId+"&wfid="+workflowId+"&isreject=&curtype=1&formid="+_workflowDetailDatas.workflowDatas.formId+"&isbill="+_workflowDetailDatas.workflowDatas.isBill+"&isClose4e9=true" : 
						"#/main/workflowengine/path/exportConditionSetting?rulesrc=1&formid="+_workflowDetailDatas.workflowDatas.formId+"&isbill="+_workflowDetailDatas.workflowDatas.isBill+"&linkid="+nodeId+"&isnew=1&wfid="+
						workflowId+"&rownum=0&curtype="+curType+"&isSinglePage=1&isNeedFooter=1",
		//超时设置
		'overtimeSet' : "#/main/workflowengine/path/nodeOvertimeList?isSinglePage=1&workflowId="+workflowId+"&nodeid="+nodeId+"&isClose4e9=true",
		'selectNextFlow' : "#main/workflowengine/path/pathSet/selectNextflow?isRoute=true&nodeId="+nodeId+"&workflowId="+workflowId,
		'hasSecondAuth' : "#/main/workflowengine/path/pathSet/nodeMore?_key=hsdkby&workflowId="+workflowId+"&nodeId="+nodeId+"&type=protectionDB&isSingle=true&isClose4e9=true",
	}
	if(urlObj[key]){
		if(IE_E8){
			var url = (key == 'hasCondition' ? '' : '/spa/workflow/static4engine/engine.html')+urlObj[key];
			if(key == 'hasCondition'){//出口条件暂时用老的弹框, e9弹框弹出jsp获取window有问题,导致获取不到当前dialog id
				var dialog = new window.top.Dialog();
				dialog.currentWindow = window;
				dialog.URL = url;
				dialog.Title = wfGetLabel(18850,'出口条件设置');
				dialog.Width = 950 ;
				dialog.Height = 522;
				dialog.Drag = true;
				dialog.closeHandle = function(a){
					mxUtils.post('/api/workflow/layout/getRuleCondition', "nodelinkid="+nodeId, function(req)
					{
						var _request = req.request;
						var _response = _request.responseText;
						var _json = JSON.parse(_response);
						workflowUi.editor.graph.workflowDetailDatas.linkDatas[nodeId]['hasCondition'] = _json.allcondition ? 'true' : 'false';
						nowCell.linkConditionInfo = _json.allcondition || '';
						workflowUi.wfNodeInfo.refresh();
					})
				};
				dialog.callback = function(datas){
				}
				dialog.show();
			}else{
				workflowDesignE9_dialog = WeaTools.createDialog({
					title: key == 'hasCondition' ? (wfGetLabel(18850,'出口条件设置')+'('+nowCell.value+')') : (modalName || 'test'),
					moduleName: "workflow",
					url: url,
					style: {width:950, height:522},
					callback: function(datas){
						jQuery('.ant-message').remove();
						jQuery('.ant-modal-mask');
					},
					onCancel: function(){
						wfMessage.destroy();
						jQuery('.ant-message').remove();
						jQuery('.ant-modal-mask');
						// jQuery('.ant-modal-mask').eq(0).removeClass('ant-modal-mask-hidden');
					}
				});
				workflowDesignE9_dialog.show();
			}
		}else{
			var url = '/spa/workflow/static4engine/engine.html'+urlObj[key];
			workflowDesignE9_dialog = WeaTools.createDialog({
				title: key == 'hasCondition' ? (wfGetLabel(18850,'出口条件设置')+'('+nowCell.value+')') : (modalName || 'test'),
				moduleName: "workflow",
				url: url,
				style: {width: key == 'hasCondition' ? 936 : 950, height:key == 'hasCondition' ? 560 : 522},
				callback: function(datas){
					jQuery('.ant-message').remove();
					jQuery('.ant-modal-mask');
				},
				onCancel: function(){
					wfMessage.destroy();
					jQuery('.ant-message').remove();
					jQuery('.ant-modal-mask');
					// jQuery('.ant-modal-mask.fade-leave.fade-leave-active')[0].remove();
					// jQuery('.ant-modal-mask').eq(0).removeClass('ant-modal-mask-hidden');
					window.top.jQuery('.ant-modal-mask.fade-leave.fade-leave-active')[0].remove();
				}
			});
			workflowDesignE9_dialog.show();
		}
	}
}
/**
*关闭e9弹框的回调
 */
function workflowDesign_callback(key,returnVal,needSyncNodes){
	// console.log(key,returnVal,needSyncNodes,'key,returnVal,needSyncNodes',workflowDesignE9_dialog_params);
	jQuery('.ant-message').remove();
	jQuery('.ant-modal-mask');
	wfMessage.destroy();

	var isNode = true , id;
	if(workflowDesignE9_dialog_params.hasOwnProperty('linkId')){
		isNode = false;
		id = workflowDesignE9_dialog_params.linkId;
	}else{
		id = workflowDesignE9_dialog_params.nodeId;
	}
	if(key == 'operator'){//操作者
		var workflowId = window.urlParams.workflowId || '';
		mxUtils.post(WORKFLOW_GETDETAILINFO_PATH, "workflowId="+workflowId, function(req)
			{
				var request = req.request;
				var response = request.responseText;
				var json = JSON.parse(response);
				workflowUi.editor.graph.workflowDetailDatas = json;
				workflowUi.wfNodeInfo.refresh();
			}
		)
	}else{
		var workflowDetailDatas = workflowUi.editor.graph.workflowDetailDatas;
		if(key == 'showpreaddinoperate'){//节点前附加操作
			workflowDetailDatas.nodeDatas[id]['hasNodeBefAddOpr'] = returnVal;
			var nowCell = workflowDesignE9_dialog_params['nowCell'];
			checkIsChangCellIcon(nowCell,returnVal,'beforeNode');
		}else if(key == 'showaddinoperate_node'){//节点后附加操作
			workflowDetailDatas.nodeDatas[id]['hasNodeAftAddOpr'] = returnVal;
			var nowCell = workflowDesignE9_dialog_params['nowCell'];
			checkIsChangCellIcon(nowCell,returnVal,'nodeAfter');
		}else if(key == 'showNodeAttrOperate_sign'){//签字意见设置
			workflowDetailDatas.nodeDatas[id]['hasOperateSign'] = returnVal;
		}else if(key == 'showNodeAttrOperate_title'){//标题显示设置
			workflowDetailDatas.nodeDatas[id]['hasOperateTitle'] = returnVal;
		}else if(key == 'showNodeAttrOperate_subWorkflow'){//子流程设置
			workflowDetailDatas.nodeDatas[id]['hasOperateSubwf'] = returnVal;
		}else if(key == 'showNodeAttrOperate_exceptionhandle'){//流程异常处理
			workflowDetailDatas.nodeDatas[id]['hasOperateException'] = returnVal;
		}else if(key == 'formContent'){//表单内容
			workflowDetailDatas.nodeDatas[id]['formContent'] = returnVal;
		}else if(key == 'showButtonNameOperate'){//操作菜单
			workflowDetailDatas.nodeDatas[id]['hasCusRigKey'] = returnVal;
		}else if(key == 'showaddinoperate_link'){//出口附加规则
			workflowDetailDatas.linkDatas[id]['hasRole'] = returnVal;
		}else if(key == 'hasCondition'){//出口条件
			workflowDetailDatas.linkDatas[id]['hasCondition'] = returnVal != '' ? 'true' : 'false';
		}else if(key == 'overtimeSet'){//超时设置
			workflowDetailDatas.nodeDatas[id]['overtimeSet'] = returnVal ? 'true' : 'false';
		}else if(key == 'selectNextFlow'){//指定流转
			workflowDetailDatas.nodeDatas[id]['selectNextFlow'] = returnVal ? 'true' : 'false';
		}else if(key == 'hasSecondAuth'){	//二次验证设置
			workflowDetailDatas.nodeDatas[id]['hasSecondAuth'] = returnVal;
		}
		workflowUi.editor.graph.workflowDetailDatas = workflowDetailDatas;

		workflowUi.wfNodeInfo.refresh();
	}
	key != 'formContent' && key != 'overtimeSet' && workflowDesignE9_dialog && workflowDesignE9_dialog.close();
}
function checkIsChangCellIcon(cell,returnVal,pos){
	var graph = workflowUi.editor.graph;
	var model = graph.model;
	
	var newStyle = cell.style,cellStyle = cell.style;
		model.beginUpdate();
		try
		{
			if(returnVal == 'true' && cellStyle.indexOf('icons=')<0){
				newStyle = cellStyle + 'icons={"'+pos+'":'+(pos=='beforeNode'?'"icon-workflow-caozuoqian"':'"icon-workflow-caozuohou"')+"};";
			}else if(returnVal =='false' && cellStyle.indexOf('icons=')>-1){
				var arr = cellStyle.split(';');
				for(var i = 0 ; i < arr.length;++i){
					if(arr[i].indexOf('icons=') >-1 ){
						//v= ic
						var iconObj = JSON.parse(arr[i].split('=')[1]);
						for(var key in iconObj){
							if(key == pos){
								delete iconObj[key];
							}
						}
						if(Object.keys(iconObj).length == 0){
							arr.splice(i,1);
						}else{
							arr[i] = "icons="+JSON.stringify(iconObj);
						}
					}
				}
				newStyle = arr.join(';');
			}else if(returnVal == 'true' && cellStyle.indexOf('icons=')>-1){//两个icon需同时存在
				var arr = cellStyle.split(';');
				for(var i = 0 ; i < arr.length;++i){
					if(arr[i].indexOf('icons=') >-1 ){
						var iconObj = JSON.parse(arr[i].split('=')[1]);
						iconObj[pos] = (pos=='beforeNode'?'icon-workflow-caozuoqian':'icon-workflow-caozuohou');
						arr[i] = "icons="+JSON.stringify(iconObj);
						
					}
				}
				newStyle = arr.join(';');
			}
			model.setStyle(cell, newStyle);
		}
		finally
		{
			model.endUpdate();
			graph.refresh();
		}
	// }
}