version.js 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. /**
  2. * version.js
  3. * 用户信息管理界面
  4. * emial: hanzhengyi@chinausky.com
  5. * create: 2018-12-12
  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. Ext.define('Buildingver',{
  18. extend: 'Ext.data.Model',
  19. fields: [
  20. { name:'I_BUILDINGVER_ID', type:'int' },
  21. { name:'I_ORDER_IDX', type:'int' },
  22. { name:'UQ_BUILDING_ID', type:'string' },
  23. { name:'V_BUILDING_NAME', type:'string' },
  24. { name:'UQ_POINT_ID', type:'string' },
  25. { name:'UQ_COMPANY_ID', type:'string' },
  26. { name:'V_AREA_ID', type:'string' },
  27. { name:'V_ADDR_0', type:'string' },
  28. { name:'V_ADDR_1', type:'string' },
  29. { name:'V_ADDR_2', type:'string' },
  30. { name:'I_MIN_FLOOR', type:'int' },
  31. { name:'I_MAX_FLOOR', type:'int' },
  32. { name:'F_FLOOR_SPACE', type:'string' },
  33. { name:'F_TOTAL_SPACE', type:'string' },
  34. { name:'F_BUILDING_HEIGHT', type:'string' },
  35. { name:'I_VERSION', type:'int' },
  36. { name:'V_COMMENT', type:'string' },
  37. { name:'D_STORETIME', type:'string' }
  38. ]
  39. });
  40. var baseUrl="";
  41. var sm = Ext.create('Ext.selection.CheckboxModel');
  42. Ext.onReady(function(){
  43. var baseUrl = document.getElementById('basePath').value;
  44. var buildingId = document.getElementById('buildingId').value;
  45. var chkIcon = '<img src="'+baseUrl+'/res/img/common/check.gif"/>'
  46. var unchkIcon = '<img src="'+baseUrl+'/res/img/common/uncheck.gif"/>'
  47. var countPerPage = 20;
  48. var maxHeight = 10000;
  49. var chkBoolean = function(flag) {
  50. if(flag)
  51. return chkIcon;
  52. return unchkIcon;
  53. }
  54. var backurl = function() {
  55. history.back();
  56. }
  57. var myVerStore = Ext.create('Ext.data.Store', {
  58. model: 'Buildingver',
  59. pageSize: countPerPage,
  60. proxy: {
  61. type: 'ajax',
  62. url: baseUrl+'/iot/building/getverList',
  63. reader: {
  64. type: 'json',
  65. root: 'RESULT',
  66. totalProperty: 'totalCount'
  67. },
  68. actionMethods: {
  69. read: 'POST'
  70. },
  71. extraParams : {
  72. queryJson : '{"UQ_BUILDING_ID" : "'+buildingId+'"}'
  73. }
  74. },
  75. remoteSort: true
  76. });
  77. // var states3 = Ext.create('Ext.data.Store', {
  78. // fields: ['status', 'name'],
  79. // data : [
  80. // {"status": "8", "name":"不选"},
  81. // {"status": "国家", "name":"国家"},
  82. // {"status": "省、直辖市、自治区、特别行政区", "name":"省、直辖市、自治区、特别行政区"},
  83. // {"status": "地区、市、自治州、盟", "name":"地区、市、自治州、盟"},
  84. // {"status": "县、市辖区、县级市、旗", "name":"县、市辖区、县级市、旗"},
  85. // ]
  86. // });
  87. var clear_filter_form = function(){
  88. Ext.getCmp('ff_V_BUILDING_NAME').setValue("");
  89. Ext.getCmp('ff_UQ_COMPANY_ID').setValue("");
  90. Ext.getCmp('ff_V_AREA_ID').setValue("");
  91. Ext.getCmp('ff_V_ADDR_0').setValue("");
  92. }
  93. var FilterForm = Ext.create('Ext.form.Panel', {
  94. id: 'BuildingFilterForm',
  95. labelWidth: 55,
  96. defaultType: 'textfield',
  97. bodyPadding: 15,
  98. items: [{
  99. fieldLabel:'建筑物名称',
  100. id: 'ff_V_BUILDING_NAME',
  101. name:'V_BUILDING_NAME',
  102. maxLength:20,
  103. maxLengthText:'长度不得超出{0}',
  104. anchor:'75%',
  105. value:document.getElementById('buildingName').value
  106. },{
  107. fieldLabel:'物业管理公司ID',
  108. id: 'ff_UQ_COMPANY_ID',
  109. name: 'UQ_COMPANY_ID',
  110. maxLength: 7,
  111. maxLengthText:'长度不得超出{0}',
  112. anchor:'75%',
  113. value:document.getElementById('companyId').value
  114. },{
  115. fieldLabel:'行政区域ID',
  116. id: 'ff_V_AREA_ID',
  117. name: 'V_AREA_ID',
  118. maxLength: 30,
  119. maxLengthText:'长度不得超出{0}',
  120. anchor:'75%',
  121. value:document.getElementById('areaId').value
  122. },{
  123. fieldLabel:'详细地址',
  124. id: 'ff_V_ADDR_0',
  125. name: 'V_ADDR_0',
  126. maxLength: 30,
  127. maxLengthText:'长度不得超出{0}',
  128. anchor:'75%',
  129. value:document.getElementById('addr0').value
  130. },{
  131. id:'ff_queryJson',
  132. name:'queryJson',
  133. hidden:true
  134. }],
  135. buttons: [{
  136. text: '提交',
  137. iconCls:'ok_btn',
  138. handler: function() {
  139. var form = this.up('form').getForm();
  140. if (form.isValid()) {
  141. var query = new Object();
  142. if(Ext.getCmp('ff_V_BUILDING_NAME').getValue().length>0)
  143. query.V_BUILDING_NAME = Ext.getCmp('ff_V_BUILDING_NAME').getValue();
  144. if(Ext.getCmp('ff_UQ_COMPANY_ID').getValue().length>0)
  145. query.UQ_COMPANY_ID = Ext.getCmp('ff_UQ_COMPANY_ID').getValue();
  146. if(Ext.getCmp('ff_V_AREA_ID').getValue().length>0)
  147. query.V_AREA_ID = Ext.getCmp('ff_V_AREA_ID').getValue();
  148. if(Ext.getCmp('ff_V_ADDR_0').getValue().length>0)
  149. query.V_ADDR_0 = Ext.getCmp('ff_V_ADDR_0').getValue();
  150. // if(Ext.getCmp('ff_E_LEVEL').getValue().length>0)
  151. // if(Ext.getCmp('ff_E_LEVEL').getValue()=='国家'){
  152. // query.E_LEVEL=0;
  153. // }
  154. // if(Ext.getCmp('ff_E_LEVEL').getValue()=='省、直辖市、自治区、特别行政区'){
  155. // query.E_LEVEL=1;
  156. // }
  157. // if(Ext.getCmp('ff_E_LEVEL').getValue()=='地区、市、自治州、盟'){
  158. // query.E_LEVEL=2;
  159. // }
  160. // if(Ext.getCmp('ff_E_LEVEL').getValue()=='县、市辖区、县级市、旗'){
  161. // query.E_LEVEL=3;
  162. // }
  163. query.V_Building_ID = buildingId;
  164. var jsonstr = Ext.JSON.encode(query);
  165. myVerStore.getProxy().extraParams = {
  166. queryJson : jsonstr
  167. };
  168. Ext.getCmp('BuildingListPageToolbar').moveFirst();
  169. Ext.getCmp('buildingName').setValue(query.V_BUILDING_NAME);
  170. Ext.getCmp('companyId').setValue(query.UQ_COMPANY_ID);
  171. Ext.getCmp('areaId').setValue(query.V_AREA_ID);
  172. Ext.getCmp('addr0').setValue(query.V_ADDR_0);
  173. // Ext.getCmp('level').setValue(Ext.getCmp('ff_E_LEVEL').getValue());
  174. clear_filter_form();
  175. this.up('window').hide();
  176. }
  177. }
  178. },{
  179. text: '关闭',
  180. iconCls: 'cancel_btn',
  181. handler: function() {
  182. this.up('window').hide();
  183. }
  184. }]
  185. });
  186. var filterwin = function() {
  187. Ext.create('Ext.window.Window',{
  188. id: 'BuildingFilterWin',
  189. title: '修改版本筛选',
  190. height: 300,
  191. width: 400,
  192. layout: 'fit',
  193. items: FilterForm,
  194. closeAction: 'hide'
  195. }).show();
  196. }
  197. Ext.create('Ext.grid.Panel', {
  198. title: '建筑信息修改记录',
  199. id: 'BuildingverListPanel',
  200. store: myVerStore,
  201. selModel: sm,
  202. columns: [
  203. { header: '建筑物名称', dataIndex: 'V_BUILDING_NAME', width:100,align:'center', menuDisabled:true },
  204. { header: '物业管理公司ID', dataIndex: 'UQ_COMPANY_ID', width:100, align:'center', menuDisabled:true },
  205. { header: '行政区域ID', dataIndex: 'V_AREA_ID', width:100,align:'center', menuDisabled:true },
  206. { header: '最低楼层', dataIndex: 'I_MIN_FLOOR', width:100,align:'center', menuDisabled:true },
  207. { header: '最高楼层', dataIndex: 'I_MAX_FLOOR', width:100, align:'center', menuDisabled:true },
  208. { header: '详细地址', dataIndex: 'V_ADDR_0', width:100,align:'center', menuDisabled:true },
  209. { header: '记录版本', dataIndex: 'I_VERSION', width:100, align:'center', menuDisabled:true },
  210. { header: '版本说明', dataIndex: 'V_COMMENT', width:150,align:'center', menuDisabled:true },
  211. { header: '保存时间', dataIndex: 'D_STORETIME',width:150, align:'center', menuDisabled:true },
  212. ],
  213. columnLines: true,
  214. tbar: [{
  215. xtype: 'button',
  216. iconCls:'back_btn',
  217. text: '返回',
  218. listeners : {
  219. click : backurl
  220. }
  221. },'-',{
  222. xtype: 'button',
  223. iconCls:'filter_btn',
  224. text: '筛选',
  225. listeners: {
  226. click: filterwin
  227. }
  228. }
  229. ],
  230. height: maxHeight,
  231. width: '100%',
  232. bbar: new Ext.PagingToolbar({
  233. store: myVerStore,
  234. id:'BuildingListPageToolbar',
  235. displayInfo: true,
  236. pageSize: countPerPage,
  237. prependButtons: true,
  238. displayMsg : '显示第 {0}条到 {1}条记录,总共 {2}条',
  239. emptyMsg : "没有记录",
  240. firstText: '第一页',
  241. prevText: '前一页',
  242. nextText: '后一页',
  243. lastText: '最后一页',
  244. refreshText: '刷新'
  245. // doRefresh:function(start){
  246. // alert(start);
  247. // relushDataFunction(start); // 调用函数刷新数据
  248. // this.cursor = start; // 更新页签
  249. // }
  250. }),
  251. frame: true,
  252. border:false,
  253. iconCls: 'icon-grid',
  254. renderTo: Ext.getBody()
  255. });
  256. myVerStore.load();
  257. maxHeight = document.documentElement.clientHeight;
  258. Ext.getCmp('BuildingverListPanel').setHeight(maxHeight);
  259. });