RefreshSet.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. Ext.define('erp.view.ma.jprocess.RefreshSet',{
  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: 'hr/refreshOrgLevel.action',
  52. value: '刷新组织层级'
  53. },{
  54. action: 'hr/refreshOrgEmployees.action',
  55. value: '刷新组织人员对照关系'
  56. },{
  57. action: 'hr/refreshOrgJobEmployeeTree.action#hr/employee/getHrOrgsTreeAndEmployees.action',
  58. value: '刷新组织架构树'
  59. }]
  60. }),
  61. plugins: [{
  62. ptype: 'rowexpander',
  63. rowBodyTpl : [
  64. '<ul>',
  65. '<li style="margin-left:30px;color:gray;">{detail}</li>',
  66. '</ul>'
  67. ]
  68. }],
  69. selModel: new Ext.selection.CellModel(),
  70. toggleRow: function(record) {
  71. var rp = this.plugins[0];
  72. if(rp)
  73. rp.toggleRow(this.store.indexOf(record));
  74. }
  75. }]
  76. });
  77. me.callParent(arguments);
  78. }
  79. });