company.js 130 KB

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