NoticeList.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /**
  2. * 通知公告列表
  3. */
  4. Ext.define('saas.view.message.NoticeList', {
  5. extend: 'Ext.container.Container',
  6. xtype: 'sys-notice-list',
  7. viewModel: {
  8. stores: {
  9. list: {
  10. model: 'saas.model.message.Notice',
  11. autoLoad: true
  12. }
  13. }
  14. },
  15. controller: 'sys-notice-list',
  16. layout: 'border',
  17. items: [{
  18. xtype: 'toolbar',
  19. margin: '0 0 12 0',
  20. padding: '10 4',
  21. region: 'north',
  22. items: [{
  23. xtype: 'tbfill'
  24. }, {
  25. text: '新增',
  26. handler: 'handleAdd'
  27. }]
  28. }, {
  29. region: 'center',
  30. layout: 'fit',
  31. items: [{
  32. xtype: 'grid',
  33. padding: '8 12',
  34. border: true,
  35. bind: {
  36. store: '{list}'
  37. },
  38. columns: [{
  39. text: '操作',
  40. width: 80,
  41. align: 'center',
  42. focusCls: null,
  43. resizable: false,
  44. draggable: false,
  45. xtype: 'actioncolumn',
  46. items: [{
  47. iconCls: 'x-fa fa-pencil',
  48. tooltip: '修改',
  49. handler: 'handleEdit'
  50. }, {
  51. iconCls: 'x-fa fa-trash-o fa-fw',
  52. tooltip: '删除',
  53. handler: 'handleDelete'
  54. }]
  55. }, {
  56. text: '级别',
  57. focusCls: null,
  58. resizable: false,
  59. draggable: false,
  60. width: 60,
  61. align: 'center',
  62. dataIndex: 'levelDesc'
  63. }, {
  64. text: '内容',
  65. focusCls: null,
  66. resizable: false,
  67. draggable: false,
  68. flex: 1,
  69. dataIndex: 'content'
  70. }, {
  71. xtype: 'datecolumn',
  72. text: '发布时间',
  73. focusCls: null,
  74. resizable: false,
  75. draggable: false,
  76. width: 140,
  77. align: 'center',
  78. dataIndex: 'createTime',
  79. format: 'Y-m-d H:i'
  80. }, {
  81. text: '发布人',
  82. focusCls: null,
  83. resizable: false,
  84. draggable: false,
  85. width: 80,
  86. dataIndex: 'creatorName'
  87. }, {
  88. text: '上线',
  89. xtype: 'checkcolumn',
  90. dataIndex: 'status',
  91. switch: true,
  92. width: 90,
  93. listeners: {
  94. checkchange: 'onCheckChange'
  95. }
  96. }]
  97. }]
  98. }]
  99. });