company.js.bak 130 KB

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