MapTools.mxml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <s:BorderContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
  3. xmlns:s="library://ns.adobe.com/flex/spark"
  4. xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:tree="com.tree.*"
  5. width="400" height="300" cornerRadius="5" borderColor="black" borderAlpha=".5" backgroundColor="#4fafe4"
  6. borderWeight="1" creationComplete="creationCompleteHandler(event)" xmlns:ui="com.view.ui.*" >
  7. <s:layout>
  8. <s:VerticalLayout gap="0"/>
  9. </s:layout>
  10. <fx:Declarations>
  11. <!-- Place non-visual elements (e.g., services, value objects) here -->
  12. </fx:Declarations>
  13. <fx:Script>
  14. <![CDATA[
  15. import com.common.ConstUtil;
  16. import com.utils.CommonUtility;
  17. import com.events.MenusEvent;
  18. import com.supermap.framework.events.BaseEventDispatcher;
  19. import com.supermap.web.core.Feature;
  20. import com.view.YjwzWindow;
  21. import com.view.yjcz.YjczWindow;
  22. import mx.collections.ArrayCollection;
  23. import mx.collections.XMLListCollection;
  24. import mx.controls.Alert;
  25. import mx.core.FlexGlobals;
  26. import mx.events.FlexEvent;
  27. import mx.managers.PopUpManager;
  28. import mx.rpc.events.ResultEvent;
  29. [Bindable]
  30. public var menuXML:XML = null;
  31. [Bindable]
  32. public var treeClickFun:Function;
  33. [Bindable]
  34. private var queryData:ArrayCollection = new ArrayCollection();
  35. public var currId:String;
  36. private var currSZD:String = null;
  37. private var showWz:Boolean=false;
  38. private var yjczWindow:YjczWindow = new YjczWindow;
  39. protected static var dataXML:XML=
  40. <SjlxSelect>
  41. <item id="0" localeName=""/>
  42. <item id="1" localeName="sjlx.yryb" />
  43. <item id="2" localeName="sjlx.ydyh" />
  44. <item id="3" localeName="sjlx.ztdhz" />
  45. <item id="4" localeName="sjlx.ztdbz" />
  46. <item id="5" localeName="sjlx.ztdypxl" />
  47. <item id="6" localeName="sjlx.ztdzrzh" />
  48. </SjlxSelect>
  49. ;
  50. [Bindable]
  51. protected var sglxArr:ArrayCollection=new ArrayCollection([{id:"0",localeName:"sjlx.yz"}]);
  52. private var yjwzWin:YjwzWindow = new YjwzWindow;
  53. protected function hiddenLable_clickHandler(event:MouseEvent):void
  54. {
  55. BaseEventDispatcher.getInstance().dispatchEvent(new MenusEvent(MenusEvent.MENUHIDE,"hide"));
  56. }
  57. protected function radiusKeyDown(event:KeyboardEvent):void
  58. {
  59. if(event.keyCode == 13)//Enter键
  60. {
  61. searchFun();
  62. }
  63. }
  64. protected function radiusYjwlKeyDown(event:KeyboardEvent):void
  65. {
  66. if(event.keyCode == 13)//Enter键
  67. {
  68. searchYjwlFun();
  69. }
  70. }
  71. //监听键盘点击事件,Enter键,ESC键
  72. protected function txtKeyDown(event:KeyboardEvent):void
  73. {
  74. if(event.keyCode == 13)//Enter键
  75. {
  76. queryClickHandler(null);
  77. }
  78. }
  79. protected function queryClickHandler(event:MouseEvent):void
  80. {
  81. this.queryData.removeAll();
  82. this.queryData.refresh();
  83. var name:String = this.mccx.text;
  84. CommonUtility.callRemote("gisController","queryCompByName",resultHandler,name);
  85. }
  86. protected function resultHandler(event:ResultEvent):void
  87. {
  88. currId ="";
  89. currSZD="0";
  90. var qy:Object= null;
  91. if("queryCompByName"==event.token.message["operation"]){
  92. var list:ArrayCollection=event.result as ArrayCollection;
  93. this.queryData=list;
  94. // 仅有一条记录时直接定位
  95. if(list.length==1)
  96. {
  97. var id:String = list[0].ID as String;
  98. currId = id;
  99. currSZD = list[0].SZD as String;
  100. var nm:String = list[0].NAME as String;
  101. FlexGlobals.topLevelApplication.locateJyr(id,nm);
  102. }
  103. }
  104. }
  105. /**
  106. * 经营人查询结果一览双击定位处理
  107. */
  108. protected function resultGrid_doubleClickHandler(event:MouseEvent):void
  109. {
  110. if(resultGrid.selectedItems == null || resultGrid.selectedItems.length == 0)
  111. {
  112. return;
  113. }
  114. else if(resultGrid.selectedItems.length > 1)
  115. {
  116. return;
  117. }
  118. var id:String = resultGrid.selectedItems[0].ID as String;
  119. currId = id;
  120. currSZD = resultGrid.selectedItems[0].SZD as String;
  121. var nm:String = resultGrid.selectedItems[0].NAME as String;
  122. FlexGlobals.topLevelApplication.locateJyr(id,nm);
  123. }
  124. protected function fieldTypeLabel(item:Object):String
  125. {
  126. if(null != item){
  127. return resourceManager.getString('select',item.@localeName);
  128. }
  129. return "";
  130. }
  131. protected function creationCompleteHandler(event:FlexEvent):void
  132. {
  133. BaseEventDispatcher.getInstance().addEventListener(QueryLayerEvent.QUERY_SUCCESS, queryLayerSuccess);
  134. }
  135. protected function sglx_creationCompleteHandler(event:FlexEvent):void
  136. {
  137. sglx.dataProvider= new XMLListCollection(dataXML..item);
  138. sglx.textInput.editable = false;
  139. sglx.textInput.setStyle("borderColor","#d2d2d2");
  140. }
  141. public function searchFun():void
  142. {
  143. if(!currId)
  144. {
  145. return;
  146. }
  147. var layerArr:ArrayCollection = new ArrayCollection;
  148. layerArr.addItem(ConstUtil.L_ID_AQ_YJWZK);
  149. FlexGlobals.topLevelApplication.bufferQuery(ConstUtil.L_ID_AQ_WXHWQY,currId,layerArr,new Number(radius.text));
  150. showWz = true;
  151. }
  152. public function searchYjwlFun():void
  153. {
  154. if(!currId)
  155. {
  156. return;
  157. }
  158. var layerArr:ArrayCollection = new ArrayCollection;
  159. layerArr.addItem(ConstUtil.L_ID_AQ_YJWZK);
  160. layerArr.addItem(ConstUtil.L_ID_AQ_XF);
  161. layerArr.addItem(ConstUtil.L_ID_AQ_JJ);
  162. layerArr.addItem(ConstUtil.L_ID_AQ_GA);
  163. layerArr.addItem(ConstUtil.L_ID_AQ_YY);
  164. layerArr.addItem(ConstUtil.L_ID_AQ_HB);
  165. layerArr.addItem(ConstUtil.L_ID_AQ_BF);
  166. layerArr.addItem(ConstUtil.L_ID_AQ_SJZX);
  167. FlexGlobals.topLevelApplication.bufferQuery(ConstUtil.L_ID_AQ_WXHWQY,currId,layerArr,new Number(radiusYjwl.text));
  168. }
  169. private function queryLayerSuccess(event:QueryLayerEvent):void
  170. {
  171. if(!showWz)
  172. {
  173. return;
  174. }
  175. showWz=false;
  176. var obj:Object = event.data;
  177. var features:Array = obj.features;
  178. var layerId:String = obj.layerId;
  179. if("L_ID_AQ_YJWZK" !=layerId)
  180. {
  181. return;
  182. }
  183. var ids:String = "";
  184. for each(var fea:Feature in features)
  185. {
  186. ids +=","+fea.attributes.ID;
  187. }
  188. if(ids.length>0)
  189. {
  190. ids = ids.substr(1);
  191. }
  192. CommonUtility.callRemote("gisController","queryWz",Yjpt_resultHandler,ids,null);
  193. }
  194. protected function Yjpt_resultHandler(event:ResultEvent):void
  195. {
  196. var yjwz:ArrayCollection=event.result as ArrayCollection;
  197. yjwzWin.list=yjwz;
  198. PopUpManager.addPopUp(yjwzWin,FlexGlobals.topLevelApplication as DisplayObject,true);
  199. PopUpManager.centerPopUp(yjwzWin);
  200. }
  201. /** 应急专家 */
  202. public function expert_clickHandler(event:MouseEvent = null,type:String = null):void
  203. {
  204. FlexGlobals.topLevelApplication.showExpert(null,currSZD);
  205. }
  206. /** 应急处置 */
  207. public function yjcz_clickHandler(event:MouseEvent = null,type:String = null):void
  208. {
  209. if(null != sglx)
  210. {
  211. yjczWindow.selectedSjlx = sglx.selectedIndex;
  212. }
  213. if(null != this.currSZD)
  214. {
  215. yjczWindow.selectSzd =new Number(this.currSZD);
  216. }
  217. yjczWindow.yappFun(null);
  218. PopUpManager.addPopUp(yjczWindow,FlexGlobals.topLevelApplication as DisplayObject,true);
  219. PopUpManager.centerPopUp(yjczWindow);
  220. }
  221. protected function saveHandler(event:MouseEvent):void
  222. {
  223. var param:Object={
  224. sgsj:sgsj.dateTime,
  225. sgdd:sgdd.text,
  226. sgwz:sgwz.text,
  227. sgxz:sgxz.text,
  228. sgqy:sgqy.text,
  229. sggm:sggm.text,
  230. rysw:rysw.text,
  231. xcjy:xcjy.text,
  232. bjr:bjr.text,
  233. bjrlxfs:bjrlxfs.text
  234. };
  235. CommonUtility.callRemote("gisController","saveJjxx",Yjpt_resultHandler,param);
  236. }
  237. protected function saveJjxx_resultHandler(event:ResultEvent):void
  238. {
  239. sgsj.dateTime = new Date;
  240. sgdd.text ="";
  241. sgwz.text ="";
  242. sgxz.text ="";
  243. sgqy.text ="";
  244. sggm.text ="";
  245. rysw.text ="";
  246. xcjy.text ="";
  247. bjr.text ="";
  248. bjrlxfs.text ="";
  249. Alert.show("保存成功!","提示");
  250. }
  251. ]]>
  252. </fx:Script>
  253. <mx:HBox width="100%" height="30" horizontalGap="0" backgroundColor="#136287" verticalAlign="middle">
  254. <s:Label text=" 应急处置" fontSize="18" fontWeight="bold" fontFamily="宋体" color="white" height="100%" width="55%" textAlign="left" verticalAlign="middle"/>
  255. <s:Spacer width="100%"/>
  256. <s:Label text="&gt;&gt;" click="hiddenLable_clickHandler(event)" toolTip="隐藏" useHandCursor="true" buttonMode="true" color="white" fontWeight="normal"/>
  257. <s:Spacer width="10"/>
  258. </mx:HBox>
  259. <mx:Accordion id="accordion" height="100%" width="100%" accentColor="0" selectedIndex="1" borderVisible="false" headerHeight="32" historyManagementEnabled="false" headerStyleName="AccordionHeader">
  260. <mx:headerRenderer>
  261. <fx:Component>
  262. <mx:Button
  263. upSkin="@Embed('images/menu.jpg')"
  264. overSkin="@Embed('images/menu.jpg')"
  265. downSkin="@Embed('images/menu.jpg')"
  266. disabledSkin="@Embed('images/menu.jpg')"
  267. fontSize="14" textRollOverColor="#ff0000" textSelectedColor="#ffffff" textAlign="left" fontWeight="bold" />
  268. </fx:Component>
  269. </mx:headerRenderer>
  270. <mx:VBox width="100%" height="100%" borderAlpha="1" borderVisible="true" cornerRadius="5" verticalGap="0" label="接警信息" verticalScrollPolicy="auto" >
  271. <s:Scroller width="100%" height="100%">
  272. <s:VGroup width="100%" height="100%">
  273. <mx:HBox width="100%" height="30" verticalAlign="middle" horizontalGap="0">
  274. <s:Label width="35%" height="100%" text="事故时间" fontSize="13" textAlign="center" verticalAlign="middle"/>
  275. <ui:DateTime id="sgsj" width="160" dateTime="{new Date}" enabled="true" hasTime="true"/>
  276. </mx:HBox>
  277. <mx:HRule width="100%" height="1"/>
  278. <mx:HBox width="100%" height="30" verticalAlign="middle" horizontalGap="0">
  279. <s:Label width="35%" height="100%" text="事故地点" fontSize="13" textAlign="center" verticalAlign="middle"/>
  280. <ui:QTextInput id="sgdd" width="160"/>
  281. </mx:HBox>
  282. <mx:HRule width="100%" height="1"/>
  283. <mx:HBox width="100%" height="30" verticalAlign="middle" horizontalGap="0">
  284. <s:Label width="35%" height="100%" text="事故位置" fontSize="13" textAlign="center" verticalAlign="middle"/>
  285. <ui:QTextInput id="sgwz" width="160"/>
  286. </mx:HBox>
  287. <mx:HRule width="100%" height="1"/>
  288. <mx:HBox width="100%" height="30" verticalAlign="middle" horizontalGap="0">
  289. <s:Label width="35%" height="100%" text="事故类型和性质" fontSize="13" textAlign="center" verticalAlign="middle"/>
  290. <ui:QTextInput id="sgxz" width="160"/>
  291. </mx:HBox>
  292. <mx:HRule width="100%" height="1"/>
  293. <mx:HBox width="100%" height="30" verticalAlign="middle" horizontalGap="0">
  294. <s:Label width="35%" height="100%" text="事故起因&#13;及简要经过" fontSize="13" textAlign="center" verticalAlign="middle"/>
  295. <ui:QTextInput id="sgqy" width="160"/>
  296. </mx:HBox>
  297. <mx:HRule width="100%" height="1"/>
  298. <mx:HBox width="100%" height="30" verticalAlign="middle" horizontalGap="0">
  299. <s:Label width="35%" height="100%" text="事故规模&#13;及扩展趋势" fontSize="13" textAlign="center" verticalAlign="middle"/>
  300. <ui:QTextInput id="sggm" width="160"/>
  301. </mx:HBox>
  302. <mx:HRule width="100%" height="1"/>
  303. <mx:HBox width="100%" height="30" verticalAlign="middle" horizontalGap="0">
  304. <s:Label width="35%" height="100%" text="人员伤亡及设施损坏初步情况" fontSize="13" textAlign="center" verticalAlign="middle"/>
  305. <ui:QTextInput id="rysw" width="160"/>
  306. </mx:HBox>
  307. <mx:HRule width="100%" height="1"/>
  308. <mx:HBox width="100%" height="30" verticalAlign="middle" horizontalGap="0">
  309. <s:Label width="35%" height="100%" text="现场救援情况" fontSize="13" textAlign="center" verticalAlign="middle"/>
  310. <ui:QTextInput id="xcjy" width="160"/>
  311. </mx:HBox>
  312. <mx:HRule width="100%" height="1"/>
  313. <mx:HBox width="100%" height="30" verticalAlign="middle" horizontalGap="0">
  314. <s:Label width="35%" height="100%" text="报警人" fontSize="13" textAlign="center" verticalAlign="middle"/>
  315. <ui:QTextInput id="bjr" width="160"/>
  316. </mx:HBox>
  317. <mx:HRule width="100%" height="1"/>
  318. <mx:HBox width="100%" height="30" verticalAlign="middle" horizontalGap="0">
  319. <s:Label width="35%" height="100%" text="报警人联系方式" fontSize="13" textAlign="center" verticalAlign="middle"/>
  320. <ui:QTextInput id="bjrlxfs" width="160"/>
  321. </mx:HBox>
  322. <mx:HBox width="100%" height="30" verticalAlign="middle" horizontalGap="0" horizontalAlign="center">
  323. <s:Button label="保存" click="saveHandler(event)" skinClass="com.skins.ButtonSkin" width="60" fontSize="14" />
  324. </mx:HBox>
  325. </s:VGroup>
  326. </s:Scroller>
  327. </mx:VBox>
  328. <mx:VBox width="100%" height="100%" borderAlpha="1" borderVisible="true" cornerRadius="5" verticalGap="1" label="事故定位">
  329. <mx:HBox width="100%" height="30" verticalAlign="middle" horizontalGap="0">
  330. <s:Label width="30%" height="100%" text="事件类型" fontSize="13" textAlign="center" verticalAlign="middle"/>
  331. <s:ComboBox width="70%" height="28" id="sglx" creationComplete="sglx_creationCompleteHandler(event)" labelFunction="fieldTypeLabel" styleName="combo" requireSelection="true" />
  332. </mx:HBox>
  333. <mx:HRule width="100%" height="1"/>
  334. <mx:HBox width="100%" height="30" verticalAlign="middle" horizontalGap="0">
  335. <s:Label width="30%" height="100%" text="企业名称" fontSize="13" textAlign="center" verticalAlign="middle"/>
  336. <mx:HBox width="70%" height="100%">
  337. <s:TextInput id="mccx" width="85%" height="24" keyDown="txtKeyDown(event)"/>
  338. <s:Spacer width="5" height="0" />
  339. <s:Image source="images/png/aq_searchMini.png" buttonMode="true" click="queryClickHandler(event)" />
  340. </mx:HBox>
  341. </mx:HBox>
  342. <s:SkinnableContainer width="100%" height="100%" skinClass="com.skins.SkinnableContainerSkin">
  343. <s:layout>
  344. <s:HorizontalLayout/>
  345. </s:layout>
  346. <mx:DataGrid id="resultGrid" width="100%" height="100%" dataProvider="{queryData}" doubleClickEnabled="true" doubleClick="resultGrid_doubleClickHandler(event)">
  347. <mx:columns>
  348. <mx:DataGridColumn dataField="ID" headerText="ID" visible="false" width="100" headerWordWrap="true"/>
  349. <mx:DataGridColumn dataField="SZD" headerText="SZD" visible="false" width="100" headerWordWrap="true"/>
  350. <mx:DataGridColumn dataField="NAME" headerText="名称" width="100" showDataTips="true" headerWordWrap="true"/>
  351. </mx:columns>
  352. </mx:DataGrid>
  353. </s:SkinnableContainer>
  354. </mx:VBox>
  355. <mx:HBox width="100%" height="100%" borderAlpha="1" borderVisible="true" cornerRadius="5" verticalGap="1" label="应急物资">
  356. <mx:HBox width="100%" height="30" verticalAlign="middle" horizontalGap="0" horizontalAlign="center">
  357. <s:Label text="搜索半径" fontSize="14" textAlign="center" verticalAlign="middle"/>
  358. <s:TextInput id="radius" text="5" maxChars="3" width="40" keyDown="radiusKeyDown(event)"/>
  359. <s:Label text="公里" fontSize="14"/>
  360. <s:Button label="确定" click="{searchFun()}" skinClass="com.skins.ButtonSkin" width="60" fontSize="14" />
  361. </mx:HBox>
  362. </mx:HBox>
  363. <mx:VBox width="100%" height="100%" borderAlpha="1" borderVisible="true" cornerRadius="5" verticalGap="1" label="其他应急机构">
  364. <mx:HBox width="100%" height="30" verticalAlign="middle" horizontalGap="0" horizontalAlign="center">
  365. <s:Label text="搜索半径" fontSize="14" textAlign="center" verticalAlign="middle"/>
  366. <s:TextInput id="radiusYjwl" text="5" maxChars="3" width="40" keyDown="radiusYjwlKeyDown(event)"/>
  367. <s:Label text="公里" fontSize="14"/>
  368. <s:Button label="确定" click="{searchYjwlFun()}" skinClass="com.skins.ButtonSkin" width="60" fontSize="14" />
  369. </mx:HBox>
  370. </mx:VBox>
  371. <mx:VBox width="100%" height="100%" borderAlpha="1" borderVisible="true" cornerRadius="5" verticalGap="1" label="应急专家">
  372. <mx:HBox width="100%" height="30" verticalAlign="middle" horizontalGap="0" horizontalAlign="center">
  373. <s:Button label="全省应急专家库" click="expert_clickHandler(event)" skinClass="com.skins.ButtonSkin" width="130" />
  374. </mx:HBox>
  375. </mx:VBox>
  376. <mx:VBox width="100%" height="100%" borderAlpha="1" borderVisible="true" cornerRadius="5" verticalGap="1" label="应急流程">
  377. <mx:HBox width="100%" height="30" verticalAlign="middle" horizontalGap="0" horizontalAlign="center">
  378. <s:Button label="查看应急处置" click="yjcz_clickHandler(event)" skinClass="com.skins.ButtonSkin" width="130" />
  379. </mx:HBox>
  380. </mx:VBox>
  381. </mx:Accordion>
  382. </s:BorderContainer>