123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840 |
- /**
- * gisui是针对驾驶舱的主界面进行设计的js文件
- * @author jyf zmy
- * @version 1.0
- * @Date 2015-09-23
- */
- //实例化接口
- var paramsEw = { "listId" :'365', "condition" : " 1=1 and IS_DEL='0' and is_alert = '0' and is_send = '5' " } ;
- var paramsEr = { "listId" :'365', "condition" : " 1=1 and IS_DEL='0' and is_alert = '1' and is_send = '5' " } ;
- var paramsLt = { "listId" :'411'} ;
- var paramsSo = { "listId" :'', "condition" : "" } ;
- var paramsFs = { "listId" :'411'} ;
- var userInfoByTop=top.conditionJson;//用户信息
- var userInfo ;//用户信息
- var gridEw ;
- var paramsGird = {"21a":paramsEw,"21b":paramsEr,"31a":paramsLt,"31c":paramsFs} ;
- var paramsGridChange = {"21a":gridEw} ;
- var quilayoutpages;
- var wg = null;
- var gislayerpages;
- $(function(){
- quilayoutpages =new QUIlayoutpage();
- wg = new WebGisMap();
- gislayerpages = new Gislayerpage();
- });
- //定义路径
- 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+1);
- var iarrs=[];//用于接收图层全选的id
- var zTree;//定义树形右键菜单
- var RightMenuId;//定义右键点击时获取的菜单ID
- var Rightflag;//定义右键菜单获取的是否选中
- var MenuID;//定义选中复选框得到的菜单ID
- var MenuCheck;//得到点击复选框当前的状态
- var pID = null ;//线路跳闸与变电站停运的全局设备ID
- var icon = null ;
- 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 hiddenPsr = [{key:"hiddenPsr",icon:path + "/nwyj/images/cockpit/er_storage.png"}];
- //显示所有设备按钮
- var showPsr = [{key:"showPsr",icon:path + "/nwyj/images/cockpit/ads_start.png"}];
- var lay1 = 'resource1' ;//添加应急资源图层
- var lay2 = 'resource2' ;//用户应急资源图层(用户绘制图形图层)
- var lay3 = 'resource3' ;//用户应急资源图层(转换后)
- var lay4 = 'resource4' ;//应急资源图层应急队伍图层(描绘轨迹队伍)
- var lay5 = 'resource5' ;//应急资源图层应急队伍图层(地点图标和描绘轨迹线)
- //var lay6 = 'resource6' ;//应急资源图层应急队伍图层(队伍定位)
- /**
- * 线类型数据
- */
- var lineStyle = {style:{"strokeColor": [17,57,101,255],"strokeWeight":2,opacity:0.5,fillColor:[127,188,249,255]}};//手绘线样式
- var lineStyle1 = {"strokeColor": [17,57,101,255],"strokeWeight":2,opacity:0.7,fillColor:[127,188,249,255]};//手绘线样式
- var lineStyle2 = {"strokeColor": [0,51,114,255],"strokeWeight":2,opacity:1,fillColor:[0,51,114,255]} ;//路径折线样式
- var lineStyle3 = {"strokeColor": [108,159,65,255],"strokeWeight":3,opacity:1,fillColor:[108,159,65,255]} ;//轨迹回放
- var lineStyle4 = {"strokeColor": [190,0,46,255],"strokeWeight":3,opacity:1,fillColor:[190,0,46,255]} ;//轨迹描述
- //应急资源各类图标,固定值
- var er_storageIcon = path + "nwyj/images/cockpit/er_storage.png" ;//仓库
- var er_groupIcon = path + "nwyj/images/cockpit/er_group.png" ;//队伍
- var er_GoodsIcon = path + "nwyj/images/cockpit/er_goods.png" ;//物资
- var er_destIcon = path + "nwyj/images/cockpit/er_destination.png" ;//终点
- var er_startIcon = path + "nwyj/images/cockpit/ads_start.png" ;//起点
- var er_adsIcon = path + "/nwyj/images/cockpit/er_adslabel.png" ;//地点
- var er_playBack = path + "nwyj/images/cockpit/no.png" ;//红色圆点
- //应急预警与响应图标的位置
- var em_earlywarning1 = path+"/nwyj/images/cockpit/em_earlywarning1.png";//一级预警
- var em_earlywarning2 = path+"/nwyj/images/cockpit/em_earlywarning2.png";//一级预警
- var em_earlywarning3 = path+"/nwyj/images/cockpit/em_earlywarning3.png";//一级预警
- var em_earlywarning4 = path+"/nwyj/images/cockpit/em_earlywarning4.png";//一级预警
- var em_response1 = path+"/nwyj/images/cockpit/em_response1.png";//一级响应
- var em_response2 = path+"/nwyj/images/cockpit/em_response2.png";//一级响应
- var em_response3 = path+"/nwyj/images/cockpit/em_response3.png";//一级响应
- var em_response4 = path+"/nwyj/images/cockpit/em_response4.png";//一级响应
- //应急预警与响应级别对应查询图标
- var level = {"35":em_earlywarning1,"36":em_earlywarning2,"37":em_earlywarning3,"38":em_earlywarning4,
- "29":em_response1,"30":em_response2,"31":em_response3,"32":em_response4} ;
- var mz_everydayWeather = [] ;//日常气象
- var mz_typhoon = [] ;//台风
- var mz_rainstorm = [] ;//暴雨
- var mz_ice = [] ;//冰灾
- var mz_temblor = [] ;//地震
- var mz_fire = [] ;//山火
- var mz_ewer = [] ;//应急预警与响应
- var mz_er = [] ;//应急资源
- var mz_device = [] ;//设备损失
- var mz_powerCut = [] ;//用户停电
- //缩放到当前图层
- var zoomTier = {"11":mz_everydayWeather, "12":mz_typhoon, "13":mz_rainstorm, "14":mz_ice, "15":mz_temblor,
- "16":mz_fire, "21":mz_ewer, "41":mz_er, "61":mz_device, "71":mz_powerCut};
- //var gdX = 113.175670022751 ;//广东:113.749183141629 ;
- //var gdY = 23.1614514994855 ;//24.1676051184671 ;
- //应急预警与响应图层名称
- //var ewer_lay1 = "Emergencyearlywarningandresponse" ;
- var ewer_lay1 = "ewerLay1" ;//应急预警与响应图标,网省级图层4-6级显示
- var ewer_lay2 = "ewerLay2" ;//应急预警与响应图标,网省级图层7-14级显示
- //接收应急预警与响应图标的ID数组
- var Emergencyearlywarningandresponseid;
- //应急资源图标信息
- var erIcons ;
- //定位队伍
- //var coordList = [113.097097830711,23.1779403082591,113.107112222063,23.1228546665349] ;
- //信息窗
- var infoWins = [{"layerName":lay1,"posX":113.109972433983,"posY":23.1454283123816,"title":"XXX物资","icon":er_GoodsIcon ,"clickable":true}] ;
- //根据路径坐标生成折线
- //var erpathA = [{"layerName":lay1,"points":er_pointsA,"lineStyle":lineStyle2,"title":"路径A"},
- // {"layerName":lay1,"points":er_pointsB,"lineStyle":lineStyle2,"title":"路径B"}] ;
- //线路跳闸与变电站停运
- var lt_lay1 = 'lineTripping1' ;//线路跳闸与变电站图层(系统)
- var lt_lay2 = 'lineTripping2' ;//线路跳闸与变电站图层
- var lt_lay3 = 'lineTripping3' ;//线路跳闸与变电站图层
- var equis = [];
- //设备右键菜单
- var menuArr = [{ "Key": "1","Name": "查看负荷曲线图"},
- { "Key": "2","Name": "查看变电站视频"},
- { "Key": "3","Name": "查看受影响的变电站、线路"}] ;
- var funArr = [{"key":"1",fun:"showLoadPattern()"},
- {"key":"2",fun:"showSubstationVideo()"},
- {"key":"3",fun:"showImpactEquipment()"}];
- //表格高度
- var pageSize = null ;
- var subDept = {} ;
- //关于坐标转换的全局变量
- //经纬度转换为墨卡托的X坐标
- var MercatorX1;
- var MercatorX2;
- //经纬度转换为墨卡托的Y坐标
- var MercatorY1;
- var MercatorY2;
- //墨卡托投影坐标下两点之间的距离
- var MercatorRange;
- ///**
- // * QUI需要初始化的所有内容
- // */
- //function initComplete(){
- // //初始花QUI布局
- //// quilayoutpages.QUIlayout("#centerUI",true,false);
- // //初始化树形复选框
- //// quilayoutpages.QUItreecheckbox("#ztreeMoreOpt");
- // //初始化树形复选框的右键菜单
- //// quilayoutpages.QUItreerightmeun("ztreeMoreOpt");
- // //初始化数据表
- // quilayoutpages.tableInit();
- //};
- /*
- function init() {
- var iframe = document.createElement("iframe");
- iframe.src = MapConfig.webGisSrc;
- iframe.onload = iframe.onreadystatechange = initWebGisMap;
- iframe.style.width = "100%";
- iframe.style.height = "100%";
- document.getElementById("centermap").appendChild(iframe);
- }
- *//**iframe加载完成**//*
- function initWebGisMap(){
- //初始化js
- if (this.src.length > 0) {
- if (!this.readyState || this.readyState == "complete") {
- wg = new WebGisMap();
- alert(JSON.stringify(wg))
- wg.login("gistest","Hello123*");
- }
- }
- }*/
- var ai ;
- $(function(){
- ai = new AlertIframe();
- $("#lw").on("click",function(){
- /* alert($(top.document).find("body").find("#"+resolveUrl()["conId"]));
- alert(top); */
- top.fn_list(window,$(top.document).find("body").find("#"+resolveUrl()["conId"]));
- });
- var heig = $(document).height();
- $("#mainTable").height(heig);
- $("#centermap").height(heig);
- $("#leftceladows").height(heig);
-
- $(".menuc").on('show.bs.collapse', function () {
- $(this).prev().children("a").children().removeClass("_unfold");
- $(this).prev().children("a").children().addClass("_shrink");
- });
-
- $(".menuc").on('hidden.bs.collapse', function () {
- $(this).prev().children("a").children().removeClass("_shrink");
- $(this).prev().children("a").children().addClass("_unfold");
- });
- });
- function displayGisSearch(){
- $("#leftceladows").fadeIn(500);
- };
- function noneGisSearch(){
- $("#leftceladows").fadeOut(500);
- };
- $(window).resize(function(){
- var heig = $(document).height();
- $("#mainTable").height(heig);
- $("#leftceladows").height(heig);
- }) ;
- /**
- * 得到当前登录用户信息
- * @returns {___anonymous6112_6113}
- */
- function resolveUrl(){
- var encondeCondition=window.location.search;
- var condition= 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];
- }
- return condJson;
- }
- /**
- * 获得表格显示的高度
- * @returns {Number} 返回表格数据的高度(不加头尾)
- */
- function getGridHieght(){
- var pageHeight = $(document).height() - 30 - 24 ;
- $("#page").width('100%');
- $("#page").height(pageHeight);
- return pageHeight;
- };
- $(function(){
- quilayoutpages.tableInit();
- var pageHeight = getGridHieght() ; //浏览器时下窗口文档的高度
- // window.frames["page_0"].refresh(pageHeight);
- $("#gisLeftSearch").height(pageHeight-35) ;
- // page_0.window.refresh(pageHeight) ;
- // page_1.window.refresh(pageHeight) ;
- /* $(window).resize(function(){
- var pageHeight = getGridHieght() ; //浏览器时下窗口文档的高度
- $("#gisLeftSearch").height(pageHeight-15) ;
- // window.frames["page_0"].refresh(pageHeight);
- page_0.window.refresh(pageHeight) ;
- page_1.window.refresh(pageHeight) ;
- }) ;*/
- userInfo = resolveUrl() ;
- var userDeptID = userInfo["dept_id"] ;
- var url ="/nwyj/ws/cockpit/CockpitService/querySubDept";
- var params = { unitId:userDeptID } ;
-
- $.post(url,params,function(data){
- subDept = data ;
- },"json") ;
-
- //得到当前部门及其子直属子部门ID
- });
- /*$(window).resize(function() {
- var pageHeight = getGridHieght() ; //浏览器时下窗口文档的高度
- $("#gisLeftSearch").height(pageHeight-35) ;
- // window.frames["page_0"].refresh(pageHeight);
- page_0.window.refresh(pageHeight) ;
- page_1.window.refresh(pageHeight) ;
- alert(pageHeight+"BBB");
- }) ;*/
- /**
- * 添加图层(公用)
- * @param lay 图层名
- * @param show 显示级别
- * @param hide 隐藏级别
- * @param appach 透明度
- */
- function addLayer(lay,show,hide,appach){
- wg.addShapeLayer(lay,show,hide,appach,1) ;
- };
- /**
- * 删除图层(公用)
- * @param lay 图层名
- */
- function delLayer(lay){
- wg.removeAllMarkers(lay);
- };
- /**
- * 删除自定义图形(公用)
- * @param lay 图层名
- */
- function delShapes(lay){
- wg.removeAllShapes(lay) ;
- }
- /**
- * 添加图标(公用)
- * @param erIcons 应急资源图层的图标信息组
- */
- function addResourceIco(erIcons){
- var iconIds = new Array() ;
- for(var icon in erIcons){
- iconIds.push(wg.addMarker(erIcons[icon])) ;
- };
- // addMarkerEvent();
- return iconIds ;
- } ;
- //function addMarkerEvent(){
- // wg.addEvent('onMarkerClicked',markerEvent);
- //}
- //function markerEvent(e){
- // var s = "";
- // s = WebGisMap.jsToJson(e);
- //}
- /**
- * 以坐标点形式给Marker添加信息窗口(公用)
- * @param infoWins 一组要添加信息窗口的Marker(要有x,y坐标属性)
- */
- function addResourceInfoWin(infoWins){
- var pathTex = pathCon + "infoWindow.html?";
- var pathText = null ;
- for(var icon in infoWins){
- pathText = pathTex + infoWins[icon].posX ;
- var obj = {posX:infoWins[icon].posX,posY:infoWins[icon].posY,sizeWidth:170,sizeHeight:130,content:pathText,iconPosition:'left'};
- wg.openInfoWindow(obj) ;
- };
- } ;
- /**
- * 打开浮动窗(公用)
- * @param width:宽
- * @param height:高
- * @param pathTex:打开的页面URL
- */
- function openFloatWindow(width,height,pathTex){
- var obj = { posX: 260, posY: 30, sizeWidth: width, sizeHeight:height, content: pathTex, iconPosition: "right" };
- wg.openFloatWindow(obj);
- } ;
- /**
- * 定位到一组指定坐标(公用)
- * @param cardlist为多组坐标,格式为[x1,y1,x2,y2,x3,y3...]
- */
- function zoomToCoordList (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;
-
- wg.zoomToExtent(minX,minY,maxX,maxY);
- */
-
- wg.zoomToCoordList(coordList);
- } ;
- /**
- * 定位到一组设备
- * @param psrIds
- */
- function zoomToPSRList(psrIds){
- wg.zoomToPSRList(psrIds) ;
- } ;
- /**
- * 取消设备高亮显示功能(公用)
- */
- function HighlightPSRs()
- {
- wg.removeAllHighlightPSRs();
- };
- /**
- * 删除一组Marker点(公用)
- * @param id
- */
- function delMarkers(markers){
- //wg.removeMarker(markers) ;
- for(var key in markers){
- wg.removeMarker(markers[key]) ;
- } ;
- } ;
- /**
- * 修改一组Marker点(公用)
- * @param markers
- */
- function updataMarkers(markers){
- for(var key in markers){
- wg.updateMarker(markers[key].markerId,markers[key].obj) ;
- } ;
- } ;
- /**
- * 删除图层上用户自定义的所有图形图标
- */
- function clearlay(lay){
- wg.removeAllShapes(lay) ;
- } ;
- /**
- * 轨迹点生成
- * @param e 一组坐标点,4个参数,x坐标 y坐标 afterX坐标 afterY坐标
- * @param markerId 要闪动的Marker点ID
- * @param iconStr 队伍开始图标(大概分两种:起点和地点)
- * @param icon 展示在地图上的Marker图标
- * @param layTrac 图层名
- * @param ls 线样式
- */
- function tracingHistory(e,markerId,iconStr,icon,layTrac,ls){
- for(var xy in e["points"]){
-
- 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);
- })();
- // markerId = wg.addMarker(obj) ;
- } ;
- } ;
- function updataMarkerByTeam(markerId,obj){
- wg.updateMarker(markerId,obj) ;//修改Marker点
- } ;
- ///**
- // * 轨迹点生成
- // * @param e 一组坐标点,4个参数,x坐标 y坐标 afterX坐标 afterY坐标
- // * @param markerId 要闪动的Marker点ID
- // * @param iconStr 队伍开始图标(大概分两种:起点和地点)
- // * @param icon 展示在地图上的Marker图标
- // */
- //function tracing(e,markerId,iconStr,icon,layTrac,ls){
- // for(var xy in e["points"]){
- //
- // if(e["points"][xy].x==e["points"][xy].afterX && e["points"][xy].y==e["points"][xy].afterY){
- // //1.判断是不是起点,如果是起点则添加起点坐标
- // var obj = {layerName:layTrac,posX:e["points"][xy].x,posY:e["points"][xy].y,icon:iconStr,clickable:true} ;
- // wg.addMarker(obj) ;
- //
- // obj = {layerName:layTrac,posX:e["points"][xy].x,posY:e["points"][xy].y,icon:icon,clikable:true,"title":e["inciName"]+":"+e["teamName"]} ;
- // markerId = wg.addMarker(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 obj = {layerName:layTrac,posX:e["points"][xy].x,posY:e["points"][xy].y} ;
- // var ma = [{"markerId":markerId,"obj":obj}] ;
- // updataMarkers(ma) ;
- // //wg.updateMarker(markerId,obj) ;//修改Marker点
- //
- //} ;
- //} ;
- //$(function(){
- // var handler = function(){
- //
- // }
- //
- // var timer = setInterval( handler , 5000); //每5秒调用一次方法
- //
- //// var clear = function(){
- //// clearInterval(timer); //清理时间
- //// }
- //});
- ///**
- // * 生成蒙版
- // */
- //function addMB()
- //{
- // wg.addShapeLayer("drowMB",3,20,1,1) ;
- // var mbX1 = 74.715473234801 ;
- // var mbY1 = 38.3054642623949 ;
- //
- // var mbX2 = 128.12832740766 ;
- // var mbY2 = 38.3391764467111 ;
- //
- // var mbX3 = 128.12832740766 ;
- // var mbY3 = 12.5481452374991 ;
- //
- // var mbX4 = 74.7584441552822 ;
- // var mbY4 = 12.5481452374991 ;
- //
- // var geoObj = {points:[{x:mbX1,y:mbY1},{x:mbX2,y:mbY2},{x:mbX3,y:mbY3},{x:mbX4,y:mbY4}]};
- //
- // var lineStyle2 = {"strokeColor": [0, 0, 0, 255],"strokeWeight":1.5,strokeStyle:'dashed',
- // opacity:0.5,fillColor:[0, 0, 0, 255]};
- // wg.addPolygon("drowMB",geoObj,lineStyle2,"蒙板");
- //};
- /**
- * @param 初始化加载的数据表格
- * @version 1.0
- * @Date 2015-09-26
- */
- function onloadinitgrid()//****
- {
- if ((window.location.href).indexOf('?') > -1)
- {
- var fd = (window.location.href).split('?')[1];
- paramsGridChange[fd] = quilayoutpages.getColumnsAndaddLayers(fd,paramsGird[fd]) ;//****
- }
- };
-
-
- function changeGridFun(fd,changeParamsGird){//****
- alert("222:"+paramsGridChange[fd]);
- quilayoutpages.changeGridData(paramsGridChange[fd],changeParamsGird) ;//****
- // quilayoutpages.getColumnsAndaddLayers(fd,changeParamsGird) ;//****
-
- } ;
-
- /**
- * @param 弹出右键面板的同时获取右键菜单的ID
- * @version 1.0
- * @Date 2015-09-26
- */
- function OnRightClick(event, treeId, treeNode)
- {
- if(treeNode && !treeNode.noR)
- {
- zTree.selectNode(treeNode);
- showRMenu(treeNode.menuType, event.clientX, event.clientY);
- //右键得到点击的ID
- RightMenuId = treeNode.id;
- Rightflag=treeNode.checked;
- }
- };
-
- /**
- * @param 显示右键面板中的菜单内容
- * @version 1.0
- * @Date 2015-09-26
- */
- function showRMenu(type, x, y)
- {
- quilayoutpages.ShowRightMeun(type, x, y);
- };
- ///**
- // * @param 右键菜单中的全选功能
- // * @version 1.0
- // * @Date 2015-09-26
- // */
- // function fullOpt(checked)
- // {
- // quilayoutpages.Rfullopt(checked);
- // quilayoutpages.hideRMenu();
- // };
-
- /**
- * @param 右键菜单中查看数据表格的功能
- * @version 1.0
- * @Date 2015-09-26
- */
- // function opendatatable()
- // {
- // $("#tabTitle").show();
- // //右键查看数据表的时候更换数据表的标题名称
- // quilayoutpages.getRightTitles(RightMenuId);
- // //右键更换数据表选项卡的名称
- // quilayoutpages.getPageTitle(RightMenuId);
- // };
- /**
- * @param 右键菜单中的打开查询面板功能
- * @version 1.0
- * @Date 2015-09-26
- */
- function openGISfind()
- {
- wg.openQueryNameUI("","");
-
- };
- /**
- * @param 关闭数据表
- */
- function closedatatable()
- {
- /*$("#tabTitle").css("display","none");*/
- $("#tabTitle").hide();
- }
- /**
- * @param 查看统计专题图
- * @version 1.0
- * @Date 2015-09-26
- */
- // function openspecial()
- // {
- // lookspecial(RightMenuId);
- // };
- /**
- * @param 右键菜单中缩放到图层功能
- * @version 1.0
- * @Date 2015-09-26
- */
- function zoomtolayer()
- {
- zoomToLayer(RightMenuId);
- quilayoutpages.hideRMenu();
- };
- /**
- * @param 鼠标点击复选框传点击参数
- * @version 1.0
- * @Date 2015-09-26
- */
- function onCheckID(event, treeId, treeNode)
- {
- appendMenuid("onCheck", treeNode.id, treeNode.checked);
- };
- /**
- * @param 左键点击选中树形复选框并获取ID和选中状态
- * @version 1.0
- * @Date 2015-09-26
- */
- function appendMenuid(eventName, nodeId, nodechecked){
-
- //得到子菜单id
- menuID=nodeId;
- //得到当前的选中状态
- menuCheck=nodechecked;
- if(menuCheck==true)
- {
- //显示id所对应的grid表头
- //quilayoutpages.getPageTitle(menuID);
- //点击更换表格标题
- //quilayoutpages.getRightTitles(menuID);
- addlayers(menuID);
- }
- else
- if(menuCheck==false)
- {
- removeallmarkers(menuID);
- }
- if(menuID==41)
- {
- $("#erTool").toggle();
- }
- };
- /*---------------------------------加载图层----------------------------------------------------------*/
- /**
- * @param 根据获取的每一个ID去加载图层
- * @version 1.0
- * @Date 2015-09-26
- */
- function addlayers(menuID)
- {
- if(tokens==null || pasrids==null){
- // alert("请您登录地图后在使用");
- 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 "13":
- // Rainstorm();
- alert("界面集成,缺少URL");
- return false ;
- //冰灾图层
- case "14":
- // IceDamage();
- alert("界面集成,缺少URL");
- return false ;
- // //地震图层
- // case "15":
- //// Earthquake();
- // alert("界面集成,缺少URL");
- // return false ;
- // //山火图层
- // case "16":
- //// VegetationFire();
- // alert("界面集成,缺少URL");
- // return false ;
- //应急预警与响应图层
- case "21":
-
- // var userInfo = resolveUrl() ;
- // var userDeptID = userInfo["dept_id"] ;
- // var subDept = getSubDept(userDeptID) ;
- var date = allGetServerTime() ;
- var beginTime = getThreeMonthsAgo(getNowFormatDate(date)) ;
- var endTime = getNowFormatDate(allGetServerTime()) ;
- var paramsProvEw = {
- RELEASE_UNIT : subDept["prov"]+"",//单位
- BEGINTIME : beginTime ,//开始时间
- ENDTIME : endTime //截止时间
- } ;
- var paramsProvEr = paramsProvEw ;
- var paramsPrefEw = {
- RELEASE_UNIT : subDept["pref"]+"",//单位
- BEGINTIME : beginTime ,//开始时间
- ENDTIME : endTime //截止时间
- } ;
- var paramsPrefEr = paramsPrefEw ;
- Emergencyearlywarningandresponse(paramsProvEw,paramsPrefEw,paramsProvEr,paramsPrefEr);
- // Emergencyearlywarningandresponse(null,null);
- // addEMMarkerEvent();
- return true ;
- //应急资源图层
- case "41":
- emergencyresource();
- // $("#erToolWin").show();
- // quilayoutpages.openERdrowTool();
- return true ;
-
- // //线路跳闸与变电站停运图层
- // case "31":
- // var ltsoVolLevelUrl = "/nwyj/ws/cockpit/CockpitService/queryVolLevelStr" ;
- // var volelel = getStrData(ltsoVolLevelUrl,null) ;
- //
- //
- // lttParams = {voltageClass:volelel,status:"1"} ;
- // ltfParams = {voltageClass:volelel,status:"0"} ;
- // Linetrippingandsubstation(lttParams,ltfParams,null,null);
- // break ;
- // //线路覆冰图层
- // case "51":
- // lineregelation();
- // addLineiceEvent();
- // break ;
- //设备损失图层
- case "61":
- // EquipmentLoss();
- alert("界面集成,缺少URL");
- return false ;
- //用户停电图层
- case "71":
- // UserOutage();
- alert("界面集成,缺少URL");
- return false ;
- }
- }
-
- };
- /*---------------------------------------------------------------删除图层---------------------------------------------*/
- /**
- * @param 根据获取的每一个ID删除
- * @version 1.0
- * @Date 2015-09-28
- */
- //function removeallmarkers()
- //{
- // switch(menuID){
- function removeallmarkers(id){
- switch(id){
- //日常气象 图层
- case "11":
- Dailyweather(false);
- break ;
- //台风图层
- case "12":
- Typhoon(false);
- break ;
- //暴雨图层
- case "13":
- //alert("删除13");
- break ;
- //冰灾图层
- case "14":
- //alert("删除14");
- break ;
- //地震图层
- case "15":
- //alert("删除15");
- break ;
- //山火图层
- case "16":
- //alert("删除16");
- break ;
- //应急预警与响应图层
- case "21":
- closeEmergencyearlywarningandresponse();
- break ;
- //应急资源图层
- case "41":
- closeemergencyresource();
- break ;
-
- // //线路跳闸与变电站停运图层
- // case "31":
- // HighlightPSRs();
- // removeCustomButton();
- // break ;
- // //线路覆冰图层
- // case "51":
- // //HighlightPSRs();
- // //closeLineiceEvent();
- // break ;
- //设备损失图层
- case "61":
- break ;
- //用户停电图层
- case "71":
- break ;
- }
- };
- /*-------------------------------------------以下是图层右键菜单中的功能------------------------------------------------------*/
- ///**
- // * @param 打开查询面板
- // * @version 1.0
- // * @Date 2015-11-11
- // */
- //function openfinds(menuID)
- //{
- // switch(menuID){
- // //日常气象 图层
- // case 11:
- // if(Rightflag==true)
- // {
- // //这个方法是打开GIS地图中的查询面板,自己做的查询面板替换即可
- // openGISfind();
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // break ;
- // //台风图层
- // case 12:
- // if(Rightflag==true)
- // {
- // openGISfind();//这个方法是打开GIS地图中的查询面板,自己做的查询面板替换即可
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // break ;
- // //暴雨图层
- // case 13:
- // if(Rightflag==true)
- // {
- // openGISfind();//这个方法是打开GIS地图中的查询面板,自己做的查询面板替换即可
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // break ;
- // //冰灾图层
- // case 14:
- // if(Rightflag==true)
- // {
- // openGISfind();//这个方法是打开GIS地图中的查询面板,自己做的查询面板替换即可
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // break ;
- // //地震图层
- // case 15:
- // if(Rightflag==true)
- // {
- // openGISfind();//这个方法是打开GIS地图中的查询面板,自己做的查询面板替换即可
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // break ;
- // //山火图层
- // case 16:
- // if(Rightflag==true)
- // {
- // openGISfind();//这个方法是打开GIS地图中的查询面板,自己做的查询面板替换即可
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // break ;
- // //应急预警与响应图层
- // case 21:
- // if(Rightflag==true)
- // {
- // $("#ewerWin").floatPanelOpen();
- //// frmcontent.window.ewErShow() ;
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // break ;
- // //线路跳闸与变电站停运图层
- // case 31:
- // if(Rightflag==true)
- // {
- // $("#ltsoWin").floatPanelOpen();
- //// frmcontent.window.ltSoShow() ;
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // break ;
- // //应急资源图层
- // case 41:
- // if(Rightflag==true)
- // {
- //// $("#investmentWin").floatPanelOpen();
- //// frmcontent.window.investmentShow() ;
- // $("#erToolWin").show();
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // break ;
- // //线路覆冰图层
- // case 51:
- // if(Rightflag==true)
- // {
- // openGISfind();//这个方法是打开GIS地图中的查询面板,自己做的查询面板替换即可
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // break ;
- // //设备损失图层
- // case 61:
- // if(Rightflag==true)
- // {
- // openGISfind();//这个方法是打开GIS地图中的查询面板,自己做的查询面板替换即可
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // break ;
- // //用户停电图层
- // case 71:
- // if(Rightflag==true)
- // {
- // openGISfind();//这个方法是打开GIS地图中的查询面板,自己做的查询面板替换即可
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // break ;
- // }
- //};
- function openfind()
- {
- openfinds(RightMenuId);
- quilayoutpages.hideRMenu();
- };
-
-
- ///**
- //* @param 右键菜单中查看数据表格的功能
- //* @version 1.0
- //* @Date 2015-11-11
- //*/
- //function opendatatable()
- // {
- // if(Rightflag==true)
- // {
- // $("#tabTitle").show();
- // //右键查看数据表的时候更换数据表的标题名称
- // quilayoutpages.getRightTitles(RightMenuId);
- // //右键更换数据表选项卡的名称
- // quilayoutpages.getPageTitle(RightMenuId);
- // quilayoutpages.hideRMenu();
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // };
-
- /**
- * @param 右键菜单中查看数据表格的功能
- * @version 1.0
- * @Date 2015-11-11
- */
- function opendatatable(id)
- {
-
-
- /*var gw = $("body").width()-283;
- var fd = gw+"px";
- $("#centermap").css({width:fd}); */
-
- /*if($("#leftceladows").is(":visible")){
- var gw = $("body").width()-283-300;
- var fd = gw+"px";
- $("#centermap").css({width:fd});
- } else {
- var gw = $("body").width()-300;
- var fd = gw+"px";
- $("#centermap").css({width:fd});
- }*/
- $("#tabTitle").show();
- //右键查看数据表的时候更换数据表的标题名称
- // quilayoutpages.getRightTitles(id);
- //右键更换数据表选项卡的名称
- quilayoutpages.getPageTitle(id);
- quilayoutpages.hideRMenu();
- };
-
- ///**
- // * @param 打开图例
- // * @version 1.0
- // * @Date 2015-11-11
- // */
- // function openlegend()
- // {
- // if(Rightflag==true)
- // {
- // $("#openLegend").show();
- // addLegendTodiv(RightMenuId);
- // quilayoutpages.hideRMenu();
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // };
-
- /**
- * @param 打开图例
- * @version 1.0
- * @Date 2015-11-11
- */
- function openlegend(id){
- var pageHeight = getGridHieght() + 30 + 24 ;
- $("#openLegend").show();
- $("#openLegend").height(pageHeight) ;
- addLegendTodiv(id);
- quilayoutpages.hideRMenu();
- };
- /**
- * @author
- * @param 通过ID打开响应的图例
- * @version 1.0
- * @Date 2015-11-11
- */
- function addLegendTodiv(menuID)
- {
- $("#openLegend").empty();
- var iframe = document.createElement("iframe");
- iframe.style.width = "100%";
- iframe.style.height = "100%";
- iframe.setAttribute('frameborder', '0',0);
- iframe.src="/nwyj/page/cockpit/legend/"+menuID+".html";
- document.getElementById("openLegend").appendChild(iframe);
-
- }
- /**
- * @param 关闭图例
- * @version 1.0
- * @Date 2015-11-11
- */
- function closelegend(){
- $("#openLegend").hide();
- };
- /**
- * @param 查看统计专题图
- * @version 1.0
- * @Date 2015-10-18
- */
- /*function lookspecial(menuID)
- {
- switch(menuID){
- //日常气象 图层
- case 11:
- if(Rightflag==true)
- {
- alert("正在建设中。。。");
- }
- else
- {
- alert("未加载该图层");
- }
- break ;
- }
- };*/
- ///**
- // * @param 缩放到图层功能
- // * @version 1.0
- // * @Date 2015-10-14
- // */
- //function zoomToLayer(menuID)
- //{
- // switch(menuID){
- // //日常气象 图层
- // case 11:
- // if(Rightflag==true)
- // {
- // zoomToCoordList(coords);
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // break ;
- // //台风图层
- // case 12:
- // if(Rightflag==true)
- // {
- // zoomToCoordList(coords);
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // break ;
- // //暴雨图层
- // case 13:
- // if(Rightflag==true)
- // {
- // zoomToCoordList(coords);
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // break ;
- // //冰灾图层
- // case 14:
- // if(Rightflag==true)
- // {
- // zoomToCoordList(coords);
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // break ;
- // //地震图层
- // case 15:
- // if(Rightflag==true)
- // {
- // zoomToCoordList(coords);
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // break ;
- // //山火图层
- // case 16:
- // if(Rightflag==true)
- // {
- // zoomToCoordList(coords);
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // break ;
- // //应急预警与响应图层
- // case 21:
- // if(Rightflag==true)
- // {
- // zoomToCoordList(em_coords);
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // break ;
- // //线路跳闸与变电站停运图层
- // case 31:
- // if(Rightflag==true)
- // {
- // wg.setZoomAndCenter(gdX,gdY,13) ;
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // break ;
- // //应急资源图层
- // case 41:
- // if(Rightflag==true)
- // {
- // wg.zoomToPSR("9030357001559537801",13) ;
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // break ;
- // //线路覆冰图层
- // case 51:
- // if(Rightflag==true)
- // {
- // zoomToCoordList(ice_coords);
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // break ;
- // //设备损失图层
- // case 61:
- // if(Rightflag==true)
- // {
- // zoomToCoordList(coords);
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // break ;
- // //用户停电图层
- // case 71:
- // if(Rightflag==true)
- // {
- // zoomToCoordList(coords);
- // }
- // else
- // {
- // alert("未加载该图层");
- // }
- // break ;
- // }
- //};
-
- /**
- * @param 缩放到图层功能
- * @version 1.0
- * @Date 2015-10-14
- */
- function zoomToLayer(id)
- {
- var pointArr = [] ;
- pointArr = zoomTier["\"" + id + "\""] ;
- if(pointArr){
- zoomToCoordList(pointArr);
- }else{
- wg.fullExtent() ;
- }
- };
- /*-------------------------------------------以上是图层右键菜单中的功能------------------------------------------------------*/
- /**
- * @param 加载日常气象图层
- * @version 1.0
- * @Date 2015-09-26
- */
- function Dailyweather(isFlat)
- {
- wg.openWeatherFuc(isFlat);
- };
- /**
- * @param 加载台风图层
- * @version 1.0
- * @Date 2015-09-26
- */
- function Typhoon(isFlat)
- {
- wg.openTyphoonFuc(isFlat);
- };
- /**
- * @param 加载暴雨图层
- * @version 1.0
- * @Date 2015-09-26
- */
- function Rainstorm()
- {
- alert("界面集成,缺少URL");
- fullOpt(false);
- };
- /**
- * @param 加载冰灾图层
- * @version 1.0
- * @Date 2015-09-26
- */
- function IceDamage()
- {
- alert("界面集成,缺少URL");
- fullOpt(false);
- };
- /**
- * @param 加载地震图层
- * @version 1.0
- * @Date 2015-09-26
- */
- function Earthquake()
- {
- alert("界面集成,缺少URL");
- fullOpt(false);
- };
- /**
- * @param 加载山火图层
- * @version 1.0
- * @Date 2015-09-26
- */
- function VegetationFire()
- {
- alert("界面集成,缺少URL");
- fullOpt(false);
- };
- /**
- * @param 加载设备损失图层
- * @version 1.0
- * @Date 2015-09-26
- */
- function EquipmentLoss()
- {
- alert("界面集成,缺少URL");
- fullOpt(false);
- };
- /**
- * @param 加载用户停电图层
- * @version 1.0
- * @Date 2015-09-26
- */
- function UserOutage()
- {
- alert("界面集成,缺少URL");
- fullOpt(false);
- };
- /**
- * @param 加载线路覆冰图层
- * @version 1.0
- * @Date 2015-10-11
- */
- function lineregelation()
- {
- //zoomToCoordList(ice_coords);
- //wg.addHighlightPSR(ice_lineNArrs,'#00F');
- alert("界面集成,缺少URL");
- } ;
- /**
- * @param 加载应急预警与响应图层
- * @version 1.0
- * @Date 2015-09-26
- */
- //function Emergencyearlywarningandresponse(paramsEw,paramsEr)
- function Emergencyearlywarningandresponse(paramsProvEw,paramsPrefEw,paramsProvEr,paramsPrefEr)
- {
- //新建应急预警与响应图层
- addLayer(ewer_lay1,4,6,1,1);
- addLayer(ewer_lay2,6,14,1,1);
-
- var pointPre = [] ;
- var pointPro = [] ;
-
- //查询应急预警图标(地市级)
- // var url ="/nwyj/ws/cockpit/CockpitService/getEwMarkerByPrefecture";
- // pointPre = pointPre.concat(searchMarkerToEwer(url,paramsEw,true,ewer_lay2)) ;
- var url ="/nwyj/ws/cockpit/CockpitService/getEwMarker";
- pointPre = pointPre.concat(searchMarkerToEwer(url,paramsPrefEw,true,ewer_lay2)) ;
- //应急响应查询(地市级)
- // url ="/nwyj/ws/cockpit/CockpitService/getErMarkerPrefecture";
- // pointPre = pointPre.concat(searchMarkerToEwer(url,paramsEr,true,ewer_lay2)) ;
- url ="/nwyj/ws/cockpit/CockpitService/getErMarker";
- pointPre = pointPre.concat(searchMarkerToEwer(url,paramsPrefEr,true,ewer_lay2)) ;
-
- //查询应急预警图标(网省级)
- // var url ="/nwyj/ws/cockpit/CockpitService/getEwMarkerByProvince";
- // pointPro = pointPro.concat(searchMarkerToEwer(url,paramsEw,true,ewer_lay1)) ;
- var url ="/nwyj/ws/cockpit/CockpitService/getEwMarker";
- pointPro = pointPro.concat(searchMarkerToEwer(url,paramsProvEw,true,ewer_lay1)) ;
- //应急响应查询(网省级)
- // url ="/nwyj/ws/cockpit/CockpitService/getErMarkerByProvince";
- // pointPro = pointPro.concat(searchMarkerToEwer(url,paramsEr,true,ewer_lay1)) ;
- url ="/nwyj/ws/cockpit/CockpitService/getErMarker";
- pointPro = pointPro.concat(searchMarkerToEwer(url,paramsProvEr,true,ewer_lay1)) ;
- if(pointPro.length != 0){
- zoomToCoordList(pointPro) ;
- mz_ewer = pointPro ;
- // wg.fullExtent() ;
- zoomToCoordList(pointPro) ;
- } else if(pointPre.length != 0){
- zoomToCoordList(pointPre) ;
- mz_ewer = pointPre ;
- } else {
- ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据");
- ai.createAlert();
- }
- addEMMarkerEvent();
- };
-
- /**
- * 应急预警和响应图标查询
- * @param url 查询路径
- * @param params 查询条件
- * @param flg 图标是否可点击Boolean
- * @param lay 显示图层
- * @returns {Array} 返回图标坐标数组
- */
- function searchMarkerToEwer(url,params,flg,lay){
- var ewJsonData = getJsonData(url,params) ;
- var poinArr = [] ;
- for(var key in ewJsonData){
- poinArr.push(ewJsonData[key]["posX"]) ;
- poinArr.push(ewJsonData[key]["posY"]) ;
- }
- ewJsonData = addEwrAttr(ewJsonData,flg,lay) ;
- addResourceIco(ewJsonData);//添加图标
-
- return poinArr ;
- }
- /**
- * XY定位
- * @param data 后台返回的结果
- * @param x 坐标对应的经度key
- * @param y 坐标对应的纬度key
- * @returns {Array} 返回图标坐标数组
- */
- function poinXY(data,x,y){
- var poinArr = [] ;
- for(var key in data){
- poinArr.push(data[key][x]) ;
- poinArr.push(data[key][y]) ;
- }
- return poinArr ;
- }
- /**
- *@param 查询数据库中的应急预警与响应的字段
- *@version 1.0
- *@Date 2015-10-30
- */
- function findDB_Emergencyearlywarningandresponse()
- {
-
- }
- /**
- * @param 取消显示应急预警与响应图层
- * @version 1.0
- * @Date 2015-09-26
- */
- function closeEmergencyearlywarningandresponse()
- {
- delLayer(ewer_lay1);
- delLayer(ewer_lay2);
- removeEvent("onMarkerClicked") ;
- };
- /**
- * @param 应急预警与响应图标的点击事件
- * @version 1.0
- * @Date 2015-09-28
- */
- function addEMMarkerEvent(){
- // wg.addEvent('onMarkerClicked',callEmergencyearlywarningandresponse);
- wg.addEvent('onMarkerClicked',openEarlywarningnotice);
- };
- /**
- *@param 点击应急预警与响应图标弹出通知单
- *//*
- function callEmergencyearlywarningandresponse(e){
- openEarlywarningnotice(e);
- };*/
- /**
- * @param 弹出应急预警响应通知单
- * @version 1.0
- * @Date 2015-09-26
- * @upDate
- */
- function openEarlywarningnotice(e)
- {
- if( e["extraData"]["IS_ALERT"] == '1'){
- window.open('/nwyj/page/business/em/response/emergencyResponse/CopyWarningView.jsp?fd_id=' + e["extraData"]["FD_OBJECTID"] );
- } else {
- window.open('/nwyj/page/business/em/alert/warning/CopyWarningView.jsp?fd_id=' + e["extraData"]["FD_OBJECTID"] );
- }
-
- };
- /**
- * @param 应急仓库图标的点击事件
- * @version 1.0
- * @Date 2015-09-28
- */
- function addHouseMarkerEvent(){
- // wg.addEvent('onMarkerClicked',callEmergencyearlywarningandresponse);
- wg.addEvent('onMarkerClicked',openHouseInfo);
- };
- /**
- * @param 弹出应急预警响应通知单
- * @version 1.0
- * @Date 2015-09-26
- * @upDate
- */
- function openHouseInfo(e)
- {
- window.open('/nwyj/page/cockpit/webgis/wareHouseInfo.jsp?' + e["extraData"]["FD_OBJECTID"] );
- };
- var erFlagPref = {} ;
- var erFlagProv = {} ;
- /**
- * @param 加载应急资源图层
- * @version 1.0
- * @Date 2015-09-26
- */
- function emergencyresource()
- {
- openDarwAddEvent() ;
- // wg.zoomToPSR(id,13) ;//定位到指定设备(事件发生的终点站等)并设置缩放等级
- addLayer(lay1,5,21,1) ;//添加图标图层(系统)
- addLayer(lay2,5,21,1) ;//添加自定义图标图层(绘图面板)
- addLayer(lay3,5,21,1) ;//添加自定义图标图层(绘图面板转换后)
- // addLayer(lay4,5,21,1) ;//添加自定义图标图层(应急队伍图层)
- // addLayer(lay5,5,21,1) ;//添加自定义图标图层(应急队伍图层)
- // ==========================================================================================================================
- var pointProv = [] ;//网省级图标坐标组
- var pointPref = [] ;//地市级图标坐标组
- var point = [] ;
- var url ="/nwyj/ws/cockpit/CockpitService/queryMareHouse";
- erIcons = getJsonData(url,null);
- point = point.concat(poinXY(erIcons,"posX","posY")) ;
- zoomToCoordList(point) ;
- pointPref = pointPref.concat(poinXY(erIcons,"posX","posY")) ;
- erIcons = addErAttr(erIcons,er_storageIcon,true,lay1) ;
- addResourceIco(erIcons) ;//添加应急资源仓库图标
- addHouseMarkerEvent() ;
- // addResourceInfoWin(infoWins) ;//给物资添加信息窗
-
- var date = allGetServerTime() ;
- var beginTime = getThreeMonthsAgo(getNowFormatDate(date)) ;
- var endTime = getNowFormatDate(allGetServerTime()) ;
- params = { INNECTID:'1' } ;
- url ="/nwyj/ws/cockpit/CockpitService/queryErMarker" ;//网省级应急资源标注查询
- params = {classid : 265, unitId : subDept["prov"]+"", startDate : beginTime, endDate : endTime} ;
- erFlagProv = getJsonData(url,params) ;
-
- url ="/nwyj/ws/cockpit/CockpitService/queryErMarker" ;//地市级应急资源标注查询
- params = {classid : 265, unitId : subDept["pref"]+"", startDate : beginTime, endDate : endTime} ;
- erFlagPref = getJsonData(url,params) ;
-
-
- if(erFlagPref){
- var posXArr = [] ;
- var posYArr = [] ;
- for(var key in erFlagPref){
- posXArr.push(erFlagPref[key]["x"]) ;
- posYArr.push(erFlagPref[key]["y"]) ;
- }
- var radiu = zoomToExtent(posXArr,posYArr) ;
- var rad = getErRadius(radiu) ;
- drawResource(erFlagPref,1,rad["ra"],rad["ds"]) ;//####
- // drawResource(res,1,600,1) ;//####
- // drawResource(erFlagPref,1,600,1) ;//添加资源标注(地市级)
- pointPref = pointPref.concat(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 = zoomToExtent(posXArr,posYArr) ;
- var rad = getErRadius(radiu) ;
- drawResource(erFlagProv,0,rad["ra"],rad["ds"]) ;//####
- /*drawResource(erFlagProv,0,90000,150) ;//添加资源标注(网省级)
- wg.fullExtent() ;*/
- pointProv = pointProv.concat(poinXY(erFlagProv,"x","y")) ;
- mz_er = pointProv ;
- zoomToCoordList(pointProv) ;
- } else {
- zoomToCoordList(pointPref) ;
- mz_er = pointPref ;
- // setZoomLevel(7) ;
- } ;
-
- wg.addEvent("onMapExtentChanged",mapChanged);
- };
- function mapChanged(e){
- delLayer("pref1") ;
- delLayer("pref2") ;
- delLayer("pref3") ;
- delLayer("prov1") ;
- delLayer("prov2") ;
- delLayer("prov3") ;
- var zl = e["zoomLevel"] ;
- var rad = getErRadius(zl) ;
- if(zl>=8){
- drawResource(erFlagPref,1,rad["ra"],rad["ds"]) ;//####
- } else {
- drawResource(erFlagProv,0,rad["ra"],rad["ds"]) ;//####
- }
-
- }
- function setZoomLevel(level){
- wg.setZoomLevel(level) ;
- }
- /**
- * 应急资源标注json格式其它参数
- * @param jsonStr 从数据库中读取出来的json属性
- * @param icon 图标
- * @param clickable 图标是否可以点击
- * @param lay 图层名
- */
- function addErAttr(jsonStr,icon,clickable,lay){
- // alert(JSON.stringify(jsonStr));
- for(var key in jsonStr){
- jsonStr[key] = addJsonAttribute(jsonStr[key],"icon",icon);
- jsonStr[key] = addJsonAttribute(jsonStr[key],"clickable",clickable);
- jsonStr[key] = addJsonAttribute(jsonStr[key],"layerName",lay);
- }
- return jsonStr ;
- };
- /**
- * 应急预警与响应标注json格式其它参数
- * @param jsonStr 从数据库中读取出来的json属性
- * @param clickable 图标是否可以点击
- * @param lay 图层名
- */
- function addEwrAttr(jsonStr,clickable,lay){
-
- for(var key in jsonStr){
- var lev = jsonStr[key]["level"] ;
- jsonStr[key] = addJsonAttribute(jsonStr[key],"clickable",clickable);
- jsonStr[key] = addJsonAttribute(jsonStr[key],"layerName",lay);
- jsonStr[key] = addJsonAttribute(jsonStr[key],"icon",level[lev]);
- }
- return jsonStr ;
- }
- /**
- * json格式添加属性
- * @param jsonStr
- */
- function addJsonAttribute(jsonStr,key,value){
- $(jsonStr).attr(key,value) ;
- return jsonStr ;
- };
- /**
- * @param 取消显示应急资源图层
- * @version 1.0
- * @Date 2015-09-26
- */
- function closeemergencyresource()
- {
- $("#erToolWin").hide();
- delLayer(lay1) ;
- delLayer(lay2) ;
- delLayer(lay3) ;
- delLayer(lay4) ;
- delLayer(lay5) ;
- // delLayer(lay6) ;
- addLayer(lay3,5,21,1) ;
- delShapes(lay3) ;
- delLayer("pref1") ;
- delLayer("pref2") ;
- delLayer("pref3") ;
- delLayer("prov1") ;
- delLayer("prov2") ;
- delLayer("prov3") ;
- removeEvent("onShapeDrawnCompleted") ;
- removeEvent("onMarkerClicked") ;
- removeEvent("onMapExtentChanged") ;
- removeEvent("onGetPointEvent") ;
- };
- function removeEvent(eventName){
- wg.removeEvent(eventName) ;
- }
- /**
- * 单击打开应急资源投入查询面板
- */
- function resourceInvestment()
- {
- quilayoutpages.resourceInvestment() ;
- // frmcontent.window.ewErShow() ;
-
- // quilayoutpages.resourceInvestment() ;
- // frmcontent.window.investmentShow() ;
- };
- /**
- * 单击打开设备列表图标事件
- */
- function listFun()
- {
- quilayoutpages.listFun() ;
- };
- /**
- * 单击打开绘图工具栏图标事件
- */
- function toolFun()
- {
- quilayoutpages.toolFun() ;
- };
- /**
- * @param 打开应急预警与响应图例
- * @version 1.0
- * @Date 2015-10-13
- */
- //function openlegend()
- //{
- // EmergencyearlywarningandresponseLegend(RightMenuId);
- //}
- ///**
- // * @param 打开展示应急预警与响应图例的html界面
- // * @version 1.0
- // * @Date 2015-10-13
- // */
- //function EmergencyearlywarningandresponseLegend(rightid)
- //{
- // var path =pathCon+"Legend.html?"+rightid;
- // var obj = { posX: 400, posY: 100, sizeWidth: 222, sizeHeight: 166, content: path, iconPosition: "right" };
- // wg.openFloatWindow(obj);
- //};
- ///**
- // * @param 线路覆冰中添加线路点击事件
- // * @version 1.0
- // * @Date 2015-10-12
- // */
- //function addLineiceEvent()
- //{
- // wg.addEvent('onPSRClicked',callPsrID);
- //};
- ///**
- // * @param 取消设备点击事件
- // * @version 1.0
- // * @Date 2015-10-12
- // */
- //function closeLineiceEvent()
- //{
- // wg.removeEvent('onPSRClicked');
- //};
- ///**
- // *@param 获取覆冰线路,得到ID,根据ID弹出信息框
- // */
- //function callPsrID(e)
- //{
- // for(var key in e)
- // {
- // if(key == 'psrID')
- // {
- // var psrid = e[key];
- // for(var key in ice_lineNArrs)
- // {
- // if(ice_lineNArrs[key]==psrid)
- // {
- // var path =pathCon+"LineIceInfo.html";
- // var obj = { posX: 400, posY: 100, sizeWidth: 320, sizeHeight: 168, content: path, iconPosition: "right" };
- // wg.openFloatWindow(obj);
- // }
- // }
- // }
- // }
- //};
- /**
- * 添加一组坐标生成折线
- * @param erPath
- */
- function addResourcePath(erPath){
- for(var transfer in erPath){
- wg.addPolyLine(erPath[transfer].layerName,erPath[transfer].points,erPath[transfer].lineStyle,erPath[transfer].title);
- };
- } ;
- /**
- * 应急资源的圆形标注 因为是用添加圆形方法画的标注,所以此标注会随着地图的放大缩小而改变,所以设置了它的显示级别为13到15
- * @param erFlag: 一组资源标注信息json格式,x、y坐标以及三个标注的数量信息,顺序分别是:本地、外地和缺口
- * @param level: 网省地县标识,0为网省级 1为地市级
- * @param crad: 圆形半径
- * @param bs: 圆与圆的差距
- */
- function drawResource(erFlag,level,crad,bs)
- {
- var c1,c2,c3 = "";
-
- if(level==0){//网省级
- c1 = "prov1" ;
- c2 = "prov2" ;
- c3 = "prov3" ;
-
- addLayer(c1,4,8,1);
- addLayer(c2,4,8,1);
- addLayer(c3,4,8,1);
-
- } else { //地市级
- c1 = "pref1" ;
- c2 = "pref2" ;
- c3 = "pref3" ;
-
- addLayer(c1,7,14,1);
- addLayer(c2,7,14,1);
- addLayer(c3,7,14,1);
-
- }
-
- var circelStyleNative = circelStyle([128,128,128,0],1,1,[93,152,226,255]) ;
- var circelStyleOther = circelStyle([128,128,128,0],1,1,[129,158,67,255]) ;
- var circelStyleInsufficiency = 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"} ;
- wg.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]};
- wg.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"} ;
- wg.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]};
- wg.addText(c2,objt2,textStyle1,"备注");
-
- //缺口资源标注圆
- ey -= 0.0044 * bs ;
- ex += 0.001 * bs ;
- rad += 200 * bs ;
- var objc3 = {points:{x:ex,y:ey},radius:rad};
- wg.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]};
- wg.addText(c3,objt3,textStyle1,"备注");
- };
- // wg.addEvent("onShapeClicked",clickByRa);
- };
- //function clickByRa(e){
- // var s = "";
- // for(var key in e){
- //
- // s+=key+":"+e[key];
- // alert(key + " : " + e[key]) ;
- //
- // }
- // alert(s);
- //}
- /**
- * 通过参数返回要添加的圆形的style
- * @param sColor:边的颜色 如:[255,255,255,0]
- * @param sWeight:线条宽度或者多边形边线宽度 number
- * @param op:填充透明度0-1
- * @param fColor:填充颜色 如:[255, 165, 0, 255]
- * @returns {___anonymous7663_7736}
- */
- function circelStyle(sColor,sWeight,op,fColor)
- {
- var circelStyle = {"strokeColor": sColor,"strokeWeight":sWeight,opacity:op,fillColor:fColor};
- return circelStyle ;
- };
- /**
- * 启动折线
- */
- function openDrawPolylineTool() {
- wg.openDrawPolylineTool(lay2,lineStyle);
- };
- //启动图形完成事件
- //function dropaddEvent(){
- // wg.addEvent("onShapeDrawnCompleted",callBack);
- //}
- //function callBack(e){
- // var s = "";
- // for(var key in e){
- // if(key == "geoID"){
- // var menuArr = [{ "Key": "3","Name": "测试"},{ "Key": "1","Name": "基本操作","SubMenus": [ { "Key": "1-1","Name": "全图" } ]},{ "Key": "2","Name": "test","SubMenus": [ { "Key": "2-1","Name": "test" } ]}];
- // var funArr = [{"key":"1-1",fun:"fullExt()"},{"key":"3",fun:"test()"}];
- // wg.addContextMenu(lay2,menuArr,funArr);
- // }
- // s+= key+":"+e[key]+" ";
- // }
- // alert(s);
- //}
- /**
- * 启动多边形
- */
- function openDrawPolygonTool() {
- wg.openDrawPolygonTool(lay2,lineStyle);
- };
- /**
- * 启动矩形
- */
- function openDrawRectangleTool(){
- wg.openDrawRectangleTool(lay2,lineStyle);
- } ;
- /**
- * 启动圆形
- */
- function openDrawCircleTool(){
- wg.openDrawCircleTool(lay2,lineStyle);
- };
- /**
- * 自定义图形的右键编辑菜单
- */
- function editUserDefined(){
- wg.openEditorTool();
- };
- /**
- * 添加自定义标注
- */
- var flag = false;
- var teamId = null ;
- var describeinfo = null ;
- function addMarkerToUserDefined(f){
- if(f=='but6'){
- userInfo = resolveUrl() ;
- var url = "toolTeam.jsp?fd_id=" + userInfo["dept_id"] ;
- var lonlat = showModalDialog(url,window,"scroll:yes;status:no;dialogWidth:400px;dialogHeight:270px") ;
- if(lonlat=="undefined"||lonlat==null||lonlat==""){
- addMarkerToUserDefined(f) ;
- }
- teamId = lonlat.split(",")[0] ;
- describeinfo = lonlat.split(",")[1] ;
- var descri = lonlat.split(",")[2] ;
-
- if(descri){
- describeinfo += "(" + descri + ")" ;
- }
-
- icon = path + "/nwyj/images/cockpit/er_group.png" ;//队伍
- } else if(f=='but7'){
- describeinfo = "地点" ;
- icon = path + "/nwyj/images/cockpit/er_adslabel.png" ;//地点
- } else if(f=='but8'){
-
- var url = "/nwyj/page/cockpit/dialog/emergencySupplies.jsp" ;
- describeinfo = showModalDialog(url,window,"scroll:yes;status:no;dialogWidth:400px;dialogHeight:270px") ;
- icon = path + "/nwyj/images/cockpit/er_goods.png" ;//物资
-
- } else if(f=='but9'){
- describeinfo = "起点" ;
- icon = path + "/nwyj/images/cockpit/ads_start.png" ;//起点
- // icon = path + "/nwyj/images/cockpit/11.gif" ;//起点
- } else if(f=='but10'){
- describeinfo = "终点" ;
- icon = path + "/nwyj/images/cockpit/er_destination.png" ;//终点
- };
-
- if(!flag){
- wg.addEvent("onGetPointEvent",callBackAddMarker);
- flag = true;
- };
- wg.startGetPoint();
- }
- /**
- * 打开网面对话框
- * @param url
- * @param params
- * @returns
- */
- function openDialog(url,params){
- return showModalDialog(url,window, params);
- }
- /**
- * 添加自定义图标的回调事件
- * @param e鼠标点击获得的地图坐标点
- */
- function callBackAddMarker(e){
- var obj = {layerName:lay2,posX:e.x,posY:e.y,icon:icon,clickable:true};
- wg.addMarker(obj);
- var iconName = icon.split("/") ;
- addMarkerXY(iconName[iconName.length-1],e.x,e.y,teamId,describeinfo) ;
- } ;
- function addMarkerXY(iconName,x,y,teamId,describeinfo){
- switch (iconName){
- case "er_group.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 "er_adslabel.png" : //地点
-
- siteArr.push("SITE") ;
- var value = "[{\"LONGITUDE\":" + x + ",\"LATITUDE\":" + y + ",\"NUM\":0,\"DESCRIBEINFO\":\"" + describeinfo + "\"}]" ;
- siteXYArr.push(value) ;
-
- break ;
- case "er_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 "er_destination.png" : //终点
-
- destinationArr.push("DESTINATION") ;
- var value = "[{\"LONGITUDE\":" + x + ",\"LATITUDE\":" + y + ",\"NUM\":0,\"DESCRIBEINFO\":\"" + describeinfo + "\"}]" ;
- destinationXYArr.push(value) ;
-
- break ;
- }
- } ;
- /**
- * 应急资源图层根据所选择的队伍进行定位
- */
- var afterRes = null ;
- var tempLay = null ;
- function locationPosition(){
- var inciId = $("#teamInci").attr("relValue") ;
- var teamId = $("#teamByInci").attr("relValue") ;
- var params = { inci : inciId, teamid : teamId } ;
-
- delLayer(lay4);
- delLayer(lay5);
- tracing = -1 ;
- var url = "/nwyj/ws/cockpit/CockpitService/queryYJTameMarkerInfo" ;
- var res = getJsonData(url,params) ;
-
- var point = [] ;
- point = point.concat(poinXY(res,"posX","posY")) ;
- zoomToCoordList(point) ;
-
- res = addErAttr(res,er_groupIcon,true,lay4) ;
-
- addResourceIco(res);//添加图标
- afterRes = res ;
- tempLay = lay4 ;
- calBackMarker() ;
- } ;
- var i = 0 ;
- /**
- * 设置标签闪动5次
- */
- function calBackMarker(){
- i++ ;
- setTimeout(function del(){
- if(i%2==0){
- markerids = addResourceIco(afterRes);//添加图标
- } else {
- delLayer(tempLay);
- } ;
- },500) ;
- if(i<8){
- setTimeout("calBackMarker()",500) ;
- } else {
- i = 0 ;
- return ;
- } ;
- } ;
- /**
- * 轨迹描绘/向当前时间以后的数据进行描绘
- * 先删除当前的路径及marker点,然后再重新生成路径及添加Marker点
- */
- var ps = {} ;
- var tracing = 0 ;
- function tracingMachine(){
-
- /*var url = "/nwyj/ws/cockpit/CockpitService/queryTameLine" ;
- var res = getJsonData(url,params) ;
- wg.removeAllMarkers(lay4);
- icon = path + "/nwyj/images/cockpit/er_group.png" ;
- for(var key in res){
- tracing(res[key],null,er_startIcon,icon,lay4,lineStyle3) ;
- }*/
- var inciId = $("#teamInci").attr("relValue") ;
- var teamId = $("#teamByInci").attr("relValue") ;
- var params = { inci : inciId, teamid : teamId } ;
-
- delLayer(lay4);
- delLayer(lay5);
- addLayer(lay4,5,21,1) ;//添加自定义图标图层(应急队伍图层)
- addLayer(lay5,5,21,1) ;//添加自定义图标图层(应急队伍图层)
- var url = "/nwyj/ws/cockpit/CockpitService/queryYJTameMarkerInfo" ;
- var res = getJsonData(url,params) ;
-
- var point = [] ;
- point = point.concat(poinXY(res,"posX","posY")) ;
- zoomToCoordList(point) ;
-
- var tres = addErAttr(res,er_groupIcon,true,lay4) ;
- var pres = addErAttr(res,er_adsIcon,true,lay5) ;
-
- addResourceIco(tres);//添加图标
- addResourceIco(pres);//添加图标
-
- afterRes = tres ;
- tempLay = lay4 ;
- ps = params ;
- tracing = 0 ;
- calBackMarkerPaint() ;
-
- } ;
- function calBackMarkerPaint(){
- tracing++ ;
- /* setTimeout(function del(){*/
- if(tracing % 2 == 0){
- markerids = addResourceIco(afterRes);//添加图标
- } else {
- delLayer(tempLay);
- } ;
-
- if(tracing % 5 == 0){
-
- var url = "/nwyj/ws/cockpit/CockpitService/queryYJTameMarkerInfo" ;
- var res = getJsonData(url,ps) ;
- var point = [] ;
- point = point.concat(poinXY(res,"posX","posY")) ;
- res = addErAttr(res,er_groupIcon,true,lay4) ;
- var after_x = afterRes[0]["posX"] ;
- var after_y = afterRes[0]["posY"] ;
- afterRes = res ;
-
- if(!(after_x == afterRes[0]["posX"] && after_y == afterRes[0]["posY"])){
-
- var points_team = {"points":[{"x":after_x,"y":after_y},{"x":afterRes[0]["posX"],"y":afterRes[0]["posY"]}]} ;
- wg.addPolyLine(lay5,points_team,lineStyle4) ;
- }
-
- }
- /* },1000) ;*/
- if(tracing != 0){
- setTimeout("calBackMarkerPaint()",1000) ;
- } else {
- return ;
- } ;
- } ;
- ///**
- // * 描绘轨迹用时间轮询方法(quartz),没有后台,所以先不写了
- // * 先删除当前的路径及marker点,然后再重新生成路径及添加Marker点
- // */
- //function tracingMachine(params){
- //
- // var url = "/nwyj/ws/cockpit/CockpitService/queryTameLine" ;
- // var res = getJsonData(url,params) ;
- // wg.removeAllMarkers(lay4);
- // icon = path + "/nwyj/images/cockpit/er_group.png" ;
- // for(var key in res){
- // tracing(res[key],null,er_startIcon,icon,lay4,lineStyle3) ;
- // }
- //} ;
- /**
- * 历史轨迹回放
- */
- function roadHistory(params){
-
- var url = "/nwyj/ws/cockpit/CockpitService/queryTameLine" ;
- var res = getJsonData(url,params) ;
- delLayer(lay4);
- delLayer(lay5);
-
-
- url = "/nwyj/ws/cockpit/CockpitService/queryYJTameMarkerInfo" ;
- $(resStart).attr("sort","ASC") ;
- var resStart = getJsonData(url,params) ;
-
- for(var key in res){
- var markerId = addAdsIcon(res[key]["points"][0]["x"],res[key]["points"][0]["y"],res[key]["teamId"],resStart,lay4) ;
- tracingHistory(res[key],markerId, er_adsIcon,er_groupIcon,lay4,lineStyle3) ;
- } ;
-
-
- } ;
- function addAdsIcon(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:er_groupIcon,clikable:true,"title":resStart[key]["title"]} ;
- markerId = wg.addMarker(tem) ;
-
- if(x == resStart[key]["posX"] && y == resStart[key]["posY"]){
-
- //1.判断是不是起点,如果是起点则添加起点图标
- var obj = {layerName:layTrac,posX:x,posY:y,icon:er_startIcon,clickable:true} ;
- wg.addMarker(obj) ;
-
- } else {
- //1.判断是不是起点,如果不是起点则添加地址图标
- var obj = {layerName:layTrac,posX:x,posY:y,icon:er_adsIcon,clickable:true} ;
- wg.addMarker(obj) ;
-
- }
- }
- }
- return markerId ;
- }
- /**
- * 线路跳闸与变电站停运图层初始化
- */
- function Linetrippingandsubstation(lineOParams, lineNParams, soOParams, soNParams){
- var url ="/nwyj/ws/cockpit/CockpitService/queryLineTrip";
- wg.setZoomAndCenter(gdX,gdY,13) ;//定位至指定坐标并设置缩放等级
- if(lineOParams){
- var lineOArrs = getArrData(url,lineOParams) ;//已恢复线路查询
- if(lineOArrs != ""){
- lineNotRecovered(lineOArrs,'#0F0') ;//高亮变电站和线路设备,线路已恢复
- } else {
- alert("没有发现线路已恢复数据!") ;
- }
- }
-
- if(lineNParams){
- var lineNArrs = getArrData(url,lineNParams) ;//未恢复线路查询
- if(lineNArrs != ""){
- lineNotRecovered(lineNArrs,'#00F') ;//高亮变电站和线路设备,线路未恢复
- } else {
- alert("没有发现线路未恢复数据!") ;
- }
- }
- //此处为判断变电站查询条件
- /*if(soOParams){
- var soOArrs = getArrData(url,soOParams) ;//已恢复线路查询
- if(soOArrs){
- lineNotRecovered(soOArrs,'#0F0') ;//高亮变电站和线路设备,线路已恢复
- } else {
- alert("没有发现变电站已恢复数据!") ;
- }
- }
-
- if(soNParams){
- var soNArrs = getArrData(url,soNParams) ;//未恢复线路查询
- if(soNArrs){
- lineNotRecovered(soNArrs,'#00F') ;//高亮变电站和线路设备,线路未恢复
- } else {
- alert("没有发现变电站未恢复数据!") ;
- }
- }*/
-
-
- /*lineNotRecovered(stNArrs,'#00F') ;//变电站未恢复
- lineNotRecovered(stYArrs,'#0F0') ;//变电站已恢复
- */
- /*equis = [] ;
- equis = equis.concat(stNArrs) ;
- equis = equis.concat(stYArrs) ;*/
-
- //右键菜单暂时未实现
- /*addRightMenu("220kV变电站",menuArr,funArr) ;
- addRightMenu("110kV变电站",menuArr,funArr) ;*/
- lineTrippingAddEvent();//添加设备单击事件
- linetrppingaddButEvent() ;//注册添加按钮事件
- };
- /**
- * 得到设备id请求(返回数据为字符串并封闭为数组用)
- */
- function getArrData(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');
- }
- });
- return newData ;
- };
- /**
- * axaj请求(返回字符串数据)
- */
- function getStrData(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');
- }
- });
- return str ;
- };
- /**
- * 得到json格式请求
- */
- function getJsonData(url,params){
- var result={} ;
- $.ajax({
- async:false,
- url : url,
- type : 'post',
- timeout : 60000,
- data : params,
- dataType : 'json',
- success : function(data) {
- result = data ;
- return data ;
- },
- error : function(e) {
- $.messager.alert('系统提示信息error', '访问服务失败!', 'error');
- }
- });
- return result ;
- };
- /**
- * 改变设备颜色
- * @param arrs
- * @param color
- */
- function lineNotRecovered(arrs,color){
- wg.addHighlightPSR(arrs,color);
- };
-
- ////添加设备右键菜单
- ///**
- // * 添加设备右键菜单
- // */
- //function addRightMenu(lay,menuArr,funArr){
- // wg.addContextMenu(lay,menuArr,funArr);
- //} ;
- //
- //
- ////查看负荷曲线图
- //function showLoadPattern()
- //{
- // addMB();
- // MBclickfunction();
- // var pathTex = pathCon + "lt_loadCurve.html" ;
- // openFloatWindow(725,310,pathTex) ;
- //} ;
- //
- ////查看变电站视频
- //function showSubstationVideo()
- //{
- // addMB();
- // MBclickfunction();
- // var pathTex = pathCon + "lt_video.html" ;
- // openFloatWindow(450,350,pathTex) ;
- //} ;
- //
- ////查看受影响的变电站、线路
- //function showImpactEquipment()
- //{
- // addMB();
- // MBclickfunction();
- //} ;
- function LayerLegend()
- {
- if ((window.location.href).indexOf('?') > -1)
- {
- //得到右键菜单的ID
- var fid = (window.location.href).split('?')[1];
- //定义图片的路径
- var imgPath = $("#LayerLegend");
- imgPath.src="/nwyj/images/cockpit/"+fid+".png";
- }
- }
- /**
- * 线路跳闸与变电站停运单击设备事件
- */
- function lineTrippingAddEvent(){
- wg.addEvent('onPSRClicked',lineTrippingAddEventcall);
- } ;
- function lineTrippingAddEventcall(e){
- for(var key in e){
- if(key == "psrID"){
- pID = e[key];
-
- for(var psr in equis){
- if(pID == equis[psr]){
- addCustomButton(buttonInfo,150,30,100,20) ;
- } ;
- } ;
-
- } ;
- } ;
- } ;
- /**
- * 添加按钮
- * @param buttonInfo 按钮组
- * @param width 按钮宽
- * @param height 按钮高
- */
- function addCustomButton(buttonInfo,width,height,x,y){
- var buttonArr = [];
- for(var i=0;i<buttonInfo.length;i++){
- var obj = {
- key:buttonInfo[i].key,
- x:x,
- y:y+i*30,
- width:width,
- height:height,
- context:buttonInfo[i].value,
- icon:buttonInfo[i].icon
- };
- buttonArr.push(obj);
- }
- wg.addButtonGroup(buttonArr);
- };
- /**
- * 注册事件
- */
- function linetrppingaddButEvent(){
- wg.addEvent("onButtonClickedEvent",linetrppingcallBackLt);
- };
- function linetrppingcallBackLt(e){
- if(e == "slp"){
-
- removeCustomButton() ;
- showLoadPattern() ;
-
- } else if(e == 'ssv'){
-
- removeCustomButton() ;
- showSubstationVideo() ;
-
- } else if(e == "sie"){
-
- removeCustomButton() ;
- showImpactEquipment() ;
-
- };
- } ;
- /**
- * 移除所有添加的按钮
- */
- function removeCustomButton(){
- wg.removeButtonGroup();
- };
- /**
- * index页面改变大小时刷新表格数据页码数
- * @param pageSize
- */
- function refresh(pageHeight){
- var quilayoutpages =new QUIlayoutpage();
- quilayoutpages.refresh(pageHeight) ;
- };
- //设置设备过滤显示
- function filterPSRDisplay(){
- wg.filterPSRDisplay('1000357000000006300');
- }
- /**
- * 清除所有过渡显示
- */
- function filterRemoveAll(){
- wg.filterRemoveAll();
- };
- /**
- * 启动图形完成事件
- */
- function openDarwAddEvent(){
- wg.addEvent("onShapeDrawnCompleted",openDarwCallBack);
- }
- /**
- * 启动图形完成回调事件
- */
- function openDarwCallBack(e){
- // alert(e["geometryType"]) ;//得到图形类型 线:1 多边形:2 圆:3 矩形: 4
- 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"]) ;
- } ;
-
- } ;
- /**
- * 校验事件名称是否存在
- */
- /*function verifyIncidentName(){
- var url ="/nwyj/ws/cockpit/CockpitService/verifyIncidentName" ; //标记
- var params = {Condi:$("#eve").val()} ;
- var result = getArrData(url,params) ;
- //alert(result) ;
- if(result==1) $("#sev").text("该事件名称已经存在!");
- if(result==0){
- $("#sev").text("可以添加!") ;
- $("#saveDrawBut").removeAttr("disabled") ;
- }
-
- } ;*/
- //以图层的形式整体保存,因为没有MarkerID,所以不能进行单独删除
- /*var tempByUserDraw ;
- function saveDrawByUser(inicId){
-
- tempByUserDraw = wg.saveGraphToData(lay2) ;
- var aa = JSON.stringify(tempByUserDraw) ;
- alert(aa) ;
- var url = "/nwyj/ws/cockpit/CockpitService/createDrawByUser" ;
- var params = {inicId:inicId,info:aa} ;
-
- var res = getStrData(url,params) ;
-
- alert(res) ;
- }
- function importDrawByUser(){
- var url = "/nwyj/ws/cockpit/CockpitService/importDrawByUser" ;
- var aa = getJsonData(url,null) ;
- alert(aa);
- wg.openGraphFromData(lay1,aa) ;
- }*/
- /**
- * 保存自定义图形按钮事件
- */
- function saveDraw(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 = saveType(inciResult,lineArr) ;
- var lineXYResultJson = saveXY(lineResult,lineXYArr) ;//保存折线类坐标
- drawTypeIds = drawTypeIds.concat(lineResult) ;
-
- lineArr = [] ;
- lineXYArr = [] ;
- // trunDrawLine(lineResult) ;
- }
-
- if(polygonArr.length != 0){
- var polygonResult = saveType(inciResult,polygonArr) ;
- var polygonXYResultJson = saveXY(polygonResult,polygonXYArr) ;//保存多边形类坐标
- drawTypeIds = drawTypeIds.concat(polygonResult) ;
- polygonArr = [] ;
- polygonXYArr = [] ;
- }
-
- if(circleArr.length != 0){
- var circleResult = saveType(inciResult,circleArr) ;
- var circleXYResultJson = saveXY(circleResult,circleXYArr) ;//保存圆形类坐标
-
- // for(var key in circleXYResultJson){alert(circleXYResultJson[key]); }
- drawTypeIds = drawTypeIds.concat(circleResult) ;
- circleArr = [] ;
- circleXYArr = [] ;
- }
-
- if(rectangleArr.length != 0){
- var rectangleResult = saveType(inciResult,rectangleArr) ;
- var rectangleXYResultJson = saveXY(rectangleResult,rectangleXYArr) ;//保存矩形类坐标
- drawTypeIds = drawTypeIds.concat(rectangleResult) ;
- rectangleArr = [] ;
- rectangleXYArr = [] ;
- }
-
- if(originArr.length != 0){
- var rectangleResult = saveType(inciResult,originArr) ;
- var rectangleXYResultJson = saveXY(rectangleResult,originXYArr) ;//保存起点类坐标
- drawTypeIds = drawTypeIds.concat(rectangleResult) ;
- originArr = [] ;
- originXYArr = [] ;
-
- }
-
- if(siteArr.length != 0){
- var siteResult = saveType(inciResult,siteArr) ;
- var siteXYResult = saveXY(siteResult,siteXYArr) ;//保存地点类坐标
- drawTypeIds = drawTypeIds.concat(siteResult) ;
- siteArr = [] ;
- siteXYArr = [] ;
- }
-
- if(destinationArr.length != 0){
- var destinationResult = saveType(inciResult,destinationArr) ;
- var destinationXYResultJson = saveXY(destinationResult,destinationXYArr) ;//保存终点类坐标
- drawTypeIds = drawTypeIds.concat(destinationResult) ;
- destinationArr = [] ;
- destinationXYArr = [] ;
- }
-
- if(vehicleArr.length != 0){
- var vehicleResult = saveType(inciResult,vehicleArr) ;
- var vehicleXYResult = saveXY(vehicleResult,vehicleXYArr) ;//保存车辆类坐标
- drawTypeIds = drawTypeIds.concat(vehicleResult) ;
- vehicleArr = [] ;
- vehicleXYArr = [] ;
- }
- if(teamArr.length != 0){
- var teamResult = saveType(inciResult,teamArr) ;
- var teamXYResult = saveXY(teamResult,teamXYArr) ;//保存队伍类坐标
- drawTypeIds = drawTypeIds.concat(teamResult) ;
- teamArr = [] ;
- teamXYArr = [] ;
- } ;
- } else {
- alert("没有数据可以保存!") ;
- } ;
- } ;
- /**
- * 保存事件
- */
- function saveIncident(){
- var url ="/nwyj/ws/cockpit/CockpitService/addIncidentName" ;
- var params = {Condi:$("#eve").val()} ;
- return getArrData(url,params) ;//得到事件ID
- } ;
- /**
- * 保存参数信息
- * @param inciResult 事件ID
- * @returns {Array} 返回FD_ID
- */
- function saveType(inciResult,drowArr){
- var par = "[" ;
- 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 ="/nwyj/ws/cockpit/CockpitService/addDrawType" ;//批量添加自定义线形图到参数信息存储表
- params = { DATA : par } ;
-
- // $.post(url,params,function(data){
- // return data ;
- // }, "text") ;
- return getArrData(url,params) ;//得到线型FD_ID
- } ;
- /**
- * 保存图形的坐标点
- * @param lineResult
- * @returns {Array}
- */
- function saveXY(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] = addJsonAttribute(exchangeJson[sk],"FIGUREID",lineResult[i]);
- exchangeStr = JSON.stringify(exchangeJson[sk]) ;
-
- jsonStr += exchangeStr ;
- jsonStr += "," ;
- } ;
-
- } ;
- jsonStr = jsonStr.substring(0, jsonStr.length - 1) ;
- jsonStr += "]" ;
- url ="/nwyj/ws/cockpit/CockpitService/addDrawXY" ;//批量添加自定义线形图到参数信息存储表
- params = { DATA : jsonStr } ;
-
- return getArrData(url,params) ;
- // getArrData(url,params) ;
-
- // alert("保存完成!开始转换...") ;
- // url ="/nwyj/ws/cockpit/CockpitService/getDrawPoints" ;//将批量添加自定义线形图转换为添加类型
- // params = {ids:lineResult.join(",")} ;
- //
- // return getJsonData(url, params) ;
- // $.post(url,params,function(data){
- // return data ;
- //}, "text") ;
- } ;
- //清除用户自定义图形
- function clearDrawUserDefined(){
- if(drawTypeIds.length != 0){
- var url = "/nwyj/ws/cockpit/CockpitService/delDrawUserDefined" ;//批量删除用户自定义绘制图形
- var params = drawTypeIds.join(",") ;
- $.post(url,params,function(data){
- if(data){
- wg.removeAllShapes(lay2) ;
- alert("保存后删除成功") ;
- }
- },"text") ;
- drawTypeIds = [] ;
- } else {
- wg.removeAllShapes(lay2) ;
- clearDrawByUserArr() ;
- alert("未保存图形删除成功") ;
- }
-
- }
- function clearDrawByUserArr(){
- lineArr = [] ; //存储线类型数组
- polygonArr = [] ; //存储多边形类型数组
- circleArr = [] ; //存储圆类型
- rectangleArr = [] ;//矩形数组
- originArr = [] ;//起点数组
- siteArr = [] ;//地点
- destinationArr = [] ;//终点
- vehicleArr = [] ;//车辆
- teamArr = [] ;//人员
- lineXYArr = [] ; //存储线类型数组坐标
- polygonXYArr = [] ; //存储多边形类型数组坐标
- circleXYArr = [] ; //存储圆类型坐标
- rectangleXYArr = [] ;//矩形数组坐标
- originXYArr = [] ;//起点数组坐标
- siteXYArr = [] ;//地点坐标
- destinationXYArr = [] ;//终点坐标
- vehicleXYArr = [] ;//车辆坐标
- teamXYArr = [] ;//人员坐标
- drawTypeIds = [] ;
- };
- //按类型查询用户自定义图形信息
- function searchDrawByUserInfo(inicId){
- isDelDrawLay(inicId) ;
- var params = {} ;
- var res = {} ;
- var url = "/nwyj/ws/cockpit/CockpitService/queryDrawByUser" ;
- params = {"inicId":inicId,"type":"LINE","userId":userInfoByTop["user_id"]} ;//线
- res = getJsonData(url,params) ;
- if(res){
- addUserDrawByLine(res) ;
- }
-
- params = {"inicId":inicId,"type":"POLYGON","userId":userInfoByTop["user_id"]} ;//多边形
- res = getJsonData(url,params) ;
- if(res){
- addUserDrawByPolygon(res) ;
- }
-
- params = {"inicId":inicId,"type":"CIRCLE","userId":userInfoByTop["user_id"]} ;//圆形
- res = getJsonData(url,params) ;
- if(res){
- addUserDrawByCircle(res) ;
- }
-
- params = {"inicId":inicId,"type":"RECTANGLE","userId":userInfoByTop["user_id"]} ;//矩形
- res = getJsonData(url,params) ;
- if(res){
- addUserDrawByPolygon(res) ;
- }
-
- url = "/nwyj/ws/cockpit/CockpitService/queryDrawByUserMarker" ;
- params = {"inicId":inicId,"type":"SITE","userId":userInfoByTop["user_id"]} ;//地点
- res = getJsonData(url,params) ;
- if(res){
- res = addErAttr(res,er_adsIcon,true,lay3) ;
- var objKV = addUserDrawByIcon(res) ;
- addRightDraw(objKV) ;
- }
-
- params = {"inicId":inicId,"type":"ORIGIN","userId":userInfoByTop["user_id"]} ;//起点
- res = getJsonData(url,params) ;
- if(res){
- res = addErAttr(res,er_startIcon,false,lay3) ;
- addResourceIco(res) ;
- }
-
- params = {"inicId":inicId,"type":"DESTINATION","userId":userInfoByTop["user_id"]} ;//终点
- res = getJsonData(url,params) ;
- if(res){
- res = addErAttr(res,er_destIcon,false,lay3) ;
- addResourceIco(res) ;
- }
-
- params = {"inicId":inicId,"type":"TEAM","userId":userInfoByTop["user_id"]} ;//队伍
- res = getJsonData(url,params) ;
- if(res){
- res = addErAttr(res,er_groupIcon,true,lay3) ;
- addResourceIco(res) ;
- }
-
- params = {"inicId":inicId,"type":"VEHICLE","userId":userInfoByTop["user_id"]} ;//物资
- res = getJsonData(url,params) ;
- if(res){
- res = addErAttr(res,er_GoodsIcon,true,lay3) ;
- addResourceIco(res) ;
- }
- // addRightClick() ;
- }
- function isDelDrawLay(inicId){
-
- if(lineArr.length != 0 || polygonArr.length != 0 || circleArr != 0 || rectangleArr != 0 || originArr != 0 ||
- siteArr != 0 || destinationArr != 0 || vehicleArr != 0 || teamArr != 0){
- if(confirm("有未保存的图形,单击确定保存后再查看")){
- saveDraw(inicId) ;
- delDrawLay() ;
- } else {
- delDrawLay() ;
- }
- } else {
- delDrawLay() ;
- }
- }
- function delDrawLay(){
- addLayer(lay3,5,21,1) ;
- addLayer(lay2,5,21,1) ;
- clearlay(lay3) ;
- clearlay(lay2) ;
- addLayer(lay3,5,21,1) ;
- }
- /**
- * 添加手绘折线
- * @param drawLineResArr
- */
- function addUserDrawByLine(drawResArr){
- var pointDraw = [] ;
- for(var key in drawResArr){
- pointDraw.push({"layerName":lay3,"points":{"points":drawResArr[key]["points"]},"lineStyle":lineStyle1,"extraData":drawResArr[key]["drawId"]}) ;
- }
- var objKV = addLineByUserDraw(pointDraw) ;
- addRightDraw(objKV) ;
- }
- /**
- * 添加手绘多边形
- * @param drawLineResArr
- */
- function addUserDrawByPolygon(drawResArr){
- var pointDraw = [] ;
- for(var key in drawResArr){
- pointDraw.push({"layerName":lay3,"points":{"points":drawResArr[key]["points"]},"lineStyle":lineStyle1,"extraData":drawResArr[key]["drawId"]}) ;
- }
- var objKV = addPolygonByUserDraw(pointDraw) ;
- addRightDraw(objKV) ;
-
- }
- /**
- * 添加手绘圆形
- * @param drawResArr
- */
- function addUserDrawByCircle(drawResArr){
- var pointDraw = [] ;
- for(var key in drawResArr){
- pointDraw.push({"layerName":lay3,"points":{"points":drawResArr[key]["points"],"radius":drawResArr[key]["radius"]},"lineStyle":lineStyle1,"extraData":drawResArr[key]["drawId"]}) ;
- }
- var objKV = addCircleByUserDraw(pointDraw) ;
- addRightDraw(objKV) ;
- }
- ///**
- // * 添加用户自定义图标
- // * @param drawResArr
- // */
- //function addUserIcon(drawResArr){
- // var drawKV = {} ;
- // for(var key in drawResArr){
- // wg.addMarker(drawResArr[key]) ;
- // };
- // return iconIds ;
- //}
- /**
- * 得到手绘图形的参数信息
- * @param lay 图层名
- * @param drawTypeResArr 坐标信息参数
- * @param ls 线样式
- * @returns 添加样式数组
- */
- function getPoint(tempLay,drawTypeResArr,ls){
- var pointDraw = [] ;
- for(var key in drawTypeResArr){
- pointDraw.push({"layerName":tempLay,"points":{"points":drawTypeResArr[key]["points"]},"lineStyle":ls}) ;
- }
- return pointDraw ;
- }
- /**
- * 批量添加多边形,返回ID数组
- * @param polygonArr
- */
- function addPolygon(polygonArr){
- var polygonObj = [] ;
- for(var transfer in polygonArr){
- polygonObj.push(wg.addPolygon(polygonArr[transfer]["layerName"],polygonArr[transfer]["points"],polygonArr[transfer]["lineStyle"],polygonArr[transfer]["title"])) ;
- };
- return polygonObj ;
- }
- /**
- * 添加圆,返回ID数组
- * @param circleArr
- * @returns {Array}
- */
- function addCircle(circleArr){
- var polygonObj = [] ;
- 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"]
- } ;
- polygonObj.push(wg.addCircle(circleArr[transfer]["layerName"],obj,circleArr[transfer]["lineStyle"])) ;
- };
- return polygonObj ;
- }
- /**
- * 添加用户自定义圆返回ID与FD_ID健值对
- * @param circleArr
- * @returns {___anonymous64930_64931}
- */
- function addCircleByUserDraw(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 = wg.addCircle(circleArr[transfer]["layerName"],obj,circleArr[transfer]["lineStyle"],circleArr[transfer]["extraData"]) ;
-
- drawKV = addJsonAttribute(drawKV,circleId,circleArr[transfer]["extraData"]);
-
- };
- return drawKV ;
- }
- /**
- * 批量添加多边形,返回ID与FD_ID健值对
- * @param polygonArr
- */
- function addPolygonByUserDraw(polygonArr){
- var drawKV = {} ;
- for(var transfer in polygonArr){
- var pId = wg.addPolygon(polygonArr[transfer]["layerName"],polygonArr[transfer]["points"],polygonArr[transfer]["lineStyle"],polygonArr[transfer]["extraData"]) ;
- drawKV = addJsonAttribute(drawKV,pId,polygonArr[transfer]["extraData"]);
- };
- return drawKV ;
- }
- /**
- * 批量添加折线,返回ID与FD_ID健值对
- * @param polygonArr
- */
- function addLineByUserDraw(polygonArr){
-
- var drawKV = {} ;
- for(var transfer in polygonArr){
- var pId = wg.addPolyLine(polygonArr[transfer]["layerName"],polygonArr[transfer]["points"],polygonArr[transfer]["lineStyle"],polygonArr[transfer]["extraData"]) ;
- drawKV = addJsonAttribute(drawKV,pId,polygonArr[transfer]["extraData"]);
- };
- return drawKV ;
- }
- /**
- * 批量添加图标,返回ID与FD_ID健值对
- * @param
- */
- function addUserDrawByIcon(polygonArr){
- var drawKV = {} ;
- for(var transfer in polygonArr){
- var pId = wg.addMarker(polygonArr[transfer]) ;
- drawKV = addJsonAttribute(drawKV,pId,polygonArr[transfer]["extraData"]["inciId"]);
- };
- return drawKV ;
- } ;
- //=========================================================================================================================
- function trunDrawLine(ids){
- var url ="/nwyj/ws/cockpit/CockpitService/getDrawPoints" ;//批量添加自定义线形图到参数信息存储表
- var params = "" ;
- for(var key in ids){
- params += ids[key] + "," ;
- }
- if(params.length > 1)
- params = params.substring(0, params.length-1) ;
- var params = { "ids" : params } ;
-
- return getJsonData(url,params) ;
-
- // var pathA = {} ;
- // var pathB = {} ;
- //
- //
- // var trunErpathLine = [{"layerName":lay1,"points":pathA,"lineStyle":lineStyle2,"title":"路径A"},
- // {"layerName":lay1,"points":pathB,"lineStyle":lineStyle2,"title":"路径B"}] ;
- // addResourcePath(erpathA) ;//显示路径
- }
- //=========================================================================================================================
- /**
- * 应急预警与响应查询事件
- */
- function searchEwer(paramsEw,paramsEr,changeGridEw,changeGridEr){
- closeEmergencyearlywarningandresponse();
- var pointPre = [] ;
- // Emergencyearlywarningandresponse(paramsEw,paramsEr) ;
- //应急预警查询
- var url ="/nwyj/ws/cockpit/CockpitService/getEwMarker";
- pointPre = pointPre.concat(searchMarkerToEwer(url,paramsEw,true,ewer_lay2)) ;
- //应急响应查询(地市级)
- url ="/nwyj/ws/cockpit/CockpitService/getErMarker";
- pointPre = pointPre.concat(searchMarkerToEwer(url,paramsEr,true,ewer_lay2)) ;
-
- if(pointPre.length != 0){
- zoomToCoordList(pointPre) ;
- } else {
- // alert("没有相关数据") ;
-
- ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据");
- ai.createAlert();
- }
- addEMMarkerEvent();
-
- page_0.window.searchEw(changeGridEw) ;
- page_1.window.searchEr(changeGridEr) ;
-
-
- } ;
- /**
- * 线路跳闸与变电站停运查询事件
- */
- function searchLtSo(lttParams, ltfParams, sotParams, sofParams,gridParams,lostParams){
- HighlightPSRs();
- removeCustomButton();
- Linetrippingandsubstation(lttParams, ltfParams, sotParams, sofParams) ;
- page_0.window.searchLt(gridParams) ;
- page_2.window.searchLost(lostParams) ;
- } ;
- /**
- * 应急资源标注查询
- * @param params
- */
- function searchErCount(params){
- closeemergencyresource();
- var erUnitID = $("#unitIdByEr").attr("relValue") ;
- var erTypeID = $("#erTypeID").val();
- var beginTime = $("#beginTimeByEr").attr("value") ;
- var endTime = $("#endTimeByEr").attr("value") ;
-
- if(beginTime != "" && endTime == "")
- endTime = getNowFormatDate(allGetServerTime()) ;
- if(beginTime == "" && endTime != ""){
- alert("请选择开始时间") ;
- }
- if(beginTime == "" && endTime == ""){
- var date = allGetServerTime() ;
- beginTime = getThreeMonthsAgo(getNowFormatDate(date)) ;
- endTime = getNowFormatDate(allGetServerTime()) ;
- }
-
- if(!erUnitID){
- erUnitID = deptId ;
- }
- var params = {classid : erTypeID, unitId : erUnitID, startDate : beginTime, endDate : endTime} ;
-
-
- var url ="/nwyj/ws/cockpit/CockpitService/queryErMarker" ;
- erFlagPref = getJsonData(url,params) ;
- if(erFlagPref){
- erFlagProv = {} ;
-
- var posXArr = [] ;
- var posYArr = [] ;
- for(var key in erFlagPref){
- posXArr.push(erFlagPref[key]["x"]) ;
- posYArr.push(erFlagPref[key]["y"]) ;
- }
- var radiu = zoomToExtent(posXArr,posYArr) ;
- var rad = getErRadius(radiu) ;
- drawResource(erFlagPref,1,rad["ra"],rad["ds"]) ;//####
-
- wg.addEvent("onMapExtentChanged",mapChanged);
- // drawResource(res,1,600,1) ;//####
- } else {
- // alert("没有相关数据") ;
- ai.setMes(320, 186, 200, 500, "系统提示", "没有相关数据");
- ai.createAlert();
- } ;
-
- } ;
- /**
- * 定位到指定区域
- * @param posXArr X坐标数组
- * @param posYArr Y坐标数组
- * @returns 地图当前缩放等级
- */
- function zoomToExtent(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;
-
- wg.zoomToExtent(minX,minY,maxX,maxY) ;
- return wg.getCurrentZoomLevel() ;
- }
- /**
- * 应急资源标各级显示半径
- * @param zoomLevel
- * @returns
- */
- function getErRadius(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] ;
- }
- /*$(function(){
- // var lazyheight = 0;
- //获取数据
- function showload(){
- alert("KKKKKKKKKKK") ;
- lazyheight = parseFloat($(window).height()) + parseFloat($(window).scrollTop());
- if ($(document).height()-100 <= lazyheight) {
- alert("xxx");
- }
- }
- //showload();
- //绑定事件
- $(window).bind("scroll", function(){
- //当滚动条滚动时
- showload();
- });
- }) ;*/
- /**
- * 得到日期类型时间yyyy-mm-dd hh:mm:ss
- * @returns {String}
- */
- function getNowFormatDate(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 ;
- } ;
- /**
- * 得到3个月前的日期类型时间yyyy-mm-dd hh:mm:ss
- * @returns {String}
- */
- function getThreeMonthsAgo(date){
- var now = new Date(date.replace(/\-/g,"/"));
- var tmya =new Date( now.setMonth(now.getMonth() - 3));
- return getNowFormatDate(tmya) ;
- } ;
- /**
- * 得到部门下的省级或地级部门
- * @returns
- */
- function getSubDept(userDeptID){
- var url ="/nwyj/ws/cockpit/CockpitService/querySubDept";
- // var params = { unitId:'1' } ;
- var params = { unitId:userDeptID } ;
-
- return getJsonData(url,params) ;
- }
- //===========================================================================================================================
- function addRightDraw(objKV){
- var menuArra = [{ "Key": "1","Name": "隐藏"},
- // { "Key": "1","Name": "隐藏","SubMenus": [ { "Key": "1-1","Name": "全图" } ]},
- { "Key": "2","Name": "删除"}];
- var funArra ;
- for(var key in objKV){
- // alert("key:" + key + " value:" + objKV[key]) ;
- funArra = [{"key":"1",fun:"hideDraw(\"" + key + "\")"},{"key":"2",fun:"delDraw(\"" + objKV[key] + "\",\"" + key + "\")"}] ;
- wg.addContextMenu(lay3,menuArra,funArra,key);
- }
-
- }
- function hideDraw(drawId){
- setTimeout(function hideShape(){
- removeShape(drawId) ;
- },10) ;
-
- }
- function delDraw(fd_id, drawId){
- setTimeout(function delShape(){
- var url ="/nwyj/ws/cockpit/CockpitService/delDrawUserDefined";
- var res = getStrData(url,fd_id) ;
- if(res=="true"){
- removeShape(drawId) ;
- }
- },10) ;
- }
- function removeShape(drawId){
- wg.removeShape(drawId) ;
- }
- //单击
- function clickUserDraw(e){
- wg.removeShape(e["shapeID"]) ;
- }
- //=========================================================== SearchToewer ====================================================
- var deptId = "" ;
- $(function(){
- var userInfo=top.conditionJson;
- var yjIncidentUrl = "/nwyj/ws/cockpit/CockpitService/queryYjIncident" ;
- $.post(yjIncidentUrl,function(data){
- $("#erewInci").data("data", data) ;
- $("#erewInci").render() ;
- $("#teamInci").data("data", data) ;
- $("#teamInci").attr("selectedValue",data["treeNodes"]["0"]["id"]);
- $("#teamInci").render() ;
- changeTameSelect(data["treeNodes"]["0"]["id"]) ;
-
-
- }, "json") ;
-
- var deptUrl="/nwyj/ws/orgInDeptService/OrgInDeptService/getDeptRootById";
- $("#unitId").attr('params','{"id":"' + userInfo["dept_id"] + '"}');
- //异步加载请求地址
- $("#unitId").attr('url',deptUrl);
- $.post(deptUrl, {"deptId" : userInfo["dept_id"]}, function(data) {
- for(var key in data["treeNodes"]){
- deptId += data["treeNodes"][key]["id"] + "," ;
- }
- deptId = deptId.substring(0, deptId.length-1) ;
- $("#unitId").data("data", data);
- $("#unitId").render();
-
- $("#unitIdByEr").data("data", data);
- $("#unitIdByEr").render();
-
- }, "json");
- }) ;
- /**
- * 应急预警与响应查询面板
- */
- function searchEwerClick(){
- var conditionEw = " 1=1 and IS_DEL='0' and is_alert = '0' and is_send = '5' " ;
- var conditionEr = " 1=1 and IS_DEL='0' and is_alert = '1' and is_send = '5' " ;
- var temp = "" ;
-
- var unitId = $("#unitId").attr("relValue") ;
- var incidentType = $("#erewInci").attr("relText") ;
- var incidentLevel = $("#incidentLevel").attr("relValue") ;
- var beginTime = $("#beginTime").attr("value") ;
- var endTime = $("#endTime").attr("value") ;
-
- if(unitId){
- temp = getOneSqlWhere("RELEASE_UNIT",unitId) ;
- conditionEw += temp ;
- conditionEr += temp ;
- } else {
- unitId = deptId ;
- }
- if(incidentType == "请选择"){
- incidentType = "" ;
- } else {
- temp = getOneSqlWhereLike("EARLY_WARNING_NAME",incidentType) ;
- conditionEw += temp ;
- conditionEr += temp ;
- }
-
- if(beginTime == "" && endTime != ""){
- alert("请选择开始时间!") ;
- return ;
- }
- if(beginTime != "" && endTime == ""){
- endTime = getNowFormatDate(allGetServerTime()) ;
- }
- if(beginTime != "" && endTime != ""){
- temp = " and RELEASE_RELIEVE_DATE BETWEEN '" + beginTime + "' AND '" + endTime + "'" ;
- conditionEw += temp ;
- conditionEr += temp ;
- }
-
- var ewLevel = '';
- var erLevel = '';
- if(incidentLevel==1){
- ewLevel = '35' ;
- erLevel = '29' ;
- } else if (incidentLevel==2){
- ewLevel = '36' ;
- erLevel = '30' ;
- } else if (incidentLevel==3){
- ewLevel = '37' ;
- erLevel = '31' ;
- } else if (incidentLevel==4){
- ewLevel = '38' ;
- erLevel = '32' ;
- }
-
- if(incidentLevel != ""){
- temp = getOneSqlWhere("CURRENT_EW_LEVEL",ewLevel) ;
- conditionEw += temp ;
- temp = getOneSqlWhere("CURRENT_ER_LEVEL",erLevel) ;
- conditionEr += temp ;
- }
-
- var paramsEw = {
- RELEASE_UNIT : unitId,//单位
- BM_EMC_WarningName : incidentType,//事件类型
- LEVEL : ewLevel,//级别
- BEGINTIME : beginTime,//开始时间
- ENDTIME : endTime //截止时间
- } ;
-
- var paramsEr = {
- RELEASE_UNIT : unitId,//单位
- BM_EMC_WarningName : incidentType,//事件类型
- LEVEL : erLevel,//级别
- BEGINTIME : beginTime,//开始时间
- ENDTIME : endTime //截止时间
- } ;
-
- var changeGridEw = { "listId" : '365', "condition" : conditionEw };
- var changeGridEr = { "listId" : '365', "condition" : conditionEr };
- searchEwer(paramsEw,paramsEr,changeGridEw,changeGridEr);
- // window.parent.window.searchEwer(paramsEw,paramsEr,changeGridEw,changeGridEr) ;
-
- } ;
- var dateSkin="blue";
- function initComplete(){
-
- //绑定应急事件下拉框change事件
- $("#teamInci").bind("change",function(){
- changeTameSelect($(this).attr("relValue")) ;
- }) ;
- //获取当前主题风格,用于设置日期控件的皮肤
- try {
- dateSkin=themeColor;
- }catch(e){}
- //自定义点击触发日期控件
- document.getElementById('beginTime').onfocus=function(){
- var endtimeTf=$dp.$('endTime');
- WdatePicker({
- skin:dateSkin,onpicked:function(){endtimeTf.focus();},maxDate:'#F{$dp.$D(\'endTime\')}'
- });
- } ;
- document.getElementById('endTime').onfocus=function(){
- //这里设置了最大日期为当前日期,如果不需要则把maxDate:'%y-%M-%d'去掉
- WdatePicker({skin:dateSkin,minDate:'#F{$dp.$D(\'beginTime\')}'});
- };
-
- document.getElementById('beginTimeByEr').onfocus=function(){
- var endtimeTf=$dp.$('endTimeByEr');
- WdatePicker({
- skin:dateSkin,onpicked:function(){endtimeTf.focus();},maxDate:'#F{$dp.$D(\'endTimeByEr\')}'
- });
- } ;
- document.getElementById('endTimeByEr').onfocus=function(){
- //这里设置了最大日期为当前日期,如果不需要则把maxDate:'%y-%M-%d'去掉
- WdatePicker({skin:dateSkin,minDate:'#F{$dp.$D(\'beginTimeByEr\')}'});
- };
- } ;
- ///**
- // * 得到日期类型时间yyyy-mm-dd hh:mm:ss
- // * @returns {String}
- // */
- //function getNowFormatDate(){
- // var date = allGetServerTime() ;
- //
- // return date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + " " +
- // date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds() ;
- //} ;
- ///**
- // * 得到日期类型时间yyyy-mm-dd hh:mm:ss
- // * @returns {String}
- // */
- //function getNowFormatDate(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 ;
- //} ;
- /**
- * 得到单个sql精确查询条件
- * @param colum
- * @param value
- * @return
- */
- function getOneSqlWhere(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模糊查询条件
- * @param colum
- * @param value
- * @return
- */
- function getOneSqlWhereLike(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 ;
-
- } ;
- //============================================================= SearchToewer.js END ===============================================
- //============================================================= Er_drawTool.js Start ==============================================
- $(function(){
- var yjIncidentUrl = "/nwyj/ws/cockpit/CockpitService/queryYjIncidentByRadio" ;
- $.post(yjIncidentUrl,function(data){
- $("#inic").data("data", data) ;
- $("#inic").attr("selectedValue",data["list"]["0"]["value"]);
- $("#inic").render() ;
- }, "json") ;
- });
-
- /**
- * 保存
- * @returns
- */
- function erSave(){
- var inicID = $("#inic").attr("relValue") ;
- if(!inicID){
- alert("请选择事件名称") ;
- } else {
- saveDraw(inicID) ;
- // window.parent.window.saveDraw(inicID) ;//分类存储
- // window.parent.window.saveDrawByUser(inicID) ;//以图层整体进行存储
- // window.parent.window.importDrawByUser(inicID) ;//导入图层
- } ;
- } ;
- /**
- * 根据事件查看用户自定义图形
- */
- function showDraw(){
- var inicID = $("#inic").attr("relValue") ;
- if(!inicID){
- alert("请选择事件名称") ;
- } else {
- var inicID = $("#inic").attr("relValue") ;
- searchDrawByUserInfo(inicID) ;
- // window.parent.window.searchDrawByUserInfo(inicID) ;
- }
- }
- //============================================================= Er_drawTool.js END ================================================
- //============================================================= SearchToteam.js Start =============================================
- $(function(){
-
- //轨迹回放
- $("#roadHistory").click(function(){
- var inciId = $("#teamInci").attr("relValue") ;
- var teamId = $("#teamByInci").attr("relValue") ;
- var beginTime = $("#beginTime").attr("value") ;
- var endTime = $("#endTime").attr("value") ;
-
- if(beginTime != "" && endTime == "")
- endTime = getNowFormatDate() ;
-
- if(beginTime == "" && endTime != ""){
- alert("请选择开始时间") ;
- } else {
- if(beginTime == "" && endTime == ""){
- beginTime = getNowFormatDate(allGetServerTime());
- beginTime = getThreeMonthsAgo(beginTime) ;
- endTime = getNowFormatDate(allGetServerTime()) ;
- var params = { inci : inciId, teamid : teamId, beginTime : beginTime, endTime : endTime } ;
- // window.parent.window.roadHistory(params) ;
- roadHistory(params) ;
-
- } else {
- var params = { inci : inciId, teamid : teamId, beginTime : beginTime, endTime : endTime } ;
- // window.parent.window.roadHistory(params) ;
- roadHistory(params) ;
- }
-
- }
- });
-
- }) ;
- function searchErTeam(){
- var inci = $("#teamInci").attr("relValue") ;
-
- window.parent.window.searchErTeam(inci) ;
- } ;
- /**
- * 针对事件下拉复选框改变应急队伍选择框
- */
- function changeTameSelect(inciIds){
- var tameUrl = "/nwyj/ws/cockpit/CockpitService/queryTeamByInci" ;
- // var tameUrl = "/nwyj/ws/cockpit/CockpitService/queryYjIncidentByRadio" ;
- var params = { teaminciId:inciIds } ;
-
- $.post(tameUrl,params,function(data){
- if(data){
- $("#teamByInci").data("data", data) ;
- $("#teamByInci").render() ;
- } else {
- $("#teamByInci").data("data", data) ;
- $("#teamByInci").render() ;
- }
-
- },"json") ;
- }
- /**
- * @author jyf
- * @version 1.0
- * @Date 2015-09-23
- * @param 经纬度坐标转换为墨卡托投影下的坐标
- */
- function lonlat2mercator(x1,y1,x2,y2){
- var lonlat = [x1,y1,x2,y2];
- var Mx1 = lonlat[0] *20037508.34/180;
- var My1 = Math.log(Math.tan((90+lonlat[1])*Math.PI/360))/(Math.PI/180);
- My1 = My1 *20037508.34/180;
-
- var Mx2 = lonlat[2] *20037508.34/180;
- var My2 = Math.log(Math.tan((90+lonlat[3])*Math.PI/360))/(Math.PI/180);
- My2 = My2 *20037508.34/180;
-
- MercatorX1=Mx1;
- MercatorY1=My1;
- MercatorX2=Mx2;
- MercatorY2=My2;
- };
- /**
- * @author jyf
- * @version 1.0
- * @Date 2015-09-23
- * @param 计算转换为墨卡托投影下两点之间的距离
- */
- function scalcRegan(x1,y1,x2,y2)
- {
- var lat = [x1, y1];
- var lng = [x2, y2];
- MercatorRange=(Math.sqrt((lat[0]-lng[0])*(lat[0]-lng[0])+(lat[1]-lng[1])*(lat[1]-lng[1])))/1000;
- };
|