66be021f661469d0d790d4f602d08212993059d6.svn-base 34.5 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
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>自然幢信息管理</title>
<meta name="decorator" content="default" />
<script src="${ctxStatic}/gis/js/init.js" type="text/javascript"></script>
<script src="${ctxStatic}/gis/lib/OpenLayers.js" type="text/javascript"></script>
<script src="${ctxStatic}/gis/lib/zdclient.js" type="text/javascript"></script>
<script src="${ctxStatic}/gis/lib/jquery.orbit-1.2.3.js"
	type="text/javascript"></script>
<script src="${ctxStatic}/gis/js/global.js" type="text/javascript"></script>
<script src="${ctxStatic}/gis/js/config.js" type="text/javascript"></script>
<script src="${ctxStatic}/select3/Area.js" type="text/javascript"></script>
<script src="${ctxStatic}/select3/AreaData_min.js"
	type="text/javascript"></script>
<link href="${ctxStatic}/gis/lib/jqueryEasyui/easyui.css"
	rel="stylesheet" type="text/css" />
<link href="${ctxStatic}/gis/lib/jqueryEasyui/icon.css" rel="stylesheet"
	type="text/css" />
<script src="${ctxStatic}/gis/lib/jqueryEasyui/jquery.easyui.min.js"
	type="text/javascript"></script>
