msg.js 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. 'use strict';
  2. define({
  3. center: {
  4. border: false,
  5. items: [
  6. [
  7. {
  8. xtype: 'button', css: { 'margin-left': '15px' },
  9. text: '正确通知', iconCls: 'fa fa-window-maximize', onClick: function () {
  10. $.yvan.notify({
  11. autoClose: 2000,
  12. type: 'success',
  13. body: "总共有555条未处理消息",
  14. title: "你有未处理消息"
  15. });
  16. }
  17. },
  18. {
  19. xtype: 'button', css: { 'margin-left': '15px' },
  20. text: '消息通知', iconCls: 'fa fa-window-maximize', onClick: function () {
  21. $.yvan.notify({
  22. autoClose: 5000,
  23. type: 'info',
  24. body: "总共有555条未处理消息",
  25. title: "你有未处理消息"
  26. });
  27. }
  28. },
  29. {
  30. xtype: 'button', css: { 'margin-left': '15px' },
  31. text: '错误通知', iconCls: 'fa fa-window-maximize', onClick: function () {
  32. $.yvan.notify({
  33. autoClose: false,
  34. showClose: true,
  35. type: 'error',
  36. body: "总共有555条未处理消息",
  37. onClick: function () {
  38. $.yvan.msg('被点击');
  39. },
  40. title: "你有未处理消息"
  41. });
  42. }
  43. }
  44. ], [
  45. {
  46. xtype: 'button', css: { 'margin-left': '15px' },
  47. text: '消息1', iconCls: 'fa fa-comment fa-lg', onClick: function () {
  48. $.yvan.msg('提交');
  49. }
  50. },
  51. {
  52. xtype: 'button', css: { 'margin-left': '15px' },
  53. text: '消息2', iconCls: 'fa fa-comment fa-lg', onClick: function () {
  54. $.yvan.msg('提交<br>提交提交<br>提交<br>这里总共十个字的宽度');
  55. }
  56. },
  57. {
  58. xtype: 'button', css: { 'margin-left': '15px' },
  59. text: '消息3', iconCls: 'fa fa-comment fa-lg', onClick: function () {
  60. $.yvan.msg('提交<br>提交提交<br>提交<br>这里总共十个字的宽度<br>提交<br>提交提交<br>提交<br>这里总共十个字的宽度<br>提交<br>提交提交<br>提交<br>这里总共十个字的宽度');
  61. }
  62. }
  63. ], [
  64. {
  65. xtype: 'button', css: { 'margin-left': '15px' },
  66. text: '提示框1', iconCls: 'fa fa-info-circle fa-lg', onClick: function () {
  67. $.yvan.info('提交');
  68. }
  69. }, {
  70. xtype: 'button', css: { 'margin-left': '15px' },
  71. text: '提示框2', iconCls: 'fa fa-info-circle fa-lg', onClick: function () {
  72. $.yvan.info('提交<br>提交提交<br>提交<br>这里总共十个字的宽度');
  73. }
  74. }, {
  75. xtype: 'button', css: { 'margin-left': '15px' },
  76. text: '提示框3', iconCls: 'fa fa-info-circle fa-lg', onClick: function () {
  77. $.yvan.info(
  78. '这个提示框没有关闭按钮,点击确认之后会有回调!',
  79. function () {
  80. $.yvan.msg('关闭之后该干的事');
  81. });
  82. }
  83. }
  84. ], [
  85. {
  86. xtype: 'button', css: { 'margin-left': '15px' },
  87. text: '错误框1', iconCls: 'fa fa-times-circle fa-lg', onClick: function () {
  88. $.yvan.error('提交');
  89. }
  90. }, {
  91. xtype: 'button', css: { 'margin-left': '15px' },
  92. text: '错误框2', iconCls: 'fa fa-times-circle fa-lg', onClick: function () {
  93. $.yvan.error('提交<br>提交提交<br>提交<br>这里总共十个字的宽度');
  94. }
  95. }, {
  96. xtype: 'button', css: { 'margin-left': '15px' },
  97. text: '错误框3', iconCls: 'fa fa-times-circle fa-lg', onClick: function () {
  98. $.yvan.error(
  99. '这个提示框没有关闭按钮,点击确认之后会有回调!',
  100. function () {
  101. $.yvan.msg('关闭之后该干的事');
  102. });
  103. }
  104. }
  105. ], [
  106. {
  107. xtype: 'button', css: { 'margin-left': '15px' },
  108. text: '确认框1', iconCls: 'fa fa-question-circle fa-lg', onClick: function () {
  109. $.yvan.confirm('确认要这样做?', function () {
  110. $.yvan.msg('是的');
  111. });
  112. }
  113. }, {
  114. xtype: 'button', css: { 'margin-left': '15px' },
  115. text: '确认框2', iconCls: 'fa fa-question-circle fa-lg', onClick: function () {
  116. $.yvan.confirm('确认要这样做?', {
  117. yes: function () {
  118. $.yvan.msg('是的');
  119. },
  120. no: function () {
  121. $.yvan.msg('不');
  122. }
  123. });
  124. }
  125. }
  126. ], [
  127. {
  128. xtype: 'button', css: { 'margin-left': '15px' },
  129. text: '全局加载', iconCls: 'fa fa-spinner fa-lg', onClick: function () {
  130. $.yvan.progress();
  131. setTimeout(function () {
  132. $.yvan.closep();
  133. }, 3000);
  134. }
  135. }, {
  136. xtype: 'button', css: { 'margin-left': '15px' },
  137. text: '局部加载', iconCls: 'fa fa-spinner fa-lg', onClick: function () {
  138. var $me = $(this).up('power');
  139. console.log($me);
  140. $me.progress();
  141. setTimeout(function () { $me.progress('close'); }, 3000);
  142. }
  143. }
  144. ]]
  145. }
  146. });