single-view.js.ftl 4.9 KB

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