12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404 |
- /**
- * gis地图辅助工具类
- * @author zmy
- * @version 1.0
- * @Date 2015-09-23
- */
- var ai = null;
- $(function(){ai = new AlertIframe();});
- GisUtil = function(){
- var _this = this ;
- /*---------------------------------------------定义路径start---------------------------------------------------*/
- var allPath = window.location.href;
- var indexPath = window.location.pathname;
- var index = allPath.indexOf(indexPath);
- //var pathEM = allPath.substring(0,index+1);
- //var pathCon = pathEM + indexPath.substring(1, 26);
- var path = allPath.substring(0,index);
- var pathIcon = path + $.pathname() + "/images/cockpit/gis/" ;
- /*---------------------------------------------定义路径end---------------------------------------------------*/
-
-
- /*---------------------------------------------查询框用部门JSON格式数据 start---------------------------------------------------*/
- var deptId = "" ;//部门信息id字符串
- var userInfo = null ;//用户信息
- var subDept = {} ;//部门信息
- var teamInfo = {} ;//队伍信息
- var simuMarkerId = null ;//模拟台风路径MarkerID
- var stArr = [];//台风历史路径setTimeout
- /*---------------------------------------------查询框用部门JSON格式数据 end---------------------------------------------------*/
-
- /*--------------------------------------------线类型 start------------------------------------------------------------*/
- var lineStyleDraw = {style:{"strokeColor": [17,57,101,255],"strokeWeight":2,opacity:0.5,fillColor:[127,188,249,255]}};//手绘线样式
- var lineStyleShow = {"strokeColor": [17,57,101,255],"strokeWeight":2,opacity:0.7,fillColor:[127,188,249,255]};//手绘线样式
- var lineStyleRow = {"strokeColor": [0,51,114,255],"strokeWeight":2,opacity:1,fillColor:[0,51,114,255]} ;//路径折线样式
- var lineStyleTrack = {"strokeColor": [190,0,46,255],"strokeWeight":3,opacity:1,fillColor:[108,159,65,255]} ;//轨迹回放
- var lineStyleDis = {"strokeColor": [190,0,46,255],"strokeWeight":3,opacity:1,fillColor:[190,0,46,255]} ;//轨迹描述
-
- var lineStyleSimulation = {"strokeWeight":2,opacity:1,fillColor:[190,0,46,255]};
- var simulationColor = {1:[0,128,0,255],2:[255,255,0,255],3:[255,165,0,255],4:[255,0,0,255],5:[255,192,203,255],6:[128,0,128,255]};
- var simulationMarker = {1:"st_tropic_lp",2:"st_tropic_strom",3:"st_tropic_strom_better",4:"st_typhoon",5:"st_violent_typhoon",6:"st_super_typhoon"};
- var simulationStrength = {1:"热带低压",2:"热带风暴",3:"强热带风暴",4:"台风",5:"强台风",6:"超强台风"};
-
- var simulationCircle = {sev:{style:{"strokeWeight":1,opacity:.3},color:[77,184,73,255]},
- ten:{style:{"strokeWeight":1,opacity:.5},color:[12,208,250,255]},
- tew:{style:{"strokeWeight":1,opacity:.9},color:[124,17,56,255]}};
- /*--------------------------------------------线类型 end------------------------------------------------------------*/
-
- /*------------------------------------------------应急资源图标存储start---------------------------------------------*/
- var lineArr = [] ; //存储线类型数组
- var polygonArr = [] ; //存储多边形类型数组
- var circleArr = [] ; //存储圆类型
- var rectangleArr = [] ;//矩形数组
- var originArr = [] ;//起点数组
- var siteArr = [] ;//地点
- var destinationArr = [] ;//终点
- var vehicleArr = [] ;//车辆
- var teamArr = [] ;//人员
-
- var lineXYArr = [] ; //存储线类型数组坐标
- var polygonXYArr = [] ; //存储多边形类型数组坐标
- var circleXYArr = [] ; //存储圆类型坐标
- var rectangleXYArr = [] ;//矩形数组坐标
- var originXYArr = [] ;//起点数组坐标
- var siteXYArr = [] ;//地点坐标
- var destinationXYArr = [] ;//终点坐标
- var vehicleXYArr = [] ;//车辆坐标
- var teamXYArr = [] ;//人员坐标
-
- var drawTypeIds = [] ;
-
- var pi = 0 ;
- var simulationPoint = [];
- var simuMarker = [];
- var simuLine = [];
-
- var psrList = {};
- var excelTitle = {"1":"所属单位","2":"电压等级","3":"设备名称","4":"所属设备"};
-
- var gisLengen = [];
- var erLengen = [{"name":"erso_house" , "describe":"仓库"},
- {"name":"erso_team" , "describe":"队伍"},
- {"name":"erso_goods" , "describe":"物资"},
- {"name":"origin" , "describe":"起点"},
- {"name":"destination" , "describe":"终点"},
- {"name":"er_adslabel" , "describe":"地点"},
- {"name":"temp_place" , "describe":"临时安置点"},
- {"name":"headquarters_place" , "describe":"指挥部"},
- {"name":"medicare_place" , "describe":"医疗救护点"},
- {"name":"other_place" , "describe":"其他"}];
- /*------------------------------------------------应急资源图标存储end-----------------------------------------------*/
-
- /*------------------------------------------------应急资源手绘图形用变量 start---------------------------------------------------*/
- var draw_value = {layName:"ersoLayDraw",flag:false,teamId:null,describeinfo:null,icon:null,drawLay:"ersoLayDraw",ls:lineStyleDraw};
- /*------------------------------------------------应急资源手绘图形用变量 start---------------------------------------------------*/
-
- /*---------------------------------------------图层的定位坐标组start---------------------------------------------------*/
- var mz_ewer = [] ;//应急预警与响应
- var mz_er = [] ;//应急资源
- /*---------------------------------------------图层的定位坐标组end---------------------------------------------------*/
-
- /*--------------------------------------------应急资源信息start----------------------------------------------------*/
- /**
- * 应急资源地市级资源标注图标信息
- */
- var erFlagPref = {} ;
- /**
- * 应急资源网省级资源标注图标信息
- */
- var erFlagProv = {} ;
- /*--------------------------------------------应急资源信息end---------------------------------------------------*/
-
- /*-------------------------------------------图层名start--------------------------------------------------------*/
- /**
- * 台风路径模拟绘制,点击后红点出现图层
- */
- var dtp_lay_point = {name:"dtpLayPoint",show:5, hidden:17,alpha:1,order:1} ;
-
- /**
- * 台风路径模拟绘制,折线图层
- */
- var dtp_lay_line = {name:"dtpLayLine",show:5, hidden:17,alpha:1,order:1} ;
-
- /**
- * 台风路径模拟绘制,七级风圈图层
- */
- var dtp_lay_seven_circle = {name:"dtpLaySeven",show:5, hidden:17,alpha:1,order:1} ;
-
- /**
- * 台风路径模拟绘制,十级风圈图层
- */
- var dtp_lay_ten_circle = {name:"dtpLayTen",show:5, hidden:17,alpha:1,order:1} ;
-
- /**
- * 台风路径模拟绘制,十二级风圈图层
- */
- var dtp_lay_twelve_circle = {name:"dtpLayTwelve",show:5, hidden:17,alpha:1,order:1} ;
-
- /**
- * 历史台风路径模拟绘制,点击后红点出现图层
- */
- var hdtp_lay_point = {name:"hdtpLayPoint",show:5, hidden:17,alpha:1,order:1} ;
-
- /**
- * 历史台风路径模拟绘制,折线图层
- */
- var hdtp_lay_line = {name:"hdtpLayLine",show:5, hidden:17,alpha:1,order:1} ;
-
- /**
- * 历史台风路径模拟绘制,七级风圈图层
- */
- var hdtp_lay_seven_circle = {name:"hdtpLaySeven",show:5, hidden:17,alpha:1,order:1} ;
-
- /**
- * 历史台风路径模拟绘制,十级风圈图层
- */
- var hdtp_lay_ten_circle = {name:"hdtpLayTen",show:5, hidden:17,alpha:1,order:1} ;
-
- /**
- * 历史台风路径模拟绘制,十二级风圈图层
- */
- var hdtp_lay_twelve_circle = {name:"hdtpLayTwelve",show:5, hidden:17,alpha:1,order:1} ;
-
- /**
- * 应急预警与响应图标,网省级图层4-6级显示
- */
- var ewer_lay_prov = {name:"ewerLayProv",show:4,hidden:7,alpha:1,order:1} ;
-
- /**
- * 应急预警与响应图标,网省级图层7-14级显示
- */
- var ewer_lay_pref = {name:"ewerLayPref",show:7,hidden:14,alpha:1,order:1} ;
-
-
- /**
- * 应急资源仓库图标,5-17级显示
- */
- var erso_lay_so = {name:"ersoLayLabel",show:4,hidden:17,alpha:1,order:1} ;
-
- /**
- * 应急资源绘图面板手画图层,5-21级显示
- */
- var erso_lay_draw = {name:"ersoLayDraw",show:5,hidden:21,alpha:1,order:1} ;
-
- /**
- * 应急资源绘图面板展示图层,5-21级显示
- */
- var erso_lay_show = {name:"ersoLayShowDraw",show:5,hidden:21,alpha:1,order:1} ;
-
- /**
- * 应急资源应急队伍定位图层,5-17级显示
- */
- var erso_lay_team = {name:"ersoLayTeam",show:5,hidden:21,alpha:1,order:1} ;
-
- /**
- * 应急资源应急队伍描述轨迹图层,5-17级显示
- */
- var erso_lay_track = {name:"ersoLayTrack",show:5,hidden:21,alpha:1,order:1} ;
-
- /**
- * 应急资源应急队伍描述轨迹图层,5-17级显示
- */
- var erso_team_playback = {name:"ersoLayPlayback",show:5,hidden:21,alpha:1,order:1} ;
-
- /**
- * 应急资源应急队伍分布图层(总计),网省级4-7显示
- */
- var erso_team_dist = {name:"ersoLayTeamDist",show:4,hidden:8,alpha:1,order:1} ;
-
- /**
- * 应急资源应急发电车加发电机分布图层,4-7级显示
- */
- var erso_car_dist = {name:"ersoLayCarDist",show:4,hidden:8,alpha:1,order:1} ;
-
- /**
- * 应急资源应急发电机分布图层,4-7级显示
- */
- var erso_dynamo_dist = {name:"ersoLayDynameDist",show:4,hidden:8,alpha:1,order:1} ;
-
- /**
- * 应急资源临时场所分布图层,7-17级显示
- */
- var erso_temp_space_dist = {name:"ersoLayTempSpaceDist",show:4,hidden:18,alpha:1,order:1} ;
-
- /**
- * 应急资源应急队伍分布图层,地市级7-17显示
- */
- var erso_team_dist_prev = {name:"ersoLayTeamDistPrev",show:8,hidden:18,alpha:1,order:1} ;
-
- /**
- * 应急资源应急发电车分布图层,地市级7-17级显示
- */
- var erso_car_dist_prev = {name:"ersoLayCarDistPrev",show:8,hidden:18,alpha:1,order:1} ;
-
- /**
- * 应急资源应急发电机分布图层,地市级7-17级显示
- */
- var erso_dynamo_dist_prev = {name:"ersoLayDynameDistPrev",show:8,hidden:18,alpha:1,order:1} ;
- /*-------------------------------------------图层名end--------------------------------------------------------*/
-
- /*=============================================方法start==============================================================*/
- /**
- * 获得表格显示的高度
- * @returns {Number} 返回表格数据的高度(不加头尾)
- */
- this.getGridHieght = function(){
- var pageHeight = $(document).height() - 30 - 24 ;
- $("#page").width('100%');
- $("#page").height(pageHeight);
- return pageHeight;
- };
- /*------------------------------------------- 获得表格显示的高度end--------------------------------------------------------*/
-
- /**
- * 得到当前登录用户信息
- * @returns {___anonymous6112_6113}
- */
- this.resolveUrl = function(){
- var encondeCondition=window.location.search;
- var condition= decodeURI(decodeURI(encondeCondition.substring(1,encondeCondition.length)));
- var conditionArr=condition.split("&");
- var condJson={};
- for(var item in conditionArr){
- var temArr=conditionArr[item].split("=");
- condJson[temArr[0]]=temArr[1];
- }
- userInfo = condJson;
- return condJson;
- };
- /*-------------------------------------------得到当前登录用户信息end----------------------------------------------------*/
-
- /**
- * 绘制台风模拟路径图层初始化()
- * @param
- * @version 1.0
- * @Date 2015-09-26
- */
- this.drawTyphoonPathInit = function(){
- _this.simulationPoint = [];
- _this.pi = 0 ;
- _this.simulationPoint = [];
- _this.simuMarker = [];
- _this.simuLine = [];
- addLayer(dtp_lay_point.name,dtp_lay_point.show,dtp_lay_point.hidden,dtp_lay_point.alpha,dtp_lay_point.order) ;//添加红点出现图层
- addLayer(dtp_lay_line.name,dtp_lay_line.show,dtp_lay_line.hidden,dtp_lay_line.alpha,dtp_lay_line.order) ;//添加折线图层
- _this.windResistingInit();
- addEvent("onGetPointEvent",getPointFun);
- addEvent('onMarkerClicked',showWindResisting);
-
- };
-
- /**
- * 绘制台风模拟路径风圈图层初始化
- */
- this.windResistingInit = function(){
- addLayer(dtp_lay_twelve_circle.name,dtp_lay_twelve_circle.show,dtp_lay_twelve_circle.hidden,dtp_lay_twelve_circle.alpha,dtp_lay_twelve_circle.order) ;//添加十二级风圈图层
- addLayer(dtp_lay_ten_circle.name,dtp_lay_ten_circle.show,dtp_lay_ten_circle.hidden,dtp_lay_ten_circle.alpha,dtp_lay_ten_circle.order) ;//添加十级风圈图层
- addLayer(dtp_lay_seven_circle.name,dtp_lay_seven_circle.show,dtp_lay_seven_circle.hidden,dtp_lay_seven_circle.alpha,dtp_lay_seven_circle.order) ;//添加七级风圈图层
- };
-
- /**
- * 查看模拟台风历史路径图层初始化
- */
- this.historyTyphoonPathInit = function(){
- _this.historyLayLoad();
- addEvent('onMarkerClicked',showWindResisting);
- };
-
- /**
- * 模拟台风历史路径图层加载
- */
- this.historyLayLoad = function(){
- addLayer(hdtp_lay_point.name,hdtp_lay_point.show,hdtp_lay_point.hidden,hdtp_lay_point.alpha,hdtp_lay_point.order) ;//添加红点出现图层
- addLayer(hdtp_lay_line.name,hdtp_lay_line.show,hdtp_lay_line.hidden,hdtp_lay_line.alpha,hdtp_lay_line.order) ;//添加折线图层
- _this.historyTyphoonCircleLoadLay();
- };
-
- /**
- * 查看历史台风模拟路径风圈图层初始化
- */
- this.historyTyphoonCircleLoadLay = function(){
- addLayer(hdtp_lay_twelve_circle.name,hdtp_lay_twelve_circle.show,hdtp_lay_twelve_circle.hidden,hdtp_lay_twelve_circle.alpha,hdtp_lay_twelve_circle.order) ;//添加十二级风圈图层
- addLayer(hdtp_lay_ten_circle.name,hdtp_lay_ten_circle.show,hdtp_lay_ten_circle.hidden,hdtp_lay_ten_circle.alpha,hdtp_lay_ten_circle.order) ;//添加十级风圈图层
- addLayer(hdtp_lay_seven_circle.name,hdtp_lay_seven_circle.show,hdtp_lay_seven_circle.hidden,hdtp_lay_seven_circle.alpha,hdtp_lay_seven_circle.order) ;//添加七级风圈图层
- };
-
- /**
- * 模拟台风历史路径图层删除
- */
- this.delHistoryLay = function(){
- delLayer(hdtp_lay_point.name);
- delLayer(hdtp_lay_line.name);
- delLayer(hdtp_lay_twelve_circle.name);
- delLayer(hdtp_lay_ten_circle.name);
- delLayer(hdtp_lay_seven_circle.name);
- };
-
- /*-------------------------------------------绘制台风模拟路径初始化end----------------------------------------------------*/
-
- /**
- * 添加历史模拟台风路径
- */
- this.addHistoryTyphoonPath = function(sid){
- _this.delHistoryLay();
- _this.historyLayLoad();
- var url = $.pathname() + "/ws/cockpit/CockpitService/getHistoryTyphoonPath" ;
- var i = 1;
- var res = [];
- res = _this.getJsonData(url,{sid:sid}) ;
-
- // for(var xy in res){
- for(var xy=0; xy<res.length; xy++){
- // i++;
- (function(){
- var j = i;
- var nextX,nextY;
- if(xy+1<res.length){
- nextX = res[xy+1].LONGITUDE;
- nextY = res[xy+1].LATITUDE;
- }else{
- nextX = res[xy].LONGITUDE;
- nextY = res[xy].LATITUDE;
- };
-
- var objLine = {"points":[{"x":res[xy].LONGITUDE,"y":res[xy].LATITUDE},
- {"x":nextX,"y":nextY}]};
-
- // var objLine = {"points":[{"x":res[xy].LONGITUDE,"y":res[xy].LATITUDE},
- // {"x":res[xy].nextX,"y":res[xy].nextY},]};
- var ls = {"strokeColor":simulationColor[res[xy].MAX_STRENGTH],
- "strokeWeight":2,opacity:1,fillColor:[190,0,46,255]};
- var pathLine = [{"layerName":hdtp_lay_line.name,"points":objLine,"lineStyle":ls}];
- var objMark = {};
- if(res[xy].addIcon=="true"){
- objMark = {"layerName":hdtp_lay_point.name,"posX":res[xy].LONGITUDE,
- "posY":res[xy].LATITUDE,icon:pathIcon+simulationMarker[res[xy].MAX_STRENGTH]+".png",
- "title":_this.getSimuPointDes(res[xy]),"clickable":true,
- "extraData":{sev:res[xy].SEVEN_RADIUS,ten:res[xy].TEN_RADIUS,tew:res[xy].TWELVE_RADIUS}};
- }else{
- objMark = {"layerName":hdtp_lay_point.name,"posX":res[xy].LONGITUDE,
- "posY":res[xy].LATITUDE,icon:null, "title":_this.getSimuPointDes(res[xy]),
- "clickable":true, "extraData":{"sev":res[xy].SEVEN_RADIUS,
- "ten":res[xy].TEN_RADIUS,"tew":res[xy].TWELVE_RADIUS}};
- }
- var param = {"radius":{"sev":res[xy].SEVEN_RADIUS,"ten":res[xy].TEN_RADIUS,"tew":res[xy].TWELVE_RADIUS},
- "point":{"posX":res[xy].LONGITUDE,"posY":res[xy].LATITUDE}};
- var st = setTimeout(function(){
- showPhoonCircle(param,true);
- addOneIco(objMark);
- addResourcePath(pathLine);
- },j*100);
- stArr.push(st);
- }());
- };
- };
-
- /**
- * 模拟台风点title提示信息生成
- * @param param
- * @returns {String}
- */
- this.getSimuPointDes = function(param){
- var res = "台风名称:" + $("#TYPHOON_NAME_CH").attr("value") + "\n" ;
- if(_this.verifyParams(param.CREATE_TIME)){
- res += "北京时间:" + param.CREATE_TIME + "\n";
- };
-
- res += "中心位置:" + _this.longLatMatrixing(param.LONGITUDE) + "E " + _this.longLatMatrixing(param.LATITUDE) + "E\n" +
- "风力等级:" + _this.getSimuStrength()[param.MAX_STRENGTH] + "\n" ;
- if(_this.verifyParams(param.MAX_SPEED)){
- res += "最大风速:" + param.MAX_SPEED + "米/秒\n" ;
- };
- if(_this.verifyParams(param.CENTRAL_PRESSURE)){
- res += "中心气压:" + param.CENTRAL_PRESSURE + "百帕\n" ;
- };
-
- if(_this.verifyParams(param.MOVEMENT_SPEED)){
- res += "移动速度:" + param.MOVEMENT_SPEED + "公里/小时\n" ;
- };
-
- res += "\n七级风圈:" + param.SEVEN_RADIUS + "公里\n" ;
-
- if(_this.verifyParams(param.TEN_RADIUS)){
- res += "十级风圈:" + param.TEN_RADIUS + "公里\n" ;
- };
- if(_this.verifyParams(param.TWELVE_RADIUS)){
- res += "十二级风圈:" + param.TWELVE_RADIUS + "公里\n" ;
- };
- return res ;
-
- };
- /**
- * 参数校验是否为空串,null值或undefined
- */
- this.verifyParams = function(param){
- if(param=="" || param==null || param==undefined || param=="null"){
- return false;
- }else{
- return true;
- }
- };
-
- /**
- * 通过坐标点求直线上的其它点
- * @param param: 坐标点:{x1:113,y1:23,x2:110,y2:20}
- */
- this.getPointStraightLine = function(param){
- var x1 = parseInt(param.x1);
- var x2 = parseInt(param.x2);
- var y1 = parseInt(param.y1);
- var y2 = parseInt(param.y2);
-
- if(parseInt(param.x1) > parseInt(param.x2)){
- var tem = parseInt(param.x1);
- x1 = parseInt(param.x2);
- x2 = tem;
- tem = parseInt(param.y1);
- y1 = parseInt(param.y2);
- y2 = tem;
- }
- var k = (y2-y1)/(x2-x1);
- var b = y1 - k*x1;
- var res = [];
- for(var i = x1; i < x2; i += .3){
- var pos = {x:i,y:k*i+b};
- res.push(pos);
- };
- return res;
- };
-
- /*-------------------------------------------台风模拟路径Marker点提示生成end----------------------------------------------------*/
-
- /**
- * 经纬度转换
- * @param pos
- * @returns {String}
- */
- this.longLatMatrixing = function(pos){
- var res = parseInt(pos) + "°";
- var minute = (pos - parseInt(pos)) * 60;
- var second = (minute - parseInt(minute)) * 60 ;
- res += parseInt(minute) + "′" + parseInt(second) + "″";
- return res;
- };
- /*-------------------------------------------经纬度转换end----------------------------------------------------*/
-
- /**
- * @param 应急资源图层初始化
- * @version 1.0
- * @Date 2015-09-26
- */
- this.ersoLay_init = function(){
- addEvent("onShapeDrawnCompleted",openDarwCallBack);
-
- addLayer(erso_lay_so.name,erso_lay_so.show,erso_lay_so.hidden,erso_lay_so.alpha,erso_lay_so.order) ;//添加资源图标图层(系统)
- addLayer(erso_lay_draw.name,erso_lay_draw.show,erso_lay_draw.hidden,erso_lay_draw.alpha,erso_lay_draw.order) ;//添加自定义图标图层(绘图面板)
- addLayer(erso_lay_show.name,erso_lay_show.show,erso_lay_show.hidden,erso_lay_show.alpha,erso_lay_show.order) ;//添加自定义图标图层(绘图面板转换后)
- addLayer(erso_lay_team.name,erso_lay_team.show,erso_lay_team.hidden,erso_lay_team.alpha,erso_lay_team.order);//队伍定位
- addLayer(erso_lay_track.name,erso_lay_track.show,erso_lay_track.hidden,erso_lay_track.alpha,erso_lay_track.order);//队伍描述
- addLayer(erso_team_playback.name,erso_team_playback.show,erso_team_playback.hidden,erso_team_playback.alpha,erso_team_playback.order);//队伍轨迹回放
-
-
- /*var pointProv = [] ;//网省级图标坐标组
- var pointPref = [] ;//地市级图标坐标组
- var point = [] ;
-
- var url = $.pathname() + "/ws/cockpit/CockpitService/queryMareHouse";
- erIcons = _this.getJsonData(url,null);
- point = point.concat(_this.poinXY(erIcons,"posX","posY")) ;
- _this.zoomToCoordList(point) ;
- pointPref = pointPref.concat(_this.poinXY(erIcons,"posX","posY")) ;
- erIcons = _this.addEwrAttr(erIcons,true,erso_lay_so.name) ;
- addResourceIco(erIcons) ;//添加应急资源仓库图标
- addEvent('onMarkerClicked',openHouseInfo);*/
- // _this.ersoPut();
- /*$("#411").click();
- $("#411").attr("relValue","0");
- getValue("411");
- $("#411").attr("relValue","1");*/
-
- };
-
- /**
- * 应急装备及队伍展示图层加载
- */
- this.ersoLay_er_dist_init = function(){
- addLayer(erso_team_dist.name,erso_team_dist.show,erso_team_dist.hidden,erso_team_dist.alpha,erso_team_dist.order);//应急队伍分布(网省级总计数)
- addLayer(erso_car_dist.name,erso_car_dist.show,erso_car_dist.hidden,erso_car_dist.alpha,erso_car_dist.order);//应急发电车分布
- addLayer(erso_dynamo_dist.name,erso_dynamo_dist.show,erso_dynamo_dist.hidden,erso_dynamo_dist.alpha,erso_dynamo_dist.order);//应急发电机分布
- addLayer(erso_temp_space_dist.name,erso_temp_space_dist.show,erso_temp_space_dist.hidden,erso_temp_space_dist.alpha,erso_temp_space_dist.order);//临时场所分布
- addLayer(erso_team_dist_prev.name,erso_team_dist_prev.show,erso_team_dist_prev.hidden,erso_team_dist_prev.alpha,erso_team_dist_prev.order);//应急队伍分布地市级
- addLayer(erso_car_dist_prev.name,erso_car_dist_prev.show,erso_car_dist_prev.hidden,erso_car_dist_prev.alpha,erso_car_dist_prev.order);//应急装备-发电车分布地市级
- addLayer(erso_dynamo_dist_prev.name,erso_dynamo_dist_prev.show,erso_dynamo_dist_prev.hidden,erso_dynamo_dist_prev.alpha,erso_dynamo_dist_prev.order);//应急装备-发电机分布地市级
-
- };
-
-
- /**
- * 应急资源 队伍分布图层添加
- */
- this.er_team_init = function(){
- addLayer(erso_team_dist.name,erso_team_dist.show,erso_team_dist.hidden,erso_team_dist.alpha,erso_team_dist.order);//应急队伍分布(网省级总计数)
- addLayer(erso_team_dist_prev.name,erso_team_dist_prev.show,erso_team_dist_prev.hidden,erso_team_dist_prev.alpha,erso_team_dist_prev.order);//应急队伍分布地市级
-
- $.post($.pathname()+ "/ws/Team/TeamService/getTeamInfo",{id : userInfo.dept_id},function (data){
- data = data.rows;
- data = data[data.length-1];
- data.dept_name = userInfo.dept_name;
- data.dept_id = userInfo.dept_id;
- gisMes.window.showTeamMes(data, true) ;
- showMes();
-
- },"json" );
- };
-
- /**
- * 应急资源 发电车分布图层添加
- */
- this.er_car_init = function(){
- addLayer(erso_car_dist.name,erso_car_dist.show,erso_car_dist.hidden,erso_car_dist.alpha,erso_car_dist.order);//应急发电车分布
- addLayer(erso_car_dist_prev.name,erso_car_dist_prev.show,erso_car_dist_prev.hidden,erso_car_dist_prev.alpha,erso_car_dist_prev.order);//应急装备-发电车分布地市级
- $.post($.pathname()+ "/ws/generatorcar/GeneratorCarService/getCarInfo",{id : userInfo.dept_id},function (data){
- data = data.rows;
- data = data[data.length-1];
- data.dept_name = userInfo.dept_name;
- data.dept_id = userInfo.dept_id;
- gisMes.window.showCarMes(data, true) ;
- showMes("car_mes");
-
- });
- };
-
- /**
- * 应急资源 发电机分布图层添加
- */
- this.er_gen_init = function(){
- addLayer(erso_dynamo_dist.name,erso_dynamo_dist.show,erso_dynamo_dist.hidden,erso_dynamo_dist.alpha,erso_dynamo_dist.order);//应急发电机分布
- addLayer(erso_dynamo_dist_prev.name,erso_dynamo_dist_prev.show,erso_dynamo_dist_prev.hidden,erso_dynamo_dist_prev.alpha,erso_dynamo_dist_prev.order);//应急装备-发电机分布地市级
- $.post($.pathname()+ "/ws/generator/GeneratorService/getGeneratorStatistics",{id : userInfo.dept_id},function (data){
- data = data.rows;
- data = data[data.length-1];
- data.dept_name = userInfo.dept_name;
- data.dept_id = userInfo.dept_id;
- gisMes.window.showDynMes(data, true) ;
- showMes("dyn_mes");
- },"json" );
- };
-
- /**
- * 应急资源 临时场所分布图层
- */
- this.er_place_init = function(){
- addLayer(erso_temp_space_dist.name,erso_temp_space_dist.show,erso_temp_space_dist.hidden,erso_temp_space_dist.alpha,erso_temp_space_dist.order);//临时场所分布
- };
-
- /**
- * 应急仓库分布图层
- */
- this.er_house_init = function(){
-
- };
-
- /*-------------------------------------------应急资源图层初始化end----------------------------------------------------*/
-
- /**
- * 加载应急资源 应急队伍分布图层
- */
- this.searchErTeam = function(unitId,searchType){
- var point = [];
- var params = {deptId:unitId, searchType:searchType};
- var url = $.pathname() + "/ws/cockpit/CockpitService/searchErByTeam" ;
- var data = _this.addResoMarker(url, params, erso_team_dist.name) ;
- if(data){
- point = point.concat(data);
- url = $.pathname() + "/ws/cockpit/CockpitService/searchErByTeamPrev" ;
- data = _this.addResoMarker(url, params, erso_team_dist_prev.name) ;
-
- };
- addEvent('onMarkerClicked',openEarlywarningnotice);
- if(point.length>4)
- _this.zoomToCoordList(point) ;
- };
-
- /**
- * 加载应急资源 发电车分布图层
- */
- this.searchErCar = function(unitId,searchType){
- var point = [];
- var params = {deptId:unitId, searchType:searchType};
- var url = $.pathname() + "/ws/cockpit/CockpitService/searchErByCar" ;
- var data = _this.addResoMarker(url, params, erso_car_dist.name) ;
- if(data){
- point = point.concat(data);
-
- url = $.pathname() + "/ws/cockpit/CockpitService/searchErByEquiCarPrev" ;
- _this.addResoMarker(url, params, erso_car_dist_prev.name) ;
-
- }else{
- ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据");
- ai.createAlert();
- };
- addEvent('onMarkerClicked',openEarlywarningnotice);
- if(point.length>4)
- _this.zoomToCoordList(point) ;
- };
-
- /**
- * 加载应急资源 发电机分布图层
- */
- this.searchErGen = function(unitId,searchType){
- var point = [];
- var params = {deptId:unitId, searchType:searchType};
- var url = $.pathname() + "/ws/cockpit/CockpitService/searchErByGen" ;
- var data = _this.addResoMarker(url, params, erso_dynamo_dist.name) ;
- if(data){
- point = point.concat(data);
-
- url = $.pathname() + "/ws/cockpit/CockpitService/searchErByEquiPrev" ;
- _this.addResoMarker(url, params, erso_dynamo_dist_prev.name) ;
-
- }else{
- ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据");
- ai.createAlert();
- };
- addEvent('onMarkerClicked',openEarlywarningnotice);
- if(point.length>4)
- _this.zoomToCoordList(point) ;
- };
-
- /**
- * 加载应急资源 临时场所分布图层
- */
- this.searchErPlace = function(unitId,placeType,searchType){
- var point = [];
- var params = {deptId:unitId, searchType:searchType, place_type:placeType};
- url = $.pathname() + "/ws/cockpit/CockpitService/searchErByTempSpace" ;
- data = _this.addResoMarker(url, params, erso_temp_space_dist.name) ;
-
- if(data){
- point = point.concat(data);
- }else{
- ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据");
- ai.createAlert();
- };
- addEvent('onMarkerClicked',openEarlywarningnotice);
- if(point.length>4)
- _this.zoomToCoordList(point) ;
-
- };
-
- /**
- * 加载应急资源仓库信息图层
- */
- this.searchErHouse = function(params){
- // var erso_lay_so = {name:"ersoLayLabel",show:7,hidden:17,alpha:1,order:1} ;
- var point = [];
- var url = $.pathname() + "/ws/cockpit/CockpitService/queryMareHouse";
- var erIcons = _this.getJsonData(url,params);
- if(erIcons){
- point = point.concat(_this.poinXY(erIcons,"posX","posY")) ;
- erIcons = _this.addEwrAttr(erIcons,true,erso_lay_so.name) ;
- _this.zoomToCoordList(point) ;
- addResourceIco(erIcons) ;//添加应急资源仓库图标
-
- }else{
- ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据");
- ai.createAlert();
- };
- // addEvent('onMarkerClicked',openEarlywarningnotice);
- addEvent('onMarkerClicked',openHouseInfo);
-
- };
-
- /**
- * 加载应急资源分布图标
- */
- this.searchErDist = function(type,unitId,placeType, searchType){
- var point = [] ;
- // var params = {deptId:unitId} ;
- var params = {deptId:unitId, searchType:searchType};
- var url = "" ;
- var layName = "" ;
- var data = [] ;
- var typeArr = type.split(",");
- /*var encondeCondition=window.location.search;
- var src = "";*/
- //261 代表查询队伍 262发电车 381临时场所
- for(var key in typeArr){
- if(typeArr[key]=="261"){
- url = $.pathname() + "/ws/cockpit/CockpitService/searchErByTeam" ;
- layName = erso_team_dist.name ;
- data = _this.addResoMarker(url, params, layName) ;
- if(data){
- point = point.concat(data);
-
- url = $.pathname() + "/ws/cockpit/CockpitService/searchErByTeamPrev" ;
- layName = erso_team_dist_prev.name ;
- _this.addResoMarker(url, params, layName) ;
-
- /*src = "/nwyj/page/cockpit/echart_maticView/amResource/DuiWuHuiZongZt.html" + encondeCondition + "?????legendC=#3399ff?xAxisC=#3399ff?yAxisC=#3399ff?titleC=#3399ff??gistype=DuiWuHuiZongZt";
- _this.addChartWin(src,"100","330",null,null,"DuiWuHuiZongZt");
-
- src = "/nwyj/page/cockpit/echart_maticView/amResource/DuiWuRenYuanHuiZongZt.html" + encondeCondition + "?????legendC=#3399ff?xAxisC=#3399ff?yAxisC=#3399ff?titleC=#3399ff??gistype=DuiWuRenYuanHuiZongZt";
- _this.addChartWin(src,null,"330",null,"50","DuiWuRenYuanHuiZongZt");*/
-
- };
-
- };
- if(typeArr[key]=="262"){
- url = $.pathname() + "/ws/cockpit/CockpitService/searchErByCar" ;
- layName = erso_car_dist.name ;
- data = _this.addResoMarker(url, params, layName) ;
- if(data){
- point = point.concat(data);
-
- url = $.pathname() + "/ws/cockpit/CockpitService/searchErByEquiPrev" ;
- layName = erso_dynamo_dist_prev.name ;
- _this.addResoMarker(url, params, layName) ;
-
- url = $.pathname() + "/ws/cockpit/CockpitService/searchErByEquiCarPrev" ;
- layName = erso_car_dist_prev.name ;
- _this.addResoMarker(url, params, layName) ;
-
- /*src = "/nwyj/page/cockpit/echart_maticView/amResource/FaDianJiHuiZongZt.html" + encondeCondition + "?????legendC=#3399ff?xAxisC=#3399ff?yAxisC=#3399ff?titleC=#3399ff??gistype=FaDianJiHuiZongZt";
- _this.addChartWin(src,"100",null,"25",null,"FaDianJiHuiZongZt");
-
- src = "/nwyj/page/cockpit/echart_maticView/amResource/FaDianCheHuiZongZt.html" + encondeCondition + "?????legendC=#3399ff?xAxisC=#3399ff?yAxisC=#3399ff?titleC=#3399ff??gistype=FaDianCheHuiZongZt";
- _this.addChartWin(src,null,null,"25","50","FaDianCheHuiZongZt");*/
- };
-
- };
- if(typeArr[key]=="381"){
- params.place_type = placeType;
- url = $.pathname() + "/ws/cockpit/CockpitService/searchErByTempSpace" ;
- layName = erso_temp_space_dist.name ;
- data = _this.addResoMarker(url, params, layName) ;
- if(data){ point = point.concat(data); };
- };
- };
-
- if(point.length > 2){
- _this.zoomToCoordList(point) ;
- } else if(point.length == 0) {
- ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据");
- ai.createAlert();
- };
- addEvent('onMarkerClicked',openEarlywarningnotice);
- };
-
- /**
- * 添加应急资源统计图(没有用到)
- */
- this.addChartWin = function(src,top,left,right,bottom,id){
- var $team_iframe = document.createElement("iframe");
- var w = $(document).width();
- w = (Number(w)-500)/2;
- var h = $(document).height();
- h = (Number(h)-150)/2;
-
- $team_iframe.src = src;
- $team_iframe.style.width = w + "px";
- $team_iframe.style.height = h + "px";
- $team_iframe.style.position = "fixed";
- if(top){ $team_iframe.style.top = top + "px"; };
- if(left){ $team_iframe.style.left = left + "px"; };
- if(right){ $team_iframe.style.right = right + "px"; };
- if(bottom){ $team_iframe.style.bottom = bottom + "px"; };
- $team_iframe.style.background ="red";
- $team_iframe.style.zIndex = 99;
- $team_iframe.id = id;
- $team_iframe.scrolling = "no";
- $team_iframe.style.border="none";
- $team_iframe.frameBorder = 0;
- $("body").append($team_iframe);
- };
-
- /**
- * 删除应急资源统计图
- */
- this.delChartWin = function(idArr){
- for(var key in idArr){
- $("#" + idArr[key]).remove();
- };
- };
-
- /**
- * 应急资源图标添加
- */
- this.addResoMarker = function(url, params, layName){
- var point = [] ;
- erIcons = _this.getJsonData(url,params);
- if(erIcons){
- point = point.concat(_this.poinXY(erIcons,"posX","posY")) ;
- erIcons = _this.addEwrAttr(erIcons,true,layName) ;
- addResourceIco(erIcons) ;//添加应急资源分布图标
- return point ;
- }else{
- return null;
- };
- };
-
- /**
- * 加载应急资源分布图标
- *//*
- this.searchErDist = function(type,unitId){
- var point = [] ;
- var params = {deptId:unitId} ;
-
- var url = $.pathname() + "/ws/cockpit/CockpitService/searchErByTeam" ;
- var layName = erso_team_dist.name ;
- if(type==265){
- url = $.pathname() + "/ws/cockpit/CockpitService/searchErByCar" ;
- layName = erso_car_dist.name ;
- }else if(type==266){
- url = $.pathname() + "/ws/cockpit/CockpitService/searchErByGen" ;
- layName = erso_dynamo_dist.name ;
- };
-
- erIcons = _this.getJsonData(url,params);
- point = point.concat(_this.poinXY(erIcons,"posX","posY")) ;
- erIcons = _this.addEwrAttr(erIcons,true,layName) ;
- addResourceIco(erIcons) ;//添加应急资源分布图标
-
- 添加应急资源队伍
- var url = $.pathname() + "/ws/cockpit/CockpitService/searchErByTeam";
- erIcons = _this.getJsonData(url,null);
- point = point.concat(_this.poinXY(erIcons,"posX","posY")) ;
- erIcons = _this.addEwrAttr(erIcons,true,erso_team_dist.name) ;
- addResourceIco(erIcons) ;//添加应急队伍分布图标
-
- 添加应急资源发电车
- var url = $.pathname() + "/ws/cockpit/CockpitService/searchErByCar";
- erIcons = _this.getJsonData(url,null);
- point = point.concat(_this.poinXY(erIcons,"posX","posY")) ;
- erIcons = _this.addEwrAttr(erIcons,true,erso_car_dist.name) ;
- addResourceIco(erIcons) ;//添加应急资源发电车分布图标
-
- 添加应急资源发电机
- var url = $.pathname() + "/ws/cockpit/CockpitService/searchErByGen";
- erIcons = _this.getJsonData(url,null);
- point = point.concat(_this.poinXY(erIcons,"posX","posY")) ;
- erIcons = _this.addEwrAttr(erIcons,true,erso_team_dist.name) ;
- addResourceIco(erIcons) ;//添加应急资源发电机分布图标
-
-
- _this.zoomToCoordList(point) ;
- };*/
- /*-------------------------------------------加载应急资源分布图标end----------------------------------------------------*/
-
- /**
- * 加载应急资源投入
- */
- this.ersoPut = function(paramsProv, paramsPref){
- var pointProv = [] ;//网省级图标坐标组
- var pointPref = [] ;//地市级图标坐标组
- var url ;
-
- if(paramsProv){
- url = $.pathname() + "/ws/cockpit/CockpitService/queryErMarker" ;//网省级应急资源标注查询
- erFlagProv = _this.getJsonData(url,paramsProv) ;
- }else{
- erFlagProv = {};
- }
-
- if(paramsPref){
- url = $.pathname() + "/ws/cockpit/CockpitService/queryErMarker" ;//地市级应急资源标注查询
- erFlagPref = _this.getJsonData(url,paramsPref) ;
- }else{
- erFlagPref = {};
- }
-
-
- if(erFlagPref){
- var posXArr = [] ;
- var posYArr = [] ;
- for(var key in erFlagPref){
- posXArr.push(erFlagPref[key]["x"]) ;
- posYArr.push(erFlagPref[key]["y"]) ;
- }
- var radiu = _this.zoomToExtent(posXArr,posYArr) ;
- var rad = _this.getErRadius(radiu) ;
- _this.drawResource(erFlagPref,1,rad["ra"],rad["ds"]) ;
- pointPref = pointPref.concat(_this.poinXY(erFlagPref,"x","y")) ;
- }
-
- if(erFlagProv){
- var posXArr = [] ;
- var posYArr = [] ;
- for(var key in erFlagProv){
- posXArr.push(erFlagProv[key]["x"]) ;
- posYArr.push(erFlagProv[key]["y"]) ;
- }
- var radiu = _this.zoomToExtent(posXArr,posYArr) ;
- var rad = _this.getErRadius(radiu) ;
- _this.drawResource(erFlagProv,0,rad["ra"],rad["ds"]) ;
- pointProv = pointProv.concat(_this.poinXY(erFlagProv,"x","y")) ;
- mz_er = pointProv ;
- // zoomToCoordList(pointProv) ;
- setZoomAndCenter(pointProv[0],pointProv[1],6);
- } else {
- _this.zoomToCoordList(pointPref) ;
- mz_er = pointPref ;
- } ;
- addEvent("onMapExtentChanged",mapChanged);
- };
- /*-------------------------------------------加载应急资源投入end----------------------------------------------------*/
-
- /**
- * 绘图工具栏初始化
- */
- this.erso_draw = function(){
-
- };
- /*-------------------------------------------绘图工具栏初始化end----------------------------------------------------*/
-
- /**
- * 应急预警与响应初始化
- */
- this.ewerLay_init = function(){
- // var date = allGetServerTime() ;
- // var beginTime = _this.getThreeMonthsAgo(_this.getNowFormatDate(date)) ;
- // var endTime = _this.getNowFormatDate(allGetServerTime()) ;
- var paramsProv = {
- // RELEASE_UNIT : subDept["prov"]+"",//单位
- USER_NAME : userInfo.real_name,
- USER_ID : userInfo.user_id,
- RELEASE_UNIT : _this.resolveUrl().dept_id,//单位
- WULEVEL : "'0','1'",
- RULEVEL : "'0','1'",
- SKEW : "0.3",
- // BEGINTIME : beginTime ,//开始时间
- // ENDTIME : endTime //截止时间
- } ;
-
- var paramsPref = {
- // RELEASE_UNIT : subDept["prov"]+"",//单位
- USER_NAME : userInfo.real_name,
- USER_ID : userInfo.user_id,
- RELEASE_UNIT : _this.resolveUrl().dept_id,
- WULEVEL : "'2','3','4'",
- RULEVEL : "'2','3','4'",
- SKEW : "0.03",
- // BEGINTIME : beginTime ,//开始时间
- // ENDTIME : endTime //截止时间
- } ;
- /*var paramsPrefEw = {
- //RELEASE_UNIT : subDept["pref"]+"",//单位
- USER_NAME : userInfo.real_name,
- USER_ID : userInfo.user_id,
- RELEASE_UNIT : _this.resolveUrl().dept_id,
- LEVEL : "35,36,37,38",//级别
- BEGINTIME : beginTime ,//开始时间
- ENDTIME : endTime //截止时间
- } ;
- var paramsPrefEr = {
- // RELEASE_UNIT : subDept["pref"]+"",//单位
- USER_NAME : userInfo.real_name,
- USER_ID : userInfo.user_id,
- RELEASE_UNIT : _this.resolveUrl().dept_id,
- LEVEL : "29,30,31,32",//级别
- BEGINTIME : beginTime ,//开始时间
- ENDTIME : endTime //截止时间
- } ;*/
- mz_ewer = _this.ewer_load(paramsProv,paramsPref);
- };
- /*--------------------------------应急预警与响应初始化end-------------------------------------------------*/
-
- /**
- * 加载应急预警与响应图层
- * @param
- * @version 1.0
- * @Date 2015-09-26
- */
- this.ewer_load_old = function(paramsProvEw,paramsPrefEw,paramsProvEr,paramsPrefEr){
- gisLengen = [];
- //新建应急预警与响应图层
- addLayer(ewer_lay_prov.name,ewer_lay_prov.show,ewer_lay_prov.hidden,ewer_lay_prov.alpha,ewer_lay_prov.order);
- addLayer(ewer_lay_pref.name,ewer_lay_pref.show,ewer_lay_pref.hidden,ewer_lay_pref.alpha,ewer_lay_pref.order);
-
- var pointPre = [] ;
- var pointPro = [] ;
- var ewJsonData = {} ;
- var mp = [] ;
- var url ;
-
- if(paramsPrefEw){
- //查询应急预警图标(地市级)
- paramsPrefEw.skew = 0;
- url = $.pathname() + "/ws/cockpit/CockpitService/getEwMarker";
- ewJsonData = _this.getJsonData(url,paramsPrefEw) ;
- pointPre = pointPre.concat(_this.poinXY(ewJsonData, "posX", "posY"));
- ewJsonData = _this.addEwrAttr(ewJsonData,true,ewer_lay_pref.name) ;
- _this.addGisLengen(ewJsonData);
- addResourceIco(ewJsonData);//添加图标
- }
-
- if(paramsPrefEr){
- //应急响应查询(地市级)
- paramsPrefEr.skew = 0.03;
- url = $.pathname() + "/ws/cockpit/CockpitService/getErMarker";
- ewJsonData = _this.getJsonData(url,paramsPrefEr) ;
- pointPre = pointPre.concat(_this.poinXY(ewJsonData, "posX", "posY"));
- ewJsonData = _this.addEwrAttr(ewJsonData,true,ewer_lay_pref.name) ;
- _this.addGisLengen(ewJsonData);
- addResourceIco(ewJsonData);//添加图标
- }
-
- if(paramsProvEw){
- //查询应急预警图标(网省级)
- paramsProvEw.skew = 0.5;
- var url = $.pathname() + "/ws/cockpit/CockpitService/getEwMarker";
- ewJsonData = _this.getJsonData(url,paramsProvEw) ;
- pointPro = pointPro.concat(_this.poinXY(ewJsonData, "posX", "posY"));
- ewJsonData = _this.addEwrAttr(ewJsonData,true,ewer_lay_prov.name) ;
- _this.addGisLengen(ewJsonData);
- addResourceIco(ewJsonData);//添加图标
- };
-
- if(paramsProvEr){
- //应急响应查询(网省级)
- paramsProvEr.skew = 1;
- url = $.pathname() + "/ws/cockpit/CockpitService/getErMarker";
- ewJsonData = _this.getJsonData(url,paramsProvEr) ;
- pointPro = pointPro.concat(_this.poinXY(ewJsonData, "posX", "posY"));
- ewJsonData = _this.addEwrAttr(ewJsonData,true,ewer_lay_prov.name) ;
- _this.addGisLengen(ewJsonData);
- addResourceIco(ewJsonData);//添加图标
- };
-
- if(pointPro.length != 0){
- if(pointPro.length > 4){
- mp = pointPro;
- _this.zoomToCoordList(pointPro);
- }else{
- setZoomLevel(6);
- }
-
- } else if(pointPre.length != 0){
- mp = pointPre;
- _this.zoomToCoordList(pointPre) ;
- } else if(pointPre.length==0 && pointPro.length ==0){
- ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据");
- ai.createAlert();
- };
- addEvent('onMarkerClicked',openEarlywarningnotice);
-
- return mp ;
- };
-
- /**
- * 加载应急预警与响应图层
- * @param
- * @version 1.0
- * @Date 2015-09-26
- */
- this.ewer_load_old_old = function(paramsProvEw,paramsPrefEw,paramsProvEr,paramsPrefEr){
- gisLengen = [];
- //新建应急预警与响应图层
- addLayer(ewer_lay_prov.name,ewer_lay_prov.show,ewer_lay_prov.hidden,ewer_lay_prov.alpha,ewer_lay_prov.order);
- addLayer(ewer_lay_pref.name,ewer_lay_pref.show,ewer_lay_pref.hidden,ewer_lay_pref.alpha,ewer_lay_pref.order);
-
- var pointPre = [] ;
- var pointPro = [] ;
- var ewJsonData = {} ;
- var mp = [] ;
- var url ;
-
- if(paramsPrefEw){
- //查询应急预警图标(地市级)
- paramsPrefEw.skew = 0.03;
- url = $.pathname() + "/ws/cockpit/CockpitService/getEwErMarker";
- ewJsonData = _this.getJsonData(url,paramsPrefEw) ;
- pointPre = pointPre.concat(_this.poinXY(ewJsonData, "posX", "posY"));
- ewJsonData = _this.addEwrAttr(ewJsonData,true,ewer_lay_pref.name) ;
- _this.addGisLengen(ewJsonData);
- addResourceIco(ewJsonData);//添加图标
- }
-
- if(paramsPrefEr){
- //应急响应查询(地市级)
- paramsPrefEr.skew = 0.03;
- url = $.pathname() + "/ws/cockpit/CockpitService/getErMarker";
- ewJsonData = _this.getJsonData(url,paramsPrefEr) ;
- pointPre = pointPre.concat(_this.poinXY(ewJsonData, "posX", "posY"));
- ewJsonData = _this.addEwrAttr(ewJsonData,true,ewer_lay_pref.name) ;
- _this.addGisLengen(ewJsonData);
- addResourceIco(ewJsonData);//添加图标
- }
-
- if(pointPro.length != 0){
- if(pointPro.length > 4){
- mp = pointPro;
- _this.zoomToCoordList(pointPro);
- }else{
- setZoomLevel(6);
- }
-
- } else if(pointPre.length != 0){
- mp = pointPre;
- _this.zoomToCoordList(pointPre) ;
- } else if(pointPre.length==0 && pointPro.length ==0){
- ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据");
- ai.createAlert();
- };
- addEvent('onMarkerClicked',openEarlywarningnotice);
-
- return mp ;
- };
- /**
- * 加载应急预警与响应图层
- * @param
- * @version 1.0
- * @Date 2015-09-26
- */
- this.ewer_load = function(paramsProv,paramsPref){
- gisLengen = [];
- //新建应急预警与响应图层
- addLayer(ewer_lay_prov.name,ewer_lay_prov.show,ewer_lay_prov.hidden,ewer_lay_prov.alpha,ewer_lay_prov.order);
- addLayer(ewer_lay_pref.name,ewer_lay_pref.show,ewer_lay_pref.hidden,ewer_lay_pref.alpha,ewer_lay_pref.order);
-
- var pointPre = [] ;
- var pointPro = [] ;
- var ewJsonData = {} ;
- var mp = [] ;
- var url ;
- if(paramsProv){
- //查询应急预警图标(网省级)
- url = $.pathname() + "/ws/cockpit/CockpitService/getEwErMarker";
- ewJsonData = _this.getJsonData(url,paramsProv) ;
- pointPro = pointPro.concat(_this.poinXY(ewJsonData, "posX", "posY"));
- ewJsonData = _this.addEwrAttr(ewJsonData,true,ewer_lay_prov.name) ;
- _this.addGisLengen(ewJsonData);
- addResourceIco(ewJsonData);//添加图标
- }
-
- if(paramsPref){
- //查询应急预警图标(地市级)
- url = $.pathname() + "/ws/cockpit/CockpitService/getEwErMarker";
- ewJsonData = _this.getJsonData(url,paramsPref) ;
- pointPre = pointPre.concat(_this.poinXY(ewJsonData, "posX", "posY"));
- ewJsonData = _this.addEwrAttr(ewJsonData,true,ewer_lay_pref.name) ;
- _this.addGisLengen(ewJsonData);
- addResourceIco(ewJsonData);//添加图标
- }
-
- if(pointPro.length != 0){
- if(pointPro.length > 4){
- mp = pointPro;
- _this.zoomToCoordList(pointPro);
- }else{
- setZoomLevel(6);
- }
-
- } else if(pointPre.length != 0){
- mp = pointPre;
- _this.zoomToCoordList(pointPre) ;
- } else if(pointPre.length==0 && pointPro.length ==0){
- ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据");
- ai.createAlert();
- };
- addEvent('onMarkerClicked',openEarlywarningnotice);
-
- return mp ;
- };
- /*--------------------------------应急预警与响应加载end-------------------------------------------------*/
- this.addGisLengen = function(pd){
- for(var key in pd){
- var lengen = {name:pd[key].extraData.name,describe:pd[key].extraData.ICON_DESCRIBE};
- gisLengen.push(lengen);
- };
- };
- /**
- * 应急预警与响应查询事件响应预警同时查出来
- */
- this.searchEwer_old = function(paramsEw,paramsEr,changeGridEw,changeGridEr){
- _this.closeEwerLayer();
- var pointPre = [] ;
- //应急预警查询
- var url = $.pathname() + "/ws/cockpit/CockpitService/getEwMarker";
- paramsEw.skew = 0;
- pointPre = pointPre.concat(_this.searchMarkerToEwer(url,paramsEw,true,ewer_lay_pref.name)) ;
-
- //应急响应查询(地市级)
- url = $.pathname() + "/ws/cockpit/CockpitService/getErMarker";
- paramsEr.skew = 0.03;
- pointPre = pointPre.concat(_this.searchMarkerToEwer(url,paramsEr,true,ewer_lay_pref.name)) ;
-
- if(pointPre.length != 0){
- _this.zoomToCoordList(pointPre) ;
- } else {
- ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据");
- ai.createAlert();
- }
- addEvent('onMarkerClicked',openEarlywarningnotice);
-
- if($("#ewerlenge").hasClass("tl_show")){
- openLegend("#ewerlenge",_this.getGisLengen());
- };
-
- page_0.window.searchEw(changeGridEw) ;
- page_1.window.searchEr(changeGridEr) ;
-
- } ;
-
- this.searchEwer = function(params,changeGridEw,changeGridEr){
- _this.closeEwerLayer();
- var pointPro = [] ;
- var pointPre = [] ;
- var mp = [] ;
- var ewJsonData ;
- //应急预警查询 (网省级)
- // var url = $.pathname() + "/ws/cockpit/CockpitService/getEwMarker";
- var url = $.pathname() + "/ws/cockpit/CockpitService/getEwErMarker";
- params.SKEW = "0.3";
- params.WULEVEL = "'0','1'";
- params.RULEVEL = "'0','1'";
-
- // ewJsonData = _this.getJsonData(url,params) ;
- // pointPro = pointPre.concat(_this.poinXY(ewJsonData, "posX", "posY"));
- // ewJsonData = _this.addEwrAttr(ewJsonData,true,ewer_lay_prov.name) ;
- // _this.addGisLengen(ewJsonData);
- // addResourceIco(ewJsonData);//添加图标
- pointPro = pointPro.concat(_this.searchMarkerToEwer(url,params,true,ewer_lay_prov.name));
-
-
- params.SKEW = "0.03";
- params.WULEVEL = "'2','3','4'";
- params.RULEVEL = "'2','3','4'";
- pointPre = pointPre.concat(_this.searchMarkerToEwer(url,params,true,ewer_lay_pref.name)) ;
- // ewJsonData = _this.getJsonData(url,params) ;
- // pointPre = pointPre.concat(_this.poinXY(ewJsonData, "posX", "posY"));
- // ewJsonData = _this.addEwrAttr(ewJsonData,true,ewer_lay_pref.name) ;
- // _this.addGisLengen(ewJsonData);
- // addResourceIco(ewJsonData);//添加图标
-
- //应急响应查询(地市级)
- /*url = $.pathname() + "/ws/cockpit/CockpitService/getErMarker";
- paramsEr.skew = 0.03;
- pointPre = pointPre.concat(_this.searchMarkerToEwer(url,paramsEr,true,ewer_lay_pref.name)) ;*/
-
- if(pointPro.length != 0){
- if(pointPro.length > 4){
- mp = pointPro;
- _this.zoomToCoordList(pointPro);
- }else{
- setZoomLevel(6);
- }
-
- } else if(pointPre.length != 0){
- mp = pointPre;
- _this.zoomToCoordList(pointPre) ;
- } else if(pointPre.length==0 && pointPro.length ==0){
- ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据");
- ai.createAlert();
- };
- addEvent('onMarkerClicked',openEarlywarningnotice);
-
- if($("#ewerlenge").hasClass("tl_show")){
- openLegend("#ewerlenge",_this.getGisLengen());
- };
-
- page_0.window.searchEw(changeGridEw) ;
- page_1.window.searchEr(changeGridEr) ;
-
- return mp ;
- } ;
- /*--------------------------------应急预警与响应查询事件end-------------------------------------------------*/
-
- /**
- * @param 关闭显示应急预警与响应图层
- * @version 1.0
- * @Date 2015-09-26
- */
- this.closeEwerLayer = function(){
- delLayer(ewer_lay_prov.name);
- delLayer(ewer_lay_pref.name);
- removeEvent("onMarkerClicked") ;
- gisLengen = [];
- };
-
- /**
- * 关闭台风模拟绘制图层
- */
- this.closeDrawTyphoonPath = function(){
- delLayer(dtp_lay_point.name);
- delLayer(dtp_lay_line.name);
- delLayer(dtp_lay_seven_circle.name);
- delLayer(dtp_lay_ten_circle.name);
- delLayer(dtp_lay_twelve_circle.name);
-
- };
- /*--------------------------------取消显示应急预警与响应图层end-------------------------------------------------*/
-
- /**
- * @param 取消显示应急资源图层
- * @version 1.0
- * @Date 2015-09-26
- */
- this.closeErsource = function(){
- // $("#erToolWin").hide();
- _this.closeErMarker();
- _this.closeErDist();
- delLayer(erso_lay_so.name) ;
- delLayer(erso_lay_show.name) ;
- delLayer(erso_lay_team.name) ;
- delLayer(erso_lay_track.name) ;
- delLayer(erso_team_playback.name) ;
-
- // delLayer(lay6) ;
- addLayer(erso_lay_draw.name,erso_lay_draw.show,erso_lay_draw.hidden,erso_lay_draw.alpha,erso_lay_draw.order) ;
- delShapes(erso_lay_draw.name) ;
-
- removeEvent("onShapeDrawnCompleted") ;
- removeEvent("onMarkerClicked") ;
- removeEvent("onMapExtentChanged") ;
- removeEvent("onGetPointEvent") ;
- };
- /*----------------------------------------------------------关闭应急资源图层------------------------------------------*/
-
- /**
- * 取消应急资源分布图层
- */
- this.closeErDist = function(){
- delLayer(erso_team_dist.name) ;
- delLayer(erso_car_dist.name) ;
- delLayer(erso_dynamo_dist.name) ;
- delLayer(erso_temp_space_dist.name) ;
- delLayer(erso_team_dist_prev.name) ;
- delLayer(erso_car_dist_prev.name) ;
- delLayer(erso_dynamo_dist_prev.name) ;
-
- };
-
- /**
- * 取消应急资源队伍分布图层
- */
- this.closeErTeam = function(){
- delLayer(erso_team_dist.name) ;
- delLayer(erso_team_dist_prev.name) ;
- gisMes.window.hiddenMes("team_mes") ;
- hiddenMes();
- };
-
- /**
- * 取消应急资源发电车分布图层
- */
- this.closeErCar = function(){
- delLayer(erso_car_dist.name) ;
- delLayer(erso_car_dist_prev.name) ;
- gisMes.window.hiddenMes("car_mes") ;
- hiddenMes();
- };
-
- /**
- * 取消应急资源发电机分布图层
- */
- this.closeErGen = function(){
- delLayer(erso_dynamo_dist.name) ;
- delLayer(erso_dynamo_dist_prev.name) ;
- gisMes.window.hiddenMes("dyn_mes") ;
- hiddenMes();
- };
-
- /**
- * 取消应急资源临时场所分布图层
- */
- this.closeErPlace = function(){
- delLayer(erso_temp_space_dist.name) ;
- };
-
- /**
- *关闭应急资源资源标注图层
- */
- this.closeErMarker = function(){
-
- delLayer("pref1") ;
- delLayer("pref2") ;
- delLayer("pref3") ;
- delLayer("prov1") ;
- delLayer("prov2") ;
- delLayer("prov3") ;
- };
-
- /**
- * 关闭应急队伍图层
- */
- this.closeTeam = function(){
- delLayer(erso_lay_team.name);
- delLayer(erso_lay_track.name);
- delLayer(erso_team_playback.name);
-
- };
-
- /**
- * 应急资源标各级显示半径
- * @param zoomLevel
- * @returns
- */
- this.getErRadius = function(zoomLevel){
- var zl = Math.floor(zoomLevel) ;
- var raiusDs = {5 :{ra:90000,ds:170}, 6 :{ra:40000,ds:80}, 7 :{ra:30000,ds:60},
- 8 :{ra:12000,ds:25} , 9 :{ra:6000,ds:11} , 10:{ra:3000,ds:6} ,
- 11:{ra:1500 ,ds:2.7}, 12:{ra:1000,ds:1.7}, 13:{ra:500,ds:0.9} ,
- 14:{ra:300 ,ds:0.5}, 15:{ra:200 ,ds:0.3}, 16:{ra:90,ds:0.15} ,
- 17:{ra:60 ,ds:0.1}} ;
- return raiusDs[zl] ;
- };
- /*--------------------------------------------应急资源标各级显示半径end-------------------------------------------------*/
-
- /**
- * 应急资源的圆形标注 因为是用添加圆形方法画的标注,所以此标注会随着地图的放大缩小而改变,所以设置了它的显示级别为13到15
- * @param erFlag: 一组资源标注信息json格式,x、y坐标以及三个标注的数量信息,顺序分别是:本地、外地和缺口
- * @param level: 网省地县标识,0为网省级 1为地市级
- * @param crad: 圆形半径
- * @param bs: 圆与圆的差距
- */
- this.drawResource = function(erFlag,level,crad,bs){
- var c1,c2,c3 = "";
- if(level==0){//网省级
- c1 = "prov1" ;
- c2 = "prov2" ;
- c3 = "prov3" ;
-
- addLayer(c1,4,8,1,1);
- addLayer(c2,4,8,1,1);
- addLayer(c3,4,8,1,1);
- } else { //地市级
- c1 = "pref1" ;
- c2 = "pref2" ;
- c3 = "pref3" ;
-
- addLayer(c1,7,14,1,1);
- addLayer(c2,7,14,1,1);
- addLayer(c3,7,14,1,1);
- }
- var circelStyleNative = _this.circelStyle([128,128,128,0],1,1,[93,152,226,255]) ;
- var circelStyleOther = _this.circelStyle([128,128,128,0],1,1,[129,158,67,255]) ;
- var circelStyleInsufficiency = _this.circelStyle([128,128,128,0],1,1,[255,5,5,255]);
- var extraData = {} ;
-
- for(var key in erFlag){
- var ex = erFlag[key].x;
- var ey = erFlag[key].y;
- var rad = crad ;
-
- //本地投入资源标注圆
- var objc1 = {points:{x:ex,y:ey},radius:rad};
- extraData = {"unit":erFlag[key]["unit"],"startDate":erFlag[key]["startDate"],"endDate":erFlag[key]["endDate"],"type":erFlag[key]["type"],"level":"Native"} ;
- addCircle(c1,objc1,circelStyleNative,"extraData");
- ex -= 0.0008 * bs ;
- ey += 0.001 * bs ;
- var objt1 = {points:{ x:ex,y:ey}};
- var textStyle1 = {"strokeColor":[255,255,255,0],text:erFlag[key].native,fontSize:15,fillColor:[0,0,0,255]};
- addText(c1,objt1,textStyle1,"备注");
-
- //外地投入资源标注圆
- ey += 0.0007 * bs ;
- ex += 0.001 * bs ;
- rad += 200 * bs ;
- var objc2 = {points:{x:ex,y:ey},radius:rad};
- extraData = {"unit":erFlag[key]["unit"],"startDate":erFlag[key]["startDate"],"endDate":erFlag[key]["endDate"],"type":erFlag[key]["type"],"level":"Other"} ;
- addCircle(c2,objc2,circelStyleOther,extraData);
- ey += 0.006 * bs ;
- ex -= 0.001 * bs ;
- var objt2 = {points:{x:ex,y:ey}};
- textStyle1 = {"strokeColor":[255,255,255,0],text:erFlag[key].other,fontSize:15,fillColor:[0,0,0,255]};
- addText(c2,objt2,textStyle1,"备注");
-
- //缺口资源标注圆
- ey -= 0.0044 * bs ;
- ex += 0.001 * bs ;
- rad += 200 * bs ;
- var objc3 = {points:{x:ex,y:ey},radius:rad};
- addCircle(c3,objc3,circelStyleInsufficiency);
- ey += 0.008 * bs ;
- ex -= 0.001 * bs ;
- var objt3 = {points:{x:ex,y:ey}};
- textStyle1 = {"strokeColor":[255,255,255,0],text:erFlag[key].insufficiency,fontSize:15,fillColor:[0,0,0,255]};
- addText(c3,objt3,textStyle1,"备注");
- };
- };
- /*--------------------------------------------应急资源标注三个圈添加end-------------------------------------------------*/
-
- /**
- * 通过参数返回要添加的圆形的style
- * @param sColor:边的颜色 如:[255,255,255,0]
- * @param sWeight:线条宽度或者多边形边线宽度 number
- * @param op:填充透明度0-1
- * @param fColor:填充颜色 如:[255, 165, 0, 255]
- * @returns {___anonymous7663_7736}
- */
- this.circelStyle = function(sColor,sWeight,op,fColor){
- var circelStyle = {"strokeColor": sColor,"strokeWeight":sWeight,opacity:op,fillColor:fColor};
- return circelStyle ;
- };
- /*--------------------------------------------通过参数返回要添加的圆形的style end-------------------------------------------------*/
-
- /**
- * 历史轨迹回放
- * @param params
- */
- this.roadHistoryOld = function(params){
-
- var url = $.pathname() + "/ws/cockpit/CockpitService/queryTameLine" ;
- var res = _this.getJsonData(url,params) ;
- if(!res){
- ai.setMes(320, 186, 200, 500, "系统提示", "没有数据!");
- ai.createAlert();
- return;
- }
- delLayer(erso_lay_track.name);
- delLayer(erso_lay_team.name);
- delLayer(erso_team_playback.name);
- addLayer(erso_team_playback.name,erso_team_playback.show,erso_team_playback.hidden,erso_team_playback.alpha,erso_team_playback.order);//队伍轨迹回放
-
- url = $.pathname() + "/ws/cockpit/CockpitService/queryYJTameMarkerInfo" ;
- $(resStart).attr("sort","ASC") ;
- var resStart = _this.getJsonData(url,params);
- for(var key in res){
- var markerId = _this.addAdsIcon(res[key]["points"][0]["x"],res[key]["points"][0]["y"],res[key]["teamId"],resStart,erso_team_playback.name) ;//添加图标
- _this.tracingHistory(res[key],markerId, pathIcon + "ads_start.png",pathIcon + "team_prev.png",erso_team_playback.name,lineStyleTrack) ;
- };
-
- } ;
- /**
- * 历史轨迹回放
- * @param params
- */
- this.roadHistory = function(params){
-
- var url = $.pathname() + "/ws/cockpit/CockpitService/queryTameLineById" ;
- var res = _this.getJsonData(url,params) ;
- if(!res){
- ai.setMes(320, 186, 200, 500, "系统提示", "没有数据!");
- ai.createAlert();
- return;
- }
- delLayer(erso_lay_track.name);
- delLayer(erso_lay_team.name);
- delLayer(erso_team_playback.name);
- addLayer(erso_team_playback.name,erso_team_playback.show,erso_team_playback.hidden,erso_team_playback.alpha,erso_team_playback.order);//队伍轨迹回放
-
- url = $.pathname() + "/ws/cockpit/CockpitService/fixedPosition" ;
- $(resStart).attr("sort","ASC") ;
- var resStart = _this.getJsonData(url,params);
- for(var key = 0; key < res.length; key++){
- var markerId = _this.addAdsIcon(res[key]["points"][0]["x"],res[key]["points"][0]["y"],res[key]["teamId"],resStart,erso_team_playback.name) ;//添加图标
- _this.tracingHistory(res[key],markerId, pathIcon + "ads_start.png",pathIcon + "team_prev.png",erso_team_playback.name,lineStyleTrack) ;
- };
-
- } ;
- /*--------------------------------------------历史轨迹回放 end-------------------------------------------------*/
-
- /**
- * 轨迹回放添加图标
- */
- this.addAdsIcon = function(x,y,teamId,resStart,layTrac){
- var markerId = "" ;
- for(var key in resStart){
- if(resStart[key]["extraData"]["teamid"] == teamId){
- var tem = {layerName:layTrac,posX:x,posY:y,icon:pathIcon + "team_prev.png",clikable:true,"title":resStart[key]["title"]} ;
- markerId = addOneIco(tem);
-
- if(x == resStart[key]["posX"] && y == resStart[key]["posY"]){
-
- //1.判断是不是起点,如果是起点则添加起点图标
- var obj = {layerName:layTrac,posX:x,posY:y,icon:pathIcon + "ads_start.png",clickable:true} ;
- addOneIco(obj) ;
-
- } else {
- //1.判断是不是起点,如果不是起点则添加地址图标
- var obj = {layerName:layTrac,posX:x,posY:y,icon:pathIcon + "adslabel.png",clickable:true} ;
- addOneIco(obj);
-
- }
- }
- }
- return markerId ;
- };
- /*--------------------------------------------轨迹回放添加图标 end-------------------------------------------------*/
-
- /**
- * 轨迹点生成
- * @param e 一组坐标点,4个参数,x坐标 y坐标 afterX坐标 afterY坐标
- * @param markerId 要闪动的Marker点ID
- * @param iconStr 队伍开始图标(大概分两种:起点和地点)
- * @param icon 展示在地图上的Marker图标
- * @param layTrac 图层名
- * @param ls 线样式
- */
- this.tracingHistory = function(e,markerId,iconStr,icon,layTrac,ls){
- for(var xy = 0; xy < e["points"].length; xy++){
-
- if(xy%10==0 && xy!=0){
- var obj = {layerName:layTrac,posX:e["points"][xy].x,posY:e["points"][xy].y,icon:pathIcon + "ads.png",clickable:false,
- title:"队伍名称:" + e["teamName"] + "\n时间:"+e["points"][xy].uploadTime + "\n\n经度:" +
- e["points"][xy].x + "\n纬度:" + e["points"][xy].y} ;
- addOneIco(obj) ;
- };
-
- var er_points = {"points":[{"x":e["points"][xy].afterX,"y":e["points"][xy].afterY},
- {"x":e["points"][xy].x,"y":e["points"][xy].y}]} ;
- var erpath = [{"layerName":layTrac,"points":er_points,"lineStyle":ls}] ;
-
- addResourcePath(erpath) ;//生成折线路径
-
- } ;
- var i = 0 ;
- for(var xy in e["points"]){
- i++;
- (function(){
- var ii=i;
- var tem = {layerName:layTrac,posX:e["points"][xy].x,posY:e["points"][xy].y,icon:icon,clikable:true,"title":e["inciName"]+":"+e["teamName"]} ;
- setTimeout(function(){
- updataMarkerByTeam(markerId,tem);
- },ii*1000);
- })();
- } ;
- } ;
- /*--------------------------------------------轨迹点生成 end-------------------------------------------------*/
-
-
- /**
- * 得到日期类型时间yyyy-mm-dd hh:mm:ss
- * @returns {String}
- */
- this.getNowFormatDate = function(date){
- var month = date.getMonth() + 1 ;
- if(month<10)
- month = "0" + month ;
-
- var day = date.getDate() ;
- if(day<10)
- day = "0" + day ;
- var hours = date.getHours() ;
- if(hours<10)
- hours = "0" + hours ;
- var minutes = date.getMinutes() ;
- if(minutes<10)
- minutes = "0" + minutes ;
- var seonds = date.getSeconds() ;
- if(seonds<10)
- seonds = "0" + seonds ;
- return date.getFullYear() + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seonds ;
- } ;
- /*--------------------------------得到日期类型时间yyyy-mm-dd hh:mm:ss end-------------------------------------------------*/
-
- /**
- * 得到3个月前的日期类型时间yyyy-mm-dd hh:mm:ss
- * @returns {String}
- */
- this.getThreeMonthsAgo = function(date){
- var now = new Date(date.replace(/\-/g,"/"));
- var tmya =new Date( now.setMonth(now.getMonth() - 3));
- return _this.getNowFormatDate(tmya) ;
- } ;
- /*--------------------------------得到3个月前的日期类型时间yyyy-mm-dd hh:mm:ss end-------------------------------------------------*/
-
- /**
- * XY定位,循环数据得到[x1,y1,x2,y2,x3,y3...]样式数组
- * @param data 后台返回的结果
- * @param x 坐标对应的经度key
- * @param y 坐标对应的纬度key
- * @returns {Array} 返回图标坐标数组
- */
- this.poinXY = function(data,x,y){
- var poinArr = [] ;
- for(var key in data){
- var reg = new RegExp("^[0-9]+(.[0-9]+)?$");
- if(reg.test(data[key][x]) && reg.test(data[key][y]) && out_of_china(data[key][x],data[key][y])){
- poinArr.push(data[key][x]) ;
- poinArr.push(data[key][y]) ;
- };
-
- // poinArr.push(data[key][x]) ;
- // poinArr.push(data[key][y]) ;
- }
- return poinArr ;
- };
- /*---------------------------------------XY定位,循环数据得到[x1,y1,x2,y2,x3,y3...]样式数组 end -----------------------------------*/
-
- /**
- * 定位到指定区域
- * @param posXArr X坐标数组
- * @param posYArr Y坐标数组
- * @returns 地图当前缩放等级
- */
- this.zoomToExtent = function(posXArr,posYArr){
- var maxX = Math.max.apply(Math,posXArr) + 0.5;
- var minX = Math.min.apply(Math,posXArr) - 0.5;
-
- var maxY = Math.max.apply(Math,posYArr) + 0.5;
- var minY = Math.min.apply(Math,posYArr) - 0.5;
-
- var posXY = {minX:minX,minY:minY,maxX:maxX,maxY:maxY};
- zoomToExtent(posXY) ;
- return getCurrentZoomLevel() ;
- };
- /*---------------------------------------定位到指定区域end -----------------------------------*/
-
- /**
- * 定位到一组指定坐标(公用)
- * @param cardlist为多组坐标,格式为[x1,y1,x2,y2,x3,y3...]
- */
- this.zoomToCoordList = function(coordList){
- var posXArr = [];
- var posYArr = [] ;
- for(var i = 0 ; i < coordList.length; i++){
- if(i%2==0){
- posXArr.push(coordList[i]);
- }else{
- posYArr.push(coordList[i]);
- }
- }
-
- var maxX = Math.max.apply(Math,posXArr) + 0.5;
- var minX = Math.min.apply(Math,posXArr) - 0.5;
-
- var maxY = Math.max.apply(Math,posYArr) + 0.5;
- var minY = Math.min.apply(Math,posYArr) - 0.5;
-
- var posXY = {minX:minX,minY:minY,maxX:maxX,maxY:maxY};
- zoomToExtent(posXY);
- } ;
- /**
- * 跟据XY坐标添加Marker
- */
- this.addMarkerXY = function(iconName,x,y,teamId,describeinfo){
- switch (iconName){
- case "team.png" : //队伍
-
- teamArr.push("TEAM") ;
- var value = {} ;
- if(describeinfo){
- value = "[{\"LONGITUDE\":" + x + ",\"LATITUDE\":" + y + ",\"NUM\":0,\"TEAMID\":\"" + teamId + "\",\"DESCRIBEINFO\":\"" + describeinfo + "\"}]" ;
- } else {
- value = "[{\"LONGITUDE\":" + x + ",\"LATITUDE\":" + y + ",\"NUM\":0,\"TEAMID\":\"" + teamId + "\"}]" ;
- }
-
- teamXYArr.push(value) ;
-
- break;
- case "adslabel.png" : //地点
-
- siteArr.push("SITE") ;
- var value = "[{\"LONGITUDE\":" + x + ",\"LATITUDE\":" + y + ",\"NUM\":0,\"DESCRIBEINFO\":\"" + describeinfo + "\"}]" ;
- siteXYArr.push(value) ;
-
- break ;
- case "goods.png" : //物资
-
- vehicleArr.push("VEHICLE") ;
- var value = "[{\"LONGITUDE\":" + x + ",\"LATITUDE\":" + y + ",\"NUM\":0,\"DESCRIBEINFO\":\"" + describeinfo + "\"}]" ;
- vehicleXYArr.push(value) ;
-
- break ;
- case "ads_start.png" : //起点
-
- originArr.push("ORIGIN") ;
- var value = "[{\"LONGITUDE\":" + x + ",\"LATITUDE\":" + y + ",\"NUM\":0,\"DESCRIBEINFO\":\"" + describeinfo + "\"}]" ;
- originXYArr.push(value) ;
-
- break ;
- case "destination.png" : //终点
-
- destinationArr.push("DESTINATION") ;
- var value = "[{\"LONGITUDE\":" + x + ",\"LATITUDE\":" + y + ",\"NUM\":0,\"DESCRIBEINFO\":\"" + describeinfo + "\"}]" ;
- destinationXYArr.push(value) ;
-
- break ;
- }
- } ;
- /*-------------------------------------------------跟据XY坐标添加Marker end------------------------------------------------------*/
-
- /**
- * 启动图形完成回调事件
- * e["geometryType"] : 得到图形类型 线:1 多边形:2 圆:3 矩形: 4
- */
- this.openDarwCallBack = function(e){
- var num = 0 ;
- var value = "[" ;
- for(var point in e["geoData"]["points"] ){
- if(e["geoData"]["radius"]){
- value += "{\"LONGITUDE\":" + e["geoData"]["points"][point]["x"] + ",\"LATITUDE\":" + e["geoData"]["points"][point]["y"] + ",\"NUM\":" + num + ",\"RADIUS\":" + e["geoData"]["radius"] + "},";
- } else {
- value += "{\"LONGITUDE\":" + e["geoData"]["points"][point]["x"] + ",\"LATITUDE\":" + e["geoData"]["points"][point]["y"] + ",\"NUM\":" + num + "},";
- }
-
- num ++ ;
- } ;
- value = value.substring(0, value.length-1) ;
- value += "]" ;
-
- if(e["geometryType"]==1){ //折线
- lineArr.push("LINE") ;
- lineXYArr.push(value) ;
- // linePoints.push(e["geoData"]["points"]) ;
- } ;
-
- if(e["geometryType"]==2){ //多边形
- polygonArr.push("POLYGON") ;
- polygonXYArr.push(value) ;
- // polygonPoints.push(e["geoData"]["points"]) ;
- } ;
- if(e["geometryType"]==3){ //圆形
- circleArr.push("CIRCLE") ;
- circleXYArr.push(value) ;
- // circlePoints.push(e["geoData"]["points"]) ;
- } ;
- if(e["geometryType"]==4){ //矩形
- var valueGeo = "[{\"LONGITUDE\":" + e["geoData"]["points"][0]["x"] + ",\"LATITUDE\":" + e["geoData"]["points"][1]["y"] + ",\"NUM\":0},";
- valueGeo += "{\"LONGITUDE\":" + e["geoData"]["points"][1]["x"] + ",\"LATITUDE\":" + e["geoData"]["points"][1]["y"] + ",\"NUM\":1},";
- valueGeo += "{\"LONGITUDE\":" + e["geoData"]["points"][1]["x"] + ",\"LATITUDE\":" + e["geoData"]["points"][0]["y"] + ",\"NUM\":2},";
- valueGeo += "{\"LONGITUDE\":" + e["geoData"]["points"][0]["x"] + ",\"LATITUDE\":" + e["geoData"]["points"][0]["y"] + ",\"NUM\":3}]";
- rectangleArr.push("RECTANGLE") ;
- rectangleXYArr.push(valueGeo) ;
- // rectanglePoints.push(e["geoData"]["points"]) ;
- } ;
-
- } ;
- /*--------------------------------------------------启动图形完成回调事件 end---------------------------------------------------------*/
-
- /**
- * 添加自定义标注
- */
- this.addMarkerToUserDefined = function(f,flg){
- draw_value.ls = lineStyleDraw;
- draw_value.layName = erso_lay_draw.name ;
- if(f=='but6'){
- if(flg){
- var userInfo = _this.resolveUrl() ;
- var url = $.pathname() + "/page/cockpit/webgis/toolTeam.jsp?fd_id=" + userInfo["dept_id"] ;
- ai.createIframe(400, 270, url);
- }
-
- draw_value.teamId = teamInfo.fd_id ;
- draw_value.describeinfo = teamInfo.name ;
- var descri = teamInfo.teamDesc ;
-
- if(descri){
- draw_value.describeinfo += "(" + descri + ")" ;
- }
-
- draw_value.icon = pathIcon + "team.png" ;//队伍
- } else if(f=='but7'){
- draw_value.describeinfo = "地点" ;
- draw_value.icon = pathIcon + "adslabel.png" ;//地点
- } else if(f=='but8'){
-
- var url = $.pathname() + "/page/cockpit/dialog/emergencySupplies.jsp" ;
- draw_value.describeinfo = showModalDialog(url,window,"scroll:yes;status:no;dialogWidth:400px;dialogHeight:270px") ;
- if(draw_value.describeinfo==undefined){ draw_value.describeinfo = ""; }
- draw_value.icon = pathIcon + "goods.png" ;//物资
-
- } else if(f=='but9'){
- draw_value.describeinfo = "起点" ;
- draw_value.icon = pathIcon + "ads_start.png" ;//起点
- // icon = path + "/nwyj/images/cockpit/11.gif" ;//起点
- } else if(f=='but10'){
- draw_value.describeinfo = "终点" ;
- draw_value.icon = pathIcon + "destination.png" ;//终点
- };
-
- if(!draw_value.flag){
- addEvent("onGetPointEvent",callBackAddMarker);
- draw_value.flag = true;
- };
-
- if(f=='but6'&&(!flg)){
- startGetPoint();
- }else if(f!='but6'){
- startGetPoint();
- }
- };
- /*------------------------------------------------添加自定义标注 end-------------------------------------------------------------*/
-
- /**
- * 保存自定义图形按钮事件
- */
- this.saveDraw = function(inciResult){
- if(lineArr.length != 0 || polygonArr.length != 0 || circleArr != 0 || rectangleArr != 0 || originArr != 0 ||
- siteArr != 0 || destinationArr != 0 || vehicleArr != 0 || teamArr != 0){
- // var inciResult = saveIncident() ;
- // drawTypeIds
- // var a = drawTypeIds.join(",") ;
- if(lineArr.length != 0){
- var lineResult = _this.saveType(inciResult,lineArr) ;
- // var lineXYResultJson = _this.saveXY(lineResult,lineXYArr) ;//保存折线类坐标
- _this.saveXY(lineResult,lineXYArr) ;//保存折线类坐标
- drawTypeIds = drawTypeIds.concat(lineResult) ;
-
- lineArr = [] ;
- lineXYArr = [] ;
- // trunDrawLine(lineResult) ;
- }
-
- if(polygonArr.length != 0){
- var polygonResult = _this.saveType(inciResult,polygonArr) ;
- // var polygonXYResultJson = _this.saveXY(polygonResult,polygonXYArr) ;//保存多边形类坐标
- _this.saveXY(polygonResult,polygonXYArr) ;//保存多边形类坐标
- drawTypeIds = drawTypeIds.concat(polygonResult) ;
- polygonArr = [] ;
- polygonXYArr = [] ;
- }
-
- if(circleArr.length != 0){
- var circleResult = _this.saveType(inciResult,circleArr) ;
- // var circleXYResultJson = _this.saveXY(circleResult,circleXYArr) ;//保存圆形类坐标
- _this.saveXY(circleResult,circleXYArr) ;//保存圆形类坐标
-
- // for(var key in circleXYResultJson){alert(circleXYResultJson[key]); }
- drawTypeIds = drawTypeIds.concat(circleResult) ;
- circleArr = [] ;
- circleXYArr = [] ;
- }
-
- if(rectangleArr.length != 0){
- var rectangleResult = _this.saveType(inciResult,rectangleArr) ;
- // var rectangleXYResultJson = _this.saveXY(rectangleResult,rectangleXYArr) ;//保存矩形类坐标
- _this.saveXY(rectangleResult,rectangleXYArr) ;//保存矩形类坐标
- drawTypeIds = drawTypeIds.concat(rectangleResult) ;
- rectangleArr = [] ;
- rectangleXYArr = [] ;
- }
-
- if(originArr.length != 0){
- var rectangleResult = _this.saveType(inciResult,originArr) ;
- // var rectangleXYResultJson = _this.saveXY(rectangleResult,originXYArr) ;//保存起点类坐标
- _this.saveXY(rectangleResult,originXYArr) ;//保存起点类坐标
- drawTypeIds = drawTypeIds.concat(rectangleResult) ;
- originArr = [] ;
- originXYArr = [] ;
-
- }
-
- if(siteArr.length != 0){
- var siteResult = _this.saveType(inciResult,siteArr) ;
- // var siteXYResult = _this.saveXY(siteResult,siteXYArr) ;//保存地点类坐标
- _this.saveXY(siteResult,siteXYArr) ;//保存地点类坐标
- drawTypeIds = drawTypeIds.concat(siteResult) ;
- siteArr = [] ;
- siteXYArr = [] ;
- }
-
- if(destinationArr.length != 0){
- var destinationResult = _this.saveType(inciResult,destinationArr) ;
- // var destinationXYResultJson = _this.saveXY(destinationResult,destinationXYArr) ;//保存终点类坐标
- _this.saveXY(destinationResult,destinationXYArr) ;//保存终点类坐标
- drawTypeIds = drawTypeIds.concat(destinationResult) ;
- destinationArr = [] ;
- destinationXYArr = [] ;
- }
-
- if(vehicleArr.length != 0){
- var vehicleResult = _this.saveType(inciResult,vehicleArr) ;
- // var vehicleXYResult = _this.saveXY(vehicleResult,vehicleXYArr) ;//保存车辆类坐标
- _this.saveXY(vehicleResult,vehicleXYArr) ;//保存车辆类坐标
- drawTypeIds = drawTypeIds.concat(vehicleResult) ;
- vehicleArr = [] ;
- vehicleXYArr = [] ;
- }
- if(teamArr.length != 0){
- var teamResult = _this.saveType(inciResult,teamArr) ;
- // var teamXYResult = _this.saveXY(teamResult,teamXYArr) ;//保存队伍类坐标
- _this.saveXY(teamResult,teamXYArr) ;//保存队伍类坐标
- drawTypeIds = drawTypeIds.concat(teamResult) ;
- teamArr = [] ;
- teamXYArr = [] ;
- } ;
- ai.setMes(320, 186, 200, 500, "系统提示", "保存成功!");
- ai.createAlert();
- } else {
- ai.setMes(320, 186, 200, 500, "系统提示", "没有数据可以保存!");
- ai.createAlert();
- } ;
- } ;
- /*-------------------------------------------------保存自定义图形按钮事件 end ------------------------------------------------------------*/
-
- /**
- * 保存参数信息
- * @param inciResult 事件ID
- * @returns {Array} 返回FD_ID
- */
- this.saveType = function(inciResult,drowArr){
- var par = "[" ;
- var userInfoByTop = _this.resolveUrl() ;
- for(var key in drowArr){
- par += '{"INNECTID":"' + inciResult +'","DROWTYPE":"'+drowArr[key]+'","USER_ID":"' + userInfoByTop["user_id"] + '"},';
- } ;
- par = par.substring(0, par.length-1) ;
- par += "]" ;
-
- url = $.pathname() + "/ws/cockpit/CockpitService/addDrawType" ;//批量添加自定义线形图到参数信息存储表
- params = { DATA : par } ;
- // $.post(url,params,function(data){
- // return data ;
- // }, "text") ;
- return _this.getArrData(url,params) ;//得到线型FD_ID
- } ;
- /*-------------------------------------------------保存参数信息 end ------------------------------------------------------------*/
- /**
- * 保存图形的坐标点
- * @param lineResult
- * @returns {Array}
- */
- this.saveXY = function(lineResult, xyArr){
- var jsonStr = "[" ;
- var exchangeStr = "" ;
- for(var i = 0 ; i < lineResult.length ; i++){//根据得到到图型FD_ID保存线形坐标数据
- var exchangeJson = JSON.parse(xyArr[i]) ;
- for(var sk in exchangeJson){
- exchangeJson[sk] = _this.addJsonAttribute(exchangeJson[sk],"FIGUREID",lineResult[i]);
- exchangeStr = JSON.stringify(exchangeJson[sk]) ;
-
- jsonStr += exchangeStr ;
- jsonStr += "," ;
- } ;
-
- } ;
- jsonStr = jsonStr.substring(0, jsonStr.length - 1) ;
- jsonStr += "]" ;
- url = $.pathname() + "/ws/cockpit/CockpitService/addDrawXY" ;//批量添加自定义线形图到参数信息存储表
- params = { DATA : jsonStr } ;
- return _this.getArrData(url,params) ;
- } ;
- /*------------------------------------------------保存图形的坐标点 end ------------------------------------------------------------*/
-
- /**
- * 清除用户自定义图形
- */
- this.clearDrawUserDefined = function(){
- clearlay("ersoLayDraw");
- _this.clearDrawByUserArr() ;
-
- /*if(drawTypeIds.length != 0){
- var url = $.pathname() + "/ws/cockpit/CockpitService/delDrawUserDefined" ;//批量删除用户自定义绘制图形
- var params = drawTypeIds.join(",") ;
- $.post(url,params,function(data){
- if(data){
- clearlay("ersoLayDraw");
- ai.setMes(320, 186, 200, 500, "系统提示", "保存后删除成功!");
- ai.createAlert();
- clearlay(erso_lay_show.name);
- }
- },"text") ;
- drawTypeIds = [] ;
- } else {
- clearlay("ersoLayDraw");
- _this.clearDrawByUserArr() ;
- ai.setMes(320, 186, 200, 500, "系统提示", "未保存图形删除成功!");
- ai.createAlert();
- }*/
-
- };
- /*------------------------------------------------清除用户自定义图形 end ------------------------------------------------------------*/
-
- /**
- * 清除用户自定义图形
- */
- this.clearDrawByUserArr = function(){
- lineArr = [] ; //存储线类型数组
- polygonArr = [] ; //存储多边形类型数组
- circleArr = [] ; //存储圆类型
- rectangleArr = [] ;//矩形数组
- originArr = [] ;//起点数组
- siteArr = [] ;//地点
- destinationArr = [] ;//终点
- vehicleArr = [] ;//车辆
- teamArr = [] ;//人员
- lineXYArr = [] ; //存储线类型数组坐标
- polygonXYArr = [] ; //存储多边形类型数组坐标
- circleXYArr = [] ; //存储圆类型坐标
- rectangleXYArr = [] ;//矩形数组坐标
- originXYArr = [] ;//起点数组坐标
- siteXYArr = [] ;//地点坐标
- destinationXYArr = [] ;//终点坐标
- vehicleXYArr = [] ;//车辆坐标
- teamXYArr = [] ;//人员坐标
- drawTypeIds = [] ;
- };
- /*------------------------------------------------清除用户自定义图形 end ------------------------------------------------------------*/
-
- /**
- * 按类型查询用户自定义图形信息
- */
- this.searchDrawByUserInfo = function(inicId){
- _this.isDelDrawLay(inicId) ;
- addLayer(erso_lay_show.name,erso_lay_show.show,erso_lay_show.hidden,erso_lay_show.alpha,erso_lay_show.order) ;//添加自定义图标图层(绘图面板转换后)
-
- /*var userInfoByTop = _this.resolveUrl() ;
- var params = {} ;
- var res = {} ;
- var flg = true;
- var url = $.pathname() + "/ws/cockpit/CockpitService/queryDrawByUser" ;
- params = {"inicId":inicId,"type":"LINE","userId":userInfoByTop["user_id"]} ;//线
- res = _this.getJsonData(url,params) ;
- if(res){
- _this.addUserDrawByLine(res) ;
- flg = false;
- }
-
- params = {"inicId":inicId,"type":"POLYGON","userId":userInfoByTop["user_id"]} ;//多边形
- res = _this.getJsonData(url,params) ;
- if(res){
- _this.addUserDrawByPolygon(res) ;
- flg = false;
- };
-
- params = {"inicId":inicId,"type":"CIRCLE","userId":userInfoByTop["user_id"]} ;//圆形
- res = _this.getJsonData(url,params) ;
- if(res){
- _this.addUserDrawByCircle(res) ;
- flg = false;
- }
-
- params = {"inicId":inicId,"type":"RECTANGLE","userId":userInfoByTop["user_id"]} ;//矩形
- res = _this.getJsonData(url,params) ;
- if(res){
- _this.addUserDrawByPolygon(res) ;
- flg = false;
- }
-
- url = $.pathname() + "/ws/cockpit/CockpitService/queryDrawByUserMarker" ;
- params = {"inicId":inicId,"type":"SITE","userId":userInfoByTop["user_id"]} ;//地点
- res = _this.getJsonData(url,params) ;
- if(res){
- res = _this.addEwrAttr(res,true,erso_lay_show.name);
- var objKV = _this.addUserDrawByIcon(res) ;
- addRightDraw(objKV);
- flg = false;
- };
-
- params = {"inicId":inicId,"type":"ORIGIN","userId":userInfoByTop["user_id"]} ;//起点
- res = _this.getJsonData(url,params) ;
- if(res){
- res = _this.addEwrAttr(res,false,erso_lay_show.name) ;
- var objKV = _this.addUserDrawByIcon(res) ;
- addRightDraw(objKV);
- // addResourceIco(res) ;
- flg = false;
- }
-
- params = {"inicId":inicId,"type":"DESTINATION","userId":userInfoByTop["user_id"]} ;//终点
- res = _this.getJsonData(url,params) ;
- if(res){
- res = _this.addEwrAttr(res,false,erso_lay_show.name) ;
- var objKV = _this.addUserDrawByIcon(res) ;
- addRightDraw(objKV);
- // addResourceIco(res) ;
- flg = false;
- }
- params = {"inicId":inicId,"type":"TEAM","userId":userInfoByTop["user_id"]} ;//队伍
- res = _this.getJsonData(url,params) ;
- if(res){
- res = _this.addEwrAttr(res,true,erso_lay_show.name) ;
- var objKV = _this.addUserDrawByIcon(res) ;
- addRightDraw(objKV);
- // addResourceIco(res) ;
- flg = false;
- }
-
- params = {"inicId":inicId,"type":"VEHICLE","userId":userInfoByTop["user_id"]} ;//物资
- res = _this.getJsonData(url,params) ;
- if(res){
- res = _this.addEwrAttr(res,true,erso_lay_show.name) ;
- var objKV = _this.addUserDrawByIcon(res) ;
- addRightDraw(objKV);
- // addResourceIco(res) ;
- flg = false;
- }
- if(flg){
- ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据!");
- ai.createAlert();
- }*/
- // addRightClick() ;
- };
- /*--------------------------------------------按类型查询用户自定义图形信息 end-------------------------------------------------------------*/
-
- /**
- * 添加手绘折线
- * @param drawLineResArr
- */
- this.addUserDrawByLine = function(drawResArr){
- var pointDraw = [] ;
- for(var key in drawResArr){
- pointDraw.push({"layerName":erso_lay_show.name,"points":{"points":drawResArr[key]["points"]},"lineStyle":lineStyleShow,"extraData":drawResArr[key]["drawId"]}) ;
- }
- var objKV = _this.addLineByUserDraw(pointDraw) ;
- addRightDraw(objKV);
- };
- /*--------------------------------------------添加手绘折线 end-----------------------------------------------------*/
- /**
- * 添加手绘多边形
- * @param drawLineResArr
- */
- this.addUserDrawByPolygon = function(drawResArr){
- var pointDraw = [] ;
- for(var key in drawResArr){
- pointDraw.push({"layerName":erso_lay_show.name,"points":{"points":drawResArr[key]["points"]},"lineStyle":lineStyleShow,"extraData":drawResArr[key]["drawId"]}) ;
- }
- var objKV = _this.addPolygonByUserDraw(pointDraw) ;
- addRightDraw(objKV);
- };
- /**
- * 添加手绘圆形
- * @param drawResArr
- */
- this.addUserDrawByCircle = function (drawResArr){
- var pointDraw = [] ;
- for(var key in drawResArr){
- pointDraw.push({"layerName":erso_lay_show.name,"points":{"points":drawResArr[key]["points"],"radius":drawResArr[key]["radius"]},"lineStyle":lineStyleShow,"extraData":drawResArr[key]["drawId"]}) ;
- }
- var objKV = _this.addCircleByUserDraw(pointDraw) ;
- addRightDraw(objKV);
- };
- /*-------------------------------------------添加手绘圆形 end-------------------------------------------------*/
-
- /**
- * 批量添加折线,返回ID与FD_ID健值对
- * @param polygonArr
- */
- this.addLineByUserDraw = function(polygonArr){
- var drawKV = {} ;
- for(var transfer in polygonArr){
- var pId = addPolyLine(polygonArr[transfer]["layerName"],polygonArr[transfer]["points"],polygonArr[transfer]["lineStyle"],polygonArr[transfer]["extraData"]) ;
- drawKV = _this.addJsonAttribute(drawKV,pId,polygonArr[transfer]["extraData"]);
- };
- return drawKV ;
- };
- /*------------------------------------------- 批量添加折线,返回ID与FD_ID健值对 end-------------------------------------------------*/
-
- /**
- * 批量添加多边形,返回ID与FD_ID健值对
- * @param polygonArr
- */
- this.addPolygonByUserDraw = function(polygonArr){
- var drawKV = {} ;
- for(var transfer in polygonArr){
- var pId = addPolygon(polygonArr[transfer]["layerName"],polygonArr[transfer]["points"],polygonArr[transfer]["lineStyle"],polygonArr[transfer]["extraData"]) ;
- drawKV = _this.addJsonAttribute(drawKV,pId,polygonArr[transfer]["extraData"]);
- };
- return drawKV ;
- };
- /*------------------------------------------- 批量添加多边形,返回ID与FD_ID健值对 end-------------------------------------------------*/
-
- /**
- * 批量添加图标,返回ID与FD_ID健值对
- * @param
- */
- this.addUserDrawByIcon = function(polygonArr){
- var drawKV = {} ;
- for(var transfer in polygonArr){
- var pId = addMarker(polygonArr[transfer]) ;
- drawKV = _this.addJsonAttribute(drawKV,pId,polygonArr[transfer]["extraData"]["inciId"]);
- };
- return drawKV ;
- } ;
- /*-------------------------------------------批量添加图标,返回ID与FD_ID健值对 end-------------------------------------------------*/
-
- /**
- * 添加用户自定义圆返回ID与FD_ID健值对
- * @param circleArr
- * @returns {___anonymous64930_64931}
- */
- this.addCircleByUserDraw = function(circleArr){
- var drawKV = {} ;
- for(var transfer in circleArr){
- var obj = {
- points:{x:circleArr[transfer]["points"]["points"][0]["x"], y:circleArr[transfer]["points"]["points"][0]["y"]},
- radius:circleArr[transfer]["points"]["radius"]
- } ;
-
- var circleId = addCircle(circleArr[transfer]["layerName"],obj,circleArr[transfer]["lineStyle"],circleArr[transfer]["extraData"]) ;
-
- drawKV = _this.addJsonAttribute(drawKV,circleId,circleArr[transfer]["extraData"]);
-
- };
- return drawKV ;
- };
- /*-------------------------------------------添加用户自定义圆返回ID与FD_ID健值对 end-------------------------------------------------*/
- /**
- * 删除自定义绘图图层图形
- */
- this.isDelDrawLay = function(inicId){
- if(lineArr.length != 0 || polygonArr.length != 0 || circleArr != 0 || rectangleArr != 0 || originArr != 0 ||
- siteArr != 0 || destinationArr != 0 || vehicleArr != 0 || teamArr != 0){
- if(confirm("有未保存的图形,单击确定保存后再查看")){
- _this.saveDraw(inicId) ;
- _this.delDrawLay() ;
- } else {
- _this.delDrawLay() ;
- }
- } else {
- _this.delDrawLay() ;
- }
- };
- /*--------------------------------------------按类型查询用户自定义图形信息 end-------------------------------------------------------------*/
-
- /**
- * 删除用户自定义图形图层
- */
- this.delDrawLay = function(){
- addLayer(erso_lay_draw.name,erso_lay_draw.show,erso_lay_draw.hidden,erso_lay_draw.alpha,erso_lay_draw.order) ;
- addLayer(erso_lay_show.name,erso_lay_show.show,erso_lay_show.hidden,erso_lay_show.alpha,erso_lay_show.order) ;
- clearlay(erso_lay_draw.name) ;
- clearlay(erso_lay_show.name) ;
- addLayer(erso_lay_draw.name,erso_lay_draw.show,erso_lay_draw.hidden,erso_lay_draw.alpha,erso_lay_draw.order) ;
- };
-
- /**
- * 应急预警和响应图标查询
- * @param url 查询路径
- * @param params 查询条件
- * @param flg 图标是否可点击Boolean
- * @param lay 显示图层
- * @returns {Array} 返回图标坐标数组
- */
- this.searchMarkerToEwer = function(url,params,flg,lay){
- var ewJsonData = _this.getJsonData(url,params) ;
- var poinArr = _this.poinXY(ewJsonData, "posX", "posY");
- ewJsonData = _this.addEwrAttr(ewJsonData,flg,lay) ;
- addResourceIco(ewJsonData);//添加图标
- _this.addGisLengen(ewJsonData);
-
- return poinArr ;
- };
- /*------------------------------------------------应急预警和响应图标查询end---------------------------------------*/
-
- /**
- * 应急预警与响应标注json格式其它参数
- * @param jsonStr 从数据库中读取出来的json属性
- * @param clickable 图标是否可以点击
- * @param lay 图层名
- */
- this.addEwrAttr = function(jsonStr,clickable,lay){
- for(var key in jsonStr){
- jsonStr[key] = _this.addJsonAttribute(jsonStr[key],"clickable",clickable);
- jsonStr[key] = _this.addJsonAttribute(jsonStr[key],"layerName",lay);
- jsonStr[key] = _this.addJsonAttribute(jsonStr[key],"icon",pathIcon + jsonStr[key]["extraData"]["name"] + ".png");
- }
- return jsonStr ;
- };
- /*---------------------------------------------应急预警与响应标注json格式其它参数end----------------------------------------------*/
-
- /**
- * json格式添加属性
- * @param jsonStr
- */
- this.addJsonAttribute = function(jsonStr,key,value){
- $(jsonStr).attr(key,value) ;
- return jsonStr ;
- };
- /*---------------------------------------------json格式添加属性end----------------------------------------------*/
-
- this.delLastChar = function(str){
- if(str != "" || str != undefined || str != null){
- str = str.substring(0,str.length-1);
- return str;
- }
- return "";
- };
- /*---------------------------------------------字符串删除最后一个字符end-----------------------------------------------*/
-
- /**
- * 得到单个sql精确查询条件
- * @param colum
- * @param value
- * @return
- */
- this.getOneSqlWhere = function(colum, value){
- var valueArr = value.split(",") ;
- var result = " and (" ;
- for(var i = 0 ; i < valueArr.length ; i++){
- result += ( colum + " = '" + valueArr[i] + "' or ") ;
- }
- result = result.substring(0, result.length - 3) ;
- result += ")" ;
- return result ;
- } ;
- /*--------------------------------------------- 得到单个sql精确查询条件end----------------------------------------------*/
-
- /**
- * 得到单个sql模糊查询条件
- * @param colum
- * @param value
- * @return
- */
- this.getOneSqlWhereLike = function(colum,value){
-
- var valueArr = value.split(",") ;
- var result = " and (" ;
- for(var i = 0 ; i < valueArr.length ; i++){
- result += ( colum + " like '%" + valueArr[i] + "%' or ") ;
- }
- result = result.substring(0, result.length-3) ;
- result += ")" ;
- return result ;
-
- } ;
- /*---------------------------------------------得到单个sql模糊查询条件end----------------------------------------------*/
-
-
- /**
- * 得到json格式请求
- */
- this.getJsonData = function(url,params){
- $("#leftceladows").showLoading();
- var result={} ;
- $.ajax({
- async:false,
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data) {
- result = data ;
- $("body").eq(0).hideLoading();
- return data ;
- },
- error : function(e) {
- $.messager.alert('操作失败', '访问服务失败!', 'error');
- console.log("URL:"+url);
- }
- });
- $("#leftceladows").hideLoading();
- return result ;
- };
- /*-----------------------------------得到json格式请求 end-----------------------------------------------------------------*/
-
- /**
- * ajax请求 返回数据为字符串并封装为数组用
- */
- this.getArrData = function(url,params){
- var newData = [] ;
- $.ajax({
- async:false,
- url : url,
- type : 'post',
- timeout : 0,
- data : params,
- dataType : 'text',
- success : function(data) {
- newData = data.split(",") ;
- return newData ;
- },
- error : function(e) {
- $.messager.alert('操作失败', '访问服务失败!', 'error');
- console.log("URL:"+url);
- }
- });
- return newData ;
- };
- /*-----------------------------------得到数组格式请求 end-----------------------------------------------------------------*/
-
- /**
- * axaj请求(返回字符串数据)
- */
- this.getStrData = function(url,params){
- var str = "" ;
- $.ajax({
- async:false,
- url : url,
- type : 'post',
- timeout : 0,
- data : params,
- dataType : 'text',
- success : function(data) {
- str = data ;
- },
- error : function(e) {
- $.messager.alert('操作失败', '访问服务失败!', 'error');
- console.log("URL:"+url);
- }
- });
- return str ;
- };
- /*-----------------------------------axaj请求(返回字符串数据) end-----------------------------------------------------------------*/
-
- /**
- * 前台导出Excel
- */
- this.expor_excel = function(devIDList,flag){
- // $("#leftceladows").showLoading();
- // $("#leftceladows").hideLoading();
- $("#leftceladows").showLoading();
- var oXL = new ActiveXObject("Excel.Application"); //创建应该对象
- var oWB = oXL.Workbooks.Add();//新建一个Excel工作簿
-
- for(var key in devIDList){
- // var oSheet = oWB.ActiveSheet;//指定要写入内容的工作表为活动工作表
- var oSheet = oWB.Sheets.Add();
- var psrIDS = devIDList[key].psrName;
- var psrType = devIDList[key].psrType;
- oSheet.name = psrList[psrType];
-
- for(var j=1; j<5; j++){
- oSheet.Cells(1,j).NumberFormatLocal = "@";//将单元格的格式定义为文本
- oSheet.Cells(1,j).Font.Bold = true;//加粗
- oSheet.Cells(1,j).Font.Size = 12;//字体大小
- oSheet.Cells(1,j).value = excelTitle[j.toString()];//向单元格写入值
- oSheet.Cells(1,j).Borders.Weight = 2;
-
- oSheet.Cells(1,j).HorizontalAlignment = 3;//水平对齐方式枚举* (1-常规,2-靠左,3-居中,4-靠右,5-填充 6-两端对齐,7-跨列居中,8-分散对齐)
- // oSheet.Cells(1,j).VerticalAlignment = 2;//垂直对齐方式枚举*(1-靠上,2-居中,3-靠下,4-两端对齐,5-分散对齐)
-
- oSheet.Cells(1,j).ColumnWidth = 22;
- // oSheet.Cells(1,j).RowHeight = 18;
-
- };
-
- for(var i=0; i<psrIDS.length; i++){
- for(var j=1; j<5; j++){
- oSheet.Cells(i+2,j).NumberFormatLocal = "@";//将单元格的格式定义为文本
- oSheet.Cells(i+2,j).Font.Size = 10;//字体大小
- if(j==3){
- oSheet.Cells(i+2,j).value = psrIDS[i];//向单元格写入值
- }else{
- oSheet.Cells(i+2,j).value = "";//向单元格写入值
- };
-
- oSheet.Cells(i+2,j).Borders.Weight = 2;
-
- oSheet.Cells(i+2,j).HorizontalAlignment = 3;//水平对齐方式枚举* (1-常规,2-靠左,3-居中,4-靠右,5-填充 6-两端对齐,7-跨列居中,8-分散对齐)
- // oSheet.Cells(i+2,j).VerticalAlignment = 2;//垂直对齐方式枚举*(1-靠上,2-居中,3-靠下,4-两端对齐,5-分散对齐)
-
- oSheet.Cells(i+2,j).ColumnWidth = 22;
- oSheet.Cells(i+2,j).RowHeight = 12;
- };
- };
-
- };
-
- oXL.Visible = true;
- $("#leftceladows").hideLoading();
-
- $("#expor_tool").animate({ width: "0" }, 1000);
-
- // if(ai.createExporAlert()){
- // ==
- // }
- if(flag){
- var fname;
- try {
- fname = oXL.Application.GetSaveAsFilename("受台风影响设备列表.xls", "Excel Spreadsheets (*.xls), *.xls");
- } catch (e) { print("导出失败! " + e);
- } finally {
- oWB.SaveAs(fname);
- oWB.Close(savechanges = false);
- oXL.Quit();
- oXL = null;
- // idTmr = window.setInterval("Cleanup();", 1);
- }
- return true;
- }else{
- //alert("取消");
- return false;
- }
- oXL.UserControl = true;
- oXL=null;
-
-
- };
-
- /*-----------------------------------导出Excel end-----------------------------------------------------------------*/
-
- this.expor_word = function(exporWord,flag){
- $("#leftceladows").showLoading();
- var WordFile = new ActiveXObject("Word.Application");
- WordFile.Application.Visible = true;
- WordFile.Application.Documents.Add();
- WordFile.Selection.PageSetup.LeftMargin = 50;
- WordFile.Selection.PageSetup.RightMargin = 50;
-
- WordFile.Selection.ParagraphFormat.Alignment = 1; //对齐方式 0:左对齐 1:居中 2:右对齐
- WordFile.Selection.Font.size = 32;
- WordFile.Selection.Font.Bold = true; //打开粗体
- WordFile.Selection.Font.Name = "楷体_GB2312";
- WordFile.Selection.Font.ColorIndex = 6;// 1:黑色 2:蓝色 3:豆沙绿 4:翠绿 5:紫 6:红色
- WordFile.Selection.TypeText ("电 网 受 影 响 情 况");
- WordFile.Selection.TypeParagraph ();
-
- WordFile.Selection.ParagraphFormat.Alignment = 0; //对齐方式
- WordFile.Selection.Font.ColorIndex = 1;
- WordFile.Selection.Font.size = 16;
- WordFile.Selection.Font.Bold = false; //关闭粗体
- WordFile.Selection.Font.Name = "黑体";
-
- for(var key in exporWord){
- WordFile.Selection.TypeText (" " + exporWord[key]);
- WordFile.Selection.TypeParagraph ();
- };
- WordFile.Application.WindowState = 1;
-
- WordFile.Application.Visible = true;
- $("#leftceladows").hideLoading();
- $("#expor_word_tool").animate({ width: "0" }, 1000);
-
- if(flag){
- var fname;
- try {
- // fname = WordFile.Application.SaveAs("受台风影响设备.doc", "Word Spreadsheets (*.doc), *.doc");
- } catch (e) { print("导出失败! " + e);
- } finally {
- WordFile.Application.SaveAs("受台风影响设备.doc");
- WordFile.Application.Close(savechanges = false);
- WordFile.Quit();
- WordFile = null;
- // idTmr = window.setInterval("Cleanup();", 1);
- }
- return true;
- }else{ return false; }
-
- WordFile = null;
- };
- /*-----------------------------------导出Excel end-----------------------------------------------------------------*/
-
- this.getWordText = function(devIDList){
- var textArr = [];
- for(var key in devIDList){
- textArr.push(psrList[devIDList[key].psrType] + ":"+ devIDList[key].psrIDS.length);
- };
- return textArr;
- };
-
- /**
- * 信息填写错误,气泡提示
- */
- this.valid = function($dom,str){
- $($dom).css({"border": "1px solid red"});
- var offset = $($dom).offset();
- $($dom).attr("valid",false);
- $($dom).bind("mouseover",function(){
- var $bubbox = document.createElement("div");
- $bubbox.id = "bubbox";
- $("body").append($bubbox);
- $("#bubbox").addClass("bubble-box").css({"left":offset.left,"top":offset.top-$("#bubbox").height()});
- $($bubbox).append("<span class='test'>* " + str + "</span>");
- });
- $($dom).bind("mouseout",function(){
- $("#bubbox").remove();
- });
- };
-
- /**
- * 信息填写正确,解除气泡提示
- */
- this.unvalid = function($dom){
- $($dom).attr("valid",true);
- $($dom).unbind("mouseover");
- $($dom).unbind("mouseout");
- $($dom).css({"border":"none"});
- };
- /*-----------------------------------气泡提示信息 end-----------------------------------------------------------------*/
-
- /*---------------------------------加载图层----------------------------------------------------------*/
- /**
- * @param 根据获取的每一个ID去加载图层
- * @version 1.0
- * @Date 2015-09-26
- */
- this.loadlayer = function(menuID){
- if(tokens==null || pasrids==null){
- // ai.setMes(320, 186, 200, 500, "系统提示", "请您登录地图后在使用");
- // ai.createAlert();
- return false;
- }else{
-
- switch(menuID){
- //日常气象 图层
- case "11":
- Dailyweather(true);
- return true;
- //台风图层
- case "12":
- Typhoon(true);
- return true;
-
- //台风模拟路径
- case "121":
- _this.drawTyphoonPathInit();
- return true;
- //历史模拟台风
- case "122":
- historyTyphoonSearch();
- _this.historyTyphoonPathInit();
- return true;
- //暴雨图层
- case "13":
- // Rainstorm();
- ai.setMes(320, 186, 200, 500, "系统提示", "界面集成,缺少URL");
- ai.createAlert();
- return false ;
- //冰灾图层
- case "14":
- // IceDamage();
- ai.setMes(320, 186, 200, 500, "系统提示", "界面集成,缺少URL");
- ai.createAlert();
- return false ;
- //应急预警与响应
- case "21":
- _this.ewerLay_init();
- return true ;
- //应急资源图层
- case "41":
- ai.addSummaryIframe();
- _this.ersoLay_init();
- return true ;
- //应急资源队伍分布
- case "413":
- _this.er_team_init();
- _this.searchErTeam(userInfo.dept_id,"0");
- return true ;
-
- //应急资源发电车分布
- case "414":
- _this.er_car_init();
- _this.searchErCar(userInfo.dept_id,"0");
- return true ;
-
- //应急资源发电机分布
- case "415":
- _this.er_gen_init();
- _this.searchErGen(userInfo.dept_id,"0");
- return true ;
-
- //应急资临时安置点分布
- case "416":
- _this.er_place_init();
- _this.searchErPlace(userInfo.dept_id,"18,19,20,21","0");
- return true ;
-
- //应急资源仓库分布
- case "417":
- _this.er_house_init();
- _this.searchErHouse({hb:"A",ht:"1",hl:"1",gt:"1,2,3,4,5,6"});
- return true ;
-
- //应急资源分布
- case "410":
- _this.ersoLay_er_dist_init();
- _this.searchErDist("261,262,381",userInfo.dept_id,"18,19,20,21","0");
- return true ;
- //应急资源投入
- case "411":
- // var paramsProv ;
- // var paramsPref ;
- // var date = allGetServerTime() ;
- // var beginTime = _this.getThreeMonthsAgo(_this.getNowFormatDate(date)) ;
- // var endTime = _this.getNowFormatDate(allGetServerTime()) ;
- //
- // paramsProv = {classid : 265, unitId : subDept["prov"]+"", startDate : beginTime, endDate : endTime} ;
- // paramsPref = {classid : 265, unitId : subDept["pref"]+"", startDate : beginTime, endDate : endTime} ;
- //
- // _this.ersoPut(paramsProv, paramsPref);
- var inicID = $("#inic").attr("relValue") ;
- _this.searchDrawByUserInfo(inicID) ;
- return true ;
- //绘图工具
- case "412":
- locationPosition();
- return true ;
- //应急队伍列表
- case "423":
-
- return true ;
- case "61":
- // EquipmentLoss();
- ai.setMes(320, 186, 200, 500, "系统提示", "界面集成,缺少URL");
- ai.createAlert();
- return false ;
- //用户停电图层
- case "71":
- // UserOutage();
- ai.setMes(320, 186, 200, 500, "系统提示", "界面集成,缺少URL");
- ai.createAlert();
- return false ;
- //电网资源工具图层
- case "81":
- return true ;
- }
- }
-
- };
-
- /*---------------------------------------------------------------删除图层---------------------------------------------*/
- /**
- * @param 根据获取的每一个ID删除
- * @version 1.0
- * @Date 2015-09-28
- */
- this.removeallmarkers = function(id){
- switch(id){
- //日常气象 图层
- case "11":
- Dailyweather(false);
- break ;
- //台风图层
- case "12":
- Typhoon(false);
- break ;
- case "121":
- _this.closeDrawTyphoonPath();
- return true;
- //历史模拟台风
- case "122":
- _this.delHistoryLay();
- removeHistoryTyphoonWin();
- break;
- //暴雨图层
- case "13":
- //alert("删除13");
- break ;
- //冰灾图层
- case "14":
- //alert("删除14");
- break ;
- //地震图层
- case "15":
- //alert("删除15");
- break ;
- //山火图层
- case "16":
- //alert("删除16");
- break ;
- //应急预警与响应图层
- case "21":
- _this.closeEwerLayer();
- break ;
- //应急资源图层
- case "41":
- $("#gisMes").remove();
- _this.closeErsource();
- // var idArr = ["DuiWuHuiZongZt","DuiWuRenYuanHuiZongZt","FaDianJiHuiZongZt","FaDianCheHuiZongZt","TeamChar","EduiChar","alertChar"];
- var idArr = ["alertChar"];
- _this.delChartWin(idArr);
- removeDrawWin();
- break ;
-
- //应急资源队伍分布
- case "413":
- _this.closeErTeam();
- break ;
-
- //应急资源发电车分布
- case "414":
- _this.closeErCar();
- break ;
-
- //应急资源发电车分布
- case "415":
- _this.closeErGen();
- break ;
-
- //应急资源发电车分布
- case "416":
- _this.closeErPlace();
- break ;
-
- case "417":
- delLayer(erso_lay_so.name) ;
- break ;
- case "410":
- _this.closeErDist();
- // var idArr = ["DuiWuHuiZongZt","DuiWuRenYuanHuiZongZt","FaDianJiHuiZongZt","FaDianCheHuiZongZt","TeamChar","EduiChar","alertChar"];
- var idArr = ["alertChar"];
- _this.delChartWin(idArr);
- removeDrawWin();
- break ;
- //绘图工具
- case "411":
- delLayer(erso_lay_show.name);
- delLayer(erso_lay_draw.name);
- return true ;
- //应急队伍列表
- case "412":
- _this.closeTeam();
- return true ;
- //设备损失图层
- case "61":
- break ;
- //用户停电图层
- case "71":
- break ;
- }
- };
-
-
- /*-------------------------------各图层所需要的图层名返回 start----------------------------------------*/
-
- /**
- * 得到绘制台风添加红点出现图层信息,5-17级显示
- */
- this.getDtpLayPoint = function(){ return dtp_lay_point; };
- /**
- * 得到绘制台风添加折线图层信息,5-17级显示
- */
- this.getDtpLayLine = function(){ return dtp_lay_line; };
- /**
- * 得到绘制台风添加七级风圈图层信息,5-17级显示
- */
- this.getDtpLaySevenCircle = function(){ return dtp_lay_seven_circle; };
- /**
- * 得到绘制台风添加十级风圈图层信息,5-17级显示
- */
- this.getDtpLayTenCircle = function(){ return dtp_lay_ten_circle; };
-
- /**
- * 得到绘制台风添加十二级风圈图层信息,5-17级显示
- */
- this.getDtpLayTwelveCircle = function(){ return dtp_lay_twelve_circle; };
-
- /**
- * 得到绘制历史模拟台风Marker点出现图层信息,5-17级显示
- */
- this.getHdtpLayPoint = function(){ return hdtp_lay_point; };
- /**
- * 得到绘制历史模拟台风折线图层信息,5-17级显示
- */
- this.getHdtpLayLine = function(){ return hdtp_lay_line; };
- /**
- * 得到绘制历史模拟台风添加七级风圈图层信息,5-17级显示
- */
- this.getHdtpLaySevenCircle = function(){ return hdtp_lay_seven_circle; };
- /**
- * 得到绘制历史模拟台风添加十级风圈图层信息,5-17级显示
- */
- this.getHdtpLayTenCircle = function(){ return hdtp_lay_ten_circle; };
-
- /**
- * 得到绘制历史模拟台风添加十二级风圈图层信息,5-17级显示
- */
- this.getHdtpLayTwelveCircle = function(){ return hdtp_lay_twelve_circle; };
-
- /**
- * 应急预警与响应图标,网省级图层4-6级显示
- */
- this.getEwerLayProv = function(){ return ewer_lay_prov; };
-
- /**
- * 应急预警与响应图标,网省级图层7-14级显示
- */
- this.getEwerLayPref = function(){ return ewer_lay_pref; };
-
- /**
- * 应急资源手绘图层
- */
- this.getDrawValue = function(){ return draw_value; };
-
- /**
- * 绘图图层手绘添加图层
- */
- this.getDrawLay = function(){ return erso_lay_draw; };
-
- /**
- * 绘图图层查看图层
- */
- this.getShowLay = function(){ return erso_lay_show; };
-
- /**
- * 线类型
- * l_draw:手绘线样式
- * l_row:路径折线样式
- * l_track:轨迹回放线样式
- * l_dis:轨迹描述线样式
- */
- this.getLineStyle = function(){
- var lsd = {l_draw:lineStyleDraw,l_row:lineStyleRow,l_track:lineStyleTrack,l_dis:lineStyleDis};
- return lsd;
- };
-
- /**
- * 队伍定位图层
- */
- this.getErsoLayTeam = function(){ return erso_lay_team; };
-
- /**
- * 队伍描述轨迹
- */
- this.getErsoLayTrack = function(){ return erso_lay_track; };
-
- /**
- * 得到队伍轨迹回放图层信息
- */
- this.getErsoTeamPlayback = function(){ return erso_team_playback; };
- /*-------------------------------各图层所需要的图层名返回 end----------------------------------------*/
-
- /*-------------------------------设置返回各图层的定位坐标组 start----------------------------------------*/
- /**
- * 应急预警与响应图层的定位坐标组
- */
- this.getEwerMz = function(){ return mz_ewer; };
-
- /**
- * 设置应急预警与响应图层的定位坐标组
- */
- this.setEwerMz = function(posXY){ mz_ewer = posXY; };
-
- /**
- * 应急资源图层的定位坐标组
- */
- this.getErMz = function(){ return mz_er; };
-
- /**
- * 设置应急资源图层的定位坐标组
- */
- this.setErMz = function(posXY){ mz_er = posXY; };
-
- /**
- * 应急资源的临时场所图标
- */
- this.getTempSpace = function(){return erso_temp_space_dist; };
-
- /*-------------------------------设置返回各图层的定位坐标组 end----------------------------------------*/
-
- /*-------------------------------设置返回各图层的定位坐标组 start----------------------------------------*/
- /**
- * 当前部门字符串格式数据返回
- */
- this.getDeptId = function(){ return deptId; };
-
- /**
- * 当前部门字符串格式数据设置
- */
- this.setDeptId = function(params){ deptId = params; };
-
- /**
- * 返回路径,用于Marker点添加用
- */
- this.getGisIconPath = function(){ return pathIcon; };
- /*-------------------------------设置返回各图层的定位坐标组 end----------------------------------------*/
-
- /*-------------------------------设置返回系统用户信息 start----------------------------------------*/
- /**
- * 登录用户信息数据返回
- */
- this.getUserInfo = function(){ return userInfo; };
-
- /**
- * 登录用户信息数据设置
- */
- this.setUserInfo = function(params){ userInfo = params; };
- /**
- * 登录用户信息数据返回
- */
- this.getSubDept = function(){ return subDept; };
-
- /**
- * 登录用户信息数据设置
- */
- this.setSubDept = function(params){ subDept = params; };
- /*-------------------------------设置返回系统用户信息 end----------------------------------------*/
-
- /*-------------------------------返回资源标注信息 start----------------------------------------*/
- /**
- * 应急资源地市级资源标注图标信息返回erFlagPref
- */
- this.getErFlagPref = function(){ return erFlagPref; };
-
- /**
- * 应急资源网省级资源标注图标信息返回erFlagProv
- */
- this.getErFlagProv = function(){ return erFlagProv; };
-
- /**
- * 设置应急资源地市级资源标注图标信息erFlagPref
- */
- this.setErFlagPref = function(params){ erFlagPref = params; };
-
- /**
- * 设置应急资源网省级资源标注图标信息erFlagProv
- */
- this.setErFlagProv = function(params){ erFlagProv = params; };
- /*-------------------------------返回资源标注信息 end----------------------------------------*/
-
- /*-------------------------------返回图标信息 start----------------------------------------*/
-
- /**
- * 返回图标名称
- * ads:地点图标
- * team:队伍图标
- * startAds:地点图标
- */
- this.getIcons = function(){
- return {ads:pathIcon + "adslabel.png",team:pathIcon + "team.png", startAds:pathIcon + "ads_start.png"} ;
- };
- /*-------------------------------返回图标信息 end----------------------------------------*/
-
- /*-------------------------------设置得到队伍信息 start----------------------------------------*/
-
- /**
- * 得到队伍信息(应急资源绘图时保存)
- */
- this.getTeamInfo = function(){
- return teamInfo ;
- };
-
- /**
- * 设置队伍信息(应急资源绘图时保存)
- */
- this.setTeamInfo = function(params){
- teamInfo = params ;
- };
- /*-------------------------------设置得到队伍信息 end----------------------------------------*/
-
- /**
- * 得到模拟台风路顺利计数
- */
- this.getPi = function(){ return _this.pi ; };
-
- /**
- * 设置模拟台风路径计数
- */
- this.setPi = function(params){ _this.pi = params ; };
-
- /**
- * 重置模拟台风路径计数及点位置记录数组
- */
- this.resPisp = function(){
- _this.pi = 0;
- _this.simulationPoint = [];
- };
-
- /**
- * 模拟台风路径计数加1
- */
- this.piPlusOne = function(){ _this.pi++; };
-
- /**
- * 台风模拟路径点数组添加
- */
- this.addSimulationPoint = function(param){ _this.simulationPoint.push(param); };
-
- /**
- * 返回台风模拟路径点数组
- */
- this.getSimulationPoint = function(){ return _this.simulationPoint; };
-
- /**
- * 返回模拟台风绘制给Style
- */
- this.getSimulineStyle = function(){ return lineStyleSimulation; };
-
- /**
- * 返回模拟台风绘制线的颜色JSON
- * 1:热带低压(绿色)
- * 2:热带风暴(黄色)
- * 3:强热带风暴(橙色)
- * 4:台风(红色)
- * 5:强台风(粉色)
- * 6:超强台风(紫色)
- */
- this.getSimuColor = function(){ return simulationColor; };
-
- /**
- * 返回模拟台风点图标,与线颜色对应
- */
- this.getSimuMark = function(){ return simulationMarker; };
-
- /**
- * 设置模拟台风MarkID用于填写完信息后修改用
- */
- this.setSimuUpdateMark = function(param){ _this.simuMarkerId = param; };
-
- /**
- * 返回模拟台风MarkID用于修改
- */
- this.getSimuUpdateMark = function(){ return _this.simuMarkerId; };
-
- /**
- * 返回模拟台风风力等级,用于模拟台风的marker提示用
- */
- this.getSimuStrength = function(){ return simulationStrength; };
-
- /**
- * 添加模拟台风绘制Marker点ID
- */
- this.addSimuMarker = function(param){_this.simuMarker.push(param); };
-
- /**
- * 添加模拟台风绘制线ID
- */
- this.addSimuLine = function(param){ _this.simuLine.push(param); };
-
- /**
- * 得到当前模拟台风的MarkerID以及LineID
- */
- this.getSimuCurrentID = function(){ return {markerID:_this.simuMarker,lineID:_this.simuLine}; };
-
- this.resetSimCurrent = function(){
- _this.simuMarker = [];
- _this.simuLine = [];
- };
-
- /**
- * 得到模拟台风风圈圆数据
- */
- this.getSimuCircleStyle = function(){ return simulationCircle; };
-
- /**
- * 反回台风模拟路径生成时的setTimeout数组
- */
- this.getSetTimeoutArr = function(){ return stArr; };
-
- /**
- * 返回应急资源网省级发电车装备图层数据
- */
- this.getErEduiLay = function(){ return erso_car_dist; };
-
- /**
- * 返回应急资源网省级发电机装备图层数据
- */
- this.getErEduiDynamoLay = function(){ return erso_dynamo_dist; };
-
- /**
- * 返回应急资源网省级队伍图层数据
- */
- this.getErTeamLay = function(){ return erso_team_dist; };
-
-
- /**
- * 返回应急资源地市级发电车图层数据
- */
- this.getEduiCarPrevLay = function(){ return erso_car_dist_prev; };
-
- /**
- * 返回应急资源地市级发电机图层数据
- */
- this.getEduiDynamoPrevLay = function(){ return erso_dynamo_dist_prev; };
-
- /**
- * 返回应急资源地市级队伍图层数据
- */
- this.getErTeamPrevLay = function(){ return erso_team_dist_prev; };
-
- /**
- * 返回仓库图层数据
- */
- this.getErHouse = function(){ return erso_lay_so; };
-
- /**
- * 设置设备类型电压等级kV
- */
- this.setPsrList = function(psrLayerInfoList){
- for(var key in psrLayerInfoList){
- var psrKey = psrLayerInfoList[key].LayerID;
- var psrVal = psrLayerInfoList[key].LayerName;
- psrList[psrKey] = psrVal;
- };
- };
-
- this.getPsrList = function(){ return psrList; };
-
- this.getGisLengen = function(){
- var res = [gisLengen[0]];
- for(var i = 0; i < gisLengen.length; i++){
- var repeat = false;
- for(var j = 0; j < res.length; j++){
- if(gisLengen[i].name == res[j].name){
- repeat = true;
- break;
- }
- }
- if(!repeat) res.push(gisLengen[i]);
- };
- return res;
- };
-
- this.getErGisLengen = function(){
- return erLengen;
- };
- };
- /* ========================================================地图辅助工具类结束==================================================*/
|