videoOption.js 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386
  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. listeners: {
  677. //添加日期选择事件
  678. "select": function (time) {
  679. var start = Ext.getCmp('ff_start_data').getValue()
  680. var end = Ext.getCmp('ff_end_data').getValue()
  681. if(start === null || start === ""){
  682. Ext.Msg.alert('操作失败', '请选择开始时间后再次选择!' , function(btn,txt){
  683. Ext.getCmp('ff_end_data').setValue('');
  684. });
  685. }else{
  686. if((end.valueOf() - start.valueOf()) < 0){
  687. Ext.Msg.alert('操作失败', '开始日期不能选择在结束日期后!' , function(btn,txt){
  688. Ext.getCmp('ff_end_data').setValue('');
  689. });
  690. }
  691. }
  692. },
  693. }
  694. }, {
  695. xtype: 'combo',
  696. fieldLabel: '处理状态',
  697. id: 'ff_clzt',
  698. name: 'ff_clzt',
  699. displayField: 'name',
  700. valueField: 'abbr',
  701. editable: false,
  702. width: 330,
  703. store: ClztStory
  704. }],
  705. buttons: [{
  706. text: '筛选',
  707. iconCls: 'ok_btn',
  708. handler: function () {
  709. var form = this.up('form').getForm();
  710. if (form.isValid()) {
  711. var query = new Object();
  712. // var tmp = Ext.getCmp('ff_company_code');
  713. if (Ext.getCmp('ff_company_code').getValue()) {
  714. query.company_code = Ext.getCmp('ff_company_code').getValue();
  715. $("#company_code").val(query.company_code);
  716. company_code = query.company_code;
  717. $("#RtuPiePanel_title_string").html(Ext.getCmp('ff_company_code').getRawValue() + '.视频报告列表');
  718. } else {
  719. $("#company_code").val('');
  720. $("#RtuPiePanel_title_string").html('视频报告列表');
  721. company_code = null;
  722. }
  723. if (Ext.getCmp('ff_clzt').getValue()) {
  724. query.clzt = Ext.getCmp('ff_clzt').getValue();
  725. $("#clzt").val(query.clzt);
  726. } else {
  727. $("#clzt").val('');
  728. }
  729. if (Ext.getCmp('ff_start_data').getValue()) {
  730. query.time_start = Ext.getCmp('ff_start_data').getValue();
  731. 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();
  732. $("#time_start").val(datetime);
  733. } else {
  734. $("#time_start").val('');
  735. }
  736. if (Ext.getCmp('ff_end_data').getValue()) {
  737. query.time_end = Ext.getCmp('ff_end_data').getValue();
  738. 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();
  739. $("#time_end").val(datetime1);
  740. } else {
  741. $("#time_end").val('');
  742. }
  743. // query.clzt = Ext.getCmp('ff_clzt').getValue()==null?"":Ext.getCmp('ff_clzt').getValue();
  744. // query.V_LOGINNAME = V_LOGINNAME;
  745. // query.V_PASSWORD = V_PASSWORD;
  746. query.COMMSTATUS = 'NO';
  747. var jsonstr = Ext.JSON.encode(query);
  748. myStore.getProxy().extraParams = {
  749. queryJson: jsonstr
  750. };
  751. Ext.getCmp('VRtuOptionListPageToolbar').moveFirst();
  752. Ext.getCmp('ff_company_code').setValue('');
  753. Ext.getCmp('ff_clzt').setValue('');
  754. Ext.getCmp('ff_start_data').setValue('');
  755. Ext.getCmp('ff_end_data').setValue('');
  756. Ext.getCmp('VRtuOptionFilterWin').hide();
  757. // getCurrentData();
  758. }
  759. }
  760. }, {
  761. text: '关闭',
  762. iconCls: 'cancel_btn',
  763. handler: function () {
  764. Ext.getCmp('VRtuOptionFilterWin').hide();
  765. }
  766. }]
  767. });
  768. var filterwin = function () {
  769. Ext.create('Ext.window.Window', {
  770. id: 'VRtuOptionFilterWin',
  771. title: '视频报告筛选',
  772. height: 210,
  773. width: 400,
  774. layout: 'fit',
  775. items: FilterForm,
  776. closable: false,
  777. modal: true,
  778. closeAction: 'hide'
  779. }).show();
  780. CompanyStory.reload();
  781. }
  782. var radiogroup = new Ext.create('Ext.form.RadioGroup', {
  783. fieldLabel: '误报',
  784. id: 'uf_r_clwb',
  785. width: 300,
  786. items: [{
  787. name: 'uf_r_clwb',
  788. inputValue: '1',
  789. boxLabel: '是'
  790. }, {
  791. name: 'uf_r_clwb',
  792. inputValue: '0',
  793. boxLabel: '否',
  794. checked: true
  795. }]
  796. });
  797. var radiogroup2 = new Ext.create('Ext.form.RadioGroup', {
  798. fieldLabel: '处理范围',
  799. id: 'uf_r_clfw',
  800. width: 300,
  801. items: [{
  802. name: 'uf_r_clfw',
  803. inputValue: '1',
  804. boxLabel: '批量'
  805. }, {
  806. name: 'uf_r_clfw',
  807. inputValue: '0',
  808. boxLabel: '单一',
  809. checked: true
  810. }]
  811. });
  812. var clear_modify_form = function () {
  813. Ext.getCmp('uf_company_name').setValue('');
  814. Ext.getCmp('uf_name').setValue('');
  815. Ext.getCmp('uf_device_code').setValue('');
  816. Ext.getCmp('uf_id').setValue('');
  817. Ext.getCmp('uf_status').setValue('');
  818. Ext.getCmp('uf_fullname').setValue('');
  819. Ext.getCmp('uf_clwb').setValue('');
  820. Ext.getCmp('uf_clr').setValue('');
  821. Ext.getCmp('uf_clsj').setValue('');
  822. Ext.getCmp('uf_clnr').setValue('');
  823. }
  824. /* var rtuInfoForm = Ext.create('Ext.form.Panel', {
  825. id: 'rtuInfoForm',
  826. labelWidth: 55,
  827. url: baseUrl + 'iot/alarm/view/updateVideo',
  828. defaultType: 'textfield',
  829. bodyPadding: 15,
  830. items: [{
  831. fieldLabel: '单位名称',
  832. id: 'uf_company_name',
  833. name: 'uf_company_name',
  834. anchor: '90%'
  835. }, {
  836. fieldLabel: '监控设备',
  837. id: 'uf_name',
  838. name: 'uf_name',
  839. anchor: '100%'
  840. }, {
  841. fieldLabel: '设备编号',
  842. id: 'uf_device_code',
  843. name: 'uf_device_code',
  844. hidden: true
  845. }, {
  846. fieldLabel: '记录编号',
  847. id: 'uf_id',
  848. name: 'uf_id',
  849. hidden: true
  850. }, {
  851. fieldLabel: '设备编号',
  852. id: 'uf_status',
  853. name: 'uf_status',
  854. hidden: true
  855. }, {
  856. fieldLabel: '报告信息',
  857. id: 'uf_fullname',
  858. name: 'uf_fullname',
  859. xtype: 'textareafield',
  860. maxLength: 250,
  861. cols: 4,
  862. anchor: '100%'
  863. }, {
  864. fieldLabel: '误报',
  865. id: 'uf_clwb',
  866. name: 'uf_clwb',
  867. maxLength: 200,
  868. anchor: '65%'
  869. }, radiogroup, radiogroup2, {
  870. fieldLabel: '处理人',
  871. id: 'uf_clr',
  872. name: 'uf_clr',
  873. maxLength: 120,
  874. anchor: '65%'
  875. }, {
  876. fieldLabel: '处理时间',
  877. id: 'uf_clsj',
  878. name: 'uf_clsj',
  879. maxLength: 200,
  880. anchor: '80%'
  881. }, {
  882. fieldLabel: '处理内容',
  883. id: 'uf_clnr',
  884. name: 'uf_clnr',
  885. xtype: 'textareafield',
  886. maxLength: 250,
  887. cols: 4,
  888. anchor: '100%'
  889. }, {
  890. id: 'fm_queryJson',
  891. name: 'queryJson',
  892. hidden: true
  893. }],
  894. buttons: [{
  895. text: '处理',
  896. id: 'confirmBtn',
  897. iconCls: 'ok_btn',
  898. handler: function () {
  899. var form = this.up('form').getForm();
  900. if (form.isValid()) {
  901. var queryJson = new Object();
  902. queryJson.V_LOGINNAME = V_LOGINNAME;
  903. queryJson.V_PASSWORD = V_PASSWORD;
  904. queryJson.id = Ext.getCmp('uf_id').getValue();
  905. queryJson.status = Ext.getCmp('uf_status').getValue();
  906. queryJson.name = Ext.getCmp('uf_name').getValue();
  907. queryJson.device_code = Ext.getCmp('uf_device_code').getValue();
  908. queryJson.confirmAll = Ext.getCmp('uf_r_clfw').getChecked()[0].boxLabel == '单一' ? '0' : '1';
  909. queryJson.clwb = Ext.getCmp('uf_r_clwb').getChecked()[0].boxLabel == '否' ? '0' : '1';
  910. queryJson.clnr = Ext.getCmp('uf_clnr').getValue();
  911. var jsonstr = Ext.JSON.encode(queryJson);
  912. Ext.getCmp('fm_queryJson').setValue(jsonstr);
  913. form.submit({
  914. method: 'post',
  915. success: function (form, action) {
  916. Ext.Msg.alert('操作成功', '已确认' + action.result.activerow + '条记录', function (btn, txt) {
  917. clear_modify_form();
  918. myStore.reload();
  919. // getCurrentData();
  920. });
  921. },
  922. failure: function (form, action) {
  923. Ext.Msg.alert('操作失败', action.Msg, function (btn, txt) {
  924. clear_modify_form();
  925. myStore.reload();
  926. // getCurrentData();
  927. });
  928. }
  929. });
  930. this.up('window').close();
  931. }
  932. }
  933. }, {
  934. text: '关闭',
  935. iconCls: 'cancel_btn',
  936. handler: function () {
  937. this.up('window').close();
  938. }
  939. }]
  940. });*/
  941. var alarmInfoForm = Ext.create('Ext.form.Panel', {
  942. id: 'alarmInfoForm',
  943. // width:400,
  944. labelWidth: 55,
  945. url: baseUrl+'iot/alarm/view/updateVideo',
  946. region:'center',
  947. defaultType: 'textfield',
  948. bodyPadding: 15,
  949. items: [{
  950. fieldLabel:'单位名称',
  951. id: 'uf_company_name',
  952. name: 'uf_company_name',
  953. anchor:'90%'
  954. },{
  955. fieldLabel:'监控设备',
  956. id:'uf_name',
  957. name:'uf_name',
  958. anchor:'100%'
  959. },{
  960. fieldLabel:'设备编号',
  961. id:'uf_device_code',
  962. name:'uf_device_code',
  963. hidden: true
  964. },{
  965. fieldLabel:'记录编号',
  966. id:'uf_id',
  967. name:'uf_id',
  968. hidden: true
  969. },{
  970. fieldLabel:'设备编号',
  971. id:'uf_status',
  972. name:'uf_status',
  973. hidden: true
  974. },{
  975. fieldLabel:'设备类型',
  976. id:'uf_dwtype',
  977. name:'uf_dwtype',
  978. hidden: true
  979. },{
  980. fieldLabel:'报告信息',
  981. id: 'uf_fullname',
  982. name:'uf_fullname',
  983. xtype: 'textareafield',
  984. maxLength: 250,
  985. cols:4,
  986. anchor:'100%'
  987. },{
  988. fieldLabel:'误报',
  989. id: 'uf_clwb',
  990. name:'uf_clwb',
  991. maxLength: 200,
  992. anchor:'65%'
  993. },radiogroup,radiogroup2,{
  994. fieldLabel:'处理人',
  995. id: 'uf_clr',
  996. name:'uf_clr',
  997. maxLength: 120,
  998. anchor:'65%'
  999. },{
  1000. fieldLabel:'处理时间',
  1001. id: 'uf_clsj',
  1002. name:'uf_clsj',
  1003. maxLength: 200,
  1004. anchor:'80%'
  1005. },{
  1006. fieldLabel:'处理内容',
  1007. id: 'uf_clnr',
  1008. name:'uf_clnr',
  1009. xtype: 'textareafield',
  1010. maxLength: 250,
  1011. cols:4,
  1012. anchor:'100%'
  1013. },{
  1014. id:'fm_queryJson',
  1015. name:'queryJson',
  1016. hidden:true
  1017. }],
  1018. buttons: [{
  1019. text: '处理',
  1020. id:'confirmBtn',
  1021. disabled:(V_LOGINNAME=='guest'?true:false),
  1022. iconCls:'ok_btn',
  1023. handler: function() {
  1024. var form = this.up('form').getForm();
  1025. if (form.isValid()) {
  1026. var queryJson = new Object();
  1027. // queryJson.V_LOGINNAME = V_LOGINNAME;
  1028. // queryJson.V_PASSWORD = V_PASSWORD;
  1029. queryJson.dwtype = Ext.getCmp('uf_dwtype').getValue();;
  1030. queryJson.id = Ext.getCmp('uf_id').getValue();
  1031. queryJson.status = Ext.getCmp('uf_status').getValue();
  1032. queryJson.name = Ext.getCmp('uf_name').getValue();
  1033. queryJson.device_code = Ext.getCmp('uf_device_code').getValue();
  1034. queryJson.confirmAll = Ext.getCmp('uf_r_clfw').getChecked()[0].boxLabel=='单一'?'0':'1';
  1035. queryJson.clwb = Ext.getCmp('uf_r_clwb').getChecked()[0].boxLabel=='否'?'0':'1';
  1036. queryJson.clnr = Ext.getCmp('uf_clnr').getValue();
  1037. var jsonstr = Ext.JSON.encode(queryJson);
  1038. Ext.getCmp('fm_queryJson').setValue(jsonstr);
  1039. form.submit({
  1040. method:'post',
  1041. success: function(form, action) {
  1042. Ext.Msg.alert('操作成功', '已确认'+action.result.activerow+'条记录', function(btn,txt){
  1043. clear_modify_form();
  1044. var div = window.top.$("#history_alarm_list").content;
  1045. div.storeReload2();
  1046. });
  1047. },
  1048. failure: function(form, action) {
  1049. Ext.Msg.alert('操作失败', action.Msg , function(btn,txt){
  1050. clear_modify_form();
  1051. });
  1052. }
  1053. });
  1054. this.up('window').close();
  1055. }
  1056. }
  1057. },{
  1058. text: '关闭',
  1059. iconCls: 'cancel_btn',
  1060. handler: function() {
  1061. this.up('window').close();
  1062. }
  1063. }]
  1064. });
  1065. /* var vRtuInfoWin = Ext.create('Ext.window.Window', {
  1066. id: 'VRtuInfoWin',
  1067. title: '详细信息: <span id="VInfoWin_Title"></span>',
  1068. width: 400,
  1069. layout: 'fit',
  1070. closable: false,
  1071. modal: true,
  1072. closeAction: 'hide',
  1073. items: rtuInfoForm
  1074. }).hide();*/
  1075. var vAlarmInfoWin = Ext.create('Ext.window.Window',{
  1076. id:'VAlarmInfoWin',
  1077. title:'详细信息: <span id="VInfoWin_Title"></span>',
  1078. height:400,
  1079. width:400,
  1080. layout:'border',
  1081. closable:false,
  1082. modal:true,
  1083. closeAction:'hide',
  1084. items:[{
  1085. id:'picPanel',
  1086. region:'west',
  1087. width:300,
  1088. html:'<div id="alarm_pic"></div>'
  1089. },alarmInfoForm]
  1090. }).hide();
  1091. // TODO
  1092. /* var showRtuInfoWin = function (record) {
  1093. alarmInfoForm.show();
  1094. $("#VInfoWin_Title").html(record.get('data'));
  1095. Ext.getCmp('uf_company_name').setValue(record.get('company_name'));
  1096. Ext.getCmp('uf_name').setValue(record.get('name'));
  1097. Ext.getCmp('uf_device_code').setValue(record.get('device_code'));
  1098. Ext.getCmp('uf_fullname').setValue(record.get('fullname'));
  1099. Ext.getCmp('uf_clr').setValue(record.get('clr_name'));
  1100. Ext.getCmp('uf_clsj').setValue(record.get('clsj'));
  1101. Ext.getCmp('uf_clnr').setValue(record.get('clnr'));
  1102. Ext.getCmp('uf_id').setValue(record.get('id'));
  1103. Ext.getCmp('uf_clwb').setValue(record.get('clwb') == '1' ? '误报' : '告警');
  1104. Ext.getCmp('uf_status').setValue(record.get('status'));
  1105. if (record.get('clzt') == '已处理') {
  1106. Ext.getCmp('uf_clwb').setVisible(true);
  1107. Ext.getCmp('uf_r_clwb').setVisible(false);
  1108. Ext.getCmp('uf_r_clfw').setVisible(false);
  1109. Ext.getCmp('confirmBtn').setVisible(false);
  1110. Ext.getCmp('uf_clr').setVisible(true);
  1111. Ext.getCmp('uf_clsj').setVisible(true);
  1112. } else {
  1113. Ext.getCmp('uf_clwb').setVisible(false);
  1114. Ext.getCmp('uf_r_clwb').setVisible(true);
  1115. Ext.getCmp('uf_r_clfw').setVisible(true);
  1116. Ext.getCmp('confirmBtn').setVisible(true);
  1117. Ext.getCmp('uf_clr').setVisible(false);
  1118. Ext.getCmp('uf_clsj').setVisible(false);
  1119. }
  1120. }*/
  1121. 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){
  1122. vAlarmInfoWin.show();
  1123. if((dwtype=='YTVA')||(dwtype=='16')){
  1124. vAlarmInfoWin.setWidth(780);
  1125. Ext.getCmp('picPanel').setWidth(360);
  1126. Ext.getCmp('picPanel').setHeight(270);
  1127. var img = document.createElement('img');
  1128. img.width=360;
  1129. img.height=270;
  1130. img.src = data2;
  1131. var alarm_pic = document.getElementById('alarm_pic');
  1132. alarm_pic.innerHTML='';
  1133. alarm_pic.appendChild(img);
  1134. }else{
  1135. vAlarmInfoWin.setWidth(780);
  1136. Ext.getCmp('picPanel').setWidth(360);
  1137. Ext.getCmp('picPanel').setHeight(270);
  1138. var img = document.createElement('img');
  1139. img.width=360;
  1140. img.height=270;
  1141. img.src = data;
  1142. var alarm_pic = document.getElementById('alarm_pic');
  1143. alarm_pic.innerHTML='';
  1144. alarm_pic.appendChild(img);
  1145. /* vAlarmInfoWin.setWidth(400);
  1146. Ext.getCmp('picPanel').setWidth(0);
  1147. Ext.getCmp('picPanel').setHeight(0);*/
  1148. }
  1149. $("#VInfoWin_Title").html(data);
  1150. Ext.getCmp('uf_company_name').setValue(company_name);
  1151. Ext.getCmp('uf_name').setValue(name);
  1152. Ext.getCmp('uf_device_code').setValue(device_code);
  1153. Ext.getCmp('uf_fullname').setValue(fullname);
  1154. Ext.getCmp('uf_clr').setValue(clr_name);
  1155. Ext.getCmp('uf_clsj').setValue(clsj);
  1156. Ext.getCmp('uf_clnr').setValue(clnr);
  1157. Ext.getCmp('uf_id').setValue(id);
  1158. Ext.getCmp('uf_clwb').setValue(clwb=='1'?'误报':'告警');
  1159. Ext.getCmp('uf_status').setValue(status);
  1160. Ext.getCmp('uf_dwtype').setValue(dwtype);
  1161. if(clzt=='已处理'){
  1162. vAlarmInfoWin.setHeight(460);
  1163. Ext.getCmp('uf_clwb').setVisible(true);
  1164. Ext.getCmp('uf_r_clwb').setVisible(false);
  1165. Ext.getCmp('uf_r_clfw').setVisible(false);
  1166. Ext.getCmp('confirmBtn').setVisible(false);
  1167. Ext.getCmp('uf_clr').setVisible(true);
  1168. Ext.getCmp('uf_clsj').setVisible(true);
  1169. if(dwtype=='YTVA')
  1170. vAlarmInfoWin.setPosition(
  1171. ($(document).innerWidth()-780)/2,
  1172. ($(document).innerHeight()-460)/2);
  1173. else
  1174. vAlarmInfoWin.setPosition(
  1175. ($(document).innerWidth()-400)/2,
  1176. ($(document).innerHeight()-460)/2);
  1177. }else{
  1178. vAlarmInfoWin.setHeight(400);
  1179. Ext.getCmp('uf_clwb').setVisible(false);
  1180. Ext.getCmp('uf_r_clwb').setVisible(true);
  1181. Ext.getCmp('uf_r_clfw').setVisible(true);
  1182. Ext.getCmp('confirmBtn').setVisible(true);
  1183. Ext.getCmp('uf_clr').setVisible(false);
  1184. Ext.getCmp('uf_clsj').setVisible(false);
  1185. if((dwtype=='YTVA')||(dwtype=='16'))
  1186. vAlarmInfoWin.setPosition(
  1187. ($(document).innerWidth()-780)/2,
  1188. ($(document).innerHeight()-400)/2);
  1189. else
  1190. vAlarmInfoWin.setPosition(
  1191. ($(document).innerWidth()-400)/2,
  1192. ($(document).innerHeight()-400)/2);
  1193. }
  1194. }
  1195. var RtuOptionPanel = Ext.create('Ext.grid.Panel', {
  1196. // title: 'RTU报告列表',
  1197. header: {
  1198. height: 0,
  1199. border: '0px solid #000000'
  1200. },
  1201. titleCollapse: true,
  1202. id: 'VRtuOptionListPanel',
  1203. region: 'center',
  1204. store: myStore,
  1205. // selModel: sm,
  1206. columns: [
  1207. {header: 'id', dataIndex: 'id', hidden: true, menuDisabled: true},
  1208. {header: '序号', dataIndex: 'orderIdx', width: 50, menuDisabled: true},
  1209. {header: '单位名称', dataIndex: 'company_name', width: 240, menuDisabled: true},
  1210. {header: '报告时间', dataIndex: 'time', width: 160, menuDisabled: true},
  1211. {header: '报告数据', dataIndex: 'data4', width: 140, menuDisabled: true},
  1212. {header: '报告内容', dataIndex: 'fullname', width: 900, minWidth: 400, maxWidth: 1600, menuDisabled: true},
  1213. {header: '处理状态', dataIndex: 'clzt', width: 100, menuDisabled: true},
  1214. {header: '处理人', dataIndex: 'clr_name', width: 150, menuDisabled: true},
  1215. {header: '处理时间', dataIndex: 'clsj', width: 160, menuDisabled: true}
  1216. ],
  1217. columnLines: true,
  1218. height: maxHeight,
  1219. width: '100%',
  1220. tbar: new Ext.create('Ext.toolbar.Toolbar', {
  1221. items: [{
  1222. html: '<span id="RtuPiePanel_title_string" style="color:#ffffff;background-color:rgba(0,0,0,0)">视频监控报告列表</span>'
  1223. }, '->', {
  1224. xtype: 'button',
  1225. iconCls: 'back_btn',
  1226. text: '<span style="color:#ffffff;background-color:rgba(0,0,0,0)">返回</span>',
  1227. listeners: {
  1228. click: function () {
  1229. location.href = baseUrl + 'view/frontpage/map.jsp?&theme=' + theme + '&company_code=' + company_code;
  1230. }
  1231. }
  1232. }, '-',
  1233. {
  1234. xtype: 'button',
  1235. iconCls: 'filter_btn',
  1236. text: '<span style="color:#ffffff;background-color:rgba(0,0,0,0)">筛选</span>',
  1237. listeners: {
  1238. click: filterwin
  1239. }
  1240. }, '-',
  1241. {
  1242. xtype: 'button',
  1243. iconCls: 'filter_btn',
  1244. text: '<span style="color:#ffffff;background-color:rgba(0,0,0,0)">导出</span>',
  1245. listeners: {
  1246. click: exportbtn_click
  1247. }
  1248. }, '-']
  1249. }),
  1250. bbar: new Ext.PagingToolbar({
  1251. store: myStore,
  1252. id: 'VRtuOptionListPageToolbar',
  1253. displayInfo: true,
  1254. pageSize: countPerPage,
  1255. prependButtons: true,
  1256. displayMsg: '显示第 {0}条到 {1}条记录,总共 {2}条',
  1257. emptyMsg: "没有记录",
  1258. firstText: '第一页',
  1259. prevText: '前一页',
  1260. nextText: '后一页',
  1261. lastText: '最后一页',
  1262. refreshText: '刷新'
  1263. }),
  1264. frame: true,
  1265. border: false,
  1266. iconCls: 'icon-grid',
  1267. listeners: {
  1268. 'celldblclick': function (grid, td, cellIndex, record, tr, rowIndex, e, eOpts) {
  1269. // alert(record.get('company_name')+','+record.get('id'));
  1270. show_alarm_info(dwtype,
  1271. record.data.status,
  1272. record.data.id,
  1273. record.data.name,
  1274. record.data.device_code,
  1275. record.data.company_code,
  1276. record.data.company_name,
  1277. record.data.fullname,
  1278. record.data.time,
  1279. record.data.data,
  1280. record.data.data2,
  1281. record.data.clzt,
  1282. record.data.clwb,
  1283. record.data.clr_name,
  1284. record.data.clnr,
  1285. record.data.clsj);
  1286. }
  1287. }
  1288. });
  1289. var piebar = Ext.create('Ext.panel.Panel', {
  1290. id: 'FirePiePanel',
  1291. width: '100%',
  1292. height: 498,
  1293. region: 'north',
  1294. layout: 'border',
  1295. defaults: {
  1296. border: false
  1297. },
  1298. html: '<div id="operation_body" class="operation_body">' +
  1299. '<div id="operation_dock_l" class="operation_dock_l"></div>' +
  1300. '<div id="operation_dock_r" class="operation_dock_r"></div>' +
  1301. '<img id="operation_title_icon" class="operation_title_icon" width="48" height="48" src="../../res/img/icons/video_03.png"/>' +
  1302. '<div id="operation_title_text" class="operation_title_text">视频监控告警处理情况</div>' +
  1303. '<div id="operation_label_1" class="operation_label_1">总数</div>' +
  1304. '<div id="operation_label_2" class="operation_label_2">已处理</div>' +
  1305. '<div id="operation_label_3" class="operation_label_3">未处理</div>' +
  1306. '<div id="operation_label_4" class="operation_label_4">处置率</div>' +
  1307. '<div id="operation_num_1" class="operation_num_1"></div>' +
  1308. '<div id="operation_num_2" class="operation_num_2"></div>' +
  1309. '<div id="operation_num_3" class="operation_num_3"></div>' +
  1310. '<div id="operation_num_4" class="operation_num_4"></div>' +
  1311. '<div id="operation_pie_bg" class="operation_pie_bg"></div>' +
  1312. '<div id="operation_pie" class="operation_pie"></div>' +
  1313. '<div id="operation_pie_title" class="operation_pie_title">处置率</div>' +
  1314. '<div id="operation_area_bg" class="operation_area_bg"></div>' +
  1315. '<div id="operation_area" class="operation_area"></div></div>'
  1316. });
  1317. pieMask = new Ext.LoadMask(piebar, {msg: "Loading..."});
  1318. new Ext.create('Ext.panel.Panel', {
  1319. width: '100%',
  1320. id: 'RtuAlarmPanel',
  1321. layout: 'border',
  1322. items: [
  1323. piebar, RtuOptionPanel
  1324. ],
  1325. renderTo: Ext.getBody()
  1326. });
  1327. myStore.reload();
  1328. // getCurrentData();
  1329. // maxHeight = document.documentElement.clientHeight;
  1330. // Ext.getCmp('RtuAlarmPanel').setHeight(maxHeight);
  1331. /* vAlarmInfoWin = Ext.create('Ext.window.Window',{
  1332. id:'VAlarmInfoWin',
  1333. title:'详细信息: <span id="VInfoWin_Title"></span>',
  1334. height:400,
  1335. width:400,
  1336. layout:'border',
  1337. closable:false,
  1338. modal:true,
  1339. closeAction:'hide',
  1340. items:[{
  1341. id:'picPanel',
  1342. region:'west',
  1343. width:300,
  1344. html:'<div id="alarm_pic"></div>'
  1345. },alarmInfoForm]
  1346. }).hide();
  1347. getCompanyInfo();*/
  1348. $(window).resize(function () {
  1349. body_resize();
  1350. });
  1351. body_resize();
  1352. });