single-view.js.ftl 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. export default {
  2. title: '${menuName!"默认名称"}',
  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!""}@query',
  26. params: {
  27. <#if queryList??>
  28. <#list queryList as query>
  29. ${query.columnName} : '{queryGrid1.${query.columnName}}',
  30. </#list>
  31. </#if>
  32. },
  33. },
  34. <#if editType != 1 || delete>
  35. listeners: {
  36. selectionchange: 'scope.grid1Select'
  37. },
  38. </#if>
  39. tbar: {
  40. xtype: 'toolbar',
  41. items: [
  42. <#switch editType>
  43. <#case 1>
  44. <#break>
  45. <#case 2>
  46. {
  47. xtype: 'button1',
  48. text: '添加',
  49. iconCls: 'x-fa fa-plus',
  50. listeners: {
  51. click: 'scope.add'
  52. },
  53. },
  54. <#break>
  55. <#case 3>
  56. {
  57. xtype: 'button',
  58. text: '添加',
  59. iconCls: 'x-fa fa-plus',
  60. listeners: {
  61. click: 'scope.add'
  62. },
  63. },
  64. {
  65. xtype: 'button',
  66. text: '编辑',
  67. iconCls: 'x-fa fa-edit',
  68. bind: {
  69. disabled: '{grid1.selection === null}'
  70. },
  71. listeners: {
  72. click: 'scope.edit'
  73. }
  74. },
  75. <#break>
  76. <#default>
  77. </#switch>
  78. <#if delete?? && delete>
  79. {
  80. xtype: 'button',
  81. text: '删除',
  82. iconCls: 'x-fa fa-remove',
  83. bind: {
  84. disabled: '{grid1.selection === null}'
  85. },
  86. listeners: {
  87. click: 'scope.remove'
  88. },
  89. },
  90. </#if>
  91. <#if editType != 1 || delete>
  92. {
  93. xtype: 'button',
  94. text: '保存',
  95. iconCls: 'x-fa fa-save',
  96. bind: {
  97. },
  98. listeners: {
  99. click: 'scope.save'
  100. },
  101. },
  102. </#if>
  103. ]
  104. },
  105. columns: [
  106. {
  107. xtype: "rownumberer",
  108. header: "序号"
  109. },
  110. <#if columnList??>
  111. <#list columnList as column>
  112. <#switch column.componentType>
  113. <#case 1>
  114. { dataIndex: "${column.columnName}", header: "${column.chineseName}", fix: ['system.getDict("${column.dictKey}")'],
  115. <#break>
  116. <#case 2>
  117. { dataIndex: "${column.columnName}", header: "${column.chineseName}",
  118. <#break>
  119. <#default>
  120. { dataIndex: "${column.columnName}", header: "${column.chineseName}",
  121. </#switch>
  122. <#if editorList?seq_contains(column.columnName)>
  123. editor: {
  124. <#if column.componentType == 1>
  125. xtype : 'combo',
  126. fix: ['system.getDict("DICT_TYPE")']
  127. <#elseif column.componentType == 2>
  128. xtype : 'textfield',
  129. </#if>
  130. }
  131. </#if>
  132. },
  133. </#list>
  134. </#if>
  135. ]
  136. }
  137. ]
  138. }
  139. ]
  140. }