company.js 116 KB

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