Optimize.js.svn-base 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. Ext.define('erp.view.ma.Optimize',{
  2. extend: 'Ext.Viewport',
  3. layout: 'anchor',
  4. hideBorders: true,
  5. initComponent : function(){
  6. var me = this;
  7. Ext.apply(me, {
  8. items: [{
  9. xtype: 'grid',
  10. id: 'check-grid',
  11. anchor: '100% 100%',
  12. tbar: ['->',{
  13. cls: 'x-btn-blue',
  14. id: 'check',
  15. text: '一键优化',
  16. width: 80,
  17. margin: '0 0 0 50'
  18. },{
  19. cls: 'x-btn-blue',
  20. id: 'close',
  21. text: $I18N.common.button.erpCloseButton,
  22. width: 80,
  23. margin: '0 0 0 5'
  24. },'->'],
  25. columns: [{
  26. text: '可优化项',
  27. dataIndex: 'value',
  28. flex: 10
  29. },{
  30. text: '',
  31. dataIndex: 'check',
  32. flex: 1,
  33. renderer: function(val, meta, record) {
  34. meta.tdCls = val;
  35. return '';
  36. }
  37. },{
  38. text: '',
  39. dataIndex: 'link',
  40. flex: 1,
  41. renderer: function(val, meta, record, x, y, store) {
  42. var idx = store.indexOf(record);
  43. meta.style = 'color:blue;text-decoration: underline;cursor: pointer;';
  44. return '<a href="javascript:Ext.getCmp(\'check-grid\').check(' + idx + ')">优化</a>';
  45. }
  46. }],
  47. columnLines: true,
  48. store: Ext.create('Ext.data.Store',{
  49. fields: [{name: 'action', type: 'string'}, {name: 'value', type: 'string'}, {name: 'detail', type: 'string'}],
  50. data: [{
  51. action: 'ma/kill_dblock.action',
  52. value: '清除数据库锁定进程'
  53. },{
  54. action: 'ma/kill_cache.action',
  55. value: '清除系统缓存'
  56. },{
  57. action: 'ma/update_seq.action',
  58. value: '更新数据库序列LAST_NUMBER'
  59. },{
  60. type: 'turn_icq',
  61. action: 'oa/info/turnHistory.action',
  62. value: '已查阅寻呼转入寻呼历史表,加速检索'
  63. }]
  64. }),
  65. plugins: [{
  66. ptype: 'rowexpander',
  67. rowBodyTpl : [
  68. '<ul>',
  69. '<li style="margin-left:30px;color:gray;">{detail}</li>',
  70. '</ul>'
  71. ]
  72. }],
  73. selModel: new Ext.selection.CellModel(),
  74. toggleRow: function(record) {
  75. var rp = this.plugins[0];
  76. if(rp)
  77. rp.toggleRow(this.store.indexOf(record));
  78. }
  79. }]
  80. });
  81. me.callParent(arguments);
  82. }
  83. });