123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248 |
- import com.common.ConstUtil;
- import com.supermap.web.core.Feature;
- import com.supermap.web.mapping.Map;
- import com.utils.CommonUtility;
- import com.view.Bw;
- import com.view.Ccss;
- import com.view.Cg;
- import com.view.QskGrid;
- import com.view.Whqy;
- import com.view.Yjwl;
- import com.view.YjwzGrid;
- import com.view.YjwzWindow;
- import flash.display.DisplayObject;
- import mx.collections.ArrayCollection;
- import mx.containers.Grid;
- import mx.controls.Alert;
- import mx.core.FlexGlobals;
- import mx.core.UIComponent;
- import mx.events.CloseEvent;
- import mx.managers.PopUpManager;
- import mx.resources.IResourceManager;
- import mx.resources.ResourceManager;
- import mx.rpc.events.ResultEvent;
- import spark.components.TitleWindow;
- private var ccss:Ccss=new Ccss;
- private var qskGrid:QskGrid=new QskGrid;
- private var whqy:Whqy=new Whqy;
- private var yjwzGrid:YjwzGrid=new YjwzGrid;
- private var yjwzWin:YjwzWindow = new YjwzWindow;
- // 应急网络
- private var yjwl:Yjwl = new Yjwl;
- // 储罐
- private var cg:Cg = new Cg;
- // 泊位
- private var bw:Bw = new Bw;
- private var jyrId:String="";
- private var currFea:Feature;
- private function showInfoGrid(fea:Feature):void{
- this.currFea = fea;
- var id:String = fea.attributes.ID;
- var name:String = fea.name;
- var attrs:Object = fea.attributes;
- this.map.infoWindow.content=getInfoWinGrid(id,name,attrs);
- }
- private function getInfoWinGrid(id:String,name:String,attrs:Object):UIComponent
- {
- jyrId=id;
- if(ConstUtil.L_ID_AQ_WHPCCSS==name){
- ccss.recordId=id;
- CommonUtility.callRemote("gisController","ccss",Yjpt_resultHandler,id);
- return ccss;
- }
- else if(ConstUtil.L_ID_AQ_WXHWQY==name){
- CommonUtility.callRemote("gisController","whqy",Yjpt_resultHandler,id);
- whqy.recordId = id;
- // 半径五公里资料搜索点
- FlexGlobals.topLevelApplication.toolsCt.currId = id;
- return whqy;
- }
- else if(ConstUtil.L_ID_AQ_QSK==name){
- CommonUtility.callRemote("gisController","qsk",Yjpt_resultHandler,id);
- return qskGrid;
- }
- else if(ConstUtil.L_ID_BW_AQ==name){
- // detailCt.show = false;
- bw.smid = attrs.ID;
- CommonUtility.callRemote("gisController","searchBw",Yjpt_resultHandler,attrs.ID);
- return bw;
- }
- else if(ConstUtil.L_ID_AQ_YJWZK==name){
- CommonUtility.callRemote("gisController","yjwz_dw",Yjpt_resultHandler,id);
- return yjwzGrid;
- }
- else if(ConstUtil.L_ID_AQ_ZDWXYQY==name){
- ccss.recordId=id;
- CommonUtility.callRemote("gisController","ccss",Yjpt_resultHandler,id);
- return ccss;
- }
- else if(ConstUtil.L_ID_AQ_GQ==name){
- cg.jyrmc=attrs.JYRMC;
- cg.gqmc=attrs.GQMC;
- CommonUtility.callRemote("gisController","searchCg",Yjpt_resultHandler,attrs.JYR,attrs.GQMC);
- return cg;
- }
- 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
- ||ConstUtil.L_ID_AQ_BF==name||ConstUtil.L_ID_AQ_HB==name||ConstUtil.L_ID_AQ_SJZX==name){
- CommonUtility.callRemote("gisController","yjwl",Yjpt_resultHandler,id);
- return yjwl;
- }
- return new Grid();
- }
- protected var rm:IResourceManager = ResourceManager.getInstance();
- protected function Yjpt_resultHandler(event:ResultEvent):void
- {
- var qy:Object= null;
- if("qsk"==event.token.message["operation"]){
- var list:ArrayCollection=event.result as ArrayCollection;
- qskGrid.list=list;
- this.map.infoWindow.show(currFea.geometry.center);
- }
- else if("whqy"==event.token.message["operation"]){
- qy=event.result;
- if(null != qy){
- whqy.gqmc=qy["GQMC"];
- whqy.gkjyr=qy["GKJYR"];
- whqy.bwmc=qy["BWMC"];
- whqy.hckpnl=qy["HCKPNL"];
- whqy.ttl=qy["TTL"];
- whqy.mtmc=qy["MTMC"];
- whqy.zyhz=qy["ZYHZ"];
- whqy.aqfzrlxdh=qy["AQFZRLXDH"];
- whqy.gkjyxkzh=qy["GKJYXKZH"];
- whqy.zyfzbh=qy["ZYFZBH"];
- }else{
- whqy.gqmc="";
- whqy.gkjyr="";
- whqy.bwmc="";
- whqy.hckpnl="";
- whqy.ttl="";
- whqy.mtmc="";
- whqy.zyhz="";
- whqy.aqfzrlxdh="";
- whqy.gkjyxkzh="";
- whqy.zyfzbh="";
- }
- this.map.infoWindow.show(currFea.geometry.center);
- }
- else if("ccss"==event.token.message["operation"]){
- qy=event.result;
- if(null !=qy){
- ccss.gqmc=qy["GQMC"];
- ccss.gkjyr=qy["GKJYR"];
- ccss.rj=qy["RJ"];
- ccss.cg=qy["CG"];
- ccss.gs=qy["GS"];
- ccss.wxygs=qy["WXYGS"];
- ccss.zyhz=qy["ZYHZ"];
- ccss.aqfzrlxdh=qy["AQFZRLXDH"];
- ccss.gkjyxkzh=qy["GKJYXKZH"];
- ccss.zyfzbh=qy["ZYFZBH"];
- }else{
- ccss.gqmc="";
- ccss.gkjyr="";
- ccss.rj="";
- ccss.cg="";
- ccss.gs="";
- ccss.wxygs="";
- ccss.zyhz="";
- ccss.aqfzrlxdh="";
- ccss.gkjyxkzh="";
- ccss.zyfzbh="";
- }
- this.map.infoWindow.show(currFea.geometry.center);
- }
- else if("yjwz_jyr"==event.token.message["operation"]){
- var yjwz:ArrayCollection=event.result as ArrayCollection;
- yjwzWin.list =yjwz;
- PopUpManager.addPopUp(yjwzWin,FlexGlobals.topLevelApplication as DisplayObject,false);
- PopUpManager.centerPopUp(yjwzWin);
- this.map.infoWindow.show(currFea.geometry.center);
- }
- else if("yjwz_dw"==event.token.message["operation"]){
- var yjwz:ArrayCollection=event.result as ArrayCollection;
- var name:String="";
- var xh:Number=0;
- var tjList:ArrayCollection=new ArrayCollection;
- for each(var o:Object in yjwz){
- o["WZFL"]=rm.getString("select",o["WZFL"]);
- if(name!=o["WZFL"]){
- var obj:Object=new Object;
- obj["WZFL"]=o["WZFL"];
- obj["index"]=yjwz.getItemIndex(o);
- tjList.addItemAt(obj,0);
- name=o["WZFL"];
- xh=0;
- }
- o["WZFL"]=++xh;
- }
- for each(var o:Object in tjList){
- yjwz.addItemAt(o,o.index);
- }
- yjwzGrid.list=yjwz;
- if(yjwz.length>0)
- {
- yjwzGrid.mc=yjwz.getItemAt(0)["MC"];
- }
- this.map.infoWindow.show(currFea.geometry.center);
- } // 应急网络
- else if("yjwl"==event.token.message["operation"]){
- qy=event.result;
- if(null != qy){
- yjwl.yjwlName=qy["NAME"];
- yjwl.szd=rm.getString("select",qy["SZDMC"]);
- yjwl.gq=qy["GQMC"];
- yjwl.address=qy["ADDRESS"];
- yjwl.tel=qy["TEL"];
- yjwl.remark=qy["REMARK"];
- }else{
- yjwl.yjwlName="";
- yjwl.szd="";
- yjwl.gq="";
- yjwl.address="";
- yjwl.tel="";
- yjwl.remark="";
- }
- this.map.infoWindow.show(currFea.geometry.center);
- }
- else if("searchCg"==event.token.message["operation"]){
- var list:ArrayCollection=event.result as ArrayCollection;
- cg.list = list;
- this.map.infoWindow.show(currFea.geometry.center);
- }
- else if("searchBw"==event.token.message["operation"]){
- qy=event.result;
- if(null != qy){
- bw.bwmc=qy["BWMC"];
- bw.jyrmc=qy["GKJYR"];
- bw.records=qy["RECORDS"];
- bw.szdmc = qy["SZDMC"];
- bw.gqmc = qy["GQMC"];
- bw.bwcd = qy["BWCD"];
- bw.sjkpnl = qy["SJKPNL"];
- bw.nhwtgml = qy["NHWTGML"];
- bw.qysjsh = qy["QYSJSH"];
- bw.fwlxmc = qy["FWLXMC"];
- this.map.infoWindow.show(currFea.geometry.center);
- }else{
- bw.bwmc="";
- bw.jyrmc="";
- bw.records=new ArrayCollection;
- bw.szdmc = "";
- bw.gqmc = "";
- bw.bwcd = "";
- bw.sjkpnl = "";
- bw.nhwtgml = "";
- bw.qysjsh = "";
- bw.fwlxmc = "";
- this.map.infoWindow.hide();
- }
- }
- }
|