company.js.bak1 85 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449
  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. var dwtypelist = [1,7,2,6,16,17];
  505. for(var i=0;i<6;i++){
  506. var td = document.createElement('td');
  507. td.setAttribute('colspan','2');
  508. td.setAttribute('style','width:128px;');
  509. td.setAttribute('class','data_bar_title');
  510. td.style.textAlign='center';
  511. td.style.paddingTop='15px';
  512. td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  513. if(i==0)
  514. td.innerHTML='火灾监控';
  515. else if(i==1)
  516. td.innerHTML='电气火灾监控';
  517. else if(i==2)
  518. td.innerHTML='水系统监控';
  519. else if(i==3)
  520. td.innerHTML='RTU监控';
  521. else if(i==4)
  522. td.innerHTML='视频告警监控'
  523. else
  524. td.innerHTML='电梯告警监控'
  525. tr.appendChild(td);
  526. }
  527. tr = document.createElement('tr');
  528. table.appendChild(tr);
  529. for(var i=0;i<6;i++){
  530. var td = document.createElement('td');
  531. td.setAttribute('class','data_bar_total_label');
  532. td.style.textAlign='right';
  533. td.width='10%';
  534. td.innerHTML='设备总数';
  535. td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  536. tr.appendChild(td);
  537. td = document.createElement('td');
  538. td.setAttribute('class','data_bar_total_number');
  539. td.style.textAlign='left';
  540. td.style.paddingLeft='10px';
  541. td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  542. if(i==0)
  543. td.innerHTML=companyStore.d1;
  544. else if(i==1)
  545. td.innerHTML=companyStore.d7;
  546. else if(i==2)
  547. td.innerHTML=companyStore.d2;
  548. else if(i==3)
  549. td.innerHTML=companyStore.d6;
  550. else if(i==4)
  551. td.innerHTML=companyStore.d16;
  552. else
  553. //td.innerHTML=companyStore.d17;
  554. td.innerHTML=0;
  555. tr.appendChild(td);
  556. }
  557. tr = document.createElement('tr');
  558. table.appendChild(tr);
  559. for(var i=0;i<6;i++){
  560. var td = document.createElement('td');
  561. td.setAttribute('class','data_bar_total_label');
  562. td.style.textAlign='right';
  563. td.width='10%';
  564. td.innerHTML='已处理';
  565. td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  566. tr.appendChild(td);
  567. td = document.createElement('td');
  568. td.setAttribute('class','device_confirm_num1');
  569. td.style.textAlign='left';
  570. td.style.paddingLeft='10px';
  571. td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  572. if(i==0)
  573. td.innerHTML=companyStore.d1ac;
  574. else if(i==1)
  575. td.innerHTML=companyStore.d7ac;
  576. else if(i==2)
  577. td.innerHTML=companyStore.d2ac;
  578. else if(i==3)
  579. td.innerHTML=companyStore.d6ac;
  580. else if(i==4)
  581. td.innerHTML=companyStore.d16ac;
  582. else
  583. //td.innerHTML=companyStore.d17ac;
  584. td.innerHTML=0;
  585. tr.appendChild(td);
  586. }
  587. tr = document.createElement('tr');
  588. table.appendChild(tr);
  589. for(var i=0;i<6;i++){
  590. var td = document.createElement('td');
  591. td.setAttribute('class','data_bar_total_label');
  592. td.style.textAlign='right';
  593. td.width='10%';
  594. td.innerHTML='待处理';
  595. td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  596. tr.appendChild(td);
  597. td = document.createElement('td');
  598. td.setAttribute('class','device_confirm_num2');
  599. td.style.textAlign='left';
  600. td.style.paddingLeft='10px';
  601. td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  602. if(i==0)
  603. td.innerHTML=companyStore.d1a-companyStore.d1ac;
  604. else if(i==1)
  605. td.innerHTML=companyStore.d7a-companyStore.d7ac;
  606. else if(i==2)
  607. td.innerHTML=companyStore.d2a-companyStore.d2ac;
  608. else if(i==3)
  609. td.innerHTML=companyStore.d6a-companyStore.d6ac;
  610. else if(i==4)
  611. td.innerHTML=companyStore.d16a-companyStore.d16ac;
  612. else
  613. //td.innerHTML=companyStore.d17a-companyStore.d17ac;
  614. td.innerHTML=0;
  615. tr.appendChild(td);
  616. }
  617. tr = document.createElement('tr');
  618. table.appendChild(tr);
  619. for(var i=0;i<6;i++){
  620. var td = document.createElement('td');
  621. td.setAttribute('colspan','2');
  622. tr.appendChild(td);
  623. var div = document.createElement('div');
  624. div.id = 'alarm_pie_'+i;
  625. div.style.margin='10px auto 10px auto';
  626. div.style.width='110px';
  627. td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
  628. td.appendChild(div);
  629. }
  630. draw_pie('alarm_pie_0',companyStore.d1a,companyStore.d1ac);
  631. draw_pie('alarm_pie_1',companyStore.d7a,companyStore.d7ac);
  632. draw_pie('alarm_pie_2',companyStore.d2a,companyStore.d2ac);
  633. draw_pie('alarm_pie_3',companyStore.d6a,companyStore.d6ac);
  634. draw_pie('alarm_pie_4',companyStore.d16a,companyStore.d16ac);
  635. //draw_pie('alarm_pie_5',companyStore.d17a,companyStore.d17ac);
  636. draw_pie('alarm_pie_5',0);
  637. }else{
  638. var project_info_bar = document.getElementById('project_info_bar');
  639. project_info_bar.innerHTML='';
  640. var history_alarm_list = document.getElementById('history_alarm_list');
  641. history_alarm_list.innerHTML='';
  642. }
  643. }
  644. var show_alarm_list = function(company_code,dwtype){
  645. $("#company_detail_title").removeClass('device_status_title_icon');
  646. $("#company_detail_title").addClass('history_alarm_title_icon');
  647. $("#bak_reset2").removeClass('hiden');
  648. $("#bak_reset2").addClass('shown');
  649. var history_alarm_list = document.getElementById('history_alarm_list');
  650. 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>';
  651. // alert(company_code+','+dwtype);
  652. }
  653. var bak_reset = function(){
  654. $("#company_detail_title").removeClass('history_alarm_title_icon');
  655. $("#company_detail_title").addClass('device_status_title_icon');
  656. $("#company_page_title").removeClass('realtime_title_icon');
  657. $("#company_page_title").addClass('project_title_icon');
  658. $("#bak_reset").removeClass('shown');
  659. $("#bak_reset").addClass('hiden');
  660. $("#bak_reset2").removeClass('shown');
  661. $("#bak_reset2").addClass('hiden');
  662. // $("#history_alarm_list").css('overflow-y','auto');
  663. var v_reset = document.getElementById('v_reset');
  664. if(v_reset!=undefined){
  665. document.body.removeChild(v_reset);
  666. }
  667. var big_view = document.getElementById('big_view');
  668. if(big_view!=undefined){
  669. document.body.removeChild(big_view);
  670. }
  671. show_project_info=true;
  672. draw_buinding();
  673. }
  674. var dev_click = function(obj){
  675. var dwtype = obj.dwtype;
  676. var level = obj.level;
  677. var id = obj.owner_code;
  678. var idx = obj.idx;
  679. show_project_info=false;
  680. // var history_alarm_list = document.getElementById('history_alarm_list');
  681. // 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>';
  682. show_realtime_status(idx);
  683. if(dwtype=='YTVA'){
  684. onair_video = false;
  685. chk_cideo();
  686. }
  687. }
  688. var icon_click = function(obj){
  689. var dwtype = obj.dwtype;
  690. var level = obj.level;
  691. var id = obj.owner_code;
  692. show_project_info=false;
  693. // $("#company_detail_title").removeClass('device_status_title_icon');
  694. // $("#company_detail_title").addClass('history_alarm_title_icon');
  695. $("#company_page_title").removeClass('project_title_icon');
  696. $("#company_page_title").addClass('realtime_title_icon');
  697. $("#bak_reset").removeClass('hiden');
  698. $("#bak_reset").addClass('shown');
  699. var project_info_bar = document.getElementById('project_info_bar');
  700. project_info_bar.innerHTML='';
  701. var query = new Object();
  702. query.dwtype=dwtype;
  703. query.level=level;
  704. query.V_LOGINNAME = V_LOGINNAME;
  705. query.COMPANY_CODE = company_code;
  706. $.ajax({
  707. type:'POST',
  708. url: basePath+"iot/frontpage/getCurrentStatus",
  709. data: {
  710. queryJson : Ext.JSON.encode(query)
  711. },
  712. success: function(result){
  713. var json = eval('(' + result + ')');
  714. if(json.action=='getCurrentStatus'){
  715. if(json.check==true){
  716. if(json.devices!=undefined){
  717. devicesStore = json.devices;
  718. drawCurrentStatus();
  719. }
  720. }else{
  721. Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function(){
  722. window.parent.document.location=basePath;
  723. });
  724. }
  725. }
  726. myMask.hide();
  727. }
  728. });
  729. // var history_alarm_list = document.getElementById('history_alarm_list');
  730. // history_alarm_list.style.overflowY='hidden';
  731. // 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>';
  732. if(dwtype=='YTVA'){
  733. onair_video = false;
  734. chk_cideo();
  735. }
  736. }
  737. var draw_pie = function(id, total, num){
  738. var mColor= '#34abf5';
  739. var percent = 100;
  740. if(total>0)
  741. percent = Number(((num*100)/total).toString().match(/^\d+(?:\.\d{0,2})?/));
  742. if(percent<60)
  743. mColor = '#f66167';
  744. else if(percent<80)
  745. mColor = '#DDDF0D';
  746. Highcharts.getOptions().colors = Highcharts.map(['#f66167','#34abf5', '#DDDF0D', '#ff2e95', '#39b54a', '#ffb163', '#c233ac', '#9dffad', '#c77051'], function (color) {
  747. return {
  748. radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
  749. stops: [
  750. [0, color],
  751. [1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
  752. ]
  753. };
  754. });
  755. Highcharts.chart(id,{
  756. chart: {
  757. type: 'pie',
  758. backgroundColor: 'rgba(0,0,0,0)',
  759. height:'100%',
  760. options3d: {
  761. enabled: true,
  762. alpha: 45,
  763. beta: 0
  764. }
  765. },
  766. title: {
  767. text: '处置率:'+percent+'%',
  768. floating:true,
  769. y:95,
  770. style:{fontSize:'12px',color:'#ffffff'}
  771. },
  772. exporting: {
  773. enabled: false
  774. },
  775. credits: {
  776. enabled: false
  777. },
  778. tooltip: {
  779. // enabled: false
  780. pointFormat: '{point.percentage:.2f}%'
  781. },
  782. plotOptions: {
  783. pie: {
  784. allowPointSelect: true,
  785. cursor: 'pointer',
  786. depth: 15,
  787. dataLabels: {
  788. enabled: false,
  789. format: '{point.name}'
  790. }
  791. }
  792. },
  793. series: [{
  794. type: 'pie',
  795. name: '处置率',
  796. startAngle:90,
  797. data: [{
  798. name:'待处理',
  799. y:100-percent,
  800. sliced: true,
  801. selected: true
  802. },
  803. ['已处理', percent]
  804. ]
  805. }]
  806. });
  807. }
  808. var drawCurrentStatus = function(){
  809. if((devicesStore!=null)&&(devicesStore.length>0)){
  810. if(onair_video){
  811. onair_video = false;
  812. chk_cideo();
  813. }
  814. var project_info_bar = document.getElementById('project_info_bar');
  815. var device_icon = document.createElement('img');
  816. if(devicesStore[0].dwtype=='YTUI'){
  817. device_icon.setAttribute('class','device_large_icon');
  818. device_icon.src = basePath+'res/img/icons/ui_large_icon.gif';
  819. }else if(devicesStore[0].dwtype=='YTFC'){
  820. device_icon.setAttribute('class','device_large_icon');
  821. device_icon.src = basePath+'res/img/icons/fc_large_icon.gif';
  822. }else if(devicesStore[0].dwtype=='YTCI'){
  823. device_icon.setAttribute('class','device_large_icon');
  824. device_icon.src = basePath+'res/img/icons/ci_large_icon.gif';
  825. }else if(devicesStore[0].dwtype=='YTWP'){
  826. device_icon.setAttribute('class','device_large_icon');
  827. device_icon.src = basePath+'res/img/icons/wp1_large_icon.gif';
  828. }else if(devicesStore[0].dwtype=='YTLL'){
  829. device_icon.setAttribute('class','device_large_icon');
  830. device_icon.src = basePath+'res/img/icons/ll_large_icon.gif';
  831. }else if(devicesStore[0].dwtype=='YTVA'){
  832. device_icon.setAttribute('class','device_large_icon');
  833. device_icon.src = basePath+'res/img/icons/va_large_icon.gif';
  834. }else if(devicesStore[0].dwtype=='YTEF'){
  835. device_icon.setAttribute('class','device_large_icon');
  836. device_icon.src = basePath+'res/img/icons/ef_large_icon.gif';
  837. }else if(devicesStore[0].dwtype=='YTWC'){
  838. device_icon.setAttribute('class','device_large_icon');
  839. device_icon.src = basePath+'res/img/icons/wc_large_icon.gif';
  840. }else if(devicesStore[0].dwtype=='YTSM'){
  841. device_icon.setAttribute('class','device_large_icon');
  842. device_icon.src = basePath+'res/img/icons/sm_large_icon.gif';
  843. }else if(devicesStore[0].dwtype=='YTMC'){
  844. device_icon.setAttribute('class','device_large_icon');
  845. device_icon.src = basePath+'res/img/icons/mc_large_icon.gif';
  846. }else if(devicesStore[0].dwtype=='YTFH'){
  847. device_icon.setAttribute('class','device_large_icon');
  848. device_icon.src = basePath+'res/img/icons/fh_large_icon.gif';
  849. }
  850. // var device_icon = document.createElement('div');
  851. // if(devicesStore[0].dwtype=='YTUI'){
  852. // device_icon.setAttribute('class','device_large_icon ui_large_icon');
  853. // }else if(devicesStore[0].dwtype=='YTFC'){
  854. // device_icon.setAttribute('class','device_large_icon fc_large_icon');
  855. // }else if(devicesStore[0].dwtype=='YTCI'){
  856. // device_icon.setAttribute('class','device_large_icon ci_large_icon');
  857. // }else if(devicesStore[0].dwtype=='YTWP'){
  858. // device_icon.setAttribute('class','device_large_icon wp1_large_icon');
  859. // }else if(devicesStore[0].dwtype=='YTLL'){
  860. // device_icon.setAttribute('class','device_large_icon ll_large_icon');
  861. // }else if(devicesStore[0].dwtype=='YTVA'){
  862. // device_icon.setAttribute('class','device_large_icon va_large_icon');
  863. // }else if(devicesStore[0].dwtype=='YTEF'){
  864. // device_icon.setAttribute('class','device_large_icon ef_large_icon');
  865. // }
  866. project_info_bar.appendChild(device_icon);
  867. var device_count_label = document.createElement('div');
  868. device_count_label.id='device_count_label';
  869. device_count_label.setAttribute('class','device_count_label');
  870. project_info_bar.appendChild(device_count_label);
  871. var device_list_bar = document.createElement('div');
  872. device_list_bar.setAttribute('class','device_list_bar');
  873. project_info_bar.appendChild(device_list_bar);
  874. var status_list_bar = document.createElement('div');
  875. status_list_bar.id='status_list_bar';
  876. status_list_bar.setAttribute('status','');
  877. status_list_bar.setAttribute('class','status_list_bar');
  878. status_list_bar.style.width= ($(document).innerWidth()-1528)+'px';
  879. project_info_bar.appendChild(status_list_bar);
  880. for(var i=0;i<devicesStore.length;i++){
  881. var dev = document.createElement('div');
  882. dev.owner_code = devicesStore[i].owner_code;
  883. dev.id = "device_list_bar_sub_"+i;
  884. dev.dwtype = devicesStore[i].dwtype;
  885. dev.level = devicesStore[i].level;
  886. dev.style.margin='10px';
  887. dev.style.padding='10px';
  888. dev.style.width='300px';
  889. dev.style.cursor='pointer';
  890. dev.idx = i;
  891. dev.setAttribute('onclick','dev_click(this)');
  892. device_list_bar.appendChild(dev);
  893. $("#device_list_bar_sub_"+i).mouseover(function(){
  894. $(this).css('background','rgba(64,85,98,0.7)');
  895. });
  896. $("#device_list_bar_sub_"+i).mouseout(function(){
  897. $(this).css('background','rgba(0,0,0,0)');
  898. });
  899. var dev_name_label = document.createElement('div');
  900. dev_name_label.setAttribute('class','project_label');
  901. dev_name_label.style.marginTop='6px';
  902. dev_name_label.innerHTML='设备名称';
  903. dev.appendChild(dev_name_label);
  904. var dev_name_info = document.createElement('div');
  905. dev_name_info.setAttribute('class','project_info');
  906. dev_name_info.style.marginTop='12px';
  907. dev_name_info.innerHTML=devicesStore[i].device_name;
  908. dev.appendChild(dev_name_info);
  909. var dev_code_label = document.createElement('div');
  910. dev_code_label.setAttribute('class','project_label');
  911. dev_code_label.style.marginTop='14px';
  912. dev_code_label.innerHTML='设备编号';
  913. dev.appendChild(dev_code_label);
  914. var dev_code_info = document.createElement('div');
  915. dev_code_info.setAttribute('class','project_info');
  916. dev_code_info.style.marginTop='12px';
  917. dev_code_info.innerHTML=devicesStore[i].owner_code;
  918. dev.appendChild(dev_code_info);
  919. var dev_OBJ_label = document.createElement('div');
  920. dev_OBJ_label.setAttribute('class','project_label');
  921. dev_OBJ_label.style.marginTop='14px';
  922. dev_OBJ_label.innerHTML='监测对象';
  923. dev.appendChild(dev_OBJ_label);
  924. var dev_OBJ_info = document.createElement('div');
  925. dev_OBJ_info.setAttribute('class','project_info');
  926. dev_OBJ_info.style.marginTop='12px';
  927. dev_OBJ_info.innerHTML=devicesStore[i].object_name;
  928. dev.appendChild(dev_OBJ_info);
  929. var dev_time_label = document.createElement('div');
  930. dev_time_label.setAttribute('class','project_label');
  931. dev_time_label.style.marginTop='14px';
  932. dev_time_label.innerHTML='数据更新时间';
  933. dev.appendChild(dev_time_label);
  934. var dev_time_info = document.createElement('div');
  935. dev_time_info.setAttribute('class','project_info');
  936. dev_time_info.style.marginTop='12px';
  937. dev_time_info.style.marginBottom='12px';
  938. dev_time_info.innerHTML=(devicesStore[i].status_time=='1970-01-01 08:00:00')?'-':devicesStore[i].status_time;
  939. dev.appendChild(dev_time_info);
  940. }
  941. }
  942. show_realtime_status(0);
  943. }
  944. var big_view_win = function(obj){
  945. Ext.create('Ext.window.Window', {
  946. id:'big_view_win',
  947. title: '监控视频',
  948. height: 680,
  949. width: 800,
  950. layout: 'fit',
  951. modal:true,
  952. maximizable :true,
  953. buttons:[
  954. {
  955. text:'关闭',
  956. handler : function() {
  957. Ext.getCmp('big_view_win').destroy();
  958. }
  959. }
  960. ],
  961. closeAction:'destroy',
  962. html:'<iframe width="99%" height="99%" frameborder=0 allowtransparency="true" scrolling=auto src="'+basePath+'view/frontpage/video.jsp?videoId='+obj.owner_code+'"></iframe>'
  963. }).show();
  964. }
  965. var reset_video = function(obj){
  966. var query = {
  967. CMD:3,
  968. BODY:{
  969. DEVICE:obj.owner_code,
  970. ACTION:0,
  971. IDX:0
  972. }
  973. }
  974. var status_list_bar = document.getElementById('status_list_bar');
  975. status_list_bar.setAttribute('status','connecting');
  976. status_list_bar.innerHTML='<div style="margin-top:120px;">连接中,请稍候...</div>';
  977. $.ajax({
  978. type:'POST',
  979. url:'https://iot.usky.cn/YtIoT/cgi-bin/demo2.cgi',
  980. data:'queryJson:'+JSON.stringify(query),
  981. success:function(result){
  982. }
  983. });
  984. onair_video = false;
  985. setTimeout(chk_cideo,5000);
  986. }
  987. var open_video = function(obj){
  988. var query = {
  989. CMD:3,
  990. BODY:{
  991. DEVICE:obj.getAttribute('owner_code'),
  992. ACTION:1,
  993. IDX:7
  994. }
  995. }
  996. var status_list_bar = document.getElementById('status_list_bar');
  997. status_list_bar.setAttribute('status','connecting');
  998. status_list_bar.innerHTML='<div style="margin-top:120px;">连接中,请稍候...</div>';
  999. $.ajax({
  1000. type:'POST',
  1001. url:'https://iot.usky.cn/YtIoT/cgi-bin/demo2.cgi',
  1002. data:'queryJson:'+JSON.stringify(query),
  1003. success:function(result){
  1004. }
  1005. });
  1006. onair_video = false;
  1007. // setTimeout(chk_cideo,5000);
  1008. }
  1009. var chk_cideo = function(){
  1010. if(onair_video)
  1011. return;
  1012. var query = {
  1013. CMD:1
  1014. }
  1015. $.ajax({
  1016. type:'POST',
  1017. url:'https://iot.usky.cn/YtIoT/cgi-bin/demo2.cgi',
  1018. data:'queryJson:'+JSON.stringify(query),
  1019. success:function(result){
  1020. var json = eval('(' + result + ')');
  1021. var v_reset = document.getElementById('v_reset');
  1022. if(v_reset!=undefined){
  1023. var found = false;
  1024. if(json.RESULT.LIST!=undefined){
  1025. if(json.RESULT.LIST.length>0){
  1026. for(var i=0;i<json.RESULT.LIST.length;i++){
  1027. if(json.RESULT.LIST[i].DEVICE==v_reset.owner_code){
  1028. found = true;
  1029. online_video = json.RESULT.LIST[i].LIVEONLINE;
  1030. if((json.RESULT.LIST[i].ONAIR)&&(!onair_video)){
  1031. $("#v_reset").css('display','block');
  1032. $("#big_view").css('display','block');
  1033. onair_video = true;
  1034. var status_list_bar = document.getElementById('status_list_bar');
  1035. status_list_bar.setAttribute('status','');
  1036. 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>';
  1037. }else if(!json.RESULT.LIST[i].ONAIR){
  1038. if(json.RESULT.LIST[i].ALIVEVALUE==3){
  1039. onair_video = false;
  1040. var status_list_bar = document.getElementById('status_list_bar');
  1041. if(status_list_bar.getAttribute('status')=='')
  1042. status_list_bar.innerHTML='<div style="margin-top:120px;cursor:pointer;" owner_code="'+json.RESULT.LIST[i].DEVICE+'" onclick="open_video(this)">设备在线,点击加载视频</div>';
  1043. }else if(json.RESULT.LIST[i].ALIVEVALUE==2){
  1044. onair_video = false;
  1045. var status_list_bar = document.getElementById('status_list_bar');
  1046. status_list_bar.setAttribute('status','');
  1047. status_list_bar.innerHTML='<div style="margin-top:120px;">设备重连中,请稍候...</div>';
  1048. }else{
  1049. onair_video = false;
  1050. var status_list_bar = document.getElementById('status_list_bar');
  1051. status_list_bar.setAttribute('status','');
  1052. status_list_bar.innerHTML='<div style="margin-top:120px;">设备未连线,尝试连接。请稍候...</div>';
  1053. }
  1054. }
  1055. }
  1056. }
  1057. }
  1058. }
  1059. }
  1060. }
  1061. });
  1062. setTimeout(chk_cideo,5000);
  1063. }
  1064. var show_realtime_status = function(idx){
  1065. $("#device_count_label").html('');
  1066. if((devicesStore!=null)&&(devicesStore.length>idx)){
  1067. $("#device_count_label").html('[ '+devicesStore.length+'-'+(idx+1)+' ]');
  1068. var status_list_bar = document.getElementById('status_list_bar');
  1069. status_list_bar.setAttribute('status','');
  1070. status_list_bar.innerHTML='';
  1071. var title = document.createElement('div');
  1072. title.id = 'device_list_status_title';
  1073. title.style.textAlign='center';
  1074. title.style.fontSize='16px';
  1075. title.style.fontWeight='bold';
  1076. title.innerHTML=devicesStore[idx].device_name;
  1077. status_list_bar.appendChild(title);
  1078. var sta = document.createElement('table');
  1079. sta.style.marginTop='10px';
  1080. sta.width='100%';
  1081. sta.idx = i;
  1082. status_list_bar.appendChild(sta);
  1083. var v_reset = document.getElementById('v_reset');
  1084. if(v_reset!=undefined){
  1085. document.body.removeChild(v_reset);
  1086. }
  1087. var big_view = document.getElementById('big_view');
  1088. if(big_view!=undefined){
  1089. document.body.removeChild(big_view);
  1090. }
  1091. $("#status_list_bar").removeClass('status_list_bar_video');
  1092. if(devicesStore[idx].dwtype=='YTVA'){
  1093. online_video = false;
  1094. if(onair_video){
  1095. onair_video = false;
  1096. chk_cideo();
  1097. }
  1098. v_reset = document.createElement('div');
  1099. v_reset.id='v_reset';
  1100. v_reset.owner_code=devicesStore[idx].owner_code;
  1101. v_reset.setAttribute('class','v_reset');
  1102. v_reset.setAttribute('onclick','reset_video(this)');
  1103. v_reset.title='视频重载';
  1104. document.body.appendChild(v_reset);
  1105. $("#v_reset").css('display','none');
  1106. big_view = document.createElement('div');
  1107. big_view.id='big_view';
  1108. big_view.owner_code=devicesStore[idx].owner_code;
  1109. big_view.setAttribute('class','big_view');
  1110. big_view.setAttribute('onclick','big_view_win(this)');
  1111. big_view.title='视频放大';
  1112. document.body.appendChild(big_view);
  1113. $("#big_view").css('display','none');
  1114. $("#status_list_bar").addClass('status_list_bar_video');
  1115. $("#status_list_bar").html('<div style="margin-top:120px;">连接中,请稍候...</div>');
  1116. }else if(devicesStore[idx].dwtype=='YTFC'){
  1117. var tr = document.createElement('tr');
  1118. sta.appendChild(tr);
  1119. var td = document.createElement('td');
  1120. td.width='30%';
  1121. td.setAttribute('class','point_label project_label');
  1122. td.style.paddingTop='14px';
  1123. td.id='PowerAlarmLabel';
  1124. td.innerHTML='电源故障状态';
  1125. tr.appendChild(td);
  1126. td = document.createElement('td');
  1127. td.id='PowerAlarm';
  1128. td.width='20%';
  1129. td.setAttribute('class','project_info');
  1130. td.style.paddingTop='12px';
  1131. tr.appendChild(td);
  1132. var td = document.createElement('td');
  1133. td.setAttribute('class','point_label project_label');
  1134. td.style.paddingTop='14px';
  1135. td.width='30%';
  1136. td.id='ManualActLabel';
  1137. td.innerHTML='手自动状态';
  1138. tr.appendChild(td);
  1139. td = document.createElement('td');
  1140. td.width='20%';
  1141. td.id='ManualAct';
  1142. td.setAttribute('class','project_info');
  1143. td.style.paddingTop='12px';
  1144. tr.appendChild(td);
  1145. tr = document.createElement('tr');
  1146. sta.appendChild(tr);
  1147. var td = document.createElement('td');
  1148. td.setAttribute('class','point_label project_label');
  1149. td.style.paddingTop='14px';
  1150. td.id='DevWorking01Label';
  1151. td.innerHTML='1#设备运行状态';
  1152. tr.appendChild(td);
  1153. td = document.createElement('td');
  1154. td.id='DevWorking01';
  1155. td.setAttribute('class','project_info');
  1156. td.style.paddingTop='12px';
  1157. tr.appendChild(td);
  1158. var td = document.createElement('td');
  1159. td.setAttribute('class','point_label project_label');
  1160. td.style.paddingTop='14px';
  1161. td.id='DevWorking02Label';
  1162. td.innerHTML='2#设备运行状态';
  1163. tr.appendChild(td);
  1164. td = document.createElement('td');
  1165. td.id='DevWorking02';
  1166. td.setAttribute('class','project_info');
  1167. td.style.paddingTop='12px';
  1168. tr.appendChild(td);
  1169. tr = document.createElement('tr');
  1170. sta.appendChild(tr);
  1171. var td = document.createElement('td');
  1172. td.setAttribute('class','point_label project_label');
  1173. td.style.paddingTop='14px';
  1174. td.id='DevAlarm01Label';
  1175. td.innerHTML='1#设备故障状态';
  1176. tr.appendChild(td);
  1177. td = document.createElement('td');
  1178. td.id='DevAlarm01';
  1179. td.setAttribute('class','project_info');
  1180. td.style.paddingTop='12px';
  1181. tr.appendChild(td);
  1182. var td = document.createElement('td');
  1183. td.setAttribute('class','point_label project_label');
  1184. td.style.paddingTop='14px';
  1185. td.id='DevAlarm02Label';
  1186. td.innerHTML='2#设备故障状态';
  1187. tr.appendChild(td);
  1188. td = document.createElement('td');
  1189. td.id='DevAlarm02';
  1190. td.setAttribute('class','project_info');
  1191. td.style.paddingTop='12px';
  1192. tr.appendChild(td);
  1193. tr = document.createElement('tr');
  1194. sta.appendChild(tr);
  1195. var td = document.createElement('td');
  1196. td.setAttribute('class','point_label project_label');
  1197. td.style.paddingTop='14px';
  1198. td.id='FireAutoActLabel';
  1199. td.innerHTML='消防联动状态';
  1200. tr.appendChild(td);
  1201. td = document.createElement('td');
  1202. td.id='FireAutoAct';
  1203. td.setAttribute('class','project_info');
  1204. td.style.paddingTop='12px';
  1205. tr.appendChild(td);
  1206. var status_list = devicesStore[idx].status_list;
  1207. status_list.sort(staSortBypoint);
  1208. for(var i=0;i<status_list.length;i++){
  1209. var words = status_list[i].content.split(" ");
  1210. if(words.length>0){
  1211. if(status_list[i].point_code==1){
  1212. $("#PowerAlarmLabel").html(status_list[i].point_name);
  1213. $("#PowerAlarm").html(words[0]);
  1214. }else if(status_list[i].point_code==2){
  1215. $("#ManualActLabel").html(status_list[i].point_name);
  1216. $("#ManualAct").html(words[0]);
  1217. }else if(status_list[i].point_code==3){
  1218. $("#DevWorking01Label").html(status_list[i].point_name);
  1219. $("#DevWorking01").html(words[0]);
  1220. }else if(status_list[i].point_code==4){
  1221. $("#DevWorking02Label").html(status_list[i].point_name);
  1222. $("#DevWorking02").html(words[0]);
  1223. }else if(status_list[i].point_code==5){
  1224. $("#DevAlarm01Label").html(status_list[i].point_name);
  1225. $("#DevAlarm01").html(words[0]);
  1226. }else if(status_list[i].point_code==6){
  1227. $("#DevAlarm02Label").html(status_list[i].point_name);
  1228. $("#DevAlarm02").html(words[0]);
  1229. }else if(status_list[i].point_code==7){
  1230. $("#FireAutoActLabel").html(status_list[i].point_name);
  1231. $("#FireAutoAct").html(words[0]);
  1232. }
  1233. }
  1234. }
  1235. }else if(devicesStore[idx].dwtype=='YTWC'){
  1236. var status_list = devicesStore[idx].status_list;
  1237. status_list.sort(staSortBypoint);
  1238. for(var i=0;i<status_list.length;i++){
  1239. var tr = document.createElement('tr');
  1240. sta.appendChild(tr);
  1241. var td = document.createElement('td');
  1242. td.width='30%';
  1243. td.setAttribute('class','point_label project_label');
  1244. td.style.paddingTop='14px';
  1245. td.innerHTML=status_list[i].point_name;
  1246. tr.appendChild(td);
  1247. td = document.createElement('td');
  1248. td.innerHTML=(status_list[i].content).substring(0,2);
  1249. td.width='20%';
  1250. td.setAttribute('class','project_info');
  1251. td.style.paddingTop='12px';
  1252. tr.appendChild(td);
  1253. }
  1254. }else if(devicesStore[idx].dwtype=='YTEF'){
  1255. var tr = document.createElement('tr');
  1256. sta.appendChild(tr);
  1257. var td = document.createElement('td');
  1258. td.setAttribute('class','project_label');
  1259. td.innerHTML='供电过压状态';
  1260. tr.appendChild(td);
  1261. td = document.createElement('td');
  1262. td.setAttribute('class','project_label');
  1263. td.innerHTML='供电低压状态';
  1264. tr.appendChild(td);
  1265. td = document.createElement('td');
  1266. td.setAttribute('class','project_label');
  1267. td.innerHTML='供电过流状态';
  1268. tr.appendChild(td);
  1269. tr = document.createElement('tr');
  1270. sta.appendChild(tr);
  1271. td = document.createElement('td');
  1272. td.id='HighVoltageAlarm'
  1273. td.setAttribute('class','project_info');
  1274. tr.appendChild(td);
  1275. td = document.createElement('td');
  1276. td.id='LowVoltageAlarm'
  1277. td.setAttribute('class','project_info');
  1278. tr.appendChild(td);
  1279. td = document.createElement('td');
  1280. td.id='HighCurrentAlarm'
  1281. td.setAttribute('class','project_info');
  1282. tr.appendChild(td);
  1283. tr = document.createElement('tr');
  1284. sta.appendChild(tr);
  1285. td = document.createElement('td');
  1286. td.setAttribute('class','project_label');
  1287. td.innerHTML='漏电报警状态';
  1288. tr.appendChild(td);
  1289. tr = document.createElement('tr');
  1290. sta.appendChild(tr);
  1291. td = document.createElement('td');
  1292. td.id='ElectricityLeakage'
  1293. td.setAttribute('class','project_info');
  1294. tr.appendChild(td);
  1295. tr = document.createElement('tr');
  1296. sta.appendChild(tr);
  1297. td = document.createElement('td');
  1298. td.setAttribute('class','project_label');
  1299. td.innerHTML='A相线缆高温状态';
  1300. tr.appendChild(td);
  1301. td = document.createElement('td');
  1302. td.setAttribute('class','project_label');
  1303. td.innerHTML='B相线缆高温状态';
  1304. tr.appendChild(td);
  1305. td = document.createElement('td');
  1306. td.setAttribute('class','project_label');
  1307. td.innerHTML='C相线缆高温状态';
  1308. tr.appendChild(td);
  1309. tr = document.createElement('tr');
  1310. sta.appendChild(tr);
  1311. td = document.createElement('td');
  1312. td.setAttribute('class','project_info');
  1313. td.id='HighTemperatureA';
  1314. tr.appendChild(td);
  1315. td = document.createElement('td');
  1316. td.setAttribute('class','project_info');
  1317. td.id='HighTemperatureB';
  1318. tr.appendChild(td);
  1319. td = document.createElement('td');
  1320. td.setAttribute('class','project_info');
  1321. td.id='HighTemperatureC';
  1322. tr.appendChild(td);
  1323. tr = document.createElement('tr');
  1324. sta.appendChild(tr);
  1325. td = document.createElement('td');
  1326. td.setAttribute('class','project_label');
  1327. td.innerHTML='A相电压';
  1328. tr.appendChild(td);
  1329. td = document.createElement('td');
  1330. td.setAttribute('class','project_label');
  1331. td.innerHTML='B相电压';
  1332. tr.appendChild(td);
  1333. td = document.createElement('td');
  1334. td.setAttribute('class','project_label');
  1335. td.innerHTML='C相电压';
  1336. tr.appendChild(td);
  1337. tr = document.createElement('tr');
  1338. sta.appendChild(tr);
  1339. td = document.createElement('td');
  1340. td.setAttribute('class','project_info');
  1341. td.id='VoltageA';
  1342. tr.appendChild(td);
  1343. td = document.createElement('td');
  1344. td.setAttribute('class','project_info');
  1345. td.id='VoltageB';
  1346. tr.appendChild(td);
  1347. td = document.createElement('td');
  1348. td.setAttribute('class','project_info');
  1349. td.id='VoltageC';
  1350. tr.appendChild(td);
  1351. tr = document.createElement('tr');
  1352. sta.appendChild(tr);
  1353. td = document.createElement('td');
  1354. td.setAttribute('class','project_label');
  1355. td.innerHTML='A相电流';
  1356. tr.appendChild(td);
  1357. td = document.createElement('td');
  1358. td.setAttribute('class','project_label');
  1359. td.innerHTML='B相电流';
  1360. tr.appendChild(td);
  1361. td = document.createElement('td');
  1362. td.setAttribute('class','project_label');
  1363. td.innerHTML='C相电流';
  1364. tr.appendChild(td);
  1365. tr = document.createElement('tr');
  1366. sta.appendChild(tr);
  1367. td = document.createElement('td');
  1368. td.setAttribute('class','project_info');
  1369. td.id='CurrentA';
  1370. tr.appendChild(td);
  1371. td = document.createElement('td');
  1372. td.setAttribute('class','project_info');
  1373. td.id='CurrentB';
  1374. tr.appendChild(td);
  1375. td = document.createElement('td');
  1376. td.setAttribute('class','project_info');
  1377. td.id='CurrentC';
  1378. tr.appendChild(td);
  1379. tr = document.createElement('tr');
  1380. sta.appendChild(tr);
  1381. td = document.createElement('td');
  1382. td.setAttribute('class','project_label');
  1383. td.innerHTML='A相温度';
  1384. tr.appendChild(td);
  1385. td = document.createElement('td');
  1386. td.setAttribute('class','project_label');
  1387. td.innerHTML='B相温度';
  1388. tr.appendChild(td);
  1389. td = document.createElement('td');
  1390. td.setAttribute('class','project_label');
  1391. td.innerHTML='C相温度';
  1392. tr.appendChild(td);
  1393. tr = document.createElement('tr');
  1394. sta.appendChild(tr);
  1395. td = document.createElement('td');
  1396. td.setAttribute('class','project_info');
  1397. td.id='TemperatureA';
  1398. tr.appendChild(td);
  1399. td = document.createElement('td');
  1400. td.setAttribute('class','project_info');
  1401. td.id='TemperatureB';
  1402. tr.appendChild(td);
  1403. td = document.createElement('td');
  1404. td.setAttribute('class','project_info');
  1405. td.id='TemperatureC';
  1406. tr.appendChild(td);
  1407. var status_list = devicesStore[idx].status_list;
  1408. status_list.sort(staSortBypoint);
  1409. for(var i=0;i<status_list.length;i++){
  1410. if(status_list[i].point_code==1){
  1411. $("#HighVoltageAlarm").html((status_list[i].point_data=='0')?'正常':'告警');
  1412. }else if(status_list[i].point_code==2){
  1413. $("#LowVoltageAlarm").html((status_list[i].point_data=='0')?'正常':'告警');
  1414. }else if(status_list[i].point_code==3){
  1415. $("#HighCurrentAlarm").html((status_list[i].point_data=='0')?'正常':'告警');
  1416. }else if(status_list[i].point_code==4){
  1417. $("#ElectricityLeakage").html((status_list[i].point_data=='0')?'正常':'告警');
  1418. }else if(status_list[i].point_code==5){
  1419. $("#HighTemperatureA").html((status_list[i].point_data=='0')?'正常':'告警');
  1420. }else if(status_list[i].point_code==6){
  1421. $("#HighTemperatureB").html((status_list[i].point_data=='0')?'正常':'告警');
  1422. }else if(status_list[i].point_code==7){
  1423. $("#HighTemperatureC").html((status_list[i].point_data=='0')?'正常':'告警');
  1424. }else if(status_list[i].point_code==65){
  1425. if(status_list[i].point_data.length>0)
  1426. $("#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+'\')"/>');
  1427. }else if(status_list[i].point_code==66){
  1428. if(status_list[i].point_data.length>0)
  1429. $("#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+'\')"/>');
  1430. }else if(status_list[i].point_code==67){
  1431. if(status_list[i].point_data.length>0)
  1432. $("#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+'\')"/>');
  1433. }else if(status_list[i].point_code==68){
  1434. if(status_list[i].point_data.length>0)
  1435. $("#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+'\')"/>');
  1436. }else if(status_list[i].point_code==69){
  1437. if(status_list[i].point_data.length>0)
  1438. $("#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+'\')"/>');
  1439. }else if(status_list[i].point_code==70){
  1440. if(status_list[i].point_data.length>0)
  1441. $("#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+'\')"/>');
  1442. }else if(status_list[i].point_code==71){
  1443. if(status_list[i].point_data.length>0){
  1444. if(status_list[i].point_data=='-200.000')
  1445. $("#TemperatureA").html('-')
  1446. else
  1447. $("#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+'\')"/>');
  1448. }
  1449. }else if(status_list[i].point_code==72){
  1450. if(status_list[i].point_data.length>0){
  1451. if(status_list[i].point_data=='-200.000')
  1452. $("#TemperatureB").html('-');
  1453. else
  1454. $("#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+'\')"/>');
  1455. }
  1456. }else if(status_list[i].point_code==73){
  1457. if(status_list[i].point_data.length>0){
  1458. if(status_list[i].point_data=='-200.000')
  1459. $("#TemperatureC").html('-');
  1460. else
  1461. $("#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+'\')"/>');
  1462. }
  1463. }
  1464. }
  1465. }else if((devicesStore[idx].dwtype=='YTSM')||(devicesStore[idx].dwtype=='YTMC')){
  1466. var status_list = devicesStore[idx].status_list;
  1467. status_list.sort(staSortBypoint);
  1468. for(var i=0;i<status_list.length;i++){
  1469. if(((status_list[i].point_code>0)&&(status_list[i].point_code<5)&&(status_list[i].point_name!='')&&(status_list[i].point_code!=3))
  1470. ||((status_list[i].point_code==3)&&(status_list[i].point_data!=0))){
  1471. var tr = document.createElement('tr');
  1472. sta.appendChild(tr);
  1473. var sta_name = document.createElement('td');
  1474. sta_name.width="40%";
  1475. sta_name.setAttribute('class','point_label project_label');
  1476. sta_name.style.paddingTop='14px';
  1477. sta_name.innerHTML=status_list[i].point_name;
  1478. tr.appendChild(sta_name);
  1479. var sta_value = document.createElement('td');
  1480. sta_value.setAttribute('class','project_info');
  1481. sta_value.style.paddingTop='12px';
  1482. if(status_list[i].point_code==1)
  1483. sta_value.innerHTML = status_list[i].content;
  1484. else
  1485. 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+'\')"/>';
  1486. tr.appendChild(sta_value);
  1487. }
  1488. }
  1489. }else{
  1490. var status_list = devicesStore[idx].status_list;
  1491. status_list.sort(staSortBypoint);
  1492. for(var i=0;i<status_list.length;i++){
  1493. if(status_list[i].point_code>0){
  1494. var tr = document.createElement('tr');
  1495. sta.appendChild(tr);
  1496. var sta_name = document.createElement('td');
  1497. sta_name.width="40%";
  1498. sta_name.setAttribute('class','point_label project_label');
  1499. sta_name.style.paddingTop='14px';
  1500. sta_name.innerHTML=status_list[i].point_name;
  1501. tr.appendChild(sta_name);
  1502. var sta_value = document.createElement('td');
  1503. sta_value.setAttribute('class','project_info');
  1504. sta_value.style.paddingTop='12px';
  1505. // sta_value.style.paddingBottom='12px';
  1506. if(devicesStore[idx].dwtype=='YTUI'){
  1507. if(V_LOGINNAME=='admin')
  1508. 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+')"/>';
  1509. else
  1510. sta_value.innerHTML=status_list[i].content;
  1511. }else if((devicesStore[idx].dwtype=='YTWP')||(devicesStore[idx].dwtype=='YTLL')||(devicesStore[idx].dwtype=='YTFH')){
  1512. if(status_list[i].point_name.indexOf('状态')>=0){
  1513. if((status_list[i].point_data==0)||(status_list[i].point_data=='00'))
  1514. sta_value.innerHTML='正常';
  1515. else
  1516. sta_value.innerHTML='--';
  1517. }else if(status_list[i].point_data.length>0)
  1518. 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+'\')"/>';
  1519. }else if(status_list[i].point_data.length>0)
  1520. 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+'\')"/>';
  1521. tr.appendChild(sta_value);
  1522. }
  1523. }
  1524. }
  1525. }
  1526. }
  1527. var fill_uiwin = function (json) {
  1528. fillvalue=true;
  1529. Ext.getCmp('userinfo_pushalarm').setValue(json.PUSH_WX==1);
  1530. Ext.getCmp('userinfo_pushtts').setValue(json.PUSH_TTS==1);
  1531. fillvalue=false;
  1532. var data = new Array();
  1533. for(var i=0;i<json.LIST.length;i++){
  1534. var obj = new Array();
  1535. if(json.LIST[i].id==1)
  1536. obj.push('故障');
  1537. else if(json.LIST[i].id==2)
  1538. obj.push('告警');
  1539. else if(json.LIST[i].id==3)
  1540. obj.push('反馈');
  1541. else if(json.LIST[i].id==4)
  1542. obj.push('监管');
  1543. else if(json.LIST[i].id==5)
  1544. obj.push('启动');
  1545. else if(json.LIST[i].id==6)
  1546. obj.push('自检');
  1547. else if(json.LIST[i].id==7)
  1548. obj.push('屏蔽');
  1549. else if(json.LIST[i].id==8)
  1550. obj.push('复位');
  1551. else if(json.LIST[i].id==9)
  1552. obj.push('消音');
  1553. obj.push(json.LIST[i].count);
  1554. data.push(obj);
  1555. }
  1556. var themecolor = ((theme=='')||(theme=='access'))?'#ffffff':'#000000';
  1557. Highcharts.chart('detail_area', {
  1558. chart: {
  1559. type: 'column',
  1560. backgroundColor: 'rgba(0,0,0,0)'
  1561. },
  1562. title: {
  1563. text: '用户传输装置报告类型统计',
  1564. style:{fontSize:'14px',color:themecolor,fontWeight:'bold'},
  1565. },
  1566. xAxis: {
  1567. type: 'category',
  1568. labels:{
  1569. style:{fontSize:'12px',color:themecolor,fontWeight:'bold'}
  1570. }
  1571. },
  1572. yAxis: {
  1573. title: {
  1574. text: '报告计次',
  1575. style:{fontSize:'14px',color:themecolor,fontWeight:'bold'}
  1576. },
  1577. labels:{
  1578. style:{fontSize:'12px',color:themecolor,fontWeight:'bold'}
  1579. }
  1580. },
  1581. legend: {
  1582. enabled: false
  1583. },
  1584. exporting: {
  1585. enabled: false
  1586. },
  1587. credits: {
  1588. enabled: false
  1589. },
  1590. series: [{
  1591. name: '报告计次',
  1592. data: data,
  1593. dataLabels: {
  1594. enabled: true,
  1595. rotation: -90,
  1596. align: 'right',
  1597. format:'{point.y}',
  1598. style:{fontSize:'14px',color:themecolor,fontWeight:'bold'},
  1599. y:10
  1600. },
  1601. colorByPoint: true
  1602. }]
  1603. });
  1604. }
  1605. var show_userinfo_detail = function(devId){
  1606. var device_id = devId;
  1607. Ext.create('Ext.window.Window',{
  1608. id:'detail_userinfo_win',
  1609. title:'<div id="detail_userinfo_title">用户传输装置信息</div>',
  1610. bodyStyle:'background-color:rgba(0,0,0,0.0);',
  1611. height:400,
  1612. width:1110,
  1613. modal:true,
  1614. layout:{
  1615. type:'table',
  1616. columns:6,
  1617. tableAttrs:{
  1618. style:{
  1619. width:'100%'
  1620. }
  1621. }
  1622. },
  1623. buttons:[{
  1624. text:'查岗',
  1625. handler : function() {
  1626. var query = new Object();
  1627. query.V_LOGINNAME = V_LOGINNAME;
  1628. query.V_PASSWORD = V_PASSWORD;
  1629. query.DEVICE_ID = devId;
  1630. query.CMD = 91;
  1631. query.LIMIT = 10;
  1632. var qjson = Ext.JSON.encode(query);
  1633. 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());
  1634. $.ajax({
  1635. type:'POST',
  1636. url: url,
  1637. data: qjson,
  1638. success: function(result){
  1639. var json = eval('(' + result + ')');
  1640. if(json.RESULT=='1'){
  1641. Ext.Msg.alert('操作信息','命令已下发');
  1642. }
  1643. }
  1644. });
  1645. }
  1646. },{
  1647. text:'清空',
  1648. handler : function() {
  1649. var query = new Object();
  1650. query.V_LOGINNAME = V_LOGINNAME;
  1651. query.V_PASSWORD = V_PASSWORD;
  1652. query.DEVICE_ID = devId;
  1653. query.CMD = 92;
  1654. query.LIMIT = 0;
  1655. var qjson = Ext.JSON.encode(query);
  1656. 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());
  1657. $.ajax({
  1658. type:'POST',
  1659. url: url,
  1660. data: qjson,
  1661. success: function(result){
  1662. var json = eval('(' + result + ')');
  1663. if(json.RESULT=='1'){
  1664. Ext.Msg.alert('操作信息','命令已下发');
  1665. fill_uiwin(json);
  1666. }
  1667. }
  1668. });
  1669. }
  1670. },{
  1671. text:'查询',
  1672. handler : function() {
  1673. var query = new Object();
  1674. query.V_LOGINNAME = V_LOGINNAME;
  1675. query.V_PASSWORD = V_PASSWORD;
  1676. query.DEVICE_ID = devId;
  1677. query.CMD = 93;
  1678. query.PARAM = 0;
  1679. var qjson = Ext.JSON.encode(query);
  1680. 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());
  1681. $.ajax({
  1682. type:'POST',
  1683. url: url,
  1684. data: qjson,
  1685. success: function(result){
  1686. var json = eval('(' + result + ')');
  1687. if(json.RESULT=='1')
  1688. {
  1689. fill_uiwin(json);
  1690. }
  1691. }
  1692. });
  1693. }
  1694. },{
  1695. text:'关闭',
  1696. handler : function() {
  1697. Ext.getCmp('detail_userinfo_win').destroy();
  1698. }
  1699. }],
  1700. tbar:['->',{
  1701. xtype: 'checkbox',
  1702. boxLabel: '语音推送',
  1703. id:'userinfo_pushtts',
  1704. checked:true,
  1705. hidden:true,
  1706. handler:function(){
  1707. if(!fillvalue){
  1708. var pushtts = Ext.getCmp('userinfo_pushtts').getValue();
  1709. Ext.create('Ext.window.Window',{
  1710. id:'detail_userinfo_pushset_win',
  1711. title:'请验证身份',
  1712. width:320,
  1713. height:240,
  1714. modal:true,
  1715. closable:false,
  1716. items:[{
  1717. xtype:'textfield',
  1718. name:'v_loginname',
  1719. fieldLabel:'登录名',
  1720. id:'v_loginname',
  1721. allowBlank:false
  1722. },{
  1723. xtype:'textfield',
  1724. name:'v_password',
  1725. fieldLabel:'密 码',
  1726. id:'v_password',
  1727. inputType:'password',
  1728. allowBlank:false
  1729. }],
  1730. bbar: ['->',{
  1731. xtype:'button',
  1732. text:'提交',
  1733. handler:function(){
  1734. var query = new Object();
  1735. query.V_LOGINNAME = V_LOGINNAME;
  1736. query.V_PASSWORD = V_PASSWORD;
  1737. query.DEVICE_ID = devId;
  1738. query.CMD = 95;
  1739. query.PARAM = pushtts?1:0;
  1740. var qjson = Ext.JSON.encode(query);
  1741. 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());
  1742. $.ajax({
  1743. type:'POST',
  1744. url: url,
  1745. data: qjson,
  1746. success: function(result){
  1747. var json = eval('(' + result + ')');
  1748. if(json.RESULT=='1')
  1749. {
  1750. Ext.Msg.alert('操作信息','命令已下发');
  1751. }
  1752. }
  1753. });
  1754. this.up("window").close();
  1755. }
  1756. },{
  1757. xtype:'button',
  1758. text:'关闭',
  1759. handler:function(){
  1760. this.up("window").close();
  1761. }
  1762. }],
  1763. closeAction:'destroy',
  1764. listeners:{
  1765. close:function(){
  1766. var query = new Object();
  1767. query.V_LOGINNAME = V_LOGINNAME;
  1768. query.V_PASSWORD = V_PASSWORD;
  1769. query.DEVICE_ID = devId;
  1770. query.CMD = 93;
  1771. query.PARAM = 0;
  1772. var qjson = Ext.JSON.encode(query);
  1773. 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());
  1774. $.ajax({
  1775. type:'POST',
  1776. url: url,
  1777. data: qjson,
  1778. success: function(result){
  1779. var json = eval('(' + result + ')');
  1780. if(json.RESULT=='1')
  1781. {
  1782. fill_uiwin(json);
  1783. }
  1784. }
  1785. });
  1786. }
  1787. }
  1788. }).show();
  1789. }
  1790. }
  1791. },'-',{
  1792. xtype: 'checkbox',
  1793. boxLabel: '微信推送',
  1794. id:'userinfo_pushalarm',
  1795. checked:true,
  1796. handler : function() {
  1797. if(!fillvalue){
  1798. var pushalarm = Ext.getCmp('userinfo_pushalarm').getValue();
  1799. Ext.create('Ext.window.Window',{
  1800. id:'detail_userinfo_pushset_win',
  1801. title:'请验证身份',
  1802. width:320,
  1803. height:240,
  1804. modal:true,
  1805. closable:false,
  1806. items:[{
  1807. xtype:'textfield',
  1808. name:'v_loginname',
  1809. fieldLabel:'登录名',
  1810. id:'v_loginname',
  1811. allowBlank:false
  1812. },{
  1813. xtype:'textfield',
  1814. name:'v_password',
  1815. fieldLabel:'密 码',
  1816. id:'v_password',
  1817. inputType:'password',
  1818. allowBlank:false
  1819. }],
  1820. bbar: ['->',{
  1821. xtype:'button',
  1822. text:'提交',
  1823. handler:function(){
  1824. var query = new Object();
  1825. query.V_LOGINNAME = V_LOGINNAME;
  1826. query.V_PASSWORD = V_PASSWORD;
  1827. query.DEVICE_ID = devId;
  1828. query.CMD = 94;
  1829. query.PARAM = pushalarm?1:0;
  1830. var qjson = Ext.JSON.encode(query);
  1831. 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());
  1832. $.ajax({
  1833. type:'POST',
  1834. url: url,
  1835. data: qjson,
  1836. success: function(result){
  1837. var json = eval('(' + result + ')');
  1838. if(json.RESULT=='1')
  1839. {
  1840. Ext.Msg.alert('操作信息','命令已下发');
  1841. }
  1842. }
  1843. });
  1844. this.up("window").close();
  1845. }
  1846. },{
  1847. xtype:'button',
  1848. text:'关闭',
  1849. handler:function(){
  1850. this.up("window").close();
  1851. }
  1852. }],
  1853. closeAction:'destroy',
  1854. listeners:{
  1855. close:function(){
  1856. var query = new Object();
  1857. query.V_LOGINNAME = V_LOGINNAME;
  1858. query.V_PASSWORD = V_PASSWORD;
  1859. query.DEVICE_ID = devId;
  1860. query.CMD = 93;
  1861. query.PARAM = 0;
  1862. var qjson = Ext.JSON.encode(query);
  1863. 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());
  1864. $.ajax({
  1865. type:'POST',
  1866. url: url,
  1867. data: qjson,
  1868. success: function(result){
  1869. var json = eval('(' + result + ')');
  1870. if(json.RESULT=='1'){
  1871. fill_uiwin(json);
  1872. }
  1873. }
  1874. });
  1875. }
  1876. }
  1877. }).show();
  1878. }
  1879. }
  1880. }],
  1881. closeAction:'destroy',
  1882. html:'<div id="detail_background" class="detail_background"><div id="detail_area" class="detail_area" style="height:304px;"></div></div>'
  1883. }).show();
  1884. var query = new Object();
  1885. query.V_LOGINNAME = V_LOGINNAME;
  1886. query.V_PASSWORD = V_PASSWORD;
  1887. query.DEVICE_ID = devId;
  1888. query.CMD = 93;
  1889. query.PARAM = 0;
  1890. var qjson = Ext.JSON.encode(query);
  1891. 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());
  1892. $.ajax({
  1893. type:'POST',
  1894. url: url,
  1895. data: qjson,
  1896. success: function(result){
  1897. var json = eval('(' + result + ')');
  1898. if(json.RESULT=='1'){
  1899. fill_uiwin(json);
  1900. }
  1901. }
  1902. });
  1903. }
  1904. var show_detail_data = function(devId,ponitId,name){
  1905. var device_id = devId;
  1906. var point_code = ponitId;
  1907. Ext.create('Ext.window.Window', {
  1908. id:'detail_data_win',
  1909. title: '<div id="detail_win_title">详细数据</div>',
  1910. height: 400,
  1911. width: 1110,
  1912. layout: 'fit',
  1913. modal:true,
  1914. buttons:[
  1915. {
  1916. text:'导出',
  1917. handler : function exportbtn_click(device_id,point_code) {
  1918. var fields = '';
  1919. var array = ['id','device_id','name','point_code','point_data','company','data_time'];
  1920. var name = ['编号','设备编号','设备名称','端口号','数据值','公司名称','添加时间'];
  1921. for(var i=0;i<7;i++){
  1922. if(i>0)
  1923. fields += ',';
  1924. fields += '{id:"'+array[i]+'",title:"'+name[i]+'",shown:"'+true+'"}';
  1925. }
  1926. var query = new Object();
  1927. query.device_id = devId;
  1928. query.point_code = ponitId;
  1929. query.EXPORT_FILE = '折线图数据监控列表';
  1930. query.fields = '['+fields+']';
  1931. $.ajax({
  1932. type:'POST',
  1933. url: basePath+"iot/excel/view/Exportexl",
  1934. data: {
  1935. queryJson : Ext.JSON.encode(query)
  1936. },
  1937. success: function(result){
  1938. var json = eval('(' + result + ')');
  1939. if(json.action=='dormExport'){
  1940. ConfirmStore = json.RESULT;
  1941. var elemIF = document.createElement("iframe");
  1942. elemIF.src = basePath+json.filename;
  1943. elemIF.style.display = "none";
  1944. document.body.appendChild(elemIF);
  1945. }
  1946. }
  1947. });
  1948. }
  1949. },{
  1950. text:'关闭',
  1951. handler : function() {
  1952. Ext.getCmp('detail_data_win').destroy();
  1953. }
  1954. }
  1955. ],
  1956. closeAction:'destroy',
  1957. html:'<div id="detail_background" class="detail_background"><div id="detail_area" class="detail_area"></div></div>'
  1958. }).show();
  1959. var query = new Object();
  1960. query.V_LOGINNAME = V_LOGINNAME;
  1961. query.V_PASSWORD = V_PASSWORD;
  1962. query.device_id = devId;
  1963. query.point_code = ponitId;
  1964. $.ajax({
  1965. type:'POST',
  1966. url: basePath+"iot/data/view/getSyncDataQList",
  1967. data: {
  1968. queryJson : Ext.JSON.encode(query)
  1969. },
  1970. success: function(result){
  1971. var json = eval('(' + result + ')');
  1972. if(json.action=='getSyncDataVList'){
  1973. ConfirmStore = json.RESULT;
  1974. draw_confirm(name);
  1975. }
  1976. }
  1977. });
  1978. }
  1979. var draw_confirm = function(name){
  1980. if((ConfirmStore!=undefined)&&(ConfirmStore.length>0)){
  1981. var themecolor = ((theme=='')||(theme=='access'))?'#ffffff':'#000000';
  1982. if((V_LOGINNAME=='guest')&&(ConfirmStore[0].device_id=='865462043119730')){
  1983. ConfirmStore[0].company='博华广场';
  1984. ConfirmStore[0].name='独立烟感';
  1985. }
  1986. $("#detail_win_title").html(ConfirmStore[0].company+'_'+ConfirmStore[0].name+'_'+name+' 一周数据');
  1987. var data_0 = new Array();
  1988. var d_time = new Array();
  1989. var max = 0, min = 0;;
  1990. for(var i=0;i<ConfirmStore.length;i++){
  1991. var rec = ConfirmStore[i];
  1992. var tmp = parseFloat(rec.point_data);
  1993. var tmp_t = rec.data_time;
  1994. if(i==0){
  1995. max = tmp;
  1996. min = tmp;
  1997. }else{
  1998. if(max<tmp)
  1999. max = tmp;
  2000. if(min>tmp)
  2001. min = tmp;
  2002. }
  2003. data_0.push(tmp);
  2004. d_time.push(tmp_t);
  2005. }
  2006. Highcharts.chart('detail_area',{
  2007. chart:{
  2008. type:'area',
  2009. zoomType: 'xy',
  2010. backgroundColor: 'rgba(0,0,0,0)'
  2011. },
  2012. title:{
  2013. text:ConfirmStore[0].company+'_'+ConfirmStore[0].name+'_'+name+' 一周数据',
  2014. float:true,
  2015. style:{fontSize:'14px',color:themecolor,fontWeight:'bold'},
  2016. enabled:false
  2017. },
  2018. legend:{
  2019. floating:true,
  2020. x:410,
  2021. y:-280,
  2022. itemStyle:{fontSize:'12px',color:themecolor,fontWeight:'bold'}
  2023. },
  2024. exporting: {
  2025. enabled: false
  2026. },
  2027. credits: {
  2028. enabled: false
  2029. },
  2030. xAxis:[{
  2031. categories:d_time,
  2032. labels:{
  2033. enabled:false
  2034. },
  2035. crosshair: true
  2036. }],
  2037. yAxis:[{
  2038. title:{
  2039. text:name,
  2040. style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  2041. },
  2042. gridLineColor:'rgba(0,0,0,0.2)',
  2043. labels:{
  2044. format:'{value}',
  2045. style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  2046. },
  2047. max:max+max*0.3,
  2048. min:0
  2049. }],
  2050. tooltip:{
  2051. shared:true
  2052. },
  2053. plotOptions:{
  2054. area:{
  2055. stackiung:'normal',
  2056. marker:{
  2057. lineWidth:0,
  2058. enabled:false,
  2059. radius:0
  2060. }
  2061. }
  2062. },
  2063. series:[{
  2064. name:name,
  2065. type: 'area',
  2066. data:data_0,
  2067. lineWidth:1,
  2068. tooltip:{
  2069. valueSuffix: ' '
  2070. },
  2071. fillColor: {
  2072. linearGradient: {
  2073. x1: 0,
  2074. y1: 0,
  2075. x2: 0,
  2076. y2: 1
  2077. },
  2078. stops: [
  2079. [0, '#34abf5'],
  2080. [1, Highcharts.Color('#34abf5').setOpacity(0.0).get('rgba')]
  2081. ]
  2082. }
  2083. }
  2084. ]
  2085. });
  2086. }
  2087. }
  2088. var show_alarm_pic = function(url){
  2089. var status_list_bar = document.getElementById('status_list_bar');
  2090. status_list_bar.setAttribute('status','');
  2091. status_list_bar.innerHTML='';
  2092. var pic = document.createElement('div');
  2093. pic.style.width = '360px';
  2094. pic.style.height = '270px';
  2095. status_list_bar.appendChild(pic);
  2096. var img = document.createElement('img');
  2097. img.width=360;
  2098. img.height=270;
  2099. img.src = url;
  2100. pic.appendChild(img);
  2101. }
  2102. 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){
  2103. vAlarmInfoWin.show();
  2104. if((dwtype=='YTVA')||(dwtype=='16')){
  2105. vAlarmInfoWin.setWidth(780);
  2106. Ext.getCmp('picPanel').setWidth(360);
  2107. Ext.getCmp('picPanel').setHeight(270);
  2108. var img = document.createElement('img');
  2109. img.width=360;
  2110. img.height=270;
  2111. img.src = data2;
  2112. var alarm_pic = document.getElementById('alarm_pic');
  2113. alarm_pic.innerHTML='';
  2114. alarm_pic.appendChild(img);
  2115. }else{
  2116. vAlarmInfoWin.setWidth(400);
  2117. Ext.getCmp('picPanel').setWidth(0);
  2118. Ext.getCmp('picPanel').setHeight(0);
  2119. }
  2120. $("#VInfoWin_Title").html(data);
  2121. Ext.getCmp('uf_company_name').setValue(company_name);
  2122. Ext.getCmp('uf_name').setValue(name);
  2123. Ext.getCmp('uf_device_code').setValue(device_code);
  2124. Ext.getCmp('uf_fullname').setValue(fullname);
  2125. Ext.getCmp('uf_clr').setValue(clr_name);
  2126. Ext.getCmp('uf_clsj').setValue(clsj);
  2127. Ext.getCmp('uf_clnr').setValue(clnr);
  2128. Ext.getCmp('uf_id').setValue(id);
  2129. Ext.getCmp('uf_clwb').setValue(clwb=='1'?'误报':'告警');
  2130. Ext.getCmp('uf_status').setValue(status);
  2131. Ext.getCmp('uf_dwtype').setValue(dwtype);
  2132. if(clzt=='已处理'){
  2133. vAlarmInfoWin.setHeight(460);
  2134. Ext.getCmp('uf_clwb').setVisible(true);
  2135. Ext.getCmp('uf_r_clwb').setVisible(false);
  2136. Ext.getCmp('uf_r_clfw').setVisible(false);
  2137. Ext.getCmp('confirmBtn').setVisible(false);
  2138. Ext.getCmp('uf_clr').setVisible(true);
  2139. Ext.getCmp('uf_clsj').setVisible(true);
  2140. if(dwtype=='YTVA')
  2141. vAlarmInfoWin.setPosition(
  2142. ($(document).innerWidth()-780)/2,
  2143. ($(document).innerHeight()-460)/2);
  2144. else
  2145. vAlarmInfoWin.setPosition(
  2146. ($(document).innerWidth()-400)/2,
  2147. ($(document).innerHeight()-460)/2);
  2148. }else{
  2149. vAlarmInfoWin.setHeight(400);
  2150. Ext.getCmp('uf_clwb').setVisible(false);
  2151. Ext.getCmp('uf_r_clwb').setVisible(true);
  2152. Ext.getCmp('uf_r_clfw').setVisible(true);
  2153. Ext.getCmp('confirmBtn').setVisible(true);
  2154. Ext.getCmp('uf_clr').setVisible(false);
  2155. Ext.getCmp('uf_clsj').setVisible(false);
  2156. if((dwtype=='YTVA')||(dwtype=='16'))
  2157. vAlarmInfoWin.setPosition(
  2158. ($(document).innerWidth()-780)/2,
  2159. ($(document).innerHeight()-400)/2);
  2160. else
  2161. vAlarmInfoWin.setPosition(
  2162. ($(document).innerWidth()-400)/2,
  2163. ($(document).innerHeight()-400)/2);
  2164. }
  2165. }
  2166. var getCompanyInfo = function(){
  2167. var query = new Object();
  2168. query.V_LOGINNAME = V_LOGINNAME;
  2169. query.V_PASSWORD = V_PASSWORD;
  2170. query.COMPANY_CODE = company_code;
  2171. query.COMMSTATUS = "NO";
  2172. var qdata = 'queryJson='+ Ext.JSON.encode(query);
  2173. myMask.show();
  2174. $.ajax({
  2175. type:'POST',
  2176. url: basePath+"iot/frontpage/getCurrentObjectListByCompanyId",
  2177. data: qdata,
  2178. success: function(result){
  2179. var json = eval('(' + result + ')');
  2180. if(json.action=='getCurrentObjectListByCompanyId'){
  2181. if(json.check==true){
  2182. if(json.LIST!=undefined){
  2183. max_level= json.max_level;
  2184. min_level = json.min_level;
  2185. top_level=json.top_level;
  2186. building_name = json.buinding;
  2187. companyStore = json.COMPANY;
  2188. buildingStore = json.LIST;
  2189. }
  2190. draw_buinding();
  2191. }else{
  2192. Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function(){
  2193. window.parent.document.location=basePath;
  2194. });
  2195. }
  2196. }
  2197. myMask.hide();
  2198. }
  2199. });
  2200. // setTimeout(getCompanyInfo,storeTime);
  2201. }
  2202. Ext.onReady(function(){
  2203. basePath = $("#basePath").val();
  2204. $("#V_LOGINNAME").val(sessionStorage.getItem('V_LOGINNAME'));
  2205. $("#V_PASSWORD").val(sessionStorage.getItem('V_PASSWORD'));
  2206. V_LOGINNAME = $("#V_LOGINNAME").val();
  2207. V_PASSWORD = $("#V_PASSWORD").val();
  2208. company_code = $("#company_code").val();
  2209. theme = $("#theme").val();
  2210. parent.window.keep_menu();
  2211. myMask = new Ext.LoadMask(Ext.getBody(), {
  2212. msg: '查询中,请稍后!',
  2213. cls:'toplevel',
  2214. removeMask: true //完成后移除
  2215. });
  2216. var radiogroup = new Ext.create('Ext.form.RadioGroup',{
  2217. fieldLabel:'误报',
  2218. id:'uf_r_clwb',
  2219. width:300,
  2220. items:[{
  2221. name:'uf_r_clwb',
  2222. inputValue:'1',
  2223. boxLabel:'是'
  2224. },{
  2225. name:'uf_r_clwb',
  2226. inputValue:'0',
  2227. boxLabel:'否',
  2228. checked:true
  2229. }]
  2230. });
  2231. var radiogroup2 = new Ext.create('Ext.form.RadioGroup',{
  2232. fieldLabel:'处理范围',
  2233. id:'uf_r_clfw',
  2234. width:300,
  2235. items:[{
  2236. name:'uf_r_clfw',
  2237. inputValue:'1',
  2238. boxLabel:'批量'
  2239. },{
  2240. name:'uf_r_clfw',
  2241. inputValue:'0',
  2242. boxLabel:'单一',
  2243. checked:true
  2244. }]
  2245. });
  2246. var clear_modify_form = function(){
  2247. Ext.getCmp('uf_company_name').setValue('');
  2248. Ext.getCmp('uf_name').setValue('');
  2249. Ext.getCmp('uf_device_code').setValue('');
  2250. Ext.getCmp('uf_id').setValue('');
  2251. Ext.getCmp('uf_status').setValue('');
  2252. Ext.getCmp('uf_dwtype').setValue('');
  2253. Ext.getCmp('uf_fullname').setValue('');
  2254. Ext.getCmp('uf_clwb').setValue('');
  2255. Ext.getCmp('uf_clr').setValue('');
  2256. Ext.getCmp('uf_clsj').setValue('');
  2257. Ext.getCmp('uf_clnr').setValue('');
  2258. }
  2259. // var picPanel = Ext.create('Ext.panel.Panel',{
  2260. // id:'picPanel',
  2261. // region:'left',
  2262. // width:300,
  2263. // html:'<div id="alarm_pic"></div>'
  2264. // });
  2265. var alarmInfoForm = Ext.create('Ext.form.Panel', {
  2266. id: 'alarmInfoForm',
  2267. // width:400,
  2268. labelWidth: 55,
  2269. url: basePath+'iot/frontpage/updateAlarm',
  2270. region:'center',
  2271. defaultType: 'textfield',
  2272. bodyPadding: 15,
  2273. items: [{
  2274. fieldLabel:'单位名称',
  2275. id: 'uf_company_name',
  2276. name: 'uf_company_name',
  2277. anchor:'90%'
  2278. },{
  2279. fieldLabel:'监控设备',
  2280. id:'uf_name',
  2281. name:'uf_name',
  2282. anchor:'100%'
  2283. },{
  2284. fieldLabel:'设备编号',
  2285. id:'uf_device_code',
  2286. name:'uf_device_code',
  2287. hidden: true
  2288. },{
  2289. fieldLabel:'记录编号',
  2290. id:'uf_id',
  2291. name:'uf_id',
  2292. hidden: true
  2293. },{
  2294. fieldLabel:'设备编号',
  2295. id:'uf_status',
  2296. name:'uf_status',
  2297. hidden: true
  2298. },{
  2299. fieldLabel:'设备类型',
  2300. id:'uf_dwtype',
  2301. name:'uf_dwtype',
  2302. hidden: true
  2303. },{
  2304. fieldLabel:'报告信息',
  2305. id: 'uf_fullname',
  2306. name:'uf_fullname',
  2307. xtype: 'textareafield',
  2308. maxLength: 250,
  2309. cols:4,
  2310. anchor:'100%'
  2311. },{
  2312. fieldLabel:'误报',
  2313. id: 'uf_clwb',
  2314. name:'uf_clwb',
  2315. maxLength: 200,
  2316. anchor:'65%'
  2317. },radiogroup,radiogroup2,{
  2318. fieldLabel:'处理人',
  2319. id: 'uf_clr',
  2320. name:'uf_clr',
  2321. maxLength: 120,
  2322. anchor:'65%'
  2323. },{
  2324. fieldLabel:'处理时间',
  2325. id: 'uf_clsj',
  2326. name:'uf_clsj',
  2327. maxLength: 200,
  2328. anchor:'80%'
  2329. },{
  2330. fieldLabel:'处理内容',
  2331. id: 'uf_clnr',
  2332. name:'uf_clnr',
  2333. xtype: 'textareafield',
  2334. maxLength: 250,
  2335. cols:4,
  2336. anchor:'100%'
  2337. },{
  2338. id:'fm_queryJson',
  2339. name:'queryJson',
  2340. hidden:true
  2341. }],
  2342. buttons: [{
  2343. text: '处理',
  2344. id:'confirmBtn',
  2345. disabled:(V_LOGINNAME=='guest'?true:false),
  2346. iconCls:'ok_btn',
  2347. handler: function() {
  2348. var form = this.up('form').getForm();
  2349. if (form.isValid()) {
  2350. var queryJson = new Object();
  2351. queryJson.V_LOGINNAME = V_LOGINNAME;
  2352. queryJson.V_PASSWORD = V_PASSWORD;
  2353. queryJson.dwtype = Ext.getCmp('uf_dwtype').getValue();;
  2354. queryJson.id = Ext.getCmp('uf_id').getValue();
  2355. queryJson.status = Ext.getCmp('uf_status').getValue();
  2356. queryJson.name = Ext.getCmp('uf_name').getValue();
  2357. queryJson.device_code = Ext.getCmp('uf_device_code').getValue();
  2358. queryJson.confirmAll = Ext.getCmp('uf_r_clfw').getChecked()[0].boxLabel=='单一'?'0':'1';
  2359. queryJson.clwb = Ext.getCmp('uf_r_clwb').getChecked()[0].boxLabel=='否'?'0':'1';
  2360. queryJson.clnr = Ext.getCmp('uf_clnr').getValue();
  2361. var jsonstr = Ext.JSON.encode(queryJson);
  2362. Ext.getCmp('fm_queryJson').setValue(jsonstr);
  2363. form.submit({
  2364. method:'post',
  2365. success: function(form, action) {
  2366. Ext.Msg.alert('操作成功', '已确认'+action.result.activerow+'条记录', function(btn,txt){
  2367. clear_modify_form();
  2368. var div = window.top.$("#history_alarm_list").content;
  2369. div.storeReload2();
  2370. });
  2371. },
  2372. failure: function(form, action) {
  2373. Ext.Msg.alert('操作失败', action.Msg , function(btn,txt){
  2374. clear_modify_form();
  2375. });
  2376. }
  2377. });
  2378. this.up('window').close();
  2379. }
  2380. }
  2381. },{
  2382. text: '关闭',
  2383. iconCls: 'cancel_btn',
  2384. handler: function() {
  2385. this.up('window').close();
  2386. }
  2387. }]
  2388. });
  2389. vAlarmInfoWin = Ext.create('Ext.window.Window',{
  2390. id:'VAlarmInfoWin',
  2391. title:'详细信息: <span id="VInfoWin_Title"></span>',
  2392. height:400,
  2393. width:400,
  2394. layout:'border',
  2395. closable:false,
  2396. modal:true,
  2397. closeAction:'hide',
  2398. items:[{
  2399. id:'picPanel',
  2400. region:'west',
  2401. width:300,
  2402. html:'<div id="alarm_pic"></div>'
  2403. },alarmInfoForm]
  2404. }).hide();
  2405. getCompanyInfo();
  2406. $(window).resize(function(){
  2407. body_resize();
  2408. });
  2409. body_resize();
  2410. });