company.js 91 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911
  1. /**
  2. * company.js
  3. */
  4. var basePath;
  5. var company_code;
  6. var V_LOGINNAME;
  7. var V_PASSWORD;
  8. var storeTime = 60000;
  9. var buildingStore = null,
  10. companyStore = null,
  11. devicesStore = null;
  12. var building_name;
  13. var max_level = 0;
  14. var min_level = 0;
  15. var top_level = 0;
  16. var default_check = 65535;
  17. var myMask;
  18. var show_project_info = true;
  19. var start = 0;
  20. var end = 360;
  21. var theme;
  22. var vAlarmInfoWin;
  23. var online_video = false;
  24. var onair_video = false;
  25. var ConfirmStore;
  26. var modifywin;
  27. var had_play = false;
  28. var fillvalue = false;
  29. Ext.Loader.setConfig({
  30. enabled: true
  31. });
  32. Ext.Loader.setPath('Ext.ux', '../../res/extjs/examples/ux');
  33. Ext.require([
  34. 'Ext.grid.*',
  35. 'Ext.data.*',
  36. 'Ext.ux.RowExpander',
  37. 'Ext.selection.CheckboxModel'
  38. ]);
  39. var bak_to_front = function() {
  40. location.href = basePath + 'view/frontpage/map.jsp?company_code=' + company_code;
  41. }
  42. var staSortBypoint = function(a, b) {
  43. return a.point_code - b.point_code;;
  44. }
  45. var body_resize = function() {
  46. $("#company_bg_mm").css('display', 'none');
  47. if ($(document).innerWidth() >= 1820) {
  48. $("#company_bg_tm").css('display', 'block');
  49. $("#company_bg_tm").css('width', ($(document).innerWidth() - 1820) + 'px');
  50. $("#company_bg_bm").css('display', 'block');
  51. $("#company_bg_bm").css('width', ($(document).innerWidth() - 1820) + 'px');
  52. } else {
  53. $("#company_bg_tm").css('display', 'none');
  54. $("#company_bg_bm").css('display', 'none');
  55. }
  56. if ($(document).innerHeight() >= 932) {
  57. $("#company_bg_ml").css('display', 'block');
  58. $("#company_bg_mr").css('display', 'block');
  59. $("#company_bg_ml").css('height', ($(document).innerHeight() - 932) + 'px');
  60. $("#company_bg_mr").css('height', ($(document).innerHeight() - 932) + 'px');
  61. if ($(document).innerWidth() >= 1820) {
  62. $("#company_bg_mm").css('display', 'block');
  63. $("#company_bg_mm").css('height', ($(document).innerHeight() - 932) + 'px');
  64. $("#company_bg_mm").css('width', ($(document).innerWidth() - 1820) + 'px');
  65. }
  66. } else {
  67. $("#company_bg_ml").css('display', 'none');
  68. $("#company_bg_mr").css('display', 'none');
  69. }
  70. $("#company_building").css('height', ($(document).innerHeight() - 328) + 'px');
  71. $("#history_alarm_list").css('width', ($(document).innerWidth() - 975) + 'px');
  72. $("#history_alarm_list").css('height', ($(document).innerHeight() - 616) + 'px');
  73. $("#project_info_bar").css('width', ($(document).innerWidth() - 975) + 'px');
  74. }
  75. var chk_click_big = function(obj) {
  76. location.href = basePath + 'view/3dBig/index.jsp?theme=' + theme + '&company_code=' + ($("#company_code").val());
  77. }
  78. var chk_click = function(obj) {
  79. if ((obj.id == 'dev_all_checkbox') || (obj.id == 'dev_all_checklabel')) {
  80. if (default_check != 65535)
  81. default_check = 65535;
  82. else
  83. default_check = 0;
  84. } else if ((obj.id == 'dev_ui_checkbox') || (obj.id == 'dev_ui_checklabel')) {
  85. if ((default_check & 1) == 1)
  86. default_check = (default_check & 65534);
  87. else
  88. default_check = (default_check | 1);
  89. } else if ((obj.id == 'dev_fc_checkbox') || (obj.id == 'dev_fc_checklabel')) {
  90. if ((default_check & 2) == 2)
  91. default_check = (default_check & 65533);
  92. else
  93. default_check = (default_check | 2);
  94. } else if ((obj.id == 'dev_ef_checkbox') || (obj.id == 'dev_ef_checklabel')) {
  95. if ((default_check & 4) == 4)
  96. default_check = (default_check & 65531);
  97. else
  98. default_check = (default_check | 4);
  99. } else if ((obj.id == 'dev_wp_checkbox') || (obj.id == 'dev_wp_checklabel')) {
  100. if ((default_check & 8) == 8)
  101. default_check = (default_check & 65527);
  102. else
  103. default_check = (default_check | 8);
  104. } else if ((obj.id == 'dev_ll_checkbox') || (obj.id == 'dev_ll_checklabel')) {
  105. if ((default_check & 16) == 16)
  106. default_check = (default_check & 65519);
  107. else
  108. default_check = (default_check | 16);
  109. } else if ((obj.id == 'dev_ci_checkbox') || (obj.id == 'dev_ci_checklabel')) {
  110. if ((default_check & 32) == 32)
  111. default_check = (default_check & 65503);
  112. else
  113. default_check = (default_check | 32);
  114. } else if ((obj.id == 'dev_va_checkbox') || (obj.id == 'dev_va_checklabel')) {
  115. if ((default_check & 64) == 64)
  116. default_check = (default_check & 65471);
  117. else
  118. default_check = (default_check | 64);
  119. } else if ((obj.id == 'dev_ot_checkbox') || (obj.id == 'dev_ot_checklabel')) {
  120. if ((default_check & 128) == 128)
  121. default_check = (default_check & 65407);
  122. else
  123. default_check = (default_check | 128);
  124. } else if ((obj.id == 'dev_sm_checkbox') || (obj.id == 'dev_sm_checklabel')) {
  125. if ((default_check & 256) == 256)
  126. default_check = (default_check & 65279);
  127. else
  128. default_check = (default_check | 256);
  129. }
  130. if (default_check == 0) {
  131. $("#dev_all_checkbox").removeClass('dev_checkbox');
  132. $("#dev_all_checkbox").removeClass('dev_few_checkbox');
  133. $("#dev_all_checkbox").addClass('dev_uncheckbox');
  134. } else if (default_check == 65535) {
  135. $("#dev_all_checkbox").removeClass('dev_uncheckbox');
  136. $("#dev_all_checkbox").removeClass('dev_few_checkbox');
  137. $("#dev_all_checkbox").addClass('dev_checkbox');
  138. } else {
  139. $("#dev_all_checkbox").removeClass('dev_uncheckbox');
  140. $("#dev_all_checkbox").removeClass('dev_checkbox');
  141. $("#dev_all_checkbox").addClass('dev_few_checkbox');
  142. }
  143. if ((default_check & 1) == 1) {
  144. $("#dev_ui_checkbox").removeClass('dev_uncheckbox');
  145. $("#dev_ui_checkbox").addClass('dev_checkbox');
  146. } else {
  147. $("#dev_ui_checkbox").removeClass('dev_checkbox');
  148. $("#dev_ui_checkbox").addClass('dev_uncheckbox');
  149. }
  150. if ((default_check & 2) == 2) {
  151. $("#dev_fc_checkbox").removeClass('dev_uncheckbox');
  152. $("#dev_fc_checkbox").addClass('dev_checkbox');
  153. } else {
  154. $("#dev_fc_checkbox").removeClass('dev_checkbox');
  155. $("#dev_fc_checkbox").addClass('dev_uncheckbox');
  156. }
  157. if ((default_check & 4) == 4) {
  158. $("#dev_ef_checkbox").removeClass('dev_uncheckbox');
  159. $("#dev_ef_checkbox").addClass('dev_checkbox');
  160. } else {
  161. $("#dev_ef_checkbox").removeClass('dev_checkbox');
  162. $("#dev_ef_checkbox").addClass('dev_uncheckbox');
  163. }
  164. if ((default_check & 8) == 8) {
  165. $("#dev_wp_checkbox").removeClass('dev_uncheckbox');
  166. $("#dev_wp_checkbox").addClass('dev_checkbox');
  167. } else {
  168. $("#dev_wp_checkbox").removeClass('dev_checkbox');
  169. $("#dev_wp_checkbox").addClass('dev_uncheckbox');
  170. }
  171. if ((default_check & 16) == 16) {
  172. $("#dev_ll_checkbox").removeClass('dev_uncheckbox');
  173. $("#dev_ll_checkbox").addClass('dev_checkbox');
  174. } else {
  175. $("#dev_ll_checkbox").removeClass('dev_checkbox');
  176. $("#dev_ll_checkbox").addClass('dev_uncheckbox');
  177. }
  178. if ((default_check & 32) == 32) {
  179. $("#dev_ci_checkbox").removeClass('dev_uncheckbox');
  180. $("#dev_ci_checkbox").addClass('dev_checkbox');
  181. } else {
  182. $("#dev_ci_checkbox").removeClass('dev_checkbox');
  183. $("#dev_ci_checkbox").addClass('dev_uncheckbox');
  184. }
  185. if ((default_check & 64) == 64) {
  186. $("#dev_va_checkbox").removeClass('dev_uncheckbox');
  187. $("#dev_va_checkbox").addClass('dev_checkbox');
  188. } else {
  189. $("#dev_va_checkbox").removeClass('dev_checkbox');
  190. $("#dev_va_checkbox").addClass('dev_uncheckbox');
  191. }
  192. if ((default_check & 128) == 128) {
  193. $("#dev_ot_checkbox").removeClass('dev_uncheckbox');
  194. $("#dev_ot_checkbox").addClass('dev_checkbox');
  195. } else {
  196. $("#dev_ot_checkbox").removeClass('dev_checkbox');
  197. $("#dev_ot_checkbox").addClass('dev_uncheckbox');
  198. }
  199. if ((default_check & 256) == 256) {
  200. $("#dev_sm_checkbox").removeClass('dev_uncheckbox');
  201. $("#dev_sm_checkbox").addClass('dev_checkbox');
  202. } else {
  203. $("#dev_sm_checkbox").removeClass('dev_checkbox');
  204. $("#dev_sm_checkbox").addClass('dev_uncheckbox');
  205. }
  206. bak_reset();
  207. }
  208. var clear_append_form = function() {
  209. Ext.getCmp('fa_company_code').setValue("");
  210. Ext.getCmp('fa_userfile').setValue("");
  211. Ext.getCmp('FactoryListPageToolbar').moveFirst();
  212. }
  213. var sc = function() {
  214. modifywin();
  215. }
  216. var chk_empty_level = function(level) {
  217. for (var i = 0; i < buildingStore.length; i++) {
  218. if (buildingStore[i].min_level == level) {
  219. if (((default_check & 1) == 1) && (buildingStore[i].dwtype == 'YTUI'))
  220. return false;
  221. else if (((default_check & 2) == 2) && (buildingStore[i].dwtype == 'YTFC'))
  222. return false;
  223. else if (((default_check & 4) == 4) && (buildingStore[i].dwtype == 'YTEF'))
  224. return false;
  225. else if (((default_check & 8) == 8) && (buildingStore[i].dwtype == 'YTWP'))
  226. return false;
  227. else if (((default_check & 16) == 16) && (buildingStore[i].dwtype == 'YTLL'))
  228. return false;
  229. else if (((default_check & 32) == 32) && (buildingStore[i].dwtype == 'YTCI'))
  230. return false;
  231. else if (((default_check & 64) == 64) && (buildingStore[i].dwtype == 'YTVA'))
  232. return false;
  233. else if (((default_check & 128) == 128) && (buildingStore[i].dwtype == 'YTWC'))
  234. return false;
  235. else if (((default_check & 256) == 256) && (buildingStore[i].dwtype == 'YTSM'))
  236. return false;
  237. }
  238. }
  239. return true;
  240. }
  241. var draw_buinding = function() {
  242. var building_icon_height = 0;
  243. $("#building_level_count").html(max_level);
  244. let array = ["10309", "10308", "10307", "10306", "10305", "10304", "10303", "10302", "10301", "10300", "10299", "10298", "10297", "10296", "10295", "10294", "10293", "10292", "10291", "10290", "10289", "10288", "10287", "10286", "10285", "10284", "10283", "10282", "10281", "10280", "10279", "10278", "10277", "10276", "10275", "10274", "10273", "10272", "10271", "10270", "10269", "10268", "10267", "10266", "10265", "10264", "10263", "10262", "10261", "10260", "10259", "10258", "10257", "10256", "10255", "10254", "10253", "10252", "10251", "10250", "10249", "10248", "10246", "10245", "10244", "10243", "10242", "10241", "10240", "10239", "10238", "10237", "10236", "10234"]
  245. // 10244,10243,10242,10238 16层
  246. // if (company_code == '10182') {
  247. if (array.includes(company_code)) {
  248. // $("#dev_big_checklabel").addClass('dev_big_checklabel');
  249. // var dev_big_checklabel = document.getElementById('dev_big_checklabel');
  250. // dev_big_checklabel.innerHTML = '最大化';
  251. $("#company_bg_tl").removeClass('company_bg_tl');
  252. $("#company_bg_tl").addClass('company_bg_YP');
  253. $("#dev_all_checkbox").hide();
  254. $("#dev_all_checklabel").hide();
  255. $("#dev_ui_checkbox").hide();
  256. $("#dev_ui_checklabel").hide();
  257. $("#dev_sm_checkbox").hide();
  258. $("#dev_sm_checklabel").hide();
  259. $("#dev_fc_checkbox").hide();
  260. $("#dev_fc_checklabel").hide();
  261. $("#dev_ef_checkbox").hide();
  262. $("#dev_ef_checklabel").hide();
  263. $("#dev_wp_checkbox").hide();
  264. $("#dev_wp_checklabel").hide();
  265. $("#dev_ll_checkbox").hide();
  266. $("#dev_ll_checklabel").hide();
  267. $("#dev_ci_checkbox").hide();
  268. $("#dev_ci_checklabel").hide();
  269. $("#dev_va_checkbox").hide();
  270. $("#dev_va_checklabel").hide();
  271. $("#dev_ot_checkbox").hide();
  272. $("#dev_ot_checklabel").hide();
  273. $("#company_building").removeClass('company_building');
  274. $("#company_building").addClass('company_building_on');
  275. var company_building = document.getElementById('company_building');
  276. company_building.innerHTML = '<iframe id="myIframe" name="thingjs" src="https://www.thingjs.com/s/b11227d4fd5505106989737c?params=105b0f77fd24654d4eebc434e9" style="width:146%;height:123%;border:1px solid #0082ff;"></iframe>';
  277. var t1 = window.setTimeout(function() {
  278. // console.log(buildingStore);
  279. // debugger;
  280. callFuncInThingJS("userListener", buildingStore, top_level,company_code);
  281. window.clearTimeout(t1);
  282. }, 10000)
  283. } else {
  284. var company_building = document.getElementById('company_building');
  285. company_building.innerHTML = '';
  286. var currett_build = document.createElement('div');
  287. company_building.appendChild(currett_build)
  288. var building_top = document.createElement('div');
  289. building_top.setAttribute('class', 'building_top');
  290. building_top.style.top = '0px';
  291. currett_build.appendChild(building_top);
  292. building_icon_height += 120;
  293. var top_info = document.createElement('div');
  294. top_info.id = "building_top_info";
  295. top_info.setAttribute('class', 'building_top_label');
  296. top_info.innerHTML = 'RF';
  297. building_top.appendChild(top_info);
  298. var top_icon = document.createElement('div');
  299. top_icon.setAttribute('class', 'building_top_icon');
  300. building_top.appendChild(top_icon);
  301. if (max_level > 0) {
  302. var last_empty = max_level + 2;
  303. var first_empty = max_level + 2;
  304. for (var i = max_level; i > 0; i--) {
  305. if (chk_empty_level(i)) {
  306. if (last_empty != (i + 1)) {
  307. first_empty = i;
  308. last_empty = i;
  309. var build_level = document.createElement('div');
  310. build_level.setAttribute('class', 'building_level');
  311. build_level.style.top = (building_icon_height - 60) + 'px';
  312. currett_build.appendChild(build_level);
  313. building_icon_height += 48;
  314. var level_info = document.createElement('div');
  315. level_info.id = "building_empty_level_info_" + i;
  316. level_info.setAttribute('class', 'building_level_info')
  317. level_info.innerHTML = i + 'F';
  318. build_level.appendChild(level_info);
  319. var level_icon = document.createElement('div');
  320. level_icon.setAttribute('class', 'building_empty_level_icon');
  321. build_level.appendChild(level_icon);
  322. } else {
  323. var level_info = document.getElementById('building_empty_level_info_' + first_empty);
  324. if (level_info != undefined)
  325. level_info.innerHTML = i + 'F~' + first_empty + 'F';
  326. last_empty = i;
  327. }
  328. } else {
  329. var build_level = document.createElement('div');
  330. build_level.setAttribute('class', 'building_level');
  331. build_level.style.top = (building_icon_height - 60) + 'px';
  332. currett_build.appendChild(build_level);
  333. building_icon_height += 48;
  334. var level_info = document.createElement('div');
  335. level_info.id = "building_level_info_" + i;
  336. level_info.setAttribute('class', 'building_level_info')
  337. level_info.innerHTML = i + 'F';
  338. build_level.appendChild(level_info);
  339. var level_icon = document.createElement('div');
  340. level_icon.setAttribute('class', 'building_level_icon');
  341. build_level.appendChild(level_icon);
  342. }
  343. }
  344. }
  345. if (min_level < 0) {
  346. for (var i = -1; i >= min_level; i--) {
  347. var base_level = document.createElement('div');
  348. base_level.setAttribute('class', 'building_base');
  349. base_level.style.top = (building_icon_height - 60) + 'px';
  350. currett_build.appendChild(base_level);
  351. building_icon_height += 48;
  352. var base_info = document.createElement('div');
  353. base_info.id = 'building_base_info_' + (0 - i);
  354. base_info.setAttribute('class', 'building_base_info');
  355. base_info.innerHTML = 'B' + (0 - i) + 'F';
  356. base_level.appendChild(base_info);
  357. var base_icon = document.createElement('div');
  358. base_icon.setAttribute('class', 'building_base_icon');
  359. base_level.appendChild(base_icon);
  360. }
  361. }
  362. $("#company_building").css('height', ($(document).innerHeight() - 402) + 'px');
  363. building_icon_height += 60;
  364. currett_build.style.marginLeft = '59px';
  365. currett_build.style.marginRight = '59px';
  366. currett_build.style.width = '536px';
  367. if ((buildingStore != null) && (buildingStore.length > 0)) {
  368. for (var i = 0; i < buildingStore.length; i++) {
  369. var iconid = buildingStore[i].dwtype + '_' + buildingStore[i].min_level;
  370. var icon = document.getElementById(iconid);
  371. if (icon == undefined) {
  372. icon = document.createElement('div');
  373. icon.id = buildingStore[i].dwtype + '_' + buildingStore[i].min_level;
  374. icon.dwtype = buildingStore[i].dwtype;
  375. icon.level = buildingStore[i].min_level;
  376. icon.owner_code = buildingStore[i].owner_code;
  377. icon.style.position = 'absolute';
  378. icon.style.width = '62px';
  379. icon.style.height = '62px';
  380. icon.style.cursor = 'pointer';
  381. icon.setAttribute('onclick', 'icon_click(this)');
  382. currett_build.appendChild(icon);
  383. var this_min_level = buildingStore[i].min_level;
  384. var level_label = document.getElementById("building_level_info_" + this_min_level);
  385. if (this_min_level == top_level) {
  386. level_label = document.getElementById('building_top_info');
  387. } else if (this_min_level < 0) {
  388. level_label = document.getElementById('building_base_info_' + (0 - this_min_level));
  389. }
  390. if (level_label != null) {
  391. if (buildingStore[i].dwtype == 'YTUI') {
  392. if ((default_check & 1) == 1) {
  393. icon.title = '用户传输装置';
  394. icon.style.top = (level_label.offsetParent.offsetTop + 1) + 'px'
  395. icon.style.left = (level_label.offsetParent.offsetLeft + 28) + 'px';
  396. icon.style.backgroundImage = 'url(../../res/img/icons/ui_icon.png)';
  397. }
  398. } else if (buildingStore[i].dwtype == 'YTFC') {
  399. if ((default_check & 2) == 2) {
  400. icon.title = '消防控制柜';
  401. icon.style.top = (level_label.offsetParent.offsetTop + 15) + 'px'
  402. icon.style.left = (level_label.offsetParent.offsetLeft + 68) + 'px';
  403. icon.style.backgroundImage = 'url(../../res/img/icons/fc_icon.png)';
  404. }
  405. } else if (buildingStore[i].dwtype == 'YTEF') {
  406. if ((default_check & 4) == 4) {
  407. icon.title = '电气火灾';
  408. icon.style.top = (level_label.offsetParent.offsetTop + 29) + 'px'
  409. icon.style.left = (level_label.offsetParent.offsetLeft + 108) + 'px';
  410. icon.style.backgroundImage = 'url(../../res/img/icons/ef_icon.png)';
  411. }
  412. } else if (buildingStore[i].dwtype == 'YTWP') {
  413. if ((default_check & 8) == 8) {
  414. icon.title = '水压';
  415. icon.style.top = (level_label.offsetParent.offsetTop + 43) + 'px'
  416. icon.style.left = (level_label.offsetParent.offsetLeft + 148) + 'px';
  417. icon.style.backgroundImage = 'url(../../res/img/icons/wp0_icon.png)';
  418. }
  419. } else if (buildingStore[i].dwtype == 'YTLL') {
  420. if ((default_check & 16) == 16) {
  421. icon.title = '液位';
  422. icon.style.top = (level_label.offsetParent.offsetTop + 48) + 'px'
  423. icon.style.left = (level_label.offsetParent.offsetLeft + 188) + 'px';
  424. icon.style.backgroundImage = 'url(../../res/img/icons/ll_icon.png)';
  425. }
  426. } else if (buildingStore[i].dwtype == 'YTCI') {
  427. if ((default_check & 32) == 32) {
  428. icon.title = '环境监测';
  429. icon.style.top = (level_label.offsetParent.offsetTop + 43) + 'px'
  430. icon.style.left = (level_label.offsetParent.offsetLeft + 228) + 'px';
  431. icon.style.backgroundImage = 'url(../../res/img/icons/ci_icon.png)';
  432. }
  433. } else if (buildingStore[i].dwtype == 'YTVA') {
  434. if ((default_check & 64) == 64) {
  435. icon.title = '视频监控';
  436. icon.style.top = (level_label.offsetParent.offsetTop + 29) + 'px'
  437. icon.style.left = (level_label.offsetParent.offsetLeft + 268) + 'px';
  438. icon.style.backgroundImage = 'url(../../res/img/icons/va_icon.png)';
  439. }
  440. } else if (buildingStore[i].dwtype == 'YTWC') {
  441. if ((default_check & 128) == 128) {
  442. icon.title = '风机控制柜';
  443. icon.style.top = (level_label.offsetParent.offsetTop + 15) + 'px'
  444. icon.style.left = (level_label.offsetParent.offsetLeft + 308) + 'px';
  445. icon.style.backgroundImage = 'url(../../res/img/icons/wc_icon.png)';
  446. }
  447. } else if (buildingStore[i].dwtype == 'YTSM') {
  448. if ((default_check & 256) == 256) {
  449. icon.title = '烟感';
  450. icon.style.top = (level_label.offsetParent.offsetTop + 1) + 'px';
  451. icon.style.left = (level_label.offsetParent.offsetLeft + 348) + 'px';
  452. icon.style.backgroundImage = 'url(../../res/img/icons/sm_icon.png)';
  453. }
  454. }
  455. }
  456. } else
  457. icon.owner_code = "";
  458. }
  459. }
  460. }
  461. if (show_project_info) {
  462. var project_info_bar = document.getElementById('project_info_bar');
  463. project_info_bar.innerHTML = '';
  464. var project_label = document.createElement('div');
  465. project_label.setAttribute('class', 'project_label');
  466. project_label.style.position = 'absolute';
  467. project_label.style.top = '30px';
  468. project_label.style.left = '50px';
  469. project_label.innerHTML = '项目名称';
  470. project_info_bar.appendChild(project_label);
  471. var project_info = document.createElement('div');
  472. // ;
  473. project_info.setAttribute('class', 'project_info');
  474. project_info.style.position = 'absolute';
  475. project_info.style.top = '60px';
  476. project_info.style.left = '50px';
  477. project_info.innerHTML = companyStore.company_name;
  478. project_info_bar.appendChild(project_info);
  479. project_label = document.createElement('div');
  480. project_label.setAttribute('class', 'project_label');
  481. project_label.style.position = 'absolute';
  482. project_label.style.top = '110px';
  483. project_label.style.left = '50px';
  484. project_label.innerHTML = '项目地址';
  485. project_info_bar.appendChild(project_label);
  486. project_info = document.createElement('div');;
  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. project_info.setAttribute('class', 'project_info');
  502. project_info.style.position = 'absolute';
  503. project_info.style.top = '220px';
  504. project_info.style.left = '50px';
  505. project_info.innerHTML = companyStore.lng + ',' + companyStore.lat;
  506. project_info_bar.appendChild(project_info);
  507. project_label = document.createElement('div');
  508. project_label.setAttribute('class', 'project_label');
  509. project_label.style.position = 'absolute';
  510. project_label.style.top = '30px';
  511. project_label.style.left = '480px';
  512. project_label.innerHTML = '联系人';
  513. project_info_bar.appendChild(project_label);
  514. project_info = document.createElement('div');;
  515. project_info.setAttribute('class', 'project_info');
  516. project_info.style.position = 'absolute';
  517. project_info.style.top = '60px';
  518. project_info.style.left = '480px';
  519. project_info.innerHTML = companyStore.username;
  520. project_info_bar.appendChild(project_info);
  521. project_label = document.createElement('div');
  522. project_label.setAttribute('class', 'project_label');
  523. project_label.style.position = 'absolute';
  524. project_label.style.top = '110px';
  525. project_label.style.left = '480px';
  526. project_label.innerHTML = '联系电话';
  527. project_info_bar.appendChild(project_label);
  528. project_info = document.createElement('div');;
  529. project_info.setAttribute('class', 'project_info');
  530. project_info.style.position = 'absolute';
  531. project_info.style.top = '140px';
  532. project_info.style.left = '480px';
  533. project_info.innerHTML = companyStore.phone;
  534. project_info_bar.appendChild(project_info);
  535. var history_alarm_list = document.getElementById('history_alarm_list');
  536. history_alarm_list.innerHTML = '';
  537. var table = document.createElement('table');
  538. table.width = '100%';
  539. history_alarm_list.appendChild(table);
  540. var tr = document.createElement('tr');
  541. table.appendChild(tr);
  542. var dwtypelist = [1, 7, 2, 6, 16, 17];
  543. for (var i = 0; i < 6; i++) {
  544. var td = document.createElement('td');
  545. td.setAttribute('colspan', '2');
  546. td.setAttribute('style', 'width:128px;');
  547. td.setAttribute('class', 'data_bar_title');
  548. td.style.textAlign = 'center';
  549. td.style.paddingTop = '15px';
  550. td.setAttribute('onclick', 'show_alarm_list("' + company_code + '","' + dwtypelist[i] + '")');
  551. if (i == 0)
  552. td.innerHTML = '火灾监控';
  553. else if (i == 1)
  554. td.innerHTML = '电气火灾监控';
  555. else if (i == 2)
  556. td.innerHTML = '水系统监控';
  557. else if (i == 3)
  558. td.innerHTML = 'RTU监控';
  559. else if (i == 4)
  560. td.innerHTML = '视频告警监控'
  561. else
  562. td.innerHTML = '电梯告警监控'
  563. tr.appendChild(td);
  564. }
  565. tr = document.createElement('tr');
  566. table.appendChild(tr);
  567. for (var i = 0; i < 6; i++) {
  568. var td = document.createElement('td');
  569. td.setAttribute('class', 'data_bar_total_label');
  570. td.style.textAlign = 'right';
  571. td.width = '10%';
  572. td.innerHTML = '设备总数';
  573. td.setAttribute('onclick', 'show_alarm_list("' + company_code + '","' + dwtypelist[i] + '")');
  574. tr.appendChild(td);
  575. td = document.createElement('td');
  576. td.setAttribute('class', 'data_bar_total_number');
  577. td.style.textAlign = 'left';
  578. td.style.paddingLeft = '10px';
  579. td.setAttribute('onclick', 'show_alarm_list("' + company_code + '","' + dwtypelist[i] + '")');
  580. if (i == 0)
  581. td.innerHTML = companyStore.d1;
  582. else if (i == 1)
  583. td.innerHTML = companyStore.d7;
  584. else if (i == 2)
  585. td.innerHTML = companyStore.d2;
  586. else if (i == 3)
  587. td.innerHTML = companyStore.d6;
  588. else if (i == 4)
  589. td.innerHTML = companyStore.d16;
  590. else
  591. //td.innerHTML=companyStore.d17;
  592. td.innerHTML = 0;
  593. tr.appendChild(td);
  594. }
  595. tr = document.createElement('tr');
  596. table.appendChild(tr);
  597. for (var i = 0; i < 6; i++) {
  598. var td = document.createElement('td');
  599. td.setAttribute('class', 'data_bar_total_label');
  600. td.style.textAlign = 'right';
  601. td.width = '10%';
  602. td.innerHTML = '已处理';
  603. td.setAttribute('onclick', 'show_alarm_list("' + company_code + '","' + dwtypelist[i] + '")');
  604. tr.appendChild(td);
  605. td = document.createElement('td');
  606. td.setAttribute('class', 'device_confirm_num1');
  607. td.style.textAlign = 'left';
  608. td.style.paddingLeft = '10px';
  609. td.setAttribute('onclick', 'show_alarm_list("' + company_code + '","' + dwtypelist[i] + '")');
  610. if (i == 0)
  611. td.innerHTML = companyStore.d1ac;
  612. else if (i == 1)
  613. td.innerHTML = companyStore.d7ac;
  614. else if (i == 2)
  615. td.innerHTML = companyStore.d2ac;
  616. else if (i == 3)
  617. td.innerHTML = companyStore.d6ac;
  618. else if (i == 4)
  619. td.innerHTML = companyStore.d16ac;
  620. else
  621. //td.innerHTML=companyStore.d17ac;
  622. td.innerHTML = 0;
  623. tr.appendChild(td);
  624. }
  625. tr = document.createElement('tr');
  626. table.appendChild(tr);
  627. for (var i = 0; i < 6; i++) {
  628. var td = document.createElement('td');
  629. td.setAttribute('class', 'data_bar_total_label');
  630. td.style.textAlign = 'right';
  631. td.width = '10%';
  632. td.innerHTML = '待处理';
  633. td.setAttribute('onclick', 'show_alarm_list("' + company_code + '","' + dwtypelist[i] + '")');
  634. tr.appendChild(td);
  635. td = document.createElement('td');
  636. td.setAttribute('class', 'device_confirm_num2');
  637. td.style.textAlign = 'left';
  638. td.style.paddingLeft = '10px';
  639. td.setAttribute('onclick', 'show_alarm_list("' + company_code + '","' + dwtypelist[i] + '")');
  640. if (i == 0)
  641. td.innerHTML = companyStore.d1a - companyStore.d1ac;
  642. else if (i == 1)
  643. td.innerHTML = companyStore.d7a - companyStore.d7ac;
  644. else if (i == 2)
  645. td.innerHTML = companyStore.d2a - companyStore.d2ac;
  646. else if (i == 3)
  647. td.innerHTML = companyStore.d6a - companyStore.d6ac;
  648. else if (i == 4)
  649. td.innerHTML = companyStore.d16a - companyStore.d16ac;
  650. else
  651. //td.innerHTML=companyStore.d17a-companyStore.d17ac;
  652. td.innerHTML = 0;
  653. tr.appendChild(td);
  654. }
  655. tr = document.createElement('tr');
  656. table.appendChild(tr);
  657. for (var i = 0; i < 6; i++) {
  658. var td = document.createElement('td');
  659. td.setAttribute('colspan', '2');
  660. tr.appendChild(td);
  661. var div = document.createElement('div');
  662. div.id = 'alarm_pie_' + i;
  663. div.style.margin = '10px auto 10px auto';
  664. div.style.width = '110px';
  665. td.setAttribute('onclick', 'show_alarm_list("' + company_code + '","' + dwtypelist[i] + '")');
  666. td.appendChild(div);
  667. }
  668. draw_pie('alarm_pie_0', companyStore.d1a, companyStore.d1ac);
  669. draw_pie('alarm_pie_1', companyStore.d7a, companyStore.d7ac);
  670. draw_pie('alarm_pie_2', companyStore.d2a, companyStore.d2ac);
  671. draw_pie('alarm_pie_3', companyStore.d6a, companyStore.d6ac);
  672. draw_pie('alarm_pie_4', companyStore.d16a, companyStore.d16ac);
  673. //draw_pie('alarm_pie_5',companyStore.d17a,companyStore.d17ac);
  674. draw_pie('alarm_pie_5', 0);
  675. } else {
  676. var project_info_bar = document.getElementById('project_info_bar');
  677. project_info_bar.innerHTML = '';
  678. var history_alarm_list = document.getElementById('history_alarm_list');
  679. history_alarm_list.innerHTML = '';
  680. }
  681. }
  682. function callFuncInThingJS(funcName, data, top_level,company_code) {
  683. var iframe = $('#myIframe')[0];
  684. var msg = { data, top_level,company_code }
  685. var message = {
  686. 'funcName': funcName,
  687. 'param': msg
  688. }
  689. iframe.contentWindow.postMessage(message, '*');
  690. }
  691. function myaleart() {
  692. alert("wwwwwwwwwwwwwwwwwww");
  693. }
  694. window.addEventListener('message', function(e) {
  695. var data = e.data;
  696. var funcName = data.funcName;
  697. var param = data.param;
  698. if (window[funcName]) window[funcName](param);
  699. });
  700. var show_alarm_list = function(company_code, dwtype) {
  701. $("#company_detail_title").removeClass('device_status_title_icon');
  702. $("#company_detail_title").addClass('history_alarm_title_icon');
  703. $("#bak_reset2").removeClass('hiden');
  704. $("#bak_reset2").addClass('shown');
  705. var history_alarm_list = document.getElementById('history_alarm_list');
  706. 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>';
  707. // alert(company_code+','+dwtype);
  708. }
  709. var bak_reset = function() {
  710. $("#company_detail_title").removeClass('history_alarm_title_icon');
  711. $("#company_detail_title").addClass('device_status_title_icon');
  712. $("#company_page_title").removeClass('realtime_title_icon');
  713. $("#company_page_title").addClass('project_title_icon');
  714. $("#bak_reset").removeClass('shown');
  715. $("#bak_reset").addClass('hiden');
  716. $("#bak_reset2").removeClass('shown');
  717. $("#bak_reset2").addClass('hiden');
  718. // $("#history_alarm_list").css('overflow-y','auto');
  719. var v_reset = document.getElementById('v_reset');
  720. if (v_reset != undefined) {
  721. document.body.removeChild(v_reset);
  722. }
  723. var big_view = document.getElementById('big_view');
  724. if (big_view != undefined) {
  725. document.body.removeChild(big_view);
  726. }
  727. show_project_info = true;
  728. draw_buinding();
  729. }
  730. var dev_click = function(obj) {
  731. var dwtype = obj.dwtype;
  732. var level = obj.level;
  733. var id = obj.owner_code;
  734. var idx = obj.idx;
  735. show_project_info = false;
  736. // var history_alarm_list = document.getElementById('history_alarm_list');
  737. // 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>';
  738. show_realtime_status(idx);
  739. if (dwtype == 'YTVA') {
  740. onair_video = false;
  741. chk_cideo();
  742. }
  743. }
  744. var icon_click = function(obj) {
  745. debugger;
  746. var dwtype = obj.dwtype;
  747. var level = obj.level;
  748. var id = obj.owner_code;
  749. show_project_info = false;
  750. // $("#company_detail_title").removeClass('device_status_title_icon');
  751. // $("#company_detail_title").addClass('history_alarm_title_icon');
  752. $("#company_page_title").removeClass('project_title_icon');
  753. $("#company_page_title").addClass('realtime_title_icon');
  754. $("#bak_reset").removeClass('hiden');
  755. $("#bak_reset").addClass('shown');
  756. var project_info_bar = document.getElementById('project_info_bar');
  757. project_info_bar.innerHTML = '';
  758. var query = new Object();
  759. query.dwtype = dwtype;
  760. query.level = level;
  761. query.V_LOGINNAME = V_LOGINNAME;
  762. query.COMPANY_CODE = company_code;
  763. $.ajax({
  764. type: 'POST',
  765. url: basePath + "iot/frontpage/getCurrentStatus",
  766. data: {
  767. queryJson: Ext.JSON.encode(query)
  768. },
  769. success: function(result) {
  770. var json = eval('(' + result + ')');
  771. if (json.action == 'getCurrentStatus') {
  772. if (json.check == true) {
  773. if (json.devices != undefined) {
  774. devicesStore = json.devices;
  775. drawCurrentStatus();
  776. }
  777. } else {
  778. Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function() {
  779. window.parent.document.location = basePath;
  780. });
  781. }
  782. }
  783. myMask.hide();
  784. }
  785. });
  786. // var history_alarm_list = document.getElementById('history_alarm_list');
  787. // history_alarm_list.style.overflowY='hidden';
  788. // 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>';
  789. if (dwtype == 'YTVA') {
  790. onair_video = false;
  791. chk_cideo();
  792. }
  793. }
  794. var draw_pie = function(id, total, num) {
  795. var mColor = '#34abf5';
  796. var percent = 100;
  797. if (total > 0)
  798. percent = Number(((num * 100) / total).toString().match(/^\d+(?:\.\d{0,2})?/));
  799. if (percent < 60)
  800. mColor = '#f66167';
  801. else if (percent < 80)
  802. mColor = '#DDDF0D';
  803. Highcharts.getOptions().colors = Highcharts.map(['#f66167', '#34abf5', '#DDDF0D', '#ff2e95', '#39b54a', '#ffb163', '#c233ac', '#9dffad', '#c77051'], function(color) {
  804. return {
  805. radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
  806. stops: [
  807. [0, color],
  808. [1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
  809. ]
  810. };
  811. });
  812. Highcharts.chart(id, {
  813. chart: {
  814. type: 'pie',
  815. backgroundColor: 'rgba(0,0,0,0)',
  816. height: '100%',
  817. options3d: {
  818. enabled: true,
  819. alpha: 45,
  820. beta: 0
  821. }
  822. },
  823. title: {
  824. text: '处置率:' + percent + '%',
  825. floating: true,
  826. y: 95,
  827. style: { fontSize: '12px', color: '#ffffff' }
  828. },
  829. exporting: {
  830. enabled: false
  831. },
  832. credits: {
  833. enabled: false
  834. },
  835. tooltip: {
  836. // enabled: false
  837. pointFormat: '{point.percentage:.2f}%'
  838. },
  839. plotOptions: {
  840. pie: {
  841. allowPointSelect: true,
  842. cursor: 'pointer',
  843. depth: 15,
  844. dataLabels: {
  845. enabled: false,
  846. format: '{point.name}'
  847. }
  848. }
  849. },
  850. series: [{
  851. type: 'pie',
  852. name: '处置率',
  853. startAngle: 90,
  854. data: [{
  855. name: '待处理',
  856. y: 100 - percent,
  857. sliced: true,
  858. selected: true
  859. },
  860. ['已处理', percent]
  861. ]
  862. }]
  863. });
  864. }
  865. var drawCurrentStatus = function() {
  866. if ((devicesStore != null) && (devicesStore.length > 0)) {
  867. if (onair_video) {
  868. onair_video = false;
  869. chk_cideo();
  870. }
  871. var project_info_bar = document.getElementById('project_info_bar');
  872. var device_icon = document.createElement('img');
  873. if (devicesStore[0].dwtype == 'YTUI') {
  874. device_icon.setAttribute('class', 'device_large_icon');
  875. device_icon.src = basePath + 'res/img/icons/ui_large_icon.gif';
  876. } else if (devicesStore[0].dwtype == 'YTFC') {
  877. device_icon.setAttribute('class', 'device_large_icon');
  878. device_icon.src = basePath + 'res/img/icons/fc_large_icon.gif';
  879. } else if (devicesStore[0].dwtype == 'YTCI') {
  880. device_icon.setAttribute('class', 'device_large_icon');
  881. device_icon.src = basePath + 'res/img/icons/ci_large_icon.gif';
  882. } else if (devicesStore[0].dwtype == 'YTWP') {
  883. device_icon.setAttribute('class', 'device_large_icon');
  884. device_icon.src = basePath + 'res/img/icons/wp1_large_icon.gif';
  885. } else if (devicesStore[0].dwtype == 'YTLL') {
  886. device_icon.setAttribute('class', 'device_large_icon');
  887. device_icon.src = basePath + 'res/img/icons/ll_large_icon.gif';
  888. } else if (devicesStore[0].dwtype == 'YTVA') {
  889. device_icon.setAttribute('class', 'device_large_icon');
  890. device_icon.src = basePath + 'res/img/icons/va_large_icon.gif';
  891. } else if (devicesStore[0].dwtype == 'YTEF') {
  892. device_icon.setAttribute('class', 'device_large_icon');
  893. device_icon.src = basePath + 'res/img/icons/ef_large_icon.gif';
  894. } else if (devicesStore[0].dwtype == 'YTWC') {
  895. device_icon.setAttribute('class', 'device_large_icon');
  896. device_icon.src = basePath + 'res/img/icons/wc_large_icon.gif';
  897. } else if (devicesStore[0].dwtype == 'YTSM') {
  898. device_icon.setAttribute('class', 'device_large_icon');
  899. device_icon.src = basePath + 'res/img/icons/sm_large_icon.gif';
  900. }
  901. // var device_icon = document.createElement('div');
  902. // if(devicesStore[0].dwtype=='YTUI'){
  903. // device_icon.setAttribute('class','device_large_icon ui_large_icon');
  904. // }else if(devicesStore[0].dwtype=='YTFC'){
  905. // device_icon.setAttribute('class','device_large_icon fc_large_icon');
  906. // }else if(devicesStore[0].dwtype=='YTCI'){
  907. // device_icon.setAttribute('class','device_large_icon ci_large_icon');
  908. // }else if(devicesStore[0].dwtype=='YTWP'){
  909. // device_icon.setAttribute('class','device_large_icon wp1_large_icon');
  910. // }else if(devicesStore[0].dwtype=='YTLL'){
  911. // device_icon.setAttribute('class','device_large_icon ll_large_icon');
  912. // }else if(devicesStore[0].dwtype=='YTVA'){
  913. // device_icon.setAttribute('class','device_large_icon va_large_icon');
  914. // }else if(devicesStore[0].dwtype=='YTEF'){
  915. // device_icon.setAttribute('class','device_large_icon ef_large_icon');
  916. // }
  917. project_info_bar.appendChild(device_icon);
  918. var device_count_label = document.createElement('div');
  919. device_count_label.id = 'device_count_label';
  920. device_count_label.setAttribute('class', 'device_count_label');
  921. project_info_bar.appendChild(device_count_label);
  922. var device_list_bar = document.createElement('div');
  923. device_list_bar.setAttribute('class', 'device_list_bar');
  924. project_info_bar.appendChild(device_list_bar);
  925. var status_list_bar = document.createElement('div');
  926. status_list_bar.id = 'status_list_bar';
  927. status_list_bar.setAttribute('status', '');
  928. status_list_bar.setAttribute('class', 'status_list_bar');
  929. status_list_bar.style.width = ($(document).innerWidth() - 1528) + 'px';
  930. project_info_bar.appendChild(status_list_bar);
  931. for (var i = 0; i < devicesStore.length; i++) {
  932. var dev = document.createElement('div');
  933. dev.owner_code = devicesStore[i].owner_code;
  934. dev.id = "device_list_bar_sub_" + i;
  935. dev.dwtype = devicesStore[i].dwtype;
  936. dev.level = devicesStore[i].level;
  937. dev.style.margin = '10px';
  938. dev.style.padding = '10px';
  939. dev.style.width = '300px';
  940. dev.style.cursor = 'pointer';
  941. dev.idx = i;
  942. dev.setAttribute('onclick', 'dev_click(this)');
  943. device_list_bar.appendChild(dev);
  944. $("#device_list_bar_sub_" + i).mouseover(function() {
  945. $(this).css('background', 'rgba(64,85,98,0.7)');
  946. });
  947. $("#device_list_bar_sub_" + i).mouseout(function() {
  948. $(this).css('background', 'rgba(0,0,0,0)');
  949. });
  950. var dev_name_label = document.createElement('div');
  951. dev_name_label.setAttribute('class', 'project_label');
  952. dev_name_label.style.marginTop = '6px';
  953. dev_name_label.innerHTML = '设备名称';
  954. dev.appendChild(dev_name_label);
  955. var dev_name_info = document.createElement('div');
  956. dev_name_info.setAttribute('class', 'project_info');
  957. dev_name_info.style.marginTop = '12px';
  958. dev_name_info.innerHTML = devicesStore[i].device_name;
  959. dev.appendChild(dev_name_info);
  960. var dev_code_label = document.createElement('div');
  961. dev_code_label.setAttribute('class', 'project_label');
  962. dev_code_label.style.marginTop = '14px';
  963. dev_code_label.innerHTML = '设备编号';
  964. dev.appendChild(dev_code_label);
  965. var dev_code_info = document.createElement('div');
  966. dev_code_info.setAttribute('class', 'project_info');
  967. dev_code_info.style.marginTop = '12px';
  968. dev_code_info.innerHTML = devicesStore[i].owner_code;
  969. dev.appendChild(dev_code_info);
  970. var dev_OBJ_label = document.createElement('div');
  971. dev_OBJ_label.setAttribute('class', 'project_label');
  972. dev_OBJ_label.style.marginTop = '14px';
  973. dev_OBJ_label.innerHTML = '监测对象';
  974. dev.appendChild(dev_OBJ_label);
  975. var dev_OBJ_info = document.createElement('div');
  976. dev_OBJ_info.setAttribute('class', 'project_info');
  977. dev_OBJ_info.style.marginTop = '12px';
  978. dev_OBJ_info.innerHTML = devicesStore[i].object_name;
  979. dev.appendChild(dev_OBJ_info);
  980. var dev_time_label = document.createElement('div');
  981. dev_time_label.setAttribute('class', 'project_label');
  982. dev_time_label.style.marginTop = '14px';
  983. dev_time_label.innerHTML = '数据更新时间';
  984. dev.appendChild(dev_time_label);
  985. var dev_time_info = document.createElement('div');
  986. dev_time_info.setAttribute('class', 'project_info');
  987. dev_time_info.style.marginTop = '12px';
  988. dev_time_info.style.marginBottom = '12px';
  989. dev_time_info.innerHTML = (devicesStore[i].status_time == '1970-01-01 08:00:00') ? '-' : devicesStore[i].status_time;
  990. dev.appendChild(dev_time_info);
  991. }
  992. }
  993. show_realtime_status(0);
  994. }
  995. var big_view_win = function(obj) {
  996. Ext.create('Ext.window.Window', {
  997. id: 'big_view_win',
  998. title: '监控视频',
  999. height: 680,
  1000. width: 800,
  1001. layout: 'fit',
  1002. modal: true,
  1003. maximizable: true,
  1004. buttons: [{
  1005. text: '关闭',
  1006. handler: function() {
  1007. Ext.getCmp('big_view_win').destroy();
  1008. }
  1009. }],
  1010. closeAction: 'destroy',
  1011. html: '<iframe width="99%" height="99%" frameborder=0 allowtransparency="true" scrolling=auto src="' + basePath + 'view/frontpage/video.jsp?videoId=' + obj.owner_code + '"></iframe>'
  1012. }).show();
  1013. }
  1014. var reset_video = function(obj) {
  1015. var query = {
  1016. CMD: 3,
  1017. BODY: {
  1018. DEVICE: obj.owner_code,
  1019. ACTION: 0,
  1020. IDX: 0
  1021. }
  1022. }
  1023. var status_list_bar = document.getElementById('status_list_bar');
  1024. status_list_bar.setAttribute('status', 'connecting');
  1025. status_list_bar.innerHTML = '<div style="margin-top:120px;">连接中,请稍候...</div>';
  1026. $.ajax({
  1027. type: 'POST',
  1028. url: 'https://fire.usky.cn:8443/YtIoT/cgi-bin/demo2.cgi',
  1029. data: 'queryJson:' + JSON.stringify(query),
  1030. success: function(result) {}
  1031. });
  1032. onair_video = false;
  1033. setTimeout(chk_cideo, 5000);
  1034. }
  1035. var open_video = function(obj) {
  1036. var query = {
  1037. CMD: 3,
  1038. BODY: {
  1039. DEVICE: obj.getAttribute('owner_code'),
  1040. ACTION: 1,
  1041. IDX: 7
  1042. }
  1043. }
  1044. var status_list_bar = document.getElementById('status_list_bar');
  1045. status_list_bar.setAttribute('status', 'connecting');
  1046. status_list_bar.innerHTML = '<div style="margin-top:120px;">连接中,请稍候...</div>';
  1047. $.ajax({
  1048. type: 'POST',
  1049. url: 'https://fire.usky.cn:8443/YtIoT/cgi-bin/demo2.cgi',
  1050. data: 'queryJson:' + JSON.stringify(query),
  1051. success: function(result) {}
  1052. });
  1053. onair_video = false;
  1054. // setTimeout(chk_cideo,5000);
  1055. }
  1056. var chk_cideo = function() {
  1057. if (onair_video)
  1058. return;
  1059. var query = {
  1060. CMD: 1
  1061. }
  1062. $.ajax({
  1063. type: 'POST',
  1064. url: 'https://fire.usky.cn:8443/YtIoT/cgi-bin/demo2.cgi',
  1065. data: 'queryJson:' + JSON.stringify(query),
  1066. success: function(result) {
  1067. var json = eval('(' + result + ')');
  1068. var v_reset = document.getElementById('v_reset');
  1069. if (v_reset != undefined) {
  1070. var found = false;
  1071. if (json.RESULT.LIST != undefined) {
  1072. if (json.RESULT.LIST.length > 0) {
  1073. for (var i = 0; i < json.RESULT.LIST.length; i++) {
  1074. if (json.RESULT.LIST[i].DEVICE == v_reset.owner_code) {
  1075. found = true;
  1076. online_video = json.RESULT.LIST[i].LIVEONLINE;
  1077. if ((json.RESULT.LIST[i].ONAIR) && (!onair_video)) {
  1078. $("#v_reset").css('display', 'block');
  1079. $("#big_view").css('display', 'block');
  1080. onair_video = true;
  1081. var status_list_bar = document.getElementById('status_list_bar');
  1082. status_list_bar.setAttribute('status', '');
  1083. 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>';
  1084. } else if (!json.RESULT.LIST[i].ONAIR) {
  1085. if (json.RESULT.LIST[i].ALIVEVALUE == 3) {
  1086. onair_video = false;
  1087. var status_list_bar = document.getElementById('status_list_bar');
  1088. if (status_list_bar.getAttribute('status') == '')
  1089. status_list_bar.innerHTML = '<div style="margin-top:120px;cursor:pointer;" owner_code="' + json.RESULT.LIST[i].DEVICE + '" onclick="open_video(this)">设备在线,点击加载视频</div>';
  1090. } else if (json.RESULT.LIST[i].ALIVEVALUE == 2) {
  1091. onair_video = false;
  1092. var status_list_bar = document.getElementById('status_list_bar');
  1093. status_list_bar.setAttribute('status', '');
  1094. status_list_bar.innerHTML = '<div style="margin-top:120px;">设备重连中,请稍候...</div>';
  1095. } else {
  1096. onair_video = false;
  1097. var status_list_bar = document.getElementById('status_list_bar');
  1098. status_list_bar.setAttribute('status', '');
  1099. status_list_bar.innerHTML = '<div style="margin-top:120px;">设备未连线,尝试连接。请稍候...</div>';
  1100. }
  1101. }
  1102. }
  1103. }
  1104. }
  1105. }
  1106. }
  1107. }
  1108. });
  1109. setTimeout(chk_cideo, 5000);
  1110. }
  1111. var show_realtime_status = function(idx) {
  1112. $("#device_count_label").html('');
  1113. if ((devicesStore != null) && (devicesStore.length > idx)) {
  1114. $("#device_count_label").html('[ ' + devicesStore.length + '-' + (idx + 1) + ' ]');
  1115. var status_list_bar = document.getElementById('status_list_bar');
  1116. status_list_bar.setAttribute('status', '');
  1117. status_list_bar.innerHTML = '';
  1118. var title = document.createElement('div');
  1119. title.id = 'device_list_status_title';
  1120. title.style.textAlign = 'center';
  1121. title.style.fontSize = '16px';
  1122. title.style.fontWeight = 'bold';
  1123. title.innerHTML = devicesStore[idx].device_name;
  1124. status_list_bar.appendChild(title);
  1125. var sta = document.createElement('table');
  1126. sta.style.marginTop = '10px';
  1127. sta.width = '100%';
  1128. sta.idx = i;
  1129. status_list_bar.appendChild(sta);
  1130. var v_reset = document.getElementById('v_reset');
  1131. if (v_reset != undefined) {
  1132. document.body.removeChild(v_reset);
  1133. }
  1134. var big_view = document.getElementById('big_view');
  1135. if (big_view != undefined) {
  1136. document.body.removeChild(big_view);
  1137. }
  1138. $("#status_list_bar").removeClass('status_list_bar_video');
  1139. if (devicesStore[idx].dwtype == 'YTVA') {
  1140. online_video = false;
  1141. if (onair_video) {
  1142. onair_video = false;
  1143. chk_cideo();
  1144. }
  1145. v_reset = document.createElement('div');
  1146. v_reset.id = 'v_reset';
  1147. v_reset.owner_code = devicesStore[idx].owner_code;
  1148. v_reset.setAttribute('class', 'v_reset');
  1149. v_reset.setAttribute('onclick', 'reset_video(this)');
  1150. v_reset.title = '视频重载';
  1151. document.body.appendChild(v_reset);
  1152. $("#v_reset").css('display', 'none');
  1153. big_view = document.createElement('div');
  1154. big_view.id = 'big_view';
  1155. big_view.owner_code = devicesStore[idx].owner_code;
  1156. big_view.setAttribute('class', 'big_view');
  1157. big_view.setAttribute('onclick', 'big_view_win(this)');
  1158. big_view.title = '视频放大';
  1159. document.body.appendChild(big_view);
  1160. $("#big_view").css('display', 'none');
  1161. $("#status_list_bar").addClass('status_list_bar_video');
  1162. $("#status_list_bar").html('<div style="margin-top:120px;">连接中,请稍候...</div>');
  1163. } else if (devicesStore[idx].dwtype == 'YTFC') {
  1164. var tr = document.createElement('tr');
  1165. sta.appendChild(tr);
  1166. var td = document.createElement('td');
  1167. td.width = '30%';
  1168. td.setAttribute('class', 'point_label project_label');
  1169. td.style.paddingTop = '14px';
  1170. td.id = 'PowerAlarmLabel';
  1171. td.innerHTML = '电源故障状态';
  1172. tr.appendChild(td);
  1173. td = document.createElement('td');
  1174. td.id = 'PowerAlarm';
  1175. td.width = '20%';
  1176. td.setAttribute('class', 'project_info');
  1177. td.style.paddingTop = '12px';
  1178. tr.appendChild(td);
  1179. var td = document.createElement('td');
  1180. td.setAttribute('class', 'point_label project_label');
  1181. td.style.paddingTop = '14px';
  1182. td.width = '30%';
  1183. td.id = 'ManualActLabel';
  1184. td.innerHTML = '手自动状态';
  1185. tr.appendChild(td);
  1186. td = document.createElement('td');
  1187. td.width = '20%';
  1188. td.id = 'ManualAct';
  1189. td.setAttribute('class', 'project_info');
  1190. td.style.paddingTop = '12px';
  1191. tr.appendChild(td);
  1192. tr = document.createElement('tr');
  1193. sta.appendChild(tr);
  1194. var td = document.createElement('td');
  1195. td.setAttribute('class', 'point_label project_label');
  1196. td.style.paddingTop = '14px';
  1197. td.id = 'DevWorking01Label';
  1198. td.innerHTML = '1#设备运行状态';
  1199. tr.appendChild(td);
  1200. td = document.createElement('td');
  1201. td.id = 'DevWorking01';
  1202. td.setAttribute('class', 'project_info');
  1203. td.style.paddingTop = '12px';
  1204. tr.appendChild(td);
  1205. var td = document.createElement('td');
  1206. td.setAttribute('class', 'point_label project_label');
  1207. td.style.paddingTop = '14px';
  1208. td.id = 'DevWorking02Label';
  1209. td.innerHTML = '2#设备运行状态';
  1210. tr.appendChild(td);
  1211. td = document.createElement('td');
  1212. td.id = 'DevWorking02';
  1213. td.setAttribute('class', 'project_info');
  1214. td.style.paddingTop = '12px';
  1215. tr.appendChild(td);
  1216. tr = document.createElement('tr');
  1217. sta.appendChild(tr);
  1218. var td = document.createElement('td');
  1219. td.setAttribute('class', 'point_label project_label');
  1220. td.style.paddingTop = '14px';
  1221. td.id = 'DevAlarm01Label';
  1222. td.innerHTML = '1#设备故障状态';
  1223. tr.appendChild(td);
  1224. td = document.createElement('td');
  1225. td.id = 'DevAlarm01';
  1226. td.setAttribute('class', 'project_info');
  1227. td.style.paddingTop = '12px';
  1228. tr.appendChild(td);
  1229. var td = document.createElement('td');
  1230. td.setAttribute('class', 'point_label project_label');
  1231. td.style.paddingTop = '14px';
  1232. td.id = 'DevAlarm02Label';
  1233. td.innerHTML = '2#设备故障状态';
  1234. tr.appendChild(td);
  1235. td = document.createElement('td');
  1236. td.id = 'DevAlarm02';
  1237. td.setAttribute('class', 'project_info');
  1238. td.style.paddingTop = '12px';
  1239. tr.appendChild(td);
  1240. tr = document.createElement('tr');
  1241. sta.appendChild(tr);
  1242. var td = document.createElement('td');
  1243. td.setAttribute('class', 'point_label project_label');
  1244. td.style.paddingTop = '14px';
  1245. td.id = 'FireAutoActLabel';
  1246. td.innerHTML = '消防联动状态';
  1247. tr.appendChild(td);
  1248. td = document.createElement('td');
  1249. td.id = 'FireAutoAct';
  1250. td.setAttribute('class', 'project_info');
  1251. td.style.paddingTop = '12px';
  1252. tr.appendChild(td);
  1253. var status_list = devicesStore[idx].status_list;
  1254. status_list.sort(staSortBypoint);
  1255. for (var i = 0; i < status_list.length; i++) {
  1256. var words = status_list[i].content.split(" ");
  1257. if (words.length > 0) {
  1258. if (status_list[i].point_code == 1) {
  1259. $("#PowerAlarmLabel").html(status_list[i].point_name);
  1260. $("#PowerAlarm").html(words[0]);
  1261. } else if (status_list[i].point_code == 2) {
  1262. $("#ManualActLabel").html(status_list[i].point_name);
  1263. $("#ManualAct").html(words[0]);
  1264. } else if (status_list[i].point_code == 3) {
  1265. $("#DevWorking01Label").html(status_list[i].point_name);
  1266. $("#DevWorking01").html(words[0]);
  1267. } else if (status_list[i].point_code == 4) {
  1268. $("#DevWorking02Label").html(status_list[i].point_name);
  1269. $("#DevWorking02").html(words[0]);
  1270. } else if (status_list[i].point_code == 5) {
  1271. $("#DevAlarm01Label").html(status_list[i].point_name);
  1272. $("#DevAlarm01").html(words[0]);
  1273. } else if (status_list[i].point_code == 6) {
  1274. $("#DevAlarm02Label").html(status_list[i].point_name);
  1275. $("#DevAlarm02").html(words[0]);
  1276. } else if (status_list[i].point_code == 7) {
  1277. $("#FireAutoActLabel").html(status_list[i].point_name);
  1278. $("#FireAutoAct").html(words[0]);
  1279. }
  1280. }
  1281. }
  1282. } else if (devicesStore[idx].dwtype == 'YTWC') {
  1283. var status_list = devicesStore[idx].status_list;
  1284. status_list.sort(staSortBypoint);
  1285. for (var i = 0; i < status_list.length; i++) {
  1286. var tr = document.createElement('tr');
  1287. sta.appendChild(tr);
  1288. var td = document.createElement('td');
  1289. td.width = '30%';
  1290. td.setAttribute('class', 'point_label project_label');
  1291. td.style.paddingTop = '14px';
  1292. td.innerHTML = status_list[i].point_name;
  1293. tr.appendChild(td);
  1294. td = document.createElement('td');
  1295. td.innerHTML = (status_list[i].content).substring(0, 2);
  1296. td.width = '20%';
  1297. td.setAttribute('class', 'project_info');
  1298. td.style.paddingTop = '12px';
  1299. tr.appendChild(td);
  1300. }
  1301. } else if (devicesStore[idx].dwtype == 'YTEF') {
  1302. var tr = document.createElement('tr');
  1303. sta.appendChild(tr);
  1304. var td = document.createElement('td');
  1305. td.setAttribute('class', 'project_label');
  1306. td.innerHTML = '供电过压状态';
  1307. tr.appendChild(td);
  1308. td = document.createElement('td');
  1309. td.setAttribute('class', 'project_label');
  1310. td.innerHTML = '供电低压状态';
  1311. tr.appendChild(td);
  1312. td = document.createElement('td');
  1313. td.setAttribute('class', 'project_label');
  1314. td.innerHTML = '供电过流状态';
  1315. tr.appendChild(td);
  1316. tr = document.createElement('tr');
  1317. sta.appendChild(tr);
  1318. td = document.createElement('td');
  1319. td.id = 'HighVoltageAlarm'
  1320. td.setAttribute('class', 'project_info');
  1321. tr.appendChild(td);
  1322. td = document.createElement('td');
  1323. td.id = 'LowVoltageAlarm'
  1324. td.setAttribute('class', 'project_info');
  1325. tr.appendChild(td);
  1326. td = document.createElement('td');
  1327. td.id = 'HighCurrentAlarm'
  1328. td.setAttribute('class', 'project_info');
  1329. tr.appendChild(td);
  1330. tr = document.createElement('tr');
  1331. sta.appendChild(tr);
  1332. td = document.createElement('td');
  1333. td.setAttribute('class', 'project_label');
  1334. td.innerHTML = '漏电报警状态';
  1335. tr.appendChild(td);
  1336. tr = document.createElement('tr');
  1337. sta.appendChild(tr);
  1338. td = document.createElement('td');
  1339. td.id = 'ElectricityLeakage'
  1340. td.setAttribute('class', 'project_info');
  1341. tr.appendChild(td);
  1342. tr = document.createElement('tr');
  1343. sta.appendChild(tr);
  1344. td = document.createElement('td');
  1345. td.setAttribute('class', 'project_label');
  1346. td.innerHTML = 'A相线缆高温状态';
  1347. tr.appendChild(td);
  1348. td = document.createElement('td');
  1349. td.setAttribute('class', 'project_label');
  1350. td.innerHTML = 'B相线缆高温状态';
  1351. tr.appendChild(td);
  1352. td = document.createElement('td');
  1353. td.setAttribute('class', 'project_label');
  1354. td.innerHTML = 'C相线缆高温状态';
  1355. tr.appendChild(td);
  1356. tr = document.createElement('tr');
  1357. sta.appendChild(tr);
  1358. td = document.createElement('td');
  1359. td.setAttribute('class', 'project_info');
  1360. td.id = 'HighTemperatureA';
  1361. tr.appendChild(td);
  1362. td = document.createElement('td');
  1363. td.setAttribute('class', 'project_info');
  1364. td.id = 'HighTemperatureB';
  1365. tr.appendChild(td);
  1366. td = document.createElement('td');
  1367. td.setAttribute('class', 'project_info');
  1368. td.id = 'HighTemperatureC';
  1369. tr.appendChild(td);
  1370. tr = document.createElement('tr');
  1371. sta.appendChild(tr);
  1372. td = document.createElement('td');
  1373. td.setAttribute('class', 'project_label');
  1374. td.innerHTML = 'A相电压';
  1375. tr.appendChild(td);
  1376. td = document.createElement('td');
  1377. td.setAttribute('class', 'project_label');
  1378. td.innerHTML = 'B相电压';
  1379. tr.appendChild(td);
  1380. td = document.createElement('td');
  1381. td.setAttribute('class', 'project_label');
  1382. td.innerHTML = 'C相电压';
  1383. tr.appendChild(td);
  1384. tr = document.createElement('tr');
  1385. sta.appendChild(tr);
  1386. td = document.createElement('td');
  1387. td.setAttribute('class', 'project_info');
  1388. td.id = 'VoltageA';
  1389. tr.appendChild(td);
  1390. td = document.createElement('td');
  1391. td.setAttribute('class', 'project_info');
  1392. td.id = 'VoltageB';
  1393. tr.appendChild(td);
  1394. td = document.createElement('td');
  1395. td.setAttribute('class', 'project_info');
  1396. td.id = 'VoltageC';
  1397. tr.appendChild(td);
  1398. tr = document.createElement('tr');
  1399. sta.appendChild(tr);
  1400. td = document.createElement('td');
  1401. td.setAttribute('class', 'project_label');
  1402. td.innerHTML = 'A相电流';
  1403. tr.appendChild(td);
  1404. td = document.createElement('td');
  1405. td.setAttribute('class', 'project_label');
  1406. td.innerHTML = 'B相电流';
  1407. tr.appendChild(td);
  1408. td = document.createElement('td');
  1409. td.setAttribute('class', 'project_label');
  1410. td.innerHTML = 'C相电流';
  1411. tr.appendChild(td);
  1412. tr = document.createElement('tr');
  1413. sta.appendChild(tr);
  1414. td = document.createElement('td');
  1415. td.setAttribute('class', 'project_info');
  1416. td.id = 'CurrentA';
  1417. tr.appendChild(td);
  1418. td = document.createElement('td');
  1419. td.setAttribute('class', 'project_info');
  1420. td.id = 'CurrentB';
  1421. tr.appendChild(td);
  1422. td = document.createElement('td');
  1423. td.setAttribute('class', 'project_info');
  1424. td.id = 'CurrentC';
  1425. tr.appendChild(td);
  1426. tr = document.createElement('tr');
  1427. sta.appendChild(tr);
  1428. td = document.createElement('td');
  1429. td.setAttribute('class', 'project_label');
  1430. td.innerHTML = 'A相温度';
  1431. tr.appendChild(td);
  1432. td = document.createElement('td');
  1433. td.setAttribute('class', 'project_label');
  1434. td.innerHTML = 'B相温度';
  1435. tr.appendChild(td);
  1436. td = document.createElement('td');
  1437. td.setAttribute('class', 'project_label');
  1438. td.innerHTML = 'C相温度';
  1439. tr.appendChild(td);
  1440. tr = document.createElement('tr');
  1441. sta.appendChild(tr);
  1442. td = document.createElement('td');
  1443. td.setAttribute('class', 'project_info');
  1444. td.id = 'TemperatureA';
  1445. tr.appendChild(td);
  1446. td = document.createElement('td');
  1447. td.setAttribute('class', 'project_info');
  1448. td.id = 'TemperatureB';
  1449. tr.appendChild(td);
  1450. td = document.createElement('td');
  1451. td.setAttribute('class', 'project_info');
  1452. td.id = 'TemperatureC';
  1453. tr.appendChild(td);
  1454. var status_list = devicesStore[idx].status_list;
  1455. status_list.sort(staSortBypoint);
  1456. for (var i = 0; i < status_list.length; i++) {
  1457. if (status_list[i].point_code == 1) {
  1458. $("#HighVoltageAlarm").html((status_list[i].point_data == '0') ? '正常' : '告警');
  1459. } else if (status_list[i].point_code == 2) {
  1460. $("#LowVoltageAlarm").html((status_list[i].point_data == '0') ? '正常' : '告警');
  1461. } else if (status_list[i].point_code == 3) {
  1462. $("#HighCurrentAlarm").html((status_list[i].point_data == '0') ? '正常' : '告警');
  1463. } else if (status_list[i].point_code == 4) {
  1464. $("#ElectricityLeakage").html((status_list[i].point_data == '0') ? '正常' : '告警');
  1465. } else if (status_list[i].point_code == 5) {
  1466. $("#HighTemperatureA").html((status_list[i].point_data == '0') ? '正常' : '告警');
  1467. } else if (status_list[i].point_code == 6) {
  1468. $("#HighTemperatureB").html((status_list[i].point_data == '0') ? '正常' : '告警');
  1469. } else if (status_list[i].point_code == 7) {
  1470. $("#HighTemperatureC").html((status_list[i].point_data == '0') ? '正常' : '告警');
  1471. } else if (status_list[i].point_code == 65) {
  1472. if (status_list[i].point_data.length > 0)
  1473. $("#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 + '\')"/>');
  1474. } else if (status_list[i].point_code == 66) {
  1475. if (status_list[i].point_data.length > 0)
  1476. $("#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 + '\')"/>');
  1477. } else if (status_list[i].point_code == 67) {
  1478. if (status_list[i].point_data.length > 0)
  1479. $("#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 + '\')"/>');
  1480. } else if (status_list[i].point_code == 68) {
  1481. if (status_list[i].point_data.length > 0)
  1482. $("#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 + '\')"/>');
  1483. } else if (status_list[i].point_code == 69) {
  1484. if (status_list[i].point_data.length > 0)
  1485. $("#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 + '\')"/>');
  1486. } else if (status_list[i].point_code == 70) {
  1487. if (status_list[i].point_data.length > 0)
  1488. $("#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 + '\')"/>');
  1489. } else if (status_list[i].point_code == 71) {
  1490. if (status_list[i].point_data.length > 0)
  1491. $("#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 + '\')"/>');
  1492. } else if (status_list[i].point_code == 72) {
  1493. if (status_list[i].point_data.length > 0)
  1494. $("#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 + '\')"/>');
  1495. } else if (status_list[i].point_code == 73) {
  1496. if (status_list[i].point_data.length > 0)
  1497. $("#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 + '\')"/>');
  1498. }
  1499. }
  1500. } else if (devicesStore[idx].dwtype == 'YTSM') {
  1501. var status_list = devicesStore[idx].status_list;
  1502. status_list.sort(staSortBypoint);
  1503. for (var i = 0; i < status_list.length; i++) {
  1504. if (((status_list[i].point_code > 0) && (status_list[i].point_code < 5) && (status_list[i].point_name != '') && (status_list[i].point_code != 3)) ||
  1505. ((status_list[i].point_code == 3) && (status_list[i].point_data != 0))) {
  1506. var tr = document.createElement('tr');
  1507. sta.appendChild(tr);
  1508. var sta_name = document.createElement('td');
  1509. sta_name.width = "40%";
  1510. sta_name.setAttribute('class', 'point_label project_label');
  1511. sta_name.style.paddingTop = '14px';
  1512. sta_name.innerHTML = status_list[i].point_name;
  1513. tr.appendChild(sta_name);
  1514. var sta_value = document.createElement('td');
  1515. sta_value.setAttribute('class', 'project_info');
  1516. sta_value.style.paddingTop = '12px';
  1517. if (status_list[i].point_code == 1)
  1518. sta_value.innerHTML = status_list[i].content;
  1519. else
  1520. 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 + '\')"/>';
  1521. tr.appendChild(sta_value);
  1522. }
  1523. }
  1524. } else {
  1525. var status_list = devicesStore[idx].status_list;
  1526. status_list.sort(staSortBypoint);
  1527. for (var i = 0; i < status_list.length; i++) {
  1528. if (status_list[i].point_code > 0) {
  1529. var tr = document.createElement('tr');
  1530. sta.appendChild(tr);
  1531. var sta_name = document.createElement('td');
  1532. sta_name.width = "40%";
  1533. sta_name.setAttribute('class', 'point_label project_label');
  1534. sta_name.style.paddingTop = '14px';
  1535. sta_name.innerHTML = status_list[i].point_name;
  1536. tr.appendChild(sta_name);
  1537. var sta_value = document.createElement('td');
  1538. sta_value.setAttribute('class', 'project_info');
  1539. sta_value.style.paddingTop = '12px';
  1540. // sta_value.style.paddingBottom='12px';
  1541. if (devicesStore[idx].dwtype == 'YTUI') {
  1542. if (V_LOGINNAME == 'admin')
  1543. 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 + ')"/>';
  1544. else
  1545. sta_value.innerHTML = status_list[i].content;
  1546. } else if ((devicesStore[idx].dwtype == 'YTWP') || (devicesStore[idx].dwtype == 'YTLL')) {
  1547. if (status_list[i].point_name.indexOf('状态') >= 0) {
  1548. if ((status_list[i].point_data == 0) || (status_list[i].point_data == '00'))
  1549. sta_value.innerHTML = '正常';
  1550. else
  1551. sta_value.innerHTML = '--';
  1552. } else if (status_list[i].point_data.length > 0)
  1553. 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 + '\')"/>';
  1554. } else if (status_list[i].point_data.length > 0)
  1555. 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 + '\')"/>';
  1556. tr.appendChild(sta_value);
  1557. }
  1558. }
  1559. }
  1560. }
  1561. }
  1562. var fill_uiwin = function(json) {
  1563. fillvalue = true;
  1564. Ext.getCmp('userinfo_pushalarm').setValue(json.PUSH_WX == 1);
  1565. Ext.getCmp('userinfo_pushtts').setValue(json.PUSH_TTS == 1);
  1566. fillvalue = false;
  1567. var data = new Array();
  1568. for (var i = 0; i < json.LIST.length; i++) {
  1569. var obj = new Array();
  1570. if (json.LIST[i].id == 1)
  1571. obj.push('故障');
  1572. else if (json.LIST[i].id == 2)
  1573. obj.push('告警');
  1574. else if (json.LIST[i].id == 3)
  1575. obj.push('反馈');
  1576. else if (json.LIST[i].id == 4)
  1577. obj.push('监管');
  1578. else if (json.LIST[i].id == 5)
  1579. obj.push('启动');
  1580. else if (json.LIST[i].id == 6)
  1581. obj.push('自检');
  1582. else if (json.LIST[i].id == 7)
  1583. obj.push('屏蔽');
  1584. else if (json.LIST[i].id == 8)
  1585. obj.push('复位');
  1586. else if (json.LIST[i].id == 9)
  1587. obj.push('消音');
  1588. obj.push(json.LIST[i].count);
  1589. data.push(obj);
  1590. }
  1591. var themecolor = ((theme == '') || (theme == 'access')) ? '#ffffff' : '#000000';
  1592. Highcharts.chart('detail_area', {
  1593. chart: {
  1594. type: 'column',
  1595. backgroundColor: 'rgba(0,0,0,0)'
  1596. },
  1597. title: {
  1598. text: '用户传输装置报告类型统计',
  1599. style: { fontSize: '14px', color: themecolor, fontWeight: 'bold' },
  1600. },
  1601. xAxis: {
  1602. type: 'category',
  1603. labels: {
  1604. style: { fontSize: '12px', color: themecolor, fontWeight: 'bold' }
  1605. }
  1606. },
  1607. yAxis: {
  1608. title: {
  1609. text: '报告计次',
  1610. style: { fontSize: '14px', color: themecolor, fontWeight: 'bold' }
  1611. },
  1612. labels: {
  1613. style: { fontSize: '12px', color: themecolor, fontWeight: 'bold' }
  1614. }
  1615. },
  1616. legend: {
  1617. enabled: false
  1618. },
  1619. exporting: {
  1620. enabled: false
  1621. },
  1622. credits: {
  1623. enabled: false
  1624. },
  1625. series: [{
  1626. name: '报告计次',
  1627. data: data,
  1628. dataLabels: {
  1629. enabled: true,
  1630. rotation: -90,
  1631. align: 'right',
  1632. format: '{point.y}',
  1633. style: { fontSize: '14px', color: themecolor, fontWeight: 'bold' },
  1634. y: 10
  1635. },
  1636. colorByPoint: true
  1637. }]
  1638. });
  1639. }
  1640. var show_userinfo_detail = function(devId) {
  1641. var device_id = devId;
  1642. Ext.create('Ext.window.Window', {
  1643. id: 'detail_userinfo_win',
  1644. title: '<div id="detail_userinfo_title">用户传输装置信息</div>',
  1645. bodyStyle: 'background-color:rgba(0,0,0,0.0);',
  1646. height: 400,
  1647. width: 1110,
  1648. modal: true,
  1649. layout: {
  1650. type: 'table',
  1651. columns: 6,
  1652. tableAttrs: {
  1653. style: {
  1654. width: '100%'
  1655. }
  1656. }
  1657. },
  1658. buttons: [{
  1659. text: '查岗',
  1660. handler: function() {
  1661. var query = new Object();
  1662. query.V_LOGINNAME = V_LOGINNAME;
  1663. query.V_PASSWORD = V_PASSWORD;
  1664. query.DEVICE_ID = devId;
  1665. query.CMD = 91;
  1666. query.LIMIT = 10;
  1667. var qjson = Ext.JSON.encode(query);
  1668. var url = ((company_code == "10012") ? "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction2.cgi?t=" : "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
  1669. $.ajax({
  1670. type: 'POST',
  1671. url: url,
  1672. data: qjson,
  1673. success: function(result) {
  1674. var json = eval('(' + result + ')');
  1675. if (json.RESULT == '1') {
  1676. Ext.Msg.alert('操作信息', '命令已下发');
  1677. }
  1678. }
  1679. });
  1680. }
  1681. }, {
  1682. text: '清空',
  1683. handler: function() {
  1684. var query = new Object();
  1685. query.V_LOGINNAME = V_LOGINNAME;
  1686. query.V_PASSWORD = V_PASSWORD;
  1687. query.DEVICE_ID = devId;
  1688. query.CMD = 92;
  1689. query.LIMIT = 0;
  1690. var qjson = Ext.JSON.encode(query);
  1691. var url = ((company_code == "10012") ? "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction2.cgi?t=" : "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
  1692. $.ajax({
  1693. type: 'POST',
  1694. url: url,
  1695. data: qjson,
  1696. success: function(result) {
  1697. var json = eval('(' + result + ')');
  1698. if (json.RESULT == '1') {
  1699. Ext.Msg.alert('操作信息', '命令已下发');
  1700. fill_uiwin(json);
  1701. }
  1702. }
  1703. });
  1704. }
  1705. }, {
  1706. text: '查询',
  1707. handler: function() {
  1708. var query = new Object();
  1709. query.V_LOGINNAME = V_LOGINNAME;
  1710. query.V_PASSWORD = V_PASSWORD;
  1711. query.DEVICE_ID = devId;
  1712. query.CMD = 93;
  1713. query.PARAM = 0;
  1714. var qjson = Ext.JSON.encode(query);
  1715. var url = ((company_code == "10012") ? "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction2.cgi?t=" : "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
  1716. $.ajax({
  1717. type: 'POST',
  1718. url: url,
  1719. data: qjson,
  1720. success: function(result) {
  1721. var json = eval('(' + result + ')');
  1722. if (json.RESULT == '1') {
  1723. fill_uiwin(json);
  1724. }
  1725. }
  1726. });
  1727. }
  1728. }, {
  1729. text: '关闭',
  1730. handler: function() {
  1731. Ext.getCmp('detail_userinfo_win').destroy();
  1732. }
  1733. }],
  1734. tbar: ['->', {
  1735. xtype: 'checkbox',
  1736. boxLabel: '语音推送',
  1737. id: 'userinfo_pushtts',
  1738. checked: true,
  1739. hidden: true,
  1740. handler: function() {
  1741. if (!fillvalue) {
  1742. var pushtts = Ext.getCmp('userinfo_pushtts').getValue();
  1743. Ext.create('Ext.window.Window', {
  1744. id: 'detail_userinfo_pushset_win',
  1745. title: '请验证身份',
  1746. width: 320,
  1747. height: 240,
  1748. modal: true,
  1749. closable: false,
  1750. items: [{
  1751. xtype: 'textfield',
  1752. name: 'v_loginname',
  1753. fieldLabel: '登录名',
  1754. id: 'v_loginname',
  1755. allowBlank: false
  1756. }, {
  1757. xtype: 'textfield',
  1758. name: 'v_password',
  1759. fieldLabel: '密 码',
  1760. id: 'v_password',
  1761. inputType: 'password',
  1762. allowBlank: false
  1763. }],
  1764. bbar: ['->', {
  1765. xtype: 'button',
  1766. text: '提交',
  1767. handler: function() {
  1768. var query = new Object();
  1769. query.V_LOGINNAME = V_LOGINNAME;
  1770. query.V_PASSWORD = V_PASSWORD;
  1771. query.DEVICE_ID = devId;
  1772. query.CMD = 95;
  1773. query.PARAM = pushtts ? 1 : 0;
  1774. var qjson = Ext.JSON.encode(query);
  1775. var url = ((company_code == "10012") ? "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction2.cgi?t=" : "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
  1776. $.ajax({
  1777. type: 'POST',
  1778. url: url,
  1779. data: qjson,
  1780. success: function(result) {
  1781. var json = eval('(' + result + ')');
  1782. if (json.RESULT == '1') {
  1783. Ext.Msg.alert('操作信息', '命令已下发');
  1784. }
  1785. }
  1786. });
  1787. this.up("window").close();
  1788. }
  1789. }, {
  1790. xtype: 'button',
  1791. text: '关闭',
  1792. handler: function() {
  1793. this.up("window").close();
  1794. }
  1795. }],
  1796. closeAction: 'destroy',
  1797. listeners: {
  1798. close: function() {
  1799. var query = new Object();
  1800. query.V_LOGINNAME = V_LOGINNAME;
  1801. query.V_PASSWORD = V_PASSWORD;
  1802. query.DEVICE_ID = devId;
  1803. query.CMD = 93;
  1804. query.PARAM = 0;
  1805. var qjson = Ext.JSON.encode(query);
  1806. var url = ((company_code == "10012") ? "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction2.cgi?t=" : "http://47.103.74.123:8080/YtIoT/cgi-bin/DPAction.cgi?t=") + (new Date().getTime());
  1807. $.ajax({
  1808. type: 'POST',
  1809. url: url,
  1810. data: qjson,
  1811. success: function(result) {
  1812. var json = eval('(' + result + ')');
  1813. if (json.RESULT == '1') {
  1814. fill_uiwin(json);
  1815. }
  1816. }
  1817. });
  1818. }
  1819. }
  1820. }).show();
  1821. }
  1822. }
  1823. }, '-', {
  1824. xtype: 'checkbox',
  1825. boxLabel: '微信推送',
  1826. id: 'userinfo_pushalarm',
  1827. checked: true,
  1828. handler: function() {
  1829. if (!fillvalue) {
  1830. var pushalarm = Ext.getCmp('userinfo_pushalarm').getValue();
  1831. Ext.create('Ext.window.Window', {
  1832. id: 'detail_userinfo_pushset_win',
  1833. title: '请验证身份',
  1834. width: 320,
  1835. height: 240,
  1836. modal: true,
  1837. closable: false,
  1838. items: [{
  1839. xtype: 'textfield',
  1840. name: 'v_loginname',
  1841. fieldLabel: '登录名',
  1842. id: 'v_loginname',
  1843. allowBlank: false
  1844. }, {
  1845. xtype: 'textfield',
  1846. name: 'v_password',
  1847. fieldLabel: '密 码',
  1848. id: 'v_password',
  1849. inputType: 'password',
  1850. allowBlank: false
  1851. }],
  1852. bbar: ['->', {
  1853. xtype: 'button',
  1854. text: '提交',
  1855. handler: function() {
  1856. var query = new Object();
  1857. query.V_LOGINNAME = V_LOGINNAME;
  1858. query.V_PASSWORD = V_PASSWORD;
  1859. query.DEVICE_ID = devId;