infoWindowHandle.as 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. import com.common.ConstUtil;
  2. import com.supermap.web.core.Feature;
  3. import com.supermap.web.mapping.Map;
  4. import com.utils.CommonUtility;
  5. import com.view.Bw;
  6. import com.view.Ccss;
  7. import com.view.Cg;
  8. import com.view.QskGrid;
  9. import com.view.Whqy;
  10. import com.view.Yjwl;
  11. import com.view.YjwzGrid;
  12. import com.view.YjwzWindow;
  13. import flash.display.DisplayObject;
  14. import mx.collections.ArrayCollection;
  15. import mx.containers.Grid;
  16. import mx.controls.Alert;
  17. import mx.core.FlexGlobals;
  18. import mx.core.UIComponent;
  19. import mx.events.CloseEvent;
  20. import mx.managers.PopUpManager;
  21. import mx.resources.IResourceManager;
  22. import mx.resources.ResourceManager;
  23. import mx.rpc.events.ResultEvent;
  24. import spark.components.TitleWindow;
  25. private var ccss:Ccss=new Ccss;
  26. private var qskGrid:QskGrid=new QskGrid;
  27. private var whqy:Whqy=new Whqy;
  28. private var yjwzGrid:YjwzGrid=new YjwzGrid;
  29. private var yjwzWin:YjwzWindow = new YjwzWindow;
  30. // 应急网络
  31. private var yjwl:Yjwl = new Yjwl;
  32. // 储罐
  33. private var cg:Cg = new Cg;
  34. // 泊位
  35. private var bw:Bw = new Bw;
  36. private var jyrId:String="";
  37. private var currFea:Feature;
  38. private function showInfoGrid(fea:Feature):void{
  39. this.currFea = fea;
  40. var id:String = fea.attributes.ID;
  41. var name:String = fea.name;
  42. var attrs:Object = fea.attributes;
  43. this.map.infoWindow.content=getInfoWinGrid(id,name,attrs);
  44. }
  45. private function getInfoWinGrid(id:String,name:String,attrs:Object):UIComponent
  46. {
  47. jyrId=id;
  48. if(ConstUtil.L_ID_AQ_WHPCCSS==name){
  49. ccss.recordId=id;
  50. CommonUtility.callRemote("gisController","ccss",Yjpt_resultHandler,id);
  51. return ccss;
  52. }
  53. else if(ConstUtil.L_ID_AQ_WXHWQY==name){
  54. CommonUtility.callRemote("gisController","whqy",Yjpt_resultHandler,id);
  55. whqy.recordId = id;
  56. // 半径五公里资料搜索点
  57. FlexGlobals.topLevelApplication.toolsCt.currId = id;
  58. return whqy;
  59. }
  60. else if(ConstUtil.L_ID_AQ_QSK==name){
  61. CommonUtility.callRemote("gisController","qsk",Yjpt_resultHandler,id);
  62. return qskGrid;
  63. }
  64. else if(ConstUtil.L_ID_BW_AQ==name){
  65. // detailCt.show = false;
  66. bw.smid = attrs.ID;
  67. CommonUtility.callRemote("gisController","searchBw",Yjpt_resultHandler,attrs.ID);
  68. return bw;
  69. }
  70. else if(ConstUtil.L_ID_AQ_YJWZK==name){
  71. CommonUtility.callRemote("gisController","yjwz_dw",Yjpt_resultHandler,id);
  72. return yjwzGrid;
  73. }
  74. else if(ConstUtil.L_ID_AQ_ZDWXYQY==name){
  75. ccss.recordId=id;
  76. CommonUtility.callRemote("gisController","ccss",Yjpt_resultHandler,id);
  77. return ccss;
  78. }
  79. else if(ConstUtil.L_ID_AQ_GQ==name){
  80. cg.jyrmc=attrs.JYRMC;
  81. cg.gqmc=attrs.GQMC;
  82. CommonUtility.callRemote("gisController","searchCg",Yjpt_resultHandler,attrs.JYR,attrs.GQMC);
  83. return cg;
  84. }
  85. else if(ConstUtil.L_ID_AQ_XF==name||ConstUtil.L_ID_AQ_YY==name||ConstUtil.L_ID_AQ_JJ==name||ConstUtil.L_ID_AQ_GA==name
  86. ||ConstUtil.L_ID_AQ_BF==name||ConstUtil.L_ID_AQ_HB==name||ConstUtil.L_ID_AQ_SJZX==name){
  87. CommonUtility.callRemote("gisController","yjwl",Yjpt_resultHandler,id);
  88. return yjwl;
  89. }
  90. return new Grid();
  91. }
  92. protected var rm:IResourceManager = ResourceManager.getInstance();
  93. protected function Yjpt_resultHandler(event:ResultEvent):void
  94. {
  95. var qy:Object= null;
  96. if("qsk"==event.token.message["operation"]){
  97. var list:ArrayCollection=event.result as ArrayCollection;
  98. qskGrid.list=list;
  99. this.map.infoWindow.show(currFea.geometry.center);
  100. }
  101. else if("whqy"==event.token.message["operation"]){
  102. qy=event.result;
  103. if(null != qy){
  104. whqy.gqmc=qy["GQMC"];
  105. whqy.gkjyr=qy["GKJYR"];
  106. whqy.bwmc=qy["BWMC"];
  107. whqy.hckpnl=qy["HCKPNL"];
  108. whqy.ttl=qy["TTL"];
  109. whqy.mtmc=qy["MTMC"];
  110. whqy.zyhz=qy["ZYHZ"];
  111. whqy.aqfzrlxdh=qy["AQFZRLXDH"];
  112. whqy.gkjyxkzh=qy["GKJYXKZH"];
  113. whqy.zyfzbh=qy["ZYFZBH"];
  114. }else{
  115. whqy.gqmc="";
  116. whqy.gkjyr="";
  117. whqy.bwmc="";
  118. whqy.hckpnl="";
  119. whqy.ttl="";
  120. whqy.mtmc="";
  121. whqy.zyhz="";
  122. whqy.aqfzrlxdh="";
  123. whqy.gkjyxkzh="";
  124. whqy.zyfzbh="";
  125. }
  126. this.map.infoWindow.show(currFea.geometry.center);
  127. }
  128. else if("ccss"==event.token.message["operation"]){
  129. qy=event.result;
  130. if(null !=qy){
  131. ccss.gqmc=qy["GQMC"];
  132. ccss.gkjyr=qy["GKJYR"];
  133. ccss.rj=qy["RJ"];
  134. ccss.cg=qy["CG"];
  135. ccss.gs=qy["GS"];
  136. ccss.wxygs=qy["WXYGS"];
  137. ccss.zyhz=qy["ZYHZ"];
  138. ccss.aqfzrlxdh=qy["AQFZRLXDH"];
  139. ccss.gkjyxkzh=qy["GKJYXKZH"];
  140. ccss.zyfzbh=qy["ZYFZBH"];
  141. }else{
  142. ccss.gqmc="";
  143. ccss.gkjyr="";
  144. ccss.rj="";
  145. ccss.cg="";
  146. ccss.gs="";
  147. ccss.wxygs="";
  148. ccss.zyhz="";
  149. ccss.aqfzrlxdh="";
  150. ccss.gkjyxkzh="";
  151. ccss.zyfzbh="";
  152. }
  153. this.map.infoWindow.show(currFea.geometry.center);
  154. }
  155. else if("yjwz_jyr"==event.token.message["operation"]){
  156. var yjwz:ArrayCollection=event.result as ArrayCollection;
  157. yjwzWin.list =yjwz;
  158. PopUpManager.addPopUp(yjwzWin,FlexGlobals.topLevelApplication as DisplayObject,false);
  159. PopUpManager.centerPopUp(yjwzWin);
  160. this.map.infoWindow.show(currFea.geometry.center);
  161. }
  162. else if("yjwz_dw"==event.token.message["operation"]){
  163. var yjwz:ArrayCollection=event.result as ArrayCollection;
  164. var name:String="";
  165. var xh:Number=0;
  166. var tjList:ArrayCollection=new ArrayCollection;
  167. for each(var o:Object in yjwz){
  168. o["WZFL"]=rm.getString("select",o["WZFL"]);
  169. if(name!=o["WZFL"]){
  170. var obj:Object=new Object;
  171. obj["WZFL"]=o["WZFL"];
  172. obj["index"]=yjwz.getItemIndex(o);
  173. tjList.addItemAt(obj,0);
  174. name=o["WZFL"];
  175. xh=0;
  176. }
  177. o["WZFL"]=++xh;
  178. }
  179. for each(var o:Object in tjList){
  180. yjwz.addItemAt(o,o.index);
  181. }
  182. yjwzGrid.list=yjwz;
  183. if(yjwz.length>0)
  184. {
  185. yjwzGrid.mc=yjwz.getItemAt(0)["MC"];
  186. }
  187. this.map.infoWindow.show(currFea.geometry.center);
  188. } // 应急网络
  189. else if("yjwl"==event.token.message["operation"]){
  190. qy=event.result;
  191. if(null != qy){
  192. yjwl.yjwlName=qy["NAME"];
  193. yjwl.szd=rm.getString("select",qy["SZDMC"]);
  194. yjwl.gq=qy["GQMC"];
  195. yjwl.address=qy["ADDRESS"];
  196. yjwl.tel=qy["TEL"];
  197. yjwl.remark=qy["REMARK"];
  198. }else{
  199. yjwl.yjwlName="";
  200. yjwl.szd="";
  201. yjwl.gq="";
  202. yjwl.address="";
  203. yjwl.tel="";
  204. yjwl.remark="";
  205. }
  206. this.map.infoWindow.show(currFea.geometry.center);
  207. }
  208. else if("searchCg"==event.token.message["operation"]){
  209. var list:ArrayCollection=event.result as ArrayCollection;
  210. cg.list = list;
  211. this.map.infoWindow.show(currFea.geometry.center);
  212. }
  213. else if("searchBw"==event.token.message["operation"]){
  214. qy=event.result;
  215. if(null != qy){
  216. bw.bwmc=qy["BWMC"];
  217. bw.jyrmc=qy["GKJYR"];
  218. bw.records=qy["RECORDS"];
  219. bw.szdmc = qy["SZDMC"];
  220. bw.gqmc = qy["GQMC"];
  221. bw.bwcd = qy["BWCD"];
  222. bw.sjkpnl = qy["SJKPNL"];
  223. bw.nhwtgml = qy["NHWTGML"];
  224. bw.qysjsh = qy["QYSJSH"];
  225. bw.fwlxmc = qy["FWLXMC"];
  226. this.map.infoWindow.show(currFea.geometry.center);
  227. }else{
  228. bw.bwmc="";
  229. bw.jyrmc="";
  230. bw.records=new ArrayCollection;
  231. bw.szdmc = "";
  232. bw.gqmc = "";
  233. bw.bwcd = "";
  234. bw.sjkpnl = "";
  235. bw.nhwtgml = "";
  236. bw.qysjsh = "";
  237. bw.fwlxmc = "";
  238. this.map.infoWindow.hide();
  239. }
  240. }
  241. }