company.js 118 KB

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