company.js.20210408.bak 116 KB

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