dialog-view.js.ftl 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. export default {
  2. title: '${title}',
  3. layout: 'fit',
  4. referenceHolder: true,
  5. items: [
  6. {
  7. layout: 'border',
  8. items: [
  9. {
  10. region: 'center',
  11. xtype: 'yvgrid',
  12. layout: 'fit',
  13. reference: 'grid1',
  14. <#if pagination?? && pagination>
  15. pagination: true,
  16. <#else>
  17. pagination: false,
  18. </#if>
  19. selModel: {
  20. selType: 'rowmodel',
  21. mode: 'SINGLE',
  22. },
  23. dataSource: {
  24. method: 'invoke',
  25. url: '${invokeUrl}',
  26. params: {
  27. <#if queryList??>
  28. <#list queryList as query>
  29. ${query.columnName} : '{queryGrid1.${query.columnName}}',
  30. </#list>
  31. </#if>
  32. },
  33. },
  34. listeners: {
  35. selectionchange: 'scope.grid1Select'
  36. },
  37. tbar: {
  38. xtype: 'toolbar',
  39. items: [
  40. <#if editType?? && editType != 1>
  41. {
  42. xtype: 'button',
  43. text: '添加',
  44. iconCls: 'x-fa fa-plus',
  45. listeners: {
  46. click: 'scope.add'
  47. },
  48. },
  49. {
  50. xtype: 'button',
  51. text: '编辑',
  52. iconCls: 'x-fa fa-edit',
  53. bind: {
  54. disabled: '{grid1.selection === null}'
  55. },
  56. listeners: {
  57. click: 'scope.edit'
  58. }
  59. },
  60. </#if>
  61. <#if delete?? && delete>
  62. {
  63. xtype: 'button',
  64. text: '删除',
  65. iconCls: 'x-fa fa-remove',
  66. bind: {
  67. disabled: '{grid1.selection === null}'
  68. },
  69. listeners: {
  70. click: 'scope.remove'
  71. },
  72. },
  73. </#if>
  74. {
  75. xtype: 'button',
  76. text: '保存',
  77. iconCls: 'x-fa fa-save',
  78. bind: {
  79. disabled: '{grid1.selection === null}'
  80. },
  81. listeners: {
  82. click: 'scope.save'
  83. },
  84. },
  85. ]
  86. },
  87. columns: [
  88. {
  89. xtype: "rownumberer",
  90. header: "序号"
  91. },
  92. <#if columnList??>
  93. <#list columnList as column>
  94. <#switch column.componentType>
  95. <#case 1>
  96. {
  97. dataIndex: "dict_type",
  98. header: "字典类别",
  99. fix: ['system.getDict("DICT_TYPE")']
  100. },
  101. <#break>
  102. <#case 2>
  103. { dataIndex: ${column.columnName}, header: ${column.chineseName}, },
  104. <#break>
  105. <#default>
  106. { dataIndex: ${column.columnName}, header: ${column.chineseName}, },
  107. </#switch>
  108. </#list>
  109. </#if>
  110. ]
  111. }
  112. ]
  113. }
  114. ]
  115. }