You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

84 lines
2.9 KiB

  1. /*
  2. * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn)
  3. * Copyright (c) 2013-2018 上海力软信息技术有限公司
  4. * 创建人:力软-前端开发组
  5. * 日 期:208.11.22
  6. * 描 述:甘特图
  7. */
  8. var bootstrap = function ($, learun) {
  9. "use strict";
  10. var data = [];
  11. var page = {
  12. init: function () {
  13. // 初始化数据
  14. for (var i = 0; i < 10; i++) {
  15. var day = new Date();
  16. day = day.DateAdd('d', i * 2);
  17. var ponit = {
  18. id: learun.newGuid(),
  19. text: '计划任务' + (i + 1),
  20. isexpand: false,
  21. complete: true,
  22. timeList: [{
  23. beginTime: learun.formatDate(day, 'yyyy-MM-dd'),
  24. endTime: learun.formatDate(day.DateAdd('d', 8), 'yyyy-MM-dd'),
  25. color: '#3286ed',
  26. overtime: true,
  27. text: '执行时间9天'
  28. }],
  29. hasChildren: true,
  30. children: [{
  31. id: learun.newGuid(),
  32. text: '计划任务' + (i + 1) + '.1',
  33. isexpand: false,
  34. complete: true,
  35. timeList: [{
  36. beginTime: learun.formatDate(day, 'yyyy-MM-dd'),
  37. endTime: learun.formatDate(day.DateAdd('d', 3), 'yyyy-MM-dd'),
  38. color: '#1bb99a',
  39. overtime: true,
  40. text: '执行时间4天'
  41. }]
  42. },
  43. {
  44. id: learun.newGuid(),
  45. text: '计划任务' + (i + 1) + '.2',
  46. isexpand: false,
  47. complete: true,
  48. timeList: [{
  49. beginTime: learun.formatDate(day.DateAdd('d', 4), 'yyyy-MM-dd'),
  50. endTime: learun.formatDate(day.DateAdd('d', 8), 'yyyy-MM-dd'),
  51. color: '#E4474D',
  52. overtime: true,
  53. text: '执行时间5天'
  54. }]
  55. }]
  56. }
  57. data.push(ponit);
  58. }
  59. page.initGantt();
  60. page.bind();
  61. },
  62. bind: function () {
  63. // 刷新
  64. $('#lr_refresh').on('click', function () {
  65. location.reload();
  66. });
  67. },
  68. initGantt: function () {
  69. $('#gridtable').lrGantt({
  70. data: data,
  71. timebtns: ['month', 'week', 'day'],//'month', 'week', 'day', 'hour'
  72. });
  73. },
  74. search: function (param) {
  75. }
  76. };
  77. page.init();
  78. }