Main.mxml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <s:Application 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:service="com.jtgh.yjpt.common.service.*"
  6. xmlns:access="com.jtgh.yjpt.view.access.*"
  7. xmlns:common="com.jtgh.yjpt.common.*"
  8. xmlns:core="com.jtgh.yjpt.view.core.*"
  9. initialize="appInit(event)">
  10. <fx:Metadata>
  11. [ResourceBundle("common")]
  12. [ResourceBundle("system")]
  13. [ResourceBundle("menu")]
  14. [ResourceBundle("select")]
  15. [ResourceBundle("module")]
  16. [ResourceBundle("yjgl")]
  17. [ResourceBundle("sgalgl")]
  18. [ResourceBundle("zysqbp")]
  19. [ResourceBundle("jlrxxgl")]
  20. [ResourceBundle("yjzyxxgl")]
  21. [ResourceBundle("aqsszxys")]
  22. [ResourceBundle("bagl")]
  23. [ResourceBundle("check")]
  24. [ResourceBundle("task")]
  25. [ResourceBundle("aqsc")]
  26. [ResourceBundle("gq")]
  27. [ResourceBundle("author")]
  28. [ResourceBundle("workflow")]
  29. [ResourceBundle("gkjsxmaqsc")]
  30. [ResourceBundle("Gkwxhwzyfzblhhz")]
  31. [ResourceBundle("fileType")]
  32. [ResourceBundle("qlyg")]
  33. [ResourceBundle("gg")]
  34. </fx:Metadata>
  35. <fx:Style>
  36. @namespace s "library://ns.adobe.com/flex/spark";
  37. @namespace mx "library://ns.adobe.com/flex/mx";
  38. @namespace ui "com.jtgh.yjpt.common.component.ui.*";
  39. mx|ToolTip{
  40. fontSize:14;
  41. }
  42. mx|Alert
  43. {
  44. title-style-name:alertTitle;
  45. buttonStyleName:alertButton;
  46. borderSkin:ClassReference("skins.AlertBorderSkin");
  47. }
  48. .alertTitle
  49. {
  50. show-border:false;
  51. show-shadow:false;
  52. color:#ffffff;
  53. font-weight:bold;
  54. font-size:16;
  55. }
  56. mx|Button.alertButton {
  57. upSkin: Embed('/resource/yjpt/list/btn.png');
  58. downSkin: Embed("/resource/yjpt/list/btn_hover.png");
  59. overSkin: Embed("/resource/yjpt/list/btn_hover.png");
  60. disabledSkin: Embed("/resource/yjpt/list/btn.png");
  61. }
  62. .AccordionHeader
  63. {
  64. skin:ClassReference("skins.cus.AccordionSkin");
  65. }
  66. mx|AccordionHeader{
  67. chrome-color:#ffffff ;
  68. color: #148fa2;
  69. fontFamily:"微软雅黑" ;
  70. fontWeight: bold;
  71. fontSize:14;
  72. paddingLeft:20;
  73. textSelectedColor:"0x23A5B8";
  74. text-roll-over-color:"0x23A5B8" ;
  75. textAlign: "left";
  76. selectedFillColors:"0x23A5B8","0x23A5B8";
  77. }
  78. mx|LegendItem{
  79. fontFamily:"宋体";
  80. fontSize:12;
  81. color:#000000;
  82. fontWeight:normal;
  83. }
  84. mx|AxisRenderer{
  85. fontFamily:"微软雅黑";
  86. fontSize:14;
  87. color:#000000;
  88. fontWeight:normal;
  89. canStagger:false;
  90. kerning:true;
  91. }
  92. @font-face
  93. {
  94. src:url("resource/yjpt/font/hzgbSimple.ttf");
  95. fontFamily: hzgb;
  96. embedAsCFF: false;
  97. }
  98. </fx:Style>
  99. <fx:Script>
  100. <![CDATA[
  101. import com.jtgh.yjpt.common.BusinessContext;
  102. import com.jtgh.yjpt.common.Global;
  103. import com.jtgh.yjpt.common.component.ui.MapView;
  104. import com.jtgh.yjpt.common.util.Constants;
  105. import com.jtgh.yjpt.common.util.Utils;
  106. import com.jtgh.yjpt.model.SystemModel;
  107. import com.jtgh.yjpt.view.SuperMapMain;
  108. import com.jtgh.yjpt.view.Workspace;
  109. import com.jtgh.yjpt.vo.access.UserVo;
  110. import com.jtgh.yjpt.vo.common.CodeVo;
  111. import com.jtgh.yjpt.vo.sys.MenuVo;
  112. import mx.controls.Alert;
  113. import mx.core.FlexGlobals;
  114. import mx.events.FlexEvent;
  115. import mx.managers.BrowserManager;
  116. import mx.rpc.events.ResultEvent;
  117. import mx.utils.Base64Decoder;
  118. import mx.utils.Base64Encoder;
  119. protected function appInit(event:FlexEvent):void
  120. {
  121. Alert.buttonWidth=58;
  122. Alert.buttonHeight=28;
  123. BrowserManager.getInstance().setTitle(resourceManager.getString('common','login.title'));
  124. SystemModel.getInstance().setMainPane(mainPane);
  125. Utils.callRemote("authenticateController","checkSession",resultCallBack);
  126. }
  127. public function showMap():void
  128. {
  129. var map:MapView = Global.mapView;
  130. map.source = "gis/Main.html?from=yjpt";
  131. if(Global.deployMode==Constants.DEPLOY_MODE_1)
  132. {
  133. var szd:String = Global.szd.localeName;
  134. if(szd.indexOf("内河")>0)
  135. {
  136. szd = szd.replace("内河","市");
  137. }else{
  138. szd =szd+"市";
  139. }
  140. var url:String = "&action=location&layer=L_ID_SJ&name="+encodeURIComponent(szd);
  141. // map.source+=url; 地市定位会有遮罩,所以去掉
  142. }
  143. Utils.popupWindow(resourceManager.getString('common','btn.showMap'),Global.mapView,FlexGlobals.topLevelApplication as DisplayObject,null,0,0);
  144. map.iframe.visible=true;
  145. }
  146. private function resultCallBack(r:ResultEvent):void{
  147. var bc:BusinessContext = r.result as BusinessContext;
  148. if(bc.getAttribute("status"))
  149. {
  150. SystemModel.doLoginSuccess(bc);
  151. }
  152. else
  153. {
  154. Global.szd = bc.getAttribute("szd") as CodeVo;
  155. Global.deploySzd = bc.getAttribute("szd") as CodeVo;
  156. Global.deployMode = bc.getAttribute("deployMode") as String;
  157. Global.upload_file_size=bc.getAttribute("uploadFileSize") as Number;
  158. Global.upload_image_size=bc.getAttribute("uploadImageSize") as Number;
  159. Global.btyyj=bc.getAttribute("btyyj") as String;
  160. Global.thyj=bc.getAttribute("thyj") as String;
  161. Global.version=bc.getAttribute("version") as String;
  162. var defaultUser:UserVo = bc.getAttribute("user") as UserVo;
  163. login.NeedCheckCode=true;
  164. if(defaultUser !=null){
  165. login.username.text = defaultUser.code;
  166. login.password.text = defaultUser.password;
  167. login.NeedCheckCode=false;
  168. }
  169. this.login.visible=true;
  170. login.username.setFocus();
  171. }
  172. }
  173. ]]>
  174. </fx:Script>
  175. <fx:Declarations>
  176. <!-- 将非可视元素(例如服务、值对象)放在此处 -->
  177. <service:Service/>
  178. <common:ClassRegistry/>
  179. </fx:Declarations>
  180. <s:Group id="mainPane" width="100%" height="100%">
  181. <core:LoginPanel id="login" visible="false"/>
  182. </s:Group>
  183. </s:Application>