welcome-portlet.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. $(function() {
  2. $('#portlet-container').portlet({
  3. sortable: true,
  4. columns: [{
  5. width: 400,
  6. portlets: [{
  7. title: '待办任务',
  8. content: {
  9. style: {
  10. maxHeight: 300
  11. },
  12. type: 'ajax',
  13. dataType: 'json',
  14. url: ctx + '/workflow/task/todo/list',
  15. formatter: function(o, pio, data) {
  16. if (data.length == 0) {
  17. return "无待办任务!";
  18. }
  19. var ct = "<ol>";
  20. $.each(data, function() {
  21. ct += "<li>" + this.pdname + "->PID:" + this.pid + "-><span class='ui-state-highlight ui-corner-all'>" + this.name + "</span>";
  22. ct += "<span class='version' title='流程定义版本:" + this.pdversion + "'><b>V:</b>" + this.pdversion + "</span>";
  23. ct += "<a class='trace' href='#' pid='" + this.pid + "' title='点击查看流程图'>跟踪</a>";
  24. ct += "<span class='status' title='任务状态'>" + (this.status == 'claim' ? '未签收' : '') + "</span>";
  25. ct += "</li>";
  26. });
  27. return ct + "</ol>";
  28. },
  29. afterShow: function() {
  30. $('.trace').click(graphTrace);
  31. }
  32. }
  33. }, {
  34. title: '表单概念',
  35. content: {
  36. type: 'text',
  37. text: function() {
  38. return $('.forms').html();
  39. }
  40. }
  41. }, {
  42. title: '会签(多实例)说明',
  43. content: {
  44. type: 'text',
  45. text: function() {
  46. return $('#multiInstance').html();
  47. }
  48. }
  49. }, {
  50. title: '关于作者',
  51. content: {
  52. type: 'text',
  53. text: function() {
  54. return $('.aboutme').html();
  55. }
  56. }
  57. }]
  58. }, {
  59. width: 350,
  60. portlets: [{
  61. title: '演示内容',
  62. content: {
  63. type: 'text',
  64. text: function() {
  65. return $('.demos').html();
  66. }
  67. }
  68. } ]
  69. }, {
  70. width: 450,
  71. portlets: [{
  72. title: '项目说明',
  73. content: {
  74. type: 'text',
  75. text: function() {
  76. return $('.project-info').html();
  77. }
  78. }
  79. }, {
  80. title: '架构说明',
  81. content: {
  82. type: 'text',
  83. text: function() {
  84. return $('.arch').html();
  85. }
  86. }
  87. }, {
  88. title: '资源链接',
  89. content: {
  90. type: 'text',
  91. text: function() {
  92. return $('.links').html();
  93. }
  94. }
  95. }, {
  96. title: 'Rest接口',
  97. content: {
  98. type: 'text',
  99. text: function() {
  100. return $('.rest').html();
  101. }
  102. }
  103. }]
  104. }]
  105. });
  106. });