view.hbs 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. {
  27. xtype: 'button',
  28. text: '删除',
  29. iconCls: 'x-fa fa-remove',
  30. bind: {
  31. disabled: '{grid1.selection === null}',
  32. },
  33. listeners: {
  34. click: 'scope.remove',
  35. },
  36. },
  37. {{#if saveButton}}
  38. {
  39. xtype: 'button',
  40. text: '保存',
  41. iconCls: 'x-fa fa-save',
  42. bind: {
  43. disabled: '{!grid1.ischanged}',
  44. },
  45. listeners: {
  46. click: 'scope.save',
  47. },
  48. },
  49. {{/if}}
  50. ]
  51. },
  52. items: [
  53. {
  54. layout: 'border',
  55. items: [
  56. {
  57. region: 'center',
  58. xtype: 'yvgrid',
  59. layout: 'fit',
  60. reference: 'grid1',
  61. pagination: {{ pagination }},
  62. selModel: {
  63. selType: 'rowmodel',
  64. mode: 'SINGLE',
  65. },
  66. dataSource: {
  67. method: 'invoke',
  68. url: '{{{ invokeUrlPrefix }}}@{{#if pagination }}queryByPage{{else}}query{{/if}}',
  69. params: {},
  70. },
  71. listeners: {
  72. selectionchange: 'scope.grid1Select',
  73. },
  74. columns: [
  75. {
  76. xtype: "rownumberer",
  77. header: "序号",
  78. },
  79. {{#each gridColumns}}
  80. {
  81. dataIndex: "{{ dataIndex }}",
  82. header: "{{ header }}",
  83. {{#with fix}}{{#if dictName}}fix: ['system.getDict("{{dictName}}")'],{{/if}}{{/with}}
  84. {{#with editor}}
  85. editor: {
  86. {{#if xtype}}xtype: '{{xtype}}',{{/if}}
  87. {{#with fix}}{{#if dictName}}fix: ['system.getDict("{{dictName}}")'],{{/if}}{{/with}}
  88. },
  89. {{/with}}
  90. },
  91. {{/each}}
  92. ],
  93. },
  94. ],
  95. },
  96. ],
  97. }