company.js 132 KB

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