<script type="text/javascript">
	  var mapreturnvale;
	  var mapreturnvaleList;
	  var regBaseZbinfoRowIdx = 0;
	  var tempdjq,tempdjzq,tempxzq;
	  var ZBArray = new Array();
	  var ZBYXArray = new Array();
	  var zblisttemp="";
	  var daoru="";
	  var zdjbxxvalue;
	  var lcxxvalue;
	  var chxxvalue;
	  var fid;
	  var zbxx,xmid,yts;
	  var temptuceng,TempTUceng;
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交,请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误,请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
					regBaseZbinfoRowIdx = 0; regBaseZbinfoTpl = $("#regBaseZbinfoZrzTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
 					var data = ${fns:toJson(regBaseZrzchxx.regBaseZbinfoZrzList)};
				   
				    for (var i=0; i<data.length; i++){
					  addRow('#regBaseZbinfoZrzList', regBaseZbinfoRowIdx, regBaseZbinfoTpl, data[i]);
					  regBaseZbinfoRowIdx = regBaseZbinfoRowIdx + 1;
			   }
			//initComplexArea('seachprov', 'seachcity', 'seachdistrict', area_array, sub_array, '44', '0', '0');	
			views();
		});
		function views(){
			var viewid = "${VIEWS}";
			if(viewid == undefined || viewid == null || viewid ==""){
				return;
			}
			$("input:not(:button,:submit,:hidden),select,textarea").attr("disabled","disabled");
		}
		
		function addRow(list, idx, tpl, row){
			$(list).append(Mustache.render(tpl, {
				idx: idx, delBtn: true, row: row
			}));
			$(list+idx).find("select").each(function(){
				$(this).val($(this).attr("data-value"));
			});
			for(var i=0;i<150;i++){
				$("#regBaseZbinfoZrzList"+i+"_sort").val(i+1);
				$("#regBaseZbinfoZrzList"+i+"_zbdmc").val("J"+(i+1));
			}
			
			$(list+idx).find("input[type='checkbox'], input[type='radio']").each(function(){
				var ss = $(this).attr("data-value").split(',');
				for (var i=0; i<ss.length; i++){
					if($(this).val() == ss[i]){
						$(this).attr("checked","checked");
					}
				}
			});
		}
		function delRow(obj, prefix){
			var id = $(prefix+"_id");
			var delFlag = $(prefix+"_delFlag");
			if (id.val() == ""){
				$(obj).parent().parent().remove();
			}else if(delFlag.val() == "0"){
				delFlag.val("1");
				$(obj).html("撤销删除").attr("title", "撤销删除");
				$(obj).parent().parent().addClass("error");
			}else if(delFlag.val() == "1"){
				delFlag.val("0");
				$(obj).html("删    除").attr("title", "删除");
				$(obj).parent().parent().removeClass("error");
			}
		}

		function selectTuCeng(ListTucengNO)
        {
        	var tucengValue="";
        	switch(ListTucengNO)
        	{
        	  case "A":
        		  tucengValue=actualSvrcfg.SYQZDGDBP;
        		  break;
        	  case "B":
        		  tucengValue=actualSvrcfg.SHYQZD_DB;
        		  break;
        	  case "S":
        		  tucengValue=actualSvrcfg.SHYQZD_DS;
        		  break;
        	  case "X":
        		  tucengValue=actualSvrcfg.SHYQZD_DX;
        		  break;
        	  case "C":
        		  tucengValue=actualSvrcfg.ZJDGDBP;
        		  break;
        	  case "D":
        		  tucengValue=actualSvrcfg.CBJYQZD_GD;
        		  break;
        	  case "E":
        		  tucengValue=actualSvrcfg.CBJYQZD_LD;
        		  break;
        	  case "F":
        		  tucengValue=actualSvrcfg.CBJYQZD_CD;
        		  break;
        	  case "I":
        		  break;
        	  case "J":
        		  break;
        	  default:break;
        	
        	}
        	return tucengValue;
        }		
	
		 //检查坐标是否正确
		   function checkzb(){
			   var zid='${regBaseZrz.id}';
				var tb = document.getElementById("chxxTable");
				var tempx,tempy,flag;
				console.log(ZBYXArray);
				 zblisttemp="";
				for (var i=1;i<tb.rows.length-1;i++){
					tempx = tb.rows[i].cells[3].getElementsByTagName("INPUT")[0].value;
				    tempy = tb.rows[i].cells[4].getElementsByTagName("INPUT")[0].value;
				    flag = 0;
					 //判断导入的数据格式,为文本则可导入
					  if((tempx.indexOf("E") != -1) || (tempy.indexOf("E") != -1)){
							 alert("导入的数据格式为 非文本 格式,无法导入,请修改后重新导入");
							 flag = 1;
							 var url ="${ctx}/reg/base/regBaseZrz/reimport?id="+zid;
							 window.location = url;
							 break;
							}
						 var arr = tempx.split(".");
						 var arr1 = tempy.split(".");
						 var NewIndex = 0;
						if((arr[0].length>=7)&&(arr1[0].length>=7))
					    {
								//坐标与GIS图XY坐标颠倒
							if((arr[0].length == 7)&&(arr1[0].length==8)){
							ZBArray[i-1]=tempy+","+tempx;
						    ZBYXArray[i-1]= new Zondy.Object.Point2D(parseFloat(tempy), parseFloat(tempx));	
						    zblisttemp=zblisttemp+$("#regBaseZbinfoZrzList"+(i-1)+"_zbdmc").val()+"["+$("#regBaseZbinfoZrzList"+(i-1)+"_zby").val()+","+$("#regBaseZbinfoZrzList"+(i-1)+"_zbx").val()+"] "+","+$("#regBaseZbinfoZrzList"+(i-1)+"_id").val()+","+$("#regBaseZbinfoZrzList"+(i-1)+"_delFlag").val()+","+$("#regBaseZbinfoZrzList"+(i-1)+"_sort").val()+";";
							}
							//坐标正常,XY一一对应
							else if((arr[0].length == 8)&&(arr1[0].length==7)){
							  ZBArray[i-1]=tempx+","+tempy;
						      ZBYXArray[i-1]= new Zondy.Object.Point2D(parseFloat(tempx), parseFloat(tempy));
						    zblisttemp=zblisttemp+$("#regBaseZbinfoZrzList"+(i-1)+"_zbdmc").val()+"["+$("#regBaseZbinfoZrzList"+(i-1)+"_zbx").val()+","+$("#regBaseZbinfoZrzList"+(i-1)+"_zby").val()+"] "+","+$("#regBaseZbinfoZrzList"+(i-1)+"_id").val()+","+$("#regBaseZbinfoZrzList"+(i-1)+"_delFlag").val()+","+$("#regBaseZbinfoZrzList"+(i-1)+"_sort").val()+";";
							}else{
							  alert("第"+i+ "行坐标输入有误,请检查");
							  return false;	
							}
						    	
							}					
						else
						{
							alert("第"+i+ "行坐标输入有误,请检查");
							return false;
						}
				}
				if(flag == 0){
				if((ZBYXArray.length<4)) {alert("请输入至少4个坐标点!");return false;}
				if(ZBArray[0]!=ZBArray[ZBArray.length-1])
				{
			    	 ZBArray[ZBArray.length]=ZBArray[0];
			    	 ZBYXArray[ZBYXArray.length]=ZBYXArray[0];
			    }
			    console.log(ZBYXArray);
			    
			    console.log(zid);
			     $.ajax({ 
		  			type:"POST", //请求方式 
		  			url:"${ctx}/reg/base/regBaseZrz/GetZb", //请求路径 
		  			cache: false,   //(默认: true,dataType为script和jsonp时默认为false) jQuery 1.2 新功能,设置为 false 将不缓存此页面。 
		  			//data:"zddmvalue="+ss+"&bdcdyhvalue="+""+"&qlrvalue="+"",  //传参 
		  			data:"id="+zid,//chrymctext
		  			async:false,
		  			success:function(modelmap){
	                        zbxx = modelmap.zb;
	                        console.log(zbxx);
			  		}
			    });
			     jiaoyanzrzzd(zbxx);
				}
		 }

			//检验幢与宗地的关系,相离或相邻可以添加
		function jiaoyanzrzzd(zbxx){
			 //拓扑分析
			    console.log(zbxx);
			    var Obj = new Array();
	    	    var quObj = new Array();
			    var lengthzb;
			    var r = /\[(.+?)\]/g;
			    var temp;
		        lengthzb="";
				lengthzb=zbxx;		
				lengthzb=lengthzb.replace( /^\s+|\s+$/g, "" );
				Obj=lengthzb.match(r);
				for(var i=0;i<Obj.length;i++)
				{
					temp= Obj[i].substring(1,Obj[i].length-1);
					temp=temp.replace( /^\s+|\s+$/g, "" );
					lengthzb=temp.split(",");
					if(lengthzb.length==2)
					{
                       if(lengthzb[1].split(".")[0].length == 8){
						quObj[i] = new Zondy.Object.Point2D(parseFloat(lengthzb[1]), parseFloat(lengthzb[0]));
                       }else if(lengthzb[1].split(".")[0].length == 7){
						quObj[i] = new Zondy.Object.Point2D(parseFloat(lengthzb[0]), parseFloat(lengthzb[1]));
        					}else{
								alert("该宗地坐标有误!");return false;
							}
				}else{
                    alert("该宗地坐标有误 或 不存在");return false;
				}
           }
                var topParam = new Zondy.Service.TopAnalysis({
                     ip:actualSvrcfg.ip,
                     port:actualSvrcfg.port
                    });
                var RegObj = new Zondy.Object.GRegion([
                                                       new Zondy.Object.AnyLine([new Zondy.Object.Arc(ZBYXArray)])]);
                 topParam.setReg(RegObj); 
                var regionObj = new Zondy.Object.GRegion([new Zondy.Object.AnyLine([new Zondy.Object.Arc(quObj)])]);
                topParam.setRelativeObj(regionObj);
                topParam.nearDis = "0.005";
                topParam.execute(AnalysisSuccess,AnalysisError);
			}

		//分析结果
        function AnalysisSuccess(data){
            
            if(data == "包含"){
            	jiaoyanzrzzb();
                }else{
                	 $('#locationMistake').dialog('open');
   				     $("#locationMistake").dialog("move",{top:$(document).scrollTop() + ($(window).height()-300) * 0.5});//带滚动条的div窗口居中显示
                    }/* else{
                    	 $('#selectORCancleButton').dialog('open');	
     					$("#selectORCancleButton").dialog("move",{top:$(document).scrollTop() + ($(window).height()-300) * 0.5});//带滚动条的div窗口居中显示
                        } */
            
            } 
        function AnalysisError(data){
            console.log(data);
        } 
		
		
		 function remainAddyaosu()
			{
				$('#selectORCancleButton').dialog('close');
				jiaoyanzrzzb();
			}
			function cancelAddyaosu(zid)
			{
				$('#selectORCancleButton').dialog('close');
				var xmid='${regBaseZrz.xmid}';
				var url = "${ctx}/reg/base/regBaseZrz/zrzzbform?id="+zid+"&XMID="+xmid;
			    window.location = url;
			}

			//检验同一宗地下,幢与幢之间的关系,相交或者包含不能添加
		function jiaoyanzrzzb(){
            var qupointObj = new Array();
            qupointObj = ZBYXArray;
            var gemoObj = new Zondy.Object.Polygon(qupointObj);
            gemoObj.nearGis = 0.001;
            var queryStruct = new Zondy.Service.QueryFeatureStruct({
                    IncludeGeometry:true,
                    IncludeAttribute:false,
					IncludeWebGraphic:false
                 });
            var featureRule = new Zondy.Service.QueryFeatureRule({
                 Intersect:true,
                 MustInside:true
                });
            var tuceng = actualSvrcfg.ZRZ;
            var queryParam = new Zondy.Service.QueryByLayerParameter(tuceng,{
                  geometry:gemoObj,
                  resultFormat:"json",
                  rule:featureRule,
                  struct:queryStruct
                });
            queryParam.recordNumber = 100;
            var queryService = new Zondy.Service.QueryLayerFeature(queryParam,{
                   ip:actualSvrcfg.ip,
                   port:actualSvrcfg.port,
                   requestType:"POST"
                });
            queryService.query(queryjiaoyanzbSuccess);
			}
			

	   function queryjiaoyanzbSuccess(data){
               if(data.TotalCount>0){
                    $('#selectOkCancleButton').dialog('open');	
					$("#selectOkCancleButton").dialog("move",{top:$(document).scrollTop() + ($(window).height()-300) * 0.5});//带滚动条的div窗口居中显示
                   }
                else{
            	   addyaosu();
                   } 
		   }
	   
	   function continueAddyaosu()
		{
			$('#selectOkCancleButton').dialog('close');
			 addyaosu();
		}
		function cancelAdd(zid)
		{
			$('#selectOkCancleButton').dialog('close');
			var url ="${ctx}/reg/base/regBaseZrz/reimport?id="+zid;
		    window.location = url;
		}

	 
		function addyaosu()
		{
			var zbtemp="";
			for(j=0; j<ZBArray.length; j++){
			   zbtemp=zbtemp+"J"+(j+1)+"["+ZBArray[j]+"] ";
		    }	
			$.ajax({ 
	  			type:"POST", //请求方式 
	  			url:"${ctx}/reg/base/regBaseZrz/savechxx", //请求路径 
	  			cache: false,   //(默认: true,dataType为script和jsonp时默认为false) jQuery 1.2 新功能,设置为 false 将不缓存此页面。 
	  			//data:"zddmvalue="+ss+"&bdcdyhvalue="+""+"&qlrvalue="+"",  //传参 
	  			data:"xmzddm=${regBaseZrz.zddm}"+"&jzdzb="+zbtemp+"&jzdzblist="+zblisttemp+"&cid=${regBaseZrzchxx.id}&lcid=${regBaseZrz.id}"+"&xmid=${regBaseZrz.xmid}",//chrymctext
	  			async:false,
	  	        //dataType: "html",   //返回值类型 
	  			success:function(modelmap){
		  			  chxxvalue = modelmap.regBaseZrzchxx;
	  				   lcxxvalue = modelmap.regBaseZrz;
	  				   yts = modelmap.yts;
	  				   console.log(lcxxvalue);
		  			   zdjbxxvalue = modelmap.regBaseZdjbxx;
	  				  //---------------------根据chid查询到楼栋
		  			 var queryStruct = new Zondy.Service.QueryFeatureStruct();
		  				queryStruct.IncludeGeometry=true;
		  				temptuceng = actualSvrcfg.ZRZ;
		  				var str="CHID='"+chxxvalue.id +"'";
		  				var queryParam=new Zondy.Service.QueryByLayerParameter(temptuceng,{ 
		  	                   // geometry: line,
		  	                   resultFormat: "json",
		  	                   struct:queryStruct,
		  	                   where : str
		  	                   });
		  				var queryService=new Zondy.Service.QueryLayerFeature(queryParam,
		  						{
		  					ip: actualSvrcfg.ip,        //IP地址
		  					port: actualSvrcfg.port ,   //端口号
		  					requestType:"POST"
		  					});
		  				queryService.query(querydataSaveSuccess); 
		  				//------------------------------------	
	  			}
	  		});
		}
		
		 function querydataSaveSuccess(data)
		{
			if(data.TotalCount==0){
                 addloudong();
				}
			  else{
				 updatequyaosu(data.SFEleArray[0].FID,temptuceng); 
			  }
		}
		
		function addloudong()
		{
			
			var pointObj = new Array(); 
			var qupointObj = new Array();
			var lengthzb;
			var zbtemp="";
			for(var j=0; j<regBaseZbinfoRowIdx; j++){
				//pointObj[j]=$("#regBaseZbinfoList"+j+"_zbx").val()+","+$("#regBaseZbinfoList"+j+"_zby").val();
				zbtemp=zbtemp+$("#regBaseZbinfoZrzList"+j+"_zbdmc").val()+"["+$("#regBaseZbinfoZrzList"+j+"_zbx").val()+","+$("#regBaseZbinfoList"+j+"_zby").val()+"] "+"zbid="+$("#regBaseZbinfoZrzList"+j+"_id").val() +";";
			}
			zbtemp="";
			for(j=0; j<ZBArray.length; j++){
			   zbtemp=zbtemp+"J"+(j+1)+"["+ZBArray[j]+"] ";
		    }			
			  qupointObj=ZBYXArray;
			  var gArc = new Zondy.Object.Arc(qupointObj);              //构成区要素的弧段
			  var gAnyLine = new Zondy.Object.AnyLine([gArc]);        //构成区要素折线
			  var gRegion = new Zondy.Object.GRegion([gAnyLine]);     //构成区要素
			  var fGeom = new Zondy.Object.FeatureGeometry({ RegGeom: [gRegion] }); //构成区要素的几何信息
			 //设置区要素的图形参数信息
			  var cRegionInfo = new Zondy.Object.CRegionInfo({ EndColor: 533, FillColor:533, FillMode: 0, OutPenWidth: 1, OverMethod: 0, PatAngle: 1, PatColor: 1, PatHeight: 1, PatID: 0, PatWidth: 1 }); //区形状图形参数信息
			  var graphicInfo = new Zondy.Object.WebGraphicsInfo({ InfoType: 3, RegInfo: cRegionInfo }); //要素图形参数信
              //设置区要素的属性信息
              var attValue = [0,,,lcxxvalue.bsm,lcxxvalue.zddm,lcxxvalue.bdcdyh,lcxxvalue.zrzh,lcxxvalue.ysdm,lcxxvalue.gzwmc,,lcxxvalue.zzdmj,lcxxvalue.xmmc,lcxxvalue.ghyt,lcxxvalue.jzwgd,lcxxvalue.zydmj,lcxxvalue.ycjzmj,lcxxvalue.scjzmj,lcxxvalue.zcs,lcxxvalue.dscs,lcxxvalue.dxcs,lcxxvalue.dxsd,lcxxvalue.fwjg,yts,lcxxvalue.zts,lcxxvalue.jzwjbyt,lcxxvalue.zt,lcxxvalue.dah,"0",lcxxvalue.bz,chxxvalue.id];//$("#textnewyaosu").val()];
             //创建一个新的区要素
             var newFeature = new Zondy.Object.Feature({ AttValue: attValue, fGeom: fGeom, GraphicInfo: graphicInfo });
             newFeature.setFType(3);
             //创建一个要素数据集
             var featureSet = new Zondy.Object.FeatureSet();
             var fldNumber = 30;
             var fldType = ["long",    "double", "double",   "long",  "string","string","string","string","string","date","double","string","string","double","double","double","double","long","string","string","double","string","string","long","string","string","string","string","string","string"];
             var fldName = ["mpLayer", "mpArea", "mpPerimeter", "BSM", "ZDDM", "BDCDYH","ZRZH",  "YSDM","JZWMC","JGRQ","ZZDMJ","XMMC","GHYT","JZWGD", "ZYDMJ","YCJZMJ", "SCJZMJ", "ZCS" ,"DSCS","DXCS", "DZSD", "FWJG", "YTMC","ZTS","JZWJBYT","ZT","DAH","islogout","BZ","CHID"];
            var cAttValue = new Zondy.Object.CAttStruct({ FldNumber: fldNumber, FldType: fldType, FldName: fldName });
             featureSet.AttStruct = cAttValue;
             featureSet.addFeature(newFeature);
             console.log(featureSet.AttStruct);
            //创建一个要素编辑服务对象
            // var editDocFeature = new Zondy.Service.EditDocFeature(SvrCfg.tileMapName, 0,0, { ip: SvrCfg.ip,  port: SvrCfg.port });
            temptuceng=actualSvrcfg.ZRZ;
            if(temptuceng !="")
            {
    	       var editDocFeature = new Zondy.Service.EditLayerFeature(temptuceng, { ip: actualSvrcfg.ip,  port: actualSvrcfg.port });
               editDocFeature.add(featureSet, chxxsuccess);	 
				  //--------------------------------
			}
		}

		function chxxsuccess(data)
		{
			if (data == true) {
				alert("添加要素成功!");
				 var url ="${ctx}/reg/base/regBaseZrz/list?XMID=${regBaseZrz.xmid}&cid=" + chxxvalue.id;
				 window.location = url;
			}
		    else {
		        alert("添加要素失败!");
		        var url ="${ctx}/reg/base/regBaseZrz/reimport?id=${regBaseZrz.id}";
			    window.location = url;
		    }
		}
		
		function updatequyaosu(fid,tuceng)
		{  
			fid = fid;
			var editDocFeature = new Zondy.Service.EditLayerFeature(tuceng, { ip: actualSvrcfg.ip,  port: actualSvrcfg.port });			   
			editDocFeature.deletes(fid, deleteonSuccess);	
		}	
		
		function deleteonSuccess(data) 
		{
			if(data == true){
				/* for(var j=0; j<regBaseZbinfoRowIdx; j++)
				{    
					var pointObj = new Array();
					var qupointObj = new Array();
					if($("#regBaseZbinfoZrzList"+j+"_delFlag").val()!=0)
					{
						pointObj[j]=$("#regBaseZbinfoZrzList"+j+"_zbx").val()+","+$("#regBaseZbinfoZrzList"+j+"_zby").val();
					    zbtemp=zbtemp+$("#regBaseZbinfoZrzList"+j+"_zbdmc").val()+"["+$("#regBaseZbinfoZrzList"+j+"_zbx").val()+","+$("#regBaseZbinfoZrzList"+j+"_zby").val()+"] ";
					}
				}
							
				for(var i=0;i<pointObj.length;i++)
				{
					r= pointObj[i].substring(1,pointObj[i].length-1);
					lengthzb=r.split(",");
					if(lengthzb.length==2)
					{
						qupointObj[i] = new Zondy.Object.Point2D(parseFloat(lengthzb[1]), parseFloat(lengthzb[0]));
					}
					else
					{alert("该宗地坐标有误!");return false;}
			    }
				
				//--------------------------
			    var gArc = new Zondy.Object.Arc(qupointObj);              //构成区要素的弧段
			    var gAnyLine = new Zondy.Object.AnyLine([gArc]);        //构成区要素折线
			    var gRegion = new Zondy.Object.GRegion([gAnyLine]);     //构成区要素
				var fGeom = new Zondy.Object.FeatureGeometry({ RegGeom: [gRegion] }); //构成区要素的几何信息
	    
			    //设置区要素的图形参数信息
				var cRegionInfo = new Zondy.Object.CRegionInfo({ EndColor: 17, FillColor:17, FillMode: 1, OutPenWidth: 1, OverMethod: 0, PatAngle: 1, PatColor: 1, PatHeight: 1, PatID: 0, PatWidth: 1 }); //区形状图形参数信息
				var graphicInfo = new Zondy.Object.WebGraphicsInfo({ InfoType: 3, RegInfo: cRegionInfo }); //要素图形参数信
	              //设置区要素的属性信息
	           //   var attValue = [0,,,dataes.zddm,dataes.bdcdyh,dataes.ysdm,dataes.zdtzm,dataes.zl,dataes.zdmj,dataes.mjdw,dataes.yt,dataes.dj,dataes.jg,dataes.qllx,dataes.qlxz,dataes.qlsdfs,dataes.rjl,dataes.jzmd,dataes.jzxg,dataes.zdszd,dataes.zdszn,dataes.zdszx,dataes.zdszb,dataes.zdt,dataes.tfh,dataes.djh,dataes.zt,dataes.qlrxm,dataes.chid,dataes.islogout];
	           //  var attValue = [0,,,lcxxvalue.bdcdyh,lcxxvalue.zddm,lcxxvalue.zrzh,lcxxvalue.ysdm,lcxxvalue.xmmc,lcxxvalue.jzwmc,lcxxvalue.jzwgd,lcxxvalue.zzdmj,lcxxvalue.zydmj,lcxxvalue.scjzmj,lcxxvalue.zcs,lcxxvalue.dscs,lcxxvalue.dxcs,lcxxvalue.ghyt,lcxxvalue.fwjg,lcxxvalue.zts,lcxxvalue.zt,"0"];//$("#textnewyaosu").val()];
	             var attValue = [0,,,,,,,,,,,,,,,,,,,,"0"];//$("#textnewyaosu").val()];
	             //创建一个新的区要素
	             var newFeature = new Zondy.Object.Feature({ AttValue: attValue, fGeom: fGeom, GraphicInfo: graphicInfo });
	             newFeature.setFType(3);
	             newFeature.setFID(fid);
	             console.log(featureSet);
	             //创建一个要素数据集
	             var featureSet = new Zondy.Object.FeatureSet();
	             var fldNumber = 30;
	             var fldType = ["long",    "double", "double",     "string","string","string","string","string","string","double","double","double","double","long","long","long","string","string","long","string","string"];
	             var fldName = ["mpLayer", "mpArea", "mpPerimeter", "BDCDYH", "ZDDM","ZRZH",  "YSDM","XMMC",  "JZWMC",  "JZWGD", "ZZDMJ","ZYDMJ", "SCJZMJ", "ZCS" ,"DSCS","DXCS", "GHYT", "FWJG", "ZTS","ZT","islogout"];
	            var cAttValue = new Zondy.Object.CAttStruct({ FldNumber: fldNumber, FldType: fldType, FldName: fldName });
	             featureSet.AttStruct = cAttValue;
	             featureSet.addFeature(newFeature);
	             var tuceng=actualSvrcfg.ZRZ;
	            //创建一个要素编辑服务对象          
	    	       var editDocFeature = new Zondy.Service.EditLayerFeature(tuceng, { ip: actualSvrcfg.ip,  port: actualSvrcfg.port });
	               editDocFeature.update(featureSet, updateSuccess);*/	
	               //-------------------------------- 
				addloudong();
			} else{
                    alert("更新修改失败,请检查参数是否填写完整");
				}
				
		}
		function updateSuccess(data)
		{ 
			if (data == true) {
	         alert("更新成功!");
	         var url ="${ctx}/reg/base/regBaseZrz/list?XMID=${regBaseZrz.xmid}&daoru=true";
 			 window.location = url;
	          }
	        else {
	         alert("更新失败,请检查参数是否填写完整!");
	        }		 
		}
		function xxdaoru(){
			$.jBox($("#importBox").html(), {title:"导入数据", buttons:{"关闭":true}, 
				bottomText:"导入文件不能超过5M,仅允许导入“xls”或“xlsx”格式文件!"});
		}
		function delRow(obj, prefix){
			var id = $(prefix+"_id");
			var delFlag = $(prefix+"_delFlag");
			if (id.val() == ""){
				$(obj).parent().parent().remove();
			}else if(delFlag.val() == "0"){
				delFlag.val("1");
				$(obj).html("撤销删除").attr("title", "撤销删除");
				$(obj).parent().parent().addClass("error");
			}else if(delFlag.val() == "1"){
				delFlag.val("0");
				$(obj).html("删    除").attr("title", "删除");
				$(obj).parent().parent().removeClass("error");
			}
		}

		//删除测绘信息
        function deleteChxx(zid){
 			$.ajax({ 
				type:"POST", 
				url:"${ctx}/reg/base/regBaseZrz/chxxdelete", 
				cache: false,
				data:"id="+zid,
			    async : false,
				success:function(modelmap){
                    var zrzchxx = modelmap.regBaseZrzchxx;
                    xmid  = modelmap.xmid;
                    deletezrzchxx(zrzchxx.id);
					}
			})
			}
        function deletezrzchxx(chid) {
			var queryStruct=new Zondy.Service.QueryFeatureStruct();
			queryStruct.IncludeGeometry=true;
			TempTUceng=actualSvrcfg.ZRZ;
			var str="CHID='"+chid +"'";
			var queryParam=new Zondy.Service.QueryByLayerParameter(TempTUceng,{ 
                   // geometry: line,
                   resultFormat: "json",
                   struct:queryStruct,
                   where :  str
                   });
			queryParam.recordNumber=1000;
			var queryService=new Zondy.Service.QueryLayerFeature(queryParam,
					{
				ip: actualSvrcfg.ip,        //IP地址
				port: actualSvrcfg.port ,   //端口号
				requestType:"POST"
		 		});
			queryService.query(querydataDeleteSuccess);
      }
         function querydataDeleteSuccess(data)
        {
	
	       if(data.TotalCount>0)
	        {
		      var editDocFeature = new Zondy.Service.EditLayerFeature(TempTUceng, { ip: actualSvrcfg.ip,  port: actualSvrcfg.port });			   
		      editDocFeature.deletes(data.SFEleArray[0].FID, deleteSuccess);			 
	       }
           }
        function deleteSuccess(data)
        { 
	     if (data == true) {
           alert("坐标已删除!");
            var url = "${ctx}/reg/base/regBaseZrz/zrzzbform?id=${regBaseZrz.id}&XMID="+xmid;
      //var url = "${ctx}/reg/base/regBaseZrz/list?repage&XMID="+ xmid;
	       window.location.href=url;
          }
       else {
         alert("删除失败,请检查参数是否填写完整!");
       }		 
      }
		
		function gotoZrzList(){
			var url = "${ctx}/reg/base/regBaseZrz/list?XMID=${regBaseZrz.xmid}&signal=1";
			window.location = url;
		}
	</script>
