gis.other.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619
  1. (function($j){$j.positionFixed=function(el){$j(el).each(function(){new fixed(this)});return el;};$j.fn.positionFixed=function(){return $j.positionFixed(this)}
  2. var fixed=$j.positionFixed.impl=function(el){var o=this;o.sts={target:$j(el).css('position','fixed'),container:$j(window)}
  3. o.sts.currentCss={top:o.sts.target.css('top'),right:o.sts.target.css('right'),bottom:o.sts.target.css('bottom'),left:o.sts.target.css('left')}
  4. if(!o.ie6)return;o.bindEvent();}
  5. $j.extend(fixed.prototype,{ie6:false,bindEvent:function(){var o=this;o.sts.target.css('position','absolute')
  6. o.overRelative().initBasePos();o.sts.target.css(o.sts.basePos)
  7. o.sts.container.scroll(o.scrollEvent()).resize(o.resizeEvent());o.setPos();},overRelative:function(){var o=this;var relative=o.sts.target.parents().filter(function(){if($j(this).css('position')=='relative')return this;})
  8. if(relative.size()>0)relative.after(o.sts.target)
  9. return o;},initBasePos:function(){var o=this;o.sts.basePos={top:o.sts.target.offset().top-(o.sts.currentCss.top=='auto'?o.sts.container.scrollTop():0),left:o.sts.target.offset().left-(o.sts.currentCss.left=='auto'?o.sts.container.scrollLeft():0)}
  10. return o;},setPos:function(){var o=this;o.sts.target.css({top:o.sts.container.scrollTop()+o.sts.basePos.top,left:o.sts.container.scrollLeft()+o.sts.basePos.left})},scrollEvent:function(){var o=this;return function(){o.setPos();}},resizeEvent:function(){var o=this;return function(){setTimeout(function(){o.sts.target.css(o.sts.currentCss)
  11. o.initBasePos();o.setPos()},1)}}})})(jQuery);(function($){$.fn.popWin=function(options){var def={PopSelector:"",CloseSelector:"",slideTime:600};var options=$.extend(def,options);
  12. var noie6=!(false&&!$.support.style);
  13. var PopSelector=options.PopSelector,CloseSelector=options.CloseSelector,slideTime=options.slideTime;
  14. if(noie6){$(PopSelector).slideDown(slideTime)}
  15. else{$(PopSelector).fadeIn(slideTime);var thisPop=$(PopSelector);jQuery(function($j){$j(thisPop).positionFixed()})}
  16. if(noie6){$(CloseSelector).click(function(){$(PopSelector).slideUp(slideTime);});}
  17. else{$(CloseSelector).click(function(){$(PopSelector).fadeOut(slideTime);});}}})(jQuery);
  18. var basePath=contextPath;
  19. function changeBoatTab(n,m){
  20. for(var i=0;i<m;i++)
  21. {
  22. var boat_menu=document.getElementById('boat_menu_' + i);
  23. var boat_main=document.getElementById('boat_main_' + i);
  24. var boat_menu_img=boat_menu.getElementsByTagName('img');
  25. boat_menu.className=i==n?'boat_hover':'';
  26. for(var j=0;j<boat_menu_img.length;j++){
  27. boat_menu_img[j].src=i==n? '${basePath}/static/image/pop/tab_hover.png': '${basePath}/static/image/pop/tab.png';
  28. }
  29. boat_main.style.display=i==n?'block':'none';
  30. }
  31. }
  32. function changepopxkzTab(n,m){
  33. for(var i=0;i<m;i++)
  34. {
  35. var pop_xkz_menu=document.getElementById('pop_xkz_menu_' + i);
  36. var pop_xkz_main=document.getElementById('pop_xkz_main_' + i);
  37. var pop_xkz_menu_img=pop_xkz_menu.getElementsByTagName('img');
  38. pop_xkz_menu.className=i==n?'pop_xkz_hover':'';
  39. for(var j=0;j<pop_xkz_menu_img.length;j++){
  40. pop_xkz_menu_img[j].src=i==n? '../static/image/pop/tab_hover.png': '../static/image/pop/tab.png';
  41. }
  42. pop_xkz_main.style.display=i==n?'block':'none';
  43. }
  44. }
  45. function queryJYRByGKIdX(data){
  46. for(var i in arguments){
  47. alert(arguments[i]);
  48. }
  49. }
  50. function progressdiv(v){
  51. var progressdiv=document.getElementById("progressdiv");
  52. //alert(v)
  53. if(progressdiv&&v){
  54. if(v=='show'){
  55. progressdiv.style.display="";
  56. }else{
  57. progressdiv.style.display="none";
  58. }
  59. }
  60. }
  61. function showBodyConfig(data){
  62. //console.log(data);
  63. if(data&&data.attrs.BodyConfig&&data.attrs.BodyConfig.length){
  64. //alert(data.attrs.BodyConfig.length);
  65. //progressdiv('show');
  66. var lengthT=data.attrs.BodyConfig.length;
  67. popBody = '';
  68. popBody += '<table style="margin-top: 5px;font-size:13px;" class="table table-striped table-bordered">';
  69. popBody += '<tr class="fisrtTr">';
  70. for(var i =0;i<lengthT;i++){
  71. var ishidden=data.attrs.BodyConfig[i].hidden;
  72. if(!ishidden||ishidden!=1){
  73. var title = data.attrs.BodyConfig[i].title;
  74. popBody += '<th >'+ title +'</th>';
  75. }
  76. }
  77. popBody += '</tr>';
  78. var trtip="双击可定位到该处";
  79. var listEntity = data.attrs.Entity;
  80. var funname=data.attrs.BodyFunConfigBean['function'];
  81. var isfuntr = data.attrs.BodyFunConfigBean&&funname&&gis.script.isNotBlank(funname);
  82. if(isfuntr){
  83. gis.script.toastmessage({text:'双击表格条目可定位。',type:'success'});
  84. }
  85. for(var i in listEntity){
  86. var trhtml="<tr>";
  87. var p=listEntity[i];
  88. if(isfuntr&&listEntity[i]){
  89. //escape
  90. //alert(encodeURIComponent("1234'4"))
  91. //var args="unescape('"+escape("1234'4")+"')";
  92. var functionParameter =data.attrs.BodyFunConfigBean.functionParameter;
  93. var args=[];
  94. //args.push("unescape('"+escape("1234'4")+"')");args.push("unescape('"+escape("1234'4")+"')");
  95. if(functionParameter&&functionParameter.length){
  96. for(var jj=0;jj<functionParameter.length;jj++){
  97. //console.log(listEntity[i]);console.log(functionParameter[jj]);
  98. args.push("unescape('"+escape(p[functionParameter[jj]])+"')");
  99. }
  100. }
  101. trhtml="<tr title='"+trtip+"' style='cursor:pointer;' ondblclick=\""+funname+"("+args.join(",")+")"+"\">";
  102. }
  103. popBody += trhtml;
  104. for(var j=0;j<lengthT;j++){
  105. //console.log(p);
  106. var ishidden=data.attrs.BodyConfig[j].hidden;
  107. //console.log(data.attrs.BodyConfig[j]);
  108. if(!ishidden||ishidden!=1){
  109. var attrname = data.attrs.BodyConfig[j].attrname;
  110. popBody += "<td "+(data.attrs.BodyConfig[j].tdStyle?" style='"+data.attrs.BodyConfig[j].tdStyle+";' ":"")+">"+ p[attrname] +"</td>";
  111. }
  112. }
  113. popBody += "</tr>";
  114. }
  115. popBody += '</table>'
  116. document.getElementById('popTitle').innerHTML=data.attrs.Title;
  117. document.getElementById('popHtml').innerHTML=popBody;
  118. //progressdiv("hide");
  119. }
  120. initpopupRightD0();
  121. }
  122. var fdtableShowConfig={};
  123. //港口经营人信息
  124. fdtableShowConfig.queryJYRById={"BodyConfig":[{"attrname":"gkjyr","attrval":"","hidden":"","tdStyle":"width:10%","title":"港口经营人名称"},{"attrname":"sfwhqy","attrval":"","hidden":"","tdStyle":"width:10%","title":"是否危货企业"},{"attrname":"zyhz","attrval":"","hidden":"","tdStyle":"","title":"主营货种"},{"attrname":"jyfw","attrval":"","hidden":"","tdStyle":"","title":"经营范围"},{"attrname":"jyfw","attrval":"","hidden":"","tdStyle":"","title":"经营地域"},{"attrname":"zyid","attrval":"","hidden":"1","tdStyle":"","title":"zyid"}],"BodyConfigType":"2","BodyFunConfigBean":{"function":"queryJYRByGKId","functionParameter":["zyid"]},"Title":"港口经营人信息"};
  125. //港区信息
  126. fdtableShowConfig.queryGQByGKId={"BodyConfig":[{"attrname":"gqmc","attrval":"","hidden":"","tdStyle":"","title":"港区名称"},{"attrname":"gqms","attrval":"","hidden":"","tdStyle":"","title":"港区功能描述"},{"attrname":"gqmj","attrval":"","hidden":"","tdStyle":"","title":"港区面积(万平方米)"},{"attrname":"lymj","attrval":"","hidden":"","tdStyle":"","title":"陆域面积(万平方米)"},{"attrname":"symj","attrval":"","hidden":"","tdStyle":"","title":"水域面积(万平方米)"},{"attrname":"gqdm","attrval":"","hidden":"1","tdStyle":"","title":"gqdm"}],"BodyConfigType":"2","BodyFunConfigBean":{"function":"queryGQByGKId","functionParameter":["gqdm"]},"Title":"港区信息"};
  127. //泊位信息
  128. fdtableShowConfig.queryBWById={"BodyConfig":[{"attrname":"bwmc","attrval":"","hidden":"","tdStyle":"","title":"泊位名称"},{"attrname":"gqmc","attrval":"","hidden":"","tdStyle":"","title":"所在港区"},{"attrname":"ssjyrname","attrval":"","hidden":"","tdStyle":"","title":"所属经营人"},{"attrname":"bwytcode","attrval":"","hidden":"","tdStyle":"","title":"主要用途"},{"attrname":"sjkpnl","attrval":"","hidden":"","tdStyle":"","title":"设计靠泊能力(吨)"},{"attrname":"bwcd","attrval":"","hidden":"","tdStyle":"","title":"长度(米)"},{"attrname":"sfkfcode","attrval":"","hidden":"","tdStyle":"","title":"是否对外开放泊位"},{"attrname":"sfwhcode","attrval":"","hidden":"","tdStyle":"","title":"是否危化品泊位"},{"attrname":"qysjsh","attrval":"","hidden":"","tdStyle":"","title":"前沿设计水深(米)"},{"attrname":"nhwtgnl","attrval":"","hidden":"","tdStyle":"","title":"泊位设计年货物通过能力"},{"attrname":"njzxtgnl","attrval":"","hidden":"","tdStyle":"","title":"泊位年集装箱通过能力"},{"attrname":"zyid","attrval":"","hidden":"1","tdStyle":"","title":"zyid"}],"BodyConfigType":"2","BodyFunConfigBean":{"function":"queryBWByGKId","functionParameter":["zyid"]},"Title":"泊位信息"};
  129. //储罐信息
  130. fdtableShowConfig.queryWHCGById={"BodyConfig":[{"attrname":"cgqmc","attrval":"","hidden":"","tdStyle":"","title":"储罐区名称"},{"attrname":"cgmc","attrval":"","hidden":"","tdStyle":"","title":"储罐名称"},{"attrname":"zdwxycggs","attrval":"","hidden":"","tdStyle":"","title":"重大危险源储罐个数(个)"},{"attrname":"zdwxycgrl","attrval":"","hidden":"","tdStyle":"","title":"重大危险源储罐容量(升)"},{"attrname":"szgqname","attrval":"","hidden":"","tdStyle":"","title":"所在港区"},{"attrname":"szdname","attrval":"","hidden":"","tdStyle":"","title":"所在地"}],"BodyConfigType":"2","Title":"储罐信息"};
  131. //岸线信息
  132. fdtableShowConfig.queryAXById={"BodyConfig":[{"attrname":"axmc","tdStyle":"","title":"岸线名称"},{"attrname":"axgncode","tdStyle":"","title":"岸线功能类型"},{"attrname":"bz","title":"规划主要用途描述"},{"attrname":"axcd","title":"长度(米)"},{"attrname":"lyzt","title":"利用状态"},{"attrname":"axlxcode","title":"是否深水岸线"},{"attrname":"gqmc","title":"所在港区"}],"BodyConfigType":"2","Title":"岸线信息"};
  133. //锚地信息
  134. fdtableShowConfig.queryMDByGKId={"BodyConfig":[{"attrname":"mdmc","tdStyle":"","title":"锚地名称"},{"attrname":"zyyt","tdStyle":"","title":"主要用途"},{"attrname":"xbnl","title":"锚泊能力"},{"attrname":"mdmj","title":"面积(万平方米)"},{"attrname":"mdcd","title":"长度(米)"},{"attrname":"mdcd","title":"宽度(米)"},{"attrname":"mdss","title":"水深(米)"}],"BodyConfigType":"2","BodyFunConfigBean":{"function":"queryMDByGKId","functionParameter":["zyid"]},"Title":"锚地信息"};
  135. //作业区信息
  136. fdtableShowConfig.queryZYQById={"BodyConfig":[{"attrname":"zyqmc","attrval":"","hidden":"","tdStyle":"","title":"作业区名称"},{"attrname":"zyqyt","attrval":"","hidden":"","tdStyle":"","title":"作业区功能描述"},{"attrname":"szgkname","attrval":"","hidden":"","tdStyle":"","title":"所在港口"},{"attrname":"szgqname","attrval":"","hidden":"","tdStyle":"","title":"所在港区"},{"attrname":"zyid","attrval":"","hidden":"1","tdStyle":"","title":"zyid"}],"BodyConfigType":"2","BodyFunConfigBean":{"function":"queryZYQbyZYID","functionParameter":["zyid"]},"Title":"作业区信息"};
  137. //海事申报作业信息
  138. fdtableShowConfig.queryDRHSSB={"BodyConfig":[{"attrname":"cbbh","tdStyle":"","title":"船舶编号"},{"attrname":"sbdlb","tdStyle":"","title":"申报单类别"},{"attrname":"zwcm","title":"中文船名"},{"attrname":"ywcm","title":"英文船名"},{"attrname":"kszysj","title":"开始作业时间"},{"attrname":"jszysj","title":"结束作业时间"},{"attrname":"zqysmczw","title":"作业品名"},{"attrname":"sl","title":"作业数量"},{"attrname":"sbrqtochar","title":"申报时间"}],"BodyConfigType":"2","Title":"海事申报作业信息","namespace":"2"};
  139. //危货附证信息
  140. fdtableShowConfig.queryWHZYFZByJYRId={"BodyConfig":[{"attrname":"fzsqh","tdStyle":"","title":"附证编号"},{"attrname":"zycstext","tdStyle":"","title":"作业区域范围"},{"attrname":"zyfs","title":"作业方式"},{"attrname":"wxhwpm","title":"作业危险货物品名"},{"attrname":"fzjg","title":"发证机关"},{"attrname":"fzsjtime","title":"发证日期"},{"attrname":"yxqjssjtime","title":"有效期至"},{"attrname":"zszt","title":"证书状态"},{"attrdefval":"详情","attrname":"","tdFunction":{"changelessParameter":["queryWHZYFZById.html","queryWHZYFZByJYRId.html"],"function":"showMesgWHXQ","functionParameter":["id","ssjyr"]},"title":"查看详情"}],"BodyConfigType":"2","Title":"危货附证信息"};
  141. function showMesg2(id,action,actionSplit){
  142. //console.log(id,action+"|"+actionSplit);
  143. var paras="";
  144. try{
  145. if(fdtableShowConfig&&action&&gis.script.isNotBlank(action)){
  146. var actSplit = action.split("?");
  147. if(actSplit&&actSplit.length>=2){
  148. paras+="?"+actSplit[1];
  149. }
  150. }
  151. }catch(e){
  152. }
  153. progressdiv('show');
  154. var tableInfo=fdtableShowConfig[actionSplit[0]];
  155. //gis.script.jsonAjax({url:contextPath+"/zygl/fdTableshow.html"+paras,contentType:'application/json;charset=utf-8',async:true,data:JSON.stringify({sqlid:"queryJYRinfo",szgk:id})},
  156. gis.script.jsonAjax({url:contextPath+"/zygl/fdTableshow.html"+paras,async:true,data:{sqlid:actionSplit[0],id:id,namespace:tableInfo.namespace||"2"}},
  157. function(data){
  158. //alert(JSON.stringify(data));
  159. newTableHtml(tableInfo,data);
  160. progressdiv('hide');
  161. },function(jqXHR, textStatus, errorThrown){
  162. //alert(jqXHR.responseText);
  163. newTableHtml(tableInfo,null);
  164. progressdiv('hide');
  165. });
  166. }
  167. function newTableHtml(tinfo,data){
  168. if(tinfo&&tinfo.BodyConfig&&tinfo.BodyConfig.length){
  169. var lengthT=tinfo.BodyConfig.length;
  170. popBody = '';
  171. popBody += '<table style="margin-top: 5px;font-size:13px;" class="table table-striped table-bordered">';
  172. popBody += '<tr class="fisrtTr">';
  173. for(var i =0;i<lengthT;i++){
  174. var ishidden=tinfo.BodyConfig[i].hidden;
  175. if(!ishidden||ishidden!=1){
  176. var title = tinfo.BodyConfig[i].title;
  177. popBody += '<th >'+ title +'</th>';
  178. }
  179. }
  180. popBody += '</tr>';
  181. if(data&&data.length){
  182. var trtip="双击可定位到该处";
  183. var listEntity = data;
  184. var funname=tinfo.BodyFunConfigBean?tinfo.BodyFunConfigBean['function']:null;
  185. var isfuntr = tinfo.BodyFunConfigBean&&funname&&gis.script.isNotBlank(funname);
  186. if(isfuntr){
  187. gis.script.toastmessage({text:'双击表格条目可定位。',type:'success'});
  188. }
  189. for(var i in listEntity){
  190. var trhtml="<tr>";
  191. var p=listEntity[i];
  192. if(isfuntr){
  193. if(p){
  194. var functionParameter =tinfo.BodyFunConfigBean.functionParameter;
  195. var args=[];
  196. //args.push("unescape('"+escape("1234'4")+"')");args.push("unescape('"+escape("1234'4")+"')");
  197. if(functionParameter&&functionParameter.length){
  198. for(var jj=0;jj<functionParameter.length;jj++){
  199. //console.log(listEntity[i]);
  200. //console.log("--",functionParameter[jj]);
  201. var parameterVal=p[functionParameter[jj]];
  202. if(parameterVal!=null){
  203. args.push("unescape('"+escape(parameterVal)+"')");
  204. }else{
  205. args.push("''");
  206. }
  207. }
  208. }
  209. if(args.length>0){
  210. trhtml="<tr title='"+trtip+"' style='cursor:pointer;' onmouseover=\"funmouseover(this)\" onmouseout=\"funmouseout(this)\" ondblclick=\""+funname+"("+args.join(",")+")"+"\">";
  211. }
  212. }
  213. }
  214. popBody += trhtml;
  215. for(var j=0;j<lengthT;j++){
  216. //console.log(p);
  217. var ishidden=tinfo.BodyConfig[j].hidden;
  218. //console.log(tinfo.BodyConfig[j]);
  219. if(!ishidden||ishidden!=1){
  220. var tdFunction =tinfo.BodyConfig[j].tdFunction;
  221. var click="";
  222. if(tdFunction&&gis.script.isNotBlank(tdFunction['function'])){
  223. var args=[];
  224. //alert(tdFunction['function']);
  225. if(tdFunction.functionParameter&&tdFunction.functionParameter.length){
  226. for(var jj=0;jj<tdFunction.functionParameter.length;jj++){
  227. var parameterVal=p[tdFunction.functionParameter[jj]];
  228. if(parameterVal!=null){
  229. args.push("unescape('"+escape(parameterVal)+"')");
  230. }else{
  231. args.push("''");
  232. }
  233. }
  234. }
  235. if(tdFunction.changelessParameter&&tdFunction.changelessParameter.length){
  236. for(var jk=0;jk<tdFunction.changelessParameter.length;jk++){
  237. var parameterVal=tdFunction.changelessParameter[jk];
  238. if(parameterVal!=null){
  239. args.push("unescape('"+escape(parameterVal)+"')");
  240. }
  241. }
  242. }
  243. click="onclick="+tdFunction['function']+'('+args.join(",")+")";
  244. //console.log(click);
  245. }
  246. var attrname = tinfo.BodyConfig[j].attrname;
  247. var attrvalshow=p[attrname]||tinfo.BodyConfig[j].attrdefval;
  248. if(!attrvalshow){
  249. attrvalshow="";
  250. }
  251. if(gis.script.isNotBlank(click)){
  252. popBody += "<td "+(tinfo.BodyConfig[j].tdStyle?" style='"+tinfo.BodyConfig[j].tdStyle+";' ":" ")+"><a "+click+">"+ attrvalshow +"</a></td>";
  253. }else{
  254. popBody += "<td "+(tinfo.BodyConfig[j].tdStyle?" style='"+tinfo.BodyConfig[j].tdStyle+";' ":" ")+">"+ attrvalshow +"</td>";
  255. }
  256. //popBody += "<td "+(tinfo.BodyConfig[j].tdStyle?" style='"+tinfo.BodyConfig[j].tdStyle+";' ":" ")+">"+ attrvalshow +"</td>";
  257. }
  258. }
  259. popBody += "</tr>";
  260. }
  261. }
  262. popBody += '</table>'
  263. var bgrounddiv=$("#bgrounddiv");
  264. var popupRightD0=$("#popupRightD0");
  265. popupRightD0.css("width",bgrounddiv.width());
  266. document.getElementById('popTitle').innerHTML=tinfo.Title;
  267. document.getElementById('popHtml').innerHTML=popBody;
  268. }
  269. initpopupRightD0();
  270. }
  271. function showMesgWHXQ(id,id2,action,action2){
  272. //console.log(arguments);
  273. backMesg(id2,action2,false);
  274. showMesg(id,action);
  275. }
  276. function backMesg(id,action,isdisplay){
  277. document.getElementById('fanhui').style.display='';
  278. $("#fanhui").unbind('click').click(function(){
  279. //console.log(action);
  280. showMesg(id,action);
  281. if(!isdisplay){
  282. document.getElementById('fanhui').style.display='none';
  283. }
  284. });
  285. }
  286. function showMesg(id,action){
  287. try{
  288. if(fdtableShowConfig&&action&&gis.script.isNotBlank(action)){
  289. var actSplit = action.split(".");
  290. if(actSplit&&actSplit.length
  291. &&fdtableShowConfig[actSplit[0]]){
  292. return showMesg2(id,action,actSplit);
  293. }
  294. }
  295. }catch(e){
  296. }
  297. /*
  298. //如果是 危货附证 的点击事件,将该事件的ID和action保存下来。用作返回
  299. if(action == 'queryWHZYFZByJYRId.html'){
  300. fanhuiId = id;
  301. fanhuiAction = action;
  302. }
  303. //如果是 危货附证 显示列表的 展示点击事件,显示返回按钮。并添加onclick操作。
  304. if(action == 'queryWHZYFZById.html'){
  305. document.getElementById('fanhui').style.display='';
  306. $("#fanhui").unbind('click').click(function(){
  307. showMesg(fanhuiId,fanhuiAction);
  308. });
  309. }
  310. else{
  311. document.getElementById('fanhui').style.display='none';
  312. }
  313. */
  314. $.ajax({
  315. url : basePath + "/zygl/"+action,
  316. //data : [{"name":"id","value":id}],
  317. data:{id:id,xxx:'dd'},
  318. type : "post",
  319. dataType : "json",
  320. success : function(data) {// ajax返回的数据
  321. if (data.success) {
  322. var popBody = '';
  323. if(data.attrs.Entity){
  324. //console.log(1,data);
  325. if(data.attrs.BodyConfigType&&data.attrs.BodyConfigType==2){
  326. return showBodyConfig(data);
  327. }
  328. var listEntity = data.attrs.Entity;
  329. var listTitleName = data.attrs.BodyTitleName.split(",");
  330. var hiddenFunction = data.attrs.HiddenFunction;
  331. //var tip=data.attrs.Tip;
  332. var trtip="双击可定位到该处";
  333. var lengthT = listTitleName.length;
  334. //如果存在影藏方法,则说明最后一列为影藏方法所需属性值,无需展示。
  335. if(hiddenFunction){
  336. gis.script.toastmessage({text:'双击表格条目可定位。',type:'success'});
  337. lengthT = listTitleName.length-1;
  338. }
  339. popBody += '<table style="margin-top: 5px;font-size:13px;" class="table table-striped table-bordered">';
  340. popBody += '<tr class="fisrtTr">';
  341. for(var i =0;i<lengthT;i++){
  342. popBody += '<th >'+ listTitleName[i] +'</th>';
  343. }
  344. popBody += '</tr>';
  345. for(var i in listEntity){
  346. if(hiddenFunction){
  347. popBody += "<tr title='"+trtip+"' style='cursor:pointer;' ondblclick=\""+hiddenFunction+"('"+listEntity[i][listTitleName.length-1]+"')"+"\">";
  348. }
  349. else{
  350. popBody += "<tr>";
  351. }
  352. for(var j=0;j<lengthT;j++){
  353. popBody += '<td >'+ getBrMessage(listEntity[i][j],0) +'</td>';
  354. }
  355. popBody += '</tr>';
  356. }
  357. popBody += '</table>'
  358. }
  359. else {
  360. popBody = data.attrs.Html;
  361. }
  362. document.getElementById('popTitle').innerHTML=data.attrs.Title;
  363. document.getElementById('popHtml').innerHTML=popBody;
  364. /*
  365. $.fn.popWin({
  366. PopSelector:".popupRightD", //弹出的窗体
  367. CloseSelector:".popupRightD .close", //关闭窗体的触发开关
  368. lideTime:600 //窗体出场入场动画的时间
  369. })
  370. */
  371. initpopupRightD0();
  372. //var dheight=$(document.body).height();
  373. //alert($('.popupRightD').height());alert(dheight*33/100);
  374. } else {
  375. $.alert({
  376. title : '提示',
  377. content : data.message,
  378. confirm : function() {
  379. }
  380. });
  381. }
  382. }
  383. });
  384. }
  385. function initpopupRightD0(){
  386. if($('#popupRightD0').length){
  387. //$('.popupRightD').get(0).style.display="";
  388. //$('#popupRightD0').get(0).style.display="";
  389. //$('.popupRightDContent').css("height","555");
  390. $('.popupRightDContent').css("height","");
  391. $('#popupRightD0').css("display","");
  392. //$('#popupRightD0').css("height","33%");
  393. $('.popupRightDContent').css("overflow-y","scroll");
  394. $('.popupRightDContent').css("height",$('.popupRightD').height()-32);
  395. //alert($('#popupRightD0').find("#popupRightD0close").length)
  396. $('#popupRightD0close').get(0).onclick=function(){
  397. $('#popupRightD0').css("display","none");
  398. $('#fanhui').css("display","none");
  399. $("#fanhui").unbind('click');
  400. };
  401. }
  402. //alert($('#pop_xkz_main_0 table').length);
  403. if($('#pop_xkz_main_0 table').length && $('.popupRightD').length){
  404. //alert($('#pop_xkz_main_0 table').css("width")+"__"+$('.popupRightD').width());
  405. //alert($('.popupRightD').get(0).scrollWidth+"__"+$('.popupRightD').scrollHeight);
  406. $('#pop_xkz_main_0 table').css("width",$('.popupRightD').width()-26);
  407. }
  408. }
  409. function queryZYQbyZYID(id){
  410. gis.script.loadgisService({treeNodeType:"GK_BASIC_JSJY_GK_ZYQ"},{id:id,showPop:"true"});
  411. }
  412. function queryGQByGKId(id){
  413. gis.script.loadgisService({treeNodeType:"GK_BASIC_JSJY_GK_GQ"},{id:id,showPop:"true"});
  414. }
  415. function queryJYRByGKId(id){
  416. gis.script.loadgisService({treeNodeType:"GK_BASIC_JSJY_JYR"},{id:id,showPop:"true"});
  417. }
  418. function queryMTByGKId(id){
  419. gis.script.loadgisService({treeNodeType:"GK_BASIC_JSJY_JYR_MT"},{id:id,showPop:"true"});
  420. }
  421. function queryBWByGKId(id){
  422. gis.script.loadgisService({treeNodeType:"GK_BASIC_JSJY_JYR_BW"},{id:id,showPop:"true"});
  423. }
  424. function queryMDByGKId(id){
  425. //console.log(id);
  426. gis.script.loadgisService({treeNodeType:"GK_BASIC_JSJY_GK_MD"},{id:id,showPop:"true"});
  427. }
  428. function funmouseover(obj){
  429. //alert(obj);
  430. obj.style.background='#FFFFCC';
  431. }
  432. function funmouseout(obj){
  433. //alert(obj);
  434. obj.style.background='';
  435. }
  436. function getBrMessage(message,leng){
  437. if(typeof(message)=='undefined'||message==null){
  438. message="";
  439. }
  440. if(leng){
  441. var i = message.length;
  442. //排除操作列的换行
  443. //!i排除非字符项
  444. if( !i ||(i >0 && message.indexOf('showMesg')>-1)){
  445. return message;
  446. }
  447. var j = parseInt(i/leng)+1;
  448. var rsl='';
  449. for (var k=0;k<j;k++){
  450. rsl = rsl + message.substring(k*leng , (k+1)*leng) +'<br/>';
  451. }
  452. return rsl;
  453. }
  454. return message;
  455. }
  456. function showall() {
  457. $('div').css("display", "block");
  458. }
  459. function hideexcel(that) {
  460. $(that).parent().parent().css("display", "none");
  461. }
  462. function changeBoatTab(n, m) {
  463. for ( var i = 0; i < m; i++) {
  464. var boat_menu = document.getElementById("boat_menu_" + i);
  465. var boat_main = document.getElementById("boat_main_" + i);
  466. var boat_menu_img = boat_menu.getElementsByTagName("img");
  467. boat_menu.className = i == n ? "boat_hover" : "";
  468. for ( var j = 0; j < boat_menu_img.length; j++) {
  469. boat_menu_img[j].src = i == n ?contextPath+'/theme/images/tab_hover.png' : contextPath+'/theme/images/tab.png';
  470. }
  471. boat_main.style.display = i == n ? "block" : "none";
  472. }
  473. }
  474. function changePopTab(n, m) {
  475. for ( var i = 0; i < m; i++) {
  476. var pop_menu = document.getElementById("pop_menu_" + i);
  477. var pop_main = document.getElementById("pop_main_" + i);
  478. var pop_menu_img = document.getElementById("pop_ul")
  479. .getElementsByTagName("img");
  480. pop_menu.className = i == n ? "pop_hover" : "";
  481. pop_menu_img[i].src = i == n ? "img/pop_tab_hover.png"
  482. : "img/pop_tab.png";
  483. //
  484. // alert(pop_menu.style.zIndex);
  485. pop_main.style.display = i == n ? "block" : "none";
  486. }
  487. }
  488. function move_img(that) {
  489. var y_axis = parseInt($(that).css('height')) / 2;
  490. if ($(that).css('bottom') == "0px")
  491. $(that).css('bottom', y_axis + "px");
  492. else
  493. $(that).css('bottom', '0px');
  494. }
  495. //经营许可证图片
  496. function detailShow(objs){
  497. $("#overlay").fadeTo(500, 0.5);
  498. $("#divpop"+objs).html($("#dv"+objs).html());
  499. divpopup($("#divpop"+objs));
  500. //$("#divpop"+objs).show(500);
  501. //$("#divpop"+objs).css("left",pageWidth()*0.1);
  502. //$("#divpop"+objs).css("top",pageHeight()*0.1);
  503. }
  504. function detailHide(objs){
  505. $("#divpop"+objs).hide(300);
  506. $("#overlay").fadeOut(300);
  507. }
  508. function divpopup(popupName){
  509. _windowHeight = $(".smMap").height(),//获取当前窗口高度
  510. _windowWidth = $(".smMap").width(),//获取当前窗口宽度
  511. _popupHeight = popupName.height(),//获取弹出层高度
  512. _popupWeight = popupName.width();//获取弹出层宽度
  513. _posiTop = (_windowHeight - _popupHeight)/2;
  514. _posiLeft = (_windowWidth - _popupWeight)/2+450;
  515. popupName.css({"left": _posiLeft + "px","top":_posiTop + "px","display":"block"});//设置position
  516. }