b5eef7bda5e50fddb1f977916fff811799c599aa.svn-base 77 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781
  1. /**
  2. * gis地图展示
  3. * @author zmy
  4. * @version 1.0
  5. * @Date 2015-09-23
  6. */
  7. var quilayoutpages;
  8. var wg = null;
  9. var ai = null;
  10. var ati = null;
  11. var gisUtil = null;
  12. var tracingTimer = null;
  13. var picturebase64=null;
  14. /**
  15. * 页面大小初始化
  16. */
  17. $(function(){
  18. var hei = $(".gis_map_main").height();
  19. $("#mainTable").height(hei);
  20. $("#centermap").height(hei);
  21. $("#leftceladows").height(hei);
  22. $(".sear_tab").height(hei);
  23. var sgh = hei - $(".gis_title_plan").height() - $(".dw_plan").height();
  24. $(".sear_tab").height(hei);
  25. $("._search_gis").height(sgh);
  26. });
  27. /**
  28. * 对象初始化
  29. */
  30. $(function(){
  31. ai = new AlertIframe();
  32. ati = new AlertTyphoonIframe();
  33. gisUtil = new GisUtil();
  34. quilayoutpages = new QUIlayoutpage();
  35. });
  36. /**
  37. * 页面查询条件框查询显示初始化
  38. * @returns
  39. */
  40. $(function(){
  41. var userInfo = gisUtil.resolveUrl();//得到用户信息
  42. var userDeptID = userInfo["dept_id"] ;//得到用户单位
  43. var parentID = userInfo["parentId"] ;//得到用户单位
  44. var deptId = "";
  45. var dataJ = {};
  46. var paramsJ = {};
  47. /* 得到当前登录用户的子级部门 {prov:省级, pref:市级} */
  48. var url = $.pathname() + "/ws/cockpit/CockpitService/querySubDept";
  49. paramsJ = { unitId:userDeptID } ;
  50. dataJ = gisUtil.getJsonData(url,paramsJ) ;
  51. gisUtil.setSubDept(dataJ) ;
  52. /* 应急响应、资源标注单位查询初始化 */
  53. var deptUrl = $.pathname() + "/ws/cockpit/CockpitService/selectTreeDept";
  54. $.post(deptUrl, {unitId:userDeptID, parentId:parentID}, function(data) {
  55. for(var key in data){
  56. deptId += data[key]["id"] + "," ;
  57. }
  58. deptId = deptId.substring(0, deptId.length-1) ;
  59. gisUtil.setDeptId(deptId) ;
  60. $("#unitId").data("data", data);
  61. $("#unitId").render();
  62. $("#unitIdByEr").data("data", data);
  63. $("#unitIdByEr").render();
  64. $("#unitIdByErCar").data("data",data);
  65. $("#unitIdByErCar").render();
  66. $("#unitIdByErGen").data("data",data);
  67. $("#unitIdByErGen").render();
  68. $("#unitIdByErPlace").data("data",data);
  69. $("#unitIdByErPlace").render();
  70. //应急事件查询单选
  71. /*var yjIncidentUrl = $.pathname() + "/ws/cockpit/CockpitService/queryPublishAlertNotice" ;
  72. dataJ = gisUtil.getJsonData(yjIncidentUrl,{"deptId" : userDeptID}) ;
  73. $("#inic").data("data", dataJ) ;
  74. $("#inic").attr("selectedValue",dataJ["list"]["0"]["value"]);
  75. $("#inic").render() ;*/
  76. //应急事件查询多选
  77. // var yjIncidentUrlByM = $.pathname() + "/ws/cockpit/CockpitService/queryNoticeByMultiMode" ;
  78. // var param = {deptId:deptId } ;
  79. // dataJ = gisUtil.getJsonData(yjIncidentUrlByM,param) ;
  80. // $("#teamInci").data("data", dataJ) ;
  81. // $("#teamInci").attr("selectedValue",dataJ["treeNodes"]["0"]["id"]);
  82. // $("#teamInci").render() ;
  83. // changeTameSelect(dataJ["treeNodes"]["0"]["id"]) ;
  84. //队伍调拨,多选
  85. var teamUrlByM = $.pathname() + "/ws/cockpit/CockpitService/queryTeamMove" ;
  86. dataJ = gisUtil.getJsonData(teamUrlByM,null) ;
  87. if(dataJ){
  88. $("#teamMove").data("data", dataJ) ;
  89. $("#teamMove").attr("selectedValue",dataJ["treeNodes"]["0"]["id"]);
  90. $("#teamMove").render() ;
  91. changeTameSelect(dataJ["treeNodes"]["0"]["id"]) ;
  92. }
  93. }, "json");
  94. var data = {list:[{value:"A",key:"中国南方电网"},{value:"G",key:"供应商"},{value:"S",key:"现场施工单位"}]};
  95. $("#house_belong").data("data",data);
  96. $("#house_belong").attr("selectedValue","A");
  97. $("#house_belong").render();
  98. $("#house_belong").bind("change",function(){
  99. if($(this).attr("relValue")!="A"){
  100. $("#house_level").attr("disabled",true);
  101. $("#house_level").render();
  102. }else{
  103. $("#house_level").attr("disabled",false);
  104. $("#house_level").render();
  105. };
  106. });
  107. data = {list:[{value:"1",key:"室内"},{value:"2",key:"露天"},{value:"3",key:"组合"}]};
  108. $("#house_type").data("data",data);
  109. $("#house_type").attr("selectedValue","1");
  110. $("#house_type").render();
  111. /**
  112. * 窗口改变大小事件
  113. */
  114. $(window).resize(function(){
  115. var hei = $(".gis_map_main").height();
  116. $("#mainTable").height(hei);
  117. $("#centermap").height(hei);
  118. $("#leftceladows").height(hei);
  119. $(".sear_tab").height(hei);
  120. var sgh = hei - $(".gis_title_plan").height() - $(".dw_plan").height();
  121. $(".sear_tab").height(hei);
  122. $("._search_gis").height(sgh);
  123. });
  124. /**
  125. * 额外查询初始化
  126. */
  127. CompHead() ;
  128. });
  129. /**
  130. * 额外查询初始化
  131. */
  132. function CompHead(){
  133. /*var url = $.pathname() + "/ws/cockpit/CockpitService/getCompanyHeadquartersEwer" ;
  134. var data = gisUtil.getJsonData(url, null);
  135. if(!data){return;};
  136. var tc = data["LEVEL"] ;
  137. var fd_id = data["FD_ID"] ;
  138. $("#srcollTitle").attr("valueID",fd_id);
  139. $("#srcollTitle").html(data["TITLE"]);
  140. if(tc == "35" || tc == "29"){
  141. $(".roll_text").css("color","red");
  142. } else if (tc == "36" || tc == "30"){
  143. $(".roll_text").css("color","orange");
  144. } else if (tc == "37" || tc == "31"){
  145. $(".roll_text").css("color","yellow");
  146. } else if (tc == "38" || tc == "32"){
  147. $(".roll_text").css("color","blue");
  148. }*/
  149. var url = $.pathname() + "/ws/getNotice/GetNoticeService/getNotice";
  150. var param = { corpId : gisUtil.getUserInfo().dept_id };
  151. var data = gisUtil.getJsonData(url, param);
  152. if(!data){return;}else{
  153. setMainIndexTab(data);
  154. };
  155. };
  156. /**
  157. * @param 关闭数据表
  158. */
  159. function closedatatable(){
  160. $("#tabTitle").hide();
  161. };
  162. /**
  163. * @param 右键菜单中查看数据表格的功能
  164. * @version 1.0
  165. * @Date 2015-11-11
  166. */
  167. function opendatatable(id){
  168. $("#tabTitle").show();
  169. quilayoutpages.getPageTitle(id);
  170. quilayoutpages.hideRMenu();
  171. };
  172. /**
  173. * 打形图例
  174. */
  175. function openLegend(id,icons){
  176. var url = $.pathname() + "/page/cockpit/alert/alert_icon_iframe.html?fd_id=" + id ;
  177. if(ai.createIconAlert(420, 270, 30, 20, url)){
  178. setTimeout(function(){
  179. iconFrame.window.createLengen(icons);
  180. },100);
  181. };
  182. };
  183. /**
  184. * 针对事件下拉复选框改变应急队伍选择框
  185. */
  186. function changeTameSelect(inciIds){
  187. var tameUrl = $.pathname() + "/ws/cockpit/CockpitService/queryTeamByInci" ;
  188. var params = { teaminciId:inciIds } ;
  189. $.post(tameUrl,params,function(data){
  190. if(data){
  191. $("#teamByInci").data("data", data) ;
  192. $("#teamByInci").render() ;
  193. } else {
  194. $("#teamByInci").data("data", data) ;
  195. $("#teamByInci").render() ;
  196. }
  197. },"json") ;
  198. };
  199. /**
  200. * 针对应急资源类型事件下拉复选框改变是否显示应急场所类型下拉列表
  201. */
  202. function changeTypeSelect(typeIds){
  203. var typeArr = typeIds.split(",");
  204. var flg = true;
  205. for(var key in typeArr){
  206. if(typeArr[key]=="381"){
  207. flg = false;
  208. };
  209. };
  210. $("#placeType").attr("disabled",flg);
  211. };
  212. /*-------------------------------------------针对事件下拉复选框改变应急队伍选择框end----------------------------------------------------*/
  213. /**
  214. * 页面事件绑定
  215. */
  216. $(function(){
  217. /**
  218. * 台风编号校检初始化
  219. */
  220. $("#TYPHOON_NUM").on("blur",function(){
  221. if($(this).val()){//有数据
  222. gisUtil.unvalid($(this));
  223. var reg = new RegExp("^[A-Za-z0-9_]*$");
  224. if(!reg.test($(this).val())){
  225. gisUtil.valid($(this),"请输入字母数字或下划线!");
  226. };
  227. }else{//没有数据
  228. gisUtil.valid($(this),"非空选项!");
  229. };
  230. });
  231. /**
  232. * 台风中文名称校检初始化
  233. */
  234. $("#TYPHOON_NAME_CH").on("blur",function(){
  235. if($(this).val()){//有数据
  236. gisUtil.unvalid($(this));
  237. var reg = new RegExp("^[^A-Za-z]*$");
  238. if(!reg.test($(this).val())){
  239. gisUtil.valid($(this),"请输入中文!");
  240. };
  241. }else{//没有数据
  242. gisUtil.valid($(this),"非空选项!");
  243. };
  244. });
  245. /**
  246. * 台风英文名称校检初始化
  247. */
  248. $("#TYPHOON_NAME_EN").on("blur",function(){
  249. if($(this).val()){//有数据
  250. gisUtil.unvalid($(this));
  251. var reg = new RegExp("^[A-Za-z0-9_]*$");
  252. if(!reg.test($(this).val())){
  253. gisUtil.valid($(this),"请输入英文!");
  254. };
  255. }else{//没有数据
  256. gisUtil.valid($(this),"非空选项!");
  257. };
  258. });
  259. /**
  260. * 模拟台风面板加载校验
  261. */
  262. $(".history_typh").each(function(i){
  263. if($(this).attr("value")){
  264. $(this).focus();
  265. $(this).blur();
  266. };
  267. });
  268. /*----------------------------------------台风模拟输入框移出校验事件end----------------------------------------------*/
  269. /**
  270. * 应急预警标签点击事件
  271. * @returns
  272. */
  273. $("#ew_level").toggle(
  274. function clearAllItem(){ $("input:checkbox[name=ew_type]").attr("checked",false); },
  275. function selectAllItem(){ $("input:checkbox[name=ew_type]").attr("checked",true);}
  276. );
  277. /*----------------------------------------应急预警标签点击事件end----------------------------------------------*/
  278. /**
  279. * 应急响应标签点击事件
  280. */
  281. $("#er_level").toggle(
  282. function(){ $("input:checkbox[name=er_type]").attr("checked",false); },
  283. function(){ $("input:checkbox[name=er_type]").attr("checked",true);}
  284. );
  285. /*----------------------------------------应急响应标签点击事件end----------------------------------------------*/
  286. /**
  287. * 设备过滤按钮点击事件
  288. */
  289. $("#filterPlant").toggle(
  290. function(){},
  291. function(){}
  292. );
  293. /*---------------------------------------- 设备过滤按钮点击事件end----------------------------------------------*/
  294. /**
  295. * 表格事件绑定
  296. */
  297. $(".std").click(
  298. function(){
  299. opendatatable($(this).attr("value"));
  300. });
  301. /**
  302. * 图例事件绑定
  303. */
  304. $(".tl").click(function(){
  305. if(!$(this).hasClass("tl_show")){
  306. $(this).addClass("tl_show");
  307. var tog = $(this).attr("toggle");
  308. if($("#"+tog).hasClass("tl_show")){
  309. $("#"+tog).removeClass("tl_show");
  310. removeIconAlter(tog);
  311. }
  312. if($(this).attr("id")=="ewerlenge"){
  313. openLegend($(this).attr("id"),gisUtil.getGisLengen());
  314. }else{
  315. openLegend($(this).attr("id"),gisUtil.getErGisLengen());
  316. };
  317. }else{
  318. $(this).removeClass("tl_show");
  319. removeIconAlter($(this).attr("id"));
  320. };
  321. });
  322. });
  323. function logingis(){
  324. username = 'gistest';
  325. password = 'Hello123*';
  326. wg.login(username,password);
  327. }
  328. /**
  329. * QUI框架初始化
  330. */
  331. function initComplete(){
  332. var dateSkin="blue";
  333. //绑定应急事件下拉框change事件
  334. $("#teamInci").bind("change",function(){ changeTameSelect($(this).attr("relValue")); }) ;
  335. //绑定应急资源类型下拉框change事件
  336. $("#erTypeID").bind("change",function(){ changeTypeSelect($(this).attr("relValue")); }) ;
  337. //获取当前主题风格,用于设置日期控件的皮肤
  338. try { dateSkin=themeColor; }catch(e){}
  339. //自定义点击触发日期控件
  340. document.getElementById('beginTime').onfocus=function(){
  341. var endtimeTf=$dp.$('endTime');
  342. WdatePicker({ skin:dateSkin,onpicked:function(){endtimeTf.focus();},maxDate:'#F{$dp.$D(\'endTime\')}' });
  343. } ;
  344. document.getElementById('endTime').onfocus=function(){
  345. //这里设置了最大日期为当前日期,如果不需要则把maxDate:'%y-%M-%d'去掉
  346. WdatePicker({skin:dateSkin,minDate:'#F{$dp.$D(\'beginTime\')}'});
  347. };
  348. document.getElementById('beginTimeByEr').onfocus=function(){
  349. var endtimeTf=$dp.$('endTimeByEr');
  350. WdatePicker({ skin:dateSkin,onpicked:function(){endtimeTf.focus();},maxDate:'#F{$dp.$D(\'endTimeByEr\')}' });
  351. } ;
  352. document.getElementById('endTimeByEr').onfocus=function(){
  353. //这里设置了最大日期为当前日期,如果不需要则把maxDate:'%y-%M-%d'去掉
  354. WdatePicker({skin:dateSkin,minDate:'#F{$dp.$D(\'beginTimeByEr\')}'});
  355. };
  356. } ;
  357. /**
  358. * 显示查询框
  359. */
  360. function displayGisSearch(){
  361. $("#leftceladows").fadeIn(500);
  362. /*$("#DuiWuHuiZongZt").css({left:330});
  363. $("#DuiWuRenYuanHuiZongZt").css({left:330});*/
  364. var offset = $("#leftceladows").offset();
  365. var offleft = $("#leftceladows").width();
  366. $("#gisMes").css({top:offset.top, left:(offleft+offset.left)});
  367. };
  368. /**
  369. * 隐藏查询框
  370. */
  371. function noneGisSearch(){
  372. $("#leftceladows").fadeOut(500);
  373. /*$("#DuiWuHuiZongZt").css({left:25});
  374. $("#DuiWuRenYuanHuiZongZt").css({left:25});*/
  375. var offset = $("#searchByGis").offset();
  376. $("#gisMes").css({top:offset.top, left:(offset.left+50)});
  377. };
  378. /**
  379. * 显示信息框
  380. */
  381. function showMes(){
  382. var hei = gisMes.window.getHeight();
  383. $("#gisMes").animate({
  384. width: "268px",
  385. height: hei + "px"
  386. }, 1000 );
  387. };
  388. /**
  389. * 隐藏信息框
  390. */
  391. function hiddenMes(){
  392. var hei = gisMes.window.getHeight();
  393. var wid = 268;
  394. if(!hei){
  395. hei = 15;
  396. wid = 15;
  397. };
  398. $("#gisMes").animate({
  399. width: wid + "px",
  400. height: hei + "px"
  401. }, 200 );
  402. };
  403. /**
  404. * 缩小信息框
  405. */
  406. function notMes(){
  407. $("#gisMes").animate({
  408. width: "15px",
  409. height: "15px"
  410. }, 200 );
  411. };
  412. /**
  413. * 打开应急资源表格
  414. */
  415. function showErInfoGrid(src){
  416. ai.createErInfoGrid(src);
  417. };
  418. /**
  419. * 刷新应急预警与响应图层
  420. */
  421. /*function refreshEwer(){
  422. CompHead();
  423. var flg = $("#21").attr("relValue") ;
  424. if(flg==1){
  425. gisUtil.closeEwerLayer() ;
  426. gisUtil.ewerLay_init() ;
  427. }
  428. };*/
  429. function gis_init(){
  430. setTimeout(function(){
  431. $("#sh_showDT").click();
  432. },3000);
  433. };
  434. /**
  435. * 点击开关按钮事件
  436. * @param id
  437. */
  438. function getValue(id){
  439. var menuId = $("#" + id).attr("relValue") ;
  440. var s_id = $("#" + id).prev().attr("id");
  441. if(menuId==0){
  442. var flag = gisUtil.loadlayer(id) ;
  443. /*if(flag){
  444. $("#"+s_id).removeClass("mouse_dis").addClass("mouse_point");
  445. $("#"+s_id).bind('click',function(){
  446. shrink(event,this);
  447. });
  448. } else {
  449. $("#" + id).click() ;
  450. ai.setMes(320, 186, 200, 500, "系统提示", "请您登录地图后在使用");
  451. ai.createAlert();
  452. } ;*/
  453. $("#"+s_id).removeClass("mouse_dis").addClass("mouse_point");
  454. $("#"+s_id).bind('click',function(){
  455. shrink(event,this);
  456. });
  457. $("#"+s_id).click();
  458. } else {
  459. $("."+s_id).find("._bsc_plan").find(".zy_toolbar").find("._bsc_plan_sub").each(function(){
  460. var ss_id = $(this).find(".zy_bar").find(".zb").attr("id");
  461. if($("#"+ss_id).hasClass("oc_close")) $("#"+ss_id).click();
  462. $("#"+ss_id).removeClass("mouse_point").addClass("mouse_dis");
  463. $("#"+ss_id).unbind('click');
  464. if($("#"+ss_id).next().attr("relValue")!=0){
  465. $("#"+ss_id).next().removeClass("toggle");
  466. }
  467. });
  468. removeAlter();
  469. $(".tl").removeClass("tl_show");
  470. gisUtil.removeallmarkers(id) ;
  471. if(id==412 || id==41){clearInterval(tracingTimer);}
  472. if($("#"+s_id).hasClass("oc_close")) {$("#" + id).prev().click();}
  473. $("#"+s_id).removeClass("mouse_point").addClass("mouse_dis");
  474. $("#"+s_id).unbind('click');
  475. };
  476. };
  477. /**
  478. * 关闭chart
  479. */
  480. function closeGisChart(id){
  481. $("#"+id).remove();
  482. };
  483. /**
  484. * 应急队伍图表
  485. */
  486. function showTeamChar(){
  487. /*removeDrawWin();
  488. var encondeCondition=window.location.search;
  489. var url = $.pathname() + "/page/cockpit/echart_maticView/emergercy_source/emergency_person_into_child_chart.html" + encondeCondition + "?????legendC=#3399ff?xAxisC=#3399ff?yAxisC=#3399ff?titleC=#3399ff??gistype=TeamChar";
  490. ati.createCharWin(770, 630, 100, 400, url,"TeamChar");*/
  491. var url = $.pathname() + "/page/cockpit/alert/gis_team-poll.jsp?dept_id=" + gisUtil.getUserInfo().dept_id + "&gisType=gistype&closeId=alertChar";
  492. ati.createCharWin(600, 230, 70, 30, url,"alertChar");
  493. };
  494. /**
  495. * 应急装备发电机图表
  496. */
  497. function showEduiChar(){
  498. /*removeDrawWin();
  499. var encondeCondition=window.location.search;
  500. var url = $.pathname() + "/page/cockpit/echart_maticView/emergercy_source/emergency_equipment_into_child_chart.html" + encondeCondition + "?????legendC=#3399ff?xAxisC=#3399ff?yAxisC=#3399ff?titleC=#3399ff??gistype=EduiChar";
  501. ati.createCharWin(770, 630, 100, 400, url,"alertChar");*/
  502. var url = $.pathname() + "/page/cockpit/alert/gis_generator-poll.jsp?dept_id=" + gisUtil.getUserInfo().dept_id + "&gisType=gistype&closeId=alertChar";
  503. ati.createCharWin(600, 430, 70, 30, url,"alertChar");
  504. };
  505. /**
  506. * 应急装备发电车图表
  507. */
  508. function showEduiCarChar(){
  509. var url = $.pathname() + "/page/cockpit/alert/gis_generator-car-poll.jsp?dept_id=" + gisUtil.getUserInfo().dept_id + "&gisType=gistype&closeId=alertChar";
  510. ati.createCharWin(600, 430, 70, 30, url,"alertChar");
  511. };
  512. /**
  513. * 收缩三角
  514. */
  515. function shrink(e,_this){
  516. var id = $(_this).attr("id");
  517. if($(_this).hasClass("oc_open")){
  518. $(_this).removeClass("oc_open").addClass("oc_close");
  519. $("."+id).slideDown(600);
  520. } else {
  521. $(_this).removeClass("oc_close").addClass("oc_open");
  522. $("."+id).slideUp(600);
  523. }
  524. };
  525. /**
  526. * @param 加载日常气象图层
  527. * @version 1.0
  528. * @Date 2015-09-26
  529. */
  530. function Dailyweather(isFlat){
  531. wg.openWeatherFuc(isFlat);
  532. };
  533. /**
  534. * @param 加载台风图层
  535. * @version 1.0
  536. * @Date 2015-09-26
  537. */
  538. function Typhoon(isFlat){
  539. wg.openTyphoonFuc(isFlat,isFlat);
  540. };
  541. /**
  542. * @param 加载暴雨图层
  543. * @version 1.0
  544. * @Date 2015-09-26
  545. */
  546. function Rainstorm(){
  547. alert("界面集成,缺少URL");
  548. fullOpt(false);
  549. };
  550. /**
  551. * @param 加载冰灾图层
  552. * @version 1.0
  553. * @Date 2015-09-26
  554. */
  555. function IceDamage(){
  556. alert("界面集成,缺少URL");
  557. fullOpt(false);
  558. };
  559. /**
  560. * @param 加载设备损失图层
  561. * @version 1.0
  562. * @Date 2015-09-26
  563. */
  564. function EquipmentLoss(){
  565. alert("界面集成,缺少URL");
  566. fullOpt(false);
  567. };
  568. /**
  569. * @param 加载用户停电图层
  570. * @version 1.0
  571. * @Date 2015-09-26
  572. */
  573. function UserOutage(){
  574. alert("界面集成,缺少URL");
  575. fullOpt(false);
  576. };
  577. /**
  578. * @param 加载线路覆冰图层
  579. * @version 1.0
  580. * @Date 2015-10-11
  581. */
  582. function lineregelation(){
  583. //zoomToCoordList(ice_coords);
  584. //wg.addHighlightPSR(ice_lineNArrs,'#00F');
  585. alert("界面集成,缺少URL");
  586. } ;
  587. /**
  588. * 添加图层(公用)
  589. * @param lay 图层名
  590. * @param show 显示级别
  591. * @param hide 隐藏级别
  592. * @param appach 透明度
  593. * @param order 叠放顺序
  594. */
  595. function addLayer(lay,show,hide,appach,order){
  596. wg.addShapeLayer(lay,show,hide,appach,order) ;
  597. };
  598. /**
  599. * 删除图层(公用)
  600. * @param lay 图层名
  601. */
  602. function delLayer(lay){
  603. wg.removeAllMarkers(lay);
  604. };
  605. /**
  606. * 删除自定义图形(公用)
  607. * @param lay 图层名
  608. */
  609. function delShapes(lay){
  610. wg.removeAllShapes(lay) ;
  611. };
  612. /**
  613. * 判断经纬度是否在中国
  614. * @param lng
  615. * @param lat
  616. * @returns {Boolean}
  617. */
  618. function out_of_china(lng, lat){
  619. var flg = true;
  620. if(lng < 72.004 || lng > 137.8347){
  621. flg = false;
  622. };
  623. if(lat < 0.8293 || lat > 55.8271){
  624. flg = false;
  625. };
  626. return flg;
  627. };
  628. /**
  629. * 添加图标(公用)
  630. * @param erIcons 应急资源图层的图标信息组
  631. */
  632. function addResourceIco(erIcons){
  633. var iconIds = new Array() ;
  634. var reg = new RegExp("^[0-9]+(.[0-9]+)?$");
  635. for(var icon in erIcons){
  636. if(reg.test(erIcons[icon].posX) && reg.test(erIcons[icon].posY) && out_of_china(erIcons[icon].posX,erIcons[icon].posY)){
  637. iconIds.push(wg.addMarker(erIcons[icon])) ;
  638. };
  639. };
  640. return iconIds ;
  641. } ;
  642. /**
  643. * 添加图标(轨迹回放)
  644. * @param obj 要添加的图标信息
  645. */
  646. function addOneIco(obj){
  647. if(obj.icon){
  648. return wg.addMarker(obj) ;
  649. }
  650. } ;
  651. /**
  652. * 添加圆
  653. * @param lay 图层名
  654. * @param point 坐标
  655. * @param style 圆风格
  656. * @param text 备注
  657. */
  658. function addCircle(lay,point,style,text){
  659. var cid = wg.addCircle(lay,point,style,text);
  660. return cid;
  661. };
  662. /**
  663. * 添加文字
  664. * @param lay 图层名
  665. * @param point 坐标
  666. * @param style 文字风格
  667. * @param text 备注
  668. */
  669. function addText(lay,point,style,text){
  670. wg.addText(lay,point,style,text);
  671. };
  672. /**
  673. * 定位
  674. */
  675. function zoomToExtent(posXY){
  676. wg.zoomToExtent(posXY.minX,posXY.minY,posXY.maxX,posXY.maxY) ;
  677. };
  678. /**
  679. * 返回地图级别
  680. */
  681. function getCurrentZoomLevel(){
  682. return wg.getCurrentZoomLevel() ;
  683. };
  684. /**
  685. * 缩放地图等级
  686. * @param zoomLevel
  687. */
  688. function setZoomLevel(zoomLevel) {
  689. wg.setZoomLevel(zoomLevel);
  690. };
  691. /**
  692. * 设置指定级别
  693. * @param x
  694. * @param y
  695. * @param zoomLevel
  696. */
  697. function setZoomAndCenter (x, y , zoomLevel){
  698. wg.setZoomAndCenter (x, y , zoomLevel) ;
  699. };
  700. /**
  701. * 删除事件
  702. * @param eventName 事件名称
  703. */
  704. function removeEvent(eventName){
  705. wg.removeEvent(eventName) ;
  706. };
  707. /**
  708. * 删除图层上用户自定义的所有图形图标
  709. */
  710. function clearlay(lay){
  711. wg.removeAllShapes(lay) ;
  712. } ;
  713. /**
  714. * 启动图形完成回调事件
  715. * e["geometryType"] : 得到图形类型 线:1 多边形:2 圆:3 矩形: 4
  716. */
  717. function openDarwCallBack(e){
  718. gisUtil.openDrawCallBack(e);
  719. } ;
  720. /**
  721. * 清除用户自定义图形
  722. */
  723. function clearDrawUserDefined(){
  724. gisUtil.clearDrawUserDefined();
  725. };
  726. /**
  727. * 启动折线
  728. */
  729. function openDrawPolylineTool() {
  730. var v = gisUtil.getDrawValue();
  731. wg.openDrawPolylineTool(v.layName,v.ls);
  732. };
  733. /**
  734. * 启动多边形
  735. */
  736. function openDrawPolygonTool() {
  737. var v = gisUtil.getDrawValue();
  738. wg.openDrawPolygonTool(v.layName,v.ls);
  739. };
  740. /**
  741. * 启动矩形
  742. */
  743. function openDrawRectangleTool(){
  744. var v = gisUtil.getDrawValue();
  745. wg.openDrawRectangleTool(v.layName,v.ls);
  746. } ;
  747. /**
  748. * 启动圆形
  749. */
  750. function openDrawCircleTool(){
  751. var v = gisUtil.getDrawValue();
  752. wg.openDrawCircleTool(v.layName,v.ls);
  753. };
  754. /**
  755. * 启动图形完成事件
  756. */
  757. function openDarwCallBack(e){
  758. gisUtil.openDarwCallBack(e);
  759. };
  760. /**
  761. * 添加自定义标注
  762. */
  763. function addMarkerToUserDefined(f){
  764. gisUtil.addMarkerToUserDefined(f,true);
  765. };
  766. /**
  767. * 得到队伍ID信息
  768. */
  769. function getTeamId(params){
  770. if(params){
  771. gisUtil.setTeamInfo(params);
  772. gisUtil.addMarkerToUserDefined("but6",false);
  773. }else{
  774. ai.setMes(320, 186, 200, 500, "系统提示", "没有选择队伍");
  775. ai.createAlert();
  776. }
  777. };
  778. /**
  779. * 保存
  780. * @returns
  781. */
  782. function erSave(){
  783. var inicID = $("#inic").attr("relValue") ;
  784. if(!inicID){
  785. ai.setMes(320, 186, 200, 500, "系统提示", "请选择事件名称!");
  786. ai.createAlert();
  787. } else {
  788. gisUtil.saveDraw(inicID) ;
  789. // window.parent.window.saveDraw(inicID) ;//分类存储
  790. // window.parent.window.saveDrawByUser(inicID) ;//以图层整体进行存储
  791. // window.parent.window.importDrawByUser(inicID) ;//导入图层
  792. } ;
  793. } ;
  794. /**
  795. * 根据事件查看用户自定义图形
  796. */
  797. function showDraw(){
  798. var inicID = $("#inic").attr("relValue") ;
  799. if(!inicID){
  800. ai.setMes(320, 186, 200, 500, "系统提示", "请选择事件名称!");
  801. ai.createAlert();
  802. } else {
  803. var inicID = $("#inic").attr("relValue") ;
  804. gisUtil.searchDrawByUserInfo(inicID) ;
  805. // window.parent.window.searchDrawByUserInfo(inicID) ;
  806. }
  807. }
  808. /**
  809. * 添加折线,返回线型ID
  810. */
  811. function addPolyLine(lay,point,ls,ed){
  812. var pId = wg.addPolyLine(lay,point,ls,ed) ;
  813. return pId;
  814. };
  815. /**
  816. * 添加多边形
  817. */
  818. function addPolygon(ln,point,ls,ed){
  819. var pId = wg.addPolygon(ln,point,ls,ed);
  820. return pId;
  821. };
  822. /**
  823. * 添加图形右键菜单
  824. */
  825. function addRightDraw(objKV){
  826. var lay = gisUtil.getShowLay();
  827. var menuArra = [{ "Key": "1","Name": "隐藏"}, { "Key": "2","Name": "删除"}];
  828. var funArra ;
  829. for(var key in objKV){
  830. funArra = [{"key":"1",fun:"hideDraw(\"" + key + "\")"},{"key":"2",fun:"delDraw(\"" + objKV[key] + "\",\"" + key + "\")"}] ;
  831. wg.addContextMenu(lay.name,menuArra,funArra,key);
  832. }
  833. };
  834. /**
  835. * 添加图标右键菜单
  836. */
  837. function addRightMarker(objKV){
  838. var lay = gisUtil.getShowLay();
  839. var menuArra = [{ "Key": "1","Name": "隐藏"}, { "Key": "2","Name": "删除"}];
  840. var funArra ;
  841. for(var key in objKV){
  842. funArra = [{"key":"1",fun:"hideMarker(\"" + key + "\")"},{"key":"2",fun:"delMarker(\"" + objKV[key] + "\",\"" + key + "\")"}] ;
  843. wg.addContextMenu(lay.name,menuArra,funArra,key);
  844. }
  845. };
  846. /**
  847. * 隐藏图形
  848. * @param drawId
  849. */
  850. function hideDraw(drawId){
  851. setTimeout(function hideShape(){
  852. removeShape(drawId) ;
  853. },10) ;
  854. };
  855. /**
  856. * 删除图形
  857. * @param fd_id
  858. * @param drawId
  859. */
  860. function delDraw(fd_id, drawId){
  861. setTimeout(function delShape(){
  862. var url ="/nwyj/ws/cockpit/CockpitService/delDrawUserDefined";
  863. var res = gisUtil.getStrData(url,fd_id) ;
  864. if(res=="true"){
  865. removeShape(drawId) ;
  866. }
  867. },10) ;
  868. };
  869. /**
  870. * 隐藏图标
  871. * @param markerId
  872. */
  873. function hideMarker(markerId){
  874. setTimeout(function hideShape(){
  875. wg.removeMarker(markerId);
  876. },10) ;
  877. };
  878. /**
  879. * 删除图标
  880. * @param fd_id
  881. * @param markerId
  882. */
  883. function delMarker(fd_id, markerId){
  884. setTimeout(function delShape(){
  885. var url ="/nwyj/ws/cockpit/CockpitService/delDrawUserDefined";
  886. var res = gisUtil.getStrData(url,fd_id) ;
  887. if(res=="true"){
  888. wg.removeMarker(markerId);
  889. }
  890. },10) ;
  891. };
  892. /**
  893. * 删除地图绘制图形
  894. * @param drawId
  895. */
  896. function removeShape(drawId){
  897. wg.removeShape(drawId) ;
  898. };
  899. /**
  900. * 添加自定义图标的回调事件
  901. * @param e鼠标点击获得的地图坐标点
  902. */
  903. function callBackAddMarker(e){
  904. var dv = gisUtil.getDrawValue();
  905. var obj = {layerName:dv.drawLay,posX:e.x,posY:e.y,icon:dv.icon,clickable:true};
  906. wg.addMarker(obj);
  907. var iconName = dv.icon.split("/") ;
  908. gisUtil.addMarkerXY(iconName[iconName.length-1],e.x,e.y,dv.teamId,dv.describeinfo) ;
  909. } ;
  910. /**
  911. * @param 弹出应急预警响应通知单
  912. * @version 1.0
  913. * @Date 2015-09-26
  914. * @upDate
  915. */
  916. function openHouseInfo(e){
  917. var house_lay = gisUtil.getErHouse().name;
  918. if(e.layerName == house_lay){
  919. // alert(JSON.stringify(e))
  920. var url = "/nwyj/page/cockpit/alert/houseInfo.jsp?fd_id=" + e["extraData"]["FD_OBJECTID"] ;
  921. ai.createErInfoGrid(url);
  922. };
  923. };
  924. /**
  925. * 添加地图事件
  926. * @param eventName 事件名称
  927. * @param callFun 回调函数名
  928. */
  929. function addEvent(eventName,callFun){
  930. wg.addEvent(eventName,callFun);
  931. };
  932. /**
  933. * 添加地图图标
  934. */
  935. function addMarker(value){
  936. var pId = wg.addMarker(value) ;
  937. return pId;
  938. };
  939. /**
  940. * 地图改变级别回调函数
  941. * @param e
  942. */
  943. function mapChanged(e){
  944. delLayer("pref1") ;
  945. delLayer("pref2") ;
  946. delLayer("pref3") ;
  947. delLayer("prov1") ;
  948. delLayer("prov2") ;
  949. delLayer("prov3") ;
  950. var zl = e["zoomLevel"] ;
  951. var rad = gisUtil.getErRadius(zl) ;
  952. if(zl>=8){
  953. gisUtil.drawResource(gisUtil.getErFlagPref(),1,rad["ra"],rad["ds"]) ;
  954. } else {
  955. gisUtil.drawResource(gisUtil.getErFlagProv(),0,rad["ra"],rad["ds"]) ;
  956. };
  957. };
  958. /**
  959. * @param 弹出应急预警响应通知单
  960. * @version 1.0
  961. * @Date 2015-09-26
  962. * @upDate
  963. */
  964. function openEarlywarningnotice(e){
  965. var ewerLayProv = gisUtil.getEwerLayProv().name;//预警与响应网省级图层
  966. var ewerLaypref = gisUtil.getEwerLayPref().name;//预警与响应地市级图层
  967. var erEduiLayProv = gisUtil.getErEduiLay().name;//应急资源装备发电车网省级图层
  968. var erEduiDynLayProv = gisUtil.getErEduiDynamoLay().name;//应急资源装备发电机网省级图层
  969. var erTeamLayProv = gisUtil.getErTeamLay().name;//应急资源队伍网省级图层
  970. var erEduiCarPrev = gisUtil.getEduiCarPrevLay().name;//应急资源发电车地市级图层
  971. var erEduiDynPrev = gisUtil.getEduiDynamoPrevLay().name;//应急资源发电机地市级图层
  972. var erTeamPrev = gisUtil.getErTeamPrevLay().name;//应急资源队伍地市级图层
  973. var tempSpace = gisUtil.getTempSpace().name;
  974. //应急预警与响应
  975. if(e.layerName == ewerLayProv || e.layerName == ewerLaypref){
  976. var deptId = gisUtil.getUserInfo().dept_id ;
  977. window.open('/nwyj/page/cockpit/webgis/EventAllInfo.jsp?fd_id=' + e["extraData"]["FD_OBJECTID"] + "&dept_id=" + deptId);
  978. // window.open('/nwyj/page/cockpit/webgis/EventAllInfo.jsp?fd_id=' + e["extraData"]["FD_OBJECTID"] + "&dept_id=" + deptId,
  979. // '','top=0,left=0,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, alwaysRaised=yes, depended=yes, z-look=yes, titlebar=yes');
  980. };
  981. //临时场所
  982. if(e.layerName==tempSpace){
  983. // window.open('/nwyj/page/business/em/response/report/settlements/SiteInfo.jsp?fd_id=' + e["extraData"]["FD_OBJECTID"] + "&cockpit=1",
  984. // '','top=0,left=0,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, alwaysRaised=yes, depended=yes, z-look=yes, titlebar=yes');
  985. window.open('/nwyj/page/business/em/response/report/settlements/SiteInfo.jsp?fd_id=' + e["extraData"]["FD_OBJECTID"] + "&cockpit=1");
  986. };
  987. //应急装备发电车网省级
  988. if(e.layerName==erEduiLayProv){
  989. /*var url = $.pathname() + "/page/cockpit/alert/gis_generator-car-poll.jsp?dept_id=" + e.extraData.DEPT_ID + "&gisType=gistype&closeId=alertChar";
  990. if($("#alertChar").length){
  991. $("#alertChar").attr("src",url);
  992. }else{
  993. ati.createCharWin(600, 230, 70, 30, url,"alertChar");
  994. };*/
  995. //右上角统计数据
  996. $.post($.pathname()+ "/ws/generatorcar/GeneratorCarService/getCarInfo",{id : gisUtil.getUserInfo().dept_id},function (data){
  997. data = data.rows;
  998. var res = null;
  999. for(var key in data){
  1000. if(data[key].dept_id == e.extraData.DEPT_ID){
  1001. res = data[key];
  1002. };
  1003. };
  1004. res.dept_name = e.extraData.DEPT_NAME;
  1005. res.dept_id = e.extraData.DEPT_ID;
  1006. gisMes.window.showCarMes(res) ;
  1007. showMes();
  1008. });
  1009. };
  1010. //应急装备发电机(网省级)
  1011. if(e.layerName==erEduiDynLayProv){
  1012. /*var url = $.pathname() + "/page/cockpit/alert/gis_generator-poll.jsp?dept_id=" + e.extraData.DEPT_ID + "&gisType=gistype&closeId=alertChar";
  1013. if($("#alertChar").length){
  1014. $("#alertChar").attr("src",url);
  1015. }else{
  1016. ati.createCharWin(600, 230, 70, 30, url,"alertChar");
  1017. };*/
  1018. //右上角统计数据
  1019. $.post($.pathname()+ "/ws/generator/GeneratorService/getGeneratorStatistics",{id : gisUtil.getUserInfo().dept_id},function (data){
  1020. data = data.rows;
  1021. var res = null;
  1022. for(var key in data){
  1023. if(data[key].dept_id == e.extraData.DEPT_ID){
  1024. res = data[key];
  1025. };
  1026. };
  1027. res.dept_name = e.extraData.DEPT_NAME;
  1028. res.dept_id = e.extraData.DEPT_ID;
  1029. gisMes.window.showDynMes(res) ;
  1030. showMes();
  1031. },"json" );
  1032. };
  1033. //应急装备发电车(机)网省级
  1034. /*if(e.layerName==erEduiLayProv){
  1035. if($("#alertChar").length){
  1036. var encondeCondition="?dept_id=" + e.extraData.DEPT_ID + "&&title=" + e.extraData.DEPT_NAME ;
  1037. var url = $.pathname() + "/page/cockpit/echart_maticView/emergercy_source/emergency_equipment_into_child_chart.html" + encondeCondition + "&&?????legendC=#3399ff?xAxisC=#3399ff?yAxisC=#3399ff?titleC=#3399ff??gistype=alertChar";
  1038. $("#alertChar").attr("src",url);
  1039. var url = $.pathname() + "/page/cockpit/alert/gis_generator-poll.jsp?dept_id=" + e.extraData.DEPT_ID + "&gisType=gistype&closeId=alertChar";
  1040. $("#alertChar").attr("src",url);
  1041. }else{
  1042. // var encondeCondition=window.location.search;
  1043. // ?dept_id=78D3C3942A7E434DAB0D79F55C645232&&user_id=liuchuang&&user_name=liuchuang@xxzx.gd.csg.cn&&dept_name=%E5%B9%BF%E4%B8%9C%E7%94%B5%E7%BD%91%E6%9C%89%E9%99%90%E8%B4%A3%E4%BB%BB%E5%85%AC%E5%8F%B8&&parentId=BBD3C37F68094363AABC3CAD5FEE0AF8&&role_id=R002105430200002105430218,R002105430205
  1044. // {"ID":"ersoLayCarDist_000016","layerName":"ersoLayCarDist","posX":112.552302,"posY":23.697059,"offsetX":"0","offsetY":"0","Width":"0","Height":"0","clickable":"True","extraData":{"FD_OBJECTID":"52CBA051D490487DA2D1F258EB8F595D","name":"erso_equip","DEPT_ID":"52CBA051D490487DA2D1F258EB8F595D","DEPT_NAME":"清远供电局"},"icon":"http://localhost:8080//nwyj/images/cockpit/gis/erso_equip.png","title":"单位:清远供电局\n发电车总计:5台\t发电机总计:185台"}
  1045. var encondeCondition="?dept_id=" + e.extraData.DEPT_ID + "&&title=" + e.extraData.DEPT_NAME ;
  1046. var url = $.pathname() + "/page/cockpit/echart_maticView/emergercy_source/emergency_equipment_into_child_chart.html" + encondeCondition + "&&?????legendC=#3399ff?xAxisC=#3399ff?yAxisC=#3399ff?titleC=#3399ff??gistype=alertChar";
  1047. ati.createCharWin(770, 630, 100, 400, url,"alertChar");
  1048. var url = $.pathname() + "/page/cockpit/alert/gis_generator-poll.jsp?dept_id=" + e.extraData.DEPT_ID + "&gisType=gistype&closeId=alertChar";
  1049. ati.createCharWin(600, 230, 70, 30, url,"alertChar");
  1050. };
  1051. if($("#alertCharCar").length){
  1052. var url = $.pathname() + "/page/cockpit/alert/gis_generator-car-poll.jsp?dept_id=" + e.extraData.DEPT_ID + "&gisType=gistype&closeId=alertCharCar";
  1053. $("#alertCharCar").attr("src",url);
  1054. }else{
  1055. var url = $.pathname() + "/page/cockpit/alert/gis_generator-car-poll.jsp?dept_id=" + e.extraData.DEPT_ID + "&gisType=gistype&closeId=alertCharCar";
  1056. ati.createCharWin(600, 230, 300, 30, url,"alertCharCar");
  1057. };
  1058. };*/
  1059. //应急队伍网省级
  1060. if(e.layerName==erTeamLayProv){
  1061. /*var encondeCondition="?dept_id=" + e.extraData.DEPT_ID + "&&title=" + e.extraData.DEPT_NAME ;
  1062. var url = $.pathname() + "/page/cockpit/echart_maticView/emergercy_source/emergency_person_into_child_chart.html" + encondeCondition + "&&?????legendC=#3399ff?xAxisC=#3399ff?yAxisC=#3399ff?titleC=#3399ff??gistype=alertChar";
  1063. ati.createCharWin(770, 630, 100, 400, url,"alertChar");*/
  1064. //打开表头显示
  1065. /*var url = $.pathname() + "/page/cockpit/alert/gis_team-poll.jsp?dept_id=" + e.extraData.DEPT_ID + "&gisType=gistype&closeId=alertChar";
  1066. if($("#alertChar").length){
  1067. $("#alertChar").attr("src",url);
  1068. }else{
  1069. ati.createCharWin(600, 230, 70, 30, url,"alertChar");
  1070. };*/
  1071. //右上角统计数据
  1072. $.post($.pathname()+ "/ws/Team/TeamService/getTeamInfo",{id : gisUtil.getUserInfo().dept_id},function (data){
  1073. data = data.rows;
  1074. var res = null;
  1075. for(var key in data){
  1076. if(data[key].dept_id == e.extraData.DEPT_ID){
  1077. res = data[key];
  1078. };
  1079. };
  1080. res.dept_name = e.extraData.DEPT_NAME;
  1081. res.dept_id = e.extraData.DEPT_ID;
  1082. gisMes.window.showTeamMes(res) ;
  1083. showMes();
  1084. },"json" );
  1085. };
  1086. //应急发电车地市级
  1087. if(e.layerName==erEduiCarPrev){
  1088. /*var url = $.pathname() + "/page/business/am/resource/ledger/generator-car-info.jsp";
  1089. ati.createCharWin(770, 630, 100, 400, url,"alertChar");*/
  1090. window.open('/nwyj/page/business/am/resource/ledger/generator-car-info.jsp?' + e["extraData"]["FD_OBJECTID"] + "?&cockpit=1");
  1091. // window.open('/nwyj/page/business/am/resource/ledger/generator-car-info.jsp?' + e["extraData"]["FD_OBJECTID"] + "?&cockpit=1",
  1092. // '','top=0,left=0,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, alwaysRaised=yes, depended=yes, z-look=yes, titlebar=yes');
  1093. };
  1094. //应急发电机地市级
  1095. if(e.layerName==erEduiDynPrev){
  1096. /*var url = $.pathname() + "/page/business/am/resource/ledger/generator-info.jsp";
  1097. ati.createCharWin(770, 630, 100, 400, url,"alertChar");*/
  1098. window.open('/nwyj/page/business/am/resource/ledger/generator-info.jsp?' + e["extraData"]["FD_OBJECTID"] + "?&cockpit=1");
  1099. };
  1100. //应急人员队伍地市级
  1101. if(e.layerName==erTeamPrev){
  1102. /*var url = $.pathname() + "/page/business/am/resource/team/teaminfo.jsp";
  1103. ati.createCharWin(770, 630, 100, 400, url,"alertChar");*/
  1104. window.open('/nwyj/page/business/am/resource/team/teaminfo.jsp?' + e["extraData"]["FD_OBJECTID"] + "?0?&cockpit=1");
  1105. };
  1106. };
  1107. function openEduiPos(){
  1108. window.open('http://218.207.200.253/index.php/Admin/System/vehiclePosition');
  1109. };
  1110. /**
  1111. * 得到用户信息
  1112. */
  1113. function getUserInfo(){
  1114. return gisUtil.getUserInfo();
  1115. };
  1116. /**
  1117. * 打开头部信息打开应急预警通知单
  1118. */
  1119. /*function openEwer(){
  1120. var id = $("#srcollTitle").attr("valueID");
  1121. if(id){
  1122. var deptId = gisUtil.getUserInfo().dept_id ;
  1123. window.open('/nwyj/page/cockpit/webgis/EventAllInfo.jsp?fd_id=' + id + "&dept_id=" + deptId);
  1124. }
  1125. };*/
  1126. function openEwer(id,isAlert){
  1127. if(id){
  1128. var deptId = gisUtil.getUserInfo().dept_id ;
  1129. window.open('/nwyj/page/cockpit/webgis/EventAllInfo.jsp?fd_id=' + id + '&dept_id=' + deptId);
  1130. if(isAlert=="0"){
  1131. }else if(isAlert=="1"){
  1132. };
  1133. // window.open('/nwyj/page/cockpit/webgis/EventAllInfo.jsp?fd_id=' + id + "&dept_id=" + deptId);
  1134. };
  1135. };
  1136. /**
  1137. * 应急预警与响应查询面板
  1138. */
  1139. function searchEwerClick(){
  1140. var userInfo = gisUtil.resolveUrl();
  1141. //var conditionEw = " 1=1 and IS_DEL='0' and is_alert = '0' and is_send = '5' " ;
  1142. var conditionErCon =" ECM_EM_PUBLISH_ALERT_NOTICE.is_del=0 and IS_SEND !=6 and IS_ALERT=1 and "+//未删除,未结束,响应通知单
  1143. " ("+
  1144. " (RELEASE_UNIT in (select DEPT_ID from SYS_DEPARTMENT where PARENT_ID='"+userInfo.dept_id+"') and IS_SEND =5) or"+//登录人可见下级单位发布的通知单
  1145. " ('"+userInfo.dept_id+"' in (select DEPT_ID from SYS_DEPARTMENT where SYS_DEPARTMENT.PARENT_ID = ECM_EM_PUBLISH_ALERT_NOTICE.RELEASE_UNIT) AND IS_SEND =5) or"+//登录人发布的通知单下级单位可见guoenle-161012
  1146. " ((EARLY_WARNING_AREA_ID like '%"+userInfo.dept_id+"%' or WRITE_DEPT ='"+userInfo.dept_id+"') and IS_SEND =5) or"+//已发布的预警通知单--预警范围内的单位和填报单位可见
  1147. " (WRITE_DEPT='"+userInfo.dept_id+"' and WRITER='"+userInfo.real_name+"') or"+//填报单位下的填报人可见所有状态的预警通知单
  1148. " (release_unit='"+userInfo.dept_id+"' and ECM_EM_TREATED_HUMAN.PERSON_ID='"+userInfo.user_id+"' and ECM_EM_TREATED_HUMAN.IS_DEL=0 and IS_SEND in('1','3','4') ) or"+//登录人单位是发布单位,并且是处理人,并且状态为(待审核,待签发,待分发)
  1149. " (RELEASE_UNIT='"+userInfo.dept_id+"' and IS_SEND =5)"+//登录人单位是发布单位的人可见已发布的通知单
  1150. " ) ";
  1151. var conditionEwCon =" ECM_EM_PUBLISH_ALERT_NOTICE.is_del=0 and IS_SEND !=6 and IS_ALERT=0 and "+ //未删除,未结束,预警通知单
  1152. "("+
  1153. "(RELEASE_UNIT in (select DEPT_ID from SYS_DEPARTMENT where PARENT_ID='"+userInfo.dept_id+"') AND IS_SEND =5) or"+//登录人可见下级单位发布的通知单
  1154. "('"+userInfo.dept_id+"' in (select DEPT_ID from SYS_DEPARTMENT where SYS_DEPARTMENT.PARENT_ID = ECM_EM_PUBLISH_ALERT_NOTICE.RELEASE_UNIT) AND IS_SEND =5) or"+//登录人发布的通知单下级单位可见guoenle-161012
  1155. "((EARLY_WARNING_AREA_ID like '%"+userInfo.dept_id+"%' or WRITE_DEPT ='"+userInfo.dept_id+"') and IS_SEND =5) or "+//已发布的预警通知单--预警范围内的单位和填报单位可见
  1156. "(WRITE_DEPT='"+userInfo.dept_id+"' and WRITER='"+userInfo.real_name+"') or "+//填报单位下的填报人可见所有状态的预警通知单
  1157. "(release_unit='"+userInfo.dept_id+"' and ECM_EM_TREATED_HUMAN.PERSON_ID='"+userInfo.user_id+"' and ECM_EM_TREATED_HUMAN.IS_DEL=0 and IS_SEND in('1','3','4')) or "+//登录人单位是发布单位,并且是处理人,并且状态为(待审核,待签发,待分发)
  1158. "(RELEASE_UNIT='"+userInfo.dept_id+"' and IS_SEND =5) "+//登录人单位是发布单位的人可见已发布的通知单
  1159. ") ";
  1160. var temp = "" ;
  1161. var unitId = $("#unitId").attr("relValue") ;
  1162. /*var incidentType = $("#erewInci").attr("relText") ; */
  1163. var beginTime = $("#beginTime").attr("value") ;
  1164. var endTime = $("#endTime").attr("value") ;
  1165. var ewLevel = "";
  1166. var erLevel = "";
  1167. if(unitId){
  1168. temp = gisUtil.getOneSqlWhere("RELEASE_UNIT",unitId) ;
  1169. //conditionEw += temp ;
  1170. //conditionEr += temp ;
  1171. };
  1172. /*if(incidentType == "请选择"){
  1173. incidentType = "" ;
  1174. } else {
  1175. temp = gisUtil.getOneSqlWhereLike("EARLY_WARNING_NAME",incidentType) ;
  1176. conditionEw += temp ;
  1177. conditionEr += temp ;
  1178. }*/
  1179. if(beginTime == "" && endTime != ""){ beginTime = gisUtil.getThreeMonthsAgo(endTime); }
  1180. if(beginTime != "" && endTime == ""){ endTime = gisUtil.getNowFormatDate(allGetServerTime()); }
  1181. if(beginTime != "" && endTime != ""){
  1182. temp = " and RELEASE_RELIEVE_DATE BETWEEN '" + beginTime + "' AND '" + endTime + "'" ;
  1183. conditionEwCon += temp ;
  1184. conditionErCon += temp ;
  1185. };
  1186. if(beginTime == "" && endTime == ""){
  1187. var date = allGetServerTime() ;
  1188. beginTime = gisUtil.getThreeMonthsAgo(gisUtil.getNowFormatDate(date)) ;
  1189. endTime = gisUtil.getNowFormatDate(allGetServerTime()) ;
  1190. };
  1191. $("input:checkbox[name=ew_type]").each(function(){
  1192. if($(this).attr("checked")){ ewLevel += $(this).val() + ","; }
  1193. });
  1194. $("input:checkbox[name=er_type]").each(function(){
  1195. if($(this).attr("checked")){ erLevel += $(this).val() + ","; }
  1196. });
  1197. ewLevel = gisUtil.delLastChar(ewLevel);
  1198. erLevel = gisUtil.delLastChar(erLevel);
  1199. var level = "";
  1200. if(ewLevel == "" && erLevel == ""){
  1201. ai.setMes(320, 186, 200, 500, "系统提示", "没有选择相关的应急预警或应急响应级别");
  1202. ai.createAlert();
  1203. return ;
  1204. };
  1205. if(ewLevel != "" ){
  1206. temp = gisUtil.getOneSqlWhere("CURRENT_EW_LEVEL",ewLevel) ;
  1207. conditionEwCon += temp ;
  1208. };
  1209. if( erLevel != "" ){
  1210. temp = gisUtil.getOneSqlWhere("CURRENT_ER_LEVEL",erLevel) ;
  1211. conditionErCon += temp ;
  1212. };
  1213. if(ewLevel && erLevel){
  1214. level = ewLevel+","+erLevel;
  1215. }else{
  1216. if(ewLevel){ level = ewLevel; }else{ level = erLevel; }
  1217. };
  1218. var params = {
  1219. USER_NAME : userInfo.real_name,
  1220. USER_ID : userInfo.user_id,
  1221. RELEASE_UNIT : gisUtil.resolveUrl().dept_id,//单位
  1222. SEARCH_UNIT : unitId,//单位
  1223. //BM_EMC_WarningName : incidentType,//事件类型
  1224. LEVEL : level,//级别
  1225. BEGINTIME : beginTime,//开始时间
  1226. ENDTIME : endTime, //截止时间
  1227. //FLG: true
  1228. } ;
  1229. /*var paramsEr = {
  1230. USER_NAME : userInfo.real_name,
  1231. USER_ID : userInfo.user_id,
  1232. RELEASE_UNIT : gisUtil.resolveUrl().dept_id,//单位
  1233. //BM_EMC_WarningName : incidentType,//事件类型
  1234. LEVEL : erLevel,//级别
  1235. BEGINTIME : beginTime,//开始时间
  1236. ENDTIME : endTime, //截止时间
  1237. FLG: true
  1238. } ;*/
  1239. var conditionEr = {listId : '365',
  1240. direction:'DESC',
  1241. sort: 'ECM_EM_PUBLISH_ALERT_NOTICE.UPDATEDATE',
  1242. sublist:' left join ECM_EM_TREATED_HUMAN',
  1243. subCondition:' on ECM_EM_PUBLISH_ALERT_NOTICE.FD_OBJECTID=ECM_EM_TREATED_HUMAN.BUSINESS_ID ',
  1244. condition :conditionErCon};
  1245. var conditionEw = {
  1246. listId : '365',
  1247. direction:'DESC',
  1248. sort: 'ECM_EM_PUBLISH_ALERT_NOTICE.UPDATEDATE',
  1249. sublist:' left join ECM_EM_TREATED_HUMAN',
  1250. subCondition:' on ECM_EM_PUBLISH_ALERT_NOTICE.FD_OBJECTID=ECM_EM_TREATED_HUMAN.BUSINESS_ID ',
  1251. condition : conditionEwCon
  1252. };
  1253. // var changeGridEw = { "listId" : '365', "condition" : conditionEw };
  1254. // var changeGridEr = { "listId" : '365', "condition" : conditionEr };
  1255. gisUtil.searchEwer(params,conditionEw,conditionEr);
  1256. } ;
  1257. /*------------------------------------------------------应急资源图层查询按钮end----------------------------------------------*/
  1258. /**
  1259. * 应急资源标注查询
  1260. * @param params
  1261. */
  1262. function searchErCount(){
  1263. gisUtil.closeErsource();
  1264. var erUnitID = $("#unitIdByEr").attr("relValue") ;
  1265. var erTypeID = $("#erTypeID").val();
  1266. var beginTime = $("#beginTimeByEr").attr("value") ;
  1267. var endTime = $("#endTimeByEr").attr("value") ;
  1268. if(beginTime != "" && endTime == "") endTime = gisUtil.getNowFormatDate(allGetServerTime()) ;
  1269. if(beginTime == "" && endTime != "") beginTime = gisUtil.getThreeMonthsAgo(endTime);
  1270. if(beginTime == "" && endTime == ""){
  1271. var date = allGetServerTime() ;
  1272. beginTime = gisUtil.getThreeMonthsAgo(gisUtil.getNowFormatDate(date)) ;
  1273. endTime = gisUtil.getNowFormatDate(allGetServerTime()) ;
  1274. }
  1275. if(!erUnitID){
  1276. erUnitID = gisUtil.getDeptId() ;
  1277. }
  1278. var params = {classid : erTypeID, unitId : erUnitID, startDate : beginTime, endDate : endTime} ;
  1279. var url ="/nwyj/ws/cockpit/CockpitService/queryErMarker" ;
  1280. var erFlagPref = gisUtil.getJsonData(url,params) ;
  1281. gisUtil.setErFlagPref(erFlagPref);
  1282. if(erFlagPref){
  1283. var erFlagProv = {} ;
  1284. gisUtil.setErFlagProv(erFlagProv);
  1285. var posXArr = [] ;
  1286. var posYArr = [] ;
  1287. for(var key in erFlagPref){
  1288. posXArr.push(erFlagPref[key]["x"]) ;
  1289. posYArr.push(erFlagPref[key]["y"]) ;
  1290. }
  1291. var radiu = gisUtil.zoomToExtent(posXArr,posYArr) ;
  1292. var rad = gisUtil.getErRadius(radiu) ;
  1293. gisUtil.drawResource(erFlagPref,1,rad["ra"],rad["ds"]) ;//####
  1294. addEvent("onMapExtentChanged",mapChanged);
  1295. } else {
  1296. ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据");
  1297. ai.createAlert();
  1298. } ;
  1299. } ;
  1300. /*--------------------------------------------------------------应急资源标注查询事件end------------------------------------------*/
  1301. /**
  1302. * 应急装备展示
  1303. */
  1304. /*function searchEr(){
  1305. gisUtil.closeErDist();
  1306. gisUtil.ersoLay_er_dist_init();
  1307. var erUnitID = $("#unitIdByEr").attr("relValue") ;
  1308. var erTypeID = $("#erTypeID").attr("relValue");
  1309. var erTypeByPlaceID = $("#placeType").attr("relValue") ;
  1310. var st = "1";
  1311. if(!erUnitID){
  1312. st = "0";
  1313. erUnitID = gisUtil.getUserInfo().dept_id;
  1314. }
  1315. gisUtil.searchErDist(erTypeID,erUnitID,erTypeByPlaceID,st);
  1316. };*/
  1317. /**
  1318. * 应急队伍展示
  1319. */
  1320. function searchErTeam(){
  1321. gisUtil.closeErTeam();
  1322. gisUtil.er_team_init();
  1323. var erUnitID = $("#unitIdByEr").attr("relValue") ;
  1324. var st = "1";
  1325. if(!erUnitID){
  1326. st = "0";
  1327. erUnitID = gisUtil.getUserInfo().dept_id;
  1328. };
  1329. gisUtil.searchErTeam(erUnitID,st);
  1330. };
  1331. /**
  1332. * 应急资源 发电车展示
  1333. */
  1334. function searchErCar(){
  1335. gisUtil.closeErCar();
  1336. gisUtil.er_car_init();
  1337. var erUnitID = $("#unitIdByErCar").attr("relValue") ;
  1338. var st = "1";
  1339. if(!erUnitID){
  1340. st = "0";
  1341. erUnitID = gisUtil.getUserInfo().dept_id;
  1342. };
  1343. gisUtil.searchErCar(erUnitID,st);
  1344. };
  1345. /**
  1346. * 应急资源 发电机展示
  1347. */
  1348. function searchErGen(){
  1349. gisUtil.closeErGen();
  1350. gisUtil.er_gen_init();
  1351. var erUnitID = $("#unitIdByErGen").attr("relValue") ;
  1352. var st = "1";
  1353. if(!erUnitID){
  1354. st = "0";
  1355. erUnitID = gisUtil.getUserInfo().dept_id;
  1356. };
  1357. gisUtil.searchErGen(erUnitID,st);
  1358. };
  1359. /**
  1360. * 临时场所展示
  1361. */
  1362. function searchErPlace(){
  1363. gisUtil.closeErPlace();
  1364. gisUtil.er_place_init();
  1365. var erUnitID = $("#unitIdByEr").attr("relValue") ;
  1366. var erTypeByPlaceID = $("#placeType").attr("relValue") ;
  1367. var st = "1";
  1368. if(!erUnitID){
  1369. st = "0";
  1370. erUnitID = gisUtil.getUserInfo().dept_id;
  1371. }
  1372. gisUtil.searchErPlace(erUnitID,erTypeByPlaceID,st);
  1373. };
  1374. /**
  1375. * 应急仓库展示
  1376. */
  1377. function searchErHourse(){
  1378. var house_lay = gisUtil.getErHouse();
  1379. delLayer(house_lay.name) ;
  1380. addLayer(house_lay.name,house_lay.show,house_lay.hidden,house_lay.alpha,house_lay.order) ;
  1381. var params = {};
  1382. var house_belong = $("#house_belong").attr("relValue") ;//仓库归属
  1383. var house_type = $("#house_type").attr("relValue") ;//仓库类别
  1384. if(house_belong=="A"){
  1385. var house_level = $("#house_level").attr("relValue") ;//仓库级别
  1386. if(house_level){ params.hl = house_level; };
  1387. };
  1388. var goods_type = $("#goods_type").attr("relValue") ;//存储物资类别
  1389. if(house_belong){ params.hb = house_belong; };
  1390. if(house_type){ params.ht = house_type; };
  1391. if(goods_type){ params.gt = goods_type; };
  1392. gisUtil.searchErHouse(params);
  1393. };
  1394. /**
  1395. * 应急资源图层根据所选择的队伍进行定位
  1396. */
  1397. var afterRes = null ;
  1398. var tempLay = null ;
  1399. function locationPosition_old(){
  1400. var inciId = $("#teamInci").attr("relValue") ;
  1401. var teamId = $("#teamByInci").attr("relValue") ;
  1402. if(teamId==""||teamId==undefined||teamId==null){
  1403. ai.setMes(320, 186, 200, 500, "系统提示", "没有选择队伍");
  1404. ai.createAlert();
  1405. return false;
  1406. }
  1407. var params = { inci : inciId, teamid : teamId } ;
  1408. var lay = gisUtil.getErsoLayTeam();
  1409. var layTrack = gisUtil.getErsoLayTrack();
  1410. var pb = gisUtil.getErsoTeamPlayback();
  1411. delLayer(lay.name);
  1412. delLayer(layTrack.name);
  1413. delLayer(pb.name);
  1414. tracing = -1 ;
  1415. var url = $.pathname() + "/ws/cockpit/CockpitService/queryYJTameMarkerInfo" ;
  1416. var res = gisUtil.getJsonData(url,params) ;
  1417. if(!res){
  1418. ai.setMes(320, 186, 200, 500, "系统提示", "没有数据!");
  1419. ai.createAlert();
  1420. return;
  1421. }
  1422. var point = [] ;
  1423. point = point.concat(gisUtil.poinXY(res,"posX","posY")) ;
  1424. gisUtil.zoomToCoordList(point) ;
  1425. res = gisUtil.addEwrAttr(res,true,lay.name) ;
  1426. addResourceIco(res);//添加图标
  1427. afterRes = res ;
  1428. tempLay = lay.name ;
  1429. calBackMarker() ;
  1430. } ;
  1431. function locationPosition(){
  1432. var teamId = $("#teamMove").attr("relValue") ;
  1433. if(teamId==""||teamId==undefined||teamId==null){
  1434. ai.setMes(320, 186, 200, 500, "系统提示", "没有选择队伍");
  1435. ai.createAlert();
  1436. return false;
  1437. };
  1438. teamId = teamId.replace(",","','");
  1439. var params = { teamid : teamId } ;
  1440. var lay = gisUtil.getErsoLayTeam();
  1441. var layTrack = gisUtil.getErsoLayTrack();
  1442. var pb = gisUtil.getErsoTeamPlayback();
  1443. delLayer(lay.name);
  1444. delLayer(layTrack.name);
  1445. delLayer(pb.name);
  1446. tracing = -1 ;
  1447. var url = $.pathname() + "/ws/cockpit/CockpitService/fixedPosition" ;
  1448. var res = gisUtil.getJsonData(url,params) ;
  1449. if(!res){
  1450. ai.setMes(320, 186, 200, 500, "系统提示", "没有数据!");
  1451. ai.createAlert();
  1452. return;
  1453. }
  1454. var point = [] ;
  1455. point = point.concat(gisUtil.poinXY(res,"posX","posY")) ;
  1456. gisUtil.zoomToCoordList(point) ;
  1457. res = gisUtil.addEwrAttr(res,true,lay.name) ;
  1458. addResourceIco(res);//添加图标
  1459. afterRes = res ;
  1460. tempLay = lay.name ;
  1461. calBackMarker() ;
  1462. } ;
  1463. /*---------------------------------------------------队伍定位end------------------------------------------------------------*/
  1464. var i = 0 ;
  1465. /**
  1466. * 设置标签闪动5次
  1467. */
  1468. function calBackMarker(){
  1469. i++ ;
  1470. setTimeout(function del(){
  1471. if(i%2==0){
  1472. markerids = addResourceIco(afterRes);//添加图标
  1473. } else {
  1474. delLayer(tempLay);
  1475. } ;
  1476. },500) ;
  1477. if(i<4){
  1478. tracingTimer = setTimeout("calBackMarker()",500) ;
  1479. } else {
  1480. i = 0 ;
  1481. return ;
  1482. } ;
  1483. } ;
  1484. /*-------------------------------------------------设置标签闪动5次end ------------------------------------------------------*/
  1485. /**
  1486. * 轨迹描绘/向当前时间以后的数据进行描绘
  1487. * 先删除当前的路径及marker点,然后再重新生成路径及添加Marker点
  1488. */
  1489. var ps = {} ;
  1490. var tracing = 0 ;
  1491. function tracingMachine_old(){
  1492. var inciId = $("#teamInci").attr("relValue") ;
  1493. var teamId = $("#teamByInci").attr("relValue") ;
  1494. if(teamId==""||teamId==undefined||teamId==null){
  1495. ai.setMes(320, 186, 200, 500, "系统提示", "没有选择队伍");
  1496. ai.createAlert();
  1497. return false;
  1498. }
  1499. var params = { inci : inciId, teamid : teamId } ;
  1500. var layTeam = gisUtil.getErsoLayTeam();//定位
  1501. var layTrack = gisUtil.getErsoLayTrack();//描述
  1502. var pb = gisUtil.getErsoTeamPlayback();//回放
  1503. delLayer(layTrack.name);
  1504. delLayer(pb.name);
  1505. delLayer(layTeam.name);
  1506. addLayer(layTeam.name,layTeam.show,layTeam.hidden,layTeam.alpha,layTeam.order) ;//添加自定义图标图层(应急队伍图层)
  1507. addLayer(layTrack.name,layTrack.show,layTrack.hidden,layTrack.alpha,layTrack.order) ;//添加自定义图标图层(应急队伍图层)
  1508. var url = "/nwyj/ws/cockpit/CockpitService/queryYJTameMarkerInfo" ;
  1509. var res = gisUtil.getJsonData(url,params) ;
  1510. if(!res){
  1511. ai.setMes(320, 186, 200, 500, "系统提示", "没有数据 !");
  1512. ai.createAlert();
  1513. return;
  1514. }
  1515. var point = [] ;
  1516. point = point.concat(gisUtil.poinXY(res,"posX","posY")) ;
  1517. gisUtil.zoomToCoordList(point) ;
  1518. var tres = gisUtil.addEwrAttr(res,true,layTrack.name) ;
  1519. addResourceIco(tres);//添加图标
  1520. afterRes = tres ;
  1521. tempLay = layTrack.name ;
  1522. ps = params ;
  1523. tracing = 0 ;
  1524. calBackMarkerPaint() ;
  1525. } ;
  1526. //轨迹描绘
  1527. var tmmid = '';
  1528. function tracingMachine(){
  1529. var teamId = $("#teamMove").attr("relValue") ;
  1530. if(teamId==""||teamId==undefined||teamId==null){
  1531. ai.setMes(320, 186, 200, 500, "系统提示", "没有选择队伍");
  1532. ai.createAlert();
  1533. return false;
  1534. }
  1535. teamId = teamId.replace(",","','");
  1536. var params = { teamid : teamId } ;
  1537. var layTeam = gisUtil.getErsoLayTeam();//定位
  1538. var layTrack = gisUtil.getErsoLayTrack();//描述
  1539. var pb = gisUtil.getErsoTeamPlayback();//回放
  1540. delLayer(layTrack.name);
  1541. delLayer(pb.name);
  1542. delLayer(layTeam.name);
  1543. addLayer(layTeam.name,layTeam.show,layTeam.hidden,layTeam.alpha,layTeam.order) ;//添加自定义图标图层(应急队伍图层)
  1544. addLayer(layTrack.name,layTrack.show,layTrack.hidden,layTrack.alpha,layTrack.order) ;//添加自定义图标图层(应急队伍图层)
  1545. var url = "/nwyj/ws/cockpit/CockpitService/fixedPosition" ;
  1546. var res = gisUtil.getJsonData(url,params) ;
  1547. if(!res){
  1548. ai.setMes(320, 186, 200, 500, "系统提示", "没有数据 !");
  1549. ai.createAlert();
  1550. return;
  1551. }
  1552. var point = [] ;
  1553. point = point.concat(gisUtil.poinXY(res,"posX","posY")) ;
  1554. gisUtil.zoomToCoordList(point) ;
  1555. var tres = gisUtil.addEwrAttr(res,true,layTrack.name) ;
  1556. tmmid = addResourceIco(tres)[0];//添加图标
  1557. afterRes = tres ;
  1558. tempLay = layTrack.name ;
  1559. ps = params ;
  1560. tracing = 0 ;
  1561. calBackMarkerPaint() ;
  1562. } ;
  1563. function calBackMarkerPaint(){
  1564. var layTrack = gisUtil.getErsoLayTrack();
  1565. // var layTeam = gisUtil.getErsoLayTeam();
  1566. var ls = gisUtil.getLineStyle();
  1567. tracing++ ;
  1568. /* setTimeout(function del(){*/
  1569. /*if(tracing % 2 == 0){
  1570. addLayer(layTrack.name,layTrack.show,layTrack.hidden,layTrack.alpha,layTrack.order) ;//添加自定义图标图层(应急队伍图层)
  1571. markerids = addResourceIco(afterRes);//添加图标
  1572. } else {
  1573. delLayer(tempLay);
  1574. } ;*/
  1575. if(tracing % 5 == 0){
  1576. //var url = "/nwyj/ws/cockpit/CockpitService/queryYJTameMarkerInfo" ; //old
  1577. var url = "/nwyj/ws/cockpit/CockpitService/fixedPosition" ;
  1578. var res = gisUtil.getJsonData(url,ps) ;
  1579. var point = [] ;
  1580. point = point.concat(gisUtil.poinXY(res,"posX","posY")) ;
  1581. res = gisUtil.addEwrAttr(res,true,layTrack.name) ;
  1582. var after_x = afterRes[0]["posX"] ;
  1583. var after_y = afterRes[0]["posY"] ;
  1584. afterRes = res ;
  1585. if(!(after_x == afterRes[0]["posX"] && after_y == afterRes[0]["posY"])){
  1586. var points_team = {"points":[{"x":after_x,"y":after_y},{"x":afterRes[0]["posX"],"y":afterRes[0]["posY"]}]} ;
  1587. var obj = {layerName:layTrack.name,posX:afterRes[0]["posX"],posY:afterRes[0]["posY"]};
  1588. updataMarkerByTeam(tmmid,obj);
  1589. wg.addPolyLine(layTrack.name,points_team,ls.l_dis) ;
  1590. }
  1591. }
  1592. /* },1000) ;*/
  1593. if(tracing != 0){
  1594. tracingTimer = setTimeout("calBackMarkerPaint()",1000) ;
  1595. } else {
  1596. return ;
  1597. } ;
  1598. } ;
  1599. /**
  1600. * 历史轨迹回放单击事件
  1601. */
  1602. function roadHistoryLoad_old(){
  1603. var inciId = $("#teamInci").attr("relValue") ;
  1604. var teamId = $("#teamByInci").attr("relValue") ;
  1605. if(teamId==""||teamId==undefined||teamId==null){
  1606. ai.setMes(320, 186, 200, 500, "系统提示", "没有选择队伍");
  1607. ai.createAlert();
  1608. return false;
  1609. };
  1610. var beginTime = $("#beginTimeByTeam").attr("value") ;
  1611. var endTime = $("#endTimeByTeam").attr("value") ;
  1612. if(beginTime != "" && endTime == "") endTime = gisUtil.getNowFormatDate(allGetServerTime()) ;
  1613. if(beginTime == "" && endTime != "") beginTime = gisUtil.getThreeMonthsAgo(endTime);
  1614. /*if(beginTime == "" && endTime == ""){
  1615. var date = allGetServerTime() ;
  1616. beginTime = gisUtil.getThreeMonthsAgo(gisUtil.getNowFormatDate(date)) ;
  1617. endTime = gisUtil.getNowFormatDate(allGetServerTime()) ;
  1618. } ;*/
  1619. var params = { inci : inciId, teamid : teamId, beginTime : beginTime, endTime : endTime } ;
  1620. gisUtil.roadHistory(params) ;
  1621. };
  1622. /**
  1623. * 历史轨迹回放单击事件
  1624. */
  1625. function roadHistoryLoad(){
  1626. var teamId = $("#teamMove").attr("relValue") ;
  1627. if(teamId==""||teamId==undefined||teamId==null){
  1628. ai.setMes(320, 186, 200, 500, "系统提示", "没有选择队伍");
  1629. ai.createAlert();
  1630. return false;
  1631. };
  1632. teamId = teamId.replace(",","','");
  1633. var beginTime = $("#beginTimeByTeam").attr("value") ;
  1634. var endTime = $("#endTimeByTeam").attr("value") ;
  1635. if(beginTime != "" && endTime == "") endTime = gisUtil.getNowFormatDate(allGetServerTime()) ;
  1636. if(beginTime == "" && endTime != "") beginTime = gisUtil.getThreeMonthsAgo(endTime);
  1637. /*if(beginTime == "" && endTime == ""){
  1638. var date = allGetServerTime() ;
  1639. beginTime = gisUtil.getThreeMonthsAgo(gisUtil.getNowFormatDate(date)) ;
  1640. endTime = gisUtil.getNowFormatDate(allGetServerTime()) ;
  1641. } ;*/
  1642. var params = { teamid : teamId, beginTime : beginTime, endTime : endTime } ;
  1643. gisUtil.roadHistory(params) ;
  1644. };
  1645. /**
  1646. * 修改图标
  1647. * @param markerId图标ID
  1648. * @param obj
  1649. */
  1650. function updataMarkerByTeam(markerId,obj){
  1651. wg.updateMarker(markerId,obj) ;//修改Marker点
  1652. } ;
  1653. /**
  1654. * 添加一组坐标生成折线
  1655. * @param erPath
  1656. */
  1657. function addResourcePath(erPath){
  1658. for(var transfer in erPath){
  1659. wg.addPolyLine(erPath[transfer].layerName,erPath[transfer].points,erPath[transfer].lineStyle);
  1660. };
  1661. } ;
  1662. /**
  1663. * 查看图例
  1664. * @param id
  1665. */
  1666. function showLabel(id){
  1667. ai.setIconMes(320, 186, 1, 1, "应急预警图层", 21);
  1668. ai.createIconAlert();
  1669. };
  1670. /*=====================================================查询按钮end=======================================================*/
  1671. /**
  1672. * @param 弹出右键面板的同时获取右键菜单的ID
  1673. * @version 1.0
  1674. * @Date 2015-09-26
  1675. */
  1676. function OnRightClick(event, treeId, treeNode)
  1677. {
  1678. if(treeNode && !treeNode.noR)
  1679. {
  1680. zTree.selectNode(treeNode);
  1681. showRMenu(treeNode.menuType, event.clientX, event.clientY);
  1682. //右键得到点击的ID
  1683. RightMenuId = treeNode.id;
  1684. Rightflag=treeNode.checked;
  1685. }
  1686. };
  1687. /**
  1688. * @param 鼠标点击复选框传点击参数
  1689. * @version 1.0
  1690. * @Date 2015-09-26
  1691. */
  1692. function onCheckID(event, treeId, treeNode){
  1693. appendMenuid("onCheck", treeNode.id, treeNode.checked);
  1694. };
  1695. /**
  1696. * @param 导出图片
  1697. * @version 1.0
  1698. * @Date 2016-04-15
  1699. */
  1700. function ecportPicture()
  1701. {
  1702. picturebase64 = printPic();
  1703. if(picturebase64==null)
  1704. {
  1705. ai.setMes(320, 186, 200, 500, "系统提示", "获取变编码失败!请确定地图是否登录成功?");
  1706. ai.createAlert();
  1707. }
  1708. else
  1709. {
  1710. /*window.open("/nwyj/page/cockpit/webgis/exportPicture.html?"+picturebase64);*/
  1711. window.open("/nwyj/page/cockpit/webgis/exportPicture.html");
  1712. }
  1713. };
  1714. function printPic(){
  1715. return wg.exportPicture("png");
  1716. };
  1717. //==============================================================================================================================
  1718. /**
  1719. * 模拟台风路径绘制,表单添写验证通过后开始绘制
  1720. */
  1721. function drawTyphoonPath(){
  1722. /**
  1723. * 模拟台风面板加载校验
  1724. */
  1725. $(".history_typh").each(function(i){
  1726. $(this).focus();
  1727. $(this).blur();
  1728. });
  1729. if(validation()){
  1730. gisUtil.resPisp();
  1731. startGetPoint();
  1732. }
  1733. };
  1734. /**
  1735. * 校验模拟面板填写是否有不可法参数
  1736. * @returns {Boolean}
  1737. */
  1738. function validation(){
  1739. var flg = true ;
  1740. $(".history_typh[valid='false']").each(function(i){
  1741. flg = false ;
  1742. });
  1743. return flg ;
  1744. };
  1745. /**
  1746. * 模拟台风绘制添加首点
  1747. */
  1748. function startGetPoint(){
  1749. wg.startGetPoint();
  1750. };
  1751. /**
  1752. * 子窗口添加模拟路径点
  1753. * @param param:表单信息序列化参数
  1754. */
  1755. function iframeGetPoint(param){
  1756. addSimuPoint(param);
  1757. gisUtil.piPlusOne();
  1758. gisUtil.addSimulationPoint(param);
  1759. wg.startGetPoint();
  1760. };
  1761. /**
  1762. * 模拟台风路径
  1763. * @param param
  1764. */
  1765. function addSimuPoint(param){
  1766. var lay = gisUtil.getDtpLayPoint();
  1767. var pathIcon = gisUtil.getGisIconPath();
  1768. var marker = gisUtil.getSimuMark()[param.MAX_STRENGTH]+ ".png";
  1769. var obj = {layerName:lay.name, posX:param.LONGITUDE, posY:param.LATITUDE, icon:pathIcon + marker,
  1770. title:gisUtil.getSimuPointDes(param), clickable:true,
  1771. extraData:{sev:param.SEVEN_RADIUS,ten:param.TEN_RADIUS,tew:param.TWELVE_RADIUS}};
  1772. var mid = wg.addMarker(obj);
  1773. gisUtil.addSimuMarker(mid);
  1774. };
  1775. function showWindResisting(e){
  1776. if(e.layerName==gisUtil.getDtpLayPoint().name){
  1777. var param = {};
  1778. param.radius = e.extraData;
  1779. param.point = {posX:e.posX,posY:e.posY};
  1780. showPhoonCircle(param,false);
  1781. }else if(e.layerName==gisUtil.getHdtpLayPoint().name){
  1782. var paramh = {};
  1783. paramh.radius = e.extraData;
  1784. paramh.point = {posX:e.posX,posY:e.posY};
  1785. showPhoonCircle(paramh,true);
  1786. };
  1787. };
  1788. /**
  1789. * 点击模拟台风Marker点添加风圈
  1790. * @param params
  1791. */
  1792. function showPhoonCircle(param,isHistory){
  1793. var sevLay,tenLay,tweLay;
  1794. if(isHistory){//是否为历史模拟路径,false为模拟路径
  1795. sevLay = gisUtil.getHdtpLaySevenCircle().name;
  1796. tenLay = gisUtil.getHdtpLayTenCircle().name;
  1797. tweLay = gisUtil.getHdtpLayTwelveCircle().name;
  1798. delLayer(sevLay);
  1799. delLayer(tenLay);
  1800. delLayer(tweLay);
  1801. gisUtil.historyTyphoonCircleLoadLay();
  1802. }else{
  1803. sevLay = gisUtil.getDtpLaySevenCircle().name;
  1804. tenLay = gisUtil.getDtpLayTenCircle().name;
  1805. tweLay = gisUtil.getDtpLayTwelveCircle().name;
  1806. delLayer(sevLay);
  1807. delLayer(tenLay);
  1808. delLayer(tweLay);
  1809. gisUtil.windResistingInit();
  1810. }
  1811. var style = gisUtil.getSimuCircleStyle().sev.style;
  1812. var obj = {};
  1813. obj.points = {x:param.point.posX,y:param.point.posY};
  1814. var cid ;
  1815. if(gisUtil.verifyParams(param.radius.sev)){
  1816. style.strokeColor = gisUtil.getSimuCircleStyle().sev.color;
  1817. style.fillColor = gisUtil.getSimuCircleStyle().sev.color;
  1818. obj.radius = param.radius.sev*1000;
  1819. cid = addCircle(sevLay,obj,style,"params");
  1820. var menuArra = [{ "Key": "1","Name": "查看风圈下设备"}, { "Key": "2","Name": "删除"}];
  1821. var funArra = [{"key":"1",fun:"showPhoonCirclePSR('" + param.point.posX + "','" + param.point.posY + "','" + param.radius.sev + "')"},{"key":"2",fun:"delMarkerSimu('" + 'data' + "')"}] ;
  1822. wg.addContextMenu(sevLay,menuArra,funArra,cid);
  1823. };
  1824. if(gisUtil.verifyParams(param.radius.ten)){
  1825. style.strokeColor = gisUtil.getSimuCircleStyle().ten.color;
  1826. style.fillColor = gisUtil.getSimuCircleStyle().ten.color;
  1827. obj.radius = param.radius.ten*1000;
  1828. cid = addCircle(tenLay,obj,style,"params");
  1829. var menuArraTen = [{ "Key": "1","Name": "查看风圈下设备"}, { "Key": "2","Name": "删除"}];
  1830. var funArraTen = [{"key":"1",fun:"showPhoonCirclePSR('" + param.point.posX + "','" + param.point.posY + "','" + param.radius.ten + "')"},{"key":"2",fun:"delMarkerSimu('" + 'data' + "')"}] ;
  1831. wg.addContextMenu(tenLay,menuArraTen,funArraTen,cid);
  1832. };
  1833. if(gisUtil.verifyParams(param.radius.tew)){
  1834. style.strokeColor = gisUtil.getSimuCircleStyle().tew.color;
  1835. style.fillColor = gisUtil.getSimuCircleStyle().tew.color;
  1836. obj.radius = param.radius.tew*1000;
  1837. cid = addCircle(tweLay,obj,style,"params");
  1838. var menuArraTew = [{ "Key": "1","Name": "查看该区域的变电站和输电线路"}, { "Key": "2","Name": "删除"}];
  1839. var funArraTew = [{"key":"1",fun:"showPhoonCirclePSR('" + param.point.posX + "','" + param.point.posY + "','" + param.radius.tew + "')"},{"key":"2",fun:"delMarkerSimu('" + 'data' + "')"}] ;
  1840. wg.addContextMenu(tweLay,menuArraTew,funArraTew,cid);
  1841. };
  1842. };
  1843. /**
  1844. * 查看风圈下设备
  1845. */
  1846. function showPhoonCirclePSR(posX,posY,radius){
  1847. var obj = {};
  1848. obj.geometryType = 3;
  1849. obj.geoData = {};
  1850. obj.geoData.points = [{x:posX,y:posY}];
  1851. obj.geoData.radius = radius*1000;
  1852. // "900": "10kV变电站",
  1853. // "901": "35kV变电站", "902": "110kV变电站", "903": "220kV变电站",
  1854. // "904": "500kV变电站", "905": "输电线路", "906": "35kV输电线路",
  1855. // "907": "110kV输电线路", "908": "220kV输电线路", "909": "500kV输电线路",
  1856. var psrListArr = [900,901,902,903,904,905,906,907,908,909];
  1857. // var url = $.pathname() + "/page/cockpit/webgis/js/psrType.json" ;
  1858. // $.getJSON(url,function(data){
  1859. // psrListArr = data.psrTypeArr;
  1860. // });
  1861. setTimeout(function(){
  1862. var s = wg.queryPSRByArea(obj,psrListArr);
  1863. // alert(JSON.stringify(s))
  1864. },10);
  1865. };
  1866. function delMarkerSimu(param){
  1867. // alert(JSON.stringify(param))
  1868. };
  1869. /**
  1870. * 模拟台风绘制回调函数
  1871. * @param e
  1872. */
  1873. function getPointFun(e){
  1874. var pi = gisUtil.getPi();
  1875. var cl = 1;
  1876. if(pi!=0){
  1877. var slp = gisUtil.getSimulationPoint();
  1878. cl = slp[pi-1].MAX_STRENGTH;
  1879. var geo = {points:[{x:slp[pi-1].LONGITUDE,y:slp[pi-1].LATITUDE},{x:e.x,y:e.y}]};
  1880. var ls = gisUtil.getSimulineStyle();
  1881. ls.strokeColor = gisUtil.getSimuColor()[cl];
  1882. var lid = wg.addPolyLine(gisUtil.getDtpLayLine().name,geo,ls);
  1883. gisUtil.addSimuLine(lid);
  1884. }
  1885. $("#leftceladows").append("<div id='gis_mask' class='_mask'></div>");
  1886. var url = $.pathname() + "/page/cockpit/alert/alertTyphoonDraw.html?x=" + e.x + "&y=" + e.y +
  1887. "&pi=" + pi ;
  1888. ati.createWin(770, 630, 50, 200, url);
  1889. };
  1890. /**
  1891. * 结束绘制
  1892. * @param param
  1893. */
  1894. function overDraw(param){
  1895. addSimuPoint(param);
  1896. gisUtil.addSimulationPoint(param);
  1897. var sp = gisUtil.getSimulationPoint();
  1898. var jsonStr = JSON.stringify(sp);
  1899. var user_id = gisUtil.resolveUrl()["user_id"];
  1900. var simu = {USER_ID:user_id,TYPHOON_NUM:$("#TYPHOON_NUM").val(),TYPHOON_NAME_CH:$("#TYPHOON_NAME_CH").val(),TYPHOON_NAME_EN:$("#TYPHOON_NAME_EN").val()};
  1901. var params = {SIMU:JSON.stringify(simu),INFO: jsonStr };
  1902. var url = $.pathname() + "/ws/cockpit/CockpitService/addSimulateTyphoonPath" ;
  1903. gisUtil.getArrData(url,params);
  1904. gisUtil.resetSimCurrent();
  1905. var data = {};
  1906. data.radius = {sev:param.SEVEN_RADIUS,ten:param.TEN_RADIUS,tew:param.TWELVE_RADIUS};
  1907. data.point = {posX:param.LONGITUDE,posY:param.LATITUDE};
  1908. showPhoonCircle(data,false);
  1909. };
  1910. /**
  1911. * 放弃绘制
  1912. */
  1913. function giveUpCurrent(){
  1914. var mid = gisUtil.getSimuCurrentID().markerID;
  1915. var lid = gisUtil.getSimuCurrentID().lineID;
  1916. delMarkers(mid);
  1917. delLines(lid);
  1918. removeDrawWin();
  1919. };
  1920. /**
  1921. * 重新采取台风模拟路径当前点
  1922. */
  1923. function resample(){
  1924. removeDrawWin();
  1925. //删除线
  1926. var lid = [];
  1927. var lids = gisUtil.getSimuCurrentID().lineID;
  1928. if(lids.length!=0){
  1929. lid.push(lids[lids.length-1]);
  1930. delLines(lid);
  1931. }
  1932. wg.startGetPoint();
  1933. };
  1934. /**
  1935. * 清除一组Marker图标
  1936. */
  1937. function delMarkers(mids){
  1938. for(var key in mids){
  1939. wg.removeMarker(mids[key]);
  1940. };
  1941. };
  1942. /**
  1943. * 清除一组图形
  1944. */
  1945. function delLines(lids){
  1946. for(var key in lids){
  1947. wg.removeShape(lids[key]);
  1948. };
  1949. };
  1950. /**
  1951. * 显示历史台风模拟路径面板
  1952. */
  1953. function historyTyphoonSearch(){
  1954. var url = $.pathname() + "/page/cockpit/alert/HistoryTyphoonAler.jsp";
  1955. ati.createTyphWin(200, 330, 60, 325, url);
  1956. };
  1957. /**
  1958. * 加载历史模拟台风路径
  1959. */
  1960. function loadHistoryTyphoonPath(sid){
  1961. for(var i=0; i<gisUtil.getSetTimeoutArr().length; i++){
  1962. clearTimeout(gisUtil.getSetTimeoutArr()[i]);
  1963. }
  1964. gisUtil.addHistoryTyphoonPath(sid);
  1965. };
  1966. //=============================================================================================================================
  1967. /**function openPostWindow()
  1968. {
  1969. var tempForm = document.createElement("from");
  1970. tempFrom.id = "tempFrom1";
  1971. tempFrom.mwthod = "post";
  1972. tempFrom.action = url;
  1973. tempFrom.target = name;
  1974. };*/
  1975. //===============================================================================================================================
  1976. /**
  1977. * 电网资源为关闭状态,调用此方法打开电网资源
  1978. */
  1979. function openDwLay(){
  1980. $("#sh_showDT").text("隐藏电网图") ;
  1981. // $("#dw_lay").attr("title","隐藏电网图") ;
  1982. $("#sh_showDT").addClass("dw_open").removeClass("dw_close");
  1983. $("#dw_lay").addClass("dw_open").removeClass("dw_close");
  1984. $("#dw_lay").attr("src","/nwyj/images/cockpit/btn/power_hidden.png");
  1985. // wg.showPSRLayer(true);
  1986. var layerList = wg.getPSRLayerInfo();
  1987. for(var key in layerList){
  1988. layerList[key].Visible = true;
  1989. wg.setPSRLayerVisiable(layerList[key]);
  1990. };
  1991. };
  1992. /**
  1993. * 电网资源为打开状态,调用此方法关闭电网资源
  1994. */
  1995. function closeDwLay(){
  1996. $("#sh_showDT").text("显示电网图") ;
  1997. // $("#dw_lay").attr("title","显示电网图") ;
  1998. $("#sh_showDT").addClass("dw_close").removeClass("dw_open");
  1999. $("#dw_lay").addClass("dw_close").removeClass("dw_open");
  2000. $("#dw_lay").attr("src","/nwyj/images/cockpit/btn/power_show.png");
  2001. // wg.showPSRLayer(false);
  2002. var layerList = wg.getPSRLayerInfo();
  2003. for(var key in layerList){
  2004. layerList[key].Visible = false;
  2005. wg.setPSRLayerVisiable(layerList[key]);
  2006. };
  2007. };
  2008. /**
  2009. * 工具条为关闭状态,调用此方法打开工具条
  2010. */
  2011. function openToolBarByGis(){
  2012. $("#sh_oper_tool").text("关闭工具条") ;
  2013. // $("#tool_lay").attr("title","关闭工具条") ;
  2014. $("#sh_oper_tool").addClass("tool_open").removeClass("tool_close");
  2015. $("#tool_lay").addClass("tool_open").removeClass("tool_close");
  2016. $("#tool_lay").attr("src","/nwyj/images/cockpit/btn/gis_hidden.png");
  2017. openFuncUI(WebGisMap.MAPTOOLBAR,true);
  2018. };
  2019. /**
  2020. * 工具条为打开状态,调用此方法关闭工具条
  2021. */
  2022. function closeToolBarByGis(){
  2023. $("#sh_oper_tool").text("打开工具条") ;
  2024. // $("#tool_lay").attr("title","打开工具条") ;
  2025. $("#sh_oper_tool").addClass("tool_close").removeClass("tool_open");
  2026. $("#tool_lay").addClass("tool_close").removeClass("tool_open");
  2027. $("#tool_lay").attr("src","/nwyj/images/cockpit/btn/gis_show.png");
  2028. openFuncUI(WebGisMap.MAPTOOLBAR,false);
  2029. };
  2030. $(function(){
  2031. /* 头部打开关闭电网图层 */
  2032. $("#dw_lay").click(function(){
  2033. if($("#dw_lay").hasClass("dw_open")){//打开状态
  2034. closeDwLay();
  2035. }else{//关闭状态
  2036. openDwLay();
  2037. };
  2038. });
  2039. /* 工具条 */
  2040. $("#sh_oper_tool").click(function(){
  2041. if($("#sh_oper_tool").hasClass("tool_open")){//打开状态
  2042. closeToolBarByGis();
  2043. }else{//关闭状态
  2044. openToolBarByGis();
  2045. };
  2046. });
  2047. /* 比例尺 */
  2048. $("#sh_openSca").toggle(
  2049. function(){
  2050. $(this).text("打开比例尺") ;
  2051. openFuncUI(WebGisMap.SCALE,false);
  2052. },
  2053. function(){
  2054. $(this).text("关闭比例尺") ;
  2055. openFuncUI(WebGisMap.SCALE,true);
  2056. }
  2057. );
  2058. /* 鹰眼图 */
  2059. $("#sh_opeOver").toggle(
  2060. function(){
  2061. $(this).text("关闭鹰眼图") ;
  2062. openFuncUI(WebGisMap.OVERVIEW,true);
  2063. },
  2064. function(){
  2065. $(this).text("打开鹰眼图") ;
  2066. openFuncUI(WebGisMap.OVERVIEW,false);
  2067. }
  2068. );
  2069. /* 电网图层图标 */
  2070. $("#sh_showDT").click(function(){
  2071. if($("#dw_lay").hasClass("dw_open")){//打开状态
  2072. closeDwLay();
  2073. }else{//关闭状态
  2074. openDwLay();
  2075. };
  2076. });
  2077. /* 工具条图标 */
  2078. $("#tool_lay").click(function(){
  2079. if($("#tool_lay").hasClass("tool_open")){//打开状态
  2080. closeToolBarByGis();
  2081. }else{//关闭状态
  2082. openToolBarByGis();
  2083. };
  2084. });
  2085. /* 坐标定位面板显示 */
  2086. $("#sh_latlon").click(
  2087. function(){
  2088. wg.openLocateByLongLatUI();
  2089. }
  2090. );
  2091. /* 电网图层过滤显示 */
  2092. $("#sh_power_resource").toggle(
  2093. function(){
  2094. $(this).text("隐藏电网过滤图层") ;
  2095. var param = parsePRTree(wg.getPSRLayerInfo());
  2096. var setting = { check: { enable: true },
  2097. view: {showIcon: false, nameIsHTML: true },
  2098. callback: { beforeCheck: powerCheck}
  2099. };
  2100. $("#sh_other_plan").slideDown(600);
  2101. $.fn.zTree.init($("#tree_power"), setting, param);
  2102. },function(){
  2103. $(this).text("显示电网过滤图层") ;
  2104. $("#sh_other_plan").slideUp(600);
  2105. }
  2106. );
  2107. /* 导出复选框初始化 */
  2108. $("#excel").removeAttr("checked");
  2109. $("#word").removeAttr("checked");
  2110. /* 导出Excel图标 */
  2111. // $("#excel_icon").toggle(onExcel,offExcel);
  2112. $("#excel_icon").click(function(){
  2113. if($(this).hasClass("off_expor")){
  2114. $(this).removeClass("off_expor").addClass("on_expor");
  2115. $("#excel").attr("checked","checked");
  2116. addQueryDevAffected();
  2117. }else{
  2118. $(this).removeClass("on_expor").addClass("off_expor");
  2119. $("#excel").removeAttr("checked");
  2120. removeQueryDevAffected();
  2121. };
  2122. });
  2123. /* 导出Word图标 */
  2124. $("#word_icon").click(function(){
  2125. if($(this).hasClass("off_expor")){
  2126. $(this).removeClass("off_expor").addClass("on_expor");
  2127. $("#word").attr("checked","checked");
  2128. addQueryDevAffected();
  2129. }else{
  2130. $(this).removeClass("on_expor").addClass("off_expor");
  2131. $("#word").removeAttr("checked");
  2132. removeQueryDevAffected();
  2133. };
  2134. });
  2135. /* 导出Excel */
  2136. $("#excel").change( function() {
  2137. if($(this).attr("checked")){
  2138. if($("#excel_icon").hasClass("off_expor")){
  2139. $("#excel_icon").removeClass("off_expor").addClass("on_expor");
  2140. };
  2141. addQueryDevAffected();
  2142. }else{
  2143. if($("#excel_icon").hasClass("on_expor")){
  2144. $("#excel_icon").removeClass("on_expor").addClass("off_expor");
  2145. };
  2146. removeQueryDevAffected();
  2147. }
  2148. });
  2149. /* 导出word */
  2150. $("#word").change( function() {
  2151. if($(this).attr("checked")){
  2152. if($("#word_icon").hasClass("off_expor")){
  2153. $("#word_icon").removeClass("off_expor").addClass("on_expor");
  2154. };
  2155. addQueryDevAffected();
  2156. }else{
  2157. if($("#word_icon").hasClass("on_expor")){
  2158. $("#word_icon").removeClass("on_expor").addClass("off_expor");
  2159. };
  2160. removeQueryDevAffected();
  2161. }
  2162. });
  2163. });
  2164. /* 添加查询受影响设备事件 */
  2165. function addQueryDevAffected(){
  2166. wg.addEvent("onQueryDevAffected", onQueryDevAffected);
  2167. };
  2168. /* 移除查询受影响设备事件 */
  2169. function removeQueryDevAffected(){
  2170. if($("#word_icon").hasClass("off_expor") && $("#excel_icon").hasClass("off_expor")){
  2171. wg.removeEvent("onQueryDevAffected");
  2172. };
  2173. };
  2174. /**
  2175. * 根据设备ID得到设备名称
  2176. * @param psrArr
  2177. * @returns {Array}
  2178. */
  2179. function queryPSRByDevID(psrArr){
  2180. var devNameArr = [];
  2181. var data = wg.queryPSRByDevID(psrArr);
  2182. for(var key in data){
  2183. devNameArr.push(data[key].DevInfo.DevName);
  2184. };
  2185. return devNameArr;
  2186. };
  2187. /* 设备列表 */
  2188. function onQueryDevAffected(devIDList) {
  2189. var layerList = wg.getPSRLayerInfo();
  2190. gisUtil.setPsrList(layerList);
  2191. devIDList = eval(devIDList);
  2192. for(var key in devIDList){
  2193. var psrName = queryPSRByDevID(devIDList[key].psrIDS);
  2194. devIDList[key].psrName = psrName;
  2195. };
  2196. exportExcel(devIDList);
  2197. /*if($("#excel").attr("checked")){
  2198. $("#expor_tool").animate({ width: "165px" }, 1000);
  2199. };
  2200. if($("#word").attr("checked")){
  2201. expor_word_tool.window.setWord(gisUtil.getWordText(devIDList));
  2202. $("#expor_word_tool").animate({ width: "165px" }, 1000);
  2203. };*/
  2204. // expor_tool.window.setDev(devIDList);
  2205. // gisUtil.expor_excel(eval(devIDList));
  2206. };
  2207. //function hideExporTool(){
  2208. // $("#expor_tool").animate({
  2209. // width: "0"
  2210. // }, 1000 );
  2211. //};
  2212. /*
  2213. 导出Excel选项
  2214. function expor_excel(devIDList,flag){
  2215. // gisUtil.expor_excel(devIDList,flag);
  2216. exportExcel(devIDList);
  2217. };
  2218. 导出Word选项
  2219. function expor_word(exporWord,flag){
  2220. gisUtil.expor_word(exporWord,flag);
  2221. };
  2222. 勾选Excel复选框
  2223. function onExcel(){
  2224. $("#excel").attr("ckecked","ckecked");
  2225. };
  2226. 取消勾选Excel复选框
  2227. function offExcel(){
  2228. $("#excel").attr("ckecked","ckecked");
  2229. };
  2230. 勾选Word复选框
  2231. function onWord(){
  2232. };
  2233. 取消勾选Word复选框
  2234. function offWord(){
  2235. };*/
  2236. function exportExcel(devIDList){
  2237. var tripArr = [];
  2238. var tripStr = "'";
  2239. for(var key in devIDList){
  2240. if(devIDList[key].psrType == "900" ||
  2241. devIDList[key].psrType == "901" ||
  2242. devIDList[key].psrType == "902" ||
  2243. devIDList[key].psrType == "903" ||
  2244. devIDList[key].psrType == "904" ){
  2245. tripArr.concat(devIDList[key].psrIDS);
  2246. tripStr += devIDList[key].psrIDS.join("','");
  2247. };
  2248. };
  2249. tripStr += "'";
  2250. if(tripStr.length == 0){return;}
  2251. $.ajax({
  2252. url : $.pathname() + '/ws/export/ExportService/exportExcle',
  2253. type : 'post',
  2254. timeout : 15000,
  2255. data : {devId:tripStr},
  2256. dataType : 'text',
  2257. async:false,
  2258. success : function(data){
  2259. var url = $.pathname() +"/page/common/getExcel.jsp?exportContent="
  2260. + data + "&destFileName=" + encodeURI(encodeURI('台风受影响设备列表'));
  2261. var w = window.open(url, "_blank");
  2262. // w.location.href = url;
  2263. },
  2264. error : function(e){
  2265. ai.setMes(320, 186, 200, 500, "系统提示", "导出Excel失败");
  2266. ai.createAlert();
  2267. }
  2268. });
  2269. }
  2270. /**
  2271. *
  2272. * @param ui
  2273. * @param flag
  2274. */
  2275. function openFuncUI(ui,flag){
  2276. wg.openFuncUI(ui,flag);
  2277. };
  2278. function powerCheck(treeId, treeNode){
  2279. if(treeNode.isParent){
  2280. ispo = treeNode.children;
  2281. for(var key in ispo){
  2282. if(ispo[key].isParent){
  2283. var ispoc = ispo[key].children;
  2284. for(var sk in ispoc){
  2285. if(ispoc[sk].isParent){
  2286. var ispocc = ispoc[sk].children;
  2287. for(var ck in ispocc){
  2288. var obj = { LayerID: ispocc[ck].id, LayerName: ispocc[ck].ename, Visible: !ispocc[ck].checked };
  2289. setPSRLayerVisiable(obj);
  2290. };
  2291. }else{
  2292. var obj = { LayerID: ispoc[sk].id, LayerName: ispoc[sk].ename, Visible: !ispoc[sk].checked };
  2293. setPSRLayerVisiable(obj);
  2294. };
  2295. };
  2296. }else{
  2297. var obj = { LayerID: ispo[key].id, LayerName: ispo[key].ename, Visible: !ispo[key].checked };
  2298. setPSRLayerVisiable(obj);
  2299. };
  2300. };
  2301. }else{
  2302. var obj = { LayerID: treeNode.id, LayerName: treeNode.ename, Visible: !treeNode.checked };
  2303. setPSRLayerVisiable(obj);
  2304. };
  2305. };
  2306. /**
  2307. * 设置电网图层状态
  2308. * @param obj {LayerID:图层ID, LayerName:图层名, Visible:是否可见(true/false)}
  2309. */
  2310. function setPSRLayerVisiable(obj){
  2311. wg.setPSRLayerVisiable(obj);
  2312. };
  2313. /**
  2314. * 电网资源信息封装成树JSON格式数据
  2315. * @param param
  2316. * @returns {___anonymous32648_32649}
  2317. */
  2318. function parsePRTree(param){
  2319. var nodes = [];
  2320. var pnodes = [{parentId:"0" , id:"1" , name:"设备层", checked:true, pname:null, ename:"设备层"},
  2321. {parentId:"1" , id:"11" , name:"1000kV", checked:true, pname:null, ename:"1000kV"},
  2322. {parentId:"11", id:"111", name:"输电" , checked:true , pname:"1000kV", ename:"输电"},
  2323. {parentId:"1" , id:"12" , name:"±800kV" , checked:true, pname:null, ename:"±800kV"},
  2324. {parentId:"12", id:"121", name:"变电站", checked:true, pname:"±800kV", ename:"变电站"},
  2325. {parentId:"12", id:"122", name:"输电" , checked:true, pname:"±800kV", ename:"输电"},
  2326. {parentId:"1" , id:"13" , name:"±500kV" , checked:true, pname:null, ename:"±500kV"},
  2327. {parentId:"13", id:"131", name:"变电站", checked:true, pname:"±500kV", ename:"变电站"},
  2328. {parentId:"13", id:"132", name:"输电" , checked:true, pname:"±500kV", ename:"输电"},
  2329. {parentId:"1" , id:"14" , name:"500kV", checked:true, pname:null, ename:"500kV"},
  2330. {parentId:"14", id:"141", name:"发电厂", checked:true, pname:"500kV", ename:"发电厂"},
  2331. {parentId:"14", id:"142", name:"变电站", checked:true, pname:"500kV", ename:"变电站"},
  2332. {parentId:"14", id:"143", name:"输电" , checked:true, pname:"500kV", ename:"输电"},
  2333. {parentId:"1" , id:"15" , name:"220kV", checked:true, pname:null, ename:"220kV"},
  2334. {parentId:"15", id:"151", name:"发电厂", checked:true, pname:"220kV", ename:"发电厂"},
  2335. {parentId:"15", id:"152", name:"变电站", checked:true, pname:"220kV", ename:"变电站"},
  2336. {parentId:"15", id:"153", name:"输电" , checked:true, pname:"220kV", ename:"输电"},
  2337. {parentId:"1" , id:"16" , name:"110kV", checked:true, pname:null, ename:"110kV"},
  2338. {parentId:"16", id:"161", name:"发电厂", checked:true, pname:"110kV", ename:"发电厂"},
  2339. {parentId:"16", id:"162", name:"变电站", checked:true, pname:"110kV", ename:"变电站"},
  2340. {parentId:"16", id:"163", name:"输电" , checked:true, pname:"110kV", ename:"输电"},
  2341. {parentId:"1" , id:"17" , name:"35kV", checked:true, pname:null, ename:"35kV"},
  2342. {parentId:"17", id:"171", name:"发电厂", checked:true, pname:"35kV", ename:"发电厂"},
  2343. {parentId:"17", id:"172", name:"变电站", checked:true, pname:"35kV", ename:"变电站"},
  2344. {parentId:"17", id:"173", name:"输电" , checked:true, pname:"35kV", ename:"输电"},
  2345. {parentId:"1" , id:"18" , name:"10kV", checked:true , pname:null, ename:"10kV"},
  2346. {parentId:"18", id:"184", name:"配电" , checked:true, pname:"配电", ename:""},
  2347. {parentId:"18", id:"185", name:"其他" , checked:true, pname:"营业厅", ename:""},
  2348. {parentId:"1" , id:"19" , name:"0.4kV", checked:true, pname:null, ename:"0.4kV"},
  2349. {parentId:"19", id:"191", name:"低压" , checked:true, pname:"低压", ename:""}];
  2350. var temp = {};
  2351. for(var key in param){
  2352. for(var sk in pnodes){
  2353. pnodes[sk].checked = false;
  2354. pnodes[sk].isParent = true;
  2355. temp = {};
  2356. if(pnodes[sk].pname){
  2357. var keyWord = pnodes[sk].pname + pnodes[sk].ename;
  2358. if(param[key]["LayerName"].indexOf(keyWord)==0){
  2359. temp.parentId = pnodes[sk].id;
  2360. temp.id = param[key]["LayerID"];
  2361. temp.name = "<span style='color:white;'>" + param[key]["LayerName"] + "</span>";
  2362. temp.checked = param[key]["Visible"];
  2363. temp.ename = param[key]["LayerName"];
  2364. temp.isParent = false;
  2365. nodes.push(temp);
  2366. };
  2367. };
  2368. };
  2369. };
  2370. nodes = nodes.concat(pnodes);
  2371. return nodes;
  2372. };