waterSignal.js 70 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121
  1. /**
  2. *
  3. */
  4. Ext.Loader.setConfig({
  5. enabled: true
  6. });
  7. Ext.Loader.setPath('Ext.ux', '../../res/extjs/examples/ux');
  8. Ext.require([
  9. 'Ext.grid.*',
  10. 'Ext.data.*',
  11. 'Ext.ux.RowExpander',
  12. 'Ext.selection.CheckboxModel'
  13. ]);
  14. var myStore=null;
  15. var StatusStore;
  16. var baseUrl;
  17. var company_code;
  18. var theme;
  19. var ConfirmStore
  20. var pieWidth;
  21. var showAlarm=null;
  22. var pieMask;
  23. var V_LOGINNAME='',V_PASSWORD='';
  24. var myMask;
  25. var sm = Ext.create('Ext.selection.CheckboxModel');
  26. Ext.define('VWaterOption',{
  27. extend: 'Ext.data.Model',
  28. fields: [
  29. { name:"id", type:'int' },
  30. { name:'company_code', type:'string' },
  31. { name:'company_name', type:'string' },
  32. { name:'fulladdress', type:'string' },
  33. { name:'rtmp', type:'string' },
  34. { name:'xmlx', type:'string' },
  35. { name:'list_count', type:'int' }
  36. ]
  37. });
  38. Ext.define('CompanyComboStore',{
  39. extend:'Ext.data.Model',
  40. fields: [
  41. {name:'owner_name', type:'string'},
  42. {name:'owner_id',type:'string'}
  43. ]
  44. });
  45. var drawDevices = function(){
  46. // alert('get device info');
  47. if(StatusStore.length>0){
  48. var current_device_id='';
  49. var device_count=0;
  50. var fire_device_count=0;
  51. var water_device_count=0;
  52. var rtu_device_count=0;
  53. var other_device_count=0;
  54. var fire_device_out=0;
  55. var water_device_out=0;
  56. var rtu_device_out=0;
  57. var other_device_out=0;
  58. var fire_device_alarm=0;
  59. var water_device_alarm=0;
  60. var rtu_device_alarm=0;
  61. var other_device_alarm=0;
  62. var fire_device_normal=0;
  63. var water_device_normal=0;
  64. var rtu_device_normal=0;
  65. var other_device_normal=0;
  66. var total_normal=0;
  67. var mark_array = new Array();
  68. for(var i=0;i<StatusStore.length;i++){
  69. if((StatusStore[i].point_list!=null)
  70. &&(StatusStore[i].point_list!=undefined)
  71. &&(StatusStore[i].point_list.length>0)){
  72. for(var j=0;j<StatusStore[i].point_list.length;j++){
  73. if(StatusStore[i].point_list[j].device_id!=current_device_id){
  74. current_device_id=StatusStore[i].point_list[j].device_id;
  75. device_count++;
  76. if((StatusStore[i].point_list[j].dwtype=='1')
  77. ||(StatusStore[i].point_list[j].dwtype==1))
  78. fire_device_count++;
  79. else if((StatusStore[i].point_list[j].dwtype=='2')
  80. ||(StatusStore[i].point_list[j].dwtype==2))
  81. water_device_count++;
  82. else if((StatusStore[i].point_list[j].dwtype=='3')
  83. ||(StatusStore[i].point_list[j].dwtype==3))
  84. other_device_count++;
  85. else if((StatusStore[i].point_list[j].dwtype=='4')
  86. ||(StatusStore[i].point_list[j].dwtype==4))
  87. water_device_count++;
  88. else if((StatusStore[i].point_list[j].dwtype=='5')
  89. ||(StatusStore[i].point_list[j].dwtype==5))
  90. water_device_count++;
  91. else if((StatusStore[i].point_list[j].dwtype=='6')
  92. ||(StatusStore[i].point_list[j].dwtype==6))
  93. rtu_device_count++;
  94. else
  95. other_device_count++;
  96. }
  97. if((StatusStore[i].point_list[j].point_code=='0')
  98. ||(StatusStore[i].point_list[j].point_code==0)){
  99. if((StatusStore[i].point_list[j].point_data!='0')
  100. &&(StatusStore[i].point_list[j].point_data!=0)){
  101. if((StatusStore[i].point_list[j].dwtype=='1')
  102. ||(StatusStore[i].point_list[j].dwtype==1))
  103. fire_device_alarm++;
  104. else if((StatusStore[i].point_list[j].dwtype=='2')
  105. ||(StatusStore[i].point_list[j].dwtype==2)){
  106. if((StatusStore[i].point_list[j].point_data=='4')
  107. ||(StatusStore[i].point_list[j].point_data==4))
  108. water_device_out++;
  109. else
  110. water_device_alarm++;
  111. }
  112. else if((StatusStore[i].point_list[j].dwtype=='3')
  113. ||(StatusStore[i].point_list[j].dwtype==3))
  114. other_device_out++;
  115. else if((StatusStore[i].point_list[j].dwtype=='4')
  116. ||(StatusStore[i].point_list[j].dwtype==4))
  117. if((StatusStore[i].point_list[j].point_data=='4')
  118. ||(StatusStore[i].point_list[j].point_data==4))
  119. water_device_out++;
  120. else
  121. water_device_alarm++;
  122. else if((StatusStore[i].point_list[j].dwtype=='5')
  123. ||(StatusStore[i].point_list[j].dwtype==5))
  124. if((StatusStore[i].point_list[j].point_data=='4')
  125. ||(StatusStore[i].point_list[j].point_data==4))
  126. water_device_out++;
  127. else
  128. water_device_alarm++;
  129. else if((StatusStore[i].point_list[j].dwtype=='6')
  130. ||(StatusStore[i].point_list[j].dwtype==6))
  131. rtu_device_out++;
  132. else
  133. other_device_out++;
  134. }
  135. }
  136. }
  137. }
  138. }
  139. fire_device_normal = fire_device_count-fire_device_out-fire_device_alarm;
  140. water_device_normal = water_device_count-water_device_out-water_device_alarm;
  141. rtu_device_normal = rtu_device_count-rtu_device_out-rtu_device_alarm;
  142. other_device_normal = other_device_count-other_device_out-other_device_alarm;
  143. total_normal = fire_device_normal+water_device_normal+rtu_device_normal+other_device_normal;
  144. var themecolor = ((theme=='')||(theme=='access'))?'#ffffff':'#000000';
  145. draw_cycle_icon('waterPie1','设备在线<br/> <br/>监控总数:<span style="color:#DDDF0D;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+water_device_count+'</span><br/>在线总数:<span style="color:#34abf5;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+(water_device_count-water_device_out)+'</span><br/>离线线总数:<span style="color:#DF5353;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+water_device_out+'<br/>在线率:',water_device_count,(water_device_count-water_device_out),themecolor);
  146. draw_cycle_icon('waterPie2','状态正常<br/> <br/>在线总数:<span style="color:#DDDF0D;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+(water_device_count-water_device_out)+'</span><br/>正常总数:<span style="color:#34abf5;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+water_device_normal+'</span><br/>告警总数:<span style="color:#DF5353;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+water_device_alarm+'<br/>正常率:',(water_device_count-water_device_out),water_device_normal,themecolor);
  147. }
  148. }
  149. var draw_confirm = function(){
  150. var themecolor = ((theme=='')||(theme=='access'))?'#ffffff':'#000000';
  151. for(var i=0;i<ConfirmStore.length;i++){
  152. if(ConfirmStore[i].id=='water_alarm'){
  153. draw_cycle_icon('waterPie3','告警处理情况<br/>告警总数:<span style="color:#DDDF0D;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+ConfirmStore[i].count+'</span><br/>已处理:<span style="color:#34abf5;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+ConfirmStore[i].sum+'</span><br/>未处理:<span style="color:#DF5353;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+(ConfirmStore[i].count-ConfirmStore[i].sum)+'</span><br/>处理率:',ConfirmStore[i].count,ConfirmStore[i].sum,themecolor);
  154. Highcharts.chart('waterArea',{
  155. chart:{
  156. type:'area',
  157. backgroundColor: 'rgba(0,0,0,0)'
  158. },
  159. title:{
  160. text:'近期告警发生及处理情况汇总',
  161. style:{fontSize:'14px',color:themecolor,fontWeight:'bold'}
  162. },
  163. legend:{
  164. floating:true,
  165. itemStyle:{fontSize:'12px',color:themecolor,fontWeight:'bold'},
  166. x:300,
  167. y:(115-pieWidth)
  168. },
  169. colors:['#f66167', '#34abf5'],
  170. exporting: {
  171. enabled: false
  172. },
  173. credits: {
  174. enabled: false
  175. },
  176. xAxis:{
  177. categories:ConfirmStore[i].day_list,
  178. tickmarkPlacement:'on',
  179. lineColor:'#666666',
  180. tickColor:'#666666',
  181. labels:{
  182. enabled:false,
  183. style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  184. },
  185. title:{
  186. enabled:false
  187. }
  188. },
  189. yAxis:{
  190. title:{
  191. text:'次',
  192. style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  193. },
  194. lineColor:'#666666',
  195. tickColor:'#666666',
  196. labels:{
  197. formatter:this.value,
  198. style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  199. }
  200. },
  201. plotOptions:{
  202. area:{
  203. stackiung:'normal',
  204. lineColor:'#666666',
  205. lineWidth:1,
  206. marker:{
  207. lineWidth:1,
  208. lineColor:'#666666'
  209. }
  210. }
  211. },
  212. series:[
  213. {
  214. name:'告警次数',
  215. data:ConfirmStore[i].count_list
  216. },{
  217. name:'处理次数',
  218. data:ConfirmStore[i].sum_list
  219. }
  220. ]
  221. });
  222. }
  223. }
  224. }
  225. var draw_cycle_icon = function(icon_id,name, total, num, themecolor){
  226. var mColor= '#34abf5';//[ '#DDDF0D','#f66167', '#34abf5']
  227. var percent = 100;
  228. if(total>0)
  229. percent = Number(((num*100)/total).toString().match(/^\d+(?:\.\d{0,2})?/));
  230. if(percent<60)
  231. mColor = '#f66167';
  232. else if(percent<80)
  233. mColor = '#DDDF0D';
  234. $("#"+icon_id+"Title").html('<br/><br/>'+name+percent+'%');
  235. Highcharts.chart(icon_id,{
  236. chart: {
  237. type: 'solidgauge',
  238. height: '85%',
  239. backgroundColor: 'rgba(0,0,0,0)',
  240. reflow:true,
  241. marginTop:0
  242. },
  243. title:{
  244. text:percent+'%',
  245. floating:true,
  246. y:pieWidth/3,
  247. style:{fontSize:'14px',color:themecolor,fontWeight:'bold'}
  248. },
  249. exporting: {
  250. enabled: false
  251. },
  252. credits: {
  253. enabled: false
  254. },
  255. tooltip: {
  256. enabled: false
  257. },
  258. pane: {
  259. startAngle: -90,
  260. endAngle: 180,
  261. background: [{
  262. outerRadius: '90%',
  263. innerRadius: '60%',
  264. backgroundColor: 'rgba(0,0,0,0)',
  265. borderWidth: 0
  266. }]
  267. },
  268. yAxis: {
  269. min: 0,
  270. max: 100,
  271. lineWidth: 0,
  272. tickPositions: []
  273. },
  274. plotOptions: {
  275. solidgauge: {
  276. dataLabels: {
  277. enabled: false
  278. },
  279. stickyTracking: false,
  280. rounded: true,
  281. warp: false
  282. }
  283. },
  284. series:[{
  285. name:'',
  286. data:[{
  287. color: Highcharts.Color(mColor)
  288. .setOpacity(0.2)
  289. .get(),
  290. radius: '90%',
  291. innerRadius: '60%',
  292. y: 100
  293. },{
  294. color: Highcharts.Color(mColor)
  295. .setOpacity(0.6)
  296. .get(),
  297. radius: '90%',
  298. innerRadius: '60%',
  299. y: percent
  300. }]
  301. }]
  302. });
  303. if((theme=='access')||(theme=='')){
  304. $('#'+icon_id).addClass('shadow_black');
  305. }else{
  306. $('#'+icon_id).addClass('shadow_white');
  307. }
  308. }
  309. var draw_confirm = function(){
  310. var list = ConfirmStore[0].point_list;
  311. var ncount = ConfirmStore[0].list_count;
  312. $("#WaterPiePanel_title_string").html(ConfirmStore[0].company_name+'.水系统监控设备通信信号强弱情况');
  313. var table = document.createElement("table");
  314. table.width="100%";
  315. table.border='0';
  316. table.style='border:0px solid #000;height:100%;';
  317. $("#waterArea").html('');
  318. document.getElementById("waterArea").appendChild(table);
  319. for(var i=0;i<ncount;i++){
  320. var tr = document.createElement("tr");
  321. tr.height=pieWidth;
  322. tr.border='0';
  323. tr.style='border:0px solid #000;height:'+(pieWidth*3)/4+'px;'
  324. table.appendChild(tr);
  325. var td2 = document.createElement('td');
  326. td2.height=pieWidth;
  327. td2.id='area_'+(i+1);
  328. td2.border='0';
  329. td2.style='border:0px solid #000;height:'+(pieWidth*3)/4+'px;margin:30px auto 30px auto;';
  330. tr.appendChild(td2);
  331. }
  332. for(var i=0;i<ncount;i++){
  333. var point_list = list[i];
  334. var themecolor = ((theme=='')||(theme=='access'))?'#ffffff':'#000000';
  335. var mColor= '#34abf5';//[ '#DDDF0D','#f66167', '#34abf5']
  336. if(point_list.point_data.length==0)
  337. point_list.point_data='0';
  338. if(point_list.point_data<3)
  339. mColor = '#f66167';
  340. else if(point_list.point_data<4)
  341. mColor = '#DDDF0D';
  342. // Highcharts.getOptions().colors = Highcharts.map([mColor], function (color) {
  343. // return {
  344. // radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
  345. // stops: [
  346. // [0, color],
  347. // [1, Highcharts.Color(color).setOpacity(0).get('rgb')] // darken
  348. // ]
  349. // };
  350. // });
  351. Highcharts.chart('area_'+(i+1),{
  352. chart:{
  353. type:'area',
  354. zoomType: 'x',
  355. backgroundColor: 'rgba(0,0,0,0)'
  356. },
  357. colors:[mColor,mColor,mColor],
  358. title:{
  359. text:point_list.name+'.通信信号强弱数据跟踪',
  360. style:{fontSize:'14px',color:themecolor,fontWeight:'bold'}
  361. },
  362. legend:{
  363. enabled:false,
  364. itemStyle:{fontSize:'12px',color:themecolor,fontWeight:'bold'}
  365. },
  366. colors:[mColor],
  367. exporting: {
  368. enabled: false
  369. },
  370. credits: {
  371. enabled: false
  372. },
  373. xAxis:{
  374. categories:ConfirmStore[i].day_list,
  375. tickmarkPlacement:'on',
  376. lineColor:'#666666',
  377. tickColor:'#666666',
  378. labels:{
  379. enabled:false,
  380. style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  381. },
  382. title:{
  383. enabled:false
  384. }
  385. },
  386. yAxis:{
  387. max:5,
  388. min:0,
  389. title:{
  390. text:'%',
  391. style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  392. },
  393. lineColor:'#666666',
  394. tickColor:'#666666',
  395. labels:{
  396. formatter: this.value,
  397. style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  398. }
  399. },
  400. plotOptions:{
  401. fillColor: {
  402. linearGradient: {
  403. x1: 0,
  404. y1: 0,
  405. x2: 0,
  406. y2: 1
  407. },
  408. stops: [
  409. [0, Highcharts.getOptions().colors[0]],
  410. [1, Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0).get('rgba')]
  411. ]
  412. },
  413. area:{
  414. stackiung:'normal',
  415. lineWidth:0,
  416. marker:{
  417. lineWidth:0,
  418. enabled:false,
  419. radius:0
  420. }
  421. }
  422. },
  423. series:[
  424. {
  425. name:'信号强弱',
  426. data:point_list.data_list
  427. }
  428. ]
  429. });
  430. }
  431. }
  432. var show_datapie = function(record){
  433. if(myStore==null)
  434. return;
  435. var themecolor = ((theme=='')||(theme=='access'))?'#ffffff':'#000000';
  436. var nrow = myStore.getCount();
  437. var company_code = record.get('company_code');
  438. for(var i=0;i<nrow;i++){
  439. if(myStore.getAt(i).get('company_code')==company_code){
  440. var list = myStore.getAt(i).raw.point_list;
  441. $("#WaterPiePanel_title_string").html(myStore.getAt(i).get('company_name')+'.水系统监控设备电池电量情况');
  442. var div_root = document.getElementById("waterArea");
  443. div_root.innerHTML = '';
  444. for(var j=0;j<list.length;j++){
  445. var v = list[j].point_data==''?0:(list[j].point_data>5?5:list[j].point_data);
  446. var myColor = ((v<3)?'#f66167':((v<4)?'#DDDF0D':'#34abf5'));
  447. var div = document.createElement('div');
  448. div.id = 'WaterPiePanel_'+list[j].device_id;
  449. div.style.overflow='hidden';
  450. div.style.padding='5px';
  451. div.style.margin='20px';
  452. div.style.width='150px';
  453. div.style.height='250px';
  454. div.style.border='2px solid rgba(255,255,255,0.0)';
  455. div.style.background = 'rgba(255,255,255,0.0)';
  456. div.style.color = '#ffffff';
  457. div.style.cursor = 'pointer';
  458. div.style.float = 'left';
  459. div.device_id = list[j].device_id;
  460. div.company_code = company_code;
  461. div_root.appendChild(div);
  462. $("#WaterPiePanel_"+list[j].device_id).mouseover(function(){
  463. $(this).css({
  464. 'overflow':'hidden',
  465. 'padding':'5px',
  466. 'margin':'20px',
  467. 'width':'150px',
  468. 'height':'250px',
  469. 'cursor':'pointer',
  470. 'float':'left',
  471. 'color':'#ffff00',
  472. 'border':'2px solid rgba(255,255,255,0.3)',
  473. 'background':'rgba(0,0,0,0.3)'
  474. });
  475. });
  476. $("#WaterPiePanel_"+list[j].device_id).mouseout(function(){
  477. $(this).css({
  478. 'overflow':'hidden',
  479. 'padding':'5px',
  480. 'margin':'20px',
  481. 'width':'150px',
  482. 'height':'250px',
  483. 'cursor':'pointer',
  484. 'float':'left',
  485. 'color':'#ffffff',
  486. 'border':'2px solid rgba(255,255,255,0.0)',
  487. 'background':'rgba(255,255,255,0.0)'
  488. });
  489. });
  490. $("#WaterPiePanel_"+list[j].device_id).click(function(e){
  491. var id = e.currentTarget.device_id;
  492. var cid = e.currentTarget.company_code;
  493. myMask.show();
  494. var query = new Object();
  495. // query.V_LOGINNAME = V_LOGINNAME;
  496. // query.V_PASSWORD = V_PASSWORD;
  497. query.company_code = cid;
  498. query.device_id = id;
  499. query.dwtype = '2';
  500. query.point_code = '3';
  501. $.ajax({
  502. type:'POST',
  503. url: baseUrl+"iot/data/view/getSyncDataVListByCompany",
  504. data: {
  505. queryJson : Ext.JSON.encode(query)
  506. },
  507. success: function(result){
  508. var json = eval('(' + result + ')');
  509. if(json.action=='getSyncDataVListByCompany'){
  510. if(json.check=='true'){
  511. ConfirmStore = json.RESULT;
  512. draw_confirm();
  513. }else{
  514. Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function(){
  515. window.parent.frames.return_login();
  516. });
  517. }
  518. }
  519. myMask.hide();
  520. }
  521. });
  522. });
  523. var title = document.createElement('div');
  524. title.style.margin = '0px';
  525. title.style.padding = '0px';
  526. title.style.width = '150px';
  527. title.style.height = '50px';
  528. title.style.fontSize = '14px';
  529. title.style.fontWeight = 'bold';
  530. title.innerHTML = list[j].name;
  531. div.appendChild(title);
  532. var text = document.createElement('div');
  533. text.style.margin = '0px';
  534. text.style.padding = '0px';
  535. text.style.width = '150px';
  536. text.style.height = '80px';
  537. text.style.fontSize = '10px';
  538. text.style.fontWeight = 'normal';
  539. var str = '<b>信号强弱:</b><span style="color:'+myColor+';">'+v+'</span><br/><b>采集时间:</b><br/>'+list[j].data_time;
  540. text.innerHTML = str
  541. div.appendChild(text);
  542. var pie = document.createElement('div');
  543. pie.style.margin = '0px';
  544. pie.style.padding = '0px';
  545. pie.style.width = '120px';
  546. pie.style.height = '100px';
  547. var pieId = 'WaterDevicePie_'+list[j].device_id;
  548. pie.id = pieId;
  549. div.appendChild(pie);
  550. Highcharts.getOptions().colors = Highcharts.map([ '#000000',myColor, myColor], function (color) {
  551. return {
  552. radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
  553. stops: [
  554. [0, color],
  555. [1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
  556. ]
  557. };
  558. });
  559. Highcharts.chart(pieId,{
  560. chart: {
  561. type: 'solidgauge',
  562. height: '85%',
  563. backgroundColor: 'rgba(0,0,0,0)',
  564. reflow:true,
  565. marginTop:0
  566. },
  567. title:{
  568. text:v+'%',
  569. floating:true,
  570. y:(pieWidth*2/5),
  571. style:{fontSize:'21px',color:themecolor,fontWeight:'bold'}
  572. },
  573. exporting: {
  574. enabled: false
  575. },
  576. credits: {
  577. enabled: false
  578. },
  579. tooltip: {
  580. enabled: false
  581. },
  582. pane: {
  583. startAngle: -90,
  584. endAngle: 270,
  585. background: [{
  586. outerRadius: '90%',
  587. innerRadius: '60%',
  588. backgroundColor: 'rgba(0,0,0,0)',
  589. borderWidth: 0
  590. }]
  591. },
  592. yAxis: {
  593. min: 0,
  594. max: 5,
  595. lineWidth: 0,
  596. tickPositions: []
  597. },
  598. plotOptions: {
  599. solidgauge: {
  600. dataLabels: {
  601. enabled: false
  602. },
  603. linecap: 'square',
  604. stickyTracking: false,
  605. rounded: false,
  606. warp: false
  607. }
  608. },
  609. series:[{
  610. name:'',
  611. data:[{
  612. color: Highcharts.Color(myColor)
  613. .setOpacity(0.2)
  614. .get(),
  615. radius: '110%',
  616. innerRadius: '80%',
  617. y: 100
  618. },{
  619. color: (Highcharts.theme && Highcharts.theme.contrastTextColor) ,
  620. radius: '110%',
  621. innerRadius: '80%',
  622. y: v*20
  623. },{
  624. color: (Highcharts.theme && Highcharts.theme.contrastTextColor) ,
  625. radius: '60%',
  626. innerRadius: '0%',
  627. y: 100
  628. }]
  629. }]
  630. });
  631. // Highcharts.chart(pieId,{
  632. // chart:{
  633. // type:'bar',
  634. // backgroundColor: 'rgba(0,0,0,0)'
  635. // },
  636. // title:{
  637. // text:null
  638. // },
  639. // exporting: {
  640. // enabled: false
  641. // },
  642. // credits: {
  643. // enabled: false
  644. // },
  645. // legend:{
  646. // enabled: false
  647. // },
  648. // tooltip:{
  649. // enabled:false
  650. // },
  651. // xAxis:{
  652. // categories:['电量'],
  653. // labels:{
  654. // enabled:false
  655. // },
  656. // gridLineWidth:0,
  657. // lineWidth:0,
  658. // tickWidth:0
  659. // },
  660. // yAxis:{
  661. // min: 0,
  662. // max: 100,
  663. // title:{
  664. // text:null
  665. // },
  666. // labels:{
  667. // enabled:false
  668. // },
  669. // gridLineWidth:0,
  670. // lineWidth:0,
  671. // stackLabels:{
  672. // enabled:false
  673. // },
  674. // tickWidth:0
  675. // },
  676. // legend:{
  677. // reversed:true,
  678. // enabled:false
  679. // },
  680. // plotOptions:{
  681. // series:{
  682. // stacking:'normal'
  683. // }
  684. // },
  685. // series:[{
  686. // name:'剩余电量',
  687. //// visible:false,
  688. // data:[v]
  689. // }]
  690. // });
  691. }
  692. break;
  693. }
  694. }
  695. pieMask.hide();
  696. }
  697. var getCurrentData = function(){
  698. var div = Ext.getCmp('VWaterOptionListPanel');
  699. var model = div.getSelectionModel();
  700. var record = model.getSelection()[0];
  701. show_datapie(record);
  702. }
  703. Ext.onReady(function(){
  704. baseUrl = document.getElementById('basePath').value;
  705. theme = document.getElementById('theme').value;
  706. company_code = document.getElementById('company_code').value;
  707. $("#V_LOGINNAME").val(sessionStorage.getItem('V_LOGINNAME'));
  708. $("#V_PASSWORD").val(sessionStorage.getItem('V_PASSWORD'));
  709. V_LOGINNAME = $("#V_LOGINNAME").val();
  710. V_PASSWORD = $("#V_PASSWORD").val();
  711. var currentWidth = document.documentElement.clientWidth;
  712. pieWidth = currentWidth/7;
  713. var chkIcon = '<img src="'+baseUrl+'res/img/common/check.gif"/>'
  714. var unchkIcon = '<img src="'+baseUrl+'res/img/common/uncheck.gif"/>'
  715. var countPerPage = 20;
  716. var maxHeight = 10000;
  717. var chkBoolean = function(flag) {
  718. if(flag)
  719. return chkIcon;
  720. return unchkIcon;
  721. }
  722. var queryJson = new Object();
  723. queryJson.V_LOGINNAME = V_LOGINNAME;
  724. // queryJson.V_PASSWORD = V_PASSWORD;
  725. queryJson.dwtype = '2';
  726. queryJson.point_code = '3'
  727. if((company_code!=null)&&(company_code!='null')&&(company_code.length>0))
  728. queryJson.company_code = company_code;
  729. myStore = Ext.create('Ext.data.Store', {
  730. model: 'VWaterOption',
  731. pageSize: countPerPage,
  732. proxy: {
  733. type: 'ajax',
  734. actionMethods: {
  735. create : 'POST',
  736. read : 'POST', // by default GET
  737. update : 'POST',
  738. destroy: 'POST'
  739. },
  740. url: baseUrl+'iot/data/view/getSyncStatusVListByCompany',
  741. reader: {
  742. type: 'json',
  743. root: 'RESULT',
  744. totalProperty: 'totalCount'
  745. },
  746. extraParams:{
  747. queryJson:Ext.JSON.encode(queryJson)
  748. }
  749. },
  750. sorters:[{
  751. property:'time',
  752. direction:'DESC'
  753. }],
  754. remoteSort: true
  755. });
  756. var CompanyStory = Ext.create('Ext.data.Store',{
  757. model: 'CompanyComboStore',
  758. proxy: {
  759. type: 'ajax',
  760. actionMethods: {
  761. create : 'POST',
  762. read : 'POST', // by default GET
  763. update : 'POST',
  764. destroy: 'POST'
  765. },
  766. url: baseUrl+'iot/company/view/getNameList',
  767. reader: {
  768. type: 'json',
  769. root: 'RESULT',
  770. totalProperty: 'totalCount'
  771. },
  772. extraParams:{
  773. queryJson:Ext.JSON.encode(queryJson)
  774. }
  775. }
  776. });
  777. var ClztStory = Ext.create('Ext.data.Store',{
  778. fields:['abbr','name'],
  779. data:[
  780. {'abbr':0,'name':'未处理'},
  781. {'abbr':1,'name':'已处理'}
  782. ]
  783. });
  784. var FilterForm = Ext.create('Ext.form.Panel', {
  785. id: 'VWaterOptionFilterForm',
  786. labelWidth: 55,
  787. defaultType: 'textfield',
  788. bodyPadding: 15,
  789. items: [{
  790. xtype:'combo',
  791. fieldLabel:'单位名称',
  792. id: 'ff_company_code',
  793. name:'ff_company_code',
  794. displayField : 'owner_name',
  795. valueField : 'owner_id',
  796. editable : false,
  797. width:330,
  798. store:CompanyStory
  799. },{
  800. xtype:'combo',
  801. fieldLabel:'处理状态',
  802. id: 'ff_clzt',
  803. name: 'ff_clzt',
  804. displayField : 'name',
  805. valueField : 'abbr',
  806. editable : false,
  807. width:330,
  808. store:ClztStory
  809. }],
  810. buttons: [{
  811. text: '筛选',
  812. iconCls:'ok_btn',
  813. handler: function() {
  814. var form = this.up('form').getForm();
  815. if (form.isValid()) {
  816. var query = new Object();
  817. // var tmp = Ext.getCmp('ff_company_code');
  818. query.dwtype = '2';
  819. query.point_code = '2'
  820. if(Ext.getCmp('ff_company_code').getValue().length>0){
  821. query.company_code = Ext.getCmp('ff_company_code').getValue();
  822. $("#company_code").val(query.company_code);
  823. company_code = query.company_code;
  824. $("#WaterPiePanel_title_string").html(Ext.getCmp('ff_company_code').getRawValue( )+'.火警系统监控告警处理情况');
  825. }else{
  826. $("#company_code").val('');
  827. $("#WaterPiePanel_title_string").html('火警系统监控告警处理情况');
  828. company_code = null;
  829. }
  830. query.clzt = Ext.getCmp('ff_clzt').getValue()==null?"":Ext.getCmp('ff_clzt').getValue();
  831. // query.V_LOGINNAME = V_LOGINNAME;
  832. // query.V_PASSWORD = V_PASSWORD;
  833. query.COMMSTATUS = 'NO';
  834. var jsonstr = Ext.JSON.encode(query);
  835. myStore.getProxy().extraParams = {
  836. queryJson : jsonstr
  837. };
  838. Ext.getCmp('VWaterOptionListPageToolbar').moveFirst();
  839. Ext.getCmp('ff_company_code').setValue('');
  840. Ext.getCmp('ff_clzt').setValue('');
  841. Ext.getCmp('VWaterOptionFilterWin').hide();
  842. getCurrentData();
  843. }
  844. }
  845. },{
  846. text: '关闭',
  847. iconCls: 'cancel_btn',
  848. handler: function() {
  849. Ext.getCmp('VWaterOptionFilterWin').hide();
  850. }
  851. }]
  852. });
  853. var filterwin = function() {
  854. Ext.create('Ext.window.Window',{
  855. id: 'VWaterOptionFilterWin',
  856. title: '水系统报告筛选',
  857. height: 210,
  858. width: 400,
  859. layout: 'fit',
  860. items: FilterForm,
  861. closable:false,
  862. modal:true,
  863. closeAction: 'hide'
  864. }).show();
  865. CompanyStory.reload();
  866. }
  867. var radiogroup = new Ext.create('Ext.form.RadioGroup',{
  868. fieldLabel:'误报',
  869. id:'uf_r_clwb',
  870. width:300,
  871. items:[{
  872. name:'uf_r_clwb',
  873. inputValue:'1',
  874. boxLabel:'是'
  875. },{
  876. name:'uf_r_clwb',
  877. inputValue:'0',
  878. boxLabel:'否',
  879. checked:true
  880. }]
  881. });
  882. var radiogroup2 = new Ext.create('Ext.form.RadioGroup',{
  883. fieldLabel:'处理范围',
  884. id:'uf_r_clfw',
  885. width:300,
  886. items:[{
  887. name:'uf_r_clfw',
  888. inputValue:'1',
  889. boxLabel:'批量'
  890. },{
  891. name:'uf_r_clfw',
  892. inputValue:'0',
  893. boxLabel:'单一',
  894. checked:true
  895. }]
  896. });
  897. var clear_modify_form = function(){
  898. Ext.getCmp('uf_company_name').setValue('');
  899. Ext.getCmp('uf_name').setValue('');
  900. Ext.getCmp('uf_device_code').setValue('');
  901. Ext.getCmp('uf_id').setValue('');
  902. Ext.getCmp('uf_status').setValue('');
  903. Ext.getCmp('uf_fullname').setValue('');
  904. Ext.getCmp('uf_clwb').setValue('');
  905. Ext.getCmp('uf_clr').setValue('');
  906. Ext.getCmp('uf_clsj').setValue('');
  907. Ext.getCmp('uf_clnr').setValue('');
  908. }
  909. var fireInfoForm = Ext.create('Ext.form.Panel', {
  910. id: 'waterInfoForm',
  911. labelWidth: 55,
  912. url: baseUrl+'iot/alarm/view/updateSj',
  913. defaultType: 'textfield',
  914. bodyPadding: 15,
  915. items: [{
  916. fieldLabel:'单位名称',
  917. id: 'uf_company_name',
  918. name: 'uf_company_name',
  919. anchor:'90%'
  920. },{
  921. fieldLabel:'监控设备',
  922. id:'uf_name',
  923. name:'uf_name',
  924. anchor:'100%'
  925. },{
  926. fieldLabel:'设备编号',
  927. id:'uf_device_code',
  928. name:'uf_device_code',
  929. hidden: true
  930. },{
  931. fieldLabel:'记录编号',
  932. id:'uf_id',
  933. name:'uf_id',
  934. hidden: true
  935. },{
  936. fieldLabel:'设备编号',
  937. id:'uf_status',
  938. name:'uf_status',
  939. hidden: true
  940. },{
  941. fieldLabel:'报告信息',
  942. id: 'uf_fullname',
  943. name:'uf_fullname',
  944. xtype: 'textareafield',
  945. maxLength: 250,
  946. cols:4,
  947. anchor:'100%'
  948. },{
  949. fieldLabel:'误报',
  950. id: 'uf_clwb',
  951. name:'uf_clwb',
  952. maxLength: 200,
  953. anchor:'65%'
  954. },radiogroup,radiogroup2,{
  955. fieldLabel:'处理人',
  956. id: 'uf_clr',
  957. name:'uf_clr',
  958. maxLength: 120,
  959. anchor:'65%'
  960. },{
  961. fieldLabel:'处理时间',
  962. id: 'uf_clsj',
  963. name:'uf_clsj',
  964. maxLength: 200,
  965. anchor:'80%'
  966. },{
  967. fieldLabel:'处理内容',
  968. id: 'uf_clnr',
  969. name:'uf_clnr',
  970. xtype: 'textareafield',
  971. maxLength: 250,
  972. cols:4,
  973. anchor:'100%'
  974. },{
  975. id:'fm_queryJson',
  976. name:'queryJson',
  977. hidden:true
  978. }],
  979. buttons: [{
  980. text: '处理',
  981. id:'confirmBtn',
  982. iconCls:'ok_btn',
  983. handler: function() {
  984. var form = this.up('form').getForm();
  985. if (form.isValid()) {
  986. var queryJson = new Object();
  987. // queryJson.V_LOGINNAME = V_LOGINNAME;
  988. // queryJson.V_PASSWORD = V_PASSWORD;
  989. queryJson.id = Ext.getCmp('uf_id').getValue();
  990. queryJson.status = Ext.getCmp('uf_status').getValue();
  991. queryJson.name = Ext.getCmp('uf_name').getValue();
  992. queryJson.device_code = Ext.getCmp('uf_device_code').getValue();
  993. queryJson.confirmAll = Ext.getCmp('uf_r_clfw').getChecked()[0].boxLabel=='单一'?'0':'1';
  994. queryJson.clwb = Ext.getCmp('uf_r_clwb').getChecked()[0].boxLabel=='否'?'0':'1';
  995. queryJson.clnr = Ext.getCmp('uf_clnr').getValue();
  996. var jsonstr = Ext.JSON.encode(queryJson);
  997. Ext.getCmp('fm_queryJson').setValue(jsonstr);
  998. form.submit({
  999. method:'post',
  1000. success: function(form, action) {
  1001. Ext.Msg.alert('操作成功', '已确认'+action.result.activerow+'条记录', function(btn,txt){
  1002. clear_modify_form();
  1003. myStore.reload();
  1004. getCurrentData();
  1005. });
  1006. },
  1007. failure: function(form, action) {
  1008. Ext.Msg.alert('操作失败', action.Msg , function(btn,txt){
  1009. clear_modify_form();
  1010. myStore.reload();
  1011. getCurrentData();
  1012. });
  1013. }
  1014. });
  1015. this.up('window').close();
  1016. }
  1017. }
  1018. },{
  1019. text: '关闭',
  1020. iconCls: 'cancel_btn',
  1021. handler: function() {
  1022. this.up('window').close();
  1023. }
  1024. }]
  1025. });
  1026. var vWaterInfoWin = Ext.create('Ext.window.Window',{
  1027. id:'VWaterInfoWin',
  1028. title:'详细信息: <span id="VInfoWin_Title"></span>',
  1029. width:400,
  1030. layout:'fit',
  1031. closable:false,
  1032. modal:true,
  1033. closeAction:'hide',
  1034. items:fireInfoForm
  1035. });
  1036. var showFireInfoWin = function(record){
  1037. vWaterInfoWin.show();
  1038. $("#VInfoWin_Title").html(record.get('data'));
  1039. Ext.getCmp('uf_company_name').setValue(record.get('company_name'));
  1040. Ext.getCmp('uf_name').setValue(record.get('name'));
  1041. Ext.getCmp('uf_device_code').setValue(record.get('device_code'));
  1042. Ext.getCmp('uf_fullname').setValue(record.get('fullname'));
  1043. Ext.getCmp('uf_clr').setValue(record.get('clr_name'));
  1044. Ext.getCmp('uf_clsj').setValue(record.get('clsj'));
  1045. Ext.getCmp('uf_clnr').setValue(record.get('clnr'));
  1046. Ext.getCmp('uf_id').setValue(record.get('id'));
  1047. Ext.getCmp('uf_clwb').setValue(record.get('clwb')=='1'?'误报':'告警');
  1048. Ext.getCmp('uf_status').setValue(record.get('status'));
  1049. if(record.get('clzt')=='已处理'){
  1050. Ext.getCmp('uf_clwb').setVisible(true);
  1051. Ext.getCmp('uf_r_clwb').setVisible(false);
  1052. Ext.getCmp('uf_r_clfw').setVisible(false);
  1053. Ext.getCmp('confirmBtn').setVisible(false);
  1054. Ext.getCmp('uf_clr').setVisible(true);
  1055. Ext.getCmp('uf_clsj').setVisible(true);
  1056. }else{
  1057. Ext.getCmp('uf_clwb').setVisible(false);
  1058. Ext.getCmp('uf_r_clwb').setVisible(true);
  1059. Ext.getCmp('uf_r_clfw').setVisible(true);
  1060. Ext.getCmp('confirmBtn').setVisible(true);
  1061. Ext.getCmp('uf_clr').setVisible(false);
  1062. Ext.getCmp('uf_clsj').setVisible(false);
  1063. }
  1064. }
  1065. var WaterOptionPanel = Ext.create('Ext.grid.Panel', {
  1066. title: '水系统监控单位列表',
  1067. titleCollapse:true,
  1068. id: 'VWaterOptionListPanel',
  1069. region:'north',
  1070. store: myStore,
  1071. height: (pieWidth*3/2),
  1072. columns: [
  1073. { header: '序号', dataIndex: 'id',width:50, menuDisabled:true },
  1074. { header: '单位名称', dataIndex: 'company_name',width:240, menuDisabled:true },
  1075. { header: '详细地址', dataIndex: 'fulladdress', width:640, menuDisabled:true },
  1076. { header: '单位类型', dataIndex: 'xmlx', width:100, menuDisabled:true },
  1077. { header: '设备数量', dataIndex: 'list_count', width:80, menuDisabled:true }
  1078. ],
  1079. columnLines: true,
  1080. width: '100%',
  1081. frame: true,
  1082. border:false,
  1083. iconCls: 'icon-grid',
  1084. listeners:{
  1085. 'celldblclick' : function(grid, td, cellIndex, record, tr, rowIndex, e, eOpts){
  1086. pieMask.show();
  1087. show_datapie(record);
  1088. }
  1089. }
  1090. });
  1091. var piebar = Ext.create('Ext.panel.Panel',{
  1092. id:'WaterPiePanel',
  1093. width:'100%',
  1094. region:'center',
  1095. layout:'border',
  1096. height: maxHeight,
  1097. title:'<span id="WaterPiePanel_title_string">水系统监控设备通信信号强弱情况</span>',
  1098. defaults:{
  1099. border:false
  1100. },
  1101. items:[
  1102. {
  1103. region:'east',
  1104. xtype:'panel',
  1105. id:'waterArea',
  1106. style:'overflow:auto',
  1107. width:currentWidth
  1108. }
  1109. ]
  1110. });
  1111. pieMask = new Ext.LoadMask(piebar,{msg:"Loading..."});
  1112. myMask = new Ext.LoadMask(document.body,{msg:"Loading..."});
  1113. new Ext.create('Ext.panel.Panel',{
  1114. width:'100%',
  1115. id: 'WaterAlarmPanel',
  1116. layout:'border',
  1117. items:[
  1118. WaterOptionPanel,piebar
  1119. ],
  1120. renderTo: Ext.getBody()
  1121. });
  1122. pieMask.show();
  1123. myStore.addListener('load',function(store,record,opts){
  1124. pieMask.show();
  1125. WaterOptionPanel.getSelectionModel().select(0,true);
  1126. getCurrentData();
  1127. });
  1128. myStore.reload();
  1129. maxHeight = document.documentElement.clientHeight;
  1130. Ext.getCmp('WaterAlarmPanel').setHeight(maxHeight);
  1131. });
  1132. ///**
  1133. // *
  1134. // */
  1135. //
  1136. //Ext.Loader.setConfig({
  1137. // enabled: true
  1138. //});
  1139. //
  1140. //Ext.Loader.setPath('Ext.ux', '../../res/extjs/examples/ux');
  1141. //
  1142. //Ext.require([
  1143. // 'Ext.grid.*',
  1144. // 'Ext.data.*',
  1145. // 'Ext.ux.RowExpander',
  1146. // 'Ext.selection.CheckboxModel'
  1147. //]);
  1148. //
  1149. //var StatusStore;
  1150. //var baseUrl;
  1151. //var company_code;
  1152. //var theme;
  1153. //var ConfirmStore
  1154. //var pieWidth;
  1155. //var showAlarm=null;
  1156. //var pieMask;
  1157. //var V_LOGINNAME='',V_PASSWORD='';
  1158. //
  1159. //var sm = Ext.create('Ext.selection.CheckboxModel');
  1160. //
  1161. //Ext.define('VWaterOption',{
  1162. // extend: 'Ext.data.Model',
  1163. // fields: [
  1164. // { name:"id", type:'int' },
  1165. // { name:'company_code', type:'string' },
  1166. // { name:'company_name', type:'string' },
  1167. // { name:'fulladdress', type:'string' },
  1168. // { name:'rtmp', type:'string' },
  1169. // { name:'xmlx', type:'string' },
  1170. // { name:'list_count', type:'int' }
  1171. // ]
  1172. //});
  1173. //
  1174. //Ext.define('CompanyComboStore',{
  1175. // extend:'Ext.data.Model',
  1176. // fields: [
  1177. // {name:'owner_name', type:'string'},
  1178. // {name:'owner_id',type:'string'}
  1179. // ]
  1180. //});
  1181. //
  1182. //var drawDevices = function(){
  1183. //// alert('get device info');
  1184. // if(StatusStore.length>0){
  1185. // var current_device_id='';
  1186. // var device_count=0;
  1187. // var fire_device_count=0;
  1188. // var water_device_count=0;
  1189. // var rtu_device_count=0;
  1190. // var other_device_count=0;
  1191. // var fire_device_out=0;
  1192. // var water_device_out=0;
  1193. // var rtu_device_out=0;
  1194. // var other_device_out=0;
  1195. // var fire_device_alarm=0;
  1196. // var water_device_alarm=0;
  1197. // var rtu_device_alarm=0;
  1198. // var other_device_alarm=0;
  1199. // var fire_device_normal=0;
  1200. // var water_device_normal=0;
  1201. // var rtu_device_normal=0;
  1202. // var other_device_normal=0;
  1203. // var total_normal=0;
  1204. // var mark_array = new Array();
  1205. // for(var i=0;i<StatusStore.length;i++){
  1206. // if((StatusStore[i].point_list!=null)
  1207. // &&(StatusStore[i].point_list!=undefined)
  1208. // &&(StatusStore[i].point_list.length>0)){
  1209. // for(var j=0;j<StatusStore[i].point_list.length;j++){
  1210. // if(StatusStore[i].point_list[j].device_id!=current_device_id){
  1211. // current_device_id=StatusStore[i].point_list[j].device_id;
  1212. // device_count++;
  1213. // if((StatusStore[i].point_list[j].dwtype=='1')
  1214. // ||(StatusStore[i].point_list[j].dwtype==1))
  1215. // fire_device_count++;
  1216. // else if((StatusStore[i].point_list[j].dwtype=='2')
  1217. // ||(StatusStore[i].point_list[j].dwtype==2))
  1218. // water_device_count++;
  1219. // else if((StatusStore[i].point_list[j].dwtype=='3')
  1220. // ||(StatusStore[i].point_list[j].dwtype==3))
  1221. // other_device_count++;
  1222. // else if((StatusStore[i].point_list[j].dwtype=='4')
  1223. // ||(StatusStore[i].point_list[j].dwtype==4))
  1224. // water_device_count++;
  1225. // else if((StatusStore[i].point_list[j].dwtype=='5')
  1226. // ||(StatusStore[i].point_list[j].dwtype==5))
  1227. // water_device_count++;
  1228. // else if((StatusStore[i].point_list[j].dwtype=='6')
  1229. // ||(StatusStore[i].point_list[j].dwtype==6))
  1230. // rtu_device_count++;
  1231. // else
  1232. // other_device_count++;
  1233. // }
  1234. // if((StatusStore[i].point_list[j].point_code=='0')
  1235. // ||(StatusStore[i].point_list[j].point_code==0)){
  1236. // if((StatusStore[i].point_list[j].point_data!='0')
  1237. // &&(StatusStore[i].point_list[j].point_data!=0)){
  1238. // if((StatusStore[i].point_list[j].dwtype=='1')
  1239. // ||(StatusStore[i].point_list[j].dwtype==1))
  1240. // fire_device_alarm++;
  1241. // else if((StatusStore[i].point_list[j].dwtype=='2')
  1242. // ||(StatusStore[i].point_list[j].dwtype==2)){
  1243. // if((StatusStore[i].point_list[j].point_data=='4')
  1244. // ||(StatusStore[i].point_list[j].point_data==4))
  1245. // water_device_out++;
  1246. // else
  1247. // water_device_alarm++;
  1248. // }
  1249. // else if((StatusStore[i].point_list[j].dwtype=='3')
  1250. // ||(StatusStore[i].point_list[j].dwtype==3))
  1251. // other_device_out++;
  1252. // else if((StatusStore[i].point_list[j].dwtype=='4')
  1253. // ||(StatusStore[i].point_list[j].dwtype==4))
  1254. // if((StatusStore[i].point_list[j].point_data=='4')
  1255. // ||(StatusStore[i].point_list[j].point_data==4))
  1256. // water_device_out++;
  1257. // else
  1258. // water_device_alarm++;
  1259. // else if((StatusStore[i].point_list[j].dwtype=='5')
  1260. // ||(StatusStore[i].point_list[j].dwtype==5))
  1261. // if((StatusStore[i].point_list[j].point_data=='4')
  1262. // ||(StatusStore[i].point_list[j].point_data==4))
  1263. // water_device_out++;
  1264. // else
  1265. // water_device_alarm++;
  1266. // else if((StatusStore[i].point_list[j].dwtype=='6')
  1267. // ||(StatusStore[i].point_list[j].dwtype==6))
  1268. // rtu_device_out++;
  1269. // else
  1270. // other_device_out++;
  1271. // }
  1272. // }
  1273. // }
  1274. // }
  1275. // }
  1276. // fire_device_normal = fire_device_count-fire_device_out-fire_device_alarm;
  1277. // water_device_normal = water_device_count-water_device_out-water_device_alarm;
  1278. // rtu_device_normal = rtu_device_count-rtu_device_out-rtu_device_alarm;
  1279. // other_device_normal = other_device_count-other_device_out-other_device_alarm;
  1280. // total_normal = fire_device_normal+water_device_normal+rtu_device_normal+other_device_normal;
  1281. // var themecolor = ((theme=='')||(theme=='access'))?'#ffffff':'#000000';
  1282. // draw_cycle_icon('waterPie1','设备在线<br/> <br/>监控总数:<span style="color:#DDDF0D;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+water_device_count+'</span><br/>在线总数:<span style="color:#34abf5;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+(water_device_count-water_device_out)+'</span><br/>离线线总数:<span style="color:#DF5353;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+water_device_out+'<br/>在线率:',water_device_count,(water_device_count-water_device_out),themecolor);
  1283. // draw_cycle_icon('waterPie2','状态正常<br/> <br/>在线总数:<span style="color:#DDDF0D;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+(water_device_count-water_device_out)+'</span><br/>正常总数:<span style="color:#34abf5;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+water_device_normal+'</span><br/>告警总数:<span style="color:#DF5353;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+water_device_alarm+'<br/>正常率:',(water_device_count-water_device_out),water_device_normal,themecolor);
  1284. // }
  1285. //}
  1286. //
  1287. //var draw_confirm = function(){
  1288. // var themecolor = ((theme=='')||(theme=='access'))?'#ffffff':'#000000';
  1289. // for(var i=0;i<ConfirmStore.length;i++){
  1290. // if(ConfirmStore[i].id=='water_alarm'){
  1291. // draw_cycle_icon('waterPie3','告警处理情况<br/>告警总数:<span style="color:#DDDF0D;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+ConfirmStore[i].count+'</span><br/>已处理:<span style="color:#34abf5;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+ConfirmStore[i].sum+'</span><br/>未处理:<span style="color:#DF5353;text-shadow: 1px 1px 2px #888, 0 0 0 #000">'+(ConfirmStore[i].count-ConfirmStore[i].sum)+'</span><br/>处理率:',ConfirmStore[i].count,ConfirmStore[i].sum,themecolor);
  1292. // Highcharts.chart('waterArea',{
  1293. // chart:{
  1294. // type:'area',
  1295. // backgroundColor: 'rgba(0,0,0,0)'
  1296. // },
  1297. // title:{
  1298. // text:'近期告警发生及处理情况汇总',
  1299. // style:{fontSize:'14px',color:themecolor,fontWeight:'bold'}
  1300. // },
  1301. // legend:{
  1302. // floating:true,
  1303. // itemStyle:{fontSize:'12px',color:themecolor,fontWeight:'bold'},
  1304. // x:300,
  1305. // y:(115-pieWidth)
  1306. // },
  1307. // colors:['#f66167', '#34abf5'],
  1308. // exporting: {
  1309. // enabled: false
  1310. // },
  1311. // credits: {
  1312. // enabled: false
  1313. // },
  1314. // xAxis:{
  1315. // categories:ConfirmStore[i].day_list,
  1316. // tickmarkPlacement:'on',
  1317. // lineColor:'#666666',
  1318. // tickColor:'#666666',
  1319. // labels:{
  1320. // enabled:false,
  1321. // style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  1322. // },
  1323. // title:{
  1324. // enabled:false
  1325. // }
  1326. // },
  1327. // yAxis:{
  1328. // title:{
  1329. // text:'次',
  1330. // style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  1331. // },
  1332. // lineColor:'#666666',
  1333. // tickColor:'#666666',
  1334. // labels:{
  1335. // formatter:this.value,
  1336. // style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  1337. // }
  1338. // },
  1339. // plotOptions:{
  1340. // area:{
  1341. // stackiung:'normal',
  1342. // lineColor:'#666666',
  1343. // lineWidth:1,
  1344. // marker:{
  1345. // lineWidth:1,
  1346. // lineColor:'#666666'
  1347. // }
  1348. // }
  1349. // },
  1350. // series:[
  1351. // {
  1352. // name:'告警次数',
  1353. // data:ConfirmStore[i].count_list
  1354. // },{
  1355. // name:'处理次数',
  1356. // data:ConfirmStore[i].sum_list
  1357. // }
  1358. // ]
  1359. // });
  1360. // }
  1361. // }
  1362. //}
  1363. //
  1364. //var draw_cycle_icon = function(icon_id,name, total, num, themecolor){
  1365. // var mColor= '#34abf5';//[ '#DDDF0D','#f66167', '#34abf5']
  1366. // var percent = 100;
  1367. // if(total>0)
  1368. // percent = Number(((num*100)/total).toString().match(/^\d+(?:\.\d{0,2})?/));
  1369. // if(percent<60)
  1370. // mColor = '#f66167';
  1371. // else if(percent<80)
  1372. // mColor = '#DDDF0D';
  1373. // $("#"+icon_id+"Title").html('<br/><br/>'+name+percent+'%');
  1374. //
  1375. // Highcharts.chart(icon_id,{
  1376. // chart: {
  1377. // type: 'solidgauge',
  1378. // height: '85%',
  1379. // backgroundColor: 'rgba(0,0,0,0)',
  1380. // reflow:true,
  1381. // marginTop:0
  1382. // },
  1383. // title:{
  1384. // text:percent+'%',
  1385. // floating:true,
  1386. // y:pieWidth/3,
  1387. // style:{fontSize:'14px',color:themecolor,fontWeight:'bold'}
  1388. // },
  1389. // exporting: {
  1390. // enabled: false
  1391. // },
  1392. // credits: {
  1393. // enabled: false
  1394. // },
  1395. // tooltip: {
  1396. // enabled: false
  1397. // },
  1398. // pane: {
  1399. // startAngle: -90,
  1400. // endAngle: 180,
  1401. // background: [{
  1402. // outerRadius: '90%',
  1403. // innerRadius: '60%',
  1404. // backgroundColor: 'rgba(0,0,0,0)',
  1405. // borderWidth: 0
  1406. // }]
  1407. // },
  1408. // yAxis: {
  1409. // min: 0,
  1410. // max: 100,
  1411. // lineWidth: 0,
  1412. // tickPositions: []
  1413. // },
  1414. // plotOptions: {
  1415. // solidgauge: {
  1416. // dataLabels: {
  1417. // enabled: false
  1418. // },
  1419. //// linecap: 'square',
  1420. // stickyTracking: false,
  1421. // rounded: true,
  1422. // warp: false
  1423. // }
  1424. // },
  1425. // series:[{
  1426. // name:'',
  1427. // data:[{
  1428. // color: Highcharts.Color(mColor)
  1429. // .setOpacity(0.2)
  1430. // .get(),
  1431. // radius: '90%',
  1432. // innerRadius: '60%',
  1433. // y: 100
  1434. // },{
  1435. // color: Highcharts.Color(mColor)
  1436. // .setOpacity(0.6)
  1437. // .get(),
  1438. // radius: '90%',
  1439. // innerRadius: '60%',
  1440. // y: percent
  1441. // }]
  1442. // }]
  1443. // });
  1444. // if((theme=='access')||(theme=='')){
  1445. // $('#'+icon_id).addClass('shadow_black');
  1446. // }else{
  1447. // $('#'+icon_id).addClass('shadow_white');
  1448. // }
  1449. //
  1450. //}
  1451. //
  1452. //var draw_confirm = function(){
  1453. // var list = ConfirmStore[0].point_list;
  1454. // var ncount = ConfirmStore[0].list_count;
  1455. //// '<span id="WaterPiePanel_title_string">水系统监控设备电池电量情况</span>'
  1456. // $("#WaterPiePanel_title_string").html(ConfirmStore[0].company_name+'.水系统监控设备通信信号情况');
  1457. // var table = document.createElement("table");
  1458. // table.width="100%";
  1459. // table.border='0';
  1460. // table.style='border:0px solid #000;height:'+(pieWidth*ncount)+'px;';
  1461. // $("#waterArea").html('');
  1462. // document.getElementById("waterArea").appendChild(table);
  1463. // for(var i=0;i<ncount;i++){
  1464. // var tr = document.createElement("tr");
  1465. // tr.height=pieWidth;
  1466. // tr.border='0';
  1467. // tr.style='border:0px solid #000;height:'+(pieWidth*3)/4+'px;'
  1468. // table.appendChild(tr);
  1469. // var td = document.createElement('th');
  1470. // td.height=pieWidth;
  1471. // td.id='pie_title_'+(i+1);
  1472. // td.border='0';
  1473. // td.style='border:0px solid #000;height:'+(pieWidth*3)/4+'px;width:200px;padding:10px;'
  1474. // tr.appendChild(td);
  1475. // var td1 = document.createElement('td');
  1476. // td1.height=pieWidth;
  1477. // td1.id='pie_'+(i+1);
  1478. // td1.border='0';
  1479. // td1.style='border:0px solid #000;height:'+(pieWidth*3)/4+'px;width:'+pieWidth+'px;';
  1480. // tr.appendChild(td1);
  1481. // var td2 = document.createElement('td');
  1482. // td2.height=pieWidth;
  1483. // td2.id='area_'+(i+1);
  1484. // td2.border='0';
  1485. // td2.style='border:0px solid #000;height:'+(pieWidth*3)/4+'px;margin:30px auto 30px auto;';
  1486. // tr.appendChild(td2);
  1487. // }
  1488. // for(var i=0;i<ncount;i++){
  1489. // var point_list = list[i];
  1490. // var themecolor = ((theme=='')||(theme=='access'))?'#ffffff':'#000000';
  1491. // var mColor= '#34abf5';//[ '#DDDF0D','#f66167', '#34abf5']
  1492. // if(point_list.point_data.length==0)
  1493. // point_list.point_data='0';
  1494. // if(point_list.point_data<3)
  1495. // mColor = '#f66167';
  1496. // else if(point_list.point_data<4)
  1497. // mColor = '#DDDF0D';
  1498. // var txt = '<span style="font-weight:bold;">设备名称:</span><span>'+point_list.name+'</span>'
  1499. // +'<br/><span style="font-weight:bold;">最新数值:</span><span style="color:'+mColor+';">'+point_list.point_data+'</span>'
  1500. // +'<br/><span style="font-weight:bold;">采集时间:</span><span style="color:'+mColor+';">'+point_list.data_time+'</span>';
  1501. // $("#pie_title_"+(i+1)).html(txt);
  1502. // Highcharts.chart('pie_'+(i+1),{
  1503. // chart: {
  1504. // type: 'solidgauge',
  1505. // height: '85%',
  1506. // backgroundColor: 'rgba(0,0,0,0)',
  1507. // reflow:true,
  1508. // marginTop:0
  1509. // },
  1510. // title:{
  1511. // text:(point_list.point_data>5?5:point_list.point_data),
  1512. // floating:true,
  1513. // y:pieWidth*.35,
  1514. // style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  1515. // },
  1516. // exporting: {
  1517. // enabled: false
  1518. // },
  1519. // credits: {
  1520. // enabled: false
  1521. // },
  1522. // tooltip: {
  1523. // enabled: false
  1524. // },
  1525. // pane: {
  1526. // startAngle: -90,
  1527. // endAngle: 180,
  1528. // background: [{
  1529. // outerRadius: '70%',
  1530. // innerRadius: '40%',
  1531. // backgroundColor: 'rgba(0,0,0,0)',
  1532. // borderWidth: 0
  1533. // }]
  1534. // },
  1535. // yAxis: {
  1536. // min: 0,
  1537. // max: 100,
  1538. // lineWidth: 0,
  1539. // tickPositions: []
  1540. // },
  1541. // plotOptions: {
  1542. // solidgauge: {
  1543. // dataLabels: {
  1544. // enabled: false
  1545. // },
  1546. // stickyTracking: false,
  1547. // rounded: true,
  1548. // warp: false
  1549. // }
  1550. // },
  1551. // series:[{
  1552. // name:'',
  1553. // data:[{
  1554. // color: Highcharts.Color(mColor)
  1555. // .setOpacity(0.2)
  1556. // .get(),
  1557. // radius: '70%',
  1558. // innerRadius: '40%',
  1559. // y: 100
  1560. // },{
  1561. // color: Highcharts.Color(mColor)
  1562. // .setOpacity(0.6)
  1563. // .get(),
  1564. // radius: '70%',
  1565. // innerRadius: '40%',
  1566. // y: (Number(point_list.point_data>5?5:point_list.point_data)/5)*100
  1567. // }]
  1568. // }]
  1569. // });
  1570. // Highcharts.chart('area_'+(i+1),{
  1571. // chart:{
  1572. // type:'line',
  1573. // backgroundColor: 'rgba(0,0,0,0)'
  1574. // },
  1575. // title:{
  1576. //// floating:true,
  1577. // text:point_list.name+'.通信信号数据跟踪',
  1578. // style:{fontSize:'14px',color:themecolor,fontWeight:'bold'}
  1579. // },
  1580. // legend:{
  1581. //// floating:true,
  1582. // enabled:false,
  1583. // itemStyle:{fontSize:'12px',color:themecolor,fontWeight:'bold'}
  1584. // },
  1585. // colors:[mColor],
  1586. // exporting: {
  1587. // enabled: false
  1588. // },
  1589. // credits: {
  1590. // enabled: false
  1591. // },
  1592. // xAxis:{
  1593. // categories:point_list.time_list,
  1594. // tickmarkPlacement:'on',
  1595. // lineColor:'#666666',
  1596. // tickColor:'#666666',
  1597. // labels:{
  1598. // enabled:false,
  1599. // style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  1600. // },
  1601. // title:{
  1602. // enabled:false
  1603. // }
  1604. // },
  1605. // yAxis:{
  1606. // title:{
  1607. // text:'',
  1608. // style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  1609. // },
  1610. // lineColor:'#666666',
  1611. // tickColor:'#666666',
  1612. // labels:{
  1613. // formatter:this.value,
  1614. // style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  1615. // }
  1616. // },
  1617. // plotOptions:{
  1618. // area:{
  1619. // stackiung:'normal',
  1620. // lineColor:'#666666',
  1621. // lineWidth:1,
  1622. // marker:{
  1623. // lineWidth:1,
  1624. // lineColor:'#666666'
  1625. // }
  1626. // }
  1627. // },
  1628. // series:[
  1629. // {
  1630. // name:'通信信号',
  1631. // data:point_list.data_list
  1632. // }
  1633. // ]
  1634. // });
  1635. // }
  1636. //}
  1637. //
  1638. //var show_datapie = function(record){
  1639. // var query = new Object();
  1640. // query.V_LOGINNAME = V_LOGINNAME;
  1641. // query.V_PASSWORD = V_PASSWORD;
  1642. // query.company_code = record.get('company_code');
  1643. // query.dwtype = '2';
  1644. // query.point_code = '3';
  1645. // $.ajax({
  1646. // type:'POST',
  1647. // url: baseUrl+"iot/data/view/getSyncDataVListByCompany",
  1648. // data: {
  1649. // queryJson : Ext.JSON.encode(query)
  1650. // },
  1651. // success: function(result){
  1652. // var json = eval('(' + result + ')');
  1653. // if(json.action=='getSyncDataVListByCompany'){
  1654. // if(json.check=='true'){
  1655. // ConfirmStore = json.RESULT;
  1656. // draw_confirm();
  1657. // }else{
  1658. // Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function(){
  1659. // window.parent.frames.return_login();
  1660. // });
  1661. // }
  1662. // }
  1663. // pieMask.hide();
  1664. // }
  1665. // });
  1666. //}
  1667. //
  1668. //var getCurrentData = function(){
  1669. // var div = Ext.getCmp('VWaterOptionListPanel');
  1670. // var model = div.getSelectionModel();
  1671. // var record = model.getSelection()[0];
  1672. // show_datapie(record);
  1673. //}
  1674. //
  1675. //Ext.onReady(function(){
  1676. // baseUrl = document.getElementById('basePath').value;
  1677. // theme = document.getElementById('theme').value;
  1678. // company_code = document.getElementById('company_code').value;
  1679. // V_LOGINNAME = $("#V_LOGINNAME").val();
  1680. // V_PASSWORD = $("#V_PASSWORD").val();
  1681. // var currentWidth = document.documentElement.clientWidth;
  1682. // pieWidth = currentWidth/7;
  1683. // var chkIcon = '<img src="'+baseUrl+'res/img/common/check.gif"/>'
  1684. // var unchkIcon = '<img src="'+baseUrl+'res/img/common/uncheck.gif"/>'
  1685. // var countPerPage = 20;
  1686. // var maxHeight = 10000;
  1687. //
  1688. // var chkBoolean = function(flag) {
  1689. // if(flag)
  1690. // return chkIcon;
  1691. // return unchkIcon;
  1692. // }
  1693. // var queryJson = new Object();
  1694. // queryJson.V_LOGINNAME = V_LOGINNAME;
  1695. // queryJson.V_PASSWORD = V_PASSWORD;
  1696. // queryJson.dwtype = '2';
  1697. // queryJson.point_code = '3'
  1698. // var myStore = Ext.create('Ext.data.Store', {
  1699. // model: 'VWaterOption',
  1700. // pageSize: countPerPage,
  1701. // proxy: {
  1702. // type: 'ajax',
  1703. // actionMethods: {
  1704. // create : 'POST',
  1705. // read : 'POST', // by default GET
  1706. // update : 'POST',
  1707. // destroy: 'POST'
  1708. // },
  1709. // url: baseUrl+'iot/data/view/getSyncStatusVListByCompany',
  1710. // reader: {
  1711. // type: 'json',
  1712. // root: 'RESULT',
  1713. // totalProperty: 'totalCount'
  1714. // },
  1715. // extraParams:{
  1716. // queryJson:Ext.JSON.encode(queryJson)
  1717. // }
  1718. // },
  1719. // sorters:[{
  1720. // property:'time',
  1721. // direction:'DESC'
  1722. // }],
  1723. // remoteSort: true
  1724. // });
  1725. // var CompanyStory = Ext.create('Ext.data.Store',{
  1726. // model: 'CompanyComboStore',
  1727. // proxy: {
  1728. // type: 'ajax',
  1729. // actionMethods: {
  1730. // create : 'POST',
  1731. // read : 'POST', // by default GET
  1732. // update : 'POST',
  1733. // destroy: 'POST'
  1734. // },
  1735. // url: baseUrl+'iot/company/view/getNameList',
  1736. // reader: {
  1737. // type: 'json',
  1738. // root: 'RESULT',
  1739. // totalProperty: 'totalCount'
  1740. // },
  1741. // extraParams:{
  1742. // queryJson:Ext.JSON.encode(queryJson)
  1743. // }
  1744. // }
  1745. // });
  1746. // var ClztStory = Ext.create('Ext.data.Store',{
  1747. // fields:['abbr','name'],
  1748. // data:[
  1749. // {'abbr':0,'name':'未处理'},
  1750. // {'abbr':1,'name':'已处理'}
  1751. // ]
  1752. // });
  1753. // var FilterForm = Ext.create('Ext.form.Panel', {
  1754. // id: 'VWaterOptionFilterForm',
  1755. // labelWidth: 55,
  1756. // defaultType: 'textfield',
  1757. // bodyPadding: 15,
  1758. // items: [{
  1759. // xtype:'combo',
  1760. // fieldLabel:'单位名称',
  1761. // id: 'ff_company_code',
  1762. // name:'ff_company_code',
  1763. // displayField : 'owner_name',
  1764. // valueField : 'owner_id',
  1765. // editable : false,
  1766. // width:330,
  1767. // store:CompanyStory
  1768. // },{
  1769. // xtype:'combo',
  1770. // fieldLabel:'处理状态',
  1771. // id: 'ff_clzt',
  1772. // name: 'ff_clzt',
  1773. // displayField : 'name',
  1774. // valueField : 'abbr',
  1775. // editable : false,
  1776. // width:330,
  1777. // store:ClztStory
  1778. // }],
  1779. // buttons: [{
  1780. // text: '筛选',
  1781. // iconCls:'ok_btn',
  1782. // handler: function() {
  1783. // var form = this.up('form').getForm();
  1784. // if (form.isValid()) {
  1785. // var query = new Object();
  1786. //// var tmp = Ext.getCmp('ff_company_code');
  1787. // query.dwtype = '2';
  1788. // query.point_code = '2'
  1789. // if(Ext.getCmp('ff_company_code').getValue().length>0){
  1790. // query.company_code = Ext.getCmp('ff_company_code').getValue();
  1791. // $("#company_code").val(query.company_code);
  1792. // company_code = query.company_code;
  1793. // $("#WaterPiePanel_title_string").html(Ext.getCmp('ff_company_code').getRawValue( )+'.火警系统监控告警处理情况');
  1794. // }else{
  1795. // $("#company_code").val('');
  1796. // $("#WaterPiePanel_title_string").html('火警系统监控告警处理情况');
  1797. // company_code = null;
  1798. // }
  1799. // query.clzt = Ext.getCmp('ff_clzt').getValue()==null?"":Ext.getCmp('ff_clzt').getValue();
  1800. // query.V_LOGINNAME = V_LOGINNAME;
  1801. // query.V_PASSWORD = V_PASSWORD;
  1802. // query.COMMSTATUS = 'NO';
  1803. // var jsonstr = Ext.JSON.encode(query);
  1804. // myStore.getProxy().extraParams = {
  1805. // queryJson : jsonstr
  1806. // };
  1807. // Ext.getCmp('VWaterOptionListPageToolbar').moveFirst();
  1808. // Ext.getCmp('ff_company_code').setValue('');
  1809. // Ext.getCmp('ff_clzt').setValue('');
  1810. // Ext.getCmp('VWaterOptionFilterWin').hide();
  1811. // getCurrentData();
  1812. // }
  1813. // }
  1814. // },{
  1815. // text: '关闭',
  1816. // iconCls: 'cancel_btn',
  1817. // handler: function() {
  1818. // Ext.getCmp('VWaterOptionFilterWin').hide();
  1819. // }
  1820. // }]
  1821. // });
  1822. // var filterwin = function() {
  1823. // Ext.create('Ext.window.Window',{
  1824. // id: 'VWaterOptionFilterWin',
  1825. // title: '水系统报告筛选',
  1826. // height: 210,
  1827. // width: 400,
  1828. // layout: 'fit',
  1829. // items: FilterForm,
  1830. // closable:false,
  1831. // modal:true,
  1832. // closeAction: 'hide'
  1833. // }).show();
  1834. // CompanyStory.reload();
  1835. // }
  1836. // var radiogroup = new Ext.create('Ext.form.RadioGroup',{
  1837. // fieldLabel:'误报',
  1838. // id:'uf_r_clwb',
  1839. // width:300,
  1840. // items:[{
  1841. // name:'uf_r_clwb',
  1842. // inputValue:'1',
  1843. // boxLabel:'是'
  1844. // },{
  1845. // name:'uf_r_clwb',
  1846. // inputValue:'0',
  1847. // boxLabel:'否',
  1848. // checked:true
  1849. // }]
  1850. // });
  1851. // var radiogroup2 = new Ext.create('Ext.form.RadioGroup',{
  1852. // fieldLabel:'处理范围',
  1853. // id:'uf_r_clfw',
  1854. // width:300,
  1855. // items:[{
  1856. // name:'uf_r_clfw',
  1857. // inputValue:'1',
  1858. // boxLabel:'批量'
  1859. // },{
  1860. // name:'uf_r_clfw',
  1861. // inputValue:'0',
  1862. // boxLabel:'单一',
  1863. // checked:true
  1864. // }]
  1865. // });
  1866. // var clear_modify_form = function(){
  1867. // Ext.getCmp('uf_company_name').setValue('');
  1868. // Ext.getCmp('uf_name').setValue('');
  1869. // Ext.getCmp('uf_device_code').setValue('');
  1870. // Ext.getCmp('uf_id').setValue('');
  1871. // Ext.getCmp('uf_status').setValue('');
  1872. // Ext.getCmp('uf_fullname').setValue('');
  1873. // Ext.getCmp('uf_clwb').setValue('');
  1874. // Ext.getCmp('uf_clr').setValue('');
  1875. // Ext.getCmp('uf_clsj').setValue('');
  1876. // Ext.getCmp('uf_clnr').setValue('');
  1877. // }
  1878. // var fireInfoForm = Ext.create('Ext.form.Panel', {
  1879. // id: 'waterInfoForm',
  1880. // labelWidth: 55,
  1881. // url: baseUrl+'iot/alarm/view/updateSj',
  1882. // defaultType: 'textfield',
  1883. // bodyPadding: 15,
  1884. // items: [{
  1885. // fieldLabel:'单位名称',
  1886. // id: 'uf_company_name',
  1887. // name: 'uf_company_name',
  1888. // anchor:'90%'
  1889. // },{
  1890. // fieldLabel:'监控设备',
  1891. // id:'uf_name',
  1892. // name:'uf_name',
  1893. // anchor:'100%'
  1894. // },{
  1895. // fieldLabel:'设备编号',
  1896. // id:'uf_device_code',
  1897. // name:'uf_device_code',
  1898. // hidden: true
  1899. // },{
  1900. // fieldLabel:'记录编号',
  1901. // id:'uf_id',
  1902. // name:'uf_id',
  1903. // hidden: true
  1904. // },{
  1905. // fieldLabel:'设备编号',
  1906. // id:'uf_status',
  1907. // name:'uf_status',
  1908. // hidden: true
  1909. // },{
  1910. // fieldLabel:'报告信息',
  1911. // id: 'uf_fullname',
  1912. // name:'uf_fullname',
  1913. // xtype: 'textareafield',
  1914. // maxLength: 250,
  1915. // cols:4,
  1916. // anchor:'100%'
  1917. // },{
  1918. // fieldLabel:'误报',
  1919. // id: 'uf_clwb',
  1920. // name:'uf_clwb',
  1921. // maxLength: 200,
  1922. // anchor:'65%'
  1923. // },radiogroup,radiogroup2,{
  1924. // fieldLabel:'处理人',
  1925. // id: 'uf_clr',
  1926. // name:'uf_clr',
  1927. // maxLength: 120,
  1928. // anchor:'65%'
  1929. // },{
  1930. // fieldLabel:'处理时间',
  1931. // id: 'uf_clsj',
  1932. // name:'uf_clsj',
  1933. // maxLength: 200,
  1934. // anchor:'80%'
  1935. // },{
  1936. // fieldLabel:'处理内容',
  1937. // id: 'uf_clnr',
  1938. // name:'uf_clnr',
  1939. // xtype: 'textareafield',
  1940. // maxLength: 250,
  1941. // cols:4,
  1942. // anchor:'100%'
  1943. // },{
  1944. // id:'fm_queryJson',
  1945. // name:'queryJson',
  1946. // hidden:true
  1947. // }],
  1948. // buttons: [{
  1949. // text: '处理',
  1950. // id:'confirmBtn',
  1951. // iconCls:'ok_btn',
  1952. // handler: function() {
  1953. // var form = this.up('form').getForm();
  1954. // if (form.isValid()) {
  1955. // var queryJson = new Object();
  1956. // queryJson.V_LOGINNAME = V_LOGINNAME;
  1957. // queryJson.V_PASSWORD = V_PASSWORD;
  1958. // queryJson.id = Ext.getCmp('uf_id').getValue();
  1959. // queryJson.status = Ext.getCmp('uf_status').getValue();
  1960. // queryJson.name = Ext.getCmp('uf_name').getValue();
  1961. // queryJson.device_code = Ext.getCmp('uf_device_code').getValue();
  1962. // queryJson.confirmAll = Ext.getCmp('uf_r_clfw').getChecked()[0].boxLabel=='单一'?'0':'1';
  1963. // queryJson.clwb = Ext.getCmp('uf_r_clwb').getChecked()[0].boxLabel=='否'?'0':'1';
  1964. // queryJson.clnr = Ext.getCmp('uf_clnr').getValue();
  1965. // var jsonstr = Ext.JSON.encode(queryJson);
  1966. // Ext.getCmp('fm_queryJson').setValue(jsonstr);
  1967. // form.submit({
  1968. // method:'post',
  1969. // success: function(form, action) {
  1970. // Ext.Msg.alert('操作成功', '已确认'+action.result.activerow+'条记录', function(btn,txt){
  1971. // clear_modify_form();
  1972. // myStore.reload();
  1973. // getCurrentData();
  1974. // });
  1975. // },
  1976. // failure: function(form, action) {
  1977. // Ext.Msg.alert('操作失败', action.Msg , function(btn,txt){
  1978. // clear_modify_form();
  1979. // myStore.reload();
  1980. // getCurrentData();
  1981. // });
  1982. // }
  1983. // });
  1984. // this.up('window').close();
  1985. // }
  1986. // }
  1987. // },{
  1988. // text: '关闭',
  1989. // iconCls: 'cancel_btn',
  1990. // handler: function() {
  1991. // this.up('window').close();
  1992. // }
  1993. // }]
  1994. // });
  1995. // var vWaterInfoWin = Ext.create('Ext.window.Window',{
  1996. // id:'VWaterInfoWin',
  1997. // title:'详细信息: <span id="VInfoWin_Title"></span>',
  1998. // width:400,
  1999. // layout:'fit',
  2000. // closable:false,
  2001. // modal:true,
  2002. // closeAction:'hide',
  2003. // items:fireInfoForm
  2004. // });
  2005. // var showFireInfoWin = function(record){
  2006. // vWaterInfoWin.show();
  2007. // $("#VInfoWin_Title").html(record.get('data'));
  2008. // Ext.getCmp('uf_company_name').setValue(record.get('company_name'));
  2009. // Ext.getCmp('uf_name').setValue(record.get('name'));
  2010. // Ext.getCmp('uf_device_code').setValue(record.get('device_code'));
  2011. // Ext.getCmp('uf_fullname').setValue(record.get('fullname'));
  2012. // Ext.getCmp('uf_clr').setValue(record.get('clr_name'));
  2013. // Ext.getCmp('uf_clsj').setValue(record.get('clsj'));
  2014. // Ext.getCmp('uf_clnr').setValue(record.get('clnr'));
  2015. // Ext.getCmp('uf_id').setValue(record.get('id'));
  2016. // Ext.getCmp('uf_clwb').setValue(record.get('clwb')=='1'?'误报':'告警');
  2017. // Ext.getCmp('uf_status').setValue(record.get('status'));
  2018. // if(record.get('clzt')=='已处理'){
  2019. // Ext.getCmp('uf_clwb').setVisible(true);
  2020. // Ext.getCmp('uf_r_clwb').setVisible(false);
  2021. // Ext.getCmp('uf_r_clfw').setVisible(false);
  2022. // Ext.getCmp('confirmBtn').setVisible(false);
  2023. // Ext.getCmp('uf_clr').setVisible(true);
  2024. // Ext.getCmp('uf_clsj').setVisible(true);
  2025. // }else{
  2026. // Ext.getCmp('uf_clwb').setVisible(false);
  2027. // Ext.getCmp('uf_r_clwb').setVisible(true);
  2028. // Ext.getCmp('uf_r_clfw').setVisible(true);
  2029. // Ext.getCmp('confirmBtn').setVisible(true);
  2030. // Ext.getCmp('uf_clr').setVisible(false);
  2031. // Ext.getCmp('uf_clsj').setVisible(false);
  2032. // }
  2033. // }
  2034. // var WaterOptionPanel = Ext.create('Ext.grid.Panel', {
  2035. // title: '水系统监控单位列表',
  2036. // titleCollapse:true,
  2037. // id: 'VWaterOptionListPanel',
  2038. // region:'center',
  2039. // store: myStore,
  2040. // columns: [
  2041. // { header: '序号', dataIndex: 'id',width:50, menuDisabled:true },
  2042. // { header: '单位名称', dataIndex: 'company_name',width:240, menuDisabled:true },
  2043. // { header: '详细地址', dataIndex: 'fulladdress', width:640, menuDisabled:true },
  2044. // { header: '单位类型', dataIndex: 'xmlx', width:100, menuDisabled:true },
  2045. // { header: '设备数量', dataIndex: 'list_count', width:80, menuDisabled:true }
  2046. // ],
  2047. // columnLines: true,
  2048. // height: maxHeight,
  2049. // width: '100%',
  2050. // frame: true,
  2051. // border:false,
  2052. // iconCls: 'icon-grid',
  2053. // listeners:{
  2054. // 'celldblclick' : function(grid, td, cellIndex, record, tr, rowIndex, e, eOpts){
  2055. // pieMask.show();
  2056. // show_datapie(record);
  2057. // }
  2058. // }
  2059. // });
  2060. // var piebar = Ext.create('Ext.panel.Panel',{
  2061. // id:'WaterPiePanel',
  2062. // width:'100%',
  2063. // height:pieWidth+50,
  2064. // region:'north',
  2065. // layout:'border',
  2066. // title:'<span id="WaterPiePanel_title_string">水系统监控设备通信信号情况</span>',
  2067. // defaults:{
  2068. // border:false
  2069. // },
  2070. // items:[
  2071. // {
  2072. // region:'east',
  2073. // xtype:'panel',
  2074. // id:'waterArea',
  2075. // style:'overflow:auto',
  2076. // width:currentWidth
  2077. // }
  2078. // ]
  2079. // });
  2080. // pieMask = new Ext.LoadMask(piebar,{msg:"Loading..."});
  2081. // new Ext.create('Ext.panel.Panel',{
  2082. // width:'100%',
  2083. // id: 'WaterAlarmPanel',
  2084. // layout:'border',
  2085. // items:[
  2086. // piebar,WaterOptionPanel
  2087. // ],
  2088. // renderTo: Ext.getBody()
  2089. // });
  2090. // pieMask.show();
  2091. // myStore.addListener('load',function(store,record,opts){
  2092. // pieMask.show();
  2093. // WaterOptionPanel.getSelectionModel().select(0,true);
  2094. // getCurrentData();
  2095. // });
  2096. // myStore.reload();
  2097. // maxHeight = document.documentElement.clientHeight;
  2098. // Ext.getCmp('WaterAlarmPanel').setHeight(maxHeight);
  2099. //
  2100. //});