engine3.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. define(function (require) {
  2. return function () {
  3. var dialog1 = require('/yvanui/example/dialog1.js');
  4. var dialog2 = require('/yvanui/example/dialog2.js')();
  5. //var selectBaseCustomer = require('/widget/selectBaseCustomer')();
  6. var grid = {
  7. xtype: 'grid',
  8. url: '/mock/wh.json',
  9. pagination: false,
  10. method: 'get',
  11. toolbar: '#tb',
  12. border: false,
  13. idField: 'whId',
  14. columns: [[
  15. { field: 'whId', title: '仓库编号', width: 80 },
  16. { field: 'whCode', title: '仓库编码', width: 80 },
  17. { field: 'whName', title: '仓库名称', width: 80 },
  18. { field: 'logogram', title: '助记码', width: 80 },
  19. { field: 'whAddress', title: '地址', width: 80 }
  20. ]]
  21. };
  22. var tabs = {
  23. xtype: 'tabs',
  24. items: [{
  25. title: 'tab1',
  26. lazy: true, //惰性渲染(当切换到选项卡时再加载)
  27. items: [{
  28. xtype: 'div',
  29. items: [[
  30. { name: 'txt11', label: '输入框1.1' },
  31. { name: 'txt12', label: '输入框1.2' }
  32. ], [
  33. { name: 'txt21', label: '输入框2.1' },
  34. { name: 'txt22', label: '输入框2.2' },
  35. { name: 'txt31', label: '输入框3.1' },
  36. { name: 'txt32', label: '输入框3.2' }
  37. ]]
  38. }]
  39. }, {
  40. title: 'tab2',
  41. lazy: true,
  42. items: [
  43. {
  44. id: '#tb',
  45. xtype: 'toolbar',
  46. title: '自定义工具条'
  47. }, grid
  48. ]
  49. }, {
  50. title: 'tab4',
  51. lazy: true,
  52. items: [
  53. {
  54. xtype: 'toolbar',
  55. title: '自定义工具条',
  56. items: [
  57. {
  58. text: '按钮1', iconCls: 'fa fa-search', onClick: function () {
  59. $.yvan.msg('按钮1');
  60. }
  61. }, {
  62. text: '按钮2', iconCls: 'fa fa-search', onClick: function () {
  63. $.yvan.msg('按钮2');
  64. }
  65. }, {
  66. text: '按钮3', iconCls: 'fa fa-search', onClick: function () {
  67. $.yvan.msg('按钮3');
  68. }
  69. }
  70. ]
  71. },
  72. '直接输入html'
  73. ]
  74. }]
  75. };
  76. return {
  77. assist: [
  78. dialog1,
  79. dialog2,
  80. {
  81. xtype: 'dialog',
  82. dialogId: 'dialog3',
  83. width: 600,
  84. height: 400,
  85. title: '复杂元素',
  86. center: {
  87. items: [tabs]
  88. }
  89. }
  90. ],
  91. center: {
  92. border: false,
  93. items: [
  94. [
  95. {
  96. xtype: 'button', text: '可越位对话框', onClick: function () {
  97. $.yvan.showDialog(this, {
  98. dialogId: 'dialog1',
  99. inline: false,
  100. modal: false
  101. });
  102. }
  103. },
  104. {
  105. xtype: 'button', text: '内部带头带尾', onClick: function () {
  106. $.yvan.showDialog(this, {
  107. dialogId: 'dialog2',
  108. modal: false
  109. });
  110. }
  111. },
  112. {
  113. xtype: 'button', text: '复杂元素', onClick: function () {
  114. $.yvan.showDialog(this, {
  115. dialogId: 'dialog3',
  116. modal: false
  117. });
  118. }
  119. }
  120. ],
  121. [
  122. {
  123. xtype: 'button', text: '按钮1', onClick: function () {
  124. $.yvan.showDialog(this, 'selectBaseCustomer');
  125. }
  126. }
  127. ]
  128. ]
  129. }
  130. };
  131. };
  132. });