company.js.bak 83 KB

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