dataSearch.js 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897
  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 centerLng;
  18. var centerLat;
  19. var company_code;
  20. var theme;
  21. var ConfirmStore
  22. var pieWidth;
  23. var pieMask;
  24. var myMask;
  25. var V_LOGINNAME='',V_PASSWORD='';
  26. var maxHeight = 10000;
  27. var maxWidth = 10000;
  28. var dwtype;
  29. var sm = Ext.create('Ext.selection.CheckboxModel');
  30. Ext.define('VDevices',{
  31. extend: 'Ext.data.Model',
  32. fields: [
  33. { name:'id', type:'int'},
  34. { name:'orderIdx', type:'int'},
  35. { name:'company', type:'string' },
  36. { name:'name', type:'string' },
  37. { name:'device_id', type:'string' },
  38. { name:'data_time', type:'string' },
  39. { name:'point_name', type:'string' },
  40. { name:'point_code', type:'string' },
  41. { name:'point_data', type:'string' },
  42. { name:'device_type', type:'string' },
  43. { name:'company_code', type:'string' },
  44. { name:'dwtype', type:'int' }
  45. ]
  46. });
  47. Ext.define('CompanyComboStore',{
  48. extend:'Ext.data.Model',
  49. fields: [
  50. {name:'owner_name', type:'string'},
  51. {name:'owner_id',type:'string'}
  52. ]
  53. });
  54. //var body_resize = function(){
  55. // maxHeight = document.documentElement.clientHeight;
  56. // maxWidth = document.documentElement.clientWidth;
  57. // Ext.getCmp('DeviceDataPanel').setHeight(maxHeight);
  58. // Ext.getCmp('DeviceDataPanel').setWidth(maxWidth);
  59. //}
  60. var draw_confirm = function(){
  61. // $("#WaterPiePanel_title_string").html(ConfirmStore[0].company+'.'+ConfirmStore[0].name+'.水系统监控设备电池电量情况');
  62. var data_0 = new Array();
  63. var data_1 = new Array();
  64. var data_2 = new Array();
  65. var d_time = new Array();
  66. var tmp_0 = null, tmp_1 = null, tmp_2 = null,tmp_t = null;
  67. var themecolor = ((theme=='')||(theme=='access'))?'#ffffff':'#000000';
  68. if(ConfirmStore==null)
  69. return;
  70. for(var i=0;i<ConfirmStore.length;i++){
  71. var rec = ConfirmStore[i];
  72. if(rec.point_code=='2'){
  73. tmp_0 = parseInt(rec.point_data);
  74. tmp_t = rec.data_time;
  75. data_0.push(tmp_0);
  76. d_time.push(tmp_t);
  77. $("#operation_num_1").html(data_0[0]);
  78. $("#operation_num_2").html(d_time[0]);
  79. }else if(rec.point_code=='3'){
  80. tmp_1 = parseInt(rec.point_data);
  81. tmp_t = rec.data_time;
  82. data_1.push(tmp_1);
  83. d_time.push(tmp_t);
  84. $("#operation_num_1").html(data_1[0]);
  85. $("#operation_num_2").html(d_time[0]);
  86. }else if(rec.point_code=='4'){
  87. // var tmp_2 = Ext.util.Format.number(num,'0.00');
  88. tmp_2 = parseFloat(rec.point_data);
  89. tmp_t = rec.data_time;
  90. data_2.push(tmp_2);
  91. d_time.push(tmp_t);
  92. $("#operation_num_1").html(data_2[0]);
  93. $("#operation_num_2").html(d_time[0]);
  94. }
  95. }
  96. if(rec.point_code=='2'){
  97. var max = data_0[0];
  98. for(var i = 1; i < data_0.length; i++) {
  99. var cur = data_0[i];
  100. cur >= max ? max = cur : null
  101. if(max == cur){
  102. time = d_time[i];
  103. }
  104. }
  105. $("#operation_num_3").html(max);
  106. $("#operation_num_4").html(time);
  107. }else if(rec.point_code=='3'){
  108. var max = data_1[0];
  109. for(var i = 1; i < data_1.length; i++) {
  110. var cur = data_1[i];
  111. cur >= max ? max = cur : null
  112. if(max == cur){
  113. time = d_time[i];
  114. }
  115. }
  116. $("#operation_num_3").html(max);
  117. $("#operation_num_4").html(time);
  118. }else if(rec.point_code=='4'){
  119. var max = data_2[0];
  120. for(var i = 1; i < data_2.length; i++) {
  121. var cur = data_2[i];
  122. cur >= max ? max = cur : null
  123. if(max == cur){
  124. time = d_time[i];
  125. }
  126. }
  127. $("#operation_num_3").html(max);
  128. $("#operation_num_4").html(time);
  129. }
  130. if(rec.point_code=='2'){
  131. var min = data_0[0];
  132. for(var i = 1; i < data_0.length; i++) {
  133. var cur = data_0[i];
  134. cur <= min ? min = cur : null
  135. if(min == cur){
  136. min_time = d_time[i];
  137. }
  138. }
  139. $("#operation_num_5").html(min);
  140. $("#operation_num_6").html(min_time);
  141. }else if(rec.point_code=='3'){
  142. var min = data_1[0];
  143. for(var i = 1; i < data_1.length; i++) {
  144. var cur = data_1[i];
  145. cur <= min ? min = cur : null
  146. if(min == cur){
  147. min_time = d_time[i];
  148. }
  149. }
  150. $("#operation_num_5").html(min);
  151. $("#operation_num_6").html(min_time);
  152. }else if(rec.point_code=='4'){
  153. var min = data_2[0];
  154. // var min_time = d_time[0]
  155. for(var i = 1; i < data_2.length; i++) {
  156. var cur = data_2[i];
  157. cur <= min ? min = cur : null
  158. if(min == cur){
  159. min_time = d_time[i];
  160. }
  161. }
  162. $("#operation_num_5").html(min);
  163. $("#operation_num_6").html(min_time);
  164. }
  165. // $("#operation_num_1").html(data_0[0]);
  166. // $("#operation_num_2").html(data_1[0]);
  167. // $("#operation_num_3").html(d_time[0]);
  168. var mColor1= '#34abf5';//[ '#DDDF0D','#f66167', '#34abf5']
  169. if(data_0[0]<60)
  170. mColor1 = '#f66167';
  171. else if(data_0[0]<80)
  172. mColor1 = '#DDDF0D';
  173. var mColor2= '#34abf5';//[ '#DDDF0D','#f66167', '#34abf5']
  174. if(data_1[0]<3)
  175. mColor2 = '#f66167';
  176. else if(data_1[0]<4)
  177. mColor2 = '#DDDF0D';
  178. Highcharts.getOptions().colors = Highcharts.map([mColor2,mColor2,mColor1,mColor1], function (color) {
  179. return {
  180. radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
  181. stops: [
  182. [0, color],
  183. [1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
  184. ]
  185. };
  186. });
  187. if(rec.point_code=='2'){
  188. Highcharts.chart('operation_area',{
  189. chart:{
  190. type:'area',
  191. // zoomType: 'x',
  192. zoomType: 'xy',
  193. backgroundColor: 'rgba(0,0,0,0)'
  194. },
  195. // color:['#f66167', '#34abf5'],
  196. title:{
  197. // text:(companyName==null)?'水系统监控告警处理情况跟踪':companyName+'.水系统监控告警处理情况跟踪',
  198. text:'水系统近两周数据',
  199. float:true,
  200. style:{fontSize:'14px',color:themecolor,fontWeight:'bold'},
  201. enabled:false
  202. },
  203. legend:{
  204. // enabled:false,
  205. floating:true,
  206. x:410,
  207. y:-230,
  208. itemStyle:{fontSize:'12px',color:themecolor,fontWeight:'bold'}
  209. },
  210. exporting: {
  211. enabled: false
  212. },
  213. credits: {
  214. enabled: false
  215. },
  216. xAxis:[{
  217. categories:d_time,
  218. labels:{
  219. enabled:false
  220. },
  221. crosshair: true
  222. }],
  223. yAxis:[{
  224. title:{
  225. text:'剩余电量',
  226. style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  227. },
  228. gridLineColor:'rgba(0,0,0,0.2)',
  229. labels:{
  230. format:'{value} %',
  231. style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  232. },
  233. max:max+max*0.3,
  234. min:0
  235. }],
  236. tooltip:{
  237. shared:true
  238. },
  239. plotOptions:{
  240. area:{
  241. stackiung:'normal',
  242. marker:{
  243. lineWidth:0,
  244. enabled:false,
  245. radius:0
  246. }
  247. }
  248. },
  249. series:[{
  250. name:'剩余电量',
  251. type: 'area',
  252. data:data_0,
  253. lineWidth:1,
  254. tooltip:{
  255. valueSuffix: ' %'
  256. },
  257. fillColor: {
  258. linearGradient: {
  259. x1: 0,
  260. y1: 0,
  261. x2: 0,
  262. y2: 1
  263. },
  264. stops: [
  265. [0, '#34abf5'],
  266. [1, Highcharts.Color('#34abf5').setOpacity(0.0).get('rgba')]
  267. ]
  268. }
  269. }
  270. ]
  271. });
  272. }else if(rec.point_code=='3'){
  273. Highcharts.chart('operation_area',{
  274. chart:{
  275. type:'area',
  276. // zoomType: 'x',
  277. zoomType: 'xy',
  278. backgroundColor: 'rgba(0,0,0,0)'
  279. },
  280. // color:['#f66167', '#34abf5'],
  281. title:{
  282. // text:(companyName==null)?'水系统监控告警处理情况跟踪':companyName+'.水系统监控告警处理情况跟踪',
  283. text:'水系统近两周数据',
  284. float:true,
  285. style:{fontSize:'14px',color:themecolor,fontWeight:'bold'},
  286. enabled:false
  287. },
  288. legend:{
  289. // enabled:false,
  290. floating:true,
  291. x:410,
  292. y:-230,
  293. itemStyle:{fontSize:'12px',color:themecolor,fontWeight:'bold'}
  294. },
  295. exporting: {
  296. enabled: false
  297. },
  298. credits: {
  299. enabled: false
  300. },
  301. xAxis:[{
  302. categories:d_time,
  303. labels:{
  304. enabled:false
  305. },
  306. crosshair: true
  307. }],
  308. yAxis:[{
  309. title:{
  310. text:'无线信号',
  311. style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  312. },
  313. gridLineColor:'rgba(0,0,0,0.2)',
  314. labels:{
  315. format:'{value} ',
  316. style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  317. },
  318. max:max+max*0.3,
  319. min:0,
  320. // opposite:true
  321. }],
  322. tooltip:{
  323. shared:true
  324. },
  325. plotOptions:{
  326. area:{
  327. stackiung:'normal',
  328. marker:{
  329. lineWidth:0,
  330. enabled:false,
  331. radius:0
  332. }
  333. }
  334. },
  335. series:[{
  336. name:'无线信号',
  337. type: 'area',
  338. // yAxis: 1,
  339. data:data_1,
  340. lineWidth:1,
  341. tooltip:{
  342. valueSuffix: ' '
  343. },
  344. fillColor: {
  345. linearGradient: {
  346. x1: 0,
  347. y1: 0,
  348. x2: 0,
  349. y2: 1
  350. },
  351. stops: [
  352. [0, '#34abf5'],
  353. [1, Highcharts.Color('#34abf5').setOpacity(0.0).get('rgba')]
  354. ]
  355. }
  356. }]
  357. });
  358. }else if(rec.point_code=='4'){
  359. Highcharts.chart('operation_area',{
  360. chart:{
  361. type:'area',
  362. // zoomType: 'x',
  363. zoomType: 'xy',
  364. backgroundColor: 'rgba(0,0,0,0)'
  365. },
  366. // color:['#f66167', '#34abf5'],
  367. title:{
  368. // text:(companyName==null)?'水系统监控告警处理情况跟踪':companyName+'.水系统监控告警处理情况跟踪',
  369. text:'水系统近两周数据',
  370. float:true,
  371. style:{fontSize:'14px',color:themecolor,fontWeight:'bold'},
  372. enabled:false
  373. },
  374. legend:{
  375. // enabled:false,
  376. floating:true,
  377. x:410,
  378. y:-230,
  379. itemStyle:{fontSize:'12px',color:themecolor,fontWeight:'bold'}
  380. },
  381. exporting: {
  382. enabled: false
  383. },
  384. credits: {
  385. enabled: false
  386. },
  387. xAxis:[{
  388. categories:d_time,
  389. labels:{
  390. enabled:false
  391. },
  392. crosshair: true
  393. }],
  394. yAxis:[{
  395. title:{
  396. text:'设备数据值',
  397. style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  398. },
  399. gridLineColor:'rgba(0,0,0,0.2)',
  400. labels:{
  401. format:'{value} ',
  402. style:{fontSize:'10px',color:themecolor,fontWeight:'bold'}
  403. },
  404. max:max+max*0.3,
  405. min:0,
  406. // opposite:true
  407. }],
  408. tooltip:{
  409. shared:true
  410. },
  411. plotOptions:{
  412. area:{
  413. stackiung:'normal',
  414. marker:{
  415. lineWidth:0,
  416. enabled:false,
  417. radius:0
  418. }
  419. }
  420. },
  421. series:[{
  422. name:'设备数据值',
  423. type: 'area',
  424. // yAxis: 1,
  425. data:data_2,
  426. lineWidth:1,
  427. tooltip:{
  428. valueSuffix: ' '
  429. },
  430. fillColor: {
  431. linearGradient: {
  432. x1: 0,
  433. y1: 0,
  434. x2: 0,
  435. y2: 1
  436. },
  437. stops: [
  438. [0, '#34abf5'],
  439. [1, Highcharts.Color('#34abf5').setOpacity(0.0).get('rgba')]
  440. ]
  441. }
  442. }]
  443. });
  444. }
  445. }
  446. var show_datapie = function(record){
  447. if(myStore==null)
  448. return;
  449. var div = Ext.getCmp('VWaterOptionListPanel');
  450. var model = div.getSelectionModel();
  451. var record = model.getSelection()[0];
  452. var themecolor = ((theme=='')||(theme=='access'))?'#ffffff':'#000000';
  453. var nrow = myStore.getCount();
  454. var device_id = record.get('device_id');
  455. var point_code = record.get('point_code');
  456. for(var i=0;i<nrow;i++){
  457. if(myStore.getAt(i).get('device_id')==device_id){
  458. $("#operation_num_1").html('');
  459. $("#operation_num_2").html('');
  460. $("#operation_num_3").html('');
  461. $("#operation_pie").html('');
  462. $("#operation_area").html('');
  463. pieMask.show();
  464. var query = new Object();
  465. // query.V_LOGINNAME = V_LOGINNAME;
  466. // query.V_PASSWORD = V_PASSWORD;
  467. query.device_id = device_id;
  468. query.point_code = point_code;
  469. $.ajax({
  470. type:'POST',
  471. url: baseUrl+"iot/data/view/getSyncDataQList",
  472. data: {
  473. queryJson : Ext.JSON.encode(query)
  474. },
  475. success: function(result){
  476. var json = eval('(' + result + ')');
  477. if(json.action=='getSyncDataVList'){
  478. ConfirmStore = json.RESULT;
  479. draw_confirm();
  480. }
  481. pieMask.hide();
  482. }
  483. });
  484. break;
  485. }
  486. }
  487. // pieMask.hide();
  488. }
  489. var getCurrentData = function(){
  490. var div = Ext.getCmp('VWaterOptionListPanel');
  491. var model = div.getSelectionModel();
  492. var record = model.getSelection()[0];
  493. show_datapie(record);
  494. }
  495. var body_resize = function(){
  496. maxHeight = document.documentElement.clientHeight;
  497. maxWidth = document.documentElement.clientWidth;
  498. Ext.getCmp('WaterAlarmPanel').setHeight(maxHeight);
  499. Ext.getCmp('WaterAlarmPanel').setWidth(maxWidth);
  500. }
  501. function exportbtn_click(){
  502. if(myStore==null)
  503. return;
  504. var div = Ext.getCmp('VWaterOptionListPanel');
  505. var model = div.getSelectionModel();
  506. var record = model.getSelection()[0];
  507. var nrow = myStore.getCount();
  508. var fields = '';
  509. var device_id = record.get('device_id');
  510. var device_type = record.get('device_type');
  511. var point_code = record.get('point_code');
  512. var point_name = record.get('point_name');
  513. var array = ['id','device_id','name','point_code','point_data','company','data_time'];
  514. var name = ['编号','设备编号','设备名称','端口号','数据值','公司名称','添加时间'];
  515. for(var i=0;i<7;i++){
  516. if(i>0)
  517. fields += ',';
  518. fields += '{id:"'+array[i]+'",title:"'+name[i]+'",shown:"'+true+'"}';
  519. }
  520. var query = new Object();
  521. query.device_id = device_id;
  522. query.point_code = point_code;
  523. if(device_type=='水表'&& point_name=='水压/水位'){
  524. query.EXPORT_FILE = '水系统水压数据监控列表';
  525. }else if(device_type=='液位'&& point_name=='水压/水位'){
  526. query.EXPORT_FILE = '水系统水位数据监控列表';
  527. }else{
  528. query.EXPORT_FILE = '水系统'+point_name+'数据监控列表';
  529. }
  530. query.fields = '['+fields+']';
  531. $.ajax({
  532. type:'POST',
  533. url: baseUrl+"iot/excel/view/waterexportexl",
  534. data: {
  535. queryJson : Ext.JSON.encode(query)
  536. },
  537. success: function(result){
  538. var json = eval('(' + result + ')');
  539. if(json.action=='dormExport'){
  540. ConfirmStore = json.RESULT;
  541. var elemIF = document.createElement("iframe");
  542. elemIF.src = baseUrl+json.filename;
  543. elemIF.style.display = "none";
  544. document.body.appendChild(elemIF);
  545. }
  546. }
  547. });
  548. }
  549. Ext.onReady(function(){
  550. baseUrl = document.getElementById('basePath').value;
  551. theme = document.getElementById('theme').value;
  552. company_code = document.getElementById('company_code').value;
  553. $("#V_LOGINNAME").val(sessionStorage.getItem('V_LOGINNAME'));
  554. $("#V_PASSWORD").val(sessionStorage.getItem('V_PASSWORD'));
  555. V_LOGINNAME = $("#V_LOGINNAME").val();
  556. V_PASSWORD = $("#V_PASSWORD").val();
  557. var currentWidth = document.documentElement.clientWidth;
  558. pieWidth = currentWidth/7;
  559. var chkIcon = '<img src="'+baseUrl+'res/img/common/check.gif"/>'
  560. var unchkIcon = '<img src="'+baseUrl+'res/img/common/uncheck.gif"/>'
  561. var countPerPage = 20;
  562. var chkBoolean = function(flag) {
  563. if(flag)
  564. return chkIcon;
  565. return unchkIcon;
  566. }
  567. var queryJson = new Object();
  568. queryJson.V_LOGINNAME = V_LOGINNAME;
  569. // queryJson.V_PASSWORD = V_PASSWORD;
  570. queryJson.COMMSTATUS = 'NO';
  571. if((company_code!=null)&&(company_code!='null')&&(company_code.length>0))
  572. queryJson.company_code = company_code;
  573. myStore = Ext.create('Ext.data.Store', {
  574. model: 'VDevices',
  575. pageSize: countPerPage,
  576. proxy: {
  577. type: 'ajax',
  578. actionMethods: {
  579. create : 'POST',
  580. read : 'POST', // by default GET
  581. update : 'POST',
  582. destroy: 'POST'
  583. },
  584. url: baseUrl+'iot/data/view/getSyncwaterDataVList',
  585. reader: {
  586. type: 'json',
  587. root: 'RESULT',
  588. totalProperty: 'totalCount'
  589. },
  590. extraParams:{
  591. queryJson:Ext.JSON.encode(queryJson)
  592. }
  593. },
  594. sorters:[{
  595. property:'data_time',
  596. direction:'DESC'
  597. }],
  598. remoteSort: true
  599. });
  600. var CompanyStory = Ext.create('Ext.data.Store',{
  601. model: 'CompanyComboStore',
  602. proxy: {
  603. type: 'ajax',
  604. actionMethods: {
  605. create : 'POST',
  606. read : 'POST', // by default GET
  607. update : 'POST',
  608. destroy: 'POST'
  609. },
  610. url: baseUrl+'iot/company/view/getNameList',
  611. reader: {
  612. type: 'json',
  613. root: 'RESULT',
  614. totalProperty: 'totalCount'
  615. },
  616. extraParams:{
  617. queryJson:Ext.JSON.encode(queryJson)
  618. }
  619. }
  620. });
  621. var ClztStory = Ext.create('Ext.data.Store',{
  622. fields:['abbr','name'],
  623. data:[
  624. {'abbr':0,'name':'未处理'},
  625. {'abbr':1,'name':'已处理'}
  626. ]
  627. });
  628. var FilterForm = Ext.create('Ext.form.Panel', {
  629. id: 'VFireOptionFilterForm',
  630. labelWidth: 55,
  631. defaultType: 'textfield',
  632. bodyPadding: 15,
  633. items: [{
  634. xtype:'combo',
  635. fieldLabel:'单位名称',
  636. id: 'ff_company_code',
  637. name:'company_code',
  638. displayField : 'owner_name',
  639. valueField : 'owner_id',
  640. editable : false,
  641. width:330,
  642. store:CompanyStory
  643. },{
  644. xtype:'datefield',
  645. fieldLabel:"开始日期",
  646. minValue:'07/07/2017',
  647. minText:"当前日期选择应大于当天日期",
  648. format:"Y-m-d",
  649. columnWidth:0.5,
  650. id: 'ff_start_data',
  651. name:"ff_start_data",
  652. editable:false,//只读约束
  653. width:330
  654. },{
  655. xtype:'datefield',
  656. fieldLabel:"结束日期",
  657. minValue:'07/07/2017',
  658. minText:"当前日期选择应大于当天日期",
  659. format:"Y-m-d",
  660. columnWidth:0.5,
  661. id: 'ff_end_data',
  662. name:"ff_end_data",
  663. editable:false,//只读约束
  664. width:330
  665. },{
  666. fieldLabel:'设备名称',
  667. id: 'ff_clzt',
  668. name: 'clzt',
  669. maxLength: 30,
  670. maxLengthText:'长度不得超出{0}',
  671. width:330
  672. }],
  673. buttons: [{
  674. text: '筛选',
  675. iconCls:'ok_btn',
  676. handler: function() {
  677. var form = this.up('form').getForm();
  678. if (form.isValid()) {
  679. var query = new Object();
  680. // var tmp = Ext.getCmp('ff_company_code');
  681. if(Ext.getCmp('ff_company_code').getValue()){
  682. query.company_code = Ext.getCmp('ff_company_code').getValue();
  683. $("#company_code").val(query.company_code);
  684. company_code = query.company_code;
  685. $("#FirePiePanel_title_string").html(Ext.getCmp('ff_company_code').getRawValue( )+'.监测设备列表');
  686. }else{
  687. $("#company_code").val('');
  688. $("#FirePiePanel_title_string").html('监测设备列表');
  689. company_code = null;
  690. }
  691. if(Ext.getCmp('ff_clzt').getValue()){
  692. query.name = Ext.getCmp('ff_clzt').getValue();
  693. $("#clzt").val(query.name);
  694. }else{
  695. $("#clzt").val('');
  696. }
  697. if(Ext.getCmp('ff_start_data').getValue()){
  698. query.time_start = Ext.getCmp('ff_start_data').getValue();
  699. var datetime=query.time_start.getFullYear() + '-' + (query.time_start.getMonth() + 1) + '-' + query.time_start.getDate() + ' ' + query.time_start.getHours() + ':' + query.time_start.getMinutes() + ':' + query.time_start.getSeconds();
  700. $("#time_start").val(datetime);
  701. }else{
  702. $("#time_start").val('');
  703. }
  704. if(Ext.getCmp('ff_end_data').getValue()){
  705. query.time_end = Ext.getCmp('ff_end_data').getValue();
  706. var datetime1=query.time_end.getFullYear() + '-' + (query.time_end.getMonth() + 1) + '-' + query.time_end.getDate() + ' ' + query.time_end.getHours() + ':' + query.time_end.getMinutes() + ':' + query.time_end.getSeconds();
  707. $("#time_end").val(datetime1);
  708. }else{
  709. $("#time_end").val('');
  710. }
  711. // query.name = Ext.getCmp('ff_clzt').getValue()==null?"":Ext.getCmp('ff_clzt').getValue();
  712. // query.V_LOGINNAME = V_LOGINNAME;
  713. // query.V_PASSWORD = V_PASSWORD;
  714. query.COMMSTATUS = 'NO';
  715. var jsonstr = Ext.JSON.encode(query);
  716. myStore.getProxy().extraParams = {
  717. queryJson : jsonstr
  718. };
  719. Ext.getCmp('VFireOptionListPageToolbar').moveFirst();
  720. Ext.getCmp('ff_company_code').setValue('');
  721. Ext.getCmp('ff_clzt').setValue('');
  722. Ext.getCmp('VFireOptionFilterWin').hide();
  723. }
  724. }
  725. },{
  726. text: '关闭',
  727. iconCls: 'cancel_btn',
  728. handler: function() {
  729. Ext.getCmp('VFireOptionFilterWin').hide();
  730. }
  731. }]
  732. });
  733. var filterwin = function() {
  734. if(Ext.getCmp('VFireOptionFilterWin')==undefined){
  735. Ext.create('Ext.window.Window',{
  736. id: 'VFireOptionFilterWin',
  737. title: '监测设备筛选',
  738. height: 210,
  739. width: 400,
  740. layout: 'fit',
  741. items: FilterForm,
  742. closable:false,
  743. modal:true,
  744. closeAction: 'hide'
  745. }).show();
  746. }else
  747. Ext.getCmp('VFireOptionFilterWin').show();
  748. CompanyStory.reload();
  749. }
  750. var WaterOptionPanel = Ext.create('Ext.grid.Panel', {
  751. header :{
  752. height:0,
  753. border:'0px solid #000000'
  754. },
  755. titleCollapse:true,
  756. id: 'VWaterOptionListPanel',
  757. region:'center',
  758. store: myStore,
  759. columns: [
  760. { header: 'id', dataIndex:'id',hidden:true, menuDisabled:true},
  761. { header: '序号', dataIndex: 'orderIdx',width:50, menuDisabled:true },
  762. { header: '单位名称', dataIndex: 'company',width:240, menuDisabled:true },
  763. { header: '设备名称', dataIndex: 'name', width:240, menuDisabled:true },
  764. { header: '设备编号', dataIndex: 'device_id', width:240, menuDisabled:true },
  765. { header: '设备类型', dataIndex: 'device_type', width:240, menuDisabled:true },
  766. { header: '端口名称', dataIndex: 'point_name', width:230, menuDisabled:true },
  767. { header: '端口编号', dataIndex: 'point_code', width:100, menuDisabled:true },
  768. { header: '数据上传时间', dataIndex: 'data_time', width:560,minWidth:400, maxWidth:1600,menuDisabled:true }
  769. // { header: '处理状态', dataIndex: 'clzt', width:100, menuDisabled:true },
  770. // { header: '处理人', dataIndex: 'clr_name',width:150, menuDisabled:true },
  771. // { header: '处理时间', dataIndex: 'clsj', width:160, menuDisabled:true }
  772. ],
  773. columnLines: true,
  774. height: maxHeight,
  775. width: '100%',
  776. tbar: new Ext.create('Ext.toolbar.Toolbar',{
  777. items:[{
  778. html:'<span id="FirePiePanel_title_string" style="color:#ffffff;background-color:rgba(0,0,0,0)">监测设备列表</span>'
  779. },'->',{
  780. xtype: 'button',
  781. iconCls:'back_btn',
  782. text: '<span style="color:#ffffff;background-color:rgba(0,0,0,0)">返回</span>',
  783. listeners: {
  784. click: function(){
  785. location.href=baseUrl+'view/frontpage/map.jsp?&theme='+theme+'&company_code='+company_code;
  786. }
  787. }
  788. },'-',
  789. {
  790. xtype: 'button',
  791. iconCls:'filter_btn',
  792. text: '<span style="color:#ffffff;background-color:rgba(0,0,0,0)">筛选</span>',
  793. listeners: {
  794. click: filterwin
  795. }
  796. },'-',
  797. {
  798. xtype: 'button',
  799. iconCls:'filter_btn',
  800. text: '<span style="color:#ffffff;background-color:rgba(0,0,0,0)">导出</span>',
  801. listeners: {
  802. click: exportbtn_click
  803. }
  804. },'-']
  805. }),
  806. bbar: new Ext.PagingToolbar({
  807. store: myStore,
  808. id:'VFireOptionListPageToolbar',
  809. displayInfo: true,
  810. pageSize: countPerPage,
  811. prependButtons: true,
  812. displayMsg : '显示第 {0}条到 {1}条记录,总共 {2}条',
  813. emptyMsg : "没有记录",
  814. firstText: '第一页',
  815. prevText: '前一页',
  816. nextText: '后一页',
  817. lastText: '最后一页',
  818. refreshText: '刷新'
  819. }),
  820. frame: true,
  821. border:false,
  822. iconCls: 'icon-grid',
  823. listeners:{
  824. 'celldblclick' : function(grid, td, cellIndex, record, tr, rowIndex, e, eOpts){
  825. show_datapie(record);
  826. }
  827. }
  828. });
  829. // myStore.reload();
  830. // getCurrentData();
  831. var piebar = Ext.create('Ext.panel.Panel',{
  832. id:'FirePiePanel',
  833. width:'100%',
  834. height:498,
  835. region:'north',
  836. layout:'border',
  837. defaults:{
  838. border:false
  839. },
  840. html:'<div id="operation_body" class="operation_body"><div id="operation_dock_l" class="operation_dock_l"></div><div id="operation_dock_r" class="operation_dock_r"></div><img id="operation_title_icon" class="operation_title_icon" width="48" height="48" src="../../res/img/icons/2.png"/><div id="operation_title_text" class="operation_title_text">水系统数据情况</div><div id="operation_label_1" class="operation_label_11">最新数据</div><div id="operation_label_2" class="operation_label_12">最大数据</div><div id="operation_label_3" class="operation_label_13">最小数据</div><div id="operation_label_4" class="operation_label_14">时间</div><div id="operation_label_5" class="operation_label_15">时间</div><div id="operation_label_6" class="operation_label_16">时间</div><div id="operation_num_1" class="operation_num_11"></div><div id="operation_num_2" class="operation_num_12"></div><div id="operation_num_3" class="operation_num_13"></div><div id="operation_num_4" class="operation_num_14"></div><div id="operation_num_5" class="operation_num_15"></div><div id="operation_num_6" class="operation_num_16"></div><div id="operation_area_bg" class="operation_area_bg"></div><div id="operation_area" class="operation_area"></div></div>'
  841. });
  842. pieMask = new Ext.LoadMask(piebar,{msg:"Loading..."});
  843. myMask = new Ext.LoadMask(document.body,{msg:"Loading..."});
  844. new Ext.create('Ext.panel.Panel',{
  845. width:'100%',
  846. id: 'WaterAlarmPanel',
  847. layout:'border',
  848. items:[
  849. piebar,WaterOptionPanel
  850. ],
  851. renderTo: Ext.getBody()
  852. });
  853. pieMask.show();
  854. myStore.addListener('load',function(store,record,opts){
  855. pieMask.show();
  856. WaterOptionPanel.getSelectionModel().select(0,true);
  857. getCurrentData();
  858. });
  859. myStore.reload();
  860. $(window).resize(function(){
  861. body_resize();
  862. });
  863. body_resize();
  864. });