<style>
.otable-form {
	width: 100%;
	border-color: #dddddd;
	border: 1px solid #ddd;
}

.otable-form, .table-form td {
	background-color: #fdfdfd;
	padding: 2px;
}

.otable-form td.tit {
	background: #fafafa;
	text-align: right;
	padding-right: 3px;
	white-space: nowrap;
}
</style>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="#">自然幢坐标信息</a></li>
	</ul>
	<br />
	<div class="current_fwinfo">
		当前项目【${regBaseXmmc}】,【${regBaseZrz.zrzh}】幢楼
		<%-- <c:if test="${empty daoru}">
		<input id="btndaoru" class="btn btn-primary" type="button" value="界址点导入" onclick="xxdaoru()"/>
	 </c:if> --%>
		<c:if test="${regBaseZrz.zb eq null}">
			<input id="btndaoru" class="btn btn-primary" type="button"
				value="界址点导入" onclick="xxdaoru()" />
		</c:if>
		<c:if test="${regBaseZrz.zb ne null}">
			<a href="#" onclick="deleteChxx('${regBaseZrz.id}')"><input
				id="btndaoru" class="btn btn-primary" type="button" value="坐标删除" /></a>&nbsp;&nbsp;
		<font color="red">说明:此界面可直接修改坐标,但重新导入界址点时,需删除坐标后重新导入</font>
		</c:if>

	</div>
	<div id="importBox" class="hide">
		<form id="importForm"
			action="${ctx}/reg/base/regBaseZrz/importFile?id=${regBaseZrz.id}&XMID=${XMID}"
			method="post" enctype="multipart/form-data" class="form-search"
			style="padding-left: 20px; text-align: center;"
			onsubmit="loading('正在导入,请稍等...');">
			<br /> <input id="uploadFile" name="file" type="file"
				style="width: 330px" /><br />
			<br /> <input id="btnImportSubmit" class="btn btn-primary"
				type="submit" value="   导    入   " /> <a
				href="${ctx}/reg/base/regBaseZrz/importFileTemplate">下载模板</a>
		</form>
	</div>
	<table id="contentTable"
		class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>标识码</th>
				<th>不动产单元号</th>
				<th>建筑物名称</th>
				<th>宗地代码</th>
				<th>自然幢号</th>
				<th>项目名称</th>
				<th>实测建筑面积</th>
				<th>总层数</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td>${regBaseZrz.bsm}</td>
				<td>${regBaseZrz.bdcdyh}</td>
				<td>${regBaseZrz.gzwmc}</td>
				<td>${regBaseZrz.zddm}</td>
				<td>${regBaseZrz.zrzh}#</td>
				<td>${regBaseZrz.xmmc}</td>
				<td>${regBaseZrz.scjzmj}</td>
				<td>${regBaseZrz.zcs}</td>
			</tr>
		</tbody>
	</table>
	<form:form id="inputForm" modelAttribute="regBaseZrz"
		action="${ctx}/reg/base/regBaseZrz/zrzzbxxsave" method="post"
		class="form-horizontal">
		<form:hidden path="id" />
		<sys:message content="${message}" />
		<div class="control-group">
			<label class="control-label">界址点坐标:</label>
			<div class="controls">
				<table id="chxxTable"
					class="table table-striped table-bordered table-condensed">
					<thead>
						<tr>
							<th class="hide"></th>
							<th>序号</th>
							<th>坐标点名称</th>
							<th>X坐标值</th>
							<th>Y坐标值</th>
							<shiro:hasPermission name="reg:base:regBaseZrz:edit">
								<th width="100">&nbsp;操 作</th>
							</shiro:hasPermission>
						</tr>
					</thead>
					<tbody id="regBaseZbinfoZrzList">
					</tbody>
					<shiro:hasPermission name="reg:base:regBaseZrz:edit">
						<tfoot>
							<tr>
								<td colspan="5"><a href="javascript:"
									onclick="addRow('#regBaseZbinfoZrzList', regBaseZbinfoZrzRowIdx, regBaseZbinfoZrzTpl);regBaseZbinfoZrzRowIdx = regBaseZbinfoZrzRowIdx + 1;"
									class="btn">新增</a></td>
							</tr>
						</tfoot>
					</shiro:hasPermission>
				</table>
				<script type="text/template" id="regBaseZbinfoZrzTpl">//<!--
						<tr id="regBaseZbinfoZrzList{{idx}}">
							<td class="hide">
								<input id="regBaseZbinfoZrzList{{idx}}_id" name="regBaseZbinfoZrzList[{{idx}}].id" type="hidden" value="{{row.id}}"/>
								<input id="regBaseZbinfoZrzList{{idx}}_delFlag" name="regBaseZbinfoZrzList[{{idx}}].delFlag" type="hidden" value="0"/>
							</td>
							<td>
								<input id="regBaseZbinfoZrzList{{idx}}_sort" name="regBaseZbinfoZrzList[{{idx}}].sort" type="text" value="{{row.sort}}" maxlength="100" class="input-small "/>
							</td>
							<td>
								<input id="regBaseZbinfoZrzList{{idx}}_zbdmc" name="regBaseZbinfoZrzList[{{idx}}].zbdmc" type="text" value="{{row.zbdmc}}" maxlength="100" class="input-small "/>
							</td>
                            <c:if test="${not empty VIEWS}">
							<td>
								<input id="regBaseZbinfoZrzList{{idx}}_zbx" name="regBaseZbinfoZrzList[{{idx}}].zbx" type="text" value="{{row.zby}}" maxlength="50" readonly="true" class="input-small "/>
							</td>
							<td>
								<input id="regBaseZbinfoZrzList{{idx}}_zby" name="regBaseZbinfoZrzList[{{idx}}].zby" type="text" value="{{row.zbx}}" maxlength="50" readonly="true" class="input-small "/>
							</td>
                            </c:if>
                            <c:if test="${empty VIEWS}">
							<td>
								<input id="regBaseZbinfoZrzList{{idx}}_zbx" name="regBaseZbinfoZrzList[{{idx}}].zbx" type="text" value="{{row.zby}}" maxlength="50" class="input-small "/>
							</td>
							<td>
								<input id="regBaseZbinfoZrzList{{idx}}_zby" name="regBaseZbinfoZrzList[{{idx}}].zby" type="text" value="{{row.zbx}}" maxlength="50" class="input-small "/>
							</td>
                            </c:if>
							<shiro:hasPermission name="reg:base:regBaseZrz:edit"><td class="text-center" width="100">
								{{#delBtn}}<a class="btn btn-primary" onclick="delRow(this, '#regBaseZbinfoZrzList{{idx}}')" title="删除">    </a>{{/delBtn}}
							</td></shiro:hasPermission>
						</tr>//-->
					</script>
				<script type="text/javascript">
					var regBaseZbinfoZrzRowIdx = 0, regBaseZbinfoZrzTpl = $("#regBaseZbinfoZrzTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
					$(document).ready(function() {
						var data = ${fns:toJson(regBaseZrz.regBaseZbinfoZrzList)};
						for (var i=0; i<data.length; i++){
							addRow('#regBaseZbinfoZrzList', regBaseZbinfoZrzRowIdx, regBaseZbinfoZrzTpl, data[i]);
							regBaseZbinfoZrzRowIdx = regBaseZbinfoZrzRowIdx + 1;
						}
					});
				</script>
			</div>
		</div>
		<div class="form-actions">
			<c:if test="${empty VIEWS}">
				<shiro:hasPermission name="reg:base:regBaseZrz:edit">
					<input id="btnSubmit" class="btn btn-primary" type="button"
						onclick="javascript:{this.disabled=true;checkzb();}" value="保 存" />&nbsp;</shiro:hasPermission>
			</c:if>
			<input id="btnCancel" class="btn" type="button" value="返 回"
				onclick="gotoZrzList();" />
		</div>
	</form:form>
	<!--  <div id="selectORCancleButton"  class="easyui-dialog" title="提示信息!"  maximizable="false"  minimizable="false" collapsible="false"  border="false" resizable="false" closable="true" closed="true" style="color:#1E90FF;left:300px;top:200px; width:300px; height:200px;padding: 5px" resizable="false">  
            <label class="control-label"><br/>&nbsp;&nbsp;&nbsp;&nbsp;该自然幢超出宗地范围,请重新导入或修改。<br/></label>
            <br/>
            <div>
			<br/>
			<input id="btnCancel" class="btn" type="button" value="确定" onclick="cancelAddyaosu('${regBaseZrz.id}')"/>
			</div>
        </div> -->
	<div text-align="center" id="locationMistake" class="easyui-dialog"
		title="提示信息!" maximizable="false" minimizable="false"
		collapsible="false" border="false" resizable="false" closable="true"
		closed="true"
		style="color: #1E90FF; left: 300px; top: 200px; width: 300px; height: 200px; padding: 5px"
		resizable="false">
		<label class="control-label"><br />
		<font color="red">该自然幢坐标不在宗地范围跨宗地存在,请重新导入或修改</font><br /></label> <br />
		<div>
			<br /> <input id="btnCancel" class="btn" type="button" value="确定"
				onclick="cancelAddyaosu('${regBaseZrz.id}')" />
		</div>
	</div>
	<div id="selectOkCancleButton" class="easyui-dialog" title="提示信息!"
		maximizable="false" minimizable="false" collapsible="false"
		border="false" resizable="false" closable="true" closed="true"
		style="color: #1E90FF; left: 300px; top: 200px; width: 300px; height: 200px; padding: 5px"
		resizable="false">
		<label class="control-label"><br />&nbsp;&nbsp;&nbsp;&nbsp;该自然幢与其他自然幢相交,是否继续。<br />
		<span><font color="red">选择‘是’,继续添加,选择‘否’,重新导入或还原为初始坐标!</font></span></label> <br />
		<div>
			<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<input id="btnSubmit" class="btn btn-primary" type="button"
				onclick="javascript:{this.disabled=true;continueAddyaosu();}"
				value="是" />&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; <input id="btnCancel"
				class="btn" type="button" value="否"
				onclick="cancelAdd('${regBaseZrz.id}')" />
		</div>
	</div>
</body>
</html>