document.js 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  1. Ext.ns('DOC');
  2. DOC = {
  3. columns:{
  4. LinkColumns:[{
  5. text:'ID',
  6. dataIndex:'dl_id',
  7. width:0,
  8. },{
  9. cls : "x-grid-header-1",
  10. text: '文档',
  11. dataIndex: 'dl_name',
  12. flex: 1,
  13. readOnly:true,
  14. renderer:function(val, meta, record){
  15. }
  16. },{
  17. cls : "x-grid-header-1",
  18. text: '链接目录',
  19. dataIndex: 'dl_manage',
  20. flex: 1,
  21. readOnly:true
  22. },{
  23. cls : "x-grid-header-1",
  24. text: '创建人',
  25. dataIndex: 'dpc_scan',
  26. flex: 1
  27. },{
  28. cls : "x-grid-header-1",
  29. text:'创建世间',
  30. dataIndex: 'dpc_create',
  31. flex: 1,
  32. readOnly:true
  33. }],
  34. PowerColumns:[{
  35. text:'ID',
  36. dataIndex:'dp_id',
  37. width:0,
  38. },{
  39. xtype:'actioncolumn',
  40. width:50,
  41. items: [{
  42. icon: 'resources/images/icon-edit.gif',
  43. padding:'0 0 0 5',
  44. style:'padding:"0 0 0 5"',
  45. tooltip: '修改',
  46. handler: function(grid, rowIndex, colIndex) {
  47. var rec = grid.getStore().getAt(rowIndex);
  48. var data=rec.data;
  49. Ext.Array.each(grid.ownerCt.powerSet,function(p){
  50. data[p]=data[p]?1:0;
  51. });
  52. var me=this;
  53. delete data['dp_type'];
  54. Ext.Ajax.request({//拿到form的items
  55. url : basePath + 'doc/updatePowerSet.action',
  56. params: {
  57. param:unescape(escape(Ext.JSON.encode(data)))
  58. },
  59. method : 'post',
  60. callback : function(options, success, response){
  61. showResult('提示','修改成功!',me);
  62. grid.ownerCt.loadNewStore();
  63. }
  64. });
  65. }
  66. },{
  67. icon: 'resources/images/icon-delete.gif',
  68. tooltip: '删除',
  69. handler: function(grid, rowIndex, colIndex) {
  70. var rec = grid.getStore().getAt(rowIndex);
  71. var me=this;
  72. Ext.Ajax.request({//拿到form的items
  73. url : basePath + 'doc/deletePowerSet.action',
  74. params:{
  75. param:unescape(escape(Ext.JSON.encode(rec.data)))
  76. },
  77. method : 'post',
  78. async:false,
  79. callback : function(options, success, response){
  80. showResult('提示','删除成功!',me);
  81. grid.ownerCt.loadNewStore();
  82. }
  83. });
  84. }
  85. }]
  86. },{
  87. cls : "x-grid-header-1",
  88. text: '人员/部门/岗位',
  89. dataIndex: 'dp_name',
  90. flex: 1
  91. },{
  92. cls : "x-grid-header-1",
  93. text: '管理',
  94. dataIndex: 'dp_control',
  95. flex: 1,
  96. xtype: 'checkcolumn',
  97. editor: {
  98. xtype: 'checkbox',
  99. cls: 'x-grid-checkheader-editor'
  100. }
  101. },{
  102. cls : "x-grid-header-1",
  103. text: '浏览',
  104. dataIndex: 'dp_see',
  105. flex: 1,
  106. xtype: 'checkcolumn',
  107. editor: {
  108. xtype: 'checkbox',
  109. cls: 'x-grid-checkheader-editor'
  110. }
  111. },{
  112. cls : "x-grid-header-1",
  113. text:'创建',
  114. dataIndex: 'dp_save',
  115. flex: 1,
  116. xtype: 'checkcolumn',
  117. editor: {
  118. xtype: 'checkbox',
  119. cls: 'x-grid-checkheader-editor'
  120. }
  121. },{
  122. cls : "x-grid-header-1",
  123. text:'阅读',
  124. dataIndex:'dp_read',
  125. flex:1,
  126. xtype: 'checkcolumn',
  127. editor: {
  128. xtype: 'checkbox',
  129. cls: 'x-grid-checkheader-editor'
  130. }
  131. },{
  132. cls:'x-grid-header-1',
  133. text:'删除',
  134. dataIndex:'dp_delete',
  135. flex:1,
  136. xtype: 'checkcolumn',
  137. editor: {
  138. xtype: 'checkbox',
  139. cls: 'x-grid-checkheader-editor'
  140. }
  141. },{
  142. cls : "x-grid-header-1",
  143. text:'打印',
  144. dataIndex: 'dlp_print',
  145. xtype: 'checkcolumn',
  146. editor: {
  147. xtype: 'checkbox',
  148. cls: 'x-grid-checkheader-editor'
  149. }
  150. },{
  151. cls:'x-grid-header-1',
  152. text:'下载',
  153. readonly:true,
  154. dataIndex:'dp_download',
  155. xtype: 'checkcolumn',
  156. editor: {
  157. xtype: 'checkbox',
  158. cls: 'x-grid-checkheader-editor'
  159. }
  160. },{
  161. cls:'x-grid-header-1',
  162. text:'上传',
  163. readonly:true,
  164. dataIndex:'dp_upload',
  165. xtype: 'checkcolumn',
  166. editor: {
  167. xtype: 'checkbox',
  168. cls: 'x-grid-checkheader-editor'
  169. }
  170. },{
  171. cls:'x-grid-header-1',
  172. text:'角色类型',
  173. dataIndex:'dp_type',
  174. summaryType:'count'
  175. },{
  176. cls:'x-grid-header-1',
  177. width:0,
  178. dataIndex:'dp_table'
  179. },{
  180. cls:'x-grid-header-1',
  181. text:'表',
  182. readonly:true,
  183. width:0,
  184. flex:0,
  185. dataIndex:'dp_table'
  186. },{
  187. cls:'x-grid-header-1',
  188. text:'所属ID',
  189. readonly:true,
  190. width:0,
  191. flex:0,
  192. dataIndex:'dp_dclid'
  193. }],
  194. HistoryColumns:[{
  195. text:'ID',
  196. dataIndex:'dv_id',
  197. width:0,
  198. },{
  199. cls : "x-grid-header-1",
  200. text: '操作',
  201. xtype:'actioncolumn',
  202. flex: 0.5,
  203. items:[{
  204. icon: 'resources/images/icon-download.gif',
  205. tooltip: '下载',
  206. handler: function(grid, rowIndex, colIndex) {
  207. var me = this;
  208. var select=grid.getStore().getAt(rowIndex);
  209. if (!Ext.fly('ext-attach-download')) {
  210. var frm = document.createElement('form');
  211. frm.id = 'ext-attach-download';
  212. frm.name = id;
  213. frm.className = 'x-hidden';
  214. document.body.appendChild(frm);
  215. }
  216. Ext.Ajax.request({
  217. url: basePath + 'common/download.action?fileName=' + select.data.dv_name,
  218. method: 'post',
  219. form: Ext.fly('ext-attach-download'),
  220. isUpload: true,
  221. params: {
  222. escape : 1,
  223. path : unescape(select.data.dv_filepath)
  224. }
  225. });
  226. }
  227. },{
  228. icon: 'resources/images/icon-withdraw.gif',
  229. tooltip: '回退',
  230. handler: function(grid, rowIndex, colIndex) {
  231. }
  232. }]
  233. },{
  234. cls : "x-grid-header-1",
  235. text: '修订号',
  236. dataIndex: 'dv_detno',
  237. flex: 1,
  238. readOnly:true
  239. },{
  240. cls : "x-grid-header-1",
  241. text: '修改说明',
  242. dataIndex: 'dv_explain',
  243. flex: 1,
  244. readOnly:true
  245. },{
  246. cls : "x-grid-header-1",
  247. text:'操作人',
  248. dataIndex:'dv_man',
  249. flex:1,
  250. readOnly:true
  251. },{
  252. cls:'x-grid-header-1',
  253. text:'操作时间',
  254. dataIndex:'dv_time',
  255. flex:1,
  256. readOnly:true,
  257. xtype:"datecolumn",
  258. format:"Y-m-d H:i:s"
  259. }],
  260. ReviewColumns:[{
  261. cls : "x-grid-header-1",
  262. text: '操作',
  263. xtype:'actioncolumn',
  264. flex: 0.1,
  265. items:[{
  266. icon: 'resources/images/icon-delete.gif',
  267. tooltip: '删除',
  268. handler: function(grid, rowIndex, colIndex) {
  269. }
  270. }]
  271. },{
  272. text:'ID',
  273. dataIndex:'dr_id',
  274. width:0,
  275. },{
  276. cls : "x-grid-header-1",
  277. text: '评论人',
  278. dataIndex: 'dr_man',
  279. flex: 1,
  280. readOnly:true
  281. },{
  282. cls : "x-grid-header-1",
  283. text: '评论内容',
  284. dataIndex: 'dr_remark',
  285. flex: 1,
  286. readOnly:true
  287. },{
  288. cls : "x-grid-header-1",
  289. text: '评论时间',
  290. dataIndex: 'dr_date',
  291. xtype:'datecolumn',
  292. format:'Y-m-d H:i:s',
  293. flex: 1
  294. }],
  295. LogColumns:[{
  296. text:'ID',
  297. dataIndex:'dll_id',
  298. width:0,
  299. },{
  300. cls : "x-grid-header-1",
  301. text: '操作人',
  302. dataIndex: 'dll_man',
  303. flex: 1,
  304. readOnly:true,
  305. renderer:function(val, meta, record){
  306. }
  307. },{
  308. cls : "x-grid-header-1",
  309. text: '日志',
  310. dataIndex: 'dll_message',
  311. flex: 1,
  312. readOnly:true
  313. },{
  314. cls : "x-grid-header-1",
  315. text: '时间',
  316. dataIndex: 'dll_time',
  317. flex: 1
  318. }],
  319. RelateColumns:[{
  320. text:'ID',
  321. dataIndex:'dlr_id',
  322. width:0,
  323. },{
  324. text:'操作',
  325. xtype:'actioncolumn',
  326. flex: 0.1,
  327. items:[{
  328. icon: 'resources/images/icon-delete.gif',
  329. tooltip: '删除',
  330. handler: function(grid, rowIndex, colIndex) {
  331. }
  332. }]
  333. },{
  334. cls : "x-grid-header-1",
  335. text: '关联文档',
  336. dataIndex: 'dl_name',
  337. flex: 1,
  338. readOnly:true
  339. },{
  340. cls : "x-grid-header-1",
  341. text: '',
  342. dataIndex: 'dlr_dlid',
  343. width:0,
  344. readOnly:true
  345. },{
  346. cls : "x-grid-header-1",
  347. text: '目录',
  348. dataIndex: 'dl_virtualpath',
  349. flex: 1,
  350. readOnly:true
  351. },{
  352. cls : "x-grid-header-1",
  353. text: '时间',
  354. dataIndex: 'dlr_date',
  355. xtype:'datecolumn',
  356. format:'Y-m-d H:s:i',
  357. flex: 1
  358. }],
  359. BorrowColumns:[{
  360. text:'ID',
  361. dataIndex:'db_id',
  362. width:0,
  363. },{
  364. cls : "x-grid-header-1",
  365. text: '借出人',
  366. dataIndex: 'db_auditman',
  367. flex: 1,
  368. readOnly:true,
  369. renderer:function(val, meta, record){
  370. }
  371. },{
  372. cls : "x-grid-header-1",
  373. text: '借给',
  374. dataIndex: 'db_persons',
  375. flex: 1,
  376. readOnly:true
  377. },{
  378. cls : "x-grid-header-1",
  379. text: '收回时间',
  380. dataIndex: 'db_backtime',
  381. flex: 1
  382. },{
  383. cls : "x-grid-header-1",
  384. text:'剩余时间',
  385. dataIndex: 'db_remain',
  386. flex: 1,
  387. readOnly:true
  388. }]
  389. },
  390. fields:{
  391. PowerFields:[{
  392. name: 'dp_id',
  393. type: 'number'
  394. },{
  395. name:'dp_name',
  396. type:'string'
  397. },{
  398. name: 'dp_control',
  399. type:'bool'
  400. },{
  401. name:'dp_see',
  402. type:'bool'
  403. },{
  404. name:'dp_save',
  405. type:'bool'
  406. },{
  407. name:'dp_read',
  408. type:'bool'
  409. },{
  410. name:'dp_delete',
  411. type:'bool'
  412. },{
  413. name:'dp_print',
  414. type:'bool'
  415. },{
  416. name:'dp_download',
  417. type:'bool'
  418. },{
  419. name:'dp_upload',
  420. type:'bool'
  421. },{
  422. name:'dp_type',
  423. type:'string'
  424. },{
  425. name:'dp_table',
  426. type:'string'
  427. },{
  428. name:'dp_table',
  429. type:'string'
  430. },{
  431. name:'dp_dclid',
  432. type:'number'
  433. }],
  434. VersionFields:[{
  435. name: 'dv_id',
  436. type: 'number'
  437. },{
  438. name:'dv_dlid',
  439. type:'number'
  440. },{
  441. name:'dv_detno',
  442. type:'number'
  443. },{
  444. name: 'dv_name',
  445. type: 'string'
  446. },{
  447. name:'dv_filepath',
  448. type:'string'
  449. },{
  450. name:'dv_man',
  451. type:'string'
  452. },{
  453. name:'dv_time',
  454. type:'date'
  455. }],
  456. ReviewFields:[{
  457. name: 'dr_id',
  458. type: 'number'
  459. },{
  460. name:'dr_dlid',
  461. type:'number'
  462. },{
  463. name: 'dr_remark',
  464. type: 'string'
  465. },{
  466. name:'dr_man',
  467. type:'string'
  468. },{
  469. name:'dr_date',
  470. type:'date'
  471. }]
  472. }
  473. };