gis.tree.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. var gis = gis || {};
  2. gis.tree = function() {
  3. };
  4. gis.tree.autohide0Node=true;
  5. gis.tree.gqshowcbinbw=!true;
  6. /*
  7. * 用于对 Ajax 返回数据进行预处理的函数。[setting.async.enable = true 时生效]
  8. */
  9. gis.tree.filter = function(treeId, parentNode, childNodes) {
  10. //console.log('>2>parentNode:',parentNode);
  11. //childNodes ={"children":[{"children":[{"children":[],"iconSkin":"","id":"402881e750ef634b0150ef64cce10001","isParent":false,"name":"2","open":false,"pId":"","type":""},{"children":[],"iconSkin":"","id":"402881e750ec68340150ec68af3c0000","isParent":true,"name":"11111","open":false,"pId":"","type":""},{"children":[],"iconSkin":"","id":"402881e750eed3aa0150eed4fe510001","isParent":true,"name":"市局下","open":false,"pId":"","type":""},{"children":[],"iconSkin":"","id":"402881e750ebc9ca0150ebede1a60006","isParent":true,"name":"港口局","open":false,"pId":"","type":""},{"children":[],"iconSkin":"","id":"402881e750ef34c80150ef35d9990001","isParent":true,"name":"222","open":false,"pId":"","type":""}],"iconSkin":"","id":"402881e750dab7fa0150dabe66630002","isParent":false,"name":"市局","open":false,"pId":"","type":""},{"children":[{"children":[],"iconSkin":"","id":"402881e750ef78f80150ef7de1940001","isParent":false,"name":"2","open":false,"pId":"","type":""}],"iconSkin":"","id":"402881e750ef78f80150ef7bf30c0000","isParent":false,"name":"2","open":false,"pId":"","type":""}],"iconSkin":"","id":"01","isParent":false,"name":"行政单位信息","open":true,"pId":"","type":""};
  12. //alert(JSON.stringify(childNodes));
  13. //alert(childNodes);
  14. //childNodes={"iconSkin":"","id":"01","isParent":true,"name":"行政单位信息","open":true,"pId":"","type":"","children":[{"iconSkin":"","id":"01","isParent":true,"name":"行政单位","open":false,"pId":"","type":""}]}
  15. //childNodes=[{"iconSkin":"","id":"01","isParent":true,"name":"行政单位","open":false,"pId":"","type":""}];
  16. /*
  17. if(parentNode&&parentNode.treeNodeType){
  18. if(parentNode.treeNodeType='GK_BASIC_JSJY_GK_GK'){
  19. childNodes=[{"iconSkin":"","id":"01","isParent":true,"name":"行政单位","open":false,"pId":"","type":""}]
  20. }
  21. }
  22. */
  23. //debugger;
  24. /*
  25. if(childNodes){
  26. if(!parentNode){
  27. alert(JSON.stringify(parentNode));
  28. }else{
  29. parentNode.name="xxx";
  30. for(var ii=0;ii<childNodes.length;ii++){
  31. childNodes[ii].name="xxx"
  32. }
  33. }
  34. }*/
  35. //console.log('>22222>gis.script.cbdataInfostatistics:',gis.script.cbdataInfostatistics);
  36. //&&(node.treeNodeType=='GK_BASIC_JSJY_JYR'||node.treeNodeType=='GK_BASIC_JSJY_JYR_BW')
  37. /*
  38. if(parentNode&&parentNode.treeNodeType=="GK_BASIC_JSJY_GK_GQ"){
  39. childNodes=gis.tree.addcbtotree(parentNode,childNodes,parentNode.treeNodeType,("V"+parentNode.code));
  40. }
  41. */
  42. return childNodes;
  43. }
  44. /*
  45. * 设置 zTree 是否显示节点的图标
  46. */
  47. gis.tree.showIconForTree = function(treeId, treeNode) {
  48. if(treeNode){
  49. //alert(treeNode.iconSkin);
  50. return !gis.script.isBlank(treeNode.iconSkin);
  51. }
  52. return false;
  53. //return !treeNode.isParent;
  54. }
  55. /*
  56. * 调用父内框架的clickDrawFillMarker方法,绘画船舶
  57. */
  58. gis.tree.parentdrawFillMarker= function(treeNode){
  59. if(parent&&parent.gis&&parent.gis.script&&parent.gis.script.clickDrawFillMarker){
  60. parent.gis.script.clickDrawFillMarker(treeNode);
  61. }
  62. }
  63. /*
  64. * 调用父内框架的parentopenPop_Boat方法,取消船舶选择状态
  65. */
  66. gis.tree.parentopenPop_Boat= function(treeNode,runPop){
  67. if(parent&&parent.gis&&parent.gis.script&&parent.gis.script.openPop_Boat){
  68. parent.gis.script.openPop_Boat(treeNode,runPop);
  69. }
  70. }
  71. /*
  72. * 树节点点击事件
  73. */
  74. gis.tree.nodeClick = function(event, treeId, treeNode, clickFlag) {
  75. //alert(parent.gis.script.setMapCenter);return;
  76. if(parent&&parent.gis&&parent.gis.script){
  77. parent.gis.script.removeAllPopup();
  78. }
  79. var parentgisLayerinfo=gis.tree.parentgisLayerinfo();
  80. var layerloadover=gis.tree.parentgisLayerinfo();
  81. if(parentgisLayerinfo&&layerloadover){
  82. if(typeof(treeNode.id)!="undefined"){
  83. var issetCenter=false;
  84. if(treeNode.id==0){
  85. //map.setCenter(new SuperMap.LonLat(lon, lat), 0);
  86. //parent.gis.script.loadcbdataService(parent.gis.script.phase.refresh);return;
  87. var info={};
  88. info.lon=119.66;
  89. info.lat=32.57;
  90. info.zoomSize=0;
  91. gis.tree.parentsetMapCenter(info);
  92. issetCenter=true;
  93. }else if(treeNode.treeNodeType&&treeNode.treeNodeType=="HS_AIS"){
  94. if(parent&&parent.gis&&parent.gis.script&&parent.gis.script.boatrefreshInfo){
  95. var cbobj=parent.gis.script.boatrefreshInfo[treeNode.mmsi];
  96. if(cbobj){
  97. if(gis.script.isNum(cbobj.lon)&&gis.script.isNum(cbobj.lat)){
  98. var info={};
  99. info.lon=cbobj.lon;
  100. info.lat=cbobj.lat;
  101. info.zoomSize=10;
  102. gis.tree.parentsetMapCenter(info);
  103. var featuredata=jQuery.extend(true, {}, treeNode);
  104. featuredata.attributes={onID:treeNode.name,onMMSI:treeNode.mmsi};
  105. featuredata.attributes.shipLON=cbobj.lon;
  106. featuredata.attributes.shipLAT=cbobj.lat;
  107. gis.tree.parentopenPop_Boat(featuredata);
  108. }
  109. }
  110. }
  111. }else if(treeNode.treeNodeType&&treeNode.treeNodeType=="HS_AIS2"){
  112. if(gis.script.isNum(treeNode.lon)&&gis.script.isNum(treeNode.lat)){
  113. var info={};
  114. info.lon=treeNode.lon;
  115. info.lat=treeNode.lat;
  116. info.zoomSize=10;
  117. gis.tree.parentsetMapCenter(info);
  118. }
  119. //boatLayer.removeAllFeatures();
  120. //gis.script.drawFillMarker(boatLayer,treeNode);
  121. //gis.tree.parentdrawFillMarker(treeNode);
  122. var featuredata=jQuery.extend(true, {}, treeNode);
  123. featuredata.attributes={onID:treeNode.name,onMMSI:treeNode.mmsi};
  124. //gis.tree.parentopenPop_Boat(featuredata,false);
  125. gis.tree.parentopenPop_Boat(featuredata);
  126. }else{
  127. //alert(treeNode.gisinfo);
  128. //map.zoomToScale(0.000001180591620);
  129. //alert(treeNode.treeNodeType);
  130. //console.log("parentgisLayerinfo--->",parentgisLayerinfo);
  131. if(treeNode.treeNodeType&&parentgisLayerinfo[treeNode.treeNodeType]){
  132. var objdata={}
  133. if(!gis.script.isBlank(treeNode.gisinfo)){
  134. var gobj=eval("("+treeNode.gisinfo+")");
  135. //objdata.id=gobj.smid;
  136. objdata.zoomto=gobj.zoomto;
  137. }
  138. if(!gis.script.isBlank(treeNode.code)){
  139. objdata.id=treeNode.code;
  140. }
  141. //alert(objdata.id)
  142. if(objdata.id){
  143. var info=parentgisLayerinfo[treeNode.treeNodeType][objdata.id];
  144. if(info&&typeof(info.lon)!="undefined"&&typeof(info.lat)!="undefined"){
  145. info.zoomSize=objdata.zoomto||info.zoom||6;
  146. gis.tree.parentsetMapCenter(info);
  147. issetCenter=true;
  148. }else{
  149. gis.tree.loadgisService(treeNode,objdata);
  150. }
  151. }
  152. }
  153. /*
  154. if(g){
  155. var gobj=eval("("+g+")");
  156. if(gobj&&gobj.smid){
  157. if(treeNode.treeNodeType&&parentgisLayerinfo[treeNode.treeNodeType]){
  158. var info=parentgisLayerinfo[treeNode.treeNodeType][gobj.smid];
  159. if(info&&typeof(info.lon)!="undefined"&&typeof(info.lat)!="undefined"){
  160. map.setCenter(new SuperMap.LonLat(info.lon, info.lat),gobj.zoomto||5);
  161. }
  162. }
  163. }
  164. }
  165. */
  166. }
  167. if(!issetCenter){
  168. //alert("缺少关联数据,定位失败...");
  169. }
  170. }
  171. }
  172. return layerloadover;
  173. }
  174. /*
  175. gis.tree.loadgisService = function(treeNode,objdata){
  176. //alert(treeNode.treeNodeType+"--"+objdata.id);
  177. var dataServices=gisConfigBean.dataconfig;
  178. if(dataServices){
  179. gis.script.consolelog('dataServices',dataServices);
  180. for(var n in dataServices){
  181. var data=gisConfigBean.dataconfig[n];
  182. if(data.gisLayerinfoKey&&treeNode.treeNodeType&&treeNode.treeNodeType==data.gisLayerinfoKey){
  183. //alert(treeNode.treeNodeType+"--"+objdata.id);
  184. var originaldata = gisConfigBean.dataconfig[n];
  185. var data=jQuery.extend(true, {}, originaldata);
  186. if(data.Model&&data.Model[gis.script.modelid]){
  187. var model=data.Model[gis.script.modelid];
  188. data.datasetNames=data.datasetNames.split(",");
  189. data.fields=data.fields.split(",");
  190. data.cachedata=model.cachedata||data.cachedata;
  191. data.zoom=model.zoom||data.zoom;
  192. data.attributeFilter=data.gisLayerinfoAttrKey+"="+objdata.id;
  193. data.treelocationHighlight=model.treelocationHighlight||"false";
  194. data.url=data.url||defdataUrl;
  195. //alert(data.attributeFilter);
  196. gis.tree.loadServicetreelocation(data);
  197. }
  198. break;
  199. }
  200. }
  201. }
  202. }
  203. */
  204. gis.tree.beforeAsync = function(treeId, treeNode){
  205. if(treeNode){
  206. //otherParam.ttt.xx='xxx';
  207. //alert();
  208. }
  209. }
  210. gis.tree.parentcbdataInfostatistics= function(){
  211. if(parent&&parent.gis&&parent.gis.script&&parent.gis.script.cbdataInfostatistics){
  212. return parent.gis.script.cbdataInfostatistics;
  213. }
  214. return {};
  215. }
  216. gis.tree.getZTreeObj = function(){
  217. return $.fn.zTree.getZTreeObj("tree");
  218. }
  219. /*
  220. * 用于捕获异步加载正常结束的事件回调函数。如果设置了 setting.callback.beforeAsync 方法,且返回 false,将无法触发 onAsyncSuccess / onAsyncError 事件回调函数。
  221. */
  222. gis.tree.onAsyncSuccess = function(event, treeId, treeNode, msg){
  223. //alert(gis.tree.parentcbdataInfostatistics());
  224. gis.script.cbdataInfostatistics=gis.tree.parentcbdataInfostatistics();
  225. var treeObj = $.fn.zTree.getZTreeObj(treeId);
  226. if(!treeNode){
  227. if(treeObj){
  228. var nodes = treeObj.getNodes();
  229. /*
  230. for(var i in nodes){
  231. var node=nodes[i];
  232. alert(node.name);
  233. node.name="xxx";
  234. treeObj.updateNode(node);
  235. }
  236. */
  237. //debugger;
  238. gis.tree.updatecb(treeObj,nodes,null);
  239. }
  240. }else if(treeNode.treeNodeType&&treeNode.treeNodeType=="GK_BASIC_JSJY_GK_GQ"){
  241. //gis.script.loadConfigXmlBWService("bwsjServices",{id:"759DF99526FD4F7F934EF2DEC3C6CFF3",code:'32100104'});
  242. //alert(treeNode.name);
  243. //gis.tree.addcbtotree(treeNode,treeNode.treeNodeType,("V"+treeNode.code));
  244. parent.gis.script.loadConfigXmlBWService("bwsjServices",treeNode);
  245. }
  246. else{
  247. gis.tree.updatecb(treeObj,treeNode.children,treeNode);
  248. }
  249. }
  250. /*
  251. * 统计数据
  252. */
  253. gis.tree.getcbinfo=function(info,key,code){
  254. var s1=0;
  255. gis.script.cbdataInfostatistics=gis.tree.parentcbdataInfostatistics();
  256. if(info){
  257. if(!code){
  258. if(gis.script.cbdataInfostatistics[key]){
  259. for(var kk in gis.script.cbdataInfostatistics[key]){
  260. var v=gis.script.cbdataInfostatistics[key][kk];
  261. if(v){
  262. s1=s1+v.length;
  263. }
  264. }
  265. }
  266. }else{
  267. if(info[key]){
  268. var v=info[key][code];
  269. if(v){
  270. s1=v.length
  271. }
  272. }
  273. }
  274. }
  275. return s1;
  276. }
  277. /*
  278. * 根据动态船舶数据,统计数据,重新绘制tree。动态添加船舶节点。
  279. */
  280. gis.tree.updatecb = function(treeObj,nodes,pnode){
  281. gis.script.cbdataInfostatistics=gis.tree.parentcbdataInfostatistics();
  282. //console.log("1.gis.script.cbdataInfostatistics",gis.script.cbdataInfostatistics);
  283. if(nodes&&nodes.length){
  284. //debugger;
  285. //alert(nodes.length);
  286. for(var i in nodes){
  287. var node=nodes[i];
  288. //treeObj.showNode(node);
  289. if(node.treeNodeType&&node.treeNodeType=="HS_AIS"){
  290. continue;
  291. }
  292. if(node.open){
  293. //gis.tree.updatecb(treeObj,node.children);
  294. }
  295. gis.tree.updatecb(treeObj,node.children);
  296. //进出港船舶总数:系泊总数:靠泊危化品船
  297. var newName=[];
  298. var s1=0,s2=0,s3=0;
  299. if(!node.treeNodeType){
  300. s1=gis.tree.getcbinfo(gis.script.cbdataInfostatistics,"GK_BASIC_JSJY_GK_GK",null);
  301. s2=gis.tree.getcbinfo(gis.script.cbdataInfostatistics,"GK_BASIC_JSJY_GK_GK_STATUS",null);
  302. s3=gis.tree.getcbinfo(gis.script.cbdataInfostatistics,"GK_BASIC_JSJY_GK_GK_DANGER",null);
  303. newName.push("进出港:");
  304. newName.push(s1);
  305. newName.push(",系泊:");
  306. newName.push(s2);
  307. newName.push(",危化品:");
  308. newName.push(s3);
  309. }else{
  310. //GK_BASIC_JSJY_GK_GK_320001
  311. var vkey="V"+node.code;
  312. //console.log('>3>vkey:',vkey);
  313. s1=gis.tree.getcbinfo(gis.script.cbdataInfostatistics,node.treeNodeType,vkey);
  314. s2=gis.tree.getcbinfo(gis.script.cbdataInfostatistics,(node.treeNodeType+"_STATUS"),vkey);
  315. s3=gis.tree.getcbinfo(gis.script.cbdataInfostatistics,(node.treeNodeType+"_DANGER"),vkey);
  316. if(!node.oldname){
  317. node.oldname=node.name;
  318. }
  319. var nodename=node.oldname;
  320. if(gis.script.isBlank(nodename)){
  321. nodename="";
  322. }
  323. newName.push(nodename);
  324. newName.push("(");
  325. newName.push(s1);
  326. newName.push(",");
  327. newName.push(s2);
  328. newName.push(",");
  329. newName.push(s3);
  330. newName.push(")");
  331. }
  332. if(gis.tree.autohide0Node&&node.treeNodeType&&node.treeNodeType=='GK_BASIC_JSJY_GK_GQ'){
  333. if(s1<=0){
  334. node.isParent=false;
  335. }else{
  336. node.isParent=true;
  337. }
  338. }
  339. if(node.treeNodeType&&node.treeNodeType=='GK_BASIC_JSJY_JYR_BW'){
  340. //console.log('>2>node.treeNodeType:',node.treeNodeType);
  341. //console.log('>3>vkey:',vkey);
  342. if(s1>0){
  343. node.isParent=true;
  344. //node.open=false;
  345. //node.children=gis.tree.addcbtotree(node,[],node.treeNodeType,("V"+node.code));
  346. //alert(node.code)
  347. //node.children.push({"iconSkin":"","id":"01","isParent":false,"name":"行政单位","open":false,"pId":"","type":""})
  348. //treeObj.addNodes(node, {id:(100), pId:pnode.id, name:"new node"},true);
  349. gis.tree.addcbtotreeApi(treeObj,node,node.treeNodeType,("V"+node.code));
  350. }else{
  351. node.isParent=false;
  352. }
  353. //alert(node.isParent);
  354. }
  355. node.name=newName.join("");
  356. if(gis.tree.autohide0Node){
  357. if(node.treeNodeType&&(node.treeNodeType=='GK_BASIC_JSJY_JYR'||node.treeNodeType=='GK_BASIC_JSJY_JYR_BW')){
  358. //alert(1);
  359. if(s1<=0){
  360. treeObj.hideNode(node);
  361. continue;
  362. }else{
  363. treeObj.showNode(node);
  364. }
  365. }
  366. }
  367. treeObj.updateNode(node);
  368. }
  369. }
  370. }
  371. /*
  372. * 动态添加船舶节点。
  373. */
  374. gis.tree.addcbtotreeApi = function(treeObj,node,key,vkey){
  375. gis.script.cbdataInfostatistics=gis.tree.parentcbdataInfostatistics();
  376. if(gis.script.cbdataInfostatistics[key]){
  377. var v=gis.script.cbdataInfostatistics[key][vkey];
  378. if(v){
  379. //var newnode={"iconSkin":"","id":"01","isParent":false,"name":"行政单位","open":false,"pId":"","type":""}
  380. //var newnode={isParent:false,open:false,treeNodeType:"HS_AIS",pId:"",type:""};
  381. //console.log("vvv:",v);
  382. for(var ij=0;ij<v.length;ij++){
  383. var vo=v[ij];
  384. if(vo.arrt&&(!vo.arrt.cbshowinjyr||key!="GK_BASIC_JSJY_GK_GQ"||gis.tree.gqshowcbinbw)){
  385. //alert(vo.arrt.cbshowinjyr);
  386. var newnode=jQuery.extend(true, {isParent:false,open:false,treeNodeType:"HS_AIS",pId:"",type:""}, vo.arrt);
  387. newnode.id="mmsi"+(ij+(vo.arrt.mmsi));
  388. if(gis.script.isBlank(newnode.name)){
  389. newnode.name="";
  390. if(!gis.script.isBlank(vo.arrt.mmsi)){
  391. newnode.name="("+vo.arrt.mmsi+")";
  392. }
  393. }
  394. //console.log("newnode:",newnode);
  395. newnode.iconSkin="";
  396. if(newnode.danger&&newnode.danger==1
  397. &&newnode.status&&newnode.status==5){
  398. newnode.iconSkin="icon001"
  399. }else if(newnode.status&&newnode.status==5){
  400. newnode.iconSkin="icon002";
  401. }else if(newnode.danger&&newnode.danger==1){
  402. newnode.iconSkin="icon003";
  403. }
  404. //console.log("vvv:",newnode);
  405. //gis.script.openbwjlj
  406. //console.log("vvv:",parent.gis.script.openbwjlj[node.id]);
  407. if(parent&&parent.gis&&parent.gis.script.openbwjlj&&parent.gis.script.openbwjlj[node.id]){
  408. treeObj.addNodes(node, newnode,false);
  409. }else{
  410. treeObj.addNodes(node, newnode,true);
  411. }
  412. }
  413. }
  414. }
  415. }
  416. }
  417. gis.tree.addcbtotree = function(node,carray,key,vkey){
  418. var children=carray||[];
  419. gis.script.cbdataInfostatistics=gis.tree.parentcbdataInfostatistics();
  420. if(gis.script.cbdataInfostatistics[key]){
  421. var v=gis.script.cbdataInfostatistics[key][vkey];
  422. if(v){
  423. //var newnode={"iconSkin":"","id":"01","isParent":false,"name":"行政单位","open":false,"pId":"","type":""}
  424. //var newnode={isParent:false,open:false,treeNodeType:"HS_AIS",pId:"",type:""};
  425. //console.log("vvv:",v);
  426. for(var ij=0;ij<v.length;ij++){
  427. var vo=v[ij];
  428. if(vo.arrt){
  429. var newnode=jQuery.extend(true, {isParent:false,open:false,treeNodeType:"HS_AIS",pId:"",type:""}, vo.arrt);
  430. if(gis.script.isBlank(newnode.name)){
  431. newnode.name="";
  432. }
  433. //console.log("newnode:",newnode);
  434. newnode.iconSkin="";
  435. if(newnode.danger&&newnode.danger==1
  436. &&newnode.status&&newnode.status==5){
  437. newnode.iconSkin="icon001"
  438. }else if(newnode.status&&newnode.status==5){
  439. newnode.iconSkin="icon002";
  440. }else if(newnode.danger&&newnode.danger==1){
  441. newnode.iconSkin="icon003";
  442. }
  443. /*
  444. if(newnode.status&&newnode.status==5){
  445. newnode.iconSkin="icon03";
  446. }
  447. if(newnode.danger&&newnode.danger==1){
  448. newnode.iconSkin="icon01";
  449. }
  450. */
  451. children.push(newnode);
  452. }
  453. }
  454. }
  455. }
  456. return children;
  457. }
  458. gis.tree.updatenodecb = function(treeObj,nodes){
  459. }
  460. gis.tree.initcbtree = function(){
  461. var setting = {
  462. view: {
  463. selectedMulti: false,
  464. showIcon: gis.tree.showIconForTree
  465. },
  466. key: {
  467. title:"title"
  468. },
  469. async: {
  470. enable: true,
  471. type: "post",
  472. dataType:"json",
  473. contentType: "application/json",
  474. url: contextPath+"/zygl/treejson.html",
  475. autoParam: ["id", "name","treeNodeType"],
  476. otherParam: {async:'treejson',rootName:"船舶总数",isHidden:(gis.tree.autohide0Node?1:0) },
  477. dataFilter: gis.tree.filter
  478. },
  479. callback: {
  480. onDblClick: gis.tree.nodeClick,
  481. beforeAsync: gis.tree.beforeAsync,
  482. onAsyncSuccess: gis.tree.onAsyncSuccess,
  483. onClick: function(event, treeId, treeNode) {
  484. //alert(this);return;
  485. var treeObj = $.fn.zTree.getZTreeObj(treeId);
  486. treeObj.expandNode(treeNode,true,false,false,false);
  487. }
  488. }
  489. };
  490. $.fn.zTree.init($("#tree"), setting);
  491. }
  492. gis.tree.parentloadcbdataService = function(){
  493. if(parent&&parent.gis&&parent.gis.script&&parent.gis.script.loadcbdataService){
  494. //alert(gis.tree.phase.init);
  495. parent.gis.script.loadcbdataService(gis.tree.phase.init);
  496. return;
  497. }
  498. gis.script.loadcbdataService(obj);
  499. }
  500. $(document).ready(function() {
  501. /*
  502. var treediv=$("#treediv");
  503. var tree=$("#tree");
  504. //alert($.support.leadingWhitespace)
  505. if($.support&&$.support.leadingWhitespace){
  506. tree.css("width",treediv.width()-10);
  507. tree.css("height",treediv.height()-10);
  508. }
  509. */
  510. //$("#othen").css("display","none");
  511. //tree.css("height",treediv.height()-$("#othen").height());
  512. //tree.css("height",treediv.height());
  513. //gis.tree.initcbtree();
  514. /*
  515. if(gis.script.loadcbdataService){
  516. gis.script.loadcbdataService(gis.script.phase.init);
  517. }
  518. */
  519. //alert();
  520. gis.tree.parentloadcbdataService();
  521. });