patrolpoint.js 56 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921
  1. /**
  2. * patrolpoint.js
  3. * 巡检点位管理界面
  4. * emial: yaoqiang@chinausky.com
  5. * create: 2018-12-08
  6. */
  7. Ext.Loader.setConfig({
  8. enabled: true
  9. });
  10. Ext.Loader.setPath('Ext.ux', '../../res/extjs/examples/ux');
  11. Ext.require([
  12. 'Ext.grid.*',
  13. 'Ext.data.*',
  14. 'Ext.ux.RowExpander',
  15. 'Ext.selection.CheckboxModel'
  16. ]);
  17. var company_code;
  18. var myStore = null;
  19. var myStore1 = null;
  20. var V_LOGINNAME = '', V_PASSWORD = '';
  21. var menuidx = '';
  22. var mouseon;
  23. var mouseoff;
  24. var menu_click;
  25. var baseUrl = '';
  26. var modifywin1;
  27. var MaintenanceCheckPanel1;
  28. //var MaintenanceCheckPanel2;
  29. var AllSelectedRecords = [];
  30. var AllSelectedRecords1 = [];
  31. var sm1;
  32. var sm2;
  33. var initflag = false;
  34. var initflag1 = false;
  35. var sm = Ext.create('Ext.selection.CheckboxModel');
  36. Ext.define('Maintenance', {
  37. extend: 'Ext.data.Model',
  38. fields: [
  39. { name: 'id', type: 'string' },
  40. { name: 'xh', type: 'int' },
  41. { name: 'spot_name', type: 'string' },
  42. { name: 'company_code', type: 'string' },
  43. { name: 'spot_address', type: 'string' },
  44. { name: 'spot_type', type: 'string' },
  45. { name: 'type_name', type: 'string' },
  46. { name: 'latest_change_time', type: 'string' },
  47. { name: 'building_name', type: 'string' },
  48. { name: 'equipment_code', type: 'string' },
  49. { name: 'remarks', type: 'string' },
  50. { name: 'picture_route', type: 'string' },
  51. ]
  52. });
  53. Ext.define('CheckRecord3', {
  54. extend: 'Ext.data.Model',
  55. fields: [
  56. { name: 'id', type: 'string' },
  57. { name: 'spot_id', type: 'string' },
  58. { name: 'xh', type: 'int' },
  59. { name: 'equipment_code', type: 'string' },
  60. { name: 'device_name', type: 'string' },
  61. { name: 'unitinfo', type: 'string' },
  62. ]
  63. });
  64. Ext.define('patrolpoint1', {
  65. extend: 'Ext.data.Model',
  66. fields: [
  67. { name: 'device_id', type: 'string' },
  68. { name: 'device_name', type: 'string' },
  69. { name: 'xh', type: 'int' },
  70. { name: 'unitinfo', type: 'string' },
  71. ]
  72. });
  73. Ext.define('patrolpoint2', {
  74. extend: 'Ext.data.Model',
  75. fields: [
  76. { name: 'device_id', type: 'string' },
  77. { name: 'device_name', type: 'string' },
  78. { name: 'xh', type: 'int' },
  79. { name: 'unitinfo', type: 'string' },
  80. { name: 'pd', type: 'string' },
  81. ]
  82. });
  83. function checkfilename() {
  84. var subwin = window.frames['file_uploader'].contentWindow;
  85. subwin.setpic();
  86. // add_pic();
  87. }
  88. function checkfilename2() {
  89. var subwin = window.frames['file_uploader2'].contentWindow;
  90. subwin.setpic2();
  91. // add_pic();
  92. }
  93. var add_pic = function () {
  94. Ext.create('Ext.window.Window', {
  95. id: 'patrol_point_pic_win',
  96. title: '图片上传',
  97. height: 200,
  98. width: 300,
  99. layout: 'fit',
  100. modal: true,
  101. buttons: [
  102. {
  103. text: '上传',
  104. handler: function () {
  105. var subwin = window.frames['file_uploader'].contentWindow;
  106. subwin.uploadpic();
  107. Ext.getCmp('patrol_point_pic_win').destroy();
  108. }
  109. }
  110. ,
  111. {
  112. text: '关闭',
  113. handler: function () {
  114. Ext.getCmp('patrol_point_pic_win').destroy();
  115. }
  116. }
  117. ],
  118. closeAction: 'destroy',
  119. html: '<div style="padding:20px;">点击上传按钮提交图片文件</div>'
  120. }).show();
  121. }
  122. function exportbtn_click() {
  123. baseUrl = document.getElementById('basePath').value;
  124. V_LOGINNAME = $("#V_LOGINNAME").val();
  125. V_PASSWORD = $("#V_PASSWORD").val();
  126. spot_name = document.getElementById('spot_name').value;
  127. spot_address = document.getElementById('spot_address').value;
  128. var fields = '';
  129. var array = ['id', 'spot_name', 'building_name', 'spot_address', 'type_name', 'spot_label_analysis', 'remarks', 'latest_change_time'];
  130. var excelname = ['编号', '点位名称', '所属建筑/项目', '点位地址', '设备类型', '点位标签', '点位备注', '最新改动时间'];
  131. for (var i = 0; i < 8; i++) {
  132. if (i > 0)
  133. fields += ',';
  134. fields += '{id:"' + array[i] + '",title:"' + excelname[i] + '",shown:"' + true + '"}';
  135. }
  136. var query = new Object();
  137. query.V_LOGINNAME = V_LOGINNAME;
  138. // query.V_PASSWORD = V_PASSWORD;
  139. query.spot_name = spot_name;
  140. query.spot_address = spot_address;
  141. query.EXPORT_FILE = '巡检点位列表';
  142. query.fields = '[' + fields + ']';
  143. $.ajax({
  144. type: 'POST',
  145. url: baseUrl + "iot/excel/view/XjInspectionPointsExcel1",
  146. data: {
  147. queryJson: Ext.JSON.encode(query)
  148. },
  149. success: function (result) {
  150. var json = eval('(' + result + ')');
  151. if (json.action == 'dormExport') {
  152. ConfirmStore = json.RESULT;
  153. var elemIF = document.createElement("iframe");
  154. elemIF.src = baseUrl + json.filename;
  155. elemIF.style.display = "none";
  156. document.body.appendChild(elemIF);
  157. }
  158. }
  159. });
  160. }
  161. var file_result = function (text) {
  162. Ext.MessageBox.alert('错误信息', text);
  163. var hiddenFrame = document.getElementById('hiddenFrame');
  164. hiddenFrame.innerHTML = '<iframe id="file_uploader" width="0" height="0" frameborder="0" src="test.jsp"></iframe>';
  165. }
  166. var file_result2 = function (text) {
  167. Ext.MessageBox.alert('错误信息', text);
  168. var hiddenFrame2 = document.getElementById('hiddenFrame2');
  169. hiddenFrame2.innerHTML = '<iframe id="file_uploader2" width="0" height="0" frameborder="0" src="test2.jsp"></iframe>';
  170. }
  171. var get_file = function (name) {
  172. // alert("got file: '"+name+"'");
  173. Ext.MessageBox.alert('操作信息', '文件上传成功');
  174. document.getElementById('patrol_add_picture').setAttribute('src', baseUrl + name);
  175. Ext.getCmp('patrol_point_addURL').setValue(name);
  176. var hiddenFrame = document.getElementById('hiddenFrame');
  177. hiddenFrame.innerHTML = '<iframe id="file_uploader" width="0" height="0" frameborder="0" src="test.jsp"></iframe>';
  178. }
  179. var get_file2 = function (name) {
  180. // alert("got file: '"+name+"'");
  181. Ext.MessageBox.alert('操作信息', '文件上传成功');
  182. document.getElementById('patrol_upload_picture').setAttribute('src', baseUrl + name);
  183. Ext.getCmp('patrol_point_uploadURL').setValue(name);
  184. var hiddenFrame2 = document.getElementById('hiddenFrame2');
  185. hiddenFrame2.innerHTML = '<iframe id="file_uploader2" width="0" height="0" frameborder="0" src="test2.jsp"></iframe>';
  186. }
  187. var body_resize = function () {
  188. maxHeight = document.documentElement.clientHeight;
  189. maxWidth = document.documentElement.clientWidth;
  190. Ext.getCmp('PatrolpointPiebar').setHeight(maxHeight);
  191. Ext.getCmp('PatrolpointPiebar').setWidth(maxWidth);
  192. }
  193. Ext.onReady(function () {
  194. baseUrl = document.getElementById('basePath').value;
  195. var theme = document.getElementById('theme').value;
  196. var chkIcon = '<img src="' + baseUrl + 'res/img/common/check.gif"/>'
  197. var unchkIcon = '<img src="' + baseUrl + 'res/img/common/uncheck.gif"/>'
  198. // company_code = document.getElementById('company_code').value;
  199. $("#V_LOGINNAME").val(sessionStorage.getItem('V_LOGINNAME'));
  200. $("#V_PASSWORD").val(sessionStorage.getItem('V_PASSWORD'));
  201. V_LOGINNAME = $("#V_LOGINNAME").val();
  202. V_PASSWORD = $("#V_PASSWORD").val();
  203. var countPerPage = 15;
  204. var maxHeight = 10000;
  205. var chkBoolean = function (flag) {
  206. if (flag)
  207. return chkIcon;
  208. return unchkIcon;
  209. }
  210. var queryJson = new Object();
  211. queryJson.V_LOGINNAME = V_LOGINNAME;
  212. // queryJson.V_PASSWORD = V_PASSWORD;
  213. if ((company_code != null) && (company_code != 'null') && (company_code.length > 0))
  214. queryJson.company_code = company_code;
  215. Ext.define('QrcodeAnalysis2', {
  216. extend: 'Ext.data.Model',
  217. fields: [
  218. { name: 'building_name', type: 'string' },
  219. { name: 'building_id', type: 'string' }
  220. ]
  221. });
  222. var getManufacturerId2 = Ext.create('Ext.data.Store', {
  223. model: 'QrcodeAnalysis2',
  224. proxy: {
  225. type: 'ajax',
  226. actionMethods: {
  227. create: 'POST',
  228. read: 'POST', // by default GET
  229. update: 'POST',
  230. destroy: 'POST'
  231. },
  232. url: baseUrl + 'iot/company/view/getBuildingNameList',
  233. reader: {
  234. type: 'json',
  235. root: 'RESULT',
  236. totalProperty: 'totalCount'
  237. },
  238. extraParams: {
  239. queryJson: Ext.JSON.encode(queryJson)
  240. }
  241. }
  242. });
  243. var clear_append_form = function () {
  244. Ext.getCmp('fa_patrol_spot_name').setValue("");
  245. Ext.getCmp('fa_patrol_company_code').setValue("");
  246. Ext.getCmp('fa_patrol_spot_address').setValue("");
  247. // Ext.getCmp('fa_patrol_equipment_code').setValue("");
  248. Ext.getCmp('fa_patrol_spot_type').setValue(false);
  249. Ext.getCmp('fa_patrol_point_message').setValue("");
  250. // Ext.getCmp('fa_id').setValue("");
  251. Ext.getCmp('PatrolpointListPageToolbar').moveFirst();
  252. }
  253. var deselect_fun = function (record) {
  254. var index = AllSelectedRecords.indexOf(record.get("device_id"));
  255. if (index > -1) {
  256. AllSelectedRecords.splice(index, 1);
  257. return AllSelectedRecords;
  258. }
  259. }
  260. sm1 = Ext.create('Ext.selection.CheckboxModel', {
  261. mode: "MULTI",
  262. listeners: {
  263. deselect: function (me, record, index, opts) {
  264. if (initflag) {
  265. // alert("初始化");
  266. } else {
  267. deselect_fun(record);
  268. }
  269. },
  270. select: function (me, record, index, opts) {
  271. var index = AllSelectedRecords.indexOf(record.get("device_id"));
  272. if (index > -1) {
  273. return AllSelectedRecords;
  274. } else {
  275. AllSelectedRecords.push(record.get("device_id"));
  276. return AllSelectedRecords;
  277. }
  278. }
  279. }
  280. });
  281. var deselect_fun1 = function (record) {
  282. var index = AllSelectedRecords1.indexOf(record.get("device_id"));
  283. if (index > -1) {
  284. AllSelectedRecords1.splice(index, 1);
  285. return AllSelectedRecords1;
  286. }
  287. }
  288. sm2 = Ext.create('Ext.selection.CheckboxModel', {
  289. mode: "MULTI",
  290. listeners: {
  291. deselect: function (me, record, index, opts) {
  292. if (initflag1) {
  293. } else {
  294. deselect_fun1(record);
  295. }
  296. },
  297. select: function (me, record, index, opts) {
  298. var index = AllSelectedRecords1.indexOf(record.get("device_id"));
  299. if (index > -1) {
  300. return AllSelectedRecords1;
  301. } else {
  302. AllSelectedRecords1.push(record.get("device_id"));
  303. return AllSelectedRecords1;
  304. }
  305. }
  306. }
  307. });
  308. myStore = Ext.create('Ext.data.Store', {
  309. model: 'Maintenance',
  310. pageSize: countPerPage,
  311. proxy: {
  312. type: 'ajax',
  313. actionMethods: {
  314. create: 'POST',
  315. read: 'POST', // by default GET
  316. update: 'POST',
  317. destroy: 'POST'
  318. },
  319. url: baseUrl + 'iot/inspectionpoints/getList1',
  320. reader: {
  321. type: 'json',
  322. root: 'RESULT',
  323. totalProperty: 'totalCount'
  324. },
  325. extraParams: {
  326. queryJson: Ext.JSON.encode(queryJson)
  327. }
  328. },
  329. // sorters:[{
  330. // property:'data_time',
  331. // direction:'DESC'
  332. // }],
  333. remoteSort: true
  334. });
  335. myStore1 = Ext.create('Ext.data.Store', {
  336. model: 'CheckRecord3',
  337. pageSize: 10,
  338. proxy: {
  339. type: 'ajax',
  340. url: baseUrl + 'iot/inspectionpoints/getXzsbList',
  341. reader: {
  342. type: 'json',
  343. root: 'RESULT',
  344. totalProperty: 'totalCount'
  345. },
  346. extraParams: {
  347. queryJson: Ext.JSON.encode(queryJson)
  348. }
  349. },
  350. remoteSort: true
  351. });
  352. var myStore2 = Ext.create('Ext.data.Store', {
  353. model: 'patrolpoint1',
  354. pageSize: 5,
  355. listeners: {
  356. beforeload: function (me, store, operation, eOpts) {
  357. initflag = true;
  358. },
  359. load: function (me, records, success, opts) {
  360. if (!success || !records || records.length == 0)
  361. return;
  362. //根据全局的选择,初始化选中的列
  363. var selModel = Ext.getCmp('PatrolCheckListPanel2').getSelectionModel();
  364. Ext.Array.forEach(AllSelectedRecords, function (item) {
  365. for (var i = 0; i < records.length; i++) {
  366. var record = records[i];
  367. if (record.get("device_id") == item) {
  368. selModel.select(record, true, true); //选中record,并且保持现有的选择,不触发选中事件
  369. }
  370. }
  371. });
  372. // sm1.addListener('deselect',deselect_fun);
  373. initflag = false;
  374. }
  375. },
  376. proxy: {
  377. type: 'ajax',
  378. url: baseUrl + 'iot/inspectionpoints/getSbList',
  379. reader: {
  380. type: 'json',
  381. root: 'RESULT',
  382. totalProperty: 'totalCount'
  383. },
  384. extraParams: {
  385. queryJson: Ext.JSON.encode(queryJson)
  386. }
  387. },
  388. remoteSort: true
  389. });
  390. myStore2.on('load', function (myStore2, record) {
  391. for (var i = 0; i < record.length; i++) {
  392. var records = record[i];
  393. if (records.get('pd') == 1) {
  394. Ext.getCmp('PatrolCheckListPanel2').getSelectionModel().select(records, true);
  395. }
  396. };
  397. });
  398. var myStore3 = Ext.create('Ext.data.Store', {
  399. model: 'patrolpoint2',
  400. pageSize: 5,
  401. listeners: {
  402. beforeload: function (me, store, operation, eOpts) {
  403. initflag1 = true;
  404. },
  405. load: function (me, records, success, opts) {
  406. if (!success || !records || records.length == 0)
  407. return;
  408. //根据全局的选择,初始化选中的列
  409. var selModel = Ext.getCmp('PatrolCheckListPanel3').getSelectionModel();
  410. Ext.Array.forEach(AllSelectedRecords1, function (item) {
  411. for (var i = 0; i < records.length; i++) {
  412. var record = records[i];
  413. if (record.get("device_id") == item && record.get('pd') != 1) {
  414. selModel.select(record, true, true); //选中record,并且保持现有的选择,不触发选中事件
  415. }
  416. }
  417. });
  418. initflag1 = false;
  419. }
  420. },
  421. proxy: {
  422. type: 'ajax',
  423. url: baseUrl + 'iot/inspectionpoints/getSbList',
  424. reader: {
  425. type: 'json',
  426. root: 'RESULT',
  427. totalProperty: 'totalCount'
  428. },
  429. extraParams: {
  430. queryJson: Ext.JSON.encode(queryJson)
  431. }
  432. },
  433. remoteSort: true
  434. });
  435. myStore3.on('load', function (myStore3, record) {
  436. for (var i = 0; i < record.length; i++) {
  437. var records = record[i];
  438. var len = AllSelectedRecords1.length;
  439. for (var j = 0; j < len; j++) {
  440. if (AllSelectedRecords1[j] == records.get('device_id')) {
  441. Ext.getCmp('PatrolCheckListPanel3').getSelectionModel().select(records, true);
  442. }
  443. }
  444. };
  445. });
  446. var clear_modify_form = function () {
  447. Ext.getCmp('fm_patrol_spot_name').setValue("");
  448. Ext.getCmp('fm_patrol_company_code').setValue("");
  449. Ext.getCmp('fm_patrol_spot_address').setValue("");
  450. Ext.getCmp('fm_patrol_spot_type').setValue(false);
  451. Ext.getCmp('fm_patrol_point_message').setValue("");
  452. Ext.getCmp('fm_patrol_point_id').setValue("");
  453. Ext.getCmp('PatrolpointListPanel').getStore().reload();
  454. }
  455. var patrolUploadForm = Ext.create('Ext.form.Panel', {
  456. id: 'patrolUploadForm',
  457. labelWidth: 55,
  458. url: baseUrl + 'iot/inspectionpoints/update1',
  459. bodyPadding: 15,
  460. frame: true,
  461. labelAlign: 'left',
  462. region: 'north',
  463. enableDrop: true,
  464. ddGroup: 'treeID',
  465. height: 200,
  466. items: [{
  467. autoHeight: true,
  468. layout: 'column',
  469. border: false,
  470. items: [{
  471. columnWidth: .45,
  472. xtype: 'fieldset',
  473. layout: 'form',
  474. // defaults: {anchor: '95%'},
  475. style: 'margin-left: 5px;padding-left: 5px;border:0px solid #B5B8C8!important;',
  476. items: [
  477. {
  478. xtype: 'textfield',
  479. fieldLabel: '点位名称',
  480. id: 'fm_patrol_spot_name',
  481. name: 'spot_name',
  482. maxLength: 20,
  483. maxLengthText: '长度不得超出{0}',
  484. anchor: '50%'
  485. }, {
  486. fieldLabel: '所属建筑/项目',
  487. id: 'fm_patrol_company_code',
  488. name: 'company_code',
  489. xtype: 'combo',
  490. store: getManufacturerId2,
  491. displayField: 'building_name',
  492. valueField: 'building_id',
  493. editable: false,
  494. anchor: '50%'
  495. }, {
  496. xtype: 'textfield',
  497. fieldLabel: '点位地址',
  498. id: 'fm_patrol_spot_address',
  499. name: 'spot_address',
  500. maxLength: 30,
  501. maxLengthText: '长度不得超出{0}',
  502. anchor: '50%'
  503. }]
  504. }, {
  505. columnWidth: .55,
  506. xtype: 'fieldset',
  507. layout: 'form',
  508. // defaults: {anchor: '95%'},
  509. style: 'margin-left: 5px;padding-left: 5px;border:0px solid #B5B8C8!important;',
  510. items: [
  511. {
  512. xtype: 'textareafield',
  513. grow: true,
  514. height: 60,
  515. id: 'fm_patrol_point_message',
  516. name: 'message',
  517. fieldLabel: '备注',
  518. anchor: '50%'
  519. }, {
  520. xtype: 'checkboxgroup',
  521. fieldLabel: '设备类型',
  522. // defaultType:'radiofield',
  523. columns: 3,
  524. id: "fm_patrol_spot_type",
  525. // defaults:{
  526. // flex:1
  527. // },
  528. // layout:'hbox',
  529. items: [
  530. { boxLabel: '水系统', name: 'fm_patrol_water_type', inputValue: "1", id: 'radio81' },
  531. { boxLabel: '火系统', name: 'fm_patrol_fire_type', inputValue: "2", id: 'radio82' },
  532. { boxLabel: '电气火灾', name: 'fm_patrol_efire_type', inputValue: "3", id: 'radio83' },
  533. { boxLabel: '气体灭火', name: 'fm_patrol_extinguishing_type', inputValue: "4", id: 'radio84' },
  534. { boxLabel: 'RTU', name: 'fm_patrol_rtu_type', inputValue: "5", id: 'radio85' },
  535. { boxLabel: '视频监控', name: 'fm_patrol_view_type', inputValue: "6", id: 'radio86' },
  536. { boxLabel: '其他', name: 'fm_patrol_other_type', inputValue: "7", id: 'radio87' },
  537. ]
  538. }, {
  539. xtype: 'textfield',
  540. id: 'fm_patrol_point_queryJson',
  541. name: 'queryJson',
  542. hidden: true
  543. }, {
  544. xtype: 'textfield',
  545. name: 'uploadURL',
  546. id: 'patrol_point_uploadURL',
  547. hidden: true
  548. }, {
  549. xtype: 'textfield',
  550. id: 'fm_patrol_point_id',
  551. name: 'id',
  552. hidden: true
  553. }
  554. ]
  555. }
  556. ]
  557. }]
  558. });
  559. var patroladdForm = Ext.create('Ext.form.Panel', {
  560. id: 'patroladdForm',
  561. labelWidth: 55,
  562. url: baseUrl + 'iot/inspectionpoints/append1',
  563. bodyPadding: 15,
  564. frame: true,
  565. labelAlign: 'left',
  566. region: 'north',
  567. enableDrop: true,
  568. ddGroup: 'treeID',
  569. height: 200,
  570. items: [{
  571. autoHeight: true,
  572. layout: 'column',
  573. border: false,
  574. items: [{
  575. columnWidth: .45,
  576. xtype: 'fieldset',
  577. layout: 'form',
  578. // defaults: {anchor: '95%'},
  579. style: 'margin-left: 5px;padding-left: 5px;border:0px solid #B5B8C8!important;',
  580. items: [
  581. {
  582. xtype: 'textfield',
  583. fieldLabel: '点位名称',
  584. id: 'fa_patrol_spot_name',
  585. name: 'spot_name',
  586. maxLength: 20,
  587. maxLengthText: '长度不得超出{0}',
  588. anchor: '50%',
  589. listeners: {
  590. change: function (o, e) {
  591. if (e.length > 20) {
  592. Ext.getCmp('fa_patrol_spot_name').setValue(e.substring(0, 20));
  593. }
  594. }
  595. }
  596. }, {
  597. fieldLabel: '所属建筑/项目',
  598. id: 'fa_patrol_company_code',
  599. name: 'company_code',
  600. xtype: 'combo',
  601. store: getManufacturerId2,
  602. displayField: 'building_name',
  603. valueField: 'building_id',
  604. editable: false,
  605. anchor: '50%',
  606. listeners: {
  607. select: function (combo, record, index) {
  608. try {
  609. var label = this.value;
  610. var query = new Object();
  611. query.building_id = label;
  612. query.V_LOGINNAME = V_LOGINNAME;
  613. // query.V_PASSWORD = V_PASSWORD;
  614. var jsonstr = Ext.JSON.encode(query);
  615. myStore2.getProxy().extraParams = {
  616. queryJson: jsonstr
  617. };
  618. Ext.getCmp('PatrolCheckListPageToolbar2').moveFirst();
  619. }
  620. catch (ex) {
  621. Ext.MessageBox.alert("错误", "数据加载失败。");
  622. }
  623. }
  624. }
  625. }, {
  626. xtype: 'textfield',
  627. fieldLabel: '点位地址',
  628. id: 'fa_patrol_spot_address',
  629. name: 'spot_address',
  630. maxLength: 30,
  631. maxLengthText: '长度不得超出{0}',
  632. anchor: '50%',
  633. listeners: {
  634. change: function (o, e) {
  635. if (e.length > 30) {
  636. Ext.getCmp('fa_patrol_spot_address').setValue(e.substring(0, 30));
  637. }
  638. }
  639. }
  640. }]
  641. }, {
  642. columnWidth: .55,
  643. xtype: 'fieldset',
  644. layout: 'form',
  645. // defaults: {anchor: '95%'},
  646. style: 'margin-left: 5px;padding-left: 5px;border:0px solid #B5B8C8!important;',
  647. items: [
  648. {
  649. xtype: 'textareafield',
  650. grow: true,
  651. height: 60,
  652. id: 'fa_patrol_point_message',
  653. name: 'message',
  654. fieldLabel: '备注',
  655. anchor: '50%'
  656. }, {
  657. xtype: 'checkboxgroup',
  658. fieldLabel: '设备类型',
  659. // defaultType:'radiofield',
  660. columns: 3,
  661. id: "fa_patrol_spot_type",
  662. // defaults:{
  663. // flex:1
  664. // },
  665. // layout:'hbox',
  666. items: [
  667. { boxLabel: '水系统', name: 'fa_patrol_water_type', inputValue: "1", id: 'radio88' },
  668. { boxLabel: '火系统', name: 'fa_patrol_fire_type', inputValue: "2", id: 'radio89' },
  669. { boxLabel: '电气火灾', name: 'fa_patrol_efire_type', inputValue: "3", id: 'radio90' },
  670. { boxLabel: '气体灭火', name: 'fa_patrol_extinguishing_type', inputValue: "4", id: 'radio91' },
  671. { boxLabel: 'RTU', name: 'fa_patrol_rtu_type', inputValue: "5", id: 'radio92' },
  672. { boxLabel: '视频监控', name: 'fa_patrol_view_type', inputValue: "6", id: 'radio93' },
  673. { boxLabel: '其他', name: 'fa_patrol_other_type', inputValue: "7", id: 'radio94' },
  674. ]
  675. }, {
  676. xtype: 'textfield',
  677. id: 'fa_patrol_point_queryJson',
  678. name: 'queryJson',
  679. hidden: true
  680. }, {
  681. xtype: 'textfield',
  682. name: 'addURL',
  683. id: 'patrol_point_addURL',
  684. hidden: true
  685. }
  686. ]
  687. }
  688. ]
  689. }]
  690. });
  691. var upload_pic = function () {
  692. Ext.create('Ext.window.Window', {
  693. id: 'patrol_point_pic_win1',
  694. title: '图片上传',
  695. height: 200,
  696. width: 300,
  697. layout: 'fit',
  698. modal: true,
  699. buttons: [
  700. {
  701. text: '关闭',
  702. handler: function () {
  703. Ext.getCmp('patrol_point_pic_win1').destroy();
  704. }
  705. }
  706. ],
  707. closeAction: 'destroy',
  708. html: '<iframe src="test2.jsp" width=300 height=200 frameborder="no"></iframe>'
  709. }).show();
  710. }
  711. var patroladUploadForm = Ext.create('Ext.form.Panel', {
  712. id: 'patroladUploadForm',
  713. layout: 'form',
  714. // title:'设备图片:',
  715. items: [{
  716. layout: 'hbox',
  717. items: [{
  718. xtype: 'box',//或者xtype: 'component',
  719. title: '点位图片',
  720. id: 'patrol_upload_picture',
  721. width: 110,//图片宽度
  722. height: 110,//图片高度
  723. margin: '0 0 30 150',
  724. autoEl: {
  725. tag: 'img',//指定为img标签
  726. src: '../../res/img/common/shangchaun.png',
  727. style: 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);width:110px;height:110px;text-align:center;'
  728. },
  729. listeners: {
  730. render: function () {
  731. Ext.fly(this.el).on("click", function () {
  732. //                                upload_pic();
  733. checkfilename2();
  734. });
  735. }
  736. }
  737. }
  738. ]
  739. }]
  740. });
  741. var patroladaddForm = Ext.create('Ext.form.Panel', {
  742. id: 'patroladaddForm',
  743. layout: 'form',
  744. // title:'设备图片:',
  745. items: [{
  746. layout: 'hbox',
  747. items: [{
  748. xtype: 'box',//或者xtype: 'component',
  749. title: '点位图片',
  750. id: 'patrol_add_picture',
  751. width: 110,//图片宽度
  752. height: 110,//图片高度
  753. margin: '0 0 30 150',
  754. autoEl: {
  755. tag: 'img',//指定为img标签
  756. src: '../../res/img/common/shangchaun.png',
  757. style: 'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale);width:110px;height:110px;text-align:center;'
  758. },
  759. listeners: {
  760. render: function () {
  761. Ext.fly(this.el).on("click", function () {
  762. //                                add_pic();
  763. checkfilename();
  764. });
  765. }
  766. }
  767. }
  768. ]
  769. }]
  770. });
  771. var MaintenanceCheckPanel2 = Ext.create('Ext.grid.Panel', {
  772. header: {
  773. height: 0,
  774. border: '0px solid #000000'
  775. },
  776. id: 'PatrolCheckListPanel2',
  777. store: myStore2,
  778. selModel: sm1,
  779. columns: [
  780. { header: '设备编号', dataIndex: 'device_id', hidden: true, menuDisabled: true },
  781. { header: '序号', dataIndex: 'xh', width: 58, align: 'center', menuDisabled: true },
  782. { header: '设备名称', dataIndex: 'device_name', width: 247, align: 'center', menuDisabled: true },
  783. { header: '设备地址', dataIndex: 'unitinfo', width: 246, align: 'center', menuDisabled: true },
  784. {
  785. text: '设备详情',
  786. xtype: 'actioncolumn',
  787. width: 210,
  788. sortable: false,
  789. align: 'center',
  790. menuDisabled: true,
  791. items: [{
  792. icon: '../../res/img/common/tupianbtn.png',
  793. tooltip: '设备详情',
  794. handler: function (grid, rowIndex, colIndex) {
  795. var rec = grid.getStore().getAt(rowIndex);
  796. // alert(rec.get("dwid"));
  797. editMaintenance(rec.get("dwid"));
  798. }
  799. }]
  800. }
  801. ],
  802. columnLines: true,
  803. height: 195,
  804. width: 785,
  805. bbar: new Ext.PagingToolbar({
  806. store: myStore2,
  807. id: 'PatrolCheckListPageToolbar2',
  808. displayInfo: true,
  809. pageSize: 5,
  810. prependButtons: true,
  811. displayMsg: '显示第 {0}条到 {1}条记录,总共 {2}条',
  812. emptyMsg: "没有记录",
  813. firstText: '第一页',
  814. prevText: '前一页',
  815. nextText: '后一页',
  816. lastText: '最后一页',
  817. refreshText: '刷新',
  818. }),
  819. // frame: true,
  820. border: false,
  821. iconCls: 'icon-grid'
  822. });
  823. var MaintenanceCheckPanel3 = Ext.create('Ext.grid.Panel', {
  824. header: {
  825. height: 0,
  826. border: '0px solid #000000'
  827. },
  828. id: 'PatrolCheckListPanel3',
  829. store: myStore3,
  830. selModel: sm2,
  831. columns: [
  832. { header: '判断', dataIndex: 'pd', hidden: true, menuDisabled: true },
  833. { header: '设备编号', dataIndex: 'device_id', hidden: true, menuDisabled: true },
  834. { header: '序号', dataIndex: 'xh', width: 58, align: 'center', menuDisabled: true },
  835. { header: '设备名称', dataIndex: 'device_name', width: 247, align: 'center', menuDisabled: true },
  836. { header: '设备地址', dataIndex: 'unitinfo', width: 246, align: 'center', menuDisabled: true },
  837. {
  838. text: '设备详情',
  839. xtype: 'actioncolumn',
  840. width: 210,
  841. sortable: false,
  842. align: 'center',
  843. menuDisabled: true,
  844. items: [{
  845. icon: '../../res/img/common/tupianbtn.png',
  846. tooltip: '设备详情',
  847. handler: function (grid, rowIndex, colIndex) {
  848. var rec = grid.getStore().getAt(rowIndex);
  849. // alert(rec.get("dwid"));
  850. editMaintenance(rec.get("dwid"));
  851. }
  852. }]
  853. }
  854. ],
  855. columnLines: true,
  856. height: 195,
  857. width: 785,
  858. bbar: new Ext.PagingToolbar({
  859. store: myStore3,
  860. id: 'PatrolCheckListPageToolbar3',
  861. displayInfo: true,
  862. pageSize: 5,
  863. prependButtons: true,
  864. displayMsg: '显示第 {0}条到 {1}条记录,总共 {2}条',
  865. emptyMsg: "没有记录",
  866. firstText: '第一页',
  867. prevText: '前一页',
  868. nextText: '后一页',
  869. lastText: '最后一页',
  870. refreshText: '刷新',
  871. }),
  872. // frame: true,
  873. border: false,
  874. iconCls: 'icon-grid'
  875. });
  876. function public_update() {
  877. var patrol_point_uploadURL = Ext.getCmp('patrol_point_uploadURL').getValue();
  878. var fm_patrol_spot_name = Ext.getCmp('fm_patrol_spot_name').getValue();
  879. var fm_patrol_company_code = Ext.getCmp('fm_patrol_company_code').getValue();
  880. var fm_patrol_spot_address = Ext.getCmp('fm_patrol_spot_address').getValue();
  881. var fm_patrol_spot_type = Ext.getCmp('fm_patrol_spot_type').getChecked();
  882. var spot_type = '';
  883. Ext.Array.each(fm_patrol_spot_type, function (item) {
  884. spot_type += item.inputValue + ',';
  885. });
  886. var fm_patrol_point_message = Ext.getCmp('fm_patrol_point_message').getValue();
  887. var fm_patrol_point_id = Ext.getCmp('fm_patrol_point_id').getValue();
  888. var query = new Object();
  889. if (AllSelectedRecords1.length == 1) {
  890. query.equipment_code = AllSelectedRecords1[0];
  891. } else {
  892. if (AllSelectedRecords1.length > 1) {
  893. var spot_id = null;
  894. // var selected = sm1.getSelection( );
  895. for (var i = 0; i < AllSelectedRecords1.length; i++) {
  896. if (i == 0)
  897. spot_id = AllSelectedRecords1[i];
  898. else
  899. spot_id += "," + AllSelectedRecords1[i];
  900. }
  901. query.equipment_code = spot_id;
  902. }
  903. }
  904. query.id = fm_patrol_point_id;
  905. query.spot_name = fm_patrol_spot_name;
  906. query.company_code = fm_patrol_company_code;
  907. query.spot_address = fm_patrol_spot_address;
  908. // query.equipment_code = fm_patrol_equipment_code;
  909. query.spot_type = spot_type;
  910. query.remarks = fm_patrol_point_message;
  911. query.picture_route = patrol_point_uploadURL;
  912. query.V_LOGINNAME = V_LOGINNAME;
  913. // query.V_PASSWORD = V_PASSWORD;
  914. var jsonstr = Ext.JSON.encode(query);
  915. Ext.getCmp('fm_patrol_point_queryJson').setValue(jsonstr);
  916. Ext.getCmp('patrolUploadForm').submit({
  917. success: function (form, action) {
  918. // uploadPop.hide();
  919. Ext.getCmp('patrol_upload_picture').getEl().dom.src = '../../res/img/common/shangchaun.png';
  920. Ext.getCmp('patrolUploadForm').getForm().reset();
  921. Ext.getCmp('patroladUploadForm').getForm().reset();
  922. // uploadPanel.getStore().reload();
  923. Ext.Msg.alert('系统提示', '保存成功!');
  924. clear_modify_form();
  925. },
  926. failure: function (form, action) {
  927. Ext.Msg.alert('系统提示', '保存失败!');
  928. clear_modify_form();
  929. }
  930. });
  931. this.up('window').hide();
  932. }
  933. var patroluploadWin = Ext.create('Ext.window.Window', {
  934. id: 'patroluploadWin',
  935. title: '<div id="patrol_upload_win1">修改巡检点位</div>',
  936. height: 600,
  937. width: 800,
  938. // maximizable: true,
  939. modal: true,
  940. closeAction: 'hide',
  941. items: [
  942. patrolUploadForm, patroladUploadForm, MaintenanceCheckPanel3],
  943. buttons: [
  944. {
  945. text: '保存',
  946. iconCls: 'ok_btn',
  947. handler: function () {
  948. public_update();
  949. }
  950. }, {
  951. text: '取消',
  952. handler: function () {
  953. this.up('window').hide();
  954. Ext.getCmp('patrol_upload_picture').getEl().dom.src = '../../res/img/common/shangchaun.png';
  955. Ext.getCmp('patrolUploadForm').getForm().reset();
  956. Ext.getCmp('patroladUploadForm').getForm().reset();
  957. Ext.getCmp('PatrolpointListPageToolbar').moveFirst();
  958. }
  959. }]
  960. });
  961. function pulic_instrt() {
  962. var fa_patrol_spot_name = Ext.getCmp('fa_patrol_spot_name').getValue();
  963. if (fa_patrol_spot_name == "" || fa_patrol_spot_name == null) {
  964. Ext.Msg.alert('系统提示', '点位名称不能为空!');
  965. return;
  966. }
  967. var fa_patrol_company_code = Ext.getCmp('fa_patrol_company_code').getValue();
  968. if (fa_patrol_company_code == "" || fa_patrol_company_code == null) {
  969. Ext.Msg.alert('系统提示', '请选择所属建筑/项目!');
  970. return;
  971. }
  972. var fa_patrol_spot_address = Ext.getCmp('fa_patrol_spot_address').getValue();
  973. if (fa_patrol_spot_address == "" || fa_patrol_spot_address == null) {
  974. Ext.Msg.alert('系统提示', '点位地址不能为空!');
  975. return;
  976. }
  977. var fa_patrol_spot_type = Ext.getCmp('fa_patrol_spot_type').getChecked();
  978. var spot_type = '';
  979. Ext.Array.each(fa_patrol_spot_type, function (item) {
  980. spot_type += item.inputValue + ',';
  981. });
  982. var fa_patrol_point_message = Ext.getCmp('fa_patrol_point_message').getValue();
  983. var patrol_point_addURL = Ext.getCmp('patrol_point_addURL').getValue();
  984. if (patrol_point_addURL == "" || patrol_point_addURL == null) {
  985. Ext.Msg.alert('系统提示', '请上传图标' + fa_patrol_spot_type);
  986. return;
  987. }
  988. var query = new Object();
  989. query.spot_name = fa_patrol_spot_name;
  990. query.company_code = fa_patrol_company_code;
  991. query.spot_address = fa_patrol_spot_address;
  992. query.spot_type = spot_type;
  993. query.remarks = fa_patrol_point_message;
  994. query.picture_route = patrol_point_addURL;
  995. if (AllSelectedRecords.length == 1) {
  996. query.equipment_code = AllSelectedRecords[0];
  997. } else {
  998. if (AllSelectedRecords.length > 1) {
  999. var spot_id = null;
  1000. for (var i = 0; i < AllSelectedRecords.length; i++) {
  1001. if (i == 0)
  1002. spot_id = AllSelectedRecords[i];
  1003. else
  1004. spot_id += "," + AllSelectedRecords[i];
  1005. }
  1006. query.equipment_code = spot_id;
  1007. }
  1008. }
  1009. query.V_LOGINNAME = V_LOGINNAME;
  1010. // query.V_PASSWORD = V_PASSWORD;
  1011. var jsonstr = Ext.JSON.encode(query);
  1012. Ext.getCmp('fa_patrol_point_queryJson').setValue(jsonstr);
  1013. Ext.getCmp('patroladdForm').submit({
  1014. success: function (form, action) {
  1015. // addPop.hide();
  1016. Ext.getCmp('patrol_add_picture').getEl().dom.src = '../../res/img/common/shangchaun.png';
  1017. Ext.getCmp('patroladdForm').getForm().reset();
  1018. Ext.getCmp('patroladaddForm').getForm().reset();
  1019. // uploadPanel.getStore().reload();
  1020. Ext.Msg.alert('系统提示', '保存成功!');
  1021. clear_append_form();
  1022. },
  1023. failure: function (form, action) {
  1024. Ext.Msg.alert('系统提示', '保存失败!');
  1025. clear_append_form();
  1026. }
  1027. });
  1028. }
  1029. var patroladdWin = Ext.create('Ext.window.Window', {
  1030. id: 'patroladdWin',
  1031. title: '增加巡检点位',
  1032. height: 600,
  1033. width: 800,
  1034. // maximizable: true,
  1035. modal: true,
  1036. closeAction: 'hide',
  1037. items: [
  1038. patroladdForm, patroladaddForm, MaintenanceCheckPanel2
  1039. ],
  1040. buttons: [
  1041. {
  1042. text: '保存',
  1043. handler: function () {
  1044. pulic_instrt();
  1045. }
  1046. }, {
  1047. text: '取消',
  1048. handler: function () {
  1049. this.up('window').hide();
  1050. Ext.getCmp('patrol_add_picture').getEl().dom.src = '../../res/img/common/shangchaun.png';
  1051. Ext.getCmp('patroladdForm').getForm().reset();
  1052. Ext.getCmp('patroladaddForm').getForm().reset();
  1053. Ext.getCmp('PatrolpointListPageToolbar').moveFirst();
  1054. }
  1055. }]
  1056. });
  1057. var addhtml = function () {
  1058. var adaddFormhtml = document.getElementById('patroladaddForm');
  1059. var title = document.createElement('div');
  1060. title.setAttribute('class', 'Maintenancediv_title');
  1061. title.innerHTML = '点位图片:';
  1062. adaddFormhtml.appendChild(title);
  1063. }
  1064. var uploadhtml = function () {
  1065. var uploadFormhtml = document.getElementById('patroladUploadForm');
  1066. var title = document.createElement('div');
  1067. title.setAttribute('class', 'Maintenancediv_title');
  1068. title.innerHTML = '点位图片:';
  1069. uploadFormhtml.appendChild(title);
  1070. }
  1071. var uploadPop = function () {
  1072. patroluploadWin.show();
  1073. uploadhtml();
  1074. }
  1075. var addPop = function () {
  1076. AllSelectedRecords.length = 0;
  1077. var query = new Object();
  1078. query.V_LOGINNAME = $("#V_LOGINNAME").val();
  1079. // query.V_PASSWORD = $("#V_PASSWORD").val();
  1080. var jsonstr = Ext.JSON.encode(query);
  1081. myStore2.getProxy().extraParams = {
  1082. queryJson: jsonstr
  1083. };
  1084. Ext.getCmp('PatrolCheckListPageToolbar2').moveFirst();
  1085. patroladdWin.show();
  1086. addhtml();
  1087. }
  1088. var chk_sm = function () {
  1089. if (sm.getCount() == 1) {
  1090. var selected = sm.getSelection();
  1091. var b = selected[0].raw.equipment_code_list;
  1092. AllSelectedRecords1 = b.split(",");
  1093. getManufacturerId2.reload();
  1094. var div = Ext.getCmp('fm_patrol_company_code');
  1095. var label = selected[0].raw.id
  1096. var query = new Object();
  1097. // if(label.length>0){
  1098. query.dwid = label;
  1099. // }
  1100. query.building_id = selected[0].raw.company_code;
  1101. query.V_LOGINNAME = V_LOGINNAME;
  1102. // query.V_PASSWORD = V_PASSWORD;
  1103. var jsonstr = Ext.JSON.encode(query);
  1104. myStore3.getProxy().extraParams = {
  1105. queryJson: jsonstr
  1106. };
  1107. Ext.getCmp('PatrolCheckListPageToolbar3').moveFirst();
  1108. uploadPop();
  1109. Ext.getCmp('fm_patrol_point_id').setValue(selected[0].raw.id);
  1110. Ext.getCmp('fm_patrol_spot_name').setValue(selected[0].raw.spot_name);
  1111. div.setValue(selected[0].raw.company_code);
  1112. Ext.getCmp('fm_patrol_spot_address').setValue(selected[0].raw.spot_address);
  1113. var a = selected[0].raw.spot_type;
  1114. // if(Number(a) ==1){
  1115. // var radio = Ext.getCmp('radio81');
  1116. // radio.setValue(true);
  1117. // }else if(Number(a)==2){
  1118. // var radio = Ext.getCmp('radio82');
  1119. // radio.setValue(true);
  1120. // }else if(Number(a)==3){
  1121. // var radio = Ext.getCmp('radio83');
  1122. // radio.setValue(true);
  1123. // }else if(Number(a)==4){
  1124. // var radio = Ext.getCmp('radio84');
  1125. // radio.setValue(true);
  1126. // }else if(Number(a)==5){
  1127. // var radio = Ext.getCmp('radio85');
  1128. // radio.setValue(true);
  1129. // }else if(Number(a)==6){
  1130. // var radio = Ext.getCmp('radio86');
  1131. // radio.setValue(true);
  1132. // }else if(Number(a)==7){
  1133. // var radio = Ext.getCmp('radio87');
  1134. // radio.setValue(true);
  1135. // }
  1136. var arr = a.split(",");
  1137. for (var i = 0; i < arr.length; i++) {
  1138. switch (arr[i]) {
  1139. case "1":
  1140. Ext.getCmp('radio81').setValue(true);
  1141. break;
  1142. case "2":
  1143. Ext.getCmp('radio82').setValue(true);
  1144. break;
  1145. case "3":
  1146. Ext.getCmp('radio83').setValue(true);
  1147. break;
  1148. case "4":
  1149. Ext.getCmp('radio84').setValue(true);
  1150. break;
  1151. case "5":
  1152. Ext.getCmp('radio85').setValue(true);
  1153. break;
  1154. case "6":
  1155. Ext.getCmp('radio86').setValue(true);
  1156. break;
  1157. case "7":
  1158. Ext.getCmp('radio87').setValue(true);
  1159. break;
  1160. }
  1161. }
  1162. Ext.getCmp('fm_patrol_point_message').setValue(selected[0].raw.remarks);
  1163. Ext.getCmp('patrol_point_uploadURL').setValue(selected[0].raw.picture_route);
  1164. var formPanel = Ext.getCmp('patroladUploadForm');
  1165. var imageShow_box = formPanel.down('box[id=patrol_upload_picture]');//预览的图片框对象
  1166. var imageShow_box_dom = imageShow_box.getEl().dom;
  1167. imageShow_box_dom.src = baseUrl + (selected[0].raw.picture_route);
  1168. } else {
  1169. Ext.Msg.alert('请先选择', '请先选择一条记录,再点击修改');
  1170. }
  1171. }
  1172. var del_sm = function () {
  1173. if (sm.getCount() == 1) {
  1174. var selected = sm.getSelection();
  1175. var query = new Object();
  1176. var list = new Array();
  1177. var o = new Object();
  1178. o.id = selected[0].raw.id;
  1179. list.push(o);
  1180. query.ID_LIST = list;
  1181. var jsonstr = Ext.JSON.encode(query);
  1182. Ext.MessageBox.confirm('删除巡检点位', '是否删除' + selected[0].raw.spot_name + ' 巡检点位?', function (btn) {
  1183. if (btn == 'yes') {
  1184. $.ajax({
  1185. type: 'POST',
  1186. url: baseUrl + "iot/inspectionpoints/del",
  1187. data: {
  1188. queryJson: jsonstr
  1189. },
  1190. success: function (result) {
  1191. var json = eval('(' + result + ')');
  1192. if (json.action == 'deleteInspectionPoints') {
  1193. if (json.success == true) {
  1194. Ext.Msg.alert('操作成功', json.MSG, function (btn, txt) {
  1195. Ext.getCmp('PatrolpointListPanel').getStore().reload();
  1196. });
  1197. } else {
  1198. Ext.Msg.alert('操作失败', json.MSG, function (btn, txt) {
  1199. Ext.getCmp('PatrolpointListPanel').getStore().reload();
  1200. });
  1201. }
  1202. }
  1203. }
  1204. });
  1205. }
  1206. }, this);
  1207. } else {
  1208. if (sm.getCount() > 1) {
  1209. var query = new Object();
  1210. var list = new Array();
  1211. for (var i = 0; i < sm.getCount(); i++) {
  1212. var selected = sm.getSelection();
  1213. var o = new Object();
  1214. o.id = selected[i].raw.id;
  1215. list.push(o);
  1216. }
  1217. query.ID_LIST = list;
  1218. var jsonstr = Ext.JSON.encode(query);
  1219. Ext.MessageBox.confirm('删除巡检点位', '是否删除选中的' + sm.getCount() + ' 个巡检点位?', function (btn) {
  1220. if (btn == 'yes') {
  1221. $.ajax({
  1222. type: 'POST',
  1223. url: baseUrl + "iot/inspectionpoints/del",
  1224. data: {
  1225. queryJson: jsonstr
  1226. },
  1227. success: function (result) {
  1228. var json = eval('(' + result + ')');
  1229. if (json.action == 'deleteInspectionPoints') {
  1230. if (json.success == true) {
  1231. Ext.Msg.alert('操作成功', json.MSG, function (btn, txt) {
  1232. Ext.getCmp('PatrolpointListPanel').getStore().reload();
  1233. });
  1234. } else {
  1235. Ext.Msg.alert('操作失败', json.MSG, function (btn, txt) {
  1236. Ext.getCmp('PatrolpointListPanel').getStore().reload();
  1237. });
  1238. }
  1239. }
  1240. }
  1241. });
  1242. }
  1243. }, this);
  1244. } else {
  1245. Ext.Msg.alert('请先选择', '至少选择一条记录,再点击删除');
  1246. }
  1247. }
  1248. }
  1249. var show_page = function () {
  1250. var patrolpoint_title2_input = document.getElementById('patrolpoint_title2_input').value;
  1251. var patrolpoint_title3_input1 = document.getElementById('patrolpoint_title3_input1').value;
  1252. var query = new Object();
  1253. if (patrolpoint_title2_input.length > 0) {
  1254. query.spot_name = patrolpoint_title2_input;
  1255. $("#spot_name").val(patrolpoint_title2_input);
  1256. }
  1257. if (patrolpoint_title3_input1.length > 0) {
  1258. query.spot_address = patrolpoint_title3_input1;
  1259. $("#spot_address").val(patrolpoint_title3_input1);
  1260. }
  1261. query.V_LOGINNAME = V_LOGINNAME;
  1262. // query.V_PASSWORD = V_PASSWORD;
  1263. var jsonstr = Ext.JSON.encode(query);
  1264. myStore.getProxy().extraParams = {
  1265. queryJson: jsonstr
  1266. };
  1267. Ext.getCmp('PatrolpointListPageToolbar').moveFirst();
  1268. }
  1269. var reset1 = function () {
  1270. document.getElementById('patrolpoint_title2_input').value = '';
  1271. document.getElementById('patrolpoint_title3_input1').value = '';
  1272. $("#spot_name").val("");
  1273. $("#spot_address").val("");
  1274. show_page();
  1275. }
  1276. mouseon = function (obj) {
  1277. var id = obj.id;
  1278. $("#" + id).removeClass(id);
  1279. $("#" + id).addClass(id + '_on');
  1280. }
  1281. mouseoff = function (obj) {
  1282. var mid = "patrolpoint_";
  1283. for (var i = 1; i < 7; i++) {
  1284. var id = "patrolpoint_title" + i + "_div";
  1285. $("#" + id).removeClass(id + '_on');
  1286. $("#" + id).addClass(id);
  1287. }
  1288. if (menuidx == 'm1') {
  1289. mid += 'title1_div';
  1290. $("#" + mid).removeClass(mid);
  1291. $("#" + mid).addClass(mid + '_on');
  1292. }
  1293. else if (menuidx == 'm2') {
  1294. mid += 'title2_div';
  1295. $("#" + mid).removeClass(mid);
  1296. $("#" + mid).addClass(mid + '_on');
  1297. }
  1298. else if (menuidx == 'm3') {
  1299. mid += 'title3_div';
  1300. $("#" + mid).removeClass(mid);
  1301. $("#" + mid).addClass(mid + '_on');
  1302. }
  1303. else if (menuidx == 'm4') {
  1304. mid += 'title4_div';
  1305. $("#" + mid).removeClass(mid);
  1306. $("#" + mid).addClass(mid + '_on');
  1307. }
  1308. else if (menuidx == 'm5') {
  1309. mid += 'title5_div';
  1310. $("#" + mid).removeClass(mid);
  1311. $("#" + mid).addClass(mid + '_on');
  1312. }
  1313. else if (menuidx == 'm6') {
  1314. mid += 'title6_div';
  1315. $("#" + mid).removeClass(mid);
  1316. $("#" + mid).addClass(mid + '_on');
  1317. }
  1318. }
  1319. menu_click = function (obj) {
  1320. var id = obj.id;
  1321. if (id == 'patrolpoint_title1_div') {
  1322. menuidx = 'm1';
  1323. show_page();
  1324. }
  1325. else if (id == 'patrolpoint_title2_div') {
  1326. menuidx = 'm2';
  1327. reset1();
  1328. }
  1329. else if (id == 'patrolpoint_title3_div') {
  1330. menuidx = 'm3';
  1331. exportbtn_click();
  1332. }
  1333. else if (id == 'patrolpoint_title4_div') {
  1334. menuidx = 'm4';
  1335. del_sm();
  1336. }
  1337. else if (id == 'patrolpoint_title5_div') {
  1338. menuidx = 'm5';
  1339. addPop();
  1340. }
  1341. else if (id == 'patrolpoint_title6_div') {
  1342. menuidx = 'm6';
  1343. chk_sm();
  1344. }
  1345. }
  1346. var piedarHtml = function () {
  1347. var maintenanceHtml = document.getElementById('patrolpointHtml');
  1348. var title = document.createElement('div');
  1349. title.setAttribute('class', 'MaintenancePersonTitle');
  1350. title.innerHTML = '巡检点位';
  1351. maintenanceHtml.appendChild(title);
  1352. var title2 = document.createElement('div');
  1353. title2.setAttribute('class', 'title2_div');
  1354. title2.innerHTML = '点位名称';
  1355. maintenanceHtml.appendChild(title2);
  1356. var input = document.createElement('input');
  1357. input.setAttribute('class', 'input_class');
  1358. input.setAttribute('id', 'patrolpoint_title2_input');
  1359. input.setAttribute('type', 'text');
  1360. input.setAttribute('value', '');
  1361. maintenanceHtml.appendChild(input);
  1362. var title3 = document.createElement('div');
  1363. title3.setAttribute('class', 'title3_div');
  1364. title3.innerHTML = '点位地址';
  1365. maintenanceHtml.appendChild(title3);
  1366. var input1 = document.createElement('input');
  1367. input1.setAttribute('class', 'input1_class');
  1368. input1.setAttribute('id', 'patrolpoint_title3_input1');
  1369. input1.setAttribute('type', 'text');
  1370. input1.setAttribute('value', '');
  1371. maintenanceHtml.appendChild(input1);
  1372. var title4 = document.createElement('div');
  1373. title4.setAttribute('class', 'patrolpoint_title1_div');
  1374. title4.setAttribute('id', 'patrolpoint_title1_div');
  1375. title4.setAttribute('onmouseover', "mouseon(this)");
  1376. title4.setAttribute('onmouseout', "mouseoff(this)");
  1377. title4.setAttribute('onclick', "menu_click(this)");
  1378. maintenanceHtml.appendChild(title4);
  1379. var title5 = document.createElement('div');
  1380. title5.setAttribute('class', 'patrolpoint_title2_div');
  1381. title5.setAttribute('id', 'patrolpoint_title2_div');
  1382. title5.setAttribute('onmouseover', "mouseon(this)");
  1383. title5.setAttribute('onmouseout', "mouseoff(this)");
  1384. title5.setAttribute('onclick', "menu_click(this)");
  1385. maintenanceHtml.appendChild(title5);
  1386. var title6 = document.createElement('div');
  1387. title6.setAttribute('class', 'patrolpoint_title3_div');
  1388. title6.setAttribute('id', 'patrolpoint_title3_div');
  1389. title6.setAttribute('onmouseover', "mouseon(this)");
  1390. title6.setAttribute('onmouseout', "mouseoff(this)");
  1391. title6.setAttribute('onclick', "menu_click(this)");
  1392. maintenanceHtml.appendChild(title6);
  1393. var title7 = document.createElement('div');
  1394. title7.setAttribute('class', 'patrolpoint_title4_div');
  1395. title7.setAttribute('id', 'patrolpoint_title4_div');
  1396. title7.setAttribute('onmouseover', "mouseon(this)");
  1397. title7.setAttribute('onmouseout', "mouseoff(this)");
  1398. title7.setAttribute('onclick', "menu_click(this)");
  1399. maintenanceHtml.appendChild(title7);
  1400. var title8 = document.createElement('div');
  1401. title8.setAttribute('class', 'patrolpoint_title5_div');
  1402. title8.setAttribute('id', 'patrolpoint_title5_div');
  1403. title8.setAttribute('onmouseover', "mouseon(this)");
  1404. title8.setAttribute('onmouseout', "mouseoff(this)");
  1405. title8.setAttribute('onclick', "menu_click(this)");
  1406. maintenanceHtml.appendChild(title8);
  1407. var title9 = document.createElement('div');
  1408. title9.setAttribute('class', 'patrolpoint_title6_div');
  1409. title9.setAttribute('id', 'patrolpoint_title6_div');
  1410. title9.setAttribute('onmouseover', "mouseon(this)");
  1411. title9.setAttribute('onmouseout', "mouseoff(this)");
  1412. title9.setAttribute('onclick', "menu_click(this)");
  1413. maintenanceHtml.appendChild(title9);
  1414. }
  1415. var saveFile = function (data, filename) {
  1416. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
  1417. save_link.href = data;
  1418. save_link.download = filename;
  1419. var event = document.createEvent('MouseEvents');
  1420. event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  1421. save_link.dispatchEvent(event);
  1422. }
  1423. var downPng = function (canvas) {
  1424. console.log(canvas);
  1425. var img_data1 = Canvas2Image.saveAsPNG(canvas, true).getAttribute('src');
  1426. saveFile(img_data1, 'richer.png');
  1427. }
  1428. var cutDiv = function () {
  1429. var content = document.getElementById("patrolpoint_div_ceshi");
  1430. html2canvas(content, {
  1431. onrendered: function (canvas) {
  1432. downPng(canvas);
  1433. }
  1434. });
  1435. }
  1436. var maintenancelabel = function () {
  1437. var maintenance_look_label = document.getElementById('patrolpoint_look_label');
  1438. var div3 = document.createElement('div');
  1439. div3.setAttribute('id', 'patrolpoint_div_ceshi');
  1440. maintenance_look_label.appendChild(div3);
  1441. var div7 = document.createElement('div');
  1442. div7.style.width = '100%';
  1443. div7.style.height = '130px';
  1444. div7.style.textAlign = 'center';
  1445. div7.style.verticalAlign = 'middle';
  1446. div7.style.background = '#fff';
  1447. div7.setAttribute('id', 'patrolpoint_div_ceshi7');
  1448. div3.appendChild(div7);
  1449. var span = document.createElement('span');
  1450. span.style.height = '100%';
  1451. span.style.display = 'inline-block';
  1452. span.style.verticalAlign = 'middle';
  1453. div7.appendChild(span);
  1454. var img = document.createElement('img');
  1455. img.width = 110;
  1456. img.height = 100;
  1457. img.style.verticalAlign = 'middle';
  1458. // img.src = "../../tp/57988c26-20fd-4782-ac99-3aec6cb4d7ce.png";
  1459. img.src = baseUrl + ConfirmStore[0].spot_label_route;
  1460. div7.appendChild(img);
  1461. var div8 = document.createElement('div');
  1462. div8.style.width = '100%';
  1463. div8.style.height = '130px';
  1464. div8.style.background = '#0082fe';
  1465. div8.setAttribute('id', 'patrolpoint_div_ceshi8');
  1466. div3.appendChild(div8);
  1467. var div4 = document.createElement('div');
  1468. div4.style.textAlign = 'left';
  1469. div4.style.color = '#000';
  1470. div4.innerHTML = '点位名称:' + ConfirmStore[0].spot_name;
  1471. div8.appendChild(div4);
  1472. var div5 = document.createElement('div');
  1473. div5.style.textAlign = 'left';
  1474. div5.style.color = '#000';
  1475. div5.innerHTML = '点位地址:' + ConfirmStore[0].spot_address;
  1476. div8.appendChild(div5);
  1477. var div6 = document.createElement('div');
  1478. div6.style.textAlign = 'left';
  1479. div6.style.color = '#000';
  1480. div6.innerHTML = '点位编号:' + ConfirmStore[0].spot_label_analysis;
  1481. div8.appendChild(div6);
  1482. }
  1483. var editRow = function (spot_id) {
  1484. var spot_id = spot_id;
  1485. Ext.create('Ext.window.Window', {
  1486. id: 'patrolpoint_data_win',
  1487. height: 300,
  1488. width: 250,
  1489. layout: 'fit',
  1490. modal: true,
  1491. buttons: [
  1492. {
  1493. text: '下载',
  1494. handler: function () {
  1495. cutDiv();
  1496. }
  1497. }, {
  1498. text: '关闭',
  1499. handler: function () {
  1500. Ext.getCmp('patrolpoint_data_win').destroy();
  1501. }
  1502. }
  1503. ],
  1504. closeAction: 'destroy',
  1505. html: '<div id="patrolpoint_look_label"></div>'
  1506. }).show();
  1507. var query = new Object();
  1508. query.V_LOGINNAME = $("#V_LOGINNAME").val();
  1509. // query.V_PASSWORD = $("#V_PASSWORD").val();
  1510. query.id = spot_id;
  1511. $.ajax({
  1512. type: 'POST',
  1513. url: baseUrl + "iot/inspectionpoints/getList1",
  1514. data: {
  1515. queryJson: Ext.JSON.encode(query)
  1516. },
  1517. success: function (result) {
  1518. var json = eval('(' + result + ')');
  1519. if (json.action == 'getInspectionPointsList') {
  1520. ConfirmStore = json.RESULT;
  1521. maintenancelabel(ConfirmStore);
  1522. }
  1523. }
  1524. });
  1525. }
  1526. var maintenancedevice = function () {
  1527. var maintenance_look_device = document.getElementById('patrolpoint_look_device');
  1528. var div7 = document.createElement('div');
  1529. div7.style.width = '400px';
  1530. div7.style.height = '400px';
  1531. div7.style.textAlign = 'center';
  1532. div7.style.verticalAlign = 'middle';
  1533. // div7.style.background='#fff';
  1534. div7.setAttribute('id', 'patrolpoint_div_ceshi10');
  1535. maintenance_look_device.appendChild(div7);
  1536. if (ConfirmStore[0].picture_route) {
  1537. var img = document.createElement('img');
  1538. img.width = 400;
  1539. img.height = 400;
  1540. img.src = baseUrl + ConfirmStore[0].picture_route;
  1541. img.setAttribute('class', 'maintenance_look_device_img');
  1542. div7.appendChild(img);
  1543. } else {
  1544. var span = document.createElement('span');
  1545. span.style.height = '100%';
  1546. span.style.display = 'inline-block';
  1547. span.style.verticalAlign = 'middle';
  1548. div7.appendChild(span);
  1549. var img = document.createElement('img');
  1550. img.width = 110;
  1551. img.height = 110;
  1552. img.style.verticalAlign = 'middle';
  1553. img.src = '../../res/img/common/shangchaun.png';
  1554. img.setAttribute('class', 'maintenance_look_device_img');
  1555. img.setAttribute('onclick', "menu_click(this)");
  1556. div7.appendChild(img);
  1557. }
  1558. var div4 = document.createElement('div');
  1559. div4.style.textAlign = 'center';
  1560. div4.innerHTML = ConfirmStore[0].remarks;
  1561. maintenance_look_device.appendChild(div4);
  1562. }
  1563. var editMaintenance = function (spot_id) {
  1564. var spot_id = spot_id;
  1565. Ext.create('Ext.window.Window', {
  1566. id: 'patrolpoint_data_win1',
  1567. height: 500,
  1568. width: 400,
  1569. layout: 'fit',
  1570. modal: true,
  1571. buttons: [
  1572. {
  1573. text: '关闭',
  1574. handler: function () {
  1575. Ext.getCmp('patrolpoint_data_win1').destroy();
  1576. }
  1577. }
  1578. ],
  1579. closeAction: 'destroy',
  1580. html: '<div id="patrolpoint_look_device"></div>'
  1581. }).show();
  1582. var query = new Object();
  1583. query.V_LOGINNAME = $("#V_LOGINNAME").val();
  1584. // query.V_PASSWORD = $("#V_PASSWORD").val();
  1585. query.id = spot_id;
  1586. $.ajax({
  1587. type: 'POST',
  1588. url: baseUrl + "iot/inspectionpoints/getList1",
  1589. data: {
  1590. queryJson: Ext.JSON.encode(query)
  1591. },
  1592. success: function (result) {
  1593. var json = eval('(' + result + ')');
  1594. if (json.action == 'getInspectionPointsList') {
  1595. ConfirmStore = json.RESULT;
  1596. maintenancedevice(ConfirmStore);
  1597. }
  1598. }
  1599. });
  1600. }
  1601. var MaintenancePanel = Ext.create('Ext.grid.Panel', {
  1602. header: {
  1603. height: 0,
  1604. border: '0px solid #000000'
  1605. },
  1606. id: 'PatrolpointListPanel',
  1607. store: myStore,
  1608. selModel: sm,
  1609. columns: [
  1610. { header: 'ID', dataIndex: 'id', hidden: true, menuDisabled: true },
  1611. { header: 'equipment_code_list', dataIndex: 'equipment_code_list', hidden: true, menuDisabled: true },
  1612. { header: '图片路径', dataIndex: 'picture_route', hidden: true, menuDisabled: true },
  1613. { header: '序号', dataIndex: 'xh', width: 37, menuDisabled: true },
  1614. { header: '点位名称', dataIndex: 'spot_name', width: 300, align: 'center', menuDisabled: true },
  1615. // { header: '所属建筑/项目', dataIndex: 'building_name', width:300,align:'center', menuDisabled:true },
  1616. {
  1617. text: '点位标签',
  1618. xtype: 'actioncolumn',
  1619. width: 150,
  1620. sortable: false,
  1621. align: 'center',
  1622. menuDisabled: true,
  1623. items: [{
  1624. icon: '../../res/img/common/chakanbtn.png',
  1625. tooltip: '点位标签',
  1626. handler: function (grid, rowIndex, colIndex) {
  1627. var rec = grid.getStore().getAt(rowIndex);
  1628. editRow(rec.get("id"));
  1629. }
  1630. }]
  1631. },
  1632. { header: '点位地址', dataIndex: 'spot_address', width: 300, align: 'center', menuDisabled: true },
  1633. {
  1634. text: '对应对象',
  1635. xtype: 'actioncolumn',
  1636. width: 150,
  1637. sortable: false,
  1638. align: 'center',
  1639. menuDisabled: true,
  1640. items: [{
  1641. icon: '../../res/img/common/chakanbtn.png',
  1642. tooltip: '对应对象',
  1643. handler: function (grid, rowIndex, colIndex) {
  1644. var rec = grid.getStore().getAt(rowIndex);
  1645. // $("#checkRecord_id").val(rec.get("id"));
  1646. modifywin(rec.get("id"));
  1647. var label = rec.get("id");
  1648. var query = new Object();
  1649. // alert(label);
  1650. if (label.length > 0) {
  1651. query.id = label;
  1652. }
  1653. query.V_LOGINNAME = V_LOGINNAME;
  1654. // query.V_PASSWORD = V_PASSWORD;
  1655. var jsonstr = Ext.JSON.encode(query);
  1656. myStore1.getProxy().extraParams = {
  1657. queryJson: jsonstr
  1658. };
  1659. myStore1.reload();
  1660. }
  1661. }]
  1662. },
  1663. // { header: '设备类型', dataIndex: 'type_name',width:100, align:'center', menuDisabled:true },
  1664. { header: '最新改动时间', dataIndex: 'latest_change_time', width: 350, align: 'center', menuDisabled: true },
  1665. { header: '备注', dataIndex: 'remarks', hidden: true, menuDisabled: true },
  1666. { header: '类型值', dataIndex: 'spot_type', hidden: true, menuDisabled: true },
  1667. {
  1668. text: '点位详情',
  1669. xtype: 'actioncolumn',
  1670. width: 150,
  1671. sortable: false,
  1672. align: 'center',
  1673. menuDisabled: true,
  1674. items: [{
  1675. icon: '../../res/img/common/tupianbtn.png',
  1676. tooltip: '点位详情',
  1677. handler: function (grid, rowIndex, colIndex) {
  1678. var rec = grid.getStore().getAt(rowIndex);
  1679. editMaintenance(rec.get("id"));
  1680. }
  1681. }]
  1682. }
  1683. ],
  1684. columnLines: true,
  1685. height: maxHeight,
  1686. width: '100%',
  1687. bbar: new Ext.PagingToolbar({
  1688. store: myStore,
  1689. id: 'PatrolpointListPageToolbar',
  1690. displayInfo: true,
  1691. pageSize: countPerPage,
  1692. prependButtons: true,
  1693. displayMsg: '显示第 {0}条到 {1}条记录,总共 {2}条',
  1694. emptyMsg: "没有记录",
  1695. firstText: '第一页',
  1696. prevText: '前一页',
  1697. nextText: '后一页',
  1698. lastText: '最后一页',
  1699. refreshText: '刷新',
  1700. }),
  1701. // frame: true,
  1702. border: false,
  1703. iconCls: 'icon-grid',
  1704. });
  1705. MaintenanceCheckPanel1 = Ext.create('Ext.grid.Panel', {
  1706. header: {
  1707. height: 0,
  1708. border: '0px solid #000000'
  1709. },
  1710. id: 'PatrolCheckListPanel1',
  1711. store: myStore1,
  1712. // selModel: sm1,
  1713. columns: [
  1714. { header: 'ID', dataIndex: 'id', hidden: true, menuDisabled: true },
  1715. { header: '点位ID', dataIndex: 'spot_id', hidden: true, menuDisabled: true },
  1716. { header: '设备编号', dataIndex: 'equipment_code', hidden: true, menuDisabled: true },
  1717. { header: '序号', dataIndex: 'xh', width: 48, align: 'center', menuDisabled: true },
  1718. { header: '设备名称', dataIndex: 'device_name', width: 150, align: 'center', menuDisabled: true },
  1719. { header: '设备地址', dataIndex: 'unitinfo', width: 150, align: 'center', menuDisabled: true },
  1720. {
  1721. text: '设备详情',
  1722. xtype: 'actioncolumn',
  1723. width: 150,
  1724. sortable: false,
  1725. align: 'center',
  1726. menuDisabled: true,
  1727. items: [{
  1728. icon: '../../res/img/common/tupianbtn.png',
  1729. tooltip: '设备详情',
  1730. handler: function (grid, rowIndex, colIndex) {
  1731. var rec = grid.getStore().getAt(rowIndex);
  1732. // alert(rec.get("dwid"));
  1733. editMaintenance(rec.get("spot_id"));
  1734. }
  1735. }]
  1736. }
  1737. ],
  1738. columnLines: true,
  1739. height: 380,
  1740. width: 490,
  1741. bbar: new Ext.PagingToolbar({
  1742. store: myStore1,
  1743. id: 'PatrolCheckListPageToolbar1',
  1744. displayInfo: true,
  1745. pageSize: 10,
  1746. prependButtons: true,
  1747. displayMsg: '显示第 {0}条到 {1}条记录,总共 {2}条',
  1748. emptyMsg: "没有记录",
  1749. firstText: '第一页',
  1750. prevText: '前一页',
  1751. nextText: '后一页',
  1752. lastText: '最后一页',
  1753. refreshText: '刷新',
  1754. }),
  1755. // frame: true,
  1756. border: false,
  1757. iconCls: 'icon-grid'
  1758. });
  1759. modifywin1 = Ext.create('Ext.window.Window', {
  1760. title: '<div id="patrol_upload_win">对应对象</div>',
  1761. id: 'patrol_point_modify_win1',
  1762. height: 450,
  1763. width: 510,
  1764. modal: true,
  1765. layout: 'fit',
  1766. items: [MaintenanceCheckPanel1],
  1767. buttons: [
  1768. {
  1769. text: '关闭',
  1770. handler: function () {
  1771. Ext.getCmp('patrol_point_modify_win1').close();
  1772. }
  1773. }
  1774. ],
  1775. closeAction: 'hide'
  1776. })
  1777. var modifywin = function () {
  1778. modifywin1.show();
  1779. }
  1780. var piebar = Ext.create('Ext.panel.Panel', {
  1781. id: 'patrolpointHtml',
  1782. width: '100%',
  1783. height: 188,
  1784. region: 'north',
  1785. layout: 'form',
  1786. defaults: {
  1787. border: false
  1788. }
  1789. });
  1790. new Ext.create('Ext.panel.Panel', {
  1791. width: '100%',
  1792. id: 'PatrolpointPiebar',
  1793. layout: 'border',
  1794. items: [
  1795. piebar, MaintenancePanel
  1796. ],
  1797. renderTo: Ext.getBody()
  1798. });
  1799. myStore.reload();
  1800. $(window).resize(function () {
  1801. body_resize();
  1802. });
  1803. piedarHtml();
  1804. body_resize();
  1805. });