company.js 114 KB

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