company.js.20210128.bak 90 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613
  1. /**
  2. * company.js
  3. */
  4. var basePath;
  5. var company_code;
  6. var V_LOGINNAME;
  7. var V_PASSWORD;
  8. var storeTime = 60000;
  9. var buildingStore=null,companyStore=null,devicesStore=null;
  10. var building_name;
  11. var max_level=0;
  12. var min_level=0;
  13. var top_level=0;
  14. var default_check = 65535;
  15. var myMask;
  16. var show_project_info = true;
  17. var start=0;
  18. var end = 360;
  19. var theme;
  20. var vAlarmInfoWin;
  21. var online_video = false;
  22. var onair_video = false;
  23. var ConfirmStore;
  24. var had_play = false;
  25. var fillvalue = false;
  26. Ext.Loader.setConfig({
  27. enabled: true
  28. });
  29. Ext.Loader.setPath('Ext.ux', '../../res/extjs/examples/ux');
  30. Ext.require([
  31. 'Ext.grid.*',
  32. 'Ext.data.*',
  33. 'Ext.ux.RowExpander',
  34. 'Ext.selection.CheckboxModel'
  35. ]);
  36. var bak_to_front = function(){
  37. location.href = basePath+'view/frontpage/map.jsp?company_code='+company_code;
  38. }
  39. var staSortBypoint = function(a,b){
  40. return a.point_code-b.point_code;;
  41. }
  42. var body_resize = function() {
  43. $("#company_bg_mm").css('display','none');
  44. if($(document).innerWidth()>=1820){
  45. $("#company_bg_tm").css('display','block');
  46. $("#company_bg_tm").css('width',($(document).innerWidth()-1820)+'px');
  47. $("#company_bg_bm").css('display','block');
  48. $("#company_bg_bm").css('width',($(document).innerWidth()-1820)+'px');
  49. }else{
  50. $("#company_bg_tm").css('display','none');
  51. $("#company_bg_bm").css('display','none');
  52. }
  53. if($(document).innerHeight()>=932){
  54. $("#company_bg_ml").css('display','block');
  55. $("#company_bg_mr").css('display','block');
  56. $("#company_bg_ml").css('height',($(document).innerHeight()-932)+'px');
  57. $("#company_bg_mr").css('height',($(document).innerHeight()-932)+'px');
  58. if($(document).innerWidth()>=1820){
  59. $("#company_bg_mm").css('display','block');
  60. $("#company_bg_mm").css('height',($(document).innerHeight()-932)+'px');
  61. $("#company_bg_mm").css('width',($(document).innerWidth()-1820)+'px');
  62. }
  63. }else{
  64. $("#company_bg_ml").css('display','none');
  65. $("#company_bg_mr").css('display','none');
  66. }
  67. $("#company_building").css('height',($(document).innerHeight()-365)+'px');
  68. $("#history_alarm_list").css('width',($(document).innerWidth()-975)+'px');
  69. $("#history_alarm_list").css('height',($(document).innerHeight()-616)+'px');
  70. $("#project_info_bar").css('width',($(document).innerWidth()-975)+'px');
  71. }
  72. var chk_click = function(obj){
  73. if((obj.id=='dev_all_checkbox')||(obj.id=='dev_all_checklabel')){
  74. if(default_check!=65535)
  75. default_check=65535;
  76. else
  77. default_check=0;
  78. }else if((obj.id=='dev_ui_checkbox')||(obj.id=='dev_ui_checklabel')){
  79. if((default_check&1)==1)
  80. default_check = (default_check&65534);
  81. else
  82. default_check = (default_check|1);
  83. }else if((obj.id=='dev_fc_checkbox')||(obj.id=='dev_fc_checklabel')){
  84. if((default_check&2)==2)
  85. default_check = (default_check&65533);
  86. else
  87. default_check = (default_check|2);
  88. }else if((obj.id=='dev_ef_checkbox')||(obj.id=='dev_ef_checklabel')){
  89. if((default_check&4)==4)
  90. default_check = (default_check&65531);
  91. else
  92. default_check = (default_check|4);
  93. }else if((obj.id=='dev_wp_checkbox')||(obj.id=='dev_wp_checklabel')){
  94. if((default_check&8)==8)
  95. default_check = (default_check&65527);
  96. else
  97. default_check = (default_check|8);
  98. }else if((obj.id=='dev_ll_checkbox')||(obj.id=='dev_ll_checklabel')){
  99. if((default_check&16)==16)
  100. default_check = (default_check&65519);
  101. else
  102. default_check = (default_check|16);
  103. }else if((obj.id=='dev_ci_checkbox')||(obj.id=='dev_ci_checklabel')){
  104. if((default_check&32)==32)
  105. default_check = (default_check&65503);
  106. else
  107. default_check = (default_check|32);
  108. }else if((obj.id=='dev_va_checkbox')||(obj.id=='dev_va_checklabel')){
  109. if((default_check&64)==64)
  110. default_check = (default_check&65471);
  111. else
  112. default_check = (default_check|64);
  113. }else if((obj.id=='dev_ot_checkbox')||(obj.id=='dev_ot_checklabel')){
  114. if((default_check&128)==128)
  115. default_check = (default_check&65407);
  116. else
  117. default_check = (default_check|128);
  118. }else if((obj.id=='dev_sm_checkbox')||(obj.id=='dev_sm_checklabel')){
  119. if((default_check&256)==256)
  120. default_check = (default_check&65279);
  121. else
  122. default_check = (default_check|256);
  123. }
  124. if(default_check==0){
  125. $("#dev_all_checkbox").removeClass('dev_checkbox');
  126. $("#dev_all_checkbox").removeClass('dev_few_checkbox');
  127. $("#dev_all_checkbox").addClass('dev_uncheckbox');
  128. }else if(default_check==65535){
  129. $("#dev_all_checkbox").removeClass('dev_uncheckbox');
  130. $("#dev_all_checkbox").removeClass('dev_few_checkbox');
  131. $("#dev_all_checkbox").addClass('dev_checkbox');
  132. }else{
  133. $("#dev_all_checkbox").removeClass('dev_uncheckbox');
  134. $("#dev_all_checkbox").removeClass('dev_checkbox');
  135. $("#dev_all_checkbox").addClass('dev_few_checkbox');
  136. }
  137. if((default_check&1)==1){
  138. $("#dev_ui_checkbox").removeClass('dev_uncheckbox');
  139. $("#dev_ui_checkbox").addClass('dev_checkbox');
  140. }else{
  141. $("#dev_ui_checkbox").removeClass('dev_checkbox');
  142. $("#dev_ui_checkbox").addClass('dev_uncheckbox');
  143. }
  144. if((default_check&2)==2){
  145. $("#dev_fc_checkbox").removeClass('dev_uncheckbox');
  146. $("#dev_fc_checkbox").addClass('dev_checkbox');
  147. }else{
  148. $("#dev_fc_checkbox").removeClass('dev_checkbox');
  149. $("#dev_fc_checkbox").addClass('dev_uncheckbox');
  150. }
  151. if((default_check&4)==4){
  152. $("#dev_ef_checkbox").removeClass('dev_uncheckbox');
  153. $("#dev_ef_checkbox").addClass('dev_checkbox');
  154. }else{
  155. $("#dev_ef_checkbox").removeClass('dev_checkbox');
  156. $("#dev_ef_checkbox").addClass('dev_uncheckbox');
  157. }
  158. if((default_check&8)==8){
  159. $("#dev_wp_checkbox").removeClass('dev_uncheckbox');
  160. $("#dev_wp_checkbox").addClass('dev_checkbox');
  161. }else{
  162. $("#dev_wp_checkbox").removeClass('dev_checkbox');
  163. $("#dev_wp_checkbox").addClass('dev_uncheckbox');
  164. }
  165. if((default_check&16)==16){
  166. $("#dev_ll_checkbox").removeClass('dev_uncheckbox');
  167. $("#dev_ll_checkbox").addClass('dev_checkbox');
  168. }else{
  169. $("#dev_ll_checkbox").removeClass('dev_checkbox');
  170. $("#dev_ll_checkbox").addClass('dev_uncheckbox');
  171. }
  172. if((default_check&32)==32){
  173. $("#dev_ci_checkbox").removeClass('dev_uncheckbox');
  174. $("#dev_ci_checkbox").addClass('dev_checkbox');
  175. }else{
  176. $("#dev_ci_checkbox").removeClass('dev_checkbox');
  177. $("#dev_ci_checkbox").addClass('dev_uncheckbox');
  178. }
  179. if((default_check&64)==64){
  180. $("#dev_va_checkbox").removeClass('dev_uncheckbox');
  181. $("#dev_va_checkbox").addClass('dev_checkbox');
  182. }else{
  183. $("#dev_va_checkbox").removeClass('dev_checkbox');
  184. $("#dev_va_checkbox").addClass('dev_uncheckbox');
  185. }
  186. if((default_check&128)==128){
  187. $("#dev_ot_checkbox").removeClass('dev_uncheckbox');
  188. $("#dev_ot_checkbox").addClass('dev_checkbox');
  189. }else{
  190. $("#dev_ot_checkbox").removeClass('dev_checkbox');
  191. $("#dev_ot_checkbox").addClass('dev_uncheckbox');
  192. }
  193. if((default_check&256)==256){
  194. $("#dev_sm_checkbox").removeClass('dev_uncheckbox');
  195. $("#dev_sm_checkbox").addClass('dev_checkbox');
  196. }else{
  197. $("#dev_sm_checkbox").removeClass('dev_checkbox');
  198. $("#dev_sm_checkbox").addClass('dev_uncheckbox');
  199. }
  200. bak_reset();
  201. }
  202. var chk_empty_level = function (level){
  203. for(var i=0;i<buildingStore.length;i++){
  204. if(buildingStore[i].min_level==level){
  205. if(((default_check&1)==1)&&(buildingStore[i].dwtype=='YTUI'))
  206. return false;
  207. else if(((default_check&2)==2)&&(buildingStore[i].dwtype=='YTFC'))
  208. return false;
  209. else if(((default_check&4)==4)&&(buildingStore[i].dwtype=='YTEF'))
  210. return false;
  211. else if(((default_check&8)==8)&&(buildingStore[i].dwtype=='YTWP'))
  212. return false;
  213. else if(((default_check&16)==16)&&(buildingStore[i].dwtype=='YTLL'))
  214. return false;
  215. else if(((default_check&32)==32)&&(buildingStore[i].dwtype=='YTCI'))
  216. return false;
  217. else if(((default_check&64)==64)&&(buildingStore[i].dwtype=='YTVA'))
  218. return false;
  219. else if(((default_check&128)==128)&&(buildingStore[i].dwtype=='YTWC'))
  220. return false;
  221. else if(((default_check&256)==256)&&(buildingStore[i].dwtype=='YTSM'))
  222. return false;
  223. else if(((default_check&512)==512)&&(buildingStore[i].dwtype=='YTMC'))
  224. return false;
  225. else if(((default_check&1024)==1024)&&(buildingStore[i].dwtype=='YTFH'))
  226. return false;
  227. }
  228. }
  229. return true;
  230. }
  231. var draw_buinding = function(){
  232. var building_icon_height = 0;
  233. $("#building_level_count").html(max_level);
  234. var company_building = document.getElementById('company_building');
  235. company_building.innerHTML='';
  236. var currett_build = document.createElement('div');
  237. company_building.appendChild(currett_build)
  238. var building_top = document.createElement('div');
  239. building_top.setAttribute('class','building_top');
  240. building_top.style.top='0px';
  241. currett_build.appendChild(building_top);
  242. building_icon_height += 120;
  243. var top_info = document.createElement('div');
  244. top_info.id = "building_top_info";
  245. top_info.setAttribute('class','building_top_label');
  246. top_info.innerHTML='RF';
  247. building_top.appendChild(top_info);
  248. var top_icon = document.createElement('div');
  249. top_icon.setAttribute('class','building_top_icon');
  250. building_top.appendChild(top_icon);
  251. if(max_level>0){
  252. var last_empty = max_level+2;
  253. var first_empty = max_level+2;
  254. for(var i=max_level;i>0;i--){
  255. if(chk_empty_level(i)){
  256. if(last_empty!=(i+1)){
  257. first_empty=i;
  258. last_empty=i;
  259. var build_level = document.createElement('div');
  260. build_level.setAttribute('class','building_level');
  261. build_level.style.top=(building_icon_height-60)+'px';
  262. currett_build.appendChild(build_level);
  263. building_icon_height += 48;
  264. var level_info = document.createElement('div');
  265. level_info.id = "building_empty_level_info_"+i;
  266. level_info.setAttribute('class','building_level_info')
  267. level_info.innerHTML=i+'F';
  268. build_level.appendChild(level_info);
  269. var level_icon = document.createElement('div');
  270. level_icon.setAttribute('class','building_empty_level_icon');
  271. build_level.appendChild(level_icon);
  272. }else{
  273. var level_info = document.getElementById('building_empty_level_info_'+first_empty);
  274. if(level_info!=undefined)
  275. level_info.innerHTML=i+'F~'+first_empty+'F';
  276. last_empty = i;
  277. }
  278. }else{
  279. var build_level = document.createElement('div');
  280. build_level.setAttribute('class','building_level');
  281. build_level.style.top=(building_icon_height-60)+'px';
  282. currett_build.appendChild(build_level);
  283. building_icon_height += 48;
  284. var level_info = document.createElement('div');
  285. level_info.id = "building_level_info_"+i;
  286. level_info.setAttribute('class','building_level_info')
  287. level_info.innerHTML=i+'F';
  288. build_level.appendChild(level_info);
  289. var level_icon = document.createElement('div');
  290. level_icon.setAttribute('class','building_level_icon');
  291. build_level.appendChild(level_icon);
  292. }
  293. }
  294. }
  295. if(min_level<0){
  296. for(var i=-1; i>=min_level;i--){
  297. var base_level = document.createElement('div');
  298. base_level.setAttribute('class','building_base');
  299. base_level.style.top=(building_icon_height-60)+'px';
  300. currett_build.appendChild(base_level);
  301. building_icon_height += 48;
  302. var base_info = document.createElement('div');
  303. base_info.id = 'building_base_info_'+(0-i);
  304. base_info.setAttribute('class','building_base_info');
  305. base_info.innerHTML='B'+(0-i)+'F';
  306. base_level.appendChild(base_info);
  307. var base_icon = document.createElement('div');
  308. base_icon.setAttribute('class','building_base_icon');
  309. base_level.appendChild(base_icon);
  310. }
  311. }
  312. $("#company_building").css('height',($(document).innerHeight()-365)+'px');
  313. building_icon_height += 60;
  314. currett_build.style.marginLeft='59px';
  315. currett_build.style.marginRight='59px';
  316. currett_build.style.width='536px';
  317. if((buildingStore!=null)&&(buildingStore.length>0)){
  318. for(var i=0;i<buildingStore.length;i++){
  319. var iconid = buildingStore[i].dwtype+'_'+buildingStore[i].min_level;
  320. var icon = document.getElementById(iconid);
  321. if(icon==undefined){
  322. icon = document.createElement('div');
  323. icon.id= buildingStore[i].dwtype+'_'+buildingStore[i].min_level;
  324. icon.dwtype = buildingStore[i].dwtype;
  325. icon.level = buildingStore[i].min_level;
  326. icon.owner_code = buildingStore[i].owner_code;
  327. icon.style.position='absolute';
  328. icon.style.width='62px';
  329. icon.style.height='62px';
  330. icon.style.cursor='pointer';
  331. icon.setAttribute('onclick','icon_click(this)');
  332. currett_build.appendChild(icon);
  333. var this_min_level = buildingStore[i].min_level;
  334. var level_label = document.getElementById("building_level_info_"+this_min_level);
  335. if(this_min_level==top_level){
  336. level_label = document.getElementById('building_top_info');
  337. }else if(this_min_level<0){
  338. level_label = document.getElementById('building_base_info_'+(0-this_min_level));
  339. }
  340. if(level_label!=null){
  341. if(buildingStore[i].dwtype=='YTUI'){
  342. if((default_check&1)==1){
  343. icon.title='用户传输装置';
  344. icon.style.top = (level_label.offsetParent.offsetTop+1)+'px'
  345. icon.style.left = (level_label.offsetParent.offsetLeft+28)+'px';
  346. icon.style.backgroundImage='url(../../res/img/icons/ui_icon.png)';
  347. }
  348. }else if(buildingStore[i].dwtype=='YTFC'){
  349. if((default_check&2)==2){
  350. icon.title='消防控制柜';
  351. icon.style.top = (level_label.offsetParent.offsetTop+15)+'px'
  352. icon.style.left = (level_label.offsetParent.offsetLeft+68)+'px';
  353. icon.style.backgroundImage='url(../../res/img/icons/fc_icon.png)';
  354. }
  355. }else if(buildingStore[i].dwtype=='YTEF'){
  356. if((default_check&4)==4){
  357. icon.title='电气火灾';
  358. icon.style.top = (level_label.offsetParent.offsetTop+29)+'px'
  359. icon.style.left = (level_label.offsetParent.offsetLeft+108)+'px';
  360. icon.style.backgroundImage='url(../../res/img/icons/ef_icon.png)';
  361. }
  362. }else if(buildingStore[i].dwtype=='YTWP'){
  363. if((default_check&8)==8){
  364. icon.title='水压';
  365. icon.style.top = (level_label.offsetParent.offsetTop+43)+'px'
  366. icon.style.left = (level_label.offsetParent.offsetLeft+148)+'px';
  367. icon.style.backgroundImage='url(../../res/img/icons/wp0_icon.png)';
  368. }
  369. }else if(buildingStore[i].dwtype=='YTLL'){
  370. if((default_check&16)==16){
  371. icon.title='液位';
  372. icon.style.top = (level_label.offsetParent.offsetTop+48)+'px'
  373. icon.style.left = (level_label.offsetParent.offsetLeft+188)+'px';
  374. icon.style.backgroundImage='url(../../res/img/icons/ll_icon.png)';
  375. }
  376. }else if(buildingStore[i].dwtype=='YTCI'){
  377. if((default_check&32)==32){
  378. icon.title='环境监测';
  379. icon.style.top = (level_label.offsetParent.offsetTop+43)+'px'
  380. icon.style.left = (level_label.offsetParent.offsetLeft+228)+'px';
  381. icon.style.backgroundImage='url(../../res/img/icons/ci_icon.png)';
  382. }
  383. }else if(buildingStore[i].dwtype=='YTVA'){
  384. if((default_check&64)==64){
  385. icon.title='视频监控';
  386. icon.style.top = (level_label.offsetParent.offsetTop+29)+'px'
  387. icon.style.left = (level_label.offsetParent.offsetLeft+268)+'px';
  388. icon.style.backgroundImage='url(../../res/img/icons/va_icon.png)';
  389. }
  390. }else if(buildingStore[i].dwtype=='YTWC'){
  391. if((default_check&128)==128){
  392. icon.title='风机控制柜';
  393. icon.style.top = (level_label.offsetParent.offsetTop+15)+'px'
  394. icon.style.left = (level_label.offsetParent.offsetLeft+308)+'px';
  395. icon.style.backgroundImage='url(../../res/img/icons/wc_icon.png)';
  396. }
  397. }else if(buildingStore[i].dwtype=='YTSM'){
  398. if((default_check&256)==256){
  399. icon.title='烟感';
  400. icon.style.top = (level_label.offsetParent.offsetTop+1)+'px';
  401. icon.style.left = (level_label.offsetParent.offsetLeft+348)+'px';
  402. icon.style.backgroundImage='url(../../res/img/icons/sm_icon.png)';
  403. }
  404. }else if(buildingStore[i].dwtype=='YTMC'){
  405. if((default_check&512)==512){
  406. icon.title='井盖监测';
  407. icon.style.top = (level_label.offsetParent.offsetTop+8)+'px';
  408. icon.style.left = (level_label.offsetParent.offsetLeft+328)+'px';
  409. icon.style.backgroundImage='url(../../res/img/icons/mc_icon.png)';
  410. }
  411. }else if(buildingStore[i].dwtype=='YTFH'){
  412. if((default_check&1024)==1024){
  413. icon.title='消火栓监测';
  414. icon.style.top = (level_label.offsetParent.offsetTop+20)+'px';
  415. icon.style.left = (level_label.offsetParent.offsetLeft+288)+'px';
  416. icon.style.backgroundImage='url(../../res/img/icons/fh_icon.png)';
  417. }
  418. }
  419. }
  420. }else
  421. icon.owner_code="";
  422. }
  423. }
  424. if(show_project_info){
  425. var project_info_bar = document.getElementById('project_info_bar');
  426. project_info_bar.innerHTML='';
  427. var project_label = document.createElement('div');
  428. project_label.setAttribute('class','project_label');
  429. project_label.style.position='absolute';
  430. project_label.style.top='30px';
  431. project_label.style.left='50px';
  432. project_label.innerHTML='项目名称';
  433. project_info_bar.appendChild(project_label);
  434. var project_info = document.createElement('div');;
  435. project_info.setAttribute('class','project_info');
  436. project_info.style.position='absolute';
  437. project_info.style.top='60px';
  438. project_info.style.left='50px';
  439. project_info.innerHTML=companyStore.company_name;
  440. project_info_bar.appendChild(project_info);
  441. project_label = document.createElement('div');
  442. project_label.setAttribute('class','project_label');
  443. project_label.style.position='absolute';
  444. project_label.style.top='110px';
  445. project_label.style.left='50px';
  446. project_label.innerHTML='项目地址';
  447. project_info_bar.appendChild(project_label);
  448. project_info = document.createElement('div');;
  449. project_info.setAttribute('class','project_info');
  450. project_info.style.position='absolute';
  451. project_info.style.top='140px';
  452. project_info.style.left='50px';
  453. project_info.innerHTML=companyStore.address;
  454. project_info_bar.appendChild(project_info);
  455. project_label = document.createElement('div');
  456. project_label.setAttribute('class','project_label');
  457. project_label.style.position='absolute';
  458. project_label.style.top='190px';
  459. project_label.style.left='50px';
  460. project_label.innerHTML='项目坐标';
  461. project_info_bar.appendChild(project_label);
  462. project_info = document.createElement('div');;
  463. project_info.setAttribute('class','project_info');
  464. project_info.style.position='absolute';
  465. project_info.style.top='220px';
  466. project_info.style.left='50px';
  467. project_info.innerHTML=companyStore.lng+','+companyStore.lat;
  468. project_info_bar.appendChild(project_info);
  469. project_label = document.createElement('div');
  470. project_label.setAttribute('class','project_label');
  471. project_label.style.position='absolute';
  472. project_label.style.top='30px';
  473. project_label.style.left='480px';
  474. project_label.innerHTML='联系人';
  475. project_info_bar.appendChild(project_label);
  476. project_info = document.createElement('div');;
  477. project_info.setAttribute('class','project_info');
  478. project_info.style.position='absolute';
  479. project_info.style.top='60px';
  480. project_info.style.left='480px';
  481. project_info.innerHTML=companyStore.username;
  482. project_info_bar.appendChild(project_info);
  483. project_label = document.createElement('div');
  484. project_label.setAttribute('class','project_label');
  485. project_label.style.position='absolute';
  486. project_label.style.top='110px';
  487. project_label.style.left='480px';
  488. project_label.innerHTML='联系电话';
  489. project_info_bar.appendChild(project_label);
  490. project_info = document.createElement('div');;
  491. project_info.setAttribute('class','project_info');
  492. project_info.style.position='absolute';
  493. project_info.style.top='140px';
  494. project_info.style.left='480px';
  495. project_info.innerHTML=companyStore.phone;
  496. project_info_bar.appendChild(project_info);
  497. var history_alarm_list = document.getElementById('history_alarm_list');
  498. history_alarm_list.innerHTML='';
  499. var table = document.createElement('table');
  500. table.width='100%';
  501. history_alarm_list.appendChild(table);
  502. var tr = document.createElement('tr');
  503. table.appendChild(tr);
  504. if(V_LOGINNAME=="ypxy"){
  505. var dwtypelist = [1,7,2,2,16];
  506. for(var i=0;i<5;i++){
  507. var td = document.createElement('td');
  508. td.setAttribute('colspan','2');
  509. td.setAttribute('style','width:128px;');
  510. td.setAttribute('class','data_bar_title');
  511. td.style.textAlign='center';
  512. td.style.paddingTop='15px';
  513. if(i==4){
  514. }else{
  515. td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  516. }
  517. if(i==0)
  518. td.innerHTML='智能烟感监控';
  519. else if(i==1)
  520. td.innerHTML='电气火灾监控';
  521. else if(i==2)
  522. td.innerHTML='智能水表监控';
  523. else if(i==3)
  524. td.innerHTML='智能消火栓监控';
  525. // else if(i==4)
  526. // td.innerHTML='视频告警监控'
  527. else
  528. td.innerHTML='智能井盖监控'
  529. tr.appendChild(td);
  530. }
  531. tr = document.createElement('tr');
  532. table.appendChild(tr);
  533. for(var i=0;i<5;i++){
  534. var td = document.createElement('td');
  535. td.setAttribute('class','data_bar_total_label');
  536. td.style.textAlign='right';
  537. td.width='10%';
  538. td.innerHTML='设备总数';
  539. if(i!=4){
  540. td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  541. }
  542. tr.appendChild(td);
  543. td = document.createElement('td');
  544. td.setAttribute('class','data_bar_total_number');
  545. td.style.textAlign='left';
  546. td.style.paddingLeft='10px';
  547. if(i!=4){
  548. td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  549. }
  550. if(i==0)
  551. td.innerHTML=companyStore.d1;
  552. else if(i==1)
  553. td.innerHTML=companyStore.d7;
  554. else if(i==2)
  555. td.innerHTML=companyStore.d2;
  556. else if(i==3)
  557. td.innerHTML=companyStore.d2;
  558. // else if(i==4)
  559. // td.innerHTML=companyStore.d16;
  560. else
  561. //td.innerHTML=companyStore.d17;
  562. td.innerHTML=3;
  563. tr.appendChild(td);
  564. }
  565. tr = document.createElement('tr');
  566. table.appendChild(tr);
  567. for(var i=0;i<5;i++){
  568. var td = document.createElement('td');
  569. td.setAttribute('class','data_bar_total_label');
  570. td.style.textAlign='right';
  571. td.width='10%';
  572. td.innerHTML='已处理';
  573. if(i!=4){
  574. td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  575. }
  576. tr.appendChild(td);
  577. td = document.createElement('td');
  578. td.setAttribute('class','device_confirm_num1');
  579. td.style.textAlign='left';
  580. td.style.paddingLeft='10px';
  581. if(i!=4){
  582. td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  583. }
  584. if(i==0)
  585. td.innerHTML=companyStore.d1ac;
  586. else if(i==1)
  587. td.innerHTML=companyStore.d7ac;
  588. else if(i==2)
  589. td.innerHTML=companyStore.d2ac;
  590. else if(i==3)
  591. td.innerHTML=companyStore.d2ac;
  592. // else if(i==4)
  593. // td.innerHTML=companyStore.d16ac;
  594. else
  595. //td.innerHTML=companyStore.d17ac;
  596. td.innerHTML=0;
  597. tr.appendChild(td);
  598. }
  599. tr = document.createElement('tr');
  600. table.appendChild(tr);
  601. for(var i=0;i<5;i++){
  602. var td = document.createElement('td');
  603. td.setAttribute('class','data_bar_total_label');
  604. td.style.textAlign='right';
  605. td.width='10%';
  606. td.innerHTML='待处理';
  607. if(i!=4){
  608. td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  609. }
  610. // td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  611. tr.appendChild(td);
  612. td = document.createElement('td');
  613. td.setAttribute('class','device_confirm_num2');
  614. td.style.textAlign='left';
  615. td.style.paddingLeft='10px';
  616. if(i!=4){
  617. td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  618. }
  619. // td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  620. if(i==0)
  621. td.innerHTML=companyStore.d1a-companyStore.d1ac;
  622. else if(i==1)
  623. td.innerHTML=companyStore.d7a-companyStore.d7ac;
  624. else if(i==2)
  625. td.innerHTML=companyStore.d2a-companyStore.d2ac;
  626. else if(i==3)
  627. td.innerHTML=companyStore.d6a-companyStore.d2ac;
  628. // else if(i==4)
  629. // td.innerHTML=companyStore.d16a-companyStore.d16ac;
  630. else
  631. //td.innerHTML=companyStore.d17a-companyStore.d17ac;
  632. td.innerHTML=0;
  633. tr.appendChild(td);
  634. }
  635. tr = document.createElement('tr');
  636. table.appendChild(tr);
  637. for(var i=0;i<5;i++){
  638. var td = document.createElement('td');
  639. td.setAttribute('colspan','2');
  640. tr.appendChild(td);
  641. var div = document.createElement('div');
  642. div.id = 'alarm_pie_'+i;
  643. div.style.margin='10px auto 10px auto';
  644. div.style.width='110px';
  645. if(i!=4){
  646. td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  647. }
  648. // td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  649. td.appendChild(div);
  650. }
  651. draw_pie('alarm_pie_0',companyStore.d1a,companyStore.d1ac);
  652. draw_pie('alarm_pie_1',companyStore.d7a,companyStore.d7ac);
  653. draw_pie('alarm_pie_2',companyStore.d2a,companyStore.d2ac);
  654. draw_pie('alarm_pie_3',companyStore.d6a,companyStore.d2ac);
  655. draw_pie('alarm_pie_4',0);
  656. //draw_pie('alarm_pie_5',companyStore.d17a,companyStore.d17ac);
  657. // draw_pie('alarm_pie_5',0);
  658. }else{
  659. var dwtypelist = [1,7,2,6,16,17];
  660. for(var i=0;i<6;i++){
  661. var td = document.createElement('td');
  662. td.setAttribute('colspan','2');
  663. td.setAttribute('style','width:128px;');
  664. td.setAttribute('class','data_bar_title');
  665. td.style.textAlign='center';
  666. td.style.paddingTop='15px';
  667. td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  668. if(i==0)
  669. td.innerHTML='火灾监控';
  670. else if(i==1)
  671. td.innerHTML='电气火灾监控';
  672. else if(i==2)
  673. td.innerHTML='水系统监控';
  674. else if(i==3)
  675. td.innerHTML='RTU监控';
  676. else if(i==4)
  677. td.innerHTML='视频告警监控'
  678. else
  679. td.innerHTML='电梯告警监控'
  680. tr.appendChild(td);
  681. }
  682. tr = document.createElement('tr');
  683. table.appendChild(tr);
  684. for(var i=0;i<6;i++){
  685. var td = document.createElement('td');
  686. td.setAttribute('class','data_bar_total_label');
  687. td.style.textAlign='right';
  688. td.width='10%';
  689. td.innerHTML='设备总数';
  690. td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  691. tr.appendChild(td);
  692. td = document.createElement('td');
  693. td.setAttribute('class','data_bar_total_number');
  694. td.style.textAlign='left';
  695. td.style.paddingLeft='10px';
  696. td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  697. if(i==0)
  698. td.innerHTML=companyStore.d1;
  699. else if(i==1)
  700. td.innerHTML=companyStore.d7;
  701. else if(i==2)
  702. td.innerHTML=companyStore.d2;
  703. else if(i==3)
  704. td.innerHTML=companyStore.d6;
  705. else if(i==4)
  706. td.innerHTML=companyStore.d16;
  707. else
  708. //td.innerHTML=companyStore.d17;
  709. td.innerHTML=0;
  710. tr.appendChild(td);
  711. }
  712. tr = document.createElement('tr');
  713. table.appendChild(tr);
  714. for(var i=0;i<6;i++){
  715. var td = document.createElement('td');
  716. td.setAttribute('class','data_bar_total_label');
  717. td.style.textAlign='right';
  718. td.width='10%';
  719. td.innerHTML='已处理';
  720. td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  721. tr.appendChild(td);
  722. td = document.createElement('td');
  723. td.setAttribute('class','device_confirm_num1');
  724. td.style.textAlign='left';
  725. td.style.paddingLeft='10px';
  726. td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  727. if(i==0)
  728. td.innerHTML=companyStore.d1ac;
  729. else if(i==1)
  730. td.innerHTML=companyStore.d7ac;
  731. else if(i==2)
  732. td.innerHTML=companyStore.d2ac;
  733. else if(i==3)
  734. td.innerHTML=companyStore.d6ac;
  735. else if(i==4)
  736. td.innerHTML=companyStore.d16ac;
  737. else
  738. //td.innerHTML=companyStore.d17ac;
  739. td.innerHTML=0;
  740. tr.appendChild(td);
  741. }
  742. tr = document.createElement('tr');
  743. table.appendChild(tr);
  744. for(var i=0;i<6;i++){
  745. var td = document.createElement('td');
  746. td.setAttribute('class','data_bar_total_label');
  747. td.style.textAlign='right';
  748. td.width='10%';
  749. td.innerHTML='待处理';
  750. td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  751. tr.appendChild(td);
  752. td = document.createElement('td');
  753. td.setAttribute('class','device_confirm_num2');
  754. td.style.textAlign='left';
  755. td.style.paddingLeft='10px';
  756. td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  757. if(i==0)
  758. td.innerHTML=companyStore.d1a-companyStore.d1ac;
  759. else if(i==1)
  760. td.innerHTML=companyStore.d7a-companyStore.d7ac;
  761. else if(i==2)
  762. td.innerHTML=companyStore.d2a-companyStore.d2ac;
  763. else if(i==3)
  764. td.innerHTML=companyStore.d6a-companyStore.d6ac;
  765. else if(i==4)
  766. td.innerHTML=companyStore.d16a-companyStore.d16ac;
  767. else
  768. //td.innerHTML=companyStore.d17a-companyStore.d17ac;
  769. td.innerHTML=0;
  770. tr.appendChild(td);
  771. }
  772. tr = document.createElement('tr');
  773. table.appendChild(tr);
  774. for(var i=0;i<6;i++){
  775. var td = document.createElement('td');
  776. td.setAttribute('colspan','2');
  777. tr.appendChild(td);
  778. var div = document.createElement('div');
  779. div.id = 'alarm_pie_'+i;
  780. div.style.margin='10px auto 10px auto';
  781. div.style.width='110px';
  782. td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  783. td.appendChild(div);
  784. }
  785. draw_pie('alarm_pie_0',companyStore.d1a,companyStore.d1ac);
  786. draw_pie('alarm_pie_1',companyStore.d7a,companyStore.d7ac);
  787. draw_pie('alarm_pie_2',companyStore.d2a,companyStore.d2ac);
  788. draw_pie('alarm_pie_3',companyStore.d6a,companyStore.d6ac);
  789. draw_pie('alarm_pie_4',companyStore.d16a,companyStore.d16ac);
  790. //draw_pie('alarm_pie_5',companyStore.d17a,companyStore.d17ac);
  791. draw_pie('alarm_pie_5',0);
  792. }
  793. }else{
  794. var project_info_bar = document.getElementById('project_info_bar');
  795. project_info_bar.innerHTML='';
  796. var history_alarm_list = document.getElementById('history_alarm_list');
  797. history_alarm_list.innerHTML='';
  798. }
  799. }
  800. var show_alarm_list = function(company_code,dwtype){
  801. $("#company_detail_title").removeClass('device_status_title_icon');
  802. $("#company_detail_title").addClass('history_alarm_title_icon');
  803. $("#bak_reset2").removeClass('hiden');
  804. $("#bak_reset2").addClass('shown');
  805. var history_alarm_list = document.getElementById('history_alarm_list');
  806. history_alarm_list.innerHTML='<iframe name="queryPage" src="'+basePath+'view/frontpage/query.jsp?theme='+theme+'&dwtype='+dwtype+'&company_code='+company_code+'" style="width:100%;height:100%;" frameborder="0"></iframe>';
  807. // alert(company_code+','+dwtype);
  808. }
  809. var bak_reset = function(){
  810. $("#company_detail_title").removeClass('history_alarm_title_icon');
  811. $("#company_detail_title").addClass('device_status_title_icon');
  812. $("#company_page_title").removeClass('realtime_title_icon');
  813. $("#company_page_title").addClass('project_title_icon');
  814. $("#bak_reset").removeClass('shown');
  815. $("#bak_reset").addClass('hiden');
  816. $("#bak_reset2").removeClass('shown');
  817. $("#bak_reset2").addClass('hiden');
  818. // $("#history_alarm_list").css('overflow-y','auto');
  819. var v_reset = document.getElementById('v_reset');
  820. if(v_reset!=undefined){
  821. document.body.removeChild(v_reset);
  822. }
  823. var big_view = document.getElementById('big_view');
  824. if(big_view!=undefined){
  825. document.body.removeChild(big_view);
  826. }
  827. show_project_info=true;
  828. draw_buinding();
  829. }
  830. var dev_click = function(obj){
  831. var dwtype = obj.dwtype;
  832. var level = obj.level;
  833. var id = obj.owner_code;
  834. var idx = obj.idx;
  835. show_project_info=false;
  836. // var history_alarm_list = document.getElementById('history_alarm_list');
  837. // history_alarm_list.innerHTML='<iframe name="queryPage" src="'+basePath+'view/frontpage/query.jsp?theme='+theme+'&dwtype='+dwtype+'&level='+level+'&objid='+id+'" style="width:100%;height:100%;" frameborder="0"></iframe>';
  838. show_realtime_status(idx);
  839. if(dwtype=='YTVA'){
  840. onair_video = false;
  841. chk_cideo();
  842. }
  843. }
  844. var icon_click = function(obj){
  845. var dwtype = obj.dwtype;
  846. var level = obj.level;
  847. var id = obj.owner_code;
  848. show_project_info=false;
  849. // $("#company_detail_title").removeClass('device_status_title_icon');
  850. // $("#company_detail_title").addClass('history_alarm_title_icon');
  851. $("#company_page_title").removeClass('project_title_icon');
  852. $("#company_page_title").addClass('realtime_title_icon');
  853. $("#bak_reset").removeClass('hiden');
  854. $("#bak_reset").addClass('shown');
  855. var project_info_bar = document.getElementById('project_info_bar');
  856. project_info_bar.innerHTML='';
  857. var query = new Object();
  858. query.dwtype=dwtype;
  859. query.level=level;
  860. query.V_LOGINNAME = V_LOGINNAME;
  861. query.COMPANY_CODE = company_code;
  862. $.ajax({
  863. type:'POST',
  864. url: basePath+"iot/frontpage/getCurrentStatus",
  865. data: {
  866. queryJson : Ext.JSON.encode(query)
  867. },
  868. success: function(result){
  869. var json = eval('(' + result + ')');
  870. if(json.action=='getCurrentStatus'){
  871. if(json.check==true){
  872. if(json.devices!=undefined){
  873. devicesStore = json.devices;
  874. drawCurrentStatus();
  875. }
  876. }else{
  877. Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function(){
  878. window.parent.document.location=basePath;
  879. });
  880. }
  881. }
  882. myMask.hide();
  883. }
  884. });
  885. // var history_alarm_list = document.getElementById('history_alarm_list');
  886. // history_alarm_list.style.overflowY='hidden';
  887. // history_alarm_list.innerHTML='<iframe name="queryPage" src="'+basePath+'view/frontpage/query.jsp?theme='+theme+'&dwtype='+dwtype+'&level='+level+'&objid='+id+'&company_code='+company_code+'" style="width:100%;height:100%;" frameborder="0"></iframe>';
  888. if(dwtype=='YTVA'){
  889. onair_video = false;
  890. chk_cideo();
  891. }
  892. }
  893. var draw_pie = function(id, total, num){
  894. var mColor= '#34abf5';
  895. var percent = 100;
  896. if(total>0)
  897. percent = Number(((num*100)/total).toString().match(/^\d+(?:\.\d{0,2})?/));
  898. if(percent<60)
  899. mColor = '#f66167';
  900. else if(percent<80)
  901. mColor = '#DDDF0D';
  902. Highcharts.getOptions().colors = Highcharts.map(['#f66167','#34abf5', '#DDDF0D', '#ff2e95', '#39b54a', '#ffb163', '#c233ac', '#9dffad', '#c77051'], function (color) {
  903. return {
  904. radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
  905. stops: [
  906. [0, color],
  907. [1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
  908. ]
  909. };
  910. });
  911. Highcharts.chart(id,{
  912. chart: {
  913. type: 'pie',
  914. backgroundColor: 'rgba(0,0,0,0)',
  915. height:'100%',
  916. options3d: {
  917. enabled: true,
  918. alpha: 45,
  919. beta: 0
  920. }
  921. },
  922. title: {
  923. text: '处置率:'+percent+'%',
  924. floating:true,
  925. y:95,
  926. style:{fontSize:'12px',color:'#ffffff'}
  927. },
  928. exporting: {
  929. enabled: false
  930. },
  931. credits: {
  932. enabled: false
  933. },
  934. tooltip: {
  935. // enabled: false
  936. pointFormat: '{point.percentage:.2f}%'
  937. },
  938. plotOptions: {
  939. pie: {
  940. allowPointSelect: true,
  941. cursor: 'pointer',
  942. depth: 15,
  943. dataLabels: {
  944. enabled: false,
  945. format: '{point.name}'
  946. }
  947. }
  948. },
  949. series: [{
  950. type: 'pie',
  951. name: '处置率',
  952. startAngle:90,
  953. data: [{
  954. name:'待处理',
  955. y:100-percent,
  956. sliced: true,
  957. selected: true
  958. },
  959. ['已处理', percent]
  960. ]
  961. }]
  962. });
  963. }
  964. var drawCurrentStatus = function(){
  965. if((devicesStore!=null)&&(devicesStore.length>0)){
  966. if(onair_video){
  967. onair_video = false;
  968. chk_cideo();
  969. }
  970. var project_info_bar = document.getElementById('project_info_bar');
  971. var device_icon = document.createElement('img');
  972. if(devicesStore[0].dwtype=='YTUI'){
  973. device_icon.setAttribute('class','device_large_icon');
  974. device_icon.src = basePath+'res/img/icons/ui_large_icon.gif';
  975. }else if(devicesStore[0].dwtype=='YTFC'){
  976. device_icon.setAttribute('class','device_large_icon');
  977. device_icon.src = basePath+'res/img/icons/fc_large_icon.gif';
  978. }else if(devicesStore[0].dwtype=='YTCI'){
  979. device_icon.setAttribute('class','device_large_icon');
  980. device_icon.src = basePath+'res/img/icons/ci_large_icon.gif';
  981. }else if(devicesStore[0].dwtype=='YTWP'){
  982. device_icon.setAttribute('class','device_large_icon');
  983. device_icon.src = basePath+'res/img/icons/wp1_large_icon.gif';
  984. }else if(devicesStore[0].dwtype=='YTLL'){
  985. device_icon.setAttribute('class','device_large_icon');
  986. device_icon.src = basePath+'res/img/icons/ll_large_icon.gif';
  987. }else if(devicesStore[0].dwtype=='YTVA'){
  988. device_icon.setAttribute('class','device_large_icon');
  989. device_icon.src = basePath+'res/img/icons/va_large_icon.gif';
  990. }else if(devicesStore[0].dwtype=='YTEF'){
  991. device_icon.setAttribute('class','device_large_icon');
  992. device_icon.src = basePath+'res/img/icons/ef_large_icon.gif';
  993. }else if(devicesStore[0].dwtype=='YTWC'){
  994. device_icon.setAttribute('class','device_large_icon');
  995. device_icon.src = basePath+'res/img/icons/wc_large_icon.gif';
  996. }else if(devicesStore[0].dwtype=='YTSM'){
  997. device_icon.setAttribute('class','device_large_icon');
  998. device_icon.src = basePath+'res/img/icons/sm_large_icon.gif';
  999. }else if(devicesStore[0].dwtype=='YTMC'){
  1000. device_icon.setAttribute('class','device_large_icon');
  1001. device_icon.src = basePath+'res/img/icons/mc_large_icon.gif';
  1002. }else if(devicesStore[0].dwtype=='YTFH'){
  1003. device_icon.setAttribute('class','device_large_icon');
  1004. device_icon.src = basePath+'res/img/icons/fh_large_icon.gif';
  1005. }
  1006. // var device_icon = document.createElement('div');
  1007. // if(devicesStore[0].dwtype=='YTUI'){
  1008. // device_icon.setAttribute('class','device_large_icon ui_large_icon');
  1009. // }else if(devicesStore[0].dwtype=='YTFC'){
  1010. // device_icon.setAttribute('class','device_large_icon fc_large_icon');
  1011. // }else if(devicesStore[0].dwtype=='YTCI'){
  1012. // device_icon.setAttribute('class','device_large_icon ci_large_icon');
  1013. // }else if(devicesStore[0].dwtype=='YTWP'){
  1014. // device_icon.setAttribute('class','device_large_icon wp1_large_icon');
  1015. // }else if(devicesStore[0].dwtype=='YTLL'){
  1016. // device_icon.setAttribute('class','device_large_icon ll_large_icon');
  1017. // }else if(devicesStore[0].dwtype=='YTVA'){
  1018. // device_icon.setAttribute('class','device_large_icon va_large_icon');
  1019. // }else if(devicesStore[0].dwtype=='YTEF'){
  1020. // device_icon.setAttribute('class','device_large_icon ef_large_icon');
  1021. // }
  1022. project_info_bar.appendChild(device_icon);
  1023. var device_count_label = document.createElement('div');
  1024. device_count_label.id='device_count_label';
  1025. device_count_label.setAttribute('class','device_count_label');
  1026. project_info_bar.appendChild(device_count_label);
  1027. var device_list_bar = document.createElement('div');
  1028. device_list_bar.setAttribute('class','device_list_bar');
  1029. project_info_bar.appendChild(device_list_bar);
  1030. var status_list_bar = document.createElement('div');
  1031. status_list_bar.id='status_list_bar';
  1032. status_list_bar.setAttribute('status','');
  1033. status_list_bar.setAttribute('class','status_list_bar');
  1034. status_list_bar.style.width= ($(document).innerWidth()-1528)+'px';
  1035. project_info_bar.appendChild(status_list_bar);
  1036. for(var i=0;i<devicesStore.length;i++){
  1037. var dev = document.createElement('div');
  1038. dev.owner_code = devicesStore[i].owner_code;
  1039. dev.id = "device_list_bar_sub_"+i;
  1040. dev.dwtype = devicesStore[i].dwtype;
  1041. dev.level = devicesStore[i].level;
  1042. dev.style.margin='10px';
  1043. dev.style.padding='10px';
  1044. dev.style.width='300px';
  1045. dev.style.cursor='pointer';
  1046. dev.idx = i;
  1047. dev.setAttribute('onclick','dev_click(this)');
  1048. device_list_bar.appendChild(dev);
  1049. $("#device_list_bar_sub_"+i).mouseover(function(){
  1050. $(this).css('background','rgba(64,85,98,0.7)');
  1051. });
  1052. $("#device_list_bar_sub_"+i).mouseout(function(){
  1053. $(this).css('background','rgba(0,0,0,0)');
  1054. });
  1055. var dev_name_label = document.createElement('div');
  1056. dev_name_label.setAttribute('class','project_label');
  1057. dev_name_label.style.marginTop='6px';
  1058. dev_name_label.innerHTML='设备名称';
  1059. dev.appendChild(dev_name_label);
  1060. var dev_name_info = document.createElement('div');
  1061. dev_name_info.setAttribute('class','project_info');
  1062. dev_name_info.style.marginTop='12px';
  1063. dev_name_info.innerHTML=devicesStore[i].device_name;
  1064. dev.appendChild(dev_name_info);
  1065. var dev_code_label = document.createElement('div');
  1066. dev_code_label.setAttribute('class','project_label');
  1067. dev_code_label.style.marginTop='14px';
  1068. dev_code_label.innerHTML='设备编号';
  1069. dev.appendChild(dev_code_label);
  1070. var dev_code_info = document.createElement('div');
  1071. dev_code_info.setAttribute('class','project_info');
  1072. dev_code_info.style.marginTop='12px';
  1073. dev_code_info.innerHTML=devicesStore[i].owner_code;
  1074. dev.appendChild(dev_code_info);
  1075. var dev_OBJ_label = document.createElement('div');
  1076. dev_OBJ_label.setAttribute('class','project_label');
  1077. dev_OBJ_label.style.marginTop='14px';
  1078. dev_OBJ_label.innerHTML='监测对象';
  1079. dev.appendChild(dev_OBJ_label);
  1080. var dev_OBJ_info = document.createElement('div');
  1081. dev_OBJ_info.setAttribute('class','project_info');
  1082. dev_OBJ_info.style.marginTop='12px';
  1083. dev_OBJ_info.innerHTML=devicesStore[i].object_name;
  1084. dev.appendChild(dev_OBJ_info);
  1085. var dev_time_label = document.createElement('div');
  1086. dev_time_label.setAttribute('class','project_label');
  1087. dev_time_label.style.marginTop='14px';
  1088. dev_time_label.innerHTML='数据更新时间';
  1089. dev.appendChild(dev_time_label);
  1090. var dev_time_info = document.createElement('div');
  1091. dev_time_info.setAttribute('class','project_info');
  1092. dev_time_info.style.marginTop='12px';
  1093. dev_time_info.style.marginBottom='12px';
  1094. dev_time_info.innerHTML=(devicesStore[i].status_time=='1970-01-01 08:00:00')?'-':devicesStore[i].status_time;
  1095. dev.appendChild(dev_time_info);
  1096. }
  1097. }
  1098. show_realtime_status(0);
  1099. }
  1100. var big_view_win = function(obj){
  1101. Ext.create('Ext.window.Window', {
  1102. id:'big_view_win',
  1103. title: '监控视频',
  1104. height: 680,
  1105. width: 800,
  1106. layout: 'fit',
  1107. modal:true,
  1108. maximizable :true,
  1109. buttons:[
  1110. {
  1111. text:'关闭',
  1112. handler : function() {
  1113. Ext.getCmp('big_view_win').destroy();
  1114. }
  1115. }
  1116. ],
  1117. closeAction:'destroy',
  1118. html:'<iframe width="99%" height="99%" frameborder=0 allowtransparency="true" scrolling=auto src="'+basePath+'view/frontpage/video.jsp?videoId='+obj.owner_code+'"></iframe>'
  1119. }).show();
  1120. }
  1121. var reset_video = function(obj){
  1122. var query = {
  1123. CMD:3,
  1124. BODY:{
  1125. DEVICE:obj.owner_code,
  1126. ACTION:0,
  1127. IDX:0
  1128. }
  1129. }
  1130. var status_list_bar = document.getElementById('status_list_bar');
  1131. status_list_bar.setAttribute('status','connecting');
  1132. status_list_bar.innerHTML='<div style="margin-top:120px;">连接中,请稍候...</div>';
  1133. $.ajax({
  1134. type:'POST',
  1135. url:'https://iot.usky.cn/YtIoT/cgi-bin/demo2.cgi',
  1136. data:'queryJson:'+JSON.stringify(query),
  1137. success:function(result){
  1138. }
  1139. });
  1140. onair_video = false;
  1141. setTimeout(chk_cideo,5000);
  1142. }
  1143. var open_video = function(obj){
  1144. var query = {
  1145. CMD:3,
  1146. BODY:{
  1147. DEVICE:obj.getAttribute('owner_code'),
  1148. ACTION:1,
  1149. IDX:7
  1150. }
  1151. }
  1152. var status_list_bar = document.getElementById('status_list_bar');
  1153. status_list_bar.setAttribute('status','connecting');
  1154. status_list_bar.innerHTML='<div style="margin-top:120px;">连接中,请稍候...</div>';
  1155. $.ajax({
  1156. type:'POST',
  1157. url:'https://iot.usky.cn/YtIoT/cgi-bin/demo2.cgi',
  1158. data:'queryJson:'+JSON.stringify(query),
  1159. success:function(result){
  1160. }
  1161. });
  1162. onair_video = false;
  1163. // setTimeout(chk_cideo,5000);
  1164. }
  1165. var chk_cideo = function(){
  1166. if(onair_video)
  1167. return;
  1168. var query = {
  1169. CMD:1
  1170. }
  1171. $.ajax({
  1172. type:'POST',
  1173. url:'https://iot.usky.cn/YtIoT/cgi-bin/demo2.cgi',
  1174. data:'queryJson:'+JSON.stringify(query),
  1175. success:function(result){
  1176. var json = eval('(' + result + ')');
  1177. var v_reset = document.getElementById('v_reset');
  1178. if(v_reset!=undefined){
  1179. var found = false;
  1180. if(json.RESULT.LIST!=undefined){
  1181. if(json.RESULT.LIST.length>0){
  1182. for(var i=0;i<json.RESULT.LIST.length;i++){
  1183. if(json.RESULT.LIST[i].DEVICE==v_reset.owner_code){
  1184. found = true;
  1185. online_video = json.RESULT.LIST[i].LIVEONLINE;
  1186. if((json.RESULT.LIST[i].ONAIR)&&(!onair_video)){
  1187. $("#v_reset").css('display','block');
  1188. $("#big_view").css('display','block');
  1189. onair_video = true;
  1190. var status_list_bar = document.getElementById('status_list_bar');
  1191. status_list_bar.setAttribute('status','');
  1192. status_list_bar.innerHTML='<iframe width="99%" height="99%" frameborder=0 allowtransparency="true" scrolling=auto src="'+basePath+'view/frontpage/video.jsp?videoId='+json.RESULT.LIST[i].DEVICE+'"></iframe>';
  1193. }else if(!json.RESULT.LIST[i].ONAIR){
  1194. if(json.RESULT.LIST[i].ALIVEVALUE==3){
  1195. onair_video = false;
  1196. var status_list_bar = document.getElementById('status_list_bar');
  1197. if(status_list_bar.getAttribute('status')=='')
  1198. status_list_bar.innerHTML='<div style="margin-top:120px;cursor:pointer;" owner_code="'+json.RESULT.LIST[i].DEVICE+'" onclick="open_video(this)">设备在线,点击加载视频</div>';
  1199. }else if(json.RESULT.LIST[i].ALIVEVALUE==2){
  1200. onair_video = false;
  1201. var status_list_bar = document.getElementById('status_list_bar');
  1202. status_list_bar.setAttribute('status','');
  1203. status_list_bar.innerHTML='<div style="margin-top:120px;">设备重连中,请稍候...</div>';
  1204. }else{
  1205. onair_video = false;
  1206. var status_list_bar = document.getElementById('status_list_bar');
  1207. status_list_bar.setAttribute('status','');
  1208. status_list_bar.innerHTML='<div style="margin-top:120px;">设备未连线,尝试连接。请稍候...</div>';
  1209. }
  1210. }
  1211. }
  1212. }
  1213. }
  1214. }
  1215. }
  1216. }
  1217. });
  1218. setTimeout(chk_cideo,5000);
  1219. }
  1220. var show_realtime_status = function(idx){
  1221. $("#device_count_label").html('');
  1222. if((devicesStore!=null)&&(devicesStore.length>idx)){
  1223. $("#device_count_label").html('[ '+devicesStore.length+'-'+(idx+1)+' ]');
  1224. var status_list_bar = document.getElementById('status_list_bar');
  1225. status_list_bar.setAttribute('status','');
  1226. status_list_bar.innerHTML='';
  1227. var title = document.createElement('div');
  1228. title.id = 'device_list_status_title';
  1229. title.style.textAlign='center';
  1230. title.style.fontSize='16px';
  1231. title.style.fontWeight='bold';
  1232. title.innerHTML=devicesStore[idx].device_name;
  1233. status_list_bar.appendChild(title);
  1234. var sta = document.createElement('table');
  1235. sta.style.marginTop='10px';
  1236. sta.width='100%';
  1237. sta.idx = i;
  1238. status_list_bar.appendChild(sta);
  1239. var v_reset = document.getElementById('v_reset');
  1240. if(v_reset!=undefined){
  1241. document.body.removeChild(v_reset);
  1242. }
  1243. var big_view = document.getElementById('big_view');
  1244. if(big_view!=undefined){
  1245. document.body.removeChild(big_view);
  1246. }
  1247. $("#status_list_bar").removeClass('status_list_bar_video');
  1248. if(devicesStore[idx].dwtype=='YTVA'){
  1249. online_video = false;
  1250. if(onair_video){
  1251. onair_video = false;
  1252. chk_cideo();
  1253. }
  1254. v_reset = document.createElement('div');
  1255. v_reset.id='v_reset';
  1256. v_reset.owner_code=devicesStore[idx].owner_code;
  1257. v_reset.setAttribute('class','v_reset');
  1258. v_reset.setAttribute('onclick','reset_video(this)');
  1259. v_reset.title='视频重载';
  1260. document.body.appendChild(v_reset);
  1261. $("#v_reset").css('display','none');
  1262. big_view = document.createElement('div');
  1263. big_view.id='big_view';
  1264. big_view.owner_code=devicesStore[idx].owner_code;
  1265. big_view.setAttribute('class','big_view');
  1266. big_view.setAttribute('onclick','big_view_win(this)');
  1267. big_view.title='视频放大';
  1268. document.body.appendChild(big_view);
  1269. $("#big_view").css('display','none');
  1270. $("#status_list_bar").addClass('status_list_bar_video');
  1271. $("#status_list_bar").html('<div style="margin-top:120px;">连接中,请稍候...</div>');
  1272. }else if(devicesStore[idx].dwtype=='YTFC'){
  1273. var tr = document.createElement('tr');
  1274. sta.appendChild(tr);
  1275. var td = document.createElement('td');
  1276. td.width='30%';
  1277. td.setAttribute('class','point_label project_label');
  1278. td.style.paddingTop='14px';
  1279. td.id='PowerAlarmLabel';
  1280. td.innerHTML='电源故障状态';
  1281. tr.appendChild(td);
  1282. td = document.createElement('td');
  1283. td.id='PowerAlarm';
  1284. td.width='20%';
  1285. td.setAttribute('class','project_info');
  1286. td.style.paddingTop='12px';
  1287. tr.appendChild(td);
  1288. var td = document.createElement('td');
  1289. td.setAttribute('class','point_label project_label');
  1290. td.style.paddingTop='14px';
  1291. td.width='30%';
  1292. td.id='ManualActLabel';
  1293. td.innerHTML='手自动状态';
  1294. tr.appendChild(td);
  1295. td = document.createElement('td');
  1296. td.width='20%';
  1297. td.id='ManualAct';
  1298. td.setAttribute('class','project_info');
  1299. td.style.paddingTop='12px';
  1300. tr.appendChild(td);
  1301. tr = document.createElement('tr');
  1302. sta.appendChild(tr);
  1303. var td = document.createElement('td');
  1304. td.setAttribute('class','point_label project_label');
  1305. td.style.paddingTop='14px';
  1306. td.id='DevWorking01Label';
  1307. td.innerHTML='1#设备运行状态';
  1308. tr.appendChild(td);
  1309. td = document.createElement('td');
  1310. td.id='DevWorking01';
  1311. td.setAttribute('class','project_info');
  1312. td.style.paddingTop='12px';
  1313. tr.appendChild(td);
  1314. var td = document.createElement('td');
  1315. td.setAttribute('class','point_label project_label');
  1316. td.style.paddingTop='14px';
  1317. td.id='DevWorking02Label';
  1318. td.innerHTML='2#设备运行状态';
  1319. tr.appendChild(td);
  1320. td = document.createElement('td');
  1321. td.id='DevWorking02';
  1322. td.setAttribute('class','project_info');
  1323. td.style.paddingTop='12px';
  1324. tr.appendChild(td);
  1325. tr = document.createElement('tr');
  1326. sta.appendChild(tr);
  1327. var td = document.createElement('td');
  1328. td.setAttribute('class','point_label project_label');
  1329. td.style.paddingTop='14px';
  1330. td.id='DevAlarm01Label';
  1331. td.innerHTML='1#设备故障状态';
  1332. tr.appendChild(td);
  1333. td = document.createElement('td');
  1334. td.id='DevAlarm01';
  1335. td.setAttribute('class','project_info');
  1336. td.style.paddingTop='12px';
  1337. tr.appendChild(td);
  1338. var td = document.createElement('td');
  1339. td.setAttribute('class','point_label project_label');
  1340. td.style.paddingTop='14px';
  1341. td.id='DevAlarm02Label';
  1342. td.innerHTML='2#设备故障状态';
  1343. tr.appendChild(td);
  1344. td = document.createElement('td');
  1345. td.id='DevAlarm02';
  1346. td.setAttribute('class','project_info');
  1347. td.style.paddingTop='12px';
  1348. tr.appendChild(td);
  1349. tr = document.createElement('tr');
  1350. sta.appendChild(tr);
  1351. var td = document.createElement('td');
  1352. td.setAttribute('class','point_label project_label');
  1353. td.style.paddingTop='14px';
  1354. td.id='FireAutoActLabel';
  1355. td.innerHTML='消防联动状态';
  1356. tr.appendChild(td);
  1357. td = document.createElement('td');
  1358. td.id='FireAutoAct';
  1359. td.setAttribute('class','project_info');
  1360. td.style.paddingTop='12px';
  1361. tr.appendChild(td);
  1362. var status_list = devicesStore[idx].status_list;
  1363. status_list.sort(staSortBypoint);
  1364. for(var i=0;i<status_list.length;i++){
  1365. var words = status_list[i].content.split(" ");
  1366. if(words.length>0){
  1367. if(status_list[i].point_code==1){
  1368. $("#PowerAlarmLabel").html(status_list[i].point_name);
  1369. $("#PowerAlarm").html(words[0]);
  1370. }else if(status_list[i].point_code==2){
  1371. $("#ManualActLabel").html(status_list[i].point_name);
  1372. $("#ManualAct").html(words[0]);
  1373. }else if(status_list[i].point_code==3){
  1374. $("#DevWorking01Label").html(status_list[i].point_name);
  1375. $("#DevWorking01").html(words[0]);
  1376. }else if(status_list[i].point_code==4){
  1377. $("#DevWorking02Label").html(status_list[i].point_name);
  1378. $("#DevWorking02").html(words[0]);
  1379. }else if(status_list[i].point_code==5){
  1380. $("#DevAlarm01Label").html(status_list[i].point_name);
  1381. $("#DevAlarm01").html(words[0]);
  1382. }else if(status_list[i].point_code==6){
  1383. $("#DevAlarm02Label").html(status_list[i].point_name);
  1384. $("#DevAlarm02").html(words[0]);
  1385. }else if(status_list[i].point_code==7){
  1386. $("#FireAutoActLabel").html(status_list[i].point_name);
  1387. $("#FireAutoAct").html(words[0]);
  1388. }
  1389. }
  1390. }
  1391. }else if(devicesStore[idx].dwtype=='YTWC'){
  1392. var status_list = devicesStore[idx].status_list;
  1393. status_list.sort(staSortBypoint);
  1394. for(var i=0;i<status_list.length;i++){
  1395. var tr = document.createElement('tr');
  1396. sta.appendChild(tr);
  1397. var td = document.createElement('td');
  1398. td.width='30%';
  1399. td.setAttribute('class','point_label project_label');
  1400. td.style.paddingTop='14px';
  1401. td.innerHTML=status_list[i].point_name;
  1402. tr.appendChild(td);
  1403. td = document.createElement('td');
  1404. td.innerHTML=(status_list[i].content).substring(0,2);
  1405. td.width='20%';
  1406. td.setAttribute('class','project_info');
  1407. td.style.paddingTop='12px';
  1408. tr.appendChild(td);
  1409. }
  1410. }else if(devicesStore[idx].dwtype=='YTEF'){
  1411. var tr = document.createElement('tr');
  1412. sta.appendChild(tr);
  1413. var td = document.createElement('td');
  1414. td.setAttribute('class','project_label');
  1415. td.innerHTML='供电过压状态';
  1416. tr.appendChild(td);
  1417. td = document.createElement('td');
  1418. td.setAttribute('class','project_label');
  1419. td.innerHTML='供电低压状态';
  1420. tr.appendChild(td);
  1421. td = document.createElement('td');
  1422. td.setAttribute('class','project_label');
  1423. td.innerHTML='供电过流状态';
  1424. tr.appendChild(td);
  1425. tr = document.createElement('tr');
  1426. sta.appendChild(tr);
  1427. td = document.createElement('td');
  1428. td.id='HighVoltageAlarm'
  1429. td.setAttribute('class','project_info');
  1430. tr.appendChild(td);
  1431. td = document.createElement('td');
  1432. td.id='LowVoltageAlarm'
  1433. td.setAttribute('class','project_info');
  1434. tr.appendChild(td);
  1435. td = document.createElement('td');
  1436. td.id='HighCurrentAlarm'
  1437. td.setAttribute('class','project_info');
  1438. tr.appendChild(td);
  1439. tr = document.createElement('tr');
  1440. sta.appendChild(tr);
  1441. td = document.createElement('td');
  1442. td.setAttribute('class','project_label');
  1443. td.innerHTML='漏电报警状态';
  1444. tr.appendChild(td);
  1445. tr = document.createElement('tr');
  1446. sta.appendChild(tr);
  1447. td = document.createElement('td');
  1448. td.id='ElectricityLeakage'
  1449. td.setAttribute('class','project_info');
  1450. tr.appendChild(td);
  1451. tr = document.createElement('tr');
  1452. sta.appendChild(tr);
  1453. td = document.createElement('td');
  1454. td.setAttribute('class','project_label');
  1455. td.innerHTML='A相线缆高温状态';
  1456. tr.appendChild(td);
  1457. td = document.createElement('td');
  1458. td.setAttribute('class','project_label');
  1459. td.innerHTML='B相线缆高温状态';
  1460. tr.appendChild(td);
  1461. td = document.createElement('td');
  1462. td.setAttribute('class','project_label');
  1463. td.innerHTML='C相线缆高温状态';
  1464. tr.appendChild(td);
  1465. tr = document.createElement('tr');
  1466. sta.appendChild(tr);
  1467. td = document.createElement('td');
  1468. td.setAttribute('class','project_info');
  1469. td.id='HighTemperatureA';
  1470. tr.appendChild(td);
  1471. td = document.createElement('td');
  1472. td.setAttribute('class','project_info');
  1473. td.id='HighTemperatureB';
  1474. tr.appendChild(td);
  1475. td = document.createElement('td');
  1476. td.setAttribute('class','project_info');
  1477. td.id='HighTemperatureC';
  1478. tr.appendChild(td);
  1479. tr = document.createElement('tr');
  1480. sta.appendChild(tr);
  1481. td = document.createElement('td');
  1482. td.setAttribute('class','project_label');
  1483. td.innerHTML='A相电压';
  1484. tr.appendChild(td);
  1485. td = document.createElement('td');
  1486. td.setAttribute('class','project_label');
  1487. td.innerHTML='B相电压';
  1488. tr.appendChild(td);
  1489. td = document.createElement('td');
  1490. td.setAttribute('class','project_label');
  1491. td.innerHTML='C相电压';
  1492. tr.appendChild(td);
  1493. tr = document.createElement('tr');
  1494. sta.appendChild(tr);
  1495. td = document.createElement('td');
  1496. td.setAttribute('class','project_info');
  1497. td.id='VoltageA';
  1498. tr.appendChild(td);
  1499. td = document.createElement('td');
  1500. td.setAttribute('class','project_info');
  1501. td.id='VoltageB';
  1502. tr.appendChild(td);
  1503. td = document.createElement('td');
  1504. td.setAttribute('class','project_info');
  1505. td.id='VoltageC';
  1506. tr.appendChild(td);
  1507. tr = document.createElement('tr');
  1508. sta.appendChild(tr);
  1509. td = document.createElement('td');
  1510. td.setAttribute('class','project_label');
  1511. td.innerHTML='A相电流';
  1512. tr.appendChild(td);
  1513. td = document.createElement('td');
  1514. td.setAttribute('class','project_label');
  1515. td.innerHTML='B相电流';
  1516. tr.appendChild(td);
  1517. td = document.createElement('td');
  1518. td.setAttribute('class','project_label');
  1519. td.innerHTML='C相电流';
  1520. tr.appendChild(td);
  1521. tr = document.createElement('tr');
  1522. sta.appendChild(tr);
  1523. td = document.createElement('td');
  1524. td.setAttribute('class','project_info');
  1525. td.id='CurrentA';
  1526. tr.appendChild(td);
  1527. td = document.createElement('td');
  1528. td.setAttribute('class','project_info');
  1529. td.id='CurrentB';
  1530. tr.appendChild(td);
  1531. td = document.createElement('td');
  1532. td.setAttribute('class','project_info');
  1533. td.id='CurrentC';
  1534. tr.appendChild(td);
  1535. tr = document.createElement('tr');
  1536. sta.appendChild(tr);
  1537. td = document.createElement('td');
  1538. td.setAttribute('class','project_label');
  1539. td.innerHTML='A相温度';
  1540. tr.appendChild(td);
  1541. td = document.createElement('td');
  1542. td.setAttribute('class','project_label');
  1543. td.innerHTML='B相温度';
  1544. tr.appendChild(td);
  1545. td = document.createElement('td');
  1546. td.setAttribute('class','project_label');
  1547. td.innerHTML='C相温度';
  1548. tr.appendChild(td);
  1549. tr = document.createElement('tr');
  1550. sta.appendChild(tr);
  1551. td = document.createElement('td');
  1552. td.setAttribute('class','project_info');
  1553. td.id='TemperatureA';
  1554. tr.appendChild(td);
  1555. td = document.createElement('td');
  1556. td.setAttribute('class','project_info');
  1557. td.id='TemperatureB';
  1558. tr.appendChild(td);
  1559. td = document.createElement('td');
  1560. td.setAttribute('class','project_info');
  1561. td.id='TemperatureC';
  1562. tr.appendChild(td);
  1563. var status_list = devicesStore[idx].status_list;
  1564. status_list.sort(staSortBypoint);
  1565. for(var i=0;i<status_list.length;i++){
  1566. if(status_list[i].point_code==1){
  1567. $("#HighVoltageAlarm").html((status_list[i].point_data=='0')?'正常':'告警');
  1568. }else if(status_list[i].point_code==2){
  1569. $("#LowVoltageAlarm").html((status_list[i].point_data=='0')?'正常':'告警');
  1570. }else if(status_list[i].point_code==3){
  1571. $("#HighCurrentAlarm").html((status_list[i].point_data=='0')?'正常':'告警');
  1572. }else if(status_list[i].point_code==4){
  1573. $("#ElectricityLeakage").html((status_list[i].point_data=='0')?'正常':'告警');
  1574. }else if(status_list[i].point_code==5){
  1575. $("#HighTemperatureA").html((status_list[i].point_data=='0')?'正常':'告警');
  1576. }else if(status_list[i].point_code==6){
  1577. $("#HighTemperatureB").html((status_list[i].point_data=='0')?'正常':'告警');
  1578. }else if(status_list[i].point_code==7){
  1579. $("#HighTemperatureC").html((status_list[i].point_data=='0')?'正常':'告警');
  1580. }else if(status_list[i].point_code==65){
  1581. if(status_list[i].point_data.length>0)
  1582. $("#VoltageA").html(status_list[i].point_data+'<img class="detail_data_btn" src="'+basePath+'res/img/common/famicons/chart_curve.png" onclick="show_detail_data('+devicesStore[idx].owner_code+','+status_list[i].point_code+',\''+status_list[i].point_name+'\')"/>');
  1583. }else if(status_list[i].point_code==66){
  1584. if(status_list[i].point_data.length>0)
  1585. $("#VoltageB").html(status_list[i].point_data+'<img class="detail_data_btn" src="'+basePath+'res/img/common/famicons/chart_curve.png" onclick="show_detail_data('+devicesStore[idx].owner_code+','+status_list[i].point_code+',\''+status_list[i].point_name+'\')"/>');
  1586. }else if(status_list[i].point_code==67){
  1587. if(status_list[i].point_data.length>0)
  1588. $("#VoltageC").html(status_list[i].point_data+'<img class="detail_data_btn" src="'+basePath+'res/img/common/famicons/chart_curve.png" onclick="show_detail_data('+devicesStore[idx].owner_code+','+status_list[i].point_code+',\''+status_list[i].point_name+'\')"/>');
  1589. }else if(status_list[i].point_code==68){
  1590. if(status_list[i].point_data.length>0)
  1591. $("#CurrentA").html(status_list[i].point_data+'<img class="detail_data_btn" src="'+basePath+'res/img/common/famicons/chart_curve.png" onclick="show_detail_data('+devicesStore[idx].owner_code+','+status_list[i].point_code+',\''+status_list[i].point_name+'\')"/>');
  1592. }else if(status_list[i].point_code==69){
  1593. if(status_list[i].point_data.length>0)
  1594. $("#CurrentB").html(status_list[i].point_data+'<img class="detail_data_btn" src="'+basePath+'res/img/common/famicons/chart_curve.png" onclick="show_detail_data('+devicesStore[idx].owner_code+','+status_list[i].point_code+',\''+status_list[i].point_name+'\')"/>');
  1595. }else if(status_list[i].point_code==70){
  1596. if(status_list[i].point_data.length>0)
  1597. $("#CurrentC").html(status_list[i].point_data+'<img class="detail_data_btn" src="'+basePath+'res/img/common/famicons/chart_curve.png" onclick="show_detail_data('+devicesStore[idx].owner_code+','+status_list[i].point_code+',\''+status_list[i].point_name+'\')"/>');
  1598. }else if(status_list[i].point_code==71){
  1599. if(status_list[i].point_data.length>0){
  1600. if(status_list[i].point_data=='-200.000')
  1601. $("#TemperatureA").html('-')
  1602. else
  1603. $("#TemperatureA").html(status_list[i].point_data+'<img class="detail_data_btn" src="'+basePath+'res/img/common/famicons/chart_curve.png" onclick="show_detail_data('+devicesStore[idx].owner_code+','+status_list[i].point_code+',\''+status_list[i].point_name+'\')"/>');
  1604. }
  1605. }else if(status_list[i].point_code==72){
  1606. if(status_list[i].point_data.length>0){
  1607. if(status_list[i].point_data=='-200.000')
  1608. $("#TemperatureB").html('-');
  1609. else
  1610. $("#TemperatureB").html(status_list[i].point_data+'<img class="detail_data_btn" src="'+basePath+'res/img/common/famicons/chart_curve.png" onclick="show_detail_data('+devicesStore[idx].owner_code+','+status_list[i].point_code+',\''+status_list[i].point_name+'\')"/>');
  1611. }
  1612. }else if(status_list[i].point_code==73){
  1613. if(status_list[i].point_data.length>0){
  1614. if(status_list[i].point_data=='-200.000')
  1615. $("#TemperatureC").html('-');
  1616. else
  1617. $("#TemperatureC").html(status_list[i].point_data+'<img class="detail_data_btn" src="'+basePath+'res/img/common/famicons/chart_curve.png" onclick="show_detail_data('+devicesStore[idx].owner_code+','+status_list[i].point_code+',\''+status_list[i].point_name+'\')"/>');
  1618. }
  1619. }
  1620. }
  1621. }else if((devicesStore[idx].dwtype=='YTSM')||(devicesStore[idx].dwtype=='YTMC')){
  1622. var status_list = devicesStore[idx].status_list;
  1623. status_list.sort(staSortBypoint);
  1624. for(var i=0;i<status_list.length;i++){
  1625. if(((status_list[i].point_code>0)&&(status_list[i].point_code<5)&&(status_list[i].point_name!='')&&(status_list[i].point_code!=3))
  1626. ||((status_list[i].point_code==3)&&(status_list[i].point_data!=0))){
  1627. var tr = document.createElement('tr');
  1628. sta.appendChild(tr);
  1629. var sta_name = document.createElement('td');
  1630. sta_name.width="40%";
  1631. sta_name.setAttribute('class','point_label project_label');
  1632. sta_name.style.paddingTop='14px';
  1633. sta_name.innerHTML=status_list[i].point_name;
  1634. tr.appendChild(sta_name);
  1635. var sta_value = document.createElement('td');
  1636. sta_value.setAttribute('class','project_info');
  1637. sta_value.style.paddingTop='12px';
  1638. if(status_list[i].point_code==1)
  1639. sta_value.innerHTML = status_list[i].content;
  1640. else
  1641. sta_value.innerHTML=status_list[i].point_data+'<img class="detail_data_btn" src="'+basePath+'res/img/common/famicons/chart_curve.png" onclick="show_detail_data('+devicesStore[idx].owner_code+','+(status_list[i].point_code+((devicesStore[idx].start_port>0)?(devicesStore[idx].start_port+63):0))+',\''+status_list[i].point_name+'\')"/>';
  1642. tr.appendChild(sta_value);
  1643. }
  1644. }
  1645. }else{
  1646. var status_list = devicesStore[idx].status_list;
  1647. status_list.sort(staSortBypoint);
  1648. for(var i=0;i<status_list.length;i++){
  1649. if(status_list[i].point_code>0){
  1650. var tr = document.createElement('tr');
  1651. sta.appendChild(tr);
  1652. var sta_name = document.createElement('td');
  1653. sta_name.width="40%";
  1654. sta_name.setAttribute('class','point_label project_label');
  1655. sta_name.style.paddingTop='14px';
  1656. sta_name.innerHTML=status_list[i].point_name;
  1657. tr.appendChild(sta_name);
  1658. var sta_value = document.createElement('td');
  1659. sta_value.setAttribute('class','project_info');
  1660. sta_value.style.paddingTop='12px';
  1661. // sta_value.style.paddingBottom='12px';
  1662. if(devicesStore[idx].dwtype=='YTUI'){
  1663. if(V_LOGINNAME=='admin')
  1664. sta_value.innerHTML=status_list[i].content+'<img class="detail_data_btn" src="'+basePath+'res/img/common/famicons/chart_curve.png" onclick="show_userinfo_detail('+devicesStore[idx].owner_code+')"/>';
  1665. else
  1666. sta_value.innerHTML=status_list[i].content;
  1667. }else if((devicesStore[idx].dwtype=='YTWP')||(devicesStore[idx].dwtype=='YTLL')||(devicesStore[idx].dwtype=='YTFH')){
  1668. if(status_list[i].point_name.indexOf('状态')>=0){
  1669. if((status_list[i].point_data==0)||(status_list[i].point_data=='00'))
  1670. sta_value.innerHTML='正常';
  1671. else
  1672. sta_value.innerHTML='--';
  1673. }else if(status_list[i].point_data.length>0)
  1674. sta_value.innerHTML=status_list[i].point_data+'<img class="detail_data_btn" src="'+basePath+'res/img/common/famicons/chart_curve.png" onclick="show_detail_data('+devicesStore[idx].owner_code+','+(status_list[i].point_code+((devicesStore[idx].start_port>0)?(devicesStore[idx].start_port+63):0))+',\''+status_list[i].point_name+'\')"/>';
  1675. }else if(status_list[i].point_data.length>0)
  1676. sta_value.innerHTML=status_list[i].point_data+'<img class="detail_data_btn" src="'+basePath+'res/img/common/famicons/chart_curve.png" onclick="show_detail_data('+devicesStore[idx].owner_code+','+(status_list[i].point_code+((devicesStore[idx].start_port>0)?(devicesStore[idx].start_port+63):0))+',\''+status_list[i].point_name+'\')"/>';
  1677. tr.appendChild(sta_value);
  1678. }
  1679. }
  1680. }
  1681. }
  1682. }
  1683. var fill_uiwin = function (json) {
  1684. fillvalue=true;
  1685. Ext.getCmp('userinfo_pushalarm').setValue(json.PUSH_WX==1);
  1686. Ext.getCmp('userinfo_pushtts').setValue(json.PUSH_TTS==1);
  1687. fillvalue=false;
  1688. var data = new Array();
  1689. for(var i=0;i<json.LIST.length;i++){
  1690. var obj = new Array();
  1691. if(json.LIST[i].id==1)
  1692. obj.push('故障');
  1693. else if(json.LIST[i].id==2)
  1694. obj.push('告警');
  1695. else if(json.LIST[i].id==3)
  1696. obj.push('反馈');
  1697. else if(json.LIST[i].id==4)
  1698. obj.push('监管');
  1699. else if(json.LIST[i].id==5)
  1700. obj.push('启动');
  1701. else if(json.LIST[i].id==6)
  1702. obj.push('自检');
  1703. else if(json.LIST[i].id==7)
  1704. obj.push('屏蔽');
  1705. else if(json.LIST[i].id==8)
  1706. obj.push('复位');
  1707. else if(json.LIST[i].id==9)
  1708. obj.push('消音');
  1709. obj.push(json.LIST[i].count);
  1710. data.push(obj);
  1711. }
  1712. var themecolor = ((theme=='')||(theme=='access'))?'#ffffff':'#000000';
  1713. Highcharts.chart('detail_area', {
  1714. chart: {
  1715. type: 'column',
  1716. backgroundColor: 'rgba(0,0,0,0)'
  1717. },
  1718. title: {
  1719. text: '用户传输装置报告类型统计',
  1720. style:{fontSize:'14px',color:themecolor,fontWeight:'bold'},
  1721. },
  1722. xAxis: {
  1723. type: 'category',
  1724. labels:{
  1725. style:{fontSize:'12px',color:themecolor,fontWeight:'bold'}
  1726. }
  1727. },
  1728. yAxis: {
  1729. title: {
  1730. text: '报告计次',
  1731. style:{fontSize:'14px',color:themecolor,fontWeight:'bold'}
  1732. },
  1733. labels:{
  1734. style:{fontSize:'12px',color:themecolor,fontWeight:'bold'}
  1735. }
  1736. },
  1737. legend: {
  1738. enabled: false
  1739. },
  1740. exporting: {
  1741. enabled: false
  1742. },
  1743. credits: {
  1744. enabled: false
  1745. },
  1746. series: [{
  1747. name: '报告计次',
  1748. data: data,
  1749. dataLabels: {
  1750. enabled: true,
  1751. rotation: -90,
  1752. align: 'right',
  1753. format:'{point.y}',
  1754. style:{fontSize:'14px',color:themecolor,fontWeight:'bold'},
  1755. y:10
  1756. },
  1757. colorByPoint: true
  1758. }]
  1759. });
  1760. }
  1761. var show_userinfo_detail = function(devId){
  1762. var device_id = devId;
  1763. Ext.create('Ext.window.Window',{
  1764. id:'detail_userinfo_win',
  1765. title:'<div id="detail_userinfo_title">用户传输装置信息</div>',
  1766. bodyStyle:'background-color:rgba(0,0,0,0.0);',
  1767. height:400,
  1768. width:1110,
  1769. modal:true,
  1770. layout:{
  1771. type:'table',
  1772. columns:6,
  1773. tableAttrs:{
  1774. style:{
  1775. width:'100%'
  1776. }
  1777. }
  1778. },
  1779. buttons:[{
  1780. text:'查岗',
  1781. handler : function() {
  1782. var query = new Object();
  1783. query.V_LOGINNAME = V_LOGINNAME;
  1784. query.V_PASSWORD = V_PASSWORD;
  1785. query.DEVICE_ID = devId;
  1786. query.CMD = 91;
  1787. query.LIMIT = 10;
  1788. var qjson = Ext.JSON.encode(query);
  1789. var url = ((company_code=="10012")?"https://iot.usky.cn/YtIoT/cgi-bin/DPAction2.cgi?t=":"https://iot.usky.cn/YtIoT/cgi-bin/DPAction.cgi?t=")+(new Date().getTime());
  1790. $.ajax({
  1791. type:'POST',
  1792. url: url,
  1793. data: qjson,
  1794. success: function(result){
  1795. var json = eval('(' + result + ')');
  1796. if(json.RESULT=='1'){
  1797. Ext.Msg.alert('操作信息','命令已下发');
  1798. }
  1799. }
  1800. });
  1801. }
  1802. },{
  1803. text:'清空',
  1804. handler : function() {
  1805. var query = new Object();
  1806. query.V_LOGINNAME = V_LOGINNAME;
  1807. query.V_PASSWORD = V_PASSWORD;
  1808. query.DEVICE_ID = devId;
  1809. query.CMD = 92;
  1810. query.LIMIT = 0;
  1811. var qjson = Ext.JSON.encode(query);
  1812. var url = ((company_code=="10012")?"https://iot.usky.cn/YtIoT/cgi-bin/DPAction2.cgi?t=":"https://iot.usky.cn/YtIoT/cgi-bin/DPAction.cgi?t=")+(new Date().getTime());
  1813. $.ajax({
  1814. type:'POST',
  1815. url: url,
  1816. data: qjson,
  1817. success: function(result){
  1818. var json = eval('(' + result + ')');
  1819. if(json.RESULT=='1'){
  1820. Ext.Msg.alert('操作信息','命令已下发');
  1821. fill_uiwin(json);
  1822. }
  1823. }
  1824. });
  1825. }
  1826. },{
  1827. text:'查询',
  1828. handler : function() {
  1829. var query = new Object();
  1830. query.V_LOGINNAME = V_LOGINNAME;
  1831. query.V_PASSWORD = V_PASSWORD;
  1832. query.DEVICE_ID = devId;
  1833. query.CMD = 93;
  1834. query.PARAM = 0;
  1835. var qjson = Ext.JSON.encode(query);
  1836. var url = ((company_code=="10012")?"https://iot.usky.cn/YtIoT/cgi-bin/DPAction2.cgi?t=":"https://iot.usky.cn/YtIoT/cgi-bin/DPAction.cgi?t=")+(new Date().getTime());
  1837. $.ajax({
  1838. type:'POST',
  1839. url: url,
  1840. data: qjson,
  1841. success: function(result){
  1842. var json = eval('(' + result + ')');
  1843. if(json.RESULT=='1')
  1844. {
  1845. fill_uiwin(json);
  1846. }
  1847. }
  1848. });
  1849. }
  1850. },{
  1851. text:'关闭',
  1852. handler : function() {
  1853. Ext.getCmp('detail_userinfo_win').destroy();
  1854. }
  1855. }],
  1856. tbar:['->',{
  1857. xtype: 'checkbox',
  1858. boxLabel: '语音推送',
  1859. id:'userinfo_pushtts',
  1860. checked:true,
  1861. hidden:true,
  1862. handler:function(){
  1863. if(!fillvalue){
  1864. var pushtts = Ext.getCmp('userinfo_pushtts').getValue();
  1865. Ext.create('Ext.window.Window',{
  1866. id:'detail_userinfo_pushset_win',
  1867. title:'请验证身份',
  1868. width:320,
  1869. height:240,
  1870. modal:true,
  1871. closable:false,
  1872. items:[{
  1873. xtype:'textfield',
  1874. name:'v_loginname',
  1875. fieldLabel:'登录名',
  1876. id:'v_loginname',
  1877. allowBlank:false
  1878. },{
  1879. xtype:'textfield',
  1880. name:'v_password',
  1881. fieldLabel:'密 码',
  1882. id:'v_password',
  1883. inputType:'password',
  1884. allowBlank:false
  1885. }],
  1886. bbar: ['->',{
  1887. xtype:'button',
  1888. text:'提交',
  1889. handler:function(){
  1890. var query = new Object();
  1891. query.V_LOGINNAME = V_LOGINNAME;
  1892. query.V_PASSWORD = V_PASSWORD;
  1893. query.DEVICE_ID = devId;
  1894. query.CMD = 95;
  1895. query.PARAM = pushtts?1:0;
  1896. var qjson = Ext.JSON.encode(query);
  1897. var url = ((company_code=="10012")?"https://iot.usky.cn/YtIoT/cgi-bin/DPAction2.cgi?t=":"https://iot.usky.cn/YtIoT/cgi-bin/DPAction.cgi?t=")+(new Date().getTime());
  1898. $.ajax({
  1899. type:'POST',
  1900. url: url,
  1901. data: qjson,
  1902. success: function(result){
  1903. var json = eval('(' + result + ')');
  1904. if(json.RESULT=='1')
  1905. {
  1906. Ext.Msg.alert('操作信息','命令已下发');
  1907. }
  1908. }
  1909. });
  1910. this.up("window").close();
  1911. }
  1912. },{
  1913. xtype:'button',
  1914. text:'关闭',
  1915. handler:function(){
  1916. this.up("window").close();
  1917. }
  1918. }],
  1919. closeAction:'destroy',
  1920. listeners:{
  1921. close:function(){
  1922. var query = new Object();
  1923. query.V_LOGINNAME = V_LOGINNAME;
  1924. query.V_PASSWORD = V_PASSWORD;
  1925. query.DEVICE_ID = devId;
  1926. query.CMD = 93;
  1927. query.PARAM = 0;
  1928. var qjson = Ext.JSON.encode(query);
  1929. var url = ((company_code=="10012")?"https://iot.usky.cn/YtIoT/cgi-bin/DPAction2.cgi?t=":"https://iot.usky.cn/YtIoT/cgi-bin/DPAction.cgi?t=")+(new Date().getTime());
  1930. $.ajax({
  1931. type:'POST',
  1932. url: url,
  1933. data: qjson,
  1934. success: function(result){
  1935. var json = eval('(' + result + ')');
  1936. if(json.RESULT=='1')
  1937. {
  1938. fill_uiwin(json);
  1939. }
  1940. }
  1941. });
  1942. }
  1943. }
  1944. }).show();
  1945. }
  1946. }
  1947. },'-',{
  1948. xtype: 'checkbox',
  1949. boxLabel: '微信推送',
  1950. id:'userinfo_pushalarm',
  1951. checked:true,
  1952. handler : function() {
  1953. if(!fillvalue){
  1954. var pushalarm = Ext.getCmp('userinfo_pushalarm').getValue();
  1955. Ext.create('Ext.window.Window',{
  1956. id:'detail_userinfo_pushset_win',
  1957. title:'请验证身份',
  1958. width:320,
  1959. height:240,
  1960. modal:true,
  1961. closable:false,
  1962. items:[{
  1963. xtype:'textfield',
  1964. name:'v_loginname',
  1965. fieldLabel:'登录名',
  1966. id:'v_loginname',
  1967. allowBlank:false
  1968. },{
  1969. xtype:'textfield',
  1970. name:'v_password',
  1971. fieldLabel:'密 码',
  1972. id:'v_password',
  1973. inputType:'password',
  1974. allowBlank:false
  1975. }],
  1976. bbar: ['->',{
  1977. xtype:'button',
  1978. text:'提交',
  1979. handler:function(){
  1980. var query = new Object();
  1981. query.V_LOGINNAME = V_LOGINNAME;
  1982. query.V_PASSWORD = V_PASSWORD;
  1983. query.DEVICE_ID = devId;
  1984. query.CMD = 94;
  1985. query.PARAM = pushalarm?1:0;
  1986. var qjson = Ext.JSON.encode(query);
  1987. var url = ((company_code=="10012")?"https://iot.usky.cn/YtIoT/cgi-bin/DPAction2.cgi?t=":"https://iot.usky.cn/YtIoT/cgi-bin/DPAction.cgi?t=")+(new Date().getTime());
  1988. $.ajax({
  1989. type:'POST',
  1990. url: url,
  1991. data: qjson,
  1992. success: function(result){
  1993. var json = eval('(' + result + ')');
  1994. if(json.RESULT=='1')
  1995. {
  1996. Ext.Msg.alert('操作信息','命令已下发');
  1997. }
  1998. }
  1999. });
  2000. this.up("window").close();
  2001. }
  2002. },{
  2003. xtype:'button',
  2004. text:'关闭',
  2005. handler:function(){
  2006. this.up("window").close();
  2007. }
  2008. }],
  2009. closeAction:'destroy',
  2010. listeners:{
  2011. close:function(){
  2012. var query = new Object();
  2013. query.V_LOGINNAME = V_LOGINNAME;
  2014. query.V_PASSWORD = V_PASSWORD;
  2015. query.DEVICE_ID = devId;
  2016. query.CMD = 93;
  2017. query.PARAM = 0;
  2018. var qjson = Ext.JSON.encode(query);
  2019. var url = ((company_code=="10012")?"https://iot.usky.cn/YtIoT/cgi-bin/DPAction2.cgi?t=":"https://iot.usky.cn/YtIoT/cgi-bin/DPAction.cgi?t=")+(new Date().getTime());
  2020. $.ajax({
  2021. type:'POST',
  2022. url: url,
  2023. data: qjson,
  2024. success: function(result){
  2025. var json = eval('(' + result + ')');
  2026. if(json.RESULT=='1'){
  2027. fill_uiwin(json);
  2028. }
  2029. }
  2030. });
  2031. }
  2032. }
  2033. }).show();
  2034. }
  2035. }
  2036. }],
  2037. closeAction:'destroy',
  2038. html:'<div id="detail_background" class="detail_background"><div id="detail_area" class="detail_area" style="height:304px;"></div></div>'
  2039. }).show();
  2040. var query = new Object();
  2041. query.V_LOGINNAME = V_LOGINNAME;
  2042. query.V_PASSWORD = V_PASSWORD;
  2043. query.DEVICE_ID = devId;
  2044. query.CMD = 93;
  2045. query.PARAM = 0;
  2046. var qjson = Ext.JSON.encode(query);
  2047. var url = ((company_code=="10012")?"https://iot.usky.cn/YtIoT/cgi-bin/DPAction2.cgi?t=":"https://iot.usky.cn/YtIoT/cgi-bin/DPAction.cgi?t=")+(new Date().getTime());
  2048. $.ajax({
  2049. type:'POST',
  2050. url: url,
  2051. data: qjson,
  2052. success: function(result){
  2053. var json = eval('(' + result + ')');
  2054. if(json.RESULT=='1'){
  2055. fill_uiwin(json);
  2056. }
  2057. }
  2058. });
  2059. }
  2060. var show_detail_data = function(devId,ponitId,name){
  2061. var device_id = devId;
  2062. var point_code = ponitId;
  2063. Ext.create('Ext.window.Window', {
  2064. id:'detail_data_win',
  2065. title: '<div id="detail_win_title">详细数据</div>',
  2066. height: 400,
  2067. width: 1110,
  2068. layout: 'fit',
  2069. modal:true,
  2070. buttons:[
  2071. {
  2072. text:'导出',
  2073. handler : function exportbtn_click(device_id,point_code) {
  2074. var fields = '';
  2075. var array = ['id','device_id','name','point_code','point_data','company','data_time'];
  2076. var name = ['编号','设备编号','设备名称','端口号','数据值','公司名称','添加时间'];
  2077. for(var i=0;i<7;i++){
  2078. if(i>0)
  2079. fields += ',';
  2080. fields += '{id:"'+array[i]+'",title:"'+name[i]+'",shown:"'+true+'"}';
  2081. }
  2082. var query = new Object();
  2083. query.device_id = devId;
  2084. query.point_code = ponitId;
  2085. query.EXPORT_FILE = '折线图数据监控列表';
  2086. query.fields = '['+fields+']';
  2087. $.ajax({
  2088. type:'POST',
  2089. url: basePath+"iot/excel/view/Exportexl",
  2090. data: {
  2091. queryJson : Ext.JSON.encode(query)
  2092. },
  2093. success: function(result){
  2094. var json = eval('(' + result + ')');
  2095. if(json.action=='dormExport'){
  2096. ConfirmStore = json.RESULT;
  2097. var elemIF = document.createElement("iframe");
  2098. elemIF.src = basePath+json.filename;
  2099. elemIF.style.display = "none";
  2100. document.body.appendChild(elemIF);
  2101. }
  2102. }
  2103. });
  2104. }
  2105. },{
  2106. text:'关闭',
  2107. handler : function() {
  2108. Ext.getCmp('detail_data_win').destroy();
  2109. }
  2110. }
  2111. ],
  2112. closeAction:'destroy',
  2113. html:'<div id="detail_background" class="detail_background"><div id="detail_area" class="detail_area"></div></div>'
  2114. }).show();
  2115. var query = new Object();
  2116. query.V_LOGINNAME = V_LOGINNAME;
  2117. query.V_PASSWORD = V_PASSWORD;
  2118. query.device_id = devId;
  2119. query.point_code = ponitId;
  2120. $.ajax({
  2121. type:'POST',
  2122. url: basePath+"iot/data/view/getSyncDataQList",
  2123. data: {
  2124. queryJson : Ext.JSON.encode(query)
  2125. },
  2126. success: function(result){
  2127. var json = eval('(' + result + ')');
  2128. if(json.action=='getSyncDataVList'){
  2129. ConfirmStore = json.RESULT;
  2130. draw_confirm(name);
  2131. }
  2132. }
  2133. });
  2134. }
  2135. var draw_confirm = function(name){
  2136. if((ConfirmStore!=undefined)&&(ConfirmStore.length>0)){
  2137. var themecolor = ((theme=='')||(theme=='access'))?'#ffffff':'#000000';
  2138. if((V_LOGINNAME=='guest')&&(ConfirmStore[0].device_id=='865462043119730')){
  2139. ConfirmStore[0].company='博华广场';
  2140. ConfirmStore[0].name='独立烟感';
  2141. }
  2142. $("#detail_win_title").html(ConfirmStore[0].company+'_'+ConfirmStore[0].name+'_'+name+' 一周数据');
  2143. var data_0 = new Array();
  2144. var d_time = new Array();
  2145. var max = 0, min = 0;;
  2146. for(var i=0;i<ConfirmStore.length;i++){
  2147. var rec = ConfirmStore[i];
  2148. var tmp = parseFloat(rec.point_data);
  2149. var tmp_t = rec.data_time;
  2150. if(i==0){
  2151. max = tmp;
  2152. min = tmp;
  2153. }else{
  2154. if(max<tmp)
  2155. max = tmp;
  2156. if(min>tmp)
  2157. min = tmp;
  2158. }
  2159. data_0.push(tmp);
  2160. d_time.push(tmp_t);
  2161. }
  2162. Highcharts.chart('detail_area',{
  2163. chart:{
  2164. type:'area',
  2165. zoomType: 'xy',
  2166. backgroundColor: 'rgba(0,0,0,0)'
  2167. },
  2168. title:{
  2169. text:ConfirmStore[0].company+'_'+ConfirmStore[0].name+'_'+name+' 一周数据',
  2170. float:true,
  2171. style:{fontSize:'14px',color:themecolor,fontWeight:'bold'},
  2172. enabled:false
  2173. },
  2174. legend:{
  2175. floating:true,
  2176. x:410,
  2177. y:-280,
  2178. itemStyle:{fontSize:'12px',color:themecolor,fontWeight:'bold'}
  2179. },
  2180. exporting: {
  2181. enabled: false
  2182. },
  2183. credits: {
  2184. enabled: false
  2185. },
  2186. xAxis:[{
  2187. categories:d_time,
  2188. labels:{
  2189. enabled:false
  2190. },
  2191. crosshair: true
  2192. }],
  2193. yAxis:[{
  2194. title:{
  2195. text:name,
  2196. style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  2197. },
  2198. gridLineColor:'rgba(0,0,0,0.2)',
  2199. labels:{
  2200. format:'{value}',
  2201. style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  2202. },
  2203. max:max+max*0.3,
  2204. min:0
  2205. }],
  2206. tooltip:{
  2207. shared:true
  2208. },
  2209. plotOptions:{
  2210. area:{
  2211. stackiung:'normal',
  2212. marker:{
  2213. lineWidth:0,
  2214. enabled:false,
  2215. radius:0
  2216. }
  2217. }
  2218. },
  2219. series:[{
  2220. name:name,
  2221. type: 'area',
  2222. data:data_0,
  2223. lineWidth:1,
  2224. tooltip:{
  2225. valueSuffix: ' '
  2226. },
  2227. fillColor: {
  2228. linearGradient: {
  2229. x1: 0,
  2230. y1: 0,
  2231. x2: 0,
  2232. y2: 1
  2233. },
  2234. stops: [
  2235. [0, '#34abf5'],
  2236. [1, Highcharts.Color('#34abf5').setOpacity(0.0).get('rgba')]
  2237. ]
  2238. }
  2239. }
  2240. ]
  2241. });
  2242. }
  2243. }
  2244. var show_alarm_pic = function(url){
  2245. var status_list_bar = document.getElementById('status_list_bar');
  2246. status_list_bar.setAttribute('status','');
  2247. status_list_bar.innerHTML='';
  2248. var pic = document.createElement('div');
  2249. pic.style.width = '360px';
  2250. pic.style.height = '270px';
  2251. status_list_bar.appendChild(pic);
  2252. var img = document.createElement('img');
  2253. img.width=360;
  2254. img.height=270;
  2255. img.src = url;
  2256. pic.appendChild(img);
  2257. }
  2258. var show_alarm_info = function (dwtype, status, id, name, device_code, company_code, company_name, fullname, time, data, data2, clzt, clwb, clr_name, clnr, clsj){
  2259. vAlarmInfoWin.show();
  2260. if((dwtype=='YTVA')||(dwtype=='16')){
  2261. vAlarmInfoWin.setWidth(780);
  2262. Ext.getCmp('picPanel').setWidth(360);
  2263. Ext.getCmp('picPanel').setHeight(270);
  2264. var img = document.createElement('img');
  2265. img.width=360;
  2266. img.height=270;
  2267. img.src = data2;
  2268. var alarm_pic = document.getElementById('alarm_pic');
  2269. alarm_pic.innerHTML='';
  2270. alarm_pic.appendChild(img);
  2271. }else{
  2272. vAlarmInfoWin.setWidth(400);
  2273. Ext.getCmp('picPanel').setWidth(0);
  2274. Ext.getCmp('picPanel').setHeight(0);
  2275. }
  2276. $("#VInfoWin_Title").html(data);
  2277. Ext.getCmp('uf_company_name').setValue(company_name);
  2278. Ext.getCmp('uf_name').setValue(name);
  2279. Ext.getCmp('uf_device_code').setValue(device_code);
  2280. Ext.getCmp('uf_fullname').setValue(fullname);
  2281. Ext.getCmp('uf_clr').setValue(clr_name);
  2282. Ext.getCmp('uf_clsj').setValue(clsj);
  2283. Ext.getCmp('uf_clnr').setValue(clnr);
  2284. Ext.getCmp('uf_id').setValue(id);
  2285. Ext.getCmp('uf_clwb').setValue(clwb=='1'?'误报':'告警');
  2286. Ext.getCmp('uf_status').setValue(status);
  2287. Ext.getCmp('uf_dwtype').setValue(dwtype);
  2288. if(clzt=='已处理'){
  2289. vAlarmInfoWin.setHeight(460);
  2290. Ext.getCmp('uf_clwb').setVisible(true);
  2291. Ext.getCmp('uf_r_clwb').setVisible(false);
  2292. Ext.getCmp('uf_r_clfw').setVisible(false);
  2293. Ext.getCmp('confirmBtn').setVisible(false);
  2294. Ext.getCmp('uf_clr').setVisible(true);
  2295. Ext.getCmp('uf_clsj').setVisible(true);
  2296. if(dwtype=='YTVA')
  2297. vAlarmInfoWin.setPosition(
  2298. ($(document).innerWidth()-780)/2,
  2299. ($(document).innerHeight()-460)/2);
  2300. else
  2301. vAlarmInfoWin.setPosition(
  2302. ($(document).innerWidth()-400)/2,
  2303. ($(document).innerHeight()-460)/2);
  2304. }else{
  2305. vAlarmInfoWin.setHeight(400);
  2306. Ext.getCmp('uf_clwb').setVisible(false);
  2307. Ext.getCmp('uf_r_clwb').setVisible(true);
  2308. Ext.getCmp('uf_r_clfw').setVisible(true);
  2309. Ext.getCmp('confirmBtn').setVisible(true);
  2310. Ext.getCmp('uf_clr').setVisible(false);
  2311. Ext.getCmp('uf_clsj').setVisible(false);
  2312. if((dwtype=='YTVA')||(dwtype=='16'))
  2313. vAlarmInfoWin.setPosition(
  2314. ($(document).innerWidth()-780)/2,
  2315. ($(document).innerHeight()-400)/2);
  2316. else
  2317. vAlarmInfoWin.setPosition(
  2318. ($(document).innerWidth()-400)/2,
  2319. ($(document).innerHeight()-400)/2);
  2320. }
  2321. }
  2322. var getCompanyInfo = function(){
  2323. var query = new Object();
  2324. query.V_LOGINNAME = V_LOGINNAME;
  2325. query.V_PASSWORD = V_PASSWORD;
  2326. query.COMPANY_CODE = company_code;
  2327. query.COMMSTATUS = "NO";
  2328. var qdata = 'queryJson='+ Ext.JSON.encode(query);
  2329. myMask.show();
  2330. $.ajax({
  2331. type:'POST',
  2332. url: basePath+"iot/frontpage/getCurrentObjectListByCompanyId",
  2333. data: qdata,
  2334. success: function(result){
  2335. var json = eval('(' + result + ')');
  2336. if(json.action=='getCurrentObjectListByCompanyId'){
  2337. if(json.check==true){
  2338. if(json.LIST!=undefined){
  2339. max_level= json.max_level;
  2340. min_level = json.min_level;
  2341. top_level=json.top_level;
  2342. building_name = json.buinding;
  2343. companyStore = json.COMPANY;
  2344. buildingStore = json.LIST;
  2345. }
  2346. draw_buinding();
  2347. }else{
  2348. Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function(){
  2349. window.parent.document.location=basePath;
  2350. });
  2351. }
  2352. }
  2353. myMask.hide();
  2354. }
  2355. });
  2356. // setTimeout(getCompanyInfo,storeTime);
  2357. }
  2358. Ext.onReady(function(){
  2359. basePath = $("#basePath").val();
  2360. $("#V_LOGINNAME").val(sessionStorage.getItem('V_LOGINNAME'));
  2361. $("#V_PASSWORD").val(sessionStorage.getItem('V_PASSWORD'));
  2362. V_LOGINNAME = $("#V_LOGINNAME").val();
  2363. V_PASSWORD = $("#V_PASSWORD").val();
  2364. company_code = $("#company_code").val();
  2365. theme = $("#theme").val();
  2366. parent.window.keep_menu();
  2367. myMask = new Ext.LoadMask(Ext.getBody(), {
  2368. msg: '查询中,请稍后!',
  2369. cls:'toplevel',
  2370. removeMask: true //完成后移除
  2371. });
  2372. var radiogroup = new Ext.create('Ext.form.RadioGroup',{
  2373. fieldLabel:'误报',
  2374. id:'uf_r_clwb',
  2375. width:300,
  2376. items:[{
  2377. name:'uf_r_clwb',
  2378. inputValue:'1',
  2379. boxLabel:'是'
  2380. },{
  2381. name:'uf_r_clwb',
  2382. inputValue:'0',
  2383. boxLabel:'否',
  2384. checked:true
  2385. }]
  2386. });
  2387. var radiogroup2 = new Ext.create('Ext.form.RadioGroup',{
  2388. fieldLabel:'处理范围',
  2389. id:'uf_r_clfw',
  2390. width:300,
  2391. items:[{
  2392. name:'uf_r_clfw',
  2393. inputValue:'1',
  2394. boxLabel:'批量'
  2395. },{
  2396. name:'uf_r_clfw',
  2397. inputValue:'0',
  2398. boxLabel:'单一',
  2399. checked:true
  2400. }]
  2401. });
  2402. var clear_modify_form = function(){
  2403. Ext.getCmp('uf_company_name').setValue('');
  2404. Ext.getCmp('uf_name').setValue('');
  2405. Ext.getCmp('uf_device_code').setValue('');
  2406. Ext.getCmp('uf_id').setValue('');
  2407. Ext.getCmp('uf_status').setValue('');
  2408. Ext.getCmp('uf_dwtype').setValue('');
  2409. Ext.getCmp('uf_fullname').setValue('');
  2410. Ext.getCmp('uf_clwb').setValue('');
  2411. Ext.getCmp('uf_clr').setValue('');
  2412. Ext.getCmp('uf_clsj').setValue('');
  2413. Ext.getCmp('uf_clnr').setValue('');
  2414. }
  2415. // var picPanel = Ext.create('Ext.panel.Panel',{
  2416. // id:'picPanel',
  2417. // region:'left',
  2418. // width:300,
  2419. // html:'<div id="alarm_pic"></div>'
  2420. // });
  2421. var alarmInfoForm = Ext.create('Ext.form.Panel', {
  2422. id: 'alarmInfoForm',
  2423. // width:400,
  2424. labelWidth: 55,
  2425. url: basePath+'iot/frontpage/updateAlarm',
  2426. region:'center',
  2427. defaultType: 'textfield',
  2428. bodyPadding: 15,
  2429. items: [{
  2430. fieldLabel:'单位名称',
  2431. id: 'uf_company_name',
  2432. name: 'uf_company_name',
  2433. anchor:'90%'
  2434. },{
  2435. fieldLabel:'监控设备',
  2436. id:'uf_name',
  2437. name:'uf_name',
  2438. anchor:'100%'
  2439. },{
  2440. fieldLabel:'设备编号',
  2441. id:'uf_device_code',
  2442. name:'uf_device_code',
  2443. hidden: true
  2444. },{
  2445. fieldLabel:'记录编号',
  2446. id:'uf_id',
  2447. name:'uf_id',
  2448. hidden: true
  2449. },{
  2450. fieldLabel:'设备编号',
  2451. id:'uf_status',
  2452. name:'uf_status',
  2453. hidden: true
  2454. },{
  2455. fieldLabel:'设备类型',
  2456. id:'uf_dwtype',
  2457. name:'uf_dwtype',
  2458. hidden: true
  2459. },{
  2460. fieldLabel:'报告信息',
  2461. id: 'uf_fullname',
  2462. name:'uf_fullname',
  2463. xtype: 'textareafield',
  2464. maxLength: 250,
  2465. cols:4,
  2466. anchor:'100%'
  2467. },{
  2468. fieldLabel:'误报',
  2469. id: 'uf_clwb',
  2470. name:'uf_clwb',
  2471. maxLength: 200,
  2472. anchor:'65%'
  2473. },radiogroup,radiogroup2,{
  2474. fieldLabel:'处理人',
  2475. id: 'uf_clr',
  2476. name:'uf_clr',
  2477. maxLength: 120,
  2478. anchor:'65%'
  2479. },{
  2480. fieldLabel:'处理时间',
  2481. id: 'uf_clsj',
  2482. name:'uf_clsj',
  2483. maxLength: 200,
  2484. anchor:'80%'
  2485. },{
  2486. fieldLabel:'处理内容',
  2487. id: 'uf_clnr',
  2488. name:'uf_clnr',
  2489. xtype: 'textareafield',
  2490. maxLength: 250,
  2491. cols:4,
  2492. anchor:'100%'
  2493. },{
  2494. id:'fm_queryJson',
  2495. name:'queryJson',
  2496. hidden:true
  2497. }],
  2498. buttons: [{
  2499. text: '处理',
  2500. id:'confirmBtn',
  2501. disabled:(V_LOGINNAME=='guest'?true:false),
  2502. iconCls:'ok_btn',
  2503. handler: function() {
  2504. var form = this.up('form').getForm();
  2505. if (form.isValid()) {
  2506. var queryJson = new Object();
  2507. queryJson.V_LOGINNAME = V_LOGINNAME;
  2508. queryJson.V_PASSWORD = V_PASSWORD;
  2509. queryJson.dwtype = Ext.getCmp('uf_dwtype').getValue();;
  2510. queryJson.id = Ext.getCmp('uf_id').getValue();
  2511. queryJson.status = Ext.getCmp('uf_status').getValue();
  2512. queryJson.name = Ext.getCmp('uf_name').getValue();
  2513. queryJson.device_code = Ext.getCmp('uf_device_code').getValue();
  2514. queryJson.confirmAll = Ext.getCmp('uf_r_clfw').getChecked()[0].boxLabel=='单一'?'0':'1';
  2515. queryJson.clwb = Ext.getCmp('uf_r_clwb').getChecked()[0].boxLabel=='否'?'0':'1';
  2516. queryJson.clnr = Ext.getCmp('uf_clnr').getValue();
  2517. var jsonstr = Ext.JSON.encode(queryJson);
  2518. Ext.getCmp('fm_queryJson').setValue(jsonstr);
  2519. form.submit({
  2520. method:'post',
  2521. success: function(form, action) {
  2522. Ext.Msg.alert('操作成功', '已确认'+action.result.activerow+'条记录', function(btn,txt){
  2523. clear_modify_form();
  2524. var div = window.top.$("#history_alarm_list").content;
  2525. div.storeReload2();
  2526. });
  2527. },
  2528. failure: function(form, action) {
  2529. Ext.Msg.alert('操作失败', action.Msg , function(btn,txt){
  2530. clear_modify_form();
  2531. });
  2532. }
  2533. });
  2534. this.up('window').close();
  2535. }
  2536. }
  2537. },{
  2538. text: '关闭',
  2539. iconCls: 'cancel_btn',
  2540. handler: function() {
  2541. this.up('window').close();
  2542. }
  2543. }]
  2544. });
  2545. vAlarmInfoWin = Ext.create('Ext.window.Window',{
  2546. id:'VAlarmInfoWin',
  2547. title:'详细信息: <span id="VInfoWin_Title"></span>',
  2548. height:400,
  2549. width:400,
  2550. layout:'border',
  2551. closable:false,
  2552. modal:true,
  2553. closeAction:'hide',
  2554. items:[{
  2555. id:'picPanel',
  2556. region:'west',
  2557. width:300,
  2558. html:'<div id="alarm_pic"></div>'
  2559. },alarmInfoForm]
  2560. }).hide();
  2561. getCompanyInfo();
  2562. $(window).resize(function(){
  2563. body_resize();
  2564. });
  2565. body_resize();
  2566. });