1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425 |
- /**
- * company.js
- */
- var basePath;
- var company_code;
- var V_LOGINNAME;
- var V_PASSWORD;
- var storeTime = 60000;
- var buildingStore=null,companyStore=null,devicesStore=null;
- var building_name;
- var max_level=0;
- var min_level=0;
- var top_level=0;
- var default_check = 65535;
- var myMask;
- var show_project_info = true;
- var start=0;
- var end = 360;
- var theme;
- var vAlarmInfoWin;
- var online_video = false;
- var onair_video = false;
- var ConfirmStore;
- var had_play = false;
- var fillvalue = false;
- Ext.Loader.setConfig({
- enabled: true
- });
- Ext.Loader.setPath('Ext.ux', '../../res/extjs/examples/ux');
- Ext.require([
- 'Ext.grid.*',
- 'Ext.data.*',
- 'Ext.ux.RowExpander',
- 'Ext.selection.CheckboxModel'
- ]);
- var bak_to_front = function(){
- location.href = basePath+'view/frontpage/map.jsp?company_code='+company_code;
- }
- var staSortBypoint = function(a,b){
- return a.point_code-b.point_code;;
- }
- var body_resize = function() {
- $("#company_bg_mm").css('display','none');
- if($(document).innerWidth()>=1820){
- $("#company_bg_tm").css('display','block');
- $("#company_bg_tm").css('width',($(document).innerWidth()-1820)+'px');
- $("#company_bg_bm").css('display','block');
- $("#company_bg_bm").css('width',($(document).innerWidth()-1820)+'px');
- }else{
- $("#company_bg_tm").css('display','none');
- $("#company_bg_bm").css('display','none');
- }
- if($(document).innerHeight()>=932){
- $("#company_bg_ml").css('display','block');
- $("#company_bg_mr").css('display','block');
- $("#company_bg_ml").css('height',($(document).innerHeight()-932)+'px');
- $("#company_bg_mr").css('height',($(document).innerHeight()-932)+'px');
- if($(document).innerWidth()>=1820){
- $("#company_bg_mm").css('display','block');
- $("#company_bg_mm").css('height',($(document).innerHeight()-932)+'px');
- $("#company_bg_mm").css('width',($(document).innerWidth()-1820)+'px');
- }
- }else{
- $("#company_bg_ml").css('display','none');
- $("#company_bg_mr").css('display','none');
- }
- $("#company_building").css('height',($(document).innerHeight()-365)+'px');
- $("#history_alarm_list").css('width',($(document).innerWidth()-975)+'px');
- $("#history_alarm_list").css('height',($(document).innerHeight()-616)+'px');
- $("#project_info_bar").css('width',($(document).innerWidth()-975)+'px');
- }
- var chk_click = function(obj){
- if((obj.id=='dev_all_checkbox')||(obj.id=='dev_all_checklabel')){
- if(default_check!=65535)
- default_check=65535;
- else
- default_check=0;
- }else if((obj.id=='dev_ui_checkbox')||(obj.id=='dev_ui_checklabel')){
- if((default_check&1)==1)
- default_check = (default_check&65534);
- else
- default_check = (default_check|1);
- }else if((obj.id=='dev_fc_checkbox')||(obj.id=='dev_fc_checklabel')){
- if((default_check&2)==2)
- default_check = (default_check&65533);
- else
- default_check = (default_check|2);
- }else if((obj.id=='dev_ef_checkbox')||(obj.id=='dev_ef_checklabel')){
- if((default_check&4)==4)
- default_check = (default_check&65531);
- else
- default_check = (default_check|4);
- }else if((obj.id=='dev_wp_checkbox')||(obj.id=='dev_wp_checklabel')){
- if((default_check&8)==8)
- default_check = (default_check&65527);
- else
- default_check = (default_check|8);
- }else if((obj.id=='dev_ll_checkbox')||(obj.id=='dev_ll_checklabel')){
- if((default_check&16)==16)
- default_check = (default_check&65519);
- else
- default_check = (default_check|16);
- }else if((obj.id=='dev_ci_checkbox')||(obj.id=='dev_ci_checklabel')){
- if((default_check&32)==32)
- default_check = (default_check&65503);
- else
- default_check = (default_check|32);
- }else if((obj.id=='dev_va_checkbox')||(obj.id=='dev_va_checklabel')){
- if((default_check&64)==64)
- default_check = (default_check&65471);
- else
- default_check = (default_check|64);
- }else if((obj.id=='dev_ot_checkbox')||(obj.id=='dev_ot_checklabel')){
- if((default_check&128)==128)
- default_check = (default_check&65407);
- else
- default_check = (default_check|128);
- }else if((obj.id=='dev_sm_checkbox')||(obj.id=='dev_sm_checklabel')){
- if((default_check&256)==256)
- default_check = (default_check&65279);
- else
- default_check = (default_check|256);
- }
- if(default_check==0){
- $("#dev_all_checkbox").removeClass('dev_checkbox');
- $("#dev_all_checkbox").removeClass('dev_few_checkbox');
- $("#dev_all_checkbox").addClass('dev_uncheckbox');
- }else if(default_check==65535){
- $("#dev_all_checkbox").removeClass('dev_uncheckbox');
- $("#dev_all_checkbox").removeClass('dev_few_checkbox');
- $("#dev_all_checkbox").addClass('dev_checkbox');
- }else{
- $("#dev_all_checkbox").removeClass('dev_uncheckbox');
- $("#dev_all_checkbox").removeClass('dev_checkbox');
- $("#dev_all_checkbox").addClass('dev_few_checkbox');
- }
- if((default_check&1)==1){
- $("#dev_ui_checkbox").removeClass('dev_uncheckbox');
- $("#dev_ui_checkbox").addClass('dev_checkbox');
- }else{
- $("#dev_ui_checkbox").removeClass('dev_checkbox');
- $("#dev_ui_checkbox").addClass('dev_uncheckbox');
- }
- if((default_check&2)==2){
- $("#dev_fc_checkbox").removeClass('dev_uncheckbox');
- $("#dev_fc_checkbox").addClass('dev_checkbox');
- }else{
- $("#dev_fc_checkbox").removeClass('dev_checkbox');
- $("#dev_fc_checkbox").addClass('dev_uncheckbox');
- }
- if((default_check&4)==4){
- $("#dev_ef_checkbox").removeClass('dev_uncheckbox');
- $("#dev_ef_checkbox").addClass('dev_checkbox');
- }else{
- $("#dev_ef_checkbox").removeClass('dev_checkbox');
- $("#dev_ef_checkbox").addClass('dev_uncheckbox');
- }
- if((default_check&8)==8){
- $("#dev_wp_checkbox").removeClass('dev_uncheckbox');
- $("#dev_wp_checkbox").addClass('dev_checkbox');
- }else{
- $("#dev_wp_checkbox").removeClass('dev_checkbox');
- $("#dev_wp_checkbox").addClass('dev_uncheckbox');
- }
- if((default_check&16)==16){
- $("#dev_ll_checkbox").removeClass('dev_uncheckbox');
- $("#dev_ll_checkbox").addClass('dev_checkbox');
- }else{
- $("#dev_ll_checkbox").removeClass('dev_checkbox');
- $("#dev_ll_checkbox").addClass('dev_uncheckbox');
- }
- if((default_check&32)==32){
- $("#dev_ci_checkbox").removeClass('dev_uncheckbox');
- $("#dev_ci_checkbox").addClass('dev_checkbox');
- }else{
- $("#dev_ci_checkbox").removeClass('dev_checkbox');
- $("#dev_ci_checkbox").addClass('dev_uncheckbox');
- }
- if((default_check&64)==64){
- $("#dev_va_checkbox").removeClass('dev_uncheckbox');
- $("#dev_va_checkbox").addClass('dev_checkbox');
- }else{
- $("#dev_va_checkbox").removeClass('dev_checkbox');
- $("#dev_va_checkbox").addClass('dev_uncheckbox');
- }
- if((default_check&128)==128){
- $("#dev_ot_checkbox").removeClass('dev_uncheckbox');
- $("#dev_ot_checkbox").addClass('dev_checkbox');
- }else{
- $("#dev_ot_checkbox").removeClass('dev_checkbox');
- $("#dev_ot_checkbox").addClass('dev_uncheckbox');
- }
- if((default_check&256)==256){
- $("#dev_sm_checkbox").removeClass('dev_uncheckbox');
- $("#dev_sm_checkbox").addClass('dev_checkbox');
- }else{
- $("#dev_sm_checkbox").removeClass('dev_checkbox');
- $("#dev_sm_checkbox").addClass('dev_uncheckbox');
- }
- bak_reset();
- }
- var chk_empty_level = function (level){
- for(var i=0;i<buildingStore.length;i++){
- if(buildingStore[i].min_level==level){
- if(((default_check&1)==1)&&(buildingStore[i].dwtype=='YTUI'))
- return false;
- else if(((default_check&2)==2)&&(buildingStore[i].dwtype=='YTFC'))
- return false;
- else if(((default_check&4)==4)&&(buildingStore[i].dwtype=='YTEF'))
- return false;
- else if(((default_check&8)==8)&&(buildingStore[i].dwtype=='YTWP'))
- return false;
- else if(((default_check&16)==16)&&(buildingStore[i].dwtype=='YTLL'))
- return false;
- else if(((default_check&32)==32)&&(buildingStore[i].dwtype=='YTCI'))
- return false;
- else if(((default_check&64)==64)&&(buildingStore[i].dwtype=='YTVA'))
- return false;
- else if(((default_check&128)==128)&&(buildingStore[i].dwtype=='YTWC'))
- return false;
- else if(((default_check&256)==256)&&(buildingStore[i].dwtype=='YTSM'))
- return false;
- }
- }
- return true;
- }
- var draw_buinding = function(){
- var building_icon_height = 0;
- $("#building_level_count").html(max_level);
- var company_building = document.getElementById('company_building');
- company_building.innerHTML='';
- var currett_build = document.createElement('div');
- company_building.appendChild(currett_build)
- var building_top = document.createElement('div');
- building_top.setAttribute('class','building_top');
- building_top.style.top='0px';
- currett_build.appendChild(building_top);
- building_icon_height += 120;
- var top_info = document.createElement('div');
- top_info.id = "building_top_info";
- top_info.setAttribute('class','building_top_label');
- top_info.innerHTML='RF';
- building_top.appendChild(top_info);
- var top_icon = document.createElement('div');
- top_icon.setAttribute('class','building_top_icon');
- building_top.appendChild(top_icon);
- if(max_level>0){
- var last_empty = max_level+2;
- var first_empty = max_level+2;
- for(var i=max_level;i>0;i--){
- if(chk_empty_level(i)){
- if(last_empty!=(i+1)){
- first_empty=i;
- last_empty=i;
- var build_level = document.createElement('div');
- build_level.setAttribute('class','building_level');
- build_level.style.top=(building_icon_height-60)+'px';
- currett_build.appendChild(build_level);
- building_icon_height += 48;
- var level_info = document.createElement('div');
- level_info.id = "building_empty_level_info_"+i;
- level_info.setAttribute('class','building_level_info')
- level_info.innerHTML=i+'F';
- build_level.appendChild(level_info);
- var level_icon = document.createElement('div');
- level_icon.setAttribute('class','building_empty_level_icon');
- build_level.appendChild(level_icon);
- }else{
- var level_info = document.getElementById('building_empty_level_info_'+first_empty);
- if(level_info!=undefined)
- level_info.innerHTML=i+'F~'+first_empty+'F';
- last_empty = i;
- }
- }else{
- var build_level = document.createElement('div');
- build_level.setAttribute('class','building_level');
- build_level.style.top=(building_icon_height-60)+'px';
- currett_build.appendChild(build_level);
- building_icon_height += 48;
- var level_info = document.createElement('div');
- level_info.id = "building_level_info_"+i;
- level_info.setAttribute('class','building_level_info')
- level_info.innerHTML=i+'F';
- build_level.appendChild(level_info);
- var level_icon = document.createElement('div');
- level_icon.setAttribute('class','building_level_icon');
- build_level.appendChild(level_icon);
- }
- }
- }
- if(min_level<0){
- for(var i=-1; i>=min_level;i--){
- var base_level = document.createElement('div');
- base_level.setAttribute('class','building_base');
- base_level.style.top=(building_icon_height-60)+'px';
- currett_build.appendChild(base_level);
- building_icon_height += 48;
- var base_info = document.createElement('div');
- base_info.id = 'building_base_info_'+(0-i);
- base_info.setAttribute('class','building_base_info');
- base_info.innerHTML='B'+(0-i)+'F';
- base_level.appendChild(base_info);
- var base_icon = document.createElement('div');
- base_icon.setAttribute('class','building_base_icon');
- base_level.appendChild(base_icon);
- }
- }
- $("#company_building").css('height',($(document).innerHeight()-365)+'px');
- building_icon_height += 60;
- currett_build.style.marginLeft='59px';
- currett_build.style.marginRight='59px';
- currett_build.style.width='536px';
- if((buildingStore!=null)&&(buildingStore.length>0)){
- for(var i=0;i<buildingStore.length;i++){
- var iconid = buildingStore[i].dwtype+'_'+buildingStore[i].min_level;
- var icon = document.getElementById(iconid);
- if(icon==undefined){
- icon = document.createElement('div');
- icon.id= buildingStore[i].dwtype+'_'+buildingStore[i].min_level;
- icon.dwtype = buildingStore[i].dwtype;
- icon.level = buildingStore[i].min_level;
- icon.owner_code = buildingStore[i].owner_code;
- icon.style.position='absolute';
- icon.style.width='62px';
- icon.style.height='62px';
- icon.style.cursor='pointer';
- icon.setAttribute('onclick','icon_click(this)');
- currett_build.appendChild(icon);
- var this_min_level = buildingStore[i].min_level;
- var level_label = document.getElementById("building_level_info_"+this_min_level);
- if(this_min_level==top_level){
- level_label = document.getElementById('building_top_info');
- }else if(this_min_level<0){
- level_label = document.getElementById('building_base_info_'+(0-this_min_level));
- }
- if(level_label!=null){
- if(buildingStore[i].dwtype=='YTUI'){
- if((default_check&1)==1){
- icon.title='用户传输装置';
- icon.style.top = (level_label.offsetParent.offsetTop+1)+'px'
- icon.style.left = (level_label.offsetParent.offsetLeft+28)+'px';
- icon.style.backgroundImage='url(../../res/img/icons/ui_icon.png)';
- }
- }else if(buildingStore[i].dwtype=='YTFC'){
- if((default_check&2)==2){
- icon.title='消防控制柜';
- icon.style.top = (level_label.offsetParent.offsetTop+15)+'px'
- icon.style.left = (level_label.offsetParent.offsetLeft+68)+'px';
- icon.style.backgroundImage='url(../../res/img/icons/fc_icon.png)';
- }
- }else if(buildingStore[i].dwtype=='YTEF'){
- if((default_check&4)==4){
- icon.title='电气火灾';
- icon.style.top = (level_label.offsetParent.offsetTop+29)+'px'
- icon.style.left = (level_label.offsetParent.offsetLeft+108)+'px';
- icon.style.backgroundImage='url(../../res/img/icons/ef_icon.png)';
- }
- }else if(buildingStore[i].dwtype=='YTWP'){
- if((default_check&8)==8){
- icon.title='水压';
- icon.style.top = (level_label.offsetParent.offsetTop+43)+'px'
- icon.style.left = (level_label.offsetParent.offsetLeft+148)+'px';
- icon.style.backgroundImage='url(../../res/img/icons/wp0_icon.png)';
- }
- }else if(buildingStore[i].dwtype=='YTLL'){
- if((default_check&16)==16){
- icon.title='液位';
- icon.style.top = (level_label.offsetParent.offsetTop+48)+'px'
- icon.style.left = (level_label.offsetParent.offsetLeft+188)+'px';
- icon.style.backgroundImage='url(../../res/img/icons/ll_icon.png)';
- }
- }else if(buildingStore[i].dwtype=='YTCI'){
- if((default_check&32)==32){
- icon.title='环境监测';
- icon.style.top = (level_label.offsetParent.offsetTop+43)+'px'
- icon.style.left = (level_label.offsetParent.offsetLeft+228)+'px';
- icon.style.backgroundImage='url(../../res/img/icons/ci_icon.png)';
- }
- }else if(buildingStore[i].dwtype=='YTVA'){
- if((default_check&64)==64){
- icon.title='视频监控';
- icon.style.top = (level_label.offsetParent.offsetTop+29)+'px'
- icon.style.left = (level_label.offsetParent.offsetLeft+268)+'px';
- icon.style.backgroundImage='url(../../res/img/icons/va_icon.png)';
- }
- }else if(buildingStore[i].dwtype=='YTWC'){
- if((default_check&128)==128){
- icon.title='风机控制柜';
- icon.style.top = (level_label.offsetParent.offsetTop+15)+'px'
- icon.style.left = (level_label.offsetParent.offsetLeft+308)+'px';
- icon.style.backgroundImage='url(../../res/img/icons/wc_icon.png)';
- }
- }else if(buildingStore[i].dwtype=='YTSM'){
- if((default_check&256)==256){
- icon.title='烟感';
- icon.style.top = (level_label.offsetParent.offsetTop+1)+'px';
- icon.style.left = (level_label.offsetParent.offsetLeft+348)+'px';
- icon.style.backgroundImage='url(../../res/img/icons/sm_icon.png)';
- }
- }
- }
- }else
- icon.owner_code="";
- }
- }
- if(show_project_info){
- var project_info_bar = document.getElementById('project_info_bar');
- project_info_bar.innerHTML='';
- var project_label = document.createElement('div');
- project_label.setAttribute('class','project_label');
- project_label.style.position='absolute';
- project_label.style.top='30px';
- project_label.style.left='50px';
- project_label.innerHTML='项目名称';
- project_info_bar.appendChild(project_label);
- var project_info = document.createElement('div');;
- project_info.setAttribute('class','project_info');
- project_info.style.position='absolute';
- project_info.style.top='60px';
- project_info.style.left='50px';
- project_info.innerHTML=companyStore.company_name;
- project_info_bar.appendChild(project_info);
- project_label = document.createElement('div');
- project_label.setAttribute('class','project_label');
- project_label.style.position='absolute';
- project_label.style.top='110px';
- project_label.style.left='50px';
- project_label.innerHTML='项目地址';
- project_info_bar.appendChild(project_label);
- project_info = document.createElement('div');;
- project_info.setAttribute('class','project_info');
- project_info.style.position='absolute';
- project_info.style.top='140px';
- project_info.style.left='50px';
- project_info.innerHTML=companyStore.address;
- project_info_bar.appendChild(project_info);
- project_label = document.createElement('div');
- project_label.setAttribute('class','project_label');
- project_label.style.position='absolute';
- project_label.style.top='190px';
- project_label.style.left='50px';
- project_label.innerHTML='项目坐标';
- project_info_bar.appendChild(project_label);
- project_info = document.createElement('div');;
- project_info.setAttribute('class','project_info');
- project_info.style.position='absolute';
- project_info.style.top='220px';
- project_info.style.left='50px';
- project_info.innerHTML=companyStore.lng+','+companyStore.lat;
- project_info_bar.appendChild(project_info);
- project_label = document.createElement('div');
- project_label.setAttribute('class','project_label');
- project_label.style.position='absolute';
- project_label.style.top='30px';
- project_label.style.left='480px';
- project_label.innerHTML='联系人';
- project_info_bar.appendChild(project_label);
- project_info = document.createElement('div');;
- project_info.setAttribute('class','project_info');
- project_info.style.position='absolute';
- project_info.style.top='60px';
- project_info.style.left='480px';
- project_info.innerHTML=companyStore.username;
- project_info_bar.appendChild(project_info);
- project_label = document.createElement('div');
- project_label.setAttribute('class','project_label');
- project_label.style.position='absolute';
- project_label.style.top='110px';
- project_label.style.left='480px';
- project_label.innerHTML='联系电话';
- project_info_bar.appendChild(project_label);
- project_info = document.createElement('div');;
- project_info.setAttribute('class','project_info');
- project_info.style.position='absolute';
- project_info.style.top='140px';
- project_info.style.left='480px';
- project_info.innerHTML=companyStore.phone;
- project_info_bar.appendChild(project_info);
- var history_alarm_list = document.getElementById('history_alarm_list');
- history_alarm_list.innerHTML='';
- var table = document.createElement('table');
- table.width='100%';
- history_alarm_list.appendChild(table);
- var tr = document.createElement('tr');
- table.appendChild(tr);
- var dwtypelist = [1,7,2,6,16,17];
- for(var i=0;i<6;i++){
- var td = document.createElement('td');
- td.setAttribute('colspan','2');
- td.setAttribute('style','width:128px;');
- td.setAttribute('class','data_bar_title');
- td.style.textAlign='center';
- td.style.paddingTop='15px';
- td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
- if(i==0)
- td.innerHTML='火灾监控';
- else if(i==1)
- td.innerHTML='电气火灾监控';
- else if(i==2)
- td.innerHTML='水系统监控';
- else if(i==3)
- td.innerHTML='RTU监控';
- else if(i==4)
- td.innerHTML='视频告警监控'
- else
- td.innerHTML='电梯告警监控'
- tr.appendChild(td);
- }
- tr = document.createElement('tr');
- table.appendChild(tr);
- for(var i=0;i<6;i++){
- var td = document.createElement('td');
- td.setAttribute('class','data_bar_total_label');
- td.style.textAlign='right';
- td.width='10%';
- td.innerHTML='设备总数';
- td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
- tr.appendChild(td);
- td = document.createElement('td');
- td.setAttribute('class','data_bar_total_number');
- td.style.textAlign='left';
- td.style.paddingLeft='10px';
- td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
- if(i==0)
- td.innerHTML=companyStore.d1;
- else if(i==1)
- td.innerHTML=companyStore.d7;
- else if(i==2)
- td.innerHTML=companyStore.d2;
- else if(i==3)
- td.innerHTML=companyStore.d6;
- else if(i==4)
- td.innerHTML=companyStore.d16;
- else
- //td.innerHTML=companyStore.d17;
- td.innerHTML=0;
- tr.appendChild(td);
- }
- tr = document.createElement('tr');
- table.appendChild(tr);
- for(var i=0;i<6;i++){
- var td = document.createElement('td');
- td.setAttribute('class','data_bar_total_label');
- td.style.textAlign='right';
- td.width='10%';
- td.innerHTML='已处理';
- td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
- tr.appendChild(td);
- td = document.createElement('td');
- td.setAttribute('class','device_confirm_num1');
- td.style.textAlign='left';
- td.style.paddingLeft='10px';
- td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
- if(i==0)
- td.innerHTML=companyStore.d1ac;
- else if(i==1)
- td.innerHTML=companyStore.d7ac;
- else if(i==2)
- td.innerHTML=companyStore.d2ac;
- else if(i==3)
- td.innerHTML=companyStore.d6ac;
- else if(i==4)
- td.innerHTML=companyStore.d16ac;
- else
- //td.innerHTML=companyStore.d17ac;
- td.innerHTML=0;
- tr.appendChild(td);
- }
- tr = document.createElement('tr');
- table.appendChild(tr);
- for(var i=0;i<6;i++){
- var td = document.createElement('td');
- td.setAttribute('class','data_bar_total_label');
- td.style.textAlign='right';
- td.width='10%';
- td.innerHTML='待处理';
- td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
- tr.appendChild(td);
- td = document.createElement('td');
- td.setAttribute('class','device_confirm_num2');
- td.style.textAlign='left';
- td.style.paddingLeft='10px';
- td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
- if(i==0)
- td.innerHTML=companyStore.d1a-companyStore.d1ac;
- else if(i==1)
- td.innerHTML=companyStore.d7a-companyStore.d7ac;
- else if(i==2)
- td.innerHTML=companyStore.d2a-companyStore.d2ac;
- else if(i==3)
- td.innerHTML=companyStore.d6a-companyStore.d6ac;
- else if(i==4)
- td.innerHTML=companyStore.d16a-companyStore.d16ac;
- else
- //td.innerHTML=companyStore.d17a-companyStore.d17ac;
- td.innerHTML=0;
- tr.appendChild(td);
- }
- tr = document.createElement('tr');
- table.appendChild(tr);
- for(var i=0;i<6;i++){
- var td = document.createElement('td');
- td.setAttribute('colspan','2');
- tr.appendChild(td);
- var div = document.createElement('div');
- div.id = 'alarm_pie_'+i;
- div.style.margin='10px auto 10px auto';
- div.style.width='110px';
- td.setAttribute('onclick','show_alarm_list("'+company_code+'","'+dwtypelist[i]+'")');
- td.appendChild(div);
- }
- draw_pie('alarm_pie_0',companyStore.d1a,companyStore.d1ac);
- draw_pie('alarm_pie_1',companyStore.d7a,companyStore.d7ac);
- draw_pie('alarm_pie_2',companyStore.d2a,companyStore.d2ac);
- draw_pie('alarm_pie_3',companyStore.d6a,companyStore.d6ac);
- draw_pie('alarm_pie_4',companyStore.d16a,companyStore.d16ac);
- //draw_pie('alarm_pie_5',companyStore.d17a,companyStore.d17ac);
- draw_pie('alarm_pie_5',0);
- }else{
- var project_info_bar = document.getElementById('project_info_bar');
- project_info_bar.innerHTML='';
- var history_alarm_list = document.getElementById('history_alarm_list');
- history_alarm_list.innerHTML='';
- }
- }
- var show_alarm_list = function(company_code,dwtype){
- $("#company_detail_title").removeClass('device_status_title_icon');
- $("#company_detail_title").addClass('history_alarm_title_icon');
- $("#bak_reset2").removeClass('hiden');
- $("#bak_reset2").addClass('shown');
- var history_alarm_list = document.getElementById('history_alarm_list');
- 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>';
- // alert(company_code+','+dwtype);
- }
- var bak_reset = function(){
- $("#company_detail_title").removeClass('history_alarm_title_icon');
- $("#company_detail_title").addClass('device_status_title_icon');
- $("#company_page_title").removeClass('realtime_title_icon');
- $("#company_page_title").addClass('project_title_icon');
- $("#bak_reset").removeClass('shown');
- $("#bak_reset").addClass('hiden');
- $("#bak_reset2").removeClass('shown');
- $("#bak_reset2").addClass('hiden');
- // $("#history_alarm_list").css('overflow-y','auto');
- var v_reset = document.getElementById('v_reset');
- if(v_reset!=undefined){
- document.body.removeChild(v_reset);
- }
- var big_view = document.getElementById('big_view');
- if(big_view!=undefined){
- document.body.removeChild(big_view);
- }
- show_project_info=true;
- draw_buinding();
- }
- var dev_click = function(obj){
- var dwtype = obj.dwtype;
- var level = obj.level;
- var id = obj.owner_code;
- var idx = obj.idx;
- show_project_info=false;
- // var history_alarm_list = document.getElementById('history_alarm_list');
- // 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>';
- show_realtime_status(idx);
- if(dwtype=='YTVA'){
- onair_video = false;
- chk_cideo();
- }
- }
- var icon_click = function(obj){
- var dwtype = obj.dwtype;
- var level = obj.level;
- var id = obj.owner_code;
- show_project_info=false;
- // $("#company_detail_title").removeClass('device_status_title_icon');
- // $("#company_detail_title").addClass('history_alarm_title_icon');
- $("#company_page_title").removeClass('project_title_icon');
- $("#company_page_title").addClass('realtime_title_icon');
- $("#bak_reset").removeClass('hiden');
- $("#bak_reset").addClass('shown');
- var project_info_bar = document.getElementById('project_info_bar');
- project_info_bar.innerHTML='';
- var query = new Object();
- query.dwtype=dwtype;
- query.level=level;
- query.V_LOGINNAME = V_LOGINNAME;
- query.COMPANY_CODE = company_code;
- $.ajax({
- type:'POST',
- url: basePath+"iot/frontpage/getCurrentStatus",
- data: {
- queryJson : Ext.JSON.encode(query)
- },
- success: function(result){
- var json = eval('(' + result + ')');
- if(json.action=='getCurrentStatus'){
- if(json.check==true){
- if(json.devices!=undefined){
- devicesStore = json.devices;
- drawCurrentStatus();
- }
- }else{
- Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function(){
- window.parent.document.location=basePath;
- });
- }
- }
- myMask.hide();
- }
- });
- // var history_alarm_list = document.getElementById('history_alarm_list');
- // history_alarm_list.style.overflowY='hidden';
- // 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>';
- if(dwtype=='YTVA'){
- onair_video = false;
- chk_cideo();
- }
- }
- var draw_pie = function(id, total, num){
- var mColor= '#34abf5';
- var percent = 100;
- if(total>0)
- percent = Number(((num*100)/total).toString().match(/^\d+(?:\.\d{0,2})?/));
- if(percent<60)
- mColor = '#f66167';
- else if(percent<80)
- mColor = '#DDDF0D';
- Highcharts.getOptions().colors = Highcharts.map(['#f66167','#34abf5', '#DDDF0D', '#ff2e95', '#39b54a', '#ffb163', '#c233ac', '#9dffad', '#c77051'], function (color) {
- return {
- radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
- stops: [
- [0, color],
- [1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
- ]
- };
- });
- Highcharts.chart(id,{
- chart: {
- type: 'pie',
- backgroundColor: 'rgba(0,0,0,0)',
- height:'100%',
- options3d: {
- enabled: true,
- alpha: 45,
- beta: 0
- }
- },
- title: {
- text: '处置率:'+percent+'%',
- floating:true,
- y:95,
- style:{fontSize:'12px',color:'#ffffff'}
- },
- exporting: {
- enabled: false
- },
- credits: {
- enabled: false
- },
- tooltip: {
- // enabled: false
- pointFormat: '{point.percentage:.2f}%'
- },
- plotOptions: {
- pie: {
- allowPointSelect: true,
-
- cursor: 'pointer',
- depth: 15,
- dataLabels: {
- enabled: false,
- format: '{point.name}'
- }
- }
- },
- series: [{
- type: 'pie',
- name: '处置率',
- startAngle:90,
- data: [{
- name:'待处理',
- y:100-percent,
- sliced: true,
- selected: true
- },
- ['已处理', percent]
- ]
- }]
- });
- }
- var drawCurrentStatus = function(){
- if((devicesStore!=null)&&(devicesStore.length>0)){
- if(onair_video){
- onair_video = false;
- chk_cideo();
- }
- var project_info_bar = document.getElementById('project_info_bar');
- var device_icon = document.createElement('img');
- if(devicesStore[0].dwtype=='YTUI'){
- device_icon.setAttribute('class','device_large_icon');
- device_icon.src = basePath+'res/img/icons/ui_large_icon.gif';
- }else if(devicesStore[0].dwtype=='YTFC'){
- device_icon.setAttribute('class','device_large_icon');
- device_icon.src = basePath+'res/img/icons/fc_large_icon.gif';
- }else if(devicesStore[0].dwtype=='YTCI'){
- device_icon.setAttribute('class','device_large_icon');
- device_icon.src = basePath+'res/img/icons/ci_large_icon.gif';
- }else if(devicesStore[0].dwtype=='YTWP'){
- device_icon.setAttribute('class','device_large_icon');
- device_icon.src = basePath+'res/img/icons/wp1_large_icon.gif';
- }else if(devicesStore[0].dwtype=='YTLL'){
- device_icon.setAttribute('class','device_large_icon');
- device_icon.src = basePath+'res/img/icons/ll_large_icon.gif';
- }else if(devicesStore[0].dwtype=='YTVA'){
- device_icon.setAttribute('class','device_large_icon');
- device_icon.src = basePath+'res/img/icons/va_large_icon.gif';
- }else if(devicesStore[0].dwtype=='YTEF'){
- device_icon.setAttribute('class','device_large_icon');
- device_icon.src = basePath+'res/img/icons/ef_large_icon.gif';
- }else if(devicesStore[0].dwtype=='YTWC'){
- device_icon.setAttribute('class','device_large_icon');
- device_icon.src = basePath+'res/img/icons/wc_large_icon.gif';
- }else if(devicesStore[0].dwtype=='YTSM'){
- device_icon.setAttribute('class','device_large_icon');
- device_icon.src = basePath+'res/img/icons/sm_large_icon.gif';
- }
- // var device_icon = document.createElement('div');
- // if(devicesStore[0].dwtype=='YTUI'){
- // device_icon.setAttribute('class','device_large_icon ui_large_icon');
- // }else if(devicesStore[0].dwtype=='YTFC'){
- // device_icon.setAttribute('class','device_large_icon fc_large_icon');
- // }else if(devicesStore[0].dwtype=='YTCI'){
- // device_icon.setAttribute('class','device_large_icon ci_large_icon');
- // }else if(devicesStore[0].dwtype=='YTWP'){
- // device_icon.setAttribute('class','device_large_icon wp1_large_icon');
- // }else if(devicesStore[0].dwtype=='YTLL'){
- // device_icon.setAttribute('class','device_large_icon ll_large_icon');
- // }else if(devicesStore[0].dwtype=='YTVA'){
- // device_icon.setAttribute('class','device_large_icon va_large_icon');
- // }else if(devicesStore[0].dwtype=='YTEF'){
- // device_icon.setAttribute('class','device_large_icon ef_large_icon');
- // }
- project_info_bar.appendChild(device_icon);
- var device_count_label = document.createElement('div');
- device_count_label.id='device_count_label';
- device_count_label.setAttribute('class','device_count_label');
- project_info_bar.appendChild(device_count_label);
- var device_list_bar = document.createElement('div');
- device_list_bar.setAttribute('class','device_list_bar');
- project_info_bar.appendChild(device_list_bar);
- var status_list_bar = document.createElement('div');
- status_list_bar.id='status_list_bar';
- status_list_bar.setAttribute('status','');
- status_list_bar.setAttribute('class','status_list_bar');
- status_list_bar.style.width= ($(document).innerWidth()-1528)+'px';
- project_info_bar.appendChild(status_list_bar);
- for(var i=0;i<devicesStore.length;i++){
- var dev = document.createElement('div');
- dev.owner_code = devicesStore[i].owner_code;
- dev.id = "device_list_bar_sub_"+i;
- dev.dwtype = devicesStore[i].dwtype;
- dev.level = devicesStore[i].level;
- dev.style.margin='10px';
- dev.style.padding='10px';
- dev.style.width='300px';
- dev.style.cursor='pointer';
- dev.idx = i;
- dev.setAttribute('onclick','dev_click(this)');
- device_list_bar.appendChild(dev);
- $("#device_list_bar_sub_"+i).mouseover(function(){
- $(this).css('background','rgba(64,85,98,0.7)');
- });
- $("#device_list_bar_sub_"+i).mouseout(function(){
- $(this).css('background','rgba(0,0,0,0)');
- });
- var dev_name_label = document.createElement('div');
- dev_name_label.setAttribute('class','project_label');
- dev_name_label.style.marginTop='6px';
- dev_name_label.innerHTML='设备名称';
- dev.appendChild(dev_name_label);
- var dev_name_info = document.createElement('div');
- dev_name_info.setAttribute('class','project_info');
- dev_name_info.style.marginTop='12px';
- dev_name_info.innerHTML=devicesStore[i].device_name;
- dev.appendChild(dev_name_info);
- var dev_code_label = document.createElement('div');
- dev_code_label.setAttribute('class','project_label');
- dev_code_label.style.marginTop='14px';
- dev_code_label.innerHTML='设备编号';
- dev.appendChild(dev_code_label);
- var dev_code_info = document.createElement('div');
- dev_code_info.setAttribute('class','project_info');
- dev_code_info.style.marginTop='12px';
- dev_code_info.innerHTML=devicesStore[i].owner_code;
- dev.appendChild(dev_code_info);
- var dev_OBJ_label = document.createElement('div');
- dev_OBJ_label.setAttribute('class','project_label');
- dev_OBJ_label.style.marginTop='14px';
- dev_OBJ_label.innerHTML='监测对象';
- dev.appendChild(dev_OBJ_label);
- var dev_OBJ_info = document.createElement('div');
- dev_OBJ_info.setAttribute('class','project_info');
- dev_OBJ_info.style.marginTop='12px';
- dev_OBJ_info.innerHTML=devicesStore[i].object_name;
- dev.appendChild(dev_OBJ_info);
- var dev_time_label = document.createElement('div');
- dev_time_label.setAttribute('class','project_label');
- dev_time_label.style.marginTop='14px';
- dev_time_label.innerHTML='数据更新时间';
- dev.appendChild(dev_time_label);
- var dev_time_info = document.createElement('div');
- dev_time_info.setAttribute('class','project_info');
- dev_time_info.style.marginTop='12px';
- dev_time_info.style.marginBottom='12px';
- dev_time_info.innerHTML=(devicesStore[i].status_time=='1970-01-01 08:00:00')?'-':devicesStore[i].status_time;
- dev.appendChild(dev_time_info);
- }
- }
- show_realtime_status(0);
- }
- var big_view_win = function(obj){
- Ext.create('Ext.window.Window', {
- id:'big_view_win',
- title: '监控视频',
- height: 680,
- width: 800,
- layout: 'fit',
- modal:true,
- maximizable :true,
- buttons:[
- {
- text:'关闭',
- handler : function() {
- Ext.getCmp('big_view_win').destroy();
- }
- }
- ],
- closeAction:'destroy',
- html:'<iframe width="99%" height="99%" frameborder=0 allowtransparency="true" scrolling=auto src="'+basePath+'view/frontpage/video.jsp?videoId='+obj.owner_code+'"></iframe>'
- }).show();
- }
- var reset_video = function(obj){
- var query = {
- CMD:3,
- BODY:{
- DEVICE:obj.owner_code,
- ACTION:0,
- IDX:0
- }
- }
- var status_list_bar = document.getElementById('status_list_bar');
- status_list_bar.setAttribute('status','connecting');
- status_list_bar.innerHTML='<div style="margin-top:120px;">连接中,请稍候...</div>';
- $.ajax({
- type:'POST',
- url:'https://iot.usky.cn/YtIoT/cgi-bin/demo2.cgi',
- data:'queryJson:'+JSON.stringify(query),
- success:function(result){
- }
- });
- onair_video = false;
- setTimeout(chk_cideo,5000);
- }
- var open_video = function(obj){
- var query = {
- CMD:3,
- BODY:{
- DEVICE:obj.getAttribute('owner_code'),
- ACTION:1,
- IDX:7
- }
- }
- var status_list_bar = document.getElementById('status_list_bar');
- status_list_bar.setAttribute('status','connecting');
- status_list_bar.innerHTML='<div style="margin-top:120px;">连接中,请稍候...</div>';
- $.ajax({
- type:'POST',
- url:'https://iot.usky.cn/YtIoT/cgi-bin/demo2.cgi',
- data:'queryJson:'+JSON.stringify(query),
- success:function(result){
- }
- });
- onair_video = false;
- // setTimeout(chk_cideo,5000);
- }
- var chk_cideo = function(){
- if(onair_video)
- return;
- var query = {
- CMD:1
- }
- $.ajax({
- type:'POST',
- url:'https://iot.usky.cn/YtIoT/cgi-bin/demo2.cgi',
- data:'queryJson:'+JSON.stringify(query),
- success:function(result){
- var json = eval('(' + result + ')');
- var v_reset = document.getElementById('v_reset');
- if(v_reset!=undefined){
- var found = false;
- if(json.RESULT.LIST!=undefined){
- if(json.RESULT.LIST.length>0){
- for(var i=0;i<json.RESULT.LIST.length;i++){
- if(json.RESULT.LIST[i].DEVICE==v_reset.owner_code){
- found = true;
- online_video = json.RESULT.LIST[i].LIVEONLINE;
- if((json.RESULT.LIST[i].ONAIR)&&(!onair_video)){
- $("#v_reset").css('display','block');
- $("#big_view").css('display','block');
- onair_video = true;
- var status_list_bar = document.getElementById('status_list_bar');
- status_list_bar.setAttribute('status','');
- 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>';
- }else if(!json.RESULT.LIST[i].ONAIR){
- if(json.RESULT.LIST[i].ALIVEVALUE==3){
- onair_video = false;
- var status_list_bar = document.getElementById('status_list_bar');
- if(status_list_bar.getAttribute('status')=='')
- status_list_bar.innerHTML='<div style="margin-top:120px;cursor:pointer;" owner_code="'+json.RESULT.LIST[i].DEVICE+'" onclick="open_video(this)">设备在线,点击加载视频</div>';
- }else if(json.RESULT.LIST[i].ALIVEVALUE==2){
- onair_video = false;
- var status_list_bar = document.getElementById('status_list_bar');
- status_list_bar.setAttribute('status','');
- status_list_bar.innerHTML='<div style="margin-top:120px;">设备重连中,请稍候...</div>';
- }else{
- onair_video = false;
- var status_list_bar = document.getElementById('status_list_bar');
- status_list_bar.setAttribute('status','');
- status_list_bar.innerHTML='<div style="margin-top:120px;">设备未连线,尝试连接。请稍候...</div>';
- }
- }
- }
- }
- }
- }
- }
- }
- });
- setTimeout(chk_cideo,5000);
- }
- var show_realtime_status = function(idx){
- $("#device_count_label").html('');
- if((devicesStore!=null)&&(devicesStore.length>idx)){
- $("#device_count_label").html('[ '+devicesStore.length+'-'+(idx+1)+' ]');
- var status_list_bar = document.getElementById('status_list_bar');
- status_list_bar.setAttribute('status','');
- status_list_bar.innerHTML='';
- var title = document.createElement('div');
- title.id = 'device_list_status_title';
- title.style.textAlign='center';
- title.style.fontSize='16px';
- title.style.fontWeight='bold';
- title.innerHTML=devicesStore[idx].device_name;
- status_list_bar.appendChild(title);
- var sta = document.createElement('table');
- sta.style.marginTop='10px';
- sta.width='100%';
- sta.idx = i;
- status_list_bar.appendChild(sta);
- var v_reset = document.getElementById('v_reset');
- if(v_reset!=undefined){
- document.body.removeChild(v_reset);
- }
- var big_view = document.getElementById('big_view');
- if(big_view!=undefined){
- document.body.removeChild(big_view);
- }
- $("#status_list_bar").removeClass('status_list_bar_video');
- if(devicesStore[idx].dwtype=='YTVA'){
- online_video = false;
- if(onair_video){
- onair_video = false;
- chk_cideo();
- }
- v_reset = document.createElement('div');
- v_reset.id='v_reset';
- v_reset.owner_code=devicesStore[idx].owner_code;
- v_reset.setAttribute('class','v_reset');
- v_reset.setAttribute('onclick','reset_video(this)');
- v_reset.title='视频重载';
- document.body.appendChild(v_reset);
- $("#v_reset").css('display','none');
- big_view = document.createElement('div');
- big_view.id='big_view';
- big_view.owner_code=devicesStore[idx].owner_code;
- big_view.setAttribute('class','big_view');
- big_view.setAttribute('onclick','big_view_win(this)');
- big_view.title='视频放大';
- document.body.appendChild(big_view);
- $("#big_view").css('display','none');
- $("#status_list_bar").addClass('status_list_bar_video');
- $("#status_list_bar").html('<div style="margin-top:120px;">连接中,请稍候...</div>');
- }else if(devicesStore[idx].dwtype=='YTFC'){
- var tr = document.createElement('tr');
- sta.appendChild(tr);
- var td = document.createElement('td');
- td.width='30%';
- td.setAttribute('class','point_label project_label');
- td.style.paddingTop='14px';
- td.id='PowerAlarmLabel';
- td.innerHTML='电源故障状态';
- tr.appendChild(td);
- td = document.createElement('td');
- td.id='PowerAlarm';
- td.width='20%';
- td.setAttribute('class','project_info');
- td.style.paddingTop='12px';
- tr.appendChild(td);
- var td = document.createElement('td');
- td.setAttribute('class','point_label project_label');
- td.style.paddingTop='14px';
- td.width='30%';
- td.id='ManualActLabel';
- td.innerHTML='手自动状态';
- tr.appendChild(td);
- td = document.createElement('td');
- td.width='20%';
- td.id='ManualAct';
- td.setAttribute('class','project_info');
- td.style.paddingTop='12px';
- tr.appendChild(td);
- tr = document.createElement('tr');
- sta.appendChild(tr);
- var td = document.createElement('td');
- td.setAttribute('class','point_label project_label');
- td.style.paddingTop='14px';
- td.id='DevWorking01Label';
- td.innerHTML='1#设备运行状态';
- tr.appendChild(td);
- td = document.createElement('td');
- td.id='DevWorking01';
- td.setAttribute('class','project_info');
- td.style.paddingTop='12px';
- tr.appendChild(td);
- var td = document.createElement('td');
- td.setAttribute('class','point_label project_label');
- td.style.paddingTop='14px';
- td.id='DevWorking02Label';
- td.innerHTML='2#设备运行状态';
- tr.appendChild(td);
- td = document.createElement('td');
- td.id='DevWorking02';
- td.setAttribute('class','project_info');
- td.style.paddingTop='12px';
- tr.appendChild(td);
- tr = document.createElement('tr');
- sta.appendChild(tr);
- var td = document.createElement('td');
- td.setAttribute('class','point_label project_label');
- td.style.paddingTop='14px';
- td.id='DevAlarm01Label';
- td.innerHTML='1#设备故障状态';
- tr.appendChild(td);
- td = document.createElement('td');
- td.id='DevAlarm01';
- td.setAttribute('class','project_info');
- td.style.paddingTop='12px';
- tr.appendChild(td);
- var td = document.createElement('td');
- td.setAttribute('class','point_label project_label');
- td.style.paddingTop='14px';
- td.id='DevAlarm02Label';
- td.innerHTML='2#设备故障状态';
- tr.appendChild(td);
- td = document.createElement('td');
- td.id='DevAlarm02';
- td.setAttribute('class','project_info');
- td.style.paddingTop='12px';
- tr.appendChild(td);
- tr = document.createElement('tr');
- sta.appendChild(tr);
- var td = document.createElement('td');
- td.setAttribute('class','point_label project_label');
- td.style.paddingTop='14px';
- td.id='FireAutoActLabel';
- td.innerHTML='消防联动状态';
- tr.appendChild(td);
- td = document.createElement('td');
- td.id='FireAutoAct';
- td.setAttribute('class','project_info');
- td.style.paddingTop='12px';
- tr.appendChild(td);
- var status_list = devicesStore[idx].status_list;
- status_list.sort(staSortBypoint);
- for(var i=0;i<status_list.length;i++){
- var words = status_list[i].content.split(" ");
- if(words.length>0){
- if(status_list[i].point_code==1){
- $("#PowerAlarmLabel").html(status_list[i].point_name);
- $("#PowerAlarm").html(words[0]);
- }else if(status_list[i].point_code==2){
- $("#ManualActLabel").html(status_list[i].point_name);
- $("#ManualAct").html(words[0]);
- }else if(status_list[i].point_code==3){
- $("#DevWorking01Label").html(status_list[i].point_name);
- $("#DevWorking01").html(words[0]);
- }else if(status_list[i].point_code==4){
- $("#DevWorking02Label").html(status_list[i].point_name);
- $("#DevWorking02").html(words[0]);
- }else if(status_list[i].point_code==5){
- $("#DevAlarm01Label").html(status_list[i].point_name);
- $("#DevAlarm01").html(words[0]);
- }else if(status_list[i].point_code==6){
- $("#DevAlarm02Label").html(status_list[i].point_name);
- $("#DevAlarm02").html(words[0]);
- }else if(status_list[i].point_code==7){
- $("#FireAutoActLabel").html(status_list[i].point_name);
- $("#FireAutoAct").html(words[0]);
- }
- }
- }
- }else if(devicesStore[idx].dwtype=='YTWC'){
- var status_list = devicesStore[idx].status_list;
- status_list.sort(staSortBypoint);
- for(var i=0;i<status_list.length;i++){
-
- var tr = document.createElement('tr');
- sta.appendChild(tr);
- var td = document.createElement('td');
- td.width='30%';
- td.setAttribute('class','point_label project_label');
- td.style.paddingTop='14px';
- td.innerHTML=status_list[i].point_name;
- tr.appendChild(td);
- td = document.createElement('td');
- td.innerHTML=(status_list[i].content).substring(0,2);
- td.width='20%';
- td.setAttribute('class','project_info');
- td.style.paddingTop='12px';
- tr.appendChild(td);
- }
- }else if(devicesStore[idx].dwtype=='YTEF'){
- var tr = document.createElement('tr');
- sta.appendChild(tr);
- var td = document.createElement('td');
- td.setAttribute('class','project_label');
- td.innerHTML='供电过压状态';
- tr.appendChild(td);
- td = document.createElement('td');
- td.setAttribute('class','project_label');
- td.innerHTML='供电低压状态';
- tr.appendChild(td);
- td = document.createElement('td');
- td.setAttribute('class','project_label');
- td.innerHTML='供电过流状态';
- tr.appendChild(td);
- tr = document.createElement('tr');
- sta.appendChild(tr);
- td = document.createElement('td');
- td.id='HighVoltageAlarm'
- td.setAttribute('class','project_info');
- tr.appendChild(td);
- td = document.createElement('td');
- td.id='LowVoltageAlarm'
- td.setAttribute('class','project_info');
- tr.appendChild(td);
- td = document.createElement('td');
- td.id='HighCurrentAlarm'
- td.setAttribute('class','project_info');
- tr.appendChild(td);
- tr = document.createElement('tr');
- sta.appendChild(tr);
- td = document.createElement('td');
- td.setAttribute('class','project_label');
- td.innerHTML='漏电报警状态';
- tr.appendChild(td);
- tr = document.createElement('tr');
- sta.appendChild(tr);
- td = document.createElement('td');
- td.id='ElectricityLeakage'
- td.setAttribute('class','project_info');
- tr.appendChild(td);
- tr = document.createElement('tr');
- sta.appendChild(tr);
- td = document.createElement('td');
- td.setAttribute('class','project_label');
- td.innerHTML='A相线缆高温状态';
- tr.appendChild(td);
- td = document.createElement('td');
- td.setAttribute('class','project_label');
- td.innerHTML='B相线缆高温状态';
- tr.appendChild(td);
- td = document.createElement('td');
- td.setAttribute('class','project_label');
- td.innerHTML='C相线缆高温状态';
- tr.appendChild(td);
- tr = document.createElement('tr');
- sta.appendChild(tr);
- td = document.createElement('td');
- td.setAttribute('class','project_info');
- td.id='HighTemperatureA';
- tr.appendChild(td);
- td = document.createElement('td');
- td.setAttribute('class','project_info');
- td.id='HighTemperatureB';
- tr.appendChild(td);
- td = document.createElement('td');
- td.setAttribute('class','project_info');
- td.id='HighTemperatureC';
- tr.appendChild(td);
- tr = document.createElement('tr');
- sta.appendChild(tr);
- td = document.createElement('td');
- td.setAttribute('class','project_label');
- td.innerHTML='A相电压';
- tr.appendChild(td);
- td = document.createElement('td');
- td.setAttribute('class','project_label');
- td.innerHTML='B相电压';
- tr.appendChild(td);
- td = document.createElement('td');
- td.setAttribute('class','project_label');
- td.innerHTML='C相电压';
- tr.appendChild(td);
- tr = document.createElement('tr');
- sta.appendChild(tr);
- td = document.createElement('td');
- td.setAttribute('class','project_info');
- td.id='VoltageA';
- tr.appendChild(td);
- td = document.createElement('td');
- td.setAttribute('class','project_info');
- td.id='VoltageB';
- tr.appendChild(td);
- td = document.createElement('td');
- td.setAttribute('class','project_info');
- td.id='VoltageC';
- tr.appendChild(td);
- tr = document.createElement('tr');
- sta.appendChild(tr);
- td = document.createElement('td');
- td.setAttribute('class','project_label');
- td.innerHTML='A相电流';
- tr.appendChild(td);
- td = document.createElement('td');
- td.setAttribute('class','project_label');
- td.innerHTML='B相电流';
- tr.appendChild(td);
- td = document.createElement('td');
- td.setAttribute('class','project_label');
- td.innerHTML='C相电流';
- tr.appendChild(td);
- tr = document.createElement('tr');
- sta.appendChild(tr);
- td = document.createElement('td');
- td.setAttribute('class','project_info');
- td.id='CurrentA';
- tr.appendChild(td);
- td = document.createElement('td');
- td.setAttribute('class','project_info');
- td.id='CurrentB';
- tr.appendChild(td);
- td = document.createElement('td');
- td.setAttribute('class','project_info');
- td.id='CurrentC';
- tr.appendChild(td);
- tr = document.createElement('tr');
- sta.appendChild(tr);
- td = document.createElement('td');
- td.setAttribute('class','project_label');
- td.innerHTML='A相温度';
- tr.appendChild(td);
- td = document.createElement('td');
- td.setAttribute('class','project_label');
- td.innerHTML='B相温度';
- tr.appendChild(td);
- td = document.createElement('td');
- td.setAttribute('class','project_label');
- td.innerHTML='C相温度';
- tr.appendChild(td);
- tr = document.createElement('tr');
- sta.appendChild(tr);
- td = document.createElement('td');
- td.setAttribute('class','project_info');
- td.id='TemperatureA';
- tr.appendChild(td);
- td = document.createElement('td');
- td.setAttribute('class','project_info');
- td.id='TemperatureB';
- tr.appendChild(td);
- td = document.createElement('td');
- td.setAttribute('class','project_info');
- td.id='TemperatureC';
- tr.appendChild(td);
- var status_list = devicesStore[idx].status_list;
- status_list.sort(staSortBypoint);
- for(var i=0;i<status_list.length;i++){
- if(status_list[i].point_code==1){
- $("#HighVoltageAlarm").html((status_list[i].point_data=='0')?'正常':'告警');
- }else if(status_list[i].point_code==2){
- $("#LowVoltageAlarm").html((status_list[i].point_data=='0')?'正常':'告警');
- }else if(status_list[i].point_code==3){
- $("#HighCurrentAlarm").html((status_list[i].point_data=='0')?'正常':'告警');
- }else if(status_list[i].point_code==4){
- $("#ElectricityLeakage").html((status_list[i].point_data=='0')?'正常':'告警');
- }else if(status_list[i].point_code==5){
- $("#HighTemperatureA").html((status_list[i].point_data=='0')?'正常':'告警');
- }else if(status_list[i].point_code==6){
- $("#HighTemperatureB").html((status_list[i].point_data=='0')?'正常':'告警');
- }else if(status_list[i].point_code==7){
- $("#HighTemperatureC").html((status_list[i].point_data=='0')?'正常':'告警');
- }else if(status_list[i].point_code==65){
- if(status_list[i].point_data.length>0)
- $("#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+'\')"/>');
- }else if(status_list[i].point_code==66){
- if(status_list[i].point_data.length>0)
- $("#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+'\')"/>');
- }else if(status_list[i].point_code==67){
- if(status_list[i].point_data.length>0)
- $("#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+'\')"/>');
- }else if(status_list[i].point_code==68){
- if(status_list[i].point_data.length>0)
- $("#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+'\')"/>');
- }else if(status_list[i].point_code==69){
- if(status_list[i].point_data.length>0)
- $("#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+'\')"/>');
- }else if(status_list[i].point_code==70){
- if(status_list[i].point_data.length>0)
- $("#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+'\')"/>');
- }else if(status_list[i].point_code==71){
- if(status_list[i].point_data.length>0){
- if(status_list[i].point_data=='-200.000')
- $("#TemperatureA").html('-')
- else
- $("#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+'\')"/>');
- }
- }else if(status_list[i].point_code==72){
- if(status_list[i].point_data.length>0){
- if(status_list[i].point_data=='-200.000')
- $("#TemperatureB").html('-');
- else
- $("#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+'\')"/>');
- }
- }else if(status_list[i].point_code==73){
- if(status_list[i].point_data.length>0){
- if(status_list[i].point_data=='-200.000')
- $("#TemperatureC").html('-');
- else
- $("#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+'\')"/>');
- }
- }
- }
- }else if(devicesStore[idx].dwtype=='YTSM'){
- var status_list = devicesStore[idx].status_list;
- status_list.sort(staSortBypoint);
- for(var i=0;i<status_list.length;i++){
- if(((status_list[i].point_code>0)&&(status_list[i].point_code<5)&&(status_list[i].point_name!='')&&(status_list[i].point_code!=3))
- ||((status_list[i].point_code==3)&&(status_list[i].point_data!=0))){
- var tr = document.createElement('tr');
- sta.appendChild(tr);
- var sta_name = document.createElement('td');
- sta_name.width="40%";
- sta_name.setAttribute('class','point_label project_label');
- sta_name.style.paddingTop='14px';
- sta_name.innerHTML=status_list[i].point_name;
- tr.appendChild(sta_name);
- var sta_value = document.createElement('td');
- sta_value.setAttribute('class','project_info');
- sta_value.style.paddingTop='12px';
- if(status_list[i].point_code==1)
- sta_value.innerHTML = status_list[i].content;
- else
- 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+'\')"/>';
- tr.appendChild(sta_value);
- }
- }
- }else{
- var status_list = devicesStore[idx].status_list;
- status_list.sort(staSortBypoint);
- for(var i=0;i<status_list.length;i++){
- if(status_list[i].point_code>0){
- var tr = document.createElement('tr');
- sta.appendChild(tr);
- var sta_name = document.createElement('td');
- sta_name.width="40%";
- sta_name.setAttribute('class','point_label project_label');
- sta_name.style.paddingTop='14px';
- sta_name.innerHTML=status_list[i].point_name;
- tr.appendChild(sta_name);
- var sta_value = document.createElement('td');
- sta_value.setAttribute('class','project_info');
- sta_value.style.paddingTop='12px';
- // sta_value.style.paddingBottom='12px';
- if(devicesStore[idx].dwtype=='YTUI'){
- if(V_LOGINNAME=='admin')
- 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+')"/>';
- else
- sta_value.innerHTML=status_list[i].content;
- }else if((devicesStore[idx].dwtype=='YTWP')||(devicesStore[idx].dwtype=='YTLL')){
- if(status_list[i].point_name.indexOf('状态')>=0){
- if((status_list[i].point_data==0)||(status_list[i].point_data=='00'))
- sta_value.innerHTML='正常';
- else
- sta_value.innerHTML='--';
- }else if(status_list[i].point_data.length>0)
- 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+'\')"/>';
- }else if(status_list[i].point_data.length>0)
- 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+'\')"/>';
- tr.appendChild(sta_value);
- }
- }
- }
- }
- }
- var fill_uiwin = function (json) {
- fillvalue=true;
- Ext.getCmp('userinfo_pushalarm').setValue(json.PUSH_WX==1);
- Ext.getCmp('userinfo_pushtts').setValue(json.PUSH_TTS==1);
- fillvalue=false;
- var data = new Array();
- for(var i=0;i<json.LIST.length;i++){
- var obj = new Array();
- if(json.LIST[i].id==1)
- obj.push('故障');
- else if(json.LIST[i].id==2)
- obj.push('告警');
- else if(json.LIST[i].id==3)
- obj.push('反馈');
- else if(json.LIST[i].id==4)
- obj.push('监管');
- else if(json.LIST[i].id==5)
- obj.push('启动');
- else if(json.LIST[i].id==6)
- obj.push('自检');
- else if(json.LIST[i].id==7)
- obj.push('屏蔽');
- else if(json.LIST[i].id==8)
- obj.push('复位');
- else if(json.LIST[i].id==9)
- obj.push('消音');
- obj.push(json.LIST[i].count);
- data.push(obj);
- }
- var themecolor = ((theme=='')||(theme=='access'))?'#ffffff':'#000000';
- Highcharts.chart('detail_area', {
- chart: {
- type: 'column',
- backgroundColor: 'rgba(0,0,0,0)'
- },
- title: {
- text: '用户传输装置报告类型统计',
- style:{fontSize:'14px',color:themecolor,fontWeight:'bold'},
- },
- xAxis: {
- type: 'category',
- labels:{
- style:{fontSize:'12px',color:themecolor,fontWeight:'bold'}
- }
- },
- yAxis: {
- title: {
- text: '报告计次',
- style:{fontSize:'14px',color:themecolor,fontWeight:'bold'}
- },
- labels:{
- style:{fontSize:'12px',color:themecolor,fontWeight:'bold'}
- }
- },
- legend: {
- enabled: false
- },
- exporting: {
- enabled: false
- },
- credits: {
- enabled: false
- },
- series: [{
- name: '报告计次',
- data: data,
- dataLabels: {
- enabled: true,
- rotation: -90,
- align: 'right',
- format:'{point.y}',
- style:{fontSize:'14px',color:themecolor,fontWeight:'bold'},
- y:10
- },
- colorByPoint: true
- }]
-
- });
- }
- var show_userinfo_detail = function(devId){
- var device_id = devId;
- Ext.create('Ext.window.Window',{
- id:'detail_userinfo_win',
- title:'<div id="detail_userinfo_title">用户传输装置信息</div>',
- bodyStyle:'background-color:rgba(0,0,0,0.0);',
- height:400,
- width:1110,
- modal:true,
- layout:{
- type:'table',
- columns:6,
- tableAttrs:{
- style:{
- width:'100%'
- }
- }
- },
- buttons:[{
- text:'查岗',
- handler : function() {
- var query = new Object();
- query.V_LOGINNAME = V_LOGINNAME;
- query.V_PASSWORD = V_PASSWORD;
- query.DEVICE_ID = devId;
- query.CMD = 91;
- query.LIMIT = 10;
- var qjson = Ext.JSON.encode(query);
- 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());
- $.ajax({
- type:'POST',
- url: url,
- data: qjson,
- success: function(result){
- var json = eval('(' + result + ')');
- if(json.RESULT=='1'){
- Ext.Msg.alert('操作信息','命令已下发');
- }
- }
- });
- }
- },{
- text:'清空',
- handler : function() {
- var query = new Object();
- query.V_LOGINNAME = V_LOGINNAME;
- query.V_PASSWORD = V_PASSWORD;
- query.DEVICE_ID = devId;
- query.CMD = 92;
- query.LIMIT = 0;
- var qjson = Ext.JSON.encode(query);
- 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());
- $.ajax({
- type:'POST',
- url: url,
- data: qjson,
- success: function(result){
- var json = eval('(' + result + ')');
- if(json.RESULT=='1'){
- Ext.Msg.alert('操作信息','命令已下发');
- fill_uiwin(json);
- }
-
- }
- });
- }
- },{
- text:'查询',
- handler : function() {
- var query = new Object();
- query.V_LOGINNAME = V_LOGINNAME;
- query.V_PASSWORD = V_PASSWORD;
- query.DEVICE_ID = devId;
- query.CMD = 93;
- query.PARAM = 0;
- var qjson = Ext.JSON.encode(query);
- 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());
- $.ajax({
- type:'POST',
- url: url,
- data: qjson,
- success: function(result){
- var json = eval('(' + result + ')');
- if(json.RESULT=='1')
- {
- fill_uiwin(json);
- }
- }
- });
- }
- },{
- text:'关闭',
- handler : function() {
- Ext.getCmp('detail_userinfo_win').destroy();
- }
- }],
- tbar:['->',{
- xtype: 'checkbox',
- boxLabel: '语音推送',
- id:'userinfo_pushtts',
- checked:true,
- hidden:true,
- handler:function(){
- if(!fillvalue){
- var pushtts = Ext.getCmp('userinfo_pushtts').getValue();
- Ext.create('Ext.window.Window',{
- id:'detail_userinfo_pushset_win',
- title:'请验证身份',
- width:320,
- height:240,
- modal:true,
- closable:false,
- items:[{
- xtype:'textfield',
- name:'v_loginname',
- fieldLabel:'登录名',
- id:'v_loginname',
- allowBlank:false
- },{
- xtype:'textfield',
- name:'v_password',
- fieldLabel:'密 码',
- id:'v_password',
- inputType:'password',
- allowBlank:false
- }],
- bbar: ['->',{
- xtype:'button',
- text:'提交',
- handler:function(){
- var query = new Object();
- query.V_LOGINNAME = V_LOGINNAME;
- query.V_PASSWORD = V_PASSWORD;
- query.DEVICE_ID = devId;
- query.CMD = 95;
- query.PARAM = pushtts?1:0;
- var qjson = Ext.JSON.encode(query);
- 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());
- $.ajax({
- type:'POST',
- url: url,
- data: qjson,
- success: function(result){
- var json = eval('(' + result + ')');
- if(json.RESULT=='1')
- {
- Ext.Msg.alert('操作信息','命令已下发');
- }
- }
- });
- this.up("window").close();
- }
- },{
- xtype:'button',
- text:'关闭',
- handler:function(){
- this.up("window").close();
- }
- }],
- closeAction:'destroy',
- listeners:{
- close:function(){
- var query = new Object();
- query.V_LOGINNAME = V_LOGINNAME;
- query.V_PASSWORD = V_PASSWORD;
- query.DEVICE_ID = devId;
- query.CMD = 93;
- query.PARAM = 0;
- var qjson = Ext.JSON.encode(query);
- 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());
- $.ajax({
- type:'POST',
- url: url,
- data: qjson,
- success: function(result){
- var json = eval('(' + result + ')');
- if(json.RESULT=='1')
- {
- fill_uiwin(json);
- }
- }
- });
- }
- }
- }).show();
- }
- }
- },'-',{
- xtype: 'checkbox',
- boxLabel: '微信推送',
- id:'userinfo_pushalarm',
- checked:true,
- handler : function() {
- if(!fillvalue){
- var pushalarm = Ext.getCmp('userinfo_pushalarm').getValue();
- Ext.create('Ext.window.Window',{
- id:'detail_userinfo_pushset_win',
- title:'请验证身份',
- width:320,
- height:240,
- modal:true,
- closable:false,
- items:[{
- xtype:'textfield',
- name:'v_loginname',
- fieldLabel:'登录名',
- id:'v_loginname',
- allowBlank:false
- },{
- xtype:'textfield',
- name:'v_password',
- fieldLabel:'密 码',
- id:'v_password',
- inputType:'password',
- allowBlank:false
- }],
- bbar: ['->',{
- xtype:'button',
- text:'提交',
- handler:function(){
- var query = new Object();
- query.V_LOGINNAME = V_LOGINNAME;
- query.V_PASSWORD = V_PASSWORD;
- query.DEVICE_ID = devId;
- query.CMD = 94;
- query.PARAM = pushalarm?1:0;
- var qjson = Ext.JSON.encode(query);
- 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());
- $.ajax({
- type:'POST',
- url: url,
- data: qjson,
- success: function(result){
- var json = eval('(' + result + ')');
- if(json.RESULT=='1')
- {
- Ext.Msg.alert('操作信息','命令已下发');
- }
- }
- });
- this.up("window").close();
- }
- },{
- xtype:'button',
- text:'关闭',
- handler:function(){
- this.up("window").close();
- }
- }],
- closeAction:'destroy',
- listeners:{
- close:function(){
- var query = new Object();
- query.V_LOGINNAME = V_LOGINNAME;
- query.V_PASSWORD = V_PASSWORD;
- query.DEVICE_ID = devId;
- query.CMD = 93;
- query.PARAM = 0;
- var qjson = Ext.JSON.encode(query);
- 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());
- $.ajax({
- type:'POST',
- url: url,
- data: qjson,
- success: function(result){
- var json = eval('(' + result + ')');
- if(json.RESULT=='1'){
- fill_uiwin(json);
- }
- }
- });
- }
- }
- }).show();
- }
- }
- }],
- closeAction:'destroy',
- html:'<div id="detail_background" class="detail_background"><div id="detail_area" class="detail_area" style="height:304px;"></div></div>'
- }).show();
- var query = new Object();
- query.V_LOGINNAME = V_LOGINNAME;
- query.V_PASSWORD = V_PASSWORD;
- query.DEVICE_ID = devId;
- query.CMD = 93;
- query.PARAM = 0;
- var qjson = Ext.JSON.encode(query);
- 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());
- $.ajax({
- type:'POST',
- url: url,
- data: qjson,
- success: function(result){
- var json = eval('(' + result + ')');
- if(json.RESULT=='1'){
- fill_uiwin(json);
- }
- }
- });
- }
- var show_detail_data = function(devId,ponitId,name){
- var device_id = devId;
- var point_code = ponitId;
- Ext.create('Ext.window.Window', {
- id:'detail_data_win',
- title: '<div id="detail_win_title">详细数据</div>',
- height: 400,
- width: 1110,
- layout: 'fit',
- modal:true,
- buttons:[
- {
- text:'导出',
- handler : function exportbtn_click(device_id,point_code) {
- var fields = '';
- var array = ['id','device_id','name','point_code','point_data','company','data_time'];
- var name = ['编号','设备编号','设备名称','端口号','数据值','公司名称','添加时间'];
- for(var i=0;i<7;i++){
- if(i>0)
- fields += ',';
- fields += '{id:"'+array[i]+'",title:"'+name[i]+'",shown:"'+true+'"}';
- }
- var query = new Object();
- query.device_id = devId;
- query.point_code = ponitId;
- query.EXPORT_FILE = '折线图数据监控列表';
- query.fields = '['+fields+']';
- $.ajax({
- type:'POST',
- url: basePath+"iot/excel/view/Exportexl",
- data: {
- queryJson : Ext.JSON.encode(query)
- },
- success: function(result){
- var json = eval('(' + result + ')');
- if(json.action=='dormExport'){
- ConfirmStore = json.RESULT;
- var elemIF = document.createElement("iframe");
- elemIF.src = basePath+json.filename;
- elemIF.style.display = "none";
- document.body.appendChild(elemIF);
- }
- }
- });
- }
- },{
- text:'关闭',
- handler : function() {
- Ext.getCmp('detail_data_win').destroy();
- }
- }
- ],
- closeAction:'destroy',
- html:'<div id="detail_background" class="detail_background"><div id="detail_area" class="detail_area"></div></div>'
- }).show();
- var query = new Object();
- query.V_LOGINNAME = V_LOGINNAME;
- query.V_PASSWORD = V_PASSWORD;
- query.device_id = devId;
- query.point_code = ponitId;
-
- $.ajax({
- type:'POST',
- url: basePath+"iot/data/view/getSyncDataQList",
- data: {
- queryJson : Ext.JSON.encode(query)
- },
- success: function(result){
- var json = eval('(' + result + ')');
- if(json.action=='getSyncDataVList'){
- ConfirmStore = json.RESULT;
- draw_confirm(name);
- }
- }
- });
- }
- var draw_confirm = function(name){
- if((ConfirmStore!=undefined)&&(ConfirmStore.length>0)){
- var themecolor = ((theme=='')||(theme=='access'))?'#ffffff':'#000000';
- if((V_LOGINNAME=='guest')&&(ConfirmStore[0].device_id=='865462043119730')){
- ConfirmStore[0].company='博华广场';
- ConfirmStore[0].name='独立烟感';
- }
- $("#detail_win_title").html(ConfirmStore[0].company+'_'+ConfirmStore[0].name+'_'+name+' 一周数据');
- var data_0 = new Array();
- var d_time = new Array();
- var max = 0, min = 0;;
- for(var i=0;i<ConfirmStore.length;i++){
- var rec = ConfirmStore[i];
- var tmp = parseFloat(rec.point_data);
- var tmp_t = rec.data_time;
- if(i==0){
- max = tmp;
- min = tmp;
- }else{
- if(max<tmp)
- max = tmp;
- if(min>tmp)
- min = tmp;
- }
- data_0.push(tmp);
- d_time.push(tmp_t);
- }
- Highcharts.chart('detail_area',{
- chart:{
- type:'area',
- zoomType: 'xy',
- backgroundColor: 'rgba(0,0,0,0)'
- },
- title:{
- text:ConfirmStore[0].company+'_'+ConfirmStore[0].name+'_'+name+' 一周数据',
- float:true,
- style:{fontSize:'14px',color:themecolor,fontWeight:'bold'},
- enabled:false
- },
- legend:{
- floating:true,
- x:410,
- y:-280,
- itemStyle:{fontSize:'12px',color:themecolor,fontWeight:'bold'}
- },
- exporting: {
- enabled: false
- },
- credits: {
- enabled: false
- },
- xAxis:[{
- categories:d_time,
- labels:{
- enabled:false
- },
- crosshair: true
- }],
- yAxis:[{
- title:{
- text:name,
- style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
- },
- gridLineColor:'rgba(0,0,0,0.2)',
- labels:{
- format:'{value}',
- style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
- },
- max:max+max*0.3,
- min:0
- }],
- tooltip:{
- shared:true
- },
- plotOptions:{
- area:{
- stackiung:'normal',
- marker:{
- lineWidth:0,
- enabled:false,
- radius:0
- }
- }
- },
- series:[{
- name:name,
- type: 'area',
- data:data_0,
- lineWidth:1,
- tooltip:{
- valueSuffix: ' '
- },
- fillColor: {
- linearGradient: {
- x1: 0,
- y1: 0,
- x2: 0,
- y2: 1
- },
- stops: [
- [0, '#34abf5'],
- [1, Highcharts.Color('#34abf5').setOpacity(0.0).get('rgba')]
- ]
- }
- }
- ]
- });
- }
- }
- var show_alarm_pic = function(url){
- var status_list_bar = document.getElementById('status_list_bar');
- status_list_bar.setAttribute('status','');
- status_list_bar.innerHTML='';
- var pic = document.createElement('div');
- pic.style.width = '360px';
- pic.style.height = '270px';
- status_list_bar.appendChild(pic);
- var img = document.createElement('img');
- img.width=360;
- img.height=270;
- img.src = url;
- pic.appendChild(img);
- }
- 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){
- vAlarmInfoWin.show();
- if((dwtype=='YTVA')||(dwtype=='16')){
- vAlarmInfoWin.setWidth(780);
- Ext.getCmp('picPanel').setWidth(360);
- Ext.getCmp('picPanel').setHeight(270);
- var img = document.createElement('img');
- img.width=360;
- img.height=270;
- img.src = data2;
- var alarm_pic = document.getElementById('alarm_pic');
- alarm_pic.innerHTML='';
- alarm_pic.appendChild(img);
- }else{
- vAlarmInfoWin.setWidth(400);
- Ext.getCmp('picPanel').setWidth(0);
- Ext.getCmp('picPanel').setHeight(0);
- }
- $("#VInfoWin_Title").html(data);
- Ext.getCmp('uf_company_name').setValue(company_name);
- Ext.getCmp('uf_name').setValue(name);
- Ext.getCmp('uf_device_code').setValue(device_code);
- Ext.getCmp('uf_fullname').setValue(fullname);
- Ext.getCmp('uf_clr').setValue(clr_name);
- Ext.getCmp('uf_clsj').setValue(clsj);
- Ext.getCmp('uf_clnr').setValue(clnr);
- Ext.getCmp('uf_id').setValue(id);
- Ext.getCmp('uf_clwb').setValue(clwb=='1'?'误报':'告警');
- Ext.getCmp('uf_status').setValue(status);
- Ext.getCmp('uf_dwtype').setValue(dwtype);
- if(clzt=='已处理'){
- vAlarmInfoWin.setHeight(460);
- Ext.getCmp('uf_clwb').setVisible(true);
- Ext.getCmp('uf_r_clwb').setVisible(false);
- Ext.getCmp('uf_r_clfw').setVisible(false);
- Ext.getCmp('confirmBtn').setVisible(false);
- Ext.getCmp('uf_clr').setVisible(true);
- Ext.getCmp('uf_clsj').setVisible(true);
- if(dwtype=='YTVA')
- vAlarmInfoWin.setPosition(
- ($(document).innerWidth()-780)/2,
- ($(document).innerHeight()-460)/2);
- else
- vAlarmInfoWin.setPosition(
- ($(document).innerWidth()-400)/2,
- ($(document).innerHeight()-460)/2);
- }else{
- vAlarmInfoWin.setHeight(400);
- Ext.getCmp('uf_clwb').setVisible(false);
- Ext.getCmp('uf_r_clwb').setVisible(true);
- Ext.getCmp('uf_r_clfw').setVisible(true);
- Ext.getCmp('confirmBtn').setVisible(true);
- Ext.getCmp('uf_clr').setVisible(false);
- Ext.getCmp('uf_clsj').setVisible(false);
- if((dwtype=='YTVA')||(dwtype=='16'))
- vAlarmInfoWin.setPosition(
- ($(document).innerWidth()-780)/2,
- ($(document).innerHeight()-400)/2);
- else
- vAlarmInfoWin.setPosition(
- ($(document).innerWidth()-400)/2,
- ($(document).innerHeight()-400)/2);
- }
- }
- var getCompanyInfo = function(){
- var query = new Object();
- query.V_LOGINNAME = V_LOGINNAME;
- query.V_PASSWORD = V_PASSWORD;
- query.COMPANY_CODE = company_code;
- query.COMMSTATUS = "NO";
- var qdata = 'queryJson='+ Ext.JSON.encode(query);
- myMask.show();
- $.ajax({
- type:'POST',
- url: basePath+"iot/frontpage/getCurrentObjectListByCompanyId",
- data: qdata,
- success: function(result){
- var json = eval('(' + result + ')');
- if(json.action=='getCurrentObjectListByCompanyId'){
- if(json.check==true){
- if(json.LIST!=undefined){
- max_level= json.max_level;
- min_level = json.min_level;
- top_level=json.top_level;
- building_name = json.buinding;
- companyStore = json.COMPANY;
- buildingStore = json.LIST;
- }
- draw_buinding();
- }else{
- Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function(){
- window.parent.document.location=basePath;
- });
- }
- }
- myMask.hide();
- }
- });
- // setTimeout(getCompanyInfo,storeTime);
- }
- Ext.onReady(function(){
- basePath = $("#basePath").val();
- $("#V_LOGINNAME").val(sessionStorage.getItem('V_LOGINNAME'));
- $("#V_PASSWORD").val(sessionStorage.getItem('V_PASSWORD'));
- V_LOGINNAME = $("#V_LOGINNAME").val();
- V_PASSWORD = $("#V_PASSWORD").val();
- company_code = $("#company_code").val();
- theme = $("#theme").val();
- parent.window.keep_menu();
- myMask = new Ext.LoadMask(Ext.getBody(), {
- msg: '查询中,请稍后!',
- cls:'toplevel',
- removeMask: true //完成后移除
- });
- var radiogroup = new Ext.create('Ext.form.RadioGroup',{
- fieldLabel:'误报',
- id:'uf_r_clwb',
- width:300,
- items:[{
- name:'uf_r_clwb',
- inputValue:'1',
- boxLabel:'是'
- },{
- name:'uf_r_clwb',
- inputValue:'0',
- boxLabel:'否',
- checked:true
- }]
- });
- var radiogroup2 = new Ext.create('Ext.form.RadioGroup',{
- fieldLabel:'处理范围',
- id:'uf_r_clfw',
- width:300,
- items:[{
- name:'uf_r_clfw',
- inputValue:'1',
- boxLabel:'批量'
- },{
- name:'uf_r_clfw',
- inputValue:'0',
- boxLabel:'单一',
- checked:true
- }]
- });
- var clear_modify_form = function(){
- Ext.getCmp('uf_company_name').setValue('');
- Ext.getCmp('uf_name').setValue('');
- Ext.getCmp('uf_device_code').setValue('');
- Ext.getCmp('uf_id').setValue('');
- Ext.getCmp('uf_status').setValue('');
- Ext.getCmp('uf_dwtype').setValue('');
- Ext.getCmp('uf_fullname').setValue('');
- Ext.getCmp('uf_clwb').setValue('');
- Ext.getCmp('uf_clr').setValue('');
- Ext.getCmp('uf_clsj').setValue('');
- Ext.getCmp('uf_clnr').setValue('');
- }
- // var picPanel = Ext.create('Ext.panel.Panel',{
- // id:'picPanel',
- // region:'left',
- // width:300,
- // html:'<div id="alarm_pic"></div>'
- // });
- var alarmInfoForm = Ext.create('Ext.form.Panel', {
- id: 'alarmInfoForm',
- // width:400,
- labelWidth: 55,
- url: basePath+'iot/frontpage/updateAlarm',
- region:'center',
- defaultType: 'textfield',
- bodyPadding: 15,
- items: [{
- fieldLabel:'单位名称',
- id: 'uf_company_name',
- name: 'uf_company_name',
- anchor:'90%'
- },{
- fieldLabel:'监控设备',
- id:'uf_name',
- name:'uf_name',
- anchor:'100%'
- },{
- fieldLabel:'设备编号',
- id:'uf_device_code',
- name:'uf_device_code',
- hidden: true
- },{
- fieldLabel:'记录编号',
- id:'uf_id',
- name:'uf_id',
- hidden: true
- },{
- fieldLabel:'设备编号',
- id:'uf_status',
- name:'uf_status',
- hidden: true
- },{
- fieldLabel:'设备类型',
- id:'uf_dwtype',
- name:'uf_dwtype',
- hidden: true
- },{
- fieldLabel:'报告信息',
- id: 'uf_fullname',
- name:'uf_fullname',
- xtype: 'textareafield',
- maxLength: 250,
- cols:4,
- anchor:'100%'
- },{
- fieldLabel:'误报',
- id: 'uf_clwb',
- name:'uf_clwb',
- maxLength: 200,
- anchor:'65%'
- },radiogroup,radiogroup2,{
- fieldLabel:'处理人',
- id: 'uf_clr',
- name:'uf_clr',
- maxLength: 120,
- anchor:'65%'
- },{
- fieldLabel:'处理时间',
- id: 'uf_clsj',
- name:'uf_clsj',
- maxLength: 200,
- anchor:'80%'
- },{
- fieldLabel:'处理内容',
- id: 'uf_clnr',
- name:'uf_clnr',
- xtype: 'textareafield',
- maxLength: 250,
- cols:4,
- anchor:'100%'
- },{
- id:'fm_queryJson',
- name:'queryJson',
- hidden:true
- }],
- buttons: [{
- text: '处理',
- id:'confirmBtn',
- disabled:(V_LOGINNAME=='guest'?true:false),
- iconCls:'ok_btn',
- handler: function() {
- var form = this.up('form').getForm();
- if (form.isValid()) {
- var queryJson = new Object();
- queryJson.V_LOGINNAME = V_LOGINNAME;
- queryJson.V_PASSWORD = V_PASSWORD;
- queryJson.dwtype = Ext.getCmp('uf_dwtype').getValue();;
- queryJson.id = Ext.getCmp('uf_id').getValue();
- queryJson.status = Ext.getCmp('uf_status').getValue();
- queryJson.name = Ext.getCmp('uf_name').getValue();
- queryJson.device_code = Ext.getCmp('uf_device_code').getValue();
- queryJson.confirmAll = Ext.getCmp('uf_r_clfw').getChecked()[0].boxLabel=='单一'?'0':'1';
- queryJson.clwb = Ext.getCmp('uf_r_clwb').getChecked()[0].boxLabel=='否'?'0':'1';
- queryJson.clnr = Ext.getCmp('uf_clnr').getValue();
- var jsonstr = Ext.JSON.encode(queryJson);
- Ext.getCmp('fm_queryJson').setValue(jsonstr);
- form.submit({
- method:'post',
- success: function(form, action) {
- Ext.Msg.alert('操作成功', '已确认'+action.result.activerow+'条记录', function(btn,txt){
- clear_modify_form();
- var div = window.top.$("#history_alarm_list").content;
- div.storeReload2();
- });
- },
- failure: function(form, action) {
- Ext.Msg.alert('操作失败', action.Msg , function(btn,txt){
- clear_modify_form();
- });
- }
- });
- this.up('window').close();
- }
- }
- },{
- text: '关闭',
- iconCls: 'cancel_btn',
- handler: function() {
- this.up('window').close();
- }
- }]
- });
- vAlarmInfoWin = Ext.create('Ext.window.Window',{
- id:'VAlarmInfoWin',
- title:'详细信息: <span id="VInfoWin_Title"></span>',
- height:400,
- width:400,
- layout:'border',
- closable:false,
- modal:true,
- closeAction:'hide',
- items:[{
- id:'picPanel',
- region:'west',
- width:300,
- html:'<div id="alarm_pic"></div>'
- },alarmInfoForm]
- }).hide();
- getCompanyInfo();
- $(window).resize(function(){
- body_resize();
- });
- body_resize();
- });
|