view.hbs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. export default {
  2. title: '{{ pageTitle }}',
  3. layout: 'fit',
  4. referenceHolder: true,
  5. tbar: {
  6. xtype: 'toolbar',
  7. items: [
  8. {
  9. xtype: 'button',
  10. text: '刷新',
  11. iconCls: 'fa fa-refresh',
  12. listeners: {
  13. click: 'scope.refresh',
  14. },
  15. },
  16. {{#if addButton}}
  17. {
  18. xtype: 'button',
  19. text: '添加',
  20. iconCls: 'x-fa fa-plus',
  21. listeners: {
  22. click: 'scope.add',
  23. },
  24. },
  25. {{/if}}
  26. {{#if deleteButton}}
  27. {
  28. xtype: 'button',
  29. text: '删除',
  30. iconCls: 'x-fa fa-remove',
  31. bind: {
  32. disabled: '{grid1.selection === null}',
  33. },
  34. listeners: {
  35. click: 'scope.remove',
  36. },
  37. },
  38. {{/if}}
  39. {{#if saveButton}}
  40. {
  41. xtype: 'button',
  42. text: '保存',
  43. iconCls: 'x-fa fa-save',
  44. bind: {
  45. disabled: '{!grid1.ischanged}',
  46. },
  47. listeners: {
  48. click: 'scope.save',
  49. },
  50. },
  51. {{/if}}
  52. ]
  53. },
  54. items: [
  55. {
  56. layout: 'border',
  57. items: [
  58. {
  59. region: 'center',
  60. xtype: 'yvgrid',
  61. layout: 'fit',
  62. reference: 'grid1',
  63. pagination: {{ pagination }},
  64. selModel: {
  65. selType: 'rowmodel',
  66. mode: 'SINGLE',
  67. },
  68. dataSource: {
  69. method: 'invoke',
  70. url: '{{{ invokeUrlPrefix }}}@{{#if pagination }}queryByPage{{else}}query{{/if}}',
  71. params: {},
  72. },
  73. listeners: {
  74. selectionchange: 'scope.grid1Select',
  75. },
  76. columns: [
  77. {
  78. xtype: "rownumberer",
  79. header: "序号",
  80. width: 50,
  81. },
  82. {{#each gridColumns}}
  83. {
  84. dataIndex: "{{ dataIndex }}",
  85. header: "{{ header }}",
  86. {{#with fix}}{{#if dictName}}fix: ['system.getDict("{{dictName}}")'],{{/if}}{{/with}}
  87. {{#with editor}}
  88. editor: {
  89. {{#if xtype}}xtype: '{{xtype}}',{{/if}}
  90. {{#with fix}}{{#if dictName}}fix: ['system.getDict("{{dictName}}")'],{{/if}}{{/with}}
  91. },
  92. {{/with}}
  93. },
  94. {{/each}}
  95. ],
  96. },
  97. ],
  98. },
  99. ],
  100. }