var sFeatures = "toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=yes;"; var finalheight = 0; //最后的高度 var he = 0; //初始高度 var finalWidth = 0; //最后的宽 var wid = 0; //初始宽 var dragable = false;//默认不可拖拽 var Insurance = false; var oldY = '';//记录第一次的鼠标位置 var oldX = '';//记录第一次的鼠标位置 var right_box; var right_btn; var rightDiv; var bottom_btn; var bottom_div; var svgDiv; var svgSize =1; var tState = 1; var svgParent; var bnts; var common; var turnPage2 = new turnPageClass(); //单击延时触发 var rightBtn = function (e) { var divHe; right_div = document.getElementById('InsuranceInfo'); right_btn = document.getElementById('right_btn'); svgDiv = document.getElementById('svg_div'); bnts = document.getElementById('bnts'); if (right_div.offsetWidth == 0) { right_div.style.width = '355px' finalWidth = 355; divHe =232; right_btn.src = './image/right.png'; right_div.style.display='block'; } else { right_div.style.width = 0; finalWidth = 0; divHe = 216; right_div.style.display='none'; right_btn.src = './image/left.png'; } svgDiv.style.width = document.documentElement.clientWidth- right_div.style.width.slice(0, -2)-divHe + 'px'; bnts.style.left = document.documentElement.clientWidth- right_div.style.width.slice(0, -2) - divHe - 35 + 'px'; } var bottomBtn = function (e) { bottom_div = document.getElementById('DivFamilytreeGrid'); bottom_btn = document.getElementById('bottom_btn'); svgDiv = document.getElementById('svg_div'); if (bottom_div.offsetHeight == 0) { bottom_div.style.height = '200px' finalheight = 200; bottom_btn.src = './image/bottom.png' bottom_div.style.display='block'; } else { bottom_div.style.height = 0; finalheight = 0; bottom_div.style.display='none'; bottom_btn.src = './image/top.png'; } right_box.style.height = document.documentElement.clientHeight - bottom_div.style.height.slice(0, -2) -17 + 'px'; svgDiv.style.height = document.documentElement.clientHeight - bottom_div.style.height.slice(0, -2) - 214 + 'px'; } window.onresize = function () { var divHe; bottom_div = document.getElementById('DivFamilytreeGrid'); right_box = document.getElementById('right_box'); svgDiv = document.getElementById('svg_div'); right_div = document.getElementById('InsuranceInfo'); bnts = document.getElementById('bnts'); right_box.style.height = document.documentElement.clientHeight - bottom_div.style.height.slice(0, -2) -17 + 'px' svgDiv.style.height = document.documentElement.clientHeight - bottom_div.style.height.slice(0, -2) - 214 + 'px'; if(right_div.offsetWidth == 0) { divHe =216; }else{ divHe = 232; } svgDiv.style.width = document.documentElement.clientWidth- right_div.style.width.slice(0, -2) - divHe + 'px'; bnts.style.left = document.documentElement.clientWidth- right_div.style.width.slice(0, -2) - divHe - 35 + 'px'; } var startDrag = function (event) { dragable = true; var e = event ? event : window.event; oldY = e.pageY; //记录第一次的鼠标位置 common.classList.add('valid_none'); }; var startDiv = function (event) { Insurance = true; var e = event ? event : window.event; oldX = e.pageX; //记录第一次的鼠标位置 common.classList.add('valid_none'); }; var unDrop = function () { dragable = false; Insurance = false; window.event ? window.event.cancelBubble = true : e.stopPropagation(); }; var endDrop = function () { if (dragable) { finalheight = he; dragable = false; common.classList.remove('valid_none'); }; if (Insurance) { finalWidth = wid; Insurance = false; common.classList.remove('valid_none'); }; }; document.onmouseup = function () { endDrop(); }; document.onmousemove = function (event) { var divHe; right_div = document.getElementById('InsuranceInfo'); var e = event ? event : window.event; if (dragable) { he = oldY - e.pageY + parseInt(finalheight); if(he > 450){ he = 450; } if(he < 0){ he = 0; bottom_btn.src = './image/top.png'; bottom_div.style.display='none'; }else{ bottom_btn.src = './image/bottom.png'; bottom_div.style.display='block'; } bottom_div.style.height = he + 'px'; right_box.style.height = document.documentElement.clientHeight - he -17+'px'; svgDiv.style.height = document.documentElement.clientHeight - he - 214 + 'px'; return false; }; if(Insurance){ wid = oldX - e.pageX + parseInt(finalWidth); if(wid > 400){ wid = 400; } if(wid < 0){ wid = 0; right_btn.src = './image/left.png'; right_div.style.display='none'; }else{ right_div.style.display='block'; right_btn.src = './image/right.png'; } right_div.style.width = wid + 'px'; if(right_div.offsetWidth == 0) { divWid =216; }else{ divWid = 232; } svgDiv.style.width = document.documentElement.clientWidth - wid - divWid + 'px'; bnts.style.left = document.documentElement.clientWidth - wid - divWid - 35 + 'px'; return false; } }; function initUWinfo(json) { var uwInfo = json.uwInfo; var appnt = json.appnt; var contNo = json.contNo; var localeStr = json.I18n; //给div赋值 var table = document.getElementById("DivFamilytreeGrid"); right_box = document.getElementById('right_box'); bottom_box = document.getElementById('bottom_box'); var svg = document.getElementsByTagName("svg"); var mask = document.getElementById("mask"); var loading = document.getElementById("loading"); var amnt = 0; var prem = 0; var appntName; var info ='' +''; for (var i = 0; i < appnt.length; i++) { info += ""; } info +="
'+i18nMessage("投保人","Polowne-2")+''+i18nMessage("客户号","ClientNum-3")+''+i18nMessage("投保人类型","PolowneType")+'
"+appnt[i][1]+""+appnt[i][0]+""+appnt[i][2]+"
"; info +='' +''; for (var i = 0; i < uwInfo.length; i++) { info += ""; amnt = Arithmetic(amnt,'+',uwInfo[i][13],2); prem = Arithmetic(prem,'+',uwInfo[i][14],2); } info +="
'+i18nMessage("被保人","Insured-2")+''+i18nMessage("客户号","ClientNum-3")+''+i18nMessage("保额","SI-2")+''+i18nMessage("保费","Prem")+'
"+uwInfo[i][2]+""+uwInfo[i][1]+""+uwInfo[i][13]+""+uwInfo[i][14]+"
"; var sum = "

