videoOption.js 52 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366
  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 StatusStore;
  15. var baseUrl;
  16. var centerLng;
  17. var centerLat;
  18. var company_code;
  19. var theme;
  20. var dwtype;
  21. var ConfirmStore;
  22. var pieWidth;
  23. var showAlarm = null;
  24. var pieMask;
  25. var V_LOGINNAME = '', V_PASSWORD = '';
  26. var maxHeight = 10000;
  27. var maxWidth = 10000;
  28. var companyName = null;
  29. var sm = Ext.create('Ext.selection.CheckboxModel');
  30. Ext.define('VRtuOption', {
  31. extend: 'Ext.data.Model',
  32. fields: [
  33. {name: 'id', type: 'int'},
  34. {name: 'orderIdx', type: 'int'},
  35. {name: 'device_code', type: 'string'},
  36. {name: 'company_code', type: 'string'},
  37. {name: 'company_name', type: 'string'},
  38. {name: 'fullname', type: 'string'},
  39. {name: 'time', type: 'string'},
  40. {name: 'ncmd', type: 'string'},
  41. {name: 'name', type: 'string'},
  42. {name: 'status', type: 'string'},
  43. {name: 'data', type: 'string'},
  44. {name: 'data4', type: 'string'},
  45. {name: 'clzt', type: 'string'},
  46. {name: 'clr_name', type: 'string'},
  47. {name: 'clsj', type: 'string'},
  48. {name: 'clnr', type: 'string'},
  49. {name: 'dwtype', type: 'string'},
  50. {name: 'clwb', type: 'string'}
  51. ]
  52. });
  53. Ext.define('CompanyComboStore', {
  54. extend: 'Ext.data.Model',
  55. fields: [
  56. {name: 'owner_name', type: 'string'},
  57. {name: 'owner_id', type: 'string'}
  58. ]
  59. });
  60. var drawDevices = function () {
  61. // alert('get device info');
  62. if (StatusStore.length > 0) {
  63. var current_device_id = '';
  64. var device_count = 0;
  65. var fire_device_count = 0;
  66. var water_device_count = 0;
  67. var rtu_device_count = 0;
  68. var other_device_count = 0;
  69. var fire_device_out = 0;
  70. var water_device_out = 0;
  71. var rtu_device_out = 0;
  72. var other_device_out = 0;
  73. var fire_device_alarm = 0;
  74. var water_device_alarm = 0;
  75. var rtu_device_alarm = 0;
  76. var other_device_alarm = 0;
  77. var fire_device_normal = 0;
  78. var water_device_normal = 0;
  79. var rtu_device_normal = 0;
  80. var other_device_normal = 0;
  81. var total_normal = 0;
  82. var mark_array = new Array();
  83. for (var i = 0; i < StatusStore.length; i++) {
  84. if ((StatusStore[i].point_list != null)
  85. && (StatusStore[i].point_list != undefined)
  86. && (StatusStore[i].point_list.length > 0)) {
  87. for (var j = 0; j < StatusStore[i].point_list.length; j++) {
  88. if (StatusStore[i].point_list[j].device_id != current_device_id) {
  89. current_device_id = StatusStore[i].point_list[j].device_id;
  90. device_count++;
  91. if ((StatusStore[i].point_list[j].dwtype == '1')
  92. || (StatusStore[i].point_list[j].dwtype == 1))
  93. fire_device_count++;
  94. else if ((StatusStore[i].point_list[j].dwtype == '2')
  95. || (StatusStore[i].point_list[j].dwtype == 2))
  96. water_device_count++;
  97. else if ((StatusStore[i].point_list[j].dwtype == '3')
  98. || (StatusStore[i].point_list[j].dwtype == 3))
  99. other_device_count++;
  100. else if ((StatusStore[i].point_list[j].dwtype == '4')
  101. || (StatusStore[i].point_list[j].dwtype == 4))
  102. water_device_count++;
  103. else if ((StatusStore[i].point_list[j].dwtype == '5')
  104. || (StatusStore[i].point_list[j].dwtype == 5))
  105. water_device_count++;
  106. else if ((StatusStore[i].point_list[j].dwtype == '6')
  107. || (StatusStore[i].point_list[j].dwtype == 6))
  108. rtu_device_count++;
  109. else
  110. other_device_count++;
  111. }
  112. if ((StatusStore[i].point_list[j].point_code == '0')
  113. || (StatusStore[i].point_list[j].point_code == 0)) {
  114. if ((StatusStore[i].point_list[j].point_data != '0')
  115. && (StatusStore[i].point_list[j].point_data != 0)) {
  116. if ((StatusStore[i].point_list[j].dwtype == '1')
  117. || (StatusStore[i].point_list[j].dwtype == 1))
  118. fire_device_alarm++;
  119. else if ((StatusStore[i].point_list[j].dwtype == '2')
  120. || (StatusStore[i].point_list[j].dwtype == 2)) {
  121. if ((StatusStore[i].point_list[j].point_data == '4')
  122. || (StatusStore[i].point_list[j].point_data == 4))
  123. water_device_out++;
  124. else
  125. water_device_alarm++;
  126. }
  127. else if ((StatusStore[i].point_list[j].dwtype == '3')
  128. || (StatusStore[i].point_list[j].dwtype == 3))
  129. other_device_out++;
  130. else if ((StatusStore[i].point_list[j].dwtype == '4')
  131. || (StatusStore[i].point_list[j].dwtype == 4))
  132. if ((StatusStore[i].point_list[j].point_data == '4')
  133. || (StatusStore[i].point_list[j].point_data == 4))
  134. water_device_out++;
  135. else
  136. water_device_alarm++;
  137. else if ((StatusStore[i].point_list[j].dwtype == '5')
  138. || (StatusStore[i].point_list[j].dwtype == 5))
  139. if ((StatusStore[i].point_list[j].point_data == '4')
  140. || (StatusStore[i].point_list[j].point_data == 4))
  141. water_device_out++;
  142. else
  143. water_device_alarm++;
  144. else if ((StatusStore[i].point_list[j].dwtype == '6')
  145. || (StatusStore[i].point_list[j].dwtype == 6))
  146. rtu_device_out++;
  147. else
  148. other_device_out++;
  149. }
  150. }
  151. }
  152. }
  153. }
  154. fire_device_normal = fire_device_count - fire_device_out - fire_device_alarm;
  155. water_device_normal = water_device_count - water_device_out - water_device_alarm;
  156. rtu_device_normal = rtu_device_count - rtu_device_out - rtu_device_alarm;
  157. other_device_normal = other_device_count - other_device_out - other_device_alarm;
  158. total_normal = fire_device_normal + water_device_normal + rtu_device_normal + other_device_normal;
  159. var themecolor = ((theme == '') || (theme == 'access')) ? '#ffffff' : '#000000';
  160. draw_cycle_icon('firePie1', '设备在线<br/> <br/>监控总数:<span style="color:#DDDF0D;text-shadow: 1px 1px 2px #888, 0 0 0 #000">' + rtu_device_count + '</span><br/>在线总数:<span style="color:#34abf5;text-shadow: 1px 1px 2px #888, 0 0 0 #000">' + (rtu_device_count - rtu_device_out) + '</span><br/>离线线总数:<span style="color:#DF5353;text-shadow: 1px 1px 2px #888, 0 0 0 #000">' + rtu_device_out + '<br/>在线率:', rtu_device_count, (rtu_device_count - rtu_device_out), themecolor);
  161. draw_cycle_icon('firePie2', '状态正常<br/> <br/>在线总数:<span style="color:#DDDF0D;text-shadow: 1px 1px 2px #888, 0 0 0 #000">' + (rtu_device_count - rtu_device_out) + '</span><br/>正常总数:<span style="color:#34abf5;text-shadow: 1px 1px 2px #888, 0 0 0 #000">' + rtu_device_normal + '</span><br/>告警总数:<span style="color:#DF5353;text-shadow: 1px 1px 2px #888, 0 0 0 #000">' + rtu_device_alarm + '<br/>正常率:', (rtu_device_count - rtu_device_out), rtu_device_normal, themecolor);
  162. }
  163. }
  164. var draw_confirm = function () {
  165. var themecolor = ((theme == '') || (theme == 'access')) ? '#ffffff' : '#000000';
  166. if (companyName != null)
  167. $("#RtuPiePanel_title_string").html(companyName + '视频监控报告列表');
  168. else
  169. $("#RtuPiePanel_title_string").html('视频监控报告列表');
  170. for (var i = 0; i < ConfirmStore.length; i++) {
  171. if (ConfirmStore[i].id == 'rtu_alarm') {
  172. var mColor = '#34abf5';//[ '#DDDF0D','#f66167', '#34abf5']
  173. var percent = 100;
  174. if (ConfirmStore[i].count > 0)
  175. percent = Number(((ConfirmStore[i].sum * 100) / ConfirmStore[i].count).toString().match(/^\d+(?:\.\d{0,2})?/));
  176. if (percent < 60)
  177. mColor = '#f66167';
  178. else if (percent < 80)
  179. mColor = '#DDDF0D';
  180. $("#operation_num_1").html(ConfirmStore[i].count);
  181. $("#operation_num_2").html(ConfirmStore[i].sum);
  182. $("#operation_num_3").html(ConfirmStore[i].count - ConfirmStore[i].sum);
  183. $("#operation_num_4").html(percent);
  184. // draw_cycle_icon('firePie3','告警处理情况<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);
  185. Highcharts.getOptions().colors = Highcharts.map(['#DDDF0D', mColor], function (color) {
  186. return {
  187. radialGradient: {cx: 0.5, cy: 0.3, r: 0.7},
  188. stops: [
  189. [0, color],
  190. [1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
  191. ]
  192. };
  193. });
  194. Highcharts.chart('operation_pie', {
  195. chart: {
  196. type: 'solidgauge',
  197. height: '100%',
  198. backgroundColor: 'rgba(0,0,0,0)',
  199. animation: false
  200. },
  201. title: {
  202. text: percent + '%',
  203. floating: true,
  204. y: 90,
  205. style: {fontSize: '16px', color: themecolor, fontWeight: 'bold'}
  206. },
  207. exporting: {
  208. enabled: false
  209. },
  210. credits: {
  211. enabled: false
  212. },
  213. tooltip: {
  214. enabled: false
  215. },
  216. pane: {
  217. startAngle: 0,
  218. background: [{
  219. outerRadius: '110%',
  220. innerRadius: '55%',
  221. backgroundColor: 'rgba(0,0,0,0)',
  222. borderWidth: 0
  223. }]
  224. },
  225. yAxis: {
  226. min: 0,
  227. max: 100,
  228. lineWidth: 0,
  229. tickPositions: []
  230. },
  231. plotOptions: {
  232. solidgauge: {
  233. dataLabels: {
  234. enabled: false
  235. },
  236. linecap: 'square',
  237. stickyTracking: false,
  238. rounded: false,
  239. warp: false
  240. },
  241. series: {
  242. animation: false
  243. }
  244. },
  245. series: [{
  246. name: name,
  247. data: [{
  248. color: 'rgba(0,0,0,0.3)',
  249. radius: '110%',
  250. innerRadius: '60%',
  251. y: 100
  252. }, {
  253. color: (Highcharts.theme && Highcharts.theme.contrastTextColor),
  254. radius: '110%',
  255. innerRadius: '60%',
  256. y: percent
  257. }]
  258. }]
  259. });
  260. Highcharts.getOptions().colors = Highcharts.map(['#f66167', '#34abf5'], function (color) {
  261. return {
  262. linearGradient: {x1: 0, x2: 0, y1: 0, y2: 1},
  263. stops: [
  264. [0, color],
  265. [1, Highcharts.Color(color).setOpacity(0).get('rgb')] // darken
  266. ]
  267. };
  268. });
  269. Highcharts.chart('operation_area', {
  270. chart: {
  271. type: 'area',
  272. // zoomType: 'x',
  273. backgroundColor: 'rgba(0,0,0,0)'
  274. },
  275. color: ['#f66167', '#34abf5'],
  276. title: {
  277. text: (companyName != null) ? companyName + '.视频监控告警处理情况跟踪' : '视频监控告警处理情况跟踪',
  278. float: true,
  279. style: {fontSize: '14px', color: themecolor, fontWeight: 'bold'},
  280. enabled: false
  281. },
  282. legend: {
  283. // enabled:false,
  284. floating: true,
  285. x: 410,
  286. y: -230,
  287. itemStyle: {fontSize: '12px', color: themecolor, fontWeight: 'bold'}
  288. },
  289. // colors:['#f66167', '#34abf5'],
  290. exporting: {
  291. enabled: false
  292. },
  293. credits: {
  294. enabled: false
  295. },
  296. xAxis: {
  297. categories: ConfirmStore[i].day_list,
  298. tickmarkPlacement: 'on',
  299. gridLineWidth: 0,
  300. labels: {
  301. enabled: false,
  302. style: {fontSize: '10px', color: themecolor, fontWeight: 'bold'}
  303. },
  304. title: {
  305. enabled: false
  306. }
  307. },
  308. yAxis: {
  309. title: {
  310. enabled: false,
  311. text: '次',
  312. style: {fontSize: '10px', color: themecolor, fontWeight: 'bold'}
  313. },
  314. gridLineWidth: 1,
  315. gridLineColor: 'rgba(0,0,0,0.2)',
  316. labels: {
  317. // enabled:false,
  318. formatter: this.value,
  319. style: {fontSize: '10px', color: themecolor, fontWeight: 'bold'}
  320. }
  321. },
  322. plotOptions: {
  323. area: {
  324. stackiung: 'normal',
  325. // fillOpacity:0.1,
  326. // lineColor:'#666666',
  327. // lineWidth:1,
  328. marker: {
  329. lineWidth: 0,
  330. enabled: false,
  331. radius: 0
  332. // lineColor:'#666666'
  333. }
  334. }
  335. },
  336. series: [
  337. {
  338. name: '告警次数',
  339. data: ConfirmStore[i].count_list,
  340. lineWidth: 1,
  341. lineColor: '#f66167',
  342. fillColor: {
  343. linearGradient: {
  344. x1: 0,
  345. y1: 0,
  346. x2: 0,
  347. y2: 1
  348. },
  349. stops: [
  350. [0, '#f66167'],
  351. [1, Highcharts.Color('#f66167').setOpacity(0.3).get('rgba')]
  352. ]
  353. }
  354. }, {
  355. name: '处理次数',
  356. data: ConfirmStore[i].sum_list,
  357. lineWidth: 1,
  358. lineColor: '#34abf5',
  359. fillColor: {
  360. linearGradient: {
  361. x1: 0,
  362. y1: 0,
  363. x2: 0,
  364. y2: 1
  365. },
  366. stops: [
  367. [0, '#34abf5'],
  368. [1, Highcharts.Color('#34abf5').setOpacity(0.3).get('rgba')]
  369. ]
  370. },
  371. }
  372. ]
  373. });
  374. }
  375. }
  376. }
  377. var draw_cycle_icon = function (icon_id, name, total, num, themecolor) {
  378. var mColor = '#34abf5';//[ '#DDDF0D','#f66167', '#34abf5']
  379. var percent = 100;
  380. if (total > 0)
  381. percent = Number(((num * 100) / total).toString().match(/^\d+(?:\.\d{0,2})?/));
  382. if (percent < 60)
  383. mColor = '#f66167';
  384. else if (percent < 80)
  385. mColor = '#DDDF0D';
  386. $("#" + icon_id + "Title").html('<br/><br/>' + name + percent + '%');
  387. Highcharts.getOptions().colors = Highcharts.map(['#000000', mColor, mColor], function (color) {
  388. return {
  389. radialGradient: {cx: 0.5, cy: 0.3, r: 0.7},
  390. stops: [
  391. [0, color],
  392. [1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
  393. ]
  394. };
  395. });
  396. Highcharts.chart(icon_id, {
  397. chart: {
  398. type: 'solidgauge',
  399. height: '85%',
  400. backgroundColor: 'rgba(0,0,0,0)',
  401. reflow: true,
  402. marginTop: 0
  403. },
  404. title: {
  405. text: percent + '%',
  406. floating: true,
  407. y: (pieWidth * 2 / 5),
  408. style: {fontSize: '21px', color: themecolor, fontWeight: 'bold'}
  409. },
  410. exporting: {
  411. enabled: false
  412. },
  413. credits: {
  414. enabled: false
  415. },
  416. tooltip: {
  417. enabled: false
  418. },
  419. pane: {
  420. startAngle: -90,
  421. endAngle: 270,
  422. background: [{
  423. outerRadius: '90%',
  424. innerRadius: '60%',
  425. backgroundColor: 'rgba(0,0,0,0)',
  426. borderWidth: 0
  427. }]
  428. },
  429. yAxis: {
  430. min: 0,
  431. max: 100,
  432. lineWidth: 0,
  433. tickPositions: []
  434. },
  435. plotOptions: {
  436. solidgauge: {
  437. dataLabels: {
  438. enabled: false
  439. },
  440. linecap: 'square',
  441. stickyTracking: false,
  442. rounded: false,
  443. warp: false
  444. }
  445. },
  446. series: [{
  447. name: '',
  448. data: [{
  449. color: Highcharts.Color(mColor)
  450. .setOpacity(0.2)
  451. .get(),
  452. radius: '110%',
  453. innerRadius: '80%',
  454. y: 100
  455. }, {
  456. color: (Highcharts.theme && Highcharts.theme.contrastTextColor),
  457. radius: '110%',
  458. innerRadius: '80%',
  459. y: percent
  460. }, {
  461. color: (Highcharts.theme && Highcharts.theme.contrastTextColor),
  462. radius: '60%',
  463. innerRadius: '0%',
  464. y: 100
  465. }]
  466. }]
  467. });
  468. if ((theme == 'access') || (theme == '')) {
  469. $('#' + icon_id).addClass('shadow_black');
  470. } else {
  471. $('#' + icon_id).addClass('shadow_white');
  472. }
  473. }
  474. var getCurrentData = function () {
  475. var query = new Object();
  476. // query.V_LOGINNAME = V_LOGINNAME;
  477. // query.V_PASSWORD = V_PASSWORD;
  478. query.dwtype = '16';
  479. query.COMMSTATUS = 'NO';
  480. if ((company_code != null) && (company_code != 'null') && (company_code.length > 0))
  481. query.company_code = company_code;
  482. pieMask.show();
  483. $.ajax({
  484. type: 'POST',
  485. url: baseUrl + "iot/alarm/view/getConfirmStatusByDays",
  486. data: {
  487. queryJson: Ext.JSON.encode(query)
  488. },
  489. success: function (result) {
  490. var json = eval('(' + result + ')');
  491. if (json.action == 'getConfirmStatusByDays') {
  492. if (json.check == 'true') {
  493. ConfirmStore = json.RESULT;
  494. if (json.company_name != null)
  495. companyName = json.company_name;
  496. else
  497. companyName = null;
  498. draw_confirm();
  499. } else {
  500. Ext.Msg.alert('错误信息', '访问权限错误,请重新登录', function () {
  501. window.parent.document.location = baseUrl;
  502. });
  503. }
  504. }
  505. pieMask.hide();
  506. }
  507. });
  508. }
  509. var body_resize = function () {
  510. maxHeight = document.documentElement.clientHeight;
  511. maxWidth = document.documentElement.clientWidth;
  512. Ext.getCmp('RtuAlarmPanel').setHeight(maxHeight);
  513. // Ext.getCmp('RtuAlarmPanel').setWidtht(maxWidth);
  514. }
  515. function exportbtn_click() {
  516. V_LOGINNAME = $("#V_LOGINNAME").val();
  517. company_code = document.getElementById('company_code').value;
  518. clzt = document.getElementById('clzt').value;
  519. time_start = document.getElementById('time_start').value;
  520. time_end = document.getElementById('time_end').value;
  521. var fields = '';
  522. var array = ['id', 'company_name', 'device_code', 'name', 'ncmd', 'clr', 'clnr', 'clwb', 'clzt', 'time', 'clsj','data2'];
  523. var name = ['编号', '公司名称', '设备编号', '设备名称', '告警截图', '告警类型', '处理内容', '是否误报', '处理状态', '报警时间', '处理时间','处理人'];
  524. for (var i = 0; i < 12; i++) {
  525. if (i > 0)
  526. fields += ',';
  527. fields += '{id:"' + array[i] + '",title:"' + name[i] + '",shown:"' + true + '"}';
  528. }
  529. var query = new Object();
  530. // query.V_LOGINNAME = V_LOGINNAME;
  531. query.company_code = company_code;
  532. query.clzt = clzt;
  533. query.time_start = time_start;
  534. query.time_end = time_end;
  535. query.COMMSTATUS = 'NO';
  536. query.EXPORT_FILE = '视频告警数据列表';
  537. query.fields = '[' + fields + ']';
  538. $.ajax({
  539. type: 'POST',
  540. url: baseUrl + "iot/excel/view/VideoAlarmExcel",
  541. data: {
  542. queryJson: Ext.JSON.encode(query)
  543. },
  544. success: function (result) {
  545. var json = eval('(' + result + ')');
  546. if (json.action == 'dormExport') {
  547. ConfirmStore = json.RESULT;
  548. var elemIF = document.createElement("iframe");
  549. elemIF.src = baseUrl + json.filename;
  550. elemIF.style.display = "none";
  551. document.body.appendChild(elemIF);
  552. }
  553. }
  554. });
  555. }
  556. Ext.onReady(function () {
  557. baseUrl = document.getElementById('basePath').value;
  558. theme = document.getElementById('theme').value;
  559. company_code = document.getElementById('company_code').value;
  560. $("#V_LOGINNAME").val(sessionStorage.getItem('V_LOGINNAME'));
  561. $("#V_PASSWORD").val(sessionStorage.getItem('V_PASSWORD'));
  562. V_LOGINNAME = $("#V_LOGINNAME").val();
  563. V_PASSWORD = $("#V_PASSWORD").val();
  564. var currentWidth = document.documentElement.clientWidth;
  565. pieWidth = currentWidth / 7;
  566. var chkIcon = '<img src="' + baseUrl + 'res/img/common/check.gif"/>'
  567. var unchkIcon = '<img src="' + baseUrl + 'res/img/common/uncheck.gif"/>'
  568. var countPerPage = 20;
  569. var chkBoolean = function (flag) {
  570. if (flag)
  571. return chkIcon;
  572. return unchkIcon;
  573. }
  574. var queryJson = new Object();
  575. queryJson.V_LOGINNAME = V_LOGINNAME;
  576. // queryJson.V_PASSWORD = V_PASSWORD;
  577. queryJson.COMMSTATUS = 'NO';
  578. if ((company_code != null) && (company_code != 'null') && (company_code.length > 0))
  579. queryJson.company_code = company_code;
  580. var myStore = Ext.create('Ext.data.Store', {
  581. model: 'VRtuOption',
  582. pageSize: countPerPage,
  583. proxy: {
  584. type: 'ajax',
  585. actionMethods: {
  586. create: 'POST',
  587. read: 'POST', // by default GET
  588. update: 'POST',
  589. destroy: 'POST'
  590. },
  591. url: baseUrl + 'iot/alarm/view/getVideoLists',
  592. reader: {
  593. type: 'json',
  594. root: 'RESULT',
  595. totalProperty: 'totalCount'
  596. },
  597. extraParams: {
  598. queryJson: Ext.JSON.encode(queryJson)
  599. }
  600. },
  601. sorters: [{
  602. property: 'time',
  603. direction: 'DESC'
  604. }],
  605. remoteSort: true
  606. });
  607. myStore.on("load", function (myStore) {
  608. getCurrentData();
  609. //do something
  610. });
  611. var CompanyStory = Ext.create('Ext.data.Store', {
  612. model: 'CompanyComboStore',
  613. proxy: {
  614. type: 'ajax',
  615. actionMethods: {
  616. create: 'POST',
  617. read: 'POST', // by default GET
  618. update: 'POST',
  619. destroy: 'POST'
  620. },
  621. url: baseUrl + 'iot/company/view/getNameList',
  622. reader: {
  623. type: 'json',
  624. root: 'RESULT',
  625. totalProperty: 'totalCount'
  626. },
  627. extraParams: {
  628. queryJson: Ext.JSON.encode(queryJson)
  629. }
  630. }
  631. });
  632. var ClztStory = Ext.create('Ext.data.Store', {
  633. fields: ['abbr', 'name'],
  634. data: [
  635. {'abbr': '0', 'name': '未处理'},
  636. {'abbr': '1', 'name': '已处理'}
  637. ]
  638. });
  639. var FilterForm = Ext.create('Ext.form.Panel', {
  640. id: 'VRtuOptionFilterForm',
  641. labelWidth: 55,
  642. defaultType: 'textfield',
  643. bodyPadding: 15,
  644. items: [{
  645. xtype: 'combo',
  646. fieldLabel: '单位名称',
  647. id: 'ff_company_code',
  648. name: 'ff_company_code',
  649. displayField: 'owner_name',
  650. valueField: 'owner_id',
  651. editable: false,
  652. width: 330,
  653. store: CompanyStory
  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_start_data',
  662. name: "ff_start_data",
  663. editable: false,//只读约束
  664. width: 330
  665. }, {
  666. xtype: 'datefield',
  667. fieldLabel: "结束日期",
  668. minValue: '07/07/2017',
  669. minText: "当前日期选择应大于当天日期",
  670. format: "Y-m-d",
  671. columnWidth: 0.5,
  672. id: 'ff_end_data',
  673. name: "ff_end_data",
  674. editable: false,//只读约束
  675. width: 330
  676. }, {
  677. xtype: 'combo',
  678. fieldLabel: '处理状态',
  679. id: 'ff_clzt',
  680. name: 'ff_clzt',
  681. displayField: 'name',
  682. valueField: 'abbr',
  683. editable: false,
  684. width: 330,
  685. store: ClztStory
  686. }],
  687. buttons: [{
  688. text: '筛选',
  689. iconCls: 'ok_btn',
  690. handler: function () {
  691. var form = this.up('form').getForm();
  692. if (form.isValid()) {
  693. var query = new Object();
  694. // var tmp = Ext.getCmp('ff_company_code');
  695. if (Ext.getCmp('ff_company_code').getValue()) {
  696. query.company_code = Ext.getCmp('ff_company_code').getValue();
  697. $("#company_code").val(query.company_code);
  698. company_code = query.company_code;
  699. $("#RtuPiePanel_title_string").html(Ext.getCmp('ff_company_code').getRawValue() + '.视频报告列表');
  700. } else {
  701. $("#company_code").val('');
  702. $("#RtuPiePanel_title_string").html('视频报告列表');
  703. company_code = null;
  704. }
  705. if (Ext.getCmp('ff_clzt').getValue()) {
  706. query.clzt = Ext.getCmp('ff_clzt').getValue();
  707. $("#clzt").val(query.clzt);
  708. } else {
  709. $("#clzt").val('');
  710. }
  711. if (Ext.getCmp('ff_start_data').getValue()) {
  712. query.time_start = Ext.getCmp('ff_start_data').getValue();
  713. 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();
  714. $("#time_start").val(datetime);
  715. } else {
  716. $("#time_start").val('');
  717. }
  718. if (Ext.getCmp('ff_end_data').getValue()) {
  719. query.time_end = Ext.getCmp('ff_end_data').getValue();
  720. 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();
  721. $("#time_end").val(datetime1);
  722. } else {
  723. $("#time_end").val('');
  724. }
  725. // query.clzt = Ext.getCmp('ff_clzt').getValue()==null?"":Ext.getCmp('ff_clzt').getValue();
  726. // query.V_LOGINNAME = V_LOGINNAME;
  727. // query.V_PASSWORD = V_PASSWORD;
  728. query.COMMSTATUS = 'NO';
  729. var jsonstr = Ext.JSON.encode(query);
  730. myStore.getProxy().extraParams = {
  731. queryJson: jsonstr
  732. };
  733. Ext.getCmp('VRtuOptionListPageToolbar').moveFirst();
  734. Ext.getCmp('ff_company_code').setValue('');
  735. Ext.getCmp('ff_clzt').setValue('');
  736. Ext.getCmp('VRtuOptionFilterWin').hide();
  737. // getCurrentData();
  738. }
  739. }
  740. }, {
  741. text: '关闭',
  742. iconCls: 'cancel_btn',
  743. handler: function () {
  744. Ext.getCmp('VRtuOptionFilterWin').hide();
  745. }
  746. }]
  747. });
  748. var filterwin = function () {
  749. Ext.create('Ext.window.Window', {
  750. id: 'VRtuOptionFilterWin',
  751. title: '视频报告筛选',
  752. height: 210,
  753. width: 400,
  754. layout: 'fit',
  755. items: FilterForm,
  756. closable: false,
  757. modal: true,
  758. closeAction: 'hide'
  759. }).show();
  760. CompanyStory.reload();
  761. }
  762. var radiogroup = new Ext.create('Ext.form.RadioGroup', {
  763. fieldLabel: '误报',
  764. id: 'uf_r_clwb',
  765. width: 300,
  766. items: [{
  767. name: 'uf_r_clwb',
  768. inputValue: '1',
  769. boxLabel: '是'
  770. }, {
  771. name: 'uf_r_clwb',
  772. inputValue: '0',
  773. boxLabel: '否',
  774. checked: true
  775. }]
  776. });
  777. var radiogroup2 = new Ext.create('Ext.form.RadioGroup', {
  778. fieldLabel: '处理范围',
  779. id: 'uf_r_clfw',
  780. width: 300,
  781. items: [{
  782. name: 'uf_r_clfw',
  783. inputValue: '1',
  784. boxLabel: '批量'
  785. }, {
  786. name: 'uf_r_clfw',
  787. inputValue: '0',
  788. boxLabel: '单一',
  789. checked: true
  790. }]
  791. });
  792. var clear_modify_form = function () {
  793. Ext.getCmp('uf_company_name').setValue('');
  794. Ext.getCmp('uf_name').setValue('');
  795. Ext.getCmp('uf_device_code').setValue('');
  796. Ext.getCmp('uf_id').setValue('');
  797. Ext.getCmp('uf_status').setValue('');
  798. Ext.getCmp('uf_fullname').setValue('');
  799. Ext.getCmp('uf_clwb').setValue('');
  800. Ext.getCmp('uf_clr').setValue('');
  801. Ext.getCmp('uf_clsj').setValue('');
  802. Ext.getCmp('uf_clnr').setValue('');
  803. }
  804. /* var rtuInfoForm = Ext.create('Ext.form.Panel', {
  805. id: 'rtuInfoForm',
  806. labelWidth: 55,
  807. url: baseUrl + 'iot/alarm/view/updateVideo',
  808. defaultType: 'textfield',
  809. bodyPadding: 15,
  810. items: [{
  811. fieldLabel: '单位名称',
  812. id: 'uf_company_name',
  813. name: 'uf_company_name',
  814. anchor: '90%'
  815. }, {
  816. fieldLabel: '监控设备',
  817. id: 'uf_name',
  818. name: 'uf_name',
  819. anchor: '100%'
  820. }, {
  821. fieldLabel: '设备编号',
  822. id: 'uf_device_code',
  823. name: 'uf_device_code',
  824. hidden: true
  825. }, {
  826. fieldLabel: '记录编号',
  827. id: 'uf_id',
  828. name: 'uf_id',
  829. hidden: true
  830. }, {
  831. fieldLabel: '设备编号',
  832. id: 'uf_status',
  833. name: 'uf_status',
  834. hidden: true
  835. }, {
  836. fieldLabel: '报告信息',
  837. id: 'uf_fullname',
  838. name: 'uf_fullname',
  839. xtype: 'textareafield',
  840. maxLength: 250,
  841. cols: 4,
  842. anchor: '100%'
  843. }, {
  844. fieldLabel: '误报',
  845. id: 'uf_clwb',
  846. name: 'uf_clwb',
  847. maxLength: 200,
  848. anchor: '65%'
  849. }, radiogroup, radiogroup2, {
  850. fieldLabel: '处理人',
  851. id: 'uf_clr',
  852. name: 'uf_clr',
  853. maxLength: 120,
  854. anchor: '65%'
  855. }, {
  856. fieldLabel: '处理时间',
  857. id: 'uf_clsj',
  858. name: 'uf_clsj',
  859. maxLength: 200,
  860. anchor: '80%'
  861. }, {
  862. fieldLabel: '处理内容',
  863. id: 'uf_clnr',
  864. name: 'uf_clnr',
  865. xtype: 'textareafield',
  866. maxLength: 250,
  867. cols: 4,
  868. anchor: '100%'
  869. }, {
  870. id: 'fm_queryJson',
  871. name: 'queryJson',
  872. hidden: true
  873. }],
  874. buttons: [{
  875. text: '处理',
  876. id: 'confirmBtn',
  877. iconCls: 'ok_btn',
  878. handler: function () {
  879. var form = this.up('form').getForm();
  880. if (form.isValid()) {
  881. var queryJson = new Object();
  882. queryJson.V_LOGINNAME = V_LOGINNAME;
  883. queryJson.V_PASSWORD = V_PASSWORD;
  884. queryJson.id = Ext.getCmp('uf_id').getValue();
  885. queryJson.status = Ext.getCmp('uf_status').getValue();
  886. queryJson.name = Ext.getCmp('uf_name').getValue();
  887. queryJson.device_code = Ext.getCmp('uf_device_code').getValue();
  888. queryJson.confirmAll = Ext.getCmp('uf_r_clfw').getChecked()[0].boxLabel == '单一' ? '0' : '1';
  889. queryJson.clwb = Ext.getCmp('uf_r_clwb').getChecked()[0].boxLabel == '否' ? '0' : '1';
  890. queryJson.clnr = Ext.getCmp('uf_clnr').getValue();
  891. var jsonstr = Ext.JSON.encode(queryJson);
  892. Ext.getCmp('fm_queryJson').setValue(jsonstr);
  893. form.submit({
  894. method: 'post',
  895. success: function (form, action) {
  896. Ext.Msg.alert('操作成功', '已确认' + action.result.activerow + '条记录', function (btn, txt) {
  897. clear_modify_form();
  898. myStore.reload();
  899. // getCurrentData();
  900. });
  901. },
  902. failure: function (form, action) {
  903. Ext.Msg.alert('操作失败', action.Msg, function (btn, txt) {
  904. clear_modify_form();
  905. myStore.reload();
  906. // getCurrentData();
  907. });
  908. }
  909. });
  910. this.up('window').close();
  911. }
  912. }
  913. }, {
  914. text: '关闭',
  915. iconCls: 'cancel_btn',
  916. handler: function () {
  917. this.up('window').close();
  918. }
  919. }]
  920. });*/
  921. var alarmInfoForm = Ext.create('Ext.form.Panel', {
  922. id: 'alarmInfoForm',
  923. // width:400,
  924. labelWidth: 55,
  925. url: baseUrl+'iot/alarm/view/updateVideo',
  926. region:'center',
  927. defaultType: 'textfield',
  928. bodyPadding: 15,
  929. items: [{
  930. fieldLabel:'单位名称',
  931. id: 'uf_company_name',
  932. name: 'uf_company_name',
  933. anchor:'90%'
  934. },{
  935. fieldLabel:'监控设备',
  936. id:'uf_name',
  937. name:'uf_name',
  938. anchor:'100%'
  939. },{
  940. fieldLabel:'设备编号',
  941. id:'uf_device_code',
  942. name:'uf_device_code',
  943. hidden: true
  944. },{
  945. fieldLabel:'记录编号',
  946. id:'uf_id',
  947. name:'uf_id',
  948. hidden: true
  949. },{
  950. fieldLabel:'设备编号',
  951. id:'uf_status',
  952. name:'uf_status',
  953. hidden: true
  954. },{
  955. fieldLabel:'设备类型',
  956. id:'uf_dwtype',
  957. name:'uf_dwtype',
  958. hidden: true
  959. },{
  960. fieldLabel:'报告信息',
  961. id: 'uf_fullname',
  962. name:'uf_fullname',
  963. xtype: 'textareafield',
  964. maxLength: 250,
  965. cols:4,
  966. anchor:'100%'
  967. },{
  968. fieldLabel:'误报',
  969. id: 'uf_clwb',
  970. name:'uf_clwb',
  971. maxLength: 200,
  972. anchor:'65%'
  973. },radiogroup,radiogroup2,{
  974. fieldLabel:'处理人',
  975. id: 'uf_clr',
  976. name:'uf_clr',
  977. maxLength: 120,
  978. anchor:'65%'
  979. },{
  980. fieldLabel:'处理时间',
  981. id: 'uf_clsj',
  982. name:'uf_clsj',
  983. maxLength: 200,
  984. anchor:'80%'
  985. },{
  986. fieldLabel:'处理内容',
  987. id: 'uf_clnr',
  988. name:'uf_clnr',
  989. xtype: 'textareafield',
  990. maxLength: 250,
  991. cols:4,
  992. anchor:'100%'
  993. },{
  994. id:'fm_queryJson',
  995. name:'queryJson',
  996. hidden:true
  997. }],
  998. buttons: [{
  999. text: '处理',
  1000. id:'confirmBtn',
  1001. disabled:(V_LOGINNAME=='guest'?true:false),
  1002. iconCls:'ok_btn',
  1003. handler: function() {
  1004. var form = this.up('form').getForm();
  1005. if (form.isValid()) {
  1006. var queryJson = new Object();
  1007. // queryJson.V_LOGINNAME = V_LOGINNAME;
  1008. // queryJson.V_PASSWORD = V_PASSWORD;
  1009. queryJson.dwtype = Ext.getCmp('uf_dwtype').getValue();;
  1010. queryJson.id = Ext.getCmp('uf_id').getValue();
  1011. queryJson.status = Ext.getCmp('uf_status').getValue();
  1012. queryJson.name = Ext.getCmp('uf_name').getValue();
  1013. queryJson.device_code = Ext.getCmp('uf_device_code').getValue();
  1014. queryJson.confirmAll = Ext.getCmp('uf_r_clfw').getChecked()[0].boxLabel=='单一'?'0':'1';
  1015. queryJson.clwb = Ext.getCmp('uf_r_clwb').getChecked()[0].boxLabel=='否'?'0':'1';
  1016. queryJson.clnr = Ext.getCmp('uf_clnr').getValue();
  1017. var jsonstr = Ext.JSON.encode(queryJson);
  1018. Ext.getCmp('fm_queryJson').setValue(jsonstr);
  1019. form.submit({
  1020. method:'post',
  1021. success: function(form, action) {
  1022. Ext.Msg.alert('操作成功', '已确认'+action.result.activerow+'条记录', function(btn,txt){
  1023. clear_modify_form();
  1024. var div = window.top.$("#history_alarm_list").content;
  1025. div.storeReload2();
  1026. });
  1027. },
  1028. failure: function(form, action) {
  1029. Ext.Msg.alert('操作失败', action.Msg , function(btn,txt){
  1030. clear_modify_form();
  1031. });
  1032. }
  1033. });
  1034. this.up('window').close();
  1035. }
  1036. }
  1037. },{
  1038. text: '关闭',
  1039. iconCls: 'cancel_btn',
  1040. handler: function() {
  1041. this.up('window').close();
  1042. }
  1043. }]
  1044. });
  1045. /* var vRtuInfoWin = Ext.create('Ext.window.Window', {
  1046. id: 'VRtuInfoWin',
  1047. title: '详细信息: <span id="VInfoWin_Title"></span>',
  1048. width: 400,
  1049. layout: 'fit',
  1050. closable: false,
  1051. modal: true,
  1052. closeAction: 'hide',
  1053. items: rtuInfoForm
  1054. }).hide();*/
  1055. var vAlarmInfoWin = Ext.create('Ext.window.Window',{
  1056. id:'VAlarmInfoWin',
  1057. title:'详细信息: <span id="VInfoWin_Title"></span>',
  1058. height:400,
  1059. width:400,
  1060. layout:'border',
  1061. closable:false,
  1062. modal:true,
  1063. closeAction:'hide',
  1064. items:[{
  1065. id:'picPanel',
  1066. region:'west',
  1067. width:300,
  1068. html:'<div id="alarm_pic"></div>'
  1069. },alarmInfoForm]
  1070. }).hide();
  1071. // TODO
  1072. /* var showRtuInfoWin = function (record) {
  1073. alarmInfoForm.show();
  1074. $("#VInfoWin_Title").html(record.get('data'));
  1075. Ext.getCmp('uf_company_name').setValue(record.get('company_name'));
  1076. Ext.getCmp('uf_name').setValue(record.get('name'));
  1077. Ext.getCmp('uf_device_code').setValue(record.get('device_code'));
  1078. Ext.getCmp('uf_fullname').setValue(record.get('fullname'));
  1079. Ext.getCmp('uf_clr').setValue(record.get('clr_name'));
  1080. Ext.getCmp('uf_clsj').setValue(record.get('clsj'));
  1081. Ext.getCmp('uf_clnr').setValue(record.get('clnr'));
  1082. Ext.getCmp('uf_id').setValue(record.get('id'));
  1083. Ext.getCmp('uf_clwb').setValue(record.get('clwb') == '1' ? '误报' : '告警');
  1084. Ext.getCmp('uf_status').setValue(record.get('status'));
  1085. if (record.get('clzt') == '已处理') {
  1086. Ext.getCmp('uf_clwb').setVisible(true);
  1087. Ext.getCmp('uf_r_clwb').setVisible(false);
  1088. Ext.getCmp('uf_r_clfw').setVisible(false);
  1089. Ext.getCmp('confirmBtn').setVisible(false);
  1090. Ext.getCmp('uf_clr').setVisible(true);
  1091. Ext.getCmp('uf_clsj').setVisible(true);
  1092. } else {
  1093. Ext.getCmp('uf_clwb').setVisible(false);
  1094. Ext.getCmp('uf_r_clwb').setVisible(true);
  1095. Ext.getCmp('uf_r_clfw').setVisible(true);
  1096. Ext.getCmp('confirmBtn').setVisible(true);
  1097. Ext.getCmp('uf_clr').setVisible(false);
  1098. Ext.getCmp('uf_clsj').setVisible(false);
  1099. }
  1100. }*/
  1101. var show_alarm_info = function (dwtype, status, id, name, device_code, company_code, company_name, fullname, time, data, data2, clzt, clwb, clr_name, clnr, clsj){
  1102. vAlarmInfoWin.show();
  1103. if((dwtype=='YTVA')||(dwtype=='16')){
  1104. vAlarmInfoWin.setWidth(780);
  1105. Ext.getCmp('picPanel').setWidth(360);
  1106. Ext.getCmp('picPanel').setHeight(270);
  1107. var img = document.createElement('img');
  1108. img.width=360;
  1109. img.height=270;
  1110. img.src = data2;
  1111. var alarm_pic = document.getElementById('alarm_pic');
  1112. alarm_pic.innerHTML='';
  1113. alarm_pic.appendChild(img);
  1114. }else{
  1115. vAlarmInfoWin.setWidth(780);
  1116. Ext.getCmp('picPanel').setWidth(360);
  1117. Ext.getCmp('picPanel').setHeight(270);
  1118. var img = document.createElement('img');
  1119. img.width=360;
  1120. img.height=270;
  1121. img.src = data;
  1122. var alarm_pic = document.getElementById('alarm_pic');
  1123. alarm_pic.innerHTML='';
  1124. alarm_pic.appendChild(img);
  1125. /* vAlarmInfoWin.setWidth(400);
  1126. Ext.getCmp('picPanel').setWidth(0);
  1127. Ext.getCmp('picPanel').setHeight(0);*/
  1128. }
  1129. $("#VInfoWin_Title").html(data);
  1130. Ext.getCmp('uf_company_name').setValue(company_name);
  1131. Ext.getCmp('uf_name').setValue(name);
  1132. Ext.getCmp('uf_device_code').setValue(device_code);
  1133. Ext.getCmp('uf_fullname').setValue(fullname);
  1134. Ext.getCmp('uf_clr').setValue(clr_name);
  1135. Ext.getCmp('uf_clsj').setValue(clsj);
  1136. Ext.getCmp('uf_clnr').setValue(clnr);
  1137. Ext.getCmp('uf_id').setValue(id);
  1138. Ext.getCmp('uf_clwb').setValue(clwb=='1'?'误报':'告警');
  1139. Ext.getCmp('uf_status').setValue(status);
  1140. Ext.getCmp('uf_dwtype').setValue(dwtype);
  1141. if(clzt=='已处理'){
  1142. vAlarmInfoWin.setHeight(460);
  1143. Ext.getCmp('uf_clwb').setVisible(true);
  1144. Ext.getCmp('uf_r_clwb').setVisible(false);
  1145. Ext.getCmp('uf_r_clfw').setVisible(false);
  1146. Ext.getCmp('confirmBtn').setVisible(false);
  1147. Ext.getCmp('uf_clr').setVisible(true);
  1148. Ext.getCmp('uf_clsj').setVisible(true);
  1149. if(dwtype=='YTVA')
  1150. vAlarmInfoWin.setPosition(
  1151. ($(document).innerWidth()-780)/2,
  1152. ($(document).innerHeight()-460)/2);
  1153. else
  1154. vAlarmInfoWin.setPosition(
  1155. ($(document).innerWidth()-400)/2,
  1156. ($(document).innerHeight()-460)/2);
  1157. }else{
  1158. vAlarmInfoWin.setHeight(400);
  1159. Ext.getCmp('uf_clwb').setVisible(false);
  1160. Ext.getCmp('uf_r_clwb').setVisible(true);
  1161. Ext.getCmp('uf_r_clfw').setVisible(true);
  1162. Ext.getCmp('confirmBtn').setVisible(true);
  1163. Ext.getCmp('uf_clr').setVisible(false);
  1164. Ext.getCmp('uf_clsj').setVisible(false);
  1165. if((dwtype=='YTVA')||(dwtype=='16'))
  1166. vAlarmInfoWin.setPosition(
  1167. ($(document).innerWidth()-780)/2,
  1168. ($(document).innerHeight()-400)/2);
  1169. else
  1170. vAlarmInfoWin.setPosition(
  1171. ($(document).innerWidth()-400)/2,
  1172. ($(document).innerHeight()-400)/2);
  1173. }
  1174. }
  1175. var RtuOptionPanel = Ext.create('Ext.grid.Panel', {
  1176. // title: 'RTU报告列表',
  1177. header: {
  1178. height: 0,
  1179. border: '0px solid #000000'
  1180. },
  1181. titleCollapse: true,
  1182. id: 'VRtuOptionListPanel',
  1183. region: 'center',
  1184. store: myStore,
  1185. // selModel: sm,
  1186. columns: [
  1187. {header: 'id', dataIndex: 'id', hidden: true, menuDisabled: true},
  1188. {header: '序号', dataIndex: 'orderIdx', width: 50, menuDisabled: true},
  1189. {header: '单位名称', dataIndex: 'company_name', width: 240, menuDisabled: true},
  1190. {header: '报告时间', dataIndex: 'time', width: 160, menuDisabled: true},
  1191. {header: '报告数据', dataIndex: 'data4', width: 140, menuDisabled: true},
  1192. {header: '报告内容', dataIndex: 'fullname', width: 900, minWidth: 400, maxWidth: 1600, menuDisabled: true},
  1193. {header: '处理状态', dataIndex: 'clzt', width: 100, menuDisabled: true},
  1194. {header: '处理人', dataIndex: 'clr_name', width: 150, menuDisabled: true},
  1195. {header: '处理时间', dataIndex: 'clsj', width: 160, menuDisabled: true}
  1196. ],
  1197. columnLines: true,
  1198. height: maxHeight,
  1199. width: '100%',
  1200. tbar: new Ext.create('Ext.toolbar.Toolbar', {
  1201. items: [{
  1202. html: '<span id="RtuPiePanel_title_string" style="color:#ffffff;background-color:rgba(0,0,0,0)">视频监控报告列表</span>'
  1203. }, '->', {
  1204. xtype: 'button',
  1205. iconCls: 'back_btn',
  1206. text: '<span style="color:#ffffff;background-color:rgba(0,0,0,0)">返回</span>',
  1207. listeners: {
  1208. click: function () {
  1209. location.href = baseUrl + 'view/frontpage/map.jsp?&theme=' + theme + '&company_code=' + company_code;
  1210. }
  1211. }
  1212. }, '-',
  1213. {
  1214. xtype: 'button',
  1215. iconCls: 'filter_btn',
  1216. text: '<span style="color:#ffffff;background-color:rgba(0,0,0,0)">筛选</span>',
  1217. listeners: {
  1218. click: filterwin
  1219. }
  1220. }, '-',
  1221. {
  1222. xtype: 'button',
  1223. iconCls: 'filter_btn',
  1224. text: '<span style="color:#ffffff;background-color:rgba(0,0,0,0)">导出</span>',
  1225. listeners: {
  1226. click: exportbtn_click
  1227. }
  1228. }, '-']
  1229. }),
  1230. bbar: new Ext.PagingToolbar({
  1231. store: myStore,
  1232. id: 'VRtuOptionListPageToolbar',
  1233. displayInfo: true,
  1234. pageSize: countPerPage,
  1235. prependButtons: true,
  1236. displayMsg: '显示第 {0}条到 {1}条记录,总共 {2}条',
  1237. emptyMsg: "没有记录",
  1238. firstText: '第一页',
  1239. prevText: '前一页',
  1240. nextText: '后一页',
  1241. lastText: '最后一页',
  1242. refreshText: '刷新'
  1243. }),
  1244. frame: true,
  1245. border: false,
  1246. iconCls: 'icon-grid',
  1247. listeners: {
  1248. 'celldblclick': function (grid, td, cellIndex, record, tr, rowIndex, e, eOpts) {
  1249. // alert(record.get('company_name')+','+record.get('id'));
  1250. show_alarm_info(dwtype,
  1251. record.data.status,
  1252. record.data.id,
  1253. record.data.name,
  1254. record.data.device_code,
  1255. record.data.company_code,
  1256. record.data.company_name,
  1257. record.data.fullname,
  1258. record.data.time,
  1259. record.data.data,
  1260. record.data.data2,
  1261. record.data.clzt,
  1262. record.data.clwb,
  1263. record.data.clr_name,
  1264. record.data.clnr,
  1265. record.data.clsj);
  1266. }
  1267. }
  1268. });
  1269. var piebar = Ext.create('Ext.panel.Panel', {
  1270. id: 'FirePiePanel',
  1271. width: '100%',
  1272. height: 498,
  1273. region: 'north',
  1274. layout: 'border',
  1275. defaults: {
  1276. border: false
  1277. },
  1278. html: '<div id="operation_body" class="operation_body">' +
  1279. '<div id="operation_dock_l" class="operation_dock_l"></div>' +
  1280. '<div id="operation_dock_r" class="operation_dock_r"></div>' +
  1281. '<img id="operation_title_icon" class="operation_title_icon" width="48" height="48" src="../../res/img/icons/video_03.png"/>' +
  1282. '<div id="operation_title_text" class="operation_title_text">视频监控告警处理情况</div>' +
  1283. '<div id="operation_label_1" class="operation_label_1">总数</div>' +
  1284. '<div id="operation_label_2" class="operation_label_2">已处理</div>' +
  1285. '<div id="operation_label_3" class="operation_label_3">未处理</div>' +
  1286. '<div id="operation_label_4" class="operation_label_4">处置率</div>' +
  1287. '<div id="operation_num_1" class="operation_num_1"></div>' +
  1288. '<div id="operation_num_2" class="operation_num_2"></div>' +
  1289. '<div id="operation_num_3" class="operation_num_3"></div>' +
  1290. '<div id="operation_num_4" class="operation_num_4"></div>' +
  1291. '<div id="operation_pie_bg" class="operation_pie_bg"></div>' +
  1292. '<div id="operation_pie" class="operation_pie"></div>' +
  1293. '<div id="operation_pie_title" class="operation_pie_title">处置率</div>' +
  1294. '<div id="operation_area_bg" class="operation_area_bg"></div>' +
  1295. '<div id="operation_area" class="operation_area"></div></div>'
  1296. });
  1297. pieMask = new Ext.LoadMask(piebar, {msg: "Loading..."});
  1298. new Ext.create('Ext.panel.Panel', {
  1299. width: '100%',
  1300. id: 'RtuAlarmPanel',
  1301. layout: 'border',
  1302. items: [
  1303. piebar, RtuOptionPanel
  1304. ],
  1305. renderTo: Ext.getBody()
  1306. });
  1307. myStore.reload();
  1308. // getCurrentData();
  1309. // maxHeight = document.documentElement.clientHeight;
  1310. // Ext.getCmp('RtuAlarmPanel').setHeight(maxHeight);
  1311. /* vAlarmInfoWin = Ext.create('Ext.window.Window',{
  1312. id:'VAlarmInfoWin',
  1313. title:'详细信息: <span id="VInfoWin_Title"></span>',
  1314. height:400,
  1315. width:400,
  1316. layout:'border',
  1317. closable:false,
  1318. modal:true,
  1319. closeAction:'hide',
  1320. items:[{
  1321. id:'picPanel',
  1322. region:'west',
  1323. width:300,
  1324. html:'<div id="alarm_pic"></div>'
  1325. },alarmInfoForm]
  1326. }).hide();
  1327. getCompanyInfo();*/
  1328. $(window).resize(function () {
  1329. body_resize();
  1330. });
  1331. body_resize();
  1332. });