SysUpdate.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. Ext.define('erp.view.ma.SysUpdate', {
  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 : 'update-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 : 'version',
  28. flex : 1
  29. }, {
  30. text : '补丁版本',
  31. dataIndex : 'name',
  32. flex : 1
  33. }, {
  34. text : '类型',
  35. dataIndex : 'type',
  36. flex : 1
  37. }, {
  38. text : '描述',
  39. dataIndex : 'desc',
  40. flex : 4
  41. }, {
  42. text : '发布日期',
  43. dataIndex : 'date',
  44. xtype : 'datecolumn',
  45. flex : 1.5
  46. }, {
  47. hidden: true,
  48. dataIndex: 'files'
  49. },{
  50. dataIndex : 'installed',
  51. flex : 1,
  52. renderer : function(val, meta, record, x, y, store, view) {
  53. var index = store.indexOf(record);
  54. if (val) {
  55. return '<a href="javascript:Ext.getCmp(\'update-grid\').uninstall(' + index + ');">卸载</a>';
  56. }
  57. return '<a href="javascript:Ext.getCmp(\'update-grid\').install(' + index + ');">安装</a>';
  58. }
  59. } ],
  60. columnLines : true,
  61. store : Ext.create('Ext.data.Store', {
  62. fields : [ {
  63. name : 'version',
  64. type : 'string'
  65. }, {
  66. name : 'name',
  67. type : 'string'
  68. }, {
  69. name : 'type',
  70. type : 'string'
  71. }, {
  72. name : 'desc',
  73. type : 'string'
  74. }, {
  75. name : 'date',
  76. type : 'string'
  77. }, {
  78. name: 'files',
  79. type: 'string'
  80. }, {
  81. name : 'installed',
  82. type : 'bool'
  83. } ],
  84. data : [],
  85. groupField : 'installed',
  86. sorters : [ {
  87. property : 'date',
  88. direction : 'DESC'
  89. }, {
  90. property : 'name',
  91. direction : 'DESC'
  92. } ]
  93. }),
  94. selModel : new Ext.selection.CellModel()
  95. } ],
  96. features : [ Ext.create('Ext.grid.feature.Grouping', {
  97. startCollapsed : false,
  98. groupHeaderTpl : '{name} ({rows.length})'
  99. }) ]
  100. });
  101. me.callParent(arguments);
  102. }
  103. });