ShipViewPanel.mxml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <s:TitleWindow 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"
  5. xmlns:common="port.common.*"
  6. xmlns:AdvancedDataGrid="com.AdvancedDataGrid.*"
  7. xmlns:SubClasses="com.AdvancedDataGrid.SubClasses.*"
  8. width="400" height="210" borderVisible="false" close="closeWindow(event)"
  9. fontFamily="宋体" fontSize="12"
  10. skinClass="com.skins.tdt.TitleWinHighSkin" title='船舶明细 - {(!ship.name||ship.name=="null")?"":ship.name}({ship.mmsi})' >
  11. <fx:Declarations>
  12. <!-- 将非可视元素(例如服务、值对象)放在此处 -->
  13. </fx:Declarations>
  14. <fx:Script>
  15. <![CDATA[
  16. import com.xt.hb.utils.AisUtils;
  17. import com.xt.hb.utils.CommonUtility;
  18. import com.xt.hb.utils.CommonUtils;
  19. import com.xt.hb.utils.MapUtils;
  20. import mx.core.FlexGlobals;
  21. import mx.events.CloseEvent;
  22. private var _ship:Object = null ;
  23. public static var locusPanel:LocusQueryPanel = new LocusQueryPanel();
  24. [Bindable]
  25. public function get ship():Object{
  26. return _ship;
  27. }
  28. public function set ship(value:Object):void{
  29. _ship = value;
  30. locusPanel.ship = value ;
  31. dispatchEvent(new Event("shipChanged"));
  32. }
  33. [Bindable(event="shipChanged")]
  34. public function shipType():String{
  35. var code:String = ship["ship_type"] ;
  36. return AisUtils.getCbhwlxByCode(code.charAt(0));
  37. }
  38. [Bindable(event="shipChanged")]
  39. public function formatTime():String{
  40. var date:Date = new Date(Number(ship["time"])*1000);
  41. return CommonUtils.formatDate(date);
  42. }
  43. //查询并且显示轨迹和面板
  44. public static function queryAndViewLocusPanel(ship:Object,param:Object):void{
  45. locusPanel.ship = ship;
  46. //显示弹出层
  47. addLocusPanelToPopLayer();
  48. //小时查询
  49. if(param["type"]=="hour"){
  50. locusPanel.hourQuery(param);
  51. }else{
  52. locusPanel.dayQuery(param);
  53. }
  54. }
  55. protected function showTrace(event:MouseEvent):void{
  56. addLocusPanelToPopLayer();
  57. }
  58. public static function addLocusPanelToPopLayer():void{
  59. var x:int =FlexGlobals.topLevelApplication.width-850;
  60. var y:int =FlexGlobals.topLevelApplication.height-280 ;
  61. if(!locusPanel)
  62. locusPanel = new LocusQueryPanel();
  63. CommonUtility.showTitleWindow(locusPanel,false,x,y);
  64. }
  65. protected function clearShipLocus(event:MouseEvent):void{
  66. if(locusPanel==null){
  67. return ;
  68. }
  69. locusPanel.clearLocusFeature();
  70. }
  71. protected function closeWindow(event:CloseEvent):void{
  72. MapUtils.getShipPopWin().removeAllChildren();
  73. //解除聚焦闪烁
  74. MapUtils.clearAISGraphic();
  75. }
  76. ]]>
  77. </fx:Script>
  78. <mx:VBox width="100%" height="100%" backgroundColor="#F0F0F0" borderVisible="false" horizontalGap="0" verticalGap="0">
  79. <s:Spacer width="8"/>
  80. <mx:VBox width="100%">
  81. <mx:Grid width="100%" borderVisible="false" horizontalGap="0" verticalGap="0" >
  82. <mx:GridRow height="3" />
  83. <mx:GridRow height="16" >
  84. <mx:GridItem width="100"><s:Spacer width="2" /><s:Label text="船舶名称:" /></mx:GridItem>
  85. <mx:GridItem width="100"><s:Label color="#3A00FF" text="{ship.name}" toolTip="{ship.name}" /></mx:GridItem>
  86. <mx:GridItem width="100"><s:Label text="MMSI:" /></mx:GridItem>
  87. <mx:GridItem width="100"><s:Label color="#3A00FF" text="{ship.mmsi}" /></mx:GridItem>
  88. </mx:GridRow>
  89. <mx:GridRow height="16">
  90. <mx:GridItem ><s:Spacer width="2" /><s:Label text="是否危险品船舶:" /></mx:GridItem>
  91. <mx:GridItem ><s:Label color="#3A00FF" text='{ship.danger=="1"?"是":"否"}'/></mx:GridItem>
  92. <mx:GridItem ><s:Label text="船舶以及货物类型:" /></mx:GridItem>
  93. <mx:GridItem ><s:Label color="#3A00FF" text="{ shipType()}" /></mx:GridItem>
  94. </mx:GridRow>
  95. <mx:GridRow height="16">
  96. <mx:GridItem ><s:Spacer width="2" /><s:Label text="航行状态:" /></mx:GridItem>
  97. <mx:GridItem ><s:Label color="#3A00FF" text='{ship.status}' /></mx:GridItem>
  98. <mx:GridItem ><s:Label text="航行速度(kts):" /></mx:GridItem>
  99. <mx:GridItem ><s:Label color="#3A00FF" text='{ship.speed}' /></mx:GridItem>
  100. </mx:GridRow>
  101. <mx:GridRow height="16">
  102. <mx:GridItem ><s:Spacer width="2" /><s:Label text="目的港:" /></mx:GridItem>
  103. <mx:GridItem ><s:Label color="#3A00FF" text="{ship.dest}" /></mx:GridItem>
  104. <mx:GridItem ><s:Label text="预计到港时间:" /></mx:GridItem>
  105. <mx:GridItem ><s:Label color="#3A00FF" text='{CommonUtils.formatETA(ship.eta)}' /></mx:GridItem>
  106. </mx:GridRow>
  107. <mx:GridRow height="16">
  108. <mx:GridItem ><s:Spacer width="2" /><s:Label text="船长(米):" /></mx:GridItem>
  109. <mx:GridItem ><s:Label color="#3A00FF" text="{ship.length}" /></mx:GridItem>
  110. <mx:GridItem ><s:Label text="船宽(米):" /></mx:GridItem>
  111. <mx:GridItem ><s:Label color="#3A00FF" text="{ship.width}" /></mx:GridItem>
  112. </mx:GridRow>
  113. <mx:GridRow height="16">
  114. <mx:GridItem ><s:Spacer width="2" /><s:Label text="航迹向(度):" /></mx:GridItem>
  115. <mx:GridItem ><s:Label color="#3A00FF" text="{ship.course}" /></mx:GridItem>
  116. <mx:GridItem ><s:Label text="呼号:" /></mx:GridItem>
  117. <mx:GridItem ><s:Label color="#3A00FF" text="{ship.callsign}" /></mx:GridItem>
  118. </mx:GridRow>
  119. <mx:GridRow height="16">
  120. <mx:GridItem ><s:Spacer width="2" /><s:Label text="船旗:" /></mx:GridItem>
  121. <mx:GridItem ><s:Label color="#3A00FF" text="{ship.flag}" /></mx:GridItem>
  122. <mx:GridItem ><s:Label text="建造时间:" /></mx:GridItem>
  123. <mx:GridItem ><s:Label color="#3A00FF" text="{ship.build}" /></mx:GridItem>
  124. </mx:GridRow>
  125. <mx:GridRow height="16">
  126. <mx:GridItem ><s:Spacer width="2" /><s:Label text="船籍港:" /></mx:GridItem>
  127. <mx:GridItem ><s:Label color="#3A00FF" text="{ship.port}" /></mx:GridItem>
  128. <mx:GridItem ><s:Label text="船舶IMO:" /></mx:GridItem>
  129. <mx:GridItem ><s:Label color="#3A00FF" text="{ship.imo}" /></mx:GridItem>
  130. </mx:GridRow>
  131. <mx:GridRow height="16">
  132. <mx:GridItem ><s:Spacer width="2" /><s:Label text="信号时间:" /></mx:GridItem>
  133. <mx:GridItem colSpan="3" ><s:Label color="#3A00FF" text="{formatTime()}" /></mx:GridItem>
  134. </mx:GridRow>
  135. </mx:Grid>
  136. </mx:VBox>
  137. <s:Group >
  138. <s:Line width="100%" xFrom="0" xTo="400" yFrom="0" yTo="0" >
  139. <s:stroke>
  140. <s:SolidColorStroke color="#4AA2DF" weight="1" caps="square"/>
  141. </s:stroke>
  142. </s:Line>
  143. </s:Group>
  144. <mx:HBox width="100%" height="30" backgroundColor="#F0F0F0" verticalAlign="middle" horizontalGap="5" verticalGap="0" borderVisible="false">
  145. <s:Spacer width="200"/>
  146. <mx:LinkButton label="绘制轨迹" fontWeight="bold" fontSize="14" color="#2f6ea1" rollOverColor="#FEB355" buttonMode="true" useHandCursor="true" click="showTrace(event)" />
  147. <s:Spacer width="8"/>
  148. <mx:LinkButton label="清除轨迹" fontWeight="bold" fontSize="14" color="#2f6ea1" rollOverColor="#FEB355" buttonMode="true" useHandCursor="true" click="clearShipLocus(event)" />
  149. </mx:HBox>
  150. </mx:VBox>
  151. </s:TitleWindow>