"+i18nMessage("保单号","PolNum-3")+":"+contNo+"

"+i18nMessage("总保额","TotalSI")+":"+amnt+" "+ i18nMessage("总保费","TotalPrem-2")+":"+prem+"

"; sum =sum+info; right_div.innerHTML=sum; displayMultiline(uwInfo, FamilytreeGrid,FamilytreeGrid); svgValue(1); var problem = document.getElementsByName("FamilytreeGrid9"); for(var i =0;i 0.9 && svgSize < 1.1) svgSize = 1; svgParent.style.transform = 'scale('+svgSize+')'; svgValue(svgSize); } //缩小 function narrow() { svgSize = svgSize - (svgSize/10); if(svgSize > 0.9 && svgSize < 1.1) svgSize = 1; svgParent.style.transform = 'scale('+svgSize+')'; svgValue(svgSize); } //回复正常 function restore() { svgSize=1; svgParent.style.transform = 'scale('+svgSize+')'; tState = 1; svgValue(svgSize); } function showSvg() { var svg = document.getElementsByTagName("svg"); var tWidth =(svg[0].width.animVal.value+200)/svgDiv.lastElementChild.offsetWidth; var tHeight =(svg[0].height.animVal.value+350)/svgDiv.lastElementChild.offsetHeight; var tiple = tWidth > tHeight ? tWidth : tHeight ; if(tiple < 1){ return; } var SWidth =svgParent.offsetWidth/svgDiv.offsetWidth; var SHeight =svgParent.offsetHeight/svgDiv.offsetHeight; var multiple = SWidth > SHeight ? SWidth : SHeight ; var size =1/multiple; var lWidth =svgDiv.offsetWidth/(svg[0].width.animVal.value*size+70); var lHeight =svgDiv.offsetHeight/(svg[0].height.animVal.value*size+70); var stiple = lWidth < lHeight ? lWidth : lHeight ; svgSize=size*stiple; svgParent.style.transform = 'scale('+svgSize+')'; tState = 0; svgValue(svgSize); } /* * 鼠标单击事件响应 * event 鼠标事件对象 */ /*function onDocumentClick() { // 取消上次延时未执行的方法 clearTimeout(clickTimeId); //执行延时 clickTimeId = setTimeout(function() { //此处为单击事件要执行的代码 restore(); }, 250); return false; }*/ /* * 鼠标双击事件响应 * event 鼠标事件对象 */ function onDocumenDblClick() { // 取消上次延时未执行的方法 if(tState == '1'){ showSvg(); }else{ restore(); } } function round(num, decimal) { if (isNaN(num)) { return 0; } var p1 = Math.pow(10, decimal + 1); var p2 = Math.pow(10, decimal); return Math.round(num * p1 / 10) / p2; } function toFixed(num, decimal) { return round(num, decimal).toFixed(decimal); } function svgValue(val){ var svgValue = document.getElementById("svgValue"); val = toFixed(val,2); svgValue.innerText =accMul(val,100)+"%"; svgDiv.scrollTop=0; } //乘法 function accMul(arg1,arg2) { var m=0,s1=arg1.toString(),s2=arg2.toString(); try{m+=s1.split(".")[1].length}catch(e){} try{m+=s2.split(".")[1].length}catch(e){} return Number(s1.replace(".",""))*Number(s2.replace(".",""))/Math.pow(10,m) } function afterSubmit(FlagStr,content,response) { //初始化表格 var parent = document.getElementById("svgParent"); var data = response.result; if (FlagStr == 'Succ'){ fullfillSvg(data, parent); initUWinfo(data); }else { confirm(content); top.close(); } } function getfamilyTree() { if(customerNo == null || customerNo == "" || contNo == null || contNo == "" ){ i18nAlert("请求参数异常!","LIS-19522"); } fm.action = "../API/customer_common/customer/familytree/UPDATE"; fm.customerNo.value = customerNo; fm.contNo.value = contNo; ajaxSubmit2(document.getElementById("fm"),afterSubmit); }