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.
 
 
 
 
 
 

1728 lines
74 KiB

  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE" />
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  6. <title>项目进度</title>
  7. <link href="~/Content/font/css/font-awesome.min.css" rel="stylesheet" />
  8. <link rel=stylesheet href="~/Content/jquerygantt/css/platform.css" type="text/css">
  9. <link rel=stylesheet href="~/Content/jquerygantt/libs/jquery/dateField/jquery.dateField.css" type="text/css">
  10. <link rel=stylesheet href="~/Content/jquerygantt/css/gantt.css" type="text/css">
  11. <link rel=stylesheet href="~/Content/jquerygantt/css/ganttPrint.css" type="text/css" media="print">
  12. <link rel="stylesheet" type="text/css" href="~/Content/jquerygantt/css/bootstrap.min.css" />
  13. <script src="~/Content/jquerygantt/jquery.min.js"></script>
  14. <script src="~/Content/jquerygantt/jquery-ui.min.js"></script>
  15. <script src="~/Content/jquerygantt/libs/jquery/jquery.livequery.1.1.1.min.js"></script>
  16. <script src="~/Content/jquerygantt/libs/jquery/jquery.timers.js"></script>
  17. <script src="~/Content/jquerygantt/libs/utilities.js"></script>
  18. <script src="~/Content/jquerygantt/libs/forms.js"></script>
  19. <script src="~/Content/jquerygantt/libs/date.js"></script>
  20. <script src="~/Content/jquerygantt/libs/dialogs.js"></script>
  21. <script src="~/Content/jquerygantt/libs/layout.js"></script>
  22. <script src="~/Content/jquerygantt/libs/i18nJs.js"></script>
  23. <script src="~/Content/jquerygantt/libs/jquery/dateField/jquery.dateField.js"></script>
  24. <script src="~/Content/jquerygantt/libs/jquery/JST/jquery.JST.js"></script>
  25. <script type="text/javascript" src="~/Content/jquerygantt/libs/jquery/svg/jquery.svg.min.js"></script>
  26. <script type="text/javascript" src="~/Content/jquerygantt/libs/jquery/svg/jquery.svgdom.1.8.js"></script>
  27. <script src="~/Content/jquerygantt/ganttUtilities.js"></script>
  28. <script src="~/Content/jquerygantt/ganttTask.js"></script>
  29. <script src="~/Content/jquerygantt/ganttDrawerSVG.js"></script>
  30. <script src="~/Content/jquerygantt/ganttGridEditor.js"></script>
  31. <script src="~/Content/jquerygantt/ganttMaster.js"></script>
  32. @Html.AppendCssFile(
  33. "/Views/LR_Content/style/lr-common.css",
  34. "/Views/LR_Content/plugin/scroll/scroll.css",
  35. "/Views/LR_Content/style/lr-iframe-index.css"
  36. )
  37. </head>
  38. <body style="background-color: #fff; margin:10px 0 0 10px;border:1px solid #ccc" >
  39. <div id="workSpace" style="padding:0px; overflow-y:auto; overflow-x:hidden;border:1px solid #e5e5e5;position:relative;"></div>
  40. <style>
  41. .resEdit {
  42. padding: 15px;
  43. }
  44. .resLine {
  45. width: 95%;
  46. padding: 3px;
  47. margin: 5px;
  48. border: 1px solid #d0d0d0;
  49. }
  50. body {
  51. overflow: hidden;
  52. }
  53. .ganttButtonBar h1 {
  54. color: #000000;
  55. font-weight: bold;
  56. font-size: 28px;
  57. margin-left: 10px;
  58. }
  59. </style>
  60. <form id="gimmeBack" style="display:none;" action="../gimmeBack.jsp" method="post" target="_blank"><input type="hidden" name="prj" id="gimBaPrj"></form>
  61. <script type="text/javascript">
  62. var data = {
  63. "tasks": [{
  64. "id": -1,
  65. "name": "珠三角水资源配置工程",
  66. "progress": 80,
  67. "progressByWorklog": false,
  68. "relevance": 0,
  69. "type": "",
  70. "typeId": "",
  71. "description": "172项重大水利工程",
  72. "code": "SL2017",
  73. "level": 0,
  74. "status": "STATUS_ACTIVE",
  75. "depends": "",
  76. "canWrite": true,
  77. "start": 1396994400000,
  78. "duration": 20,
  79. "end": 1399586399999,
  80. "startIsMilestone": false,
  81. "endIsMilestone": false,
  82. "collapsed": false,
  83. "hasChild": true,
  84. "assigs": [{
  85. "resourceId": "tmp_1",
  86. "id": "tmp_1345625008213",
  87. "roleId": "tmp_1",
  88. "effort": 7200000
  89. }, {
  90. "resourceId": "tmp_2",
  91. "id": "tmp_1345625008213",
  92. "roleId": "tmp_1",
  93. "effort": 7200000
  94. }],
  95. }, {
  96. "id": -2,
  97. "name": "可行性研究阶段",
  98. "progress": 0,
  99. "progressByWorklog": false,
  100. "relevance": 0,
  101. "type": "",
  102. "typeId": "",
  103. "description": "",
  104. "code": "",
  105. "level": 1,
  106. "status": "STATUS_ACTIVE",
  107. "depends": "",
  108. "canWrite": true,
  109. "start": 1396994400000,
  110. "duration": 10,
  111. "end": 1398203999999,
  112. "startIsMilestone": false,
  113. "endIsMilestone": false,
  114. "collapsed": false,
  115. "assigs": [],
  116. "hasChild": true,
  117. "progress": 20,
  118. "assigs": [{
  119. "resourceId": "tmp_2",
  120. "id": "tmp_1345625008213",
  121. "roleId": "tmp_1",
  122. "effort": 7200000
  123. }],
  124. }, {
  125. "id": -3,
  126. "name": "水工专业",
  127. "progress": 0,
  128. "progressByWorklog": false,
  129. "relevance": 0,
  130. "type": "",
  131. "typeId": "",
  132. "description": "",
  133. "code": "",
  134. "level": 2,
  135. "status": "STATUS_ACTIVE",
  136. "depends": "",
  137. "canWrite": true,
  138. "start": 1396994400000,
  139. "duration": 2,
  140. "end": 1397167199999,
  141. "startIsMilestone": false,
  142. "endIsMilestone": false,
  143. "collapsed": false,
  144. "assigs": [],
  145. "hasChild": false,
  146. "progress": 20,
  147. "assigs": [{
  148. "resourceId": "tmp_3",
  149. "id": "tmp_1345625008213",
  150. "roleId": "tmp_1",
  151. "effort": 7200000
  152. }],
  153. }, {
  154. "id": -4,
  155. "name": "施工专业",
  156. "progress": 0,
  157. "progressByWorklog": false,
  158. "relevance": 0,
  159. "type": "",
  160. "typeId": "",
  161. "description": "",
  162. "code": "",
  163. "level": 2,
  164. "status": "STATUS_SUSPENDED",
  165. "depends": "3",
  166. "canWrite": true,
  167. "start": 1397167200000,
  168. "duration": 4,
  169. "end": 1397685599999,
  170. "startIsMilestone": false,
  171. "endIsMilestone": false,
  172. "collapsed": false,
  173. "assigs": [],
  174. "hasChild": false
  175. }, {
  176. "id": -5,
  177. "name": "施工专业",
  178. "progress": 0,
  179. "progressByWorklog": false,
  180. "relevance": 0,
  181. "type": "",
  182. "typeId": "",
  183. "description": "",
  184. "code": "",
  185. "level": 2,
  186. "status": "STATUS_SUSPENDED",
  187. "depends": "3",
  188. "canWrite": true,
  189. "start": 1397167200000,
  190. "duration": 4,
  191. "end": 1397685599999,
  192. "startIsMilestone": false,
  193. "endIsMilestone": false,
  194. "collapsed": false,
  195. "assigs": [],
  196. "hasChild": false
  197. }, {
  198. "id": -6,
  199. "name": "施工专业",
  200. "progress": 0,
  201. "progressByWorklog": false,
  202. "relevance": 0,
  203. "type": "",
  204. "typeId": "",
  205. "description": "",
  206. "code": "",
  207. "level": 2,
  208. "status": "STATUS_SUSPENDED",
  209. "depends": "3",
  210. "canWrite": true,
  211. "start": 1397167200000,
  212. "duration": 4,
  213. "end": 1397685599999,
  214. "startIsMilestone": false,
  215. "endIsMilestone": false,
  216. "collapsed": false,
  217. "assigs": [],
  218. "hasChild": false
  219. }, {
  220. "id": -7,
  221. "name": "施工专业",
  222. "progress": 0,
  223. "progressByWorklog": false,
  224. "relevance": 0,
  225. "type": "",
  226. "typeId": "",
  227. "description": "",
  228. "code": "",
  229. "level": 2,
  230. "status": "STATUS_SUSPENDED",
  231. "depends": "3",
  232. "canWrite": true,
  233. "start": 1397167200000,
  234. "duration": 4,
  235. "end": 1397685599999,
  236. "startIsMilestone": false,
  237. "endIsMilestone": false,
  238. "collapsed": false,
  239. "assigs": [],
  240. "hasChild": false
  241. }, {
  242. "id": -8,
  243. "name": "施工专业",
  244. "progress": 0,
  245. "progressByWorklog": false,
  246. "relevance": 0,
  247. "type": "",
  248. "typeId": "",
  249. "description": "",
  250. "code": "",
  251. "level": 2,
  252. "status": "STATUS_SUSPENDED",
  253. "depends": "3",
  254. "canWrite": true,
  255. "start": 1397167200000,
  256. "duration": 4,
  257. "end": 1397685599999,
  258. "startIsMilestone": false,
  259. "endIsMilestone": false,
  260. "collapsed": false,
  261. "assigs": [],
  262. "hasChild": false
  263. }, {
  264. "id": -9,
  265. "name": "施工专业",
  266. "progress": 0,
  267. "progressByWorklog": false,
  268. "relevance": 0,
  269. "type": "",
  270. "typeId": "",
  271. "description": "",
  272. "code": "",
  273. "level": 2,
  274. "status": "STATUS_SUSPENDED",
  275. "depends": "3",
  276. "canWrite": true,
  277. "start": 1397167200000,
  278. "duration": 4,
  279. "end": 1397685599999,
  280. "startIsMilestone": false,
  281. "endIsMilestone": false,
  282. "collapsed": false,
  283. "assigs": [],
  284. "hasChild": false
  285. }, {
  286. "id": -10,
  287. "name": "施工专业",
  288. "progress": 0,
  289. "progressByWorklog": false,
  290. "relevance": 0,
  291. "type": "",
  292. "typeId": "",
  293. "description": "",
  294. "code": "",
  295. "level": 2,
  296. "status": "STATUS_SUSPENDED",
  297. "depends": "3",
  298. "canWrite": true,
  299. "start": 1397167200000,
  300. "duration": 4,
  301. "end": 1397685599999,
  302. "startIsMilestone": false,
  303. "endIsMilestone": false,
  304. "collapsed": false,
  305. "assigs": [],
  306. "hasChild": false
  307. }, {
  308. "id": -11,
  309. "name": "施工专业",
  310. "progress": 0,
  311. "progressByWorklog": false,
  312. "relevance": 0,
  313. "type": "",
  314. "typeId": "",
  315. "description": "",
  316. "code": "",
  317. "level": 2,
  318. "status": "STATUS_SUSPENDED",
  319. "depends": "3",
  320. "canWrite": true,
  321. "start": 1397167200000,
  322. "duration": 4,
  323. "end": 1397685599999,
  324. "startIsMilestone": false,
  325. "endIsMilestone": false,
  326. "collapsed": false,
  327. "assigs": [],
  328. "hasChild": false
  329. }, {
  330. "id": -12,
  331. "name": "施工专业",
  332. "progress": 0,
  333. "progressByWorklog": false,
  334. "relevance": 0,
  335. "type": "",
  336. "typeId": "",
  337. "description": "",
  338. "code": "",
  339. "level": 2,
  340. "status": "STATUS_SUSPENDED",
  341. "depends": "3",
  342. "canWrite": true,
  343. "start": 1397167200000,
  344. "duration": 4,
  345. "end": 1397685599999,
  346. "startIsMilestone": false,
  347. "endIsMilestone": false,
  348. "collapsed": false,
  349. "assigs": [],
  350. "hasChild": false
  351. }, {
  352. "id": -13,
  353. "name": "施工专业",
  354. "progress": 0,
  355. "progressByWorklog": false,
  356. "relevance": 0,
  357. "type": "",
  358. "typeId": "",
  359. "description": "",
  360. "code": "",
  361. "level": 2,
  362. "status": "STATUS_SUSPENDED",
  363. "depends": "3",
  364. "canWrite": true,
  365. "start": 1397167200000,
  366. "duration": 4,
  367. "end": 1397685599999,
  368. "startIsMilestone": false,
  369. "endIsMilestone": false,
  370. "collapsed": false,
  371. "assigs": [],
  372. "hasChild": false
  373. }, {
  374. "id": -14,
  375. "name": "施工专业",
  376. "progress": 0,
  377. "progressByWorklog": false,
  378. "relevance": 0,
  379. "type": "",
  380. "typeId": "",
  381. "description": "",
  382. "code": "",
  383. "level": 2,
  384. "status": "STATUS_SUSPENDED",
  385. "depends": "3",
  386. "canWrite": true,
  387. "start": 1397167200000,
  388. "duration": 4,
  389. "end": 1397685599999,
  390. "startIsMilestone": false,
  391. "endIsMilestone": false,
  392. "collapsed": false,
  393. "assigs": [],
  394. "hasChild": false
  395. }, {
  396. "id": -15,
  397. "name": "施工专业",
  398. "progress": 0,
  399. "progressByWorklog": false,
  400. "relevance": 0,
  401. "type": "",
  402. "typeId": "",
  403. "description": "",
  404. "code": "",
  405. "level": 2,
  406. "status": "STATUS_SUSPENDED",
  407. "depends": "3",
  408. "canWrite": true,
  409. "start": 1397167200000,
  410. "duration": 4,
  411. "end": 1397685599999,
  412. "startIsMilestone": false,
  413. "endIsMilestone": false,
  414. "collapsed": false,
  415. "assigs": [],
  416. "hasChild": false
  417. }, {
  418. "id": -16,
  419. "name": "施工专业",
  420. "progress": 0,
  421. "progressByWorklog": false,
  422. "relevance": 0,
  423. "type": "",
  424. "typeId": "",
  425. "description": "",
  426. "code": "",
  427. "level": 2,
  428. "status": "STATUS_SUSPENDED",
  429. "depends": "3",
  430. "canWrite": true,
  431. "start": 1397167200000,
  432. "duration": 4,
  433. "end": 1397685599999,
  434. "startIsMilestone": false,
  435. "endIsMilestone": false,
  436. "collapsed": false,
  437. "assigs": [],
  438. "hasChild": false
  439. }, {
  440. "id": -17,
  441. "name": "施工专业",
  442. "progress": 0,
  443. "progressByWorklog": false,
  444. "relevance": 0,
  445. "type": "",
  446. "typeId": "",
  447. "description": "",
  448. "code": "",
  449. "level": 2,
  450. "status": "STATUS_SUSPENDED",
  451. "depends": "3",
  452. "canWrite": true,
  453. "start": 1397167200000,
  454. "duration": 4,
  455. "end": 1397685599999,
  456. "startIsMilestone": false,
  457. "endIsMilestone": false,
  458. "collapsed": false,
  459. "assigs": [],
  460. "hasChild": false
  461. }, {
  462. "id": -18,
  463. "name": "施工专业",
  464. "progress": 0,
  465. "progressByWorklog": false,
  466. "relevance": 0,
  467. "type": "",
  468. "typeId": "",
  469. "description": "",
  470. "code": "",
  471. "level": 2,
  472. "status": "STATUS_SUSPENDED",
  473. "depends": "3",
  474. "canWrite": true,
  475. "start": 1397167200000,
  476. "duration": 4,
  477. "end": 1397685599999,
  478. "startIsMilestone": false,
  479. "endIsMilestone": false,
  480. "collapsed": false,
  481. "assigs": [],
  482. "hasChild": false
  483. }, {
  484. "id": -19,
  485. "name": "施工专业",
  486. "progress": 0,
  487. "progressByWorklog": false,
  488. "relevance": 0,
  489. "type": "",
  490. "typeId": "",
  491. "description": "",
  492. "code": "",
  493. "level": 2,
  494. "status": "STATUS_SUSPENDED",
  495. "depends": "3",
  496. "canWrite": true,
  497. "start": 1397167200000,
  498. "duration": 4,
  499. "end": 1397685599999,
  500. "startIsMilestone": false,
  501. "endIsMilestone": false,
  502. "collapsed": false,
  503. "assigs": [],
  504. "hasChild": false
  505. }, {
  506. "id": -20,
  507. "name": "施工专业",
  508. "progress": 0,
  509. "progressByWorklog": false,
  510. "relevance": 0,
  511. "type": "",
  512. "typeId": "",
  513. "description": "",
  514. "code": "",
  515. "level": 2,
  516. "status": "STATUS_SUSPENDED",
  517. "depends": "3",
  518. "canWrite": true,
  519. "start": 1397167200000,
  520. "duration": 4,
  521. "end": 1397685599999,
  522. "startIsMilestone": false,
  523. "endIsMilestone": false,
  524. "collapsed": false,
  525. "assigs": [],
  526. "hasChild": false
  527. }, {
  528. "id": -21,
  529. "name": "testing",
  530. "progress": 0,
  531. "progressByWorklog": false,
  532. "relevance": 0,
  533. "type": "",
  534. "typeId": "",
  535. "description": "",
  536. "code": "",
  537. "level": 1,
  538. "status": "STATUS_SUSPENDED",
  539. "depends": "2:5",
  540. "canWrite": true,
  541. "start": 1398981600000,
  542. "duration": 5,
  543. "end": 1399586399999,
  544. "startIsMilestone": false,
  545. "endIsMilestone": false,
  546. "collapsed": false,
  547. "assigs": [],
  548. "hasChild": true
  549. }, {
  550. "id": -22,
  551. "name": "test on safari",
  552. "progress": 0,
  553. "progressByWorklog": false,
  554. "relevance": 0,
  555. "type": "",
  556. "typeId": "",
  557. "description": "",
  558. "code": "",
  559. "level": 2,
  560. "status": "STATUS_SUSPENDED",
  561. "depends": "",
  562. "canWrite": true,
  563. "start": 1398981600000,
  564. "duration": 2,
  565. "end": 1399327199999,
  566. "startIsMilestone": false,
  567. "endIsMilestone": false,
  568. "collapsed": false,
  569. "assigs": [],
  570. "hasChild": false
  571. }],
  572. "selectedRow": 2,
  573. "deletedTaskIds": [],
  574. "resources": [{
  575. "id": "tmp_1",
  576. "name": "秦晓川"
  577. }, {
  578. "id": "tmp_2",
  579. "name": "冯文涛"
  580. }, {
  581. "id": "tmp_3",
  582. "name": "张武"
  583. }, {
  584. "id": "tmp_4",
  585. "name": "陈小云"
  586. }],
  587. "roles": [{
  588. "id": "tmp_1",
  589. "name": "项目负责人"
  590. }, {
  591. "id": "tmp_2",
  592. "name": "专业负责人"
  593. }, {
  594. "id": "tmp_3",
  595. "name": "专业负责人"
  596. }, {
  597. "id": "tmp_4",
  598. "name": "审查"
  599. }],
  600. "canWrite": true,
  601. "canWriteOnParent": true,
  602. "zoom": "w3"
  603. };
  604. var ge;
  605. $(function() {
  606. var canWrite = true; //this is the default for test purposes
  607. // here starts gantt initialization
  608. ge = new GanttMaster();
  609. var workSpace = $("#workSpace");
  610. workSpace.css({
  611. width: $(window).width(),
  612. height: $(window).height()
  613. });
  614. ge.init(workSpace);
  615. loadI18n(); //overwrite with localized ones
  616. //in order to force compute the best-fitting zoom level
  617. delete ge.gantt.zoom;
  618. loadFromLocalStorage();
  619. //var project = loadFromLocalStorage();
  620. //if (!project.canWrite)
  621. // $(".ganttButtonBar button.requireWrite").attr("disabled", "true");
  622. //ge.loadProject(project);
  623. //ge.checkpoint(); //empty the undo stack
  624. //ge.editor.element.oneTime(100, "cl", function() {
  625. // $(this).find("tr.emptyRow:first").click()
  626. //});
  627. //$(window).resize(function() {
  628. // workSpace.css({
  629. // width: $(window).width() - 1,
  630. // height: $(window).height() - workSpace.position().top
  631. // });
  632. // workSpace.trigger("resize.gantt");
  633. //}).oneTime(150, "resize", function() {
  634. // $(this).trigger("resize")
  635. //});
  636. });
  637. function loadGanttFromServer(taskId, callback) {
  638. //this is a simulation: load data from the local storage if you have already played with the demo or a textarea with starting demo data
  639. loadFromLocalStorage();
  640. //this is the real implementation
  641. /*
  642. //var taskId = $("#taskSelector").val();
  643. var prof = new Profiler("loadServerSide");
  644. prof.reset();
  645. $.getJSON("ganttAjaxController.jsp", {CM:"LOADPROJECT",taskId:taskId}, function(response) {
  646. //console.debug(response);
  647. if (response.ok) {
  648. prof.stop();
  649. ge.loadProject(response.project);
  650. ge.checkpoint(); //empty the undo stack
  651. if (typeof(callback)=="function") {
  652. callback(response);
  653. }
  654. } else {
  655. jsonErrorHandling(response);
  656. }
  657. });
  658. */
  659. }
  660. function saveGanttOnServer() {
  661. //this is a simulation: save data to the local storage or to the textarea
  662. saveInLocalStorage();
  663. var prj = ge.saveProject();
  664. // alert(prj[0]);
  665. // alert(JSON.stringify(prj));
  666. delete prj.resources;
  667. delete prj.roles;
  668. // var prof = new Profiler("saveServerSide");
  669. // prof.reset();
  670. if (ge.deletedTaskIds.length > 0) {
  671. if (!confirm("TASK_THAT_WILL_BE_REMOVED\n" + ge.deletedTaskIds.length)) {
  672. return;
  673. }
  674. }
  675. // if (name&&code){
  676. $.ajax({
  677. type: "post",
  678. url: "/projectgant/addprojgant",
  679. data: {
  680. prj: JSON.stringify(prj)
  681. }, //
  682. success: function(data, status) {
  683. alert("添加“" + data + "”成功!(status:" + status + ".)");
  684. //按确定后再刷新
  685. // $('#modalTable').modal('hide');
  686. }
  687. });
  688. // }else{
  689. // alert("请填写编号和名称!");
  690. // return;
  691. // }
  692. // $.ajax("/projectgant/addprojgant", {
  693. // dataType:"json",
  694. // data: {CM:"SVPROJECT",prj:JSON.stringify(prj)},
  695. // type:"POST",
  696. // success: function(response) {
  697. // if (response.ok) {
  698. // prof.stop();
  699. // if (response.project) {
  700. // ge.loadProject(response.project); //must reload as "tmp_" ids are now the good ones
  701. // } else {
  702. // ge.reset();
  703. // }
  704. // } else {
  705. // var errMsg="Errors saving project\n";
  706. // if (response.message) {
  707. // errMsg=errMsg+response.message+"\n";
  708. // }
  709. // if (response.errorMessages.length) {
  710. // errMsg += response.errorMessages.join("\n");
  711. // }
  712. // alert(errMsg);
  713. // }
  714. // }
  715. // });
  716. }
  717. function addGanttOnServer() {
  718. //top.learun.httpAsync('GET', top.$.rootUrl + '/LR_OAModule/ProjectGantt/GetList', { queryJson: "test" }, function (res) {
  719. // console.log(res);
  720. //});
  721. top.learun.layerForm({
  722. id: 'form',
  723. title: '添加',
  724. url: top.$.rootUrl + '/LR_OAModule/ProjectGantt/Form?keyValue=',
  725. width: 600,
  726. height: 400,
  727. callBack: function (id) {
  728. return top[id].acceptClick(refreshGanttOnServer);
  729. }
  730. });
  731. }
  732. function refreshGanttOnServer() {
  733. location.reload();
  734. }
  735. function newProject() {
  736. clearGantt();
  737. }
  738. //------------------------------------------- Create some demo data ------------------------------------------------------
  739. function setRoles() {
  740. ge.roles = [{
  741. id: "tmp_1",
  742. name: "Project Manager"
  743. }, {
  744. id: "tmp_2",
  745. name: "Worker"
  746. }, {
  747. id: "tmp_3",
  748. name: "Stakeholder"
  749. }, {
  750. id: "tmp_4",
  751. name: "Customer"
  752. }];
  753. }
  754. function setResource() {
  755. var res = [];
  756. for (var i = 1; i <= 10; i++) {
  757. res.push({
  758. id: "tmp_" + i,
  759. name: "Resource " + i
  760. });
  761. }
  762. ge.resources = res;
  763. }
  764. function editResources() {}
  765. function clearGantt() {
  766. ge.reset();
  767. }
  768. function loadI18n() {
  769. GanttMaster.messages = {
  770. "CANNOT_WRITE": "CANNOT_WRITE",
  771. "CHANGE_OUT_OF_SCOPE": "NO_RIGHTS_FOR_UPDATE_PARENTS_OUT_OF_EDITOR_SCOPE",
  772. "START_IS_MILESTONE": "START_IS_MILESTONE",
  773. "END_IS_MILESTONE": "END_IS_MILESTONE",
  774. "TASK_HAS_CONSTRAINTS": "TASK_HAS_CONSTRAINTS",
  775. "GANTT_ERROR_DEPENDS_ON_OPEN_TASK": "GANTT_ERROR_DEPENDS_ON_OPEN_TASK",
  776. "GANTT_ERROR_DESCENDANT_OF_CLOSED_TASK": "GANTT_ERROR_DESCENDANT_OF_CLOSED_TASK",
  777. "TASK_HAS_EXTERNAL_DEPS": "TASK_HAS_EXTERNAL_DEPS",
  778. "GANTT_ERROR_LOADING_DATA_TASK_REMOVED": "GANTT_ERROR_LOADING_DATA_TASK_REMOVED",
  779. "ERROR_SETTING_DATES": "ERROR_SETTING_DATES",
  780. "CIRCULAR_REFERENCE": "CIRCULAR_REFERENCE",
  781. "CANNOT_DEPENDS_ON_ANCESTORS": "CANNOT_DEPENDS_ON_ANCESTORS",
  782. "CANNOT_DEPENDS_ON_DESCENDANTS": "CANNOT_DEPENDS_ON_DESCENDANTS",
  783. "INVALID_DATE_FORMAT": "INVALID_DATE_FORMAT",
  784. "TASK_MOVE_INCONSISTENT_LEVEL": "TASK_MOVE_INCONSISTENT_LEVEL",
  785. "GANTT_QUARTER_SHORT": "trim.",
  786. "GANTT_SEMESTER_SHORT": "sem."
  787. };
  788. }
  789. //------------------------------------------- Get project file as JSON (used for migrate project from gantt to Teamwork) ------------------------------------------------------
  790. function getFile() {
  791. $("#gimBaPrj").val(JSON.stringify(ge.saveProject()));
  792. $("#gimmeBack").submit();
  793. $("#gimBaPrj").val("");
  794. /* var uriContent = "data:text/html;charset=utf-8," + encodeURIComponent(JSON.stringify(prj));
  795. neww=window.open(uriContent,"dl");*/
  796. }
  797. function loadFromLocalStorage() {
  798. var ret;
  799. //if (localStorage) {
  800. // if (localStorage.getObject("teamworkGantDemo")) {
  801. // ret = localStorage.getObject("teamworkGantDemo");
  802. // }
  803. //}
  804. top.learun.httpAsync('GET', top.$.rootUrl + '/LR_OAModule/ProjectGantt/GetList', { queryJson: "test" }, function (res) {
  805. console.log(res);
  806. for (var i = 0; i < res.length; i++) {
  807. res[i].start = parseInt(res[i].start);
  808. res[i].end = parseInt(res[i].end);
  809. }
  810. ret = {
  811. "tasks": res,
  812. "selectedRow": 0,
  813. "deletedTaskIds": [],
  814. "resources": [{
  815. "id": "tmp_1",
  816. "name": "秦晓川"
  817. }, {
  818. "id": "tmp_2",
  819. "name": "冯文涛"
  820. }, {
  821. "id": "tmp_3",
  822. "name": "张武"
  823. }, {
  824. "id": "tmp_4",
  825. "name": "陈小云"
  826. }],
  827. "roles": [{
  828. "id": "tmp_1",
  829. "name": "项目负责人"
  830. }, {
  831. "id": "tmp_2",
  832. "name": "专业负责人"
  833. }, {
  834. "id": "tmp_3",
  835. "name": "专业负责人"
  836. }, {
  837. "id": "tmp_4",
  838. "name": "审查"
  839. }],
  840. "canWrite": true,
  841. "canWriteOnParent": true,
  842. "zoom": "w3"
  843. }
  844. //if not found create a new example task
  845. if (!ret || !ret.tasks || ret.tasks.length == 0) {
  846. ret = {
  847. "tasks": [{
  848. "id": -1,
  849. "name": "珠三角水资源配置工程",
  850. "progress": 80,
  851. "progressByWorklog": false,
  852. "relevance": 0,
  853. "type": "",
  854. "typeId": "",
  855. "description": "172项重大水利工程",
  856. "code": "SL2017",
  857. "level": 0,
  858. "status": "STATUS_ACTIVE",
  859. "depends": "",
  860. "canWrite": true,
  861. "start": 1396994400000,
  862. "duration": 20,
  863. "end": 1399586399999,
  864. "startIsMilestone": false,
  865. "endIsMilestone": false,
  866. "collapsed": false,
  867. "hasChild": true,
  868. "assigs": [{
  869. "resourceId": "tmp_1",
  870. "id": "tmp_1345625008213",
  871. "roleId": "tmp_1",
  872. "effort": 7200000
  873. }, {
  874. "resourceId": "tmp_2",
  875. "id": "tmp_1345625008213",
  876. "roleId": "tmp_1",
  877. "effort": 7200000
  878. }],
  879. }, {
  880. "id": -2,
  881. "name": "可行性研究阶段",
  882. "progress": 0,
  883. "progressByWorklog": false,
  884. "relevance": 0,
  885. "type": "",
  886. "typeId": "",
  887. "description": "",
  888. "code": "",
  889. "level": 1,
  890. "status": "STATUS_ACTIVE",
  891. "depends": "",
  892. "canWrite": true,
  893. "start": 1396994400000,
  894. "duration": 10,
  895. "end": 1398203999999,
  896. "startIsMilestone": false,
  897. "endIsMilestone": false,
  898. "collapsed": false,
  899. "assigs": [],
  900. "hasChild": true,
  901. "progress": 20,
  902. "assigs": [{
  903. "resourceId": "tmp_2",
  904. "id": "tmp_1345625008213",
  905. "roleId": "tmp_1",
  906. "effort": 7200000
  907. }],
  908. }, {
  909. "id": -3,
  910. "name": "水工专业",
  911. "progress": 0,
  912. "progressByWorklog": false,
  913. "relevance": 0,
  914. "type": "",
  915. "typeId": "",
  916. "description": "",
  917. "code": "",
  918. "level": 2,
  919. "status": "STATUS_ACTIVE",
  920. "depends": "",
  921. "canWrite": true,
  922. "start": 1396994400000,
  923. "duration": 2,
  924. "end": 1397167199999,
  925. "startIsMilestone": false,
  926. "endIsMilestone": false,
  927. "collapsed": false,
  928. "assigs": [],
  929. "hasChild": false,
  930. "progress": 20,
  931. "assigs": [{
  932. "resourceId": "tmp_3",
  933. "id": "tmp_1345625008213",
  934. "roleId": "tmp_1",
  935. "effort": 7200000
  936. }],
  937. }, {
  938. "id": -4,
  939. "name": "施工专业",
  940. "progress": 0,
  941. "progressByWorklog": false,
  942. "relevance": 0,
  943. "type": "",
  944. "typeId": "",
  945. "description": "",
  946. "code": "",
  947. "level": 2,
  948. "status": "STATUS_SUSPENDED",
  949. "depends": "3",
  950. "canWrite": true,
  951. "start": 1397167200000,
  952. "duration": 4,
  953. "end": 1397685599999,
  954. "startIsMilestone": false,
  955. "endIsMilestone": false,
  956. "collapsed": false,
  957. "assigs": [],
  958. "hasChild": false
  959. }, {
  960. "id": -5,
  961. "name": "施工专业",
  962. "progress": 0,
  963. "progressByWorklog": false,
  964. "relevance": 0,
  965. "type": "",
  966. "typeId": "",
  967. "description": "",
  968. "code": "",
  969. "level": 2,
  970. "status": "STATUS_SUSPENDED",
  971. "depends": "3",
  972. "canWrite": true,
  973. "start": 1397167200000,
  974. "duration": 4,
  975. "end": 1397685599999,
  976. "startIsMilestone": false,
  977. "endIsMilestone": false,
  978. "collapsed": false,
  979. "assigs": [],
  980. "hasChild": false
  981. }, {
  982. "id": -6,
  983. "name": "施工专业",
  984. "progress": 0,
  985. "progressByWorklog": false,
  986. "relevance": 0,
  987. "type": "",
  988. "typeId": "",
  989. "description": "",
  990. "code": "",
  991. "level": 2,
  992. "status": "STATUS_SUSPENDED",
  993. "depends": "3",
  994. "canWrite": true,
  995. "start": 1397167200000,
  996. "duration": 4,
  997. "end": 1397685599999,
  998. "startIsMilestone": false,
  999. "endIsMilestone": false,
  1000. "collapsed": false,
  1001. "assigs": [],
  1002. "hasChild": false
  1003. }, {
  1004. "id": -7,
  1005. "name": "施工专业",
  1006. "progress": 0,
  1007. "progressByWorklog": false,
  1008. "relevance": 0,
  1009. "type": "",
  1010. "typeId": "",
  1011. "description": "",
  1012. "code": "",
  1013. "level": 2,
  1014. "status": "STATUS_SUSPENDED",
  1015. "depends": "3",
  1016. "canWrite": true,
  1017. "start": 1397167200000,
  1018. "duration": 4,
  1019. "end": 1397685599999,
  1020. "startIsMilestone": false,
  1021. "endIsMilestone": false,
  1022. "collapsed": false,
  1023. "assigs": [],
  1024. "hasChild": false
  1025. }, {
  1026. "id": -8,
  1027. "name": "施工专业",
  1028. "progress": 0,
  1029. "progressByWorklog": false,
  1030. "relevance": 0,
  1031. "type": "",
  1032. "typeId": "",
  1033. "description": "",
  1034. "code": "",
  1035. "level": 2,
  1036. "status": "STATUS_SUSPENDED",
  1037. "depends": "3",
  1038. "canWrite": true,
  1039. "start": 1397167200000,
  1040. "duration": 4,
  1041. "end": 1397685599999,
  1042. "startIsMilestone": false,
  1043. "endIsMilestone": false,
  1044. "collapsed": false,
  1045. "assigs": [],
  1046. "hasChild": false
  1047. }, {
  1048. "id": -9,
  1049. "name": "施工专业",
  1050. "progress": 0,
  1051. "progressByWorklog": false,
  1052. "relevance": 0,
  1053. "type": "",
  1054. "typeId": "",
  1055. "description": "",
  1056. "code": "",
  1057. "level": 2,
  1058. "status": "STATUS_SUSPENDED",
  1059. "depends": "3",
  1060. "canWrite": true,
  1061. "start": 1397167200000,
  1062. "duration": 4,
  1063. "end": 1397685599999,
  1064. "startIsMilestone": false,
  1065. "endIsMilestone": false,
  1066. "collapsed": false,
  1067. "assigs": [],
  1068. "hasChild": false
  1069. }, {
  1070. "id": -10,
  1071. "name": "施工专业",
  1072. "progress": 0,
  1073. "progressByWorklog": false,
  1074. "relevance": 0,
  1075. "type": "",
  1076. "typeId": "",
  1077. "description": "",
  1078. "code": "",
  1079. "level": 2,
  1080. "status": "STATUS_SUSPENDED",
  1081. "depends": "3",
  1082. "canWrite": true,
  1083. "start": 1397167200000,
  1084. "duration": 4,
  1085. "end": 1397685599999,
  1086. "startIsMilestone": false,
  1087. "endIsMilestone": false,
  1088. "collapsed": false,
  1089. "assigs": [],
  1090. "hasChild": false
  1091. }, {
  1092. "id": -11,
  1093. "name": "施工专业",
  1094. "progress": 0,
  1095. "progressByWorklog": false,
  1096. "relevance": 0,
  1097. "type": "",
  1098. "typeId": "",
  1099. "description": "",
  1100. "code": "",
  1101. "level": 2,
  1102. "status": "STATUS_SUSPENDED",
  1103. "depends": "3",
  1104. "canWrite": true,
  1105. "start": 1397167200000,
  1106. "duration": 4,
  1107. "end": 1397685599999,
  1108. "startIsMilestone": false,
  1109. "endIsMilestone": false,
  1110. "collapsed": false,
  1111. "assigs": [],
  1112. "hasChild": false
  1113. }, {
  1114. "id": -12,
  1115. "name": "施工专业",
  1116. "progress": 0,
  1117. "progressByWorklog": false,
  1118. "relevance": 0,
  1119. "type": "",
  1120. "typeId": "",
  1121. "description": "",
  1122. "code": "",
  1123. "level": 2,
  1124. "status": "STATUS_SUSPENDED",
  1125. "depends": "3",
  1126. "canWrite": true,
  1127. "start": 1397167200000,
  1128. "duration": 4,
  1129. "end": 1397685599999,
  1130. "startIsMilestone": false,
  1131. "endIsMilestone": false,
  1132. "collapsed": false,
  1133. "assigs": [],
  1134. "hasChild": false
  1135. }, {
  1136. "id": -13,
  1137. "name": "施工专业",
  1138. "progress": 0,
  1139. "progressByWorklog": false,
  1140. "relevance": 0,
  1141. "type": "",
  1142. "typeId": "",
  1143. "description": "",
  1144. "code": "",
  1145. "level": 2,
  1146. "status": "STATUS_SUSPENDED",
  1147. "depends": "3",
  1148. "canWrite": true,
  1149. "start": 1397167200000,
  1150. "duration": 4,
  1151. "end": 1397685599999,
  1152. "startIsMilestone": false,
  1153. "endIsMilestone": false,
  1154. "collapsed": false,
  1155. "assigs": [],
  1156. "hasChild": false
  1157. }, {
  1158. "id": -14,
  1159. "name": "施工专业",
  1160. "progress": 0,
  1161. "progressByWorklog": false,
  1162. "relevance": 0,
  1163. "type": "",
  1164. "typeId": "",
  1165. "description": "",
  1166. "code": "",
  1167. "level": 2,
  1168. "status": "STATUS_SUSPENDED",
  1169. "depends": "3",
  1170. "canWrite": true,
  1171. "start": 1397167200000,
  1172. "duration": 4,
  1173. "end": 1397685599999,
  1174. "startIsMilestone": false,
  1175. "endIsMilestone": false,
  1176. "collapsed": false,
  1177. "assigs": [],
  1178. "hasChild": false
  1179. }, {
  1180. "id": -15,
  1181. "name": "施工专业",
  1182. "progress": 0,
  1183. "progressByWorklog": false,
  1184. "relevance": 0,
  1185. "type": "",
  1186. "typeId": "",
  1187. "description": "",
  1188. "code": "",
  1189. "level": 2,
  1190. "status": "STATUS_SUSPENDED",
  1191. "depends": "3",
  1192. "canWrite": true,
  1193. "start": 1397167200000,
  1194. "duration": 4,
  1195. "end": 1397685599999,
  1196. "startIsMilestone": false,
  1197. "endIsMilestone": false,
  1198. "collapsed": false,
  1199. "assigs": [],
  1200. "hasChild": false
  1201. }, {
  1202. "id": -16,
  1203. "name": "施工专业",
  1204. "progress": 0,
  1205. "progressByWorklog": false,
  1206. "relevance": 0,
  1207. "type": "",
  1208. "typeId": "",
  1209. "description": "",
  1210. "code": "",
  1211. "level": 2,
  1212. "status": "STATUS_SUSPENDED",
  1213. "depends": "3",
  1214. "canWrite": true,
  1215. "start": 1397167200000,
  1216. "duration": 4,
  1217. "end": 1397685599999,
  1218. "startIsMilestone": false,
  1219. "endIsMilestone": false,
  1220. "collapsed": false,
  1221. "assigs": [],
  1222. "hasChild": false
  1223. }, {
  1224. "id": -17,
  1225. "name": "施工专业",
  1226. "progress": 0,
  1227. "progressByWorklog": false,
  1228. "relevance": 0,
  1229. "type": "",
  1230. "typeId": "",
  1231. "description": "",
  1232. "code": "",
  1233. "level": 2,
  1234. "status": "STATUS_SUSPENDED",
  1235. "depends": "3",
  1236. "canWrite": true,
  1237. "start": 1397167200000,
  1238. "duration": 4,
  1239. "end": 1397685599999,
  1240. "startIsMilestone": false,
  1241. "endIsMilestone": false,
  1242. "collapsed": false,
  1243. "assigs": [],
  1244. "hasChild": false
  1245. }, {
  1246. "id": -18,
  1247. "name": "施工专业",
  1248. "progress": 0,
  1249. "progressByWorklog": false,
  1250. "relevance": 0,
  1251. "type": "",
  1252. "typeId": "",
  1253. "description": "",
  1254. "code": "",
  1255. "level": 2,
  1256. "status": "STATUS_SUSPENDED",
  1257. "depends": "3",
  1258. "canWrite": true,
  1259. "start": 1397167200000,
  1260. "duration": 4,
  1261. "end": 1397685599999,
  1262. "startIsMilestone": false,
  1263. "endIsMilestone": false,
  1264. "collapsed": false,
  1265. "assigs": [],
  1266. "hasChild": false
  1267. }, {
  1268. "id": -19,
  1269. "name": "施工专业",
  1270. "progress": 0,
  1271. "progressByWorklog": false,
  1272. "relevance": 0,
  1273. "type": "",
  1274. "typeId": "",
  1275. "description": "",
  1276. "code": "",
  1277. "level": 2,
  1278. "status": "STATUS_SUSPENDED",
  1279. "depends": "3",
  1280. "canWrite": true,
  1281. "start": 1397167200000,
  1282. "duration": 4,
  1283. "end": 1397685599999,
  1284. "startIsMilestone": false,
  1285. "endIsMilestone": false,
  1286. "collapsed": false,
  1287. "assigs": [],
  1288. "hasChild": false
  1289. }, {
  1290. "id": -20,
  1291. "name": "施工专业",
  1292. "progress": 0,
  1293. "progressByWorklog": false,
  1294. "relevance": 0,
  1295. "type": "",
  1296. "typeId": "",
  1297. "description": "",
  1298. "code": "",
  1299. "level": 2,
  1300. "status": "STATUS_SUSPENDED",
  1301. "depends": "3",
  1302. "canWrite": true,
  1303. "start": 1397167200000,
  1304. "duration": 4,
  1305. "end": 1397685599999,
  1306. "startIsMilestone": false,
  1307. "endIsMilestone": false,
  1308. "collapsed": false,
  1309. "assigs": [],
  1310. "hasChild": false
  1311. }],
  1312. "selectedRow": 2,
  1313. "deletedTaskIds": [],
  1314. "resources": [{
  1315. "id": "tmp_1",
  1316. "name": "秦晓川"
  1317. }, {
  1318. "id": "tmp_2",
  1319. "name": "冯文涛"
  1320. }, {
  1321. "id": "tmp_3",
  1322. "name": "张武"
  1323. }, {
  1324. "id": "tmp_4",
  1325. "name": "陈小云"
  1326. }],
  1327. "roles": [{
  1328. "id": "tmp_1",
  1329. "name": "项目负责人"
  1330. }, {
  1331. "id": "tmp_2",
  1332. "name": "专业负责人"
  1333. }, {
  1334. "id": "tmp_3",
  1335. "name": "专业负责人"
  1336. }, {
  1337. "id": "tmp_4",
  1338. "name": "审查"
  1339. }],
  1340. "canWrite": true,
  1341. "canWriteOnParent": true,
  1342. "zoom": "w3"
  1343. }
  1344. //actualize data
  1345. var offset = new Date().getTime() - ret.tasks[0].start;
  1346. for (var i = 0; i < ret.tasks.length; i++) {
  1347. ret.tasks[i].start = ret.tasks[i].start + offset;
  1348. }
  1349. }
  1350. if (!ret.canWrite)
  1351. $(".ganttButtonBar button.requireWrite").attr("disabled", "true");
  1352. ge.loadProject(ret);
  1353. ge.checkpoint(); //empty the undo stack
  1354. });
  1355. }
  1356. function saveInLocalStorage() {
  1357. var prj = ge.saveProject();
  1358. if (localStorage) {
  1359. localStorage.setObject("teamworkGantDemo", prj);
  1360. }
  1361. }
  1362. </script>
  1363. <!-- <img src="/static/css/gantt/res/twproject-badge.png" style="max-width: 120px" /> -->
  1364. <div id="gantEditorTemplates" style="display:none; ">
  1365. <div class="__template__" type="GANTBUTTONS">
  1366. <div class="ganttButtonBar noprint" style="background-color:#fff !important;" >
  1367. <div class="buttons" style="position:relative;">
  1368. <button onclick="$('#workSpace').trigger('undo.gantt');return false;" class="button textual icon requireCanWrite" title="undo"><span class="teamworkIcon">&#39;</span></button>
  1369. <button onclick="$('#workSpace').trigger('redo.gantt');return false;" class="button textual icon requireCanWrite" title="redo"><span class="teamworkIcon">&middot;</span></button>
  1370. <span class="ganttButtonSeparator requireCanWrite"></span>
  1371. <button onclick="$('#workSpace').trigger('deleteCurrentTask.gantt');return false;" class="button textual icon delete requireCanWrite" title="Delete"><span class="teamworkIcon">&cent;</span></button>
  1372. <span class="ganttButtonSeparator requireCanAddIssue"></span>
  1373. <span class="ganttButtonSeparator"></span>
  1374. <button onclick="$('#workSpace').trigger('zoomMinus.gantt'); return false;" class="button textual icon " title="zoom out"><span class="teamworkIcon">)</span></button>
  1375. <button onclick="$('#workSpace').trigger('zoomPlus.gantt');return false;" class="button textual icon " title="zoom in"><span class="teamworkIcon">(</span></button>
  1376. <span class="ganttButtonSeparator requireCanSeeCriticalPath"></span>
  1377. <button onclick="ge.splitter.resize(.1);return false;" class="button textual icon"><span class="teamworkIcon">F</span></button>
  1378. <button onclick="ge.splitter.resize(50);return false;" class="button textual icon"><span class="teamworkIcon">O</span></button>
  1379. <button onclick="ge.splitter.resize(100);return false;" class="button textual icon"><span class="teamworkIcon">R</span></button>
  1380. <span class="ganttButtonSeparator"></span>
  1381. <div class="btn-group btn-group-sm" style="position:absolute; right:35px; top:0; height:100%;padding-top:10px;">
  1382. <button onclick="refreshGanttOnServer();" class="btn btn-default add" title="Refresh"><i class="fa fa-refresh"></i></button>
  1383. <button onclick="addGanttOnServer();"class="btn btn-default add" title="Add"><i class="fa fa-plus"></i>&nbsp; 添加</button>
  1384. <button onclick="saveGanttOnServer();" class="btn btn-default add" title="Save"><i class="fa fa-save"></i>&nbsp;保存</button>
  1385. </div>
  1386. </div>
  1387. </div>
  1388. </div>
  1389. <div class="__template__" type="TASKSEDITHEAD">
  1390. <table class="gdfTable" cellspacing="0" cellpadding="0">
  1391. <thead>
  1392. <tr style="height:40px">
  1393. <th class="gdfColHeader" style="width:35px; border-right: none"></th>
  1394. <th class="gdfColHeader" style="width:25px;"></th>
  1395. <th class="gdfColHeader gdfResizable" style="width:100px;">编号</th>
  1396. <th class="gdfColHeader gdfResizable" style="width:300px;">名称</th>
  1397. <th class="gdfColHeader" align="center" style="width:20px;" title="Start date is a milestone."><span class="teamworkIcon" style="font-size: 8px;">^</span></th>
  1398. <th class="gdfColHeader gdfResizable" style="width:80px;">开始</th>
  1399. <th class="gdfColHeader" align="center" style="width:20px;" title="End date is a milestone."><span class="teamworkIcon" style="font-size: 8px;">^</span></th>
  1400. <th class="gdfColHeader gdfResizable" style="width:80px;">结束</th>
  1401. <th class="gdfColHeader gdfResizable" style="width:50px;">dur.</th>
  1402. <th class="gdfColHeader gdfResizable" style="width:20px;">%</th>
  1403. <th class="gdfColHeader gdfResizable requireCanSeeDep" style="width:50px;">depe.</th>
  1404. <th class="gdfColHeader gdfResizable" style="width:1000px; text-align: left; padding-left: 10px;">资源分配</th>
  1405. </tr>
  1406. </thead>
  1407. </table>
  1408. </div>
  1409. <div class="__template__" type="TASKROW">
  1410. <!--
  1411. <tr taskId="(#=obj.id#)" class="taskEditRow (#=obj.isParent()?'isParent':''#) (#=obj.collapsed?'collapsed':''#)" level="(#=level#)">
  1412. <th class="gdfCell edit" align="right" style="cursor:pointer;"><span class="taskRowIndex">(#=obj.getRow()+1#)</span> <span class="teamworkIcon" style="font-size:12px;" >e</span></th>
  1413. <td class="gdfCell noClip" align="center"><div class="taskStatus cvcColorSquare" status="(#=obj.status#)"></div></td>
  1414. <td class="gdfCell"><input type="text" name="code" value="(#=obj.code?obj.code:''#)" placeholder="code/short name"></td>
  1415. <td class="gdfCell indentCell" style="padding-left:(#=obj.level*10+18#)px;">
  1416. <div class="exp-controller" align="center"></div>
  1417. <input type="text" name="name" value="(#=obj.name#)" placeholder="name">
  1418. </td>
  1419. <td class="gdfCell" align="center"><input type="checkbox" name="startIsMilestone"></td>
  1420. <td class="gdfCell"><input type="text" name="start" value="" class="date"></td>
  1421. <td class="gdfCell" align="center"><input type="checkbox" name="endIsMilestone"></td>
  1422. <td class="gdfCell"><input type="text" name="end" value="" class="date"></td>
  1423. <td class="gdfCell"><input type="text" name="duration" autocomplete="off" value="(#=obj.duration#)"></td>
  1424. <td class="gdfCell"><input type="text" name="progress" class="validated" entrytype="PERCENTILE" autocomplete="off" value="(#=obj.progress?obj.progress:''#)" (#=obj.progressByWorklog?"readOnly":""#)></td>
  1425. <td class="gdfCell requireCanSeeDep"><input type="text" name="depends" autocomplete="off" value="(#=obj.depends#)" (#=obj.hasExternalDep?"readonly":""#)></td>
  1426. <td class="gdfCell taskAssigs">(#=obj.getAssigsString()#)</td>
  1427. </tr>
  1428. -->
  1429. </div>
  1430. <div class="__template__" type="TASKEMPTYROW">
  1431. <tr class="taskEditRow emptyRow">
  1432. <th class="gdfCell" align="right"></th>
  1433. <td class="gdfCell noClip" align="center"></td>
  1434. <td class="gdfCell"></td>
  1435. <td class="gdfCell"></td>
  1436. <td class="gdfCell"></td>
  1437. <td class="gdfCell"></td>
  1438. <td class="gdfCell"></td>
  1439. <td class="gdfCell"></td>
  1440. <td class="gdfCell"></td>
  1441. <td class="gdfCell"></td>
  1442. <td class="gdfCell requireCanSeeDep"></td>
  1443. <td class="gdfCell"></td>
  1444. </tr>
  1445. </div>
  1446. <div class="__template__" type="TASKBAR">
  1447. <!--
  1448. <div class="taskBox taskBoxDiv" taskId="(#=obj.id#)" >
  1449. <div class="layout (#=obj.hasExternalDep?'extDep':''#)">
  1450. <div class="taskStatus" status="(#=obj.status#)"></div>
  1451. <div class="taskProgress" style="width:(#=obj.progress>100?100:obj.progress#)%; background-color:(#=obj.progress>100?'red':'rgb(153,255,51);'#);"></div>
  1452. <div class="milestone (#=obj.startIsMilestone?'active':''#)" ></div>
  1453. <div class="taskLabel"></div>
  1454. <div class="milestone end (#=obj.endIsMilestone?'active':''#)" ></div>
  1455. </div>
  1456. </div>
  1457. -->
  1458. </div>
  1459. <div class="__template__" type="CHANGE_STATUS">
  1460. <div class="taskStatusBox">
  1461. <div class="taskStatus cvcColorSquare" status="STATUS_ACTIVE" title="active"></div>
  1462. <div class="taskStatus cvcColorSquare" status="STATUS_DONE" title="completed"></div>
  1463. <div class="taskStatus cvcColorSquare" status="STATUS_FAILED" title="failed"></div>
  1464. <div class="taskStatus cvcColorSquare" status="STATUS_SUSPENDED" title="suspended"></div>
  1465. <div class="taskStatus cvcColorSquare" status="STATUS_UNDEFINED" title="undefined"></div>
  1466. </div>
  1467. </div>
  1468. <div class="__template__" type="TASK_EDITOR">
  1469. <div class="ganttTaskEditor">
  1470. <h2 class="taskData">任务编辑</h2>
  1471. <table cellspacing="1" cellpadding="5" width="100%" class="taskData table" border="0">
  1472. <tr>
  1473. <td width="200" style="height: 80px" valign="top">
  1474. <label for="code">编号</label><br>
  1475. <input type="text" name="code" id="code" value="" size=15 class="formElements" autocomplete='off' maxlength=255 style='width:100%' oldvalue="1">
  1476. </td>
  1477. <td colspan="3" valign="top"><label for="name" class="required">名称</label><br><input type="text" name="name" id="name" class="formElements" autocomplete='off' maxlength=255 style='width:100%' value="" required="true" oldvalue="1"></td>
  1478. </tr>
  1479. <tr class="dateRow">
  1480. <td nowrap="">
  1481. <div style="position:relative">
  1482. <label for="start">开始</label>&nbsp;&nbsp;&nbsp;&nbsp;
  1483. <input type="checkbox" id="startIsMilestone" name="startIsMilestone" value="yes"> &nbsp;<label for="startIsMilestone">里程碑</label>&nbsp;
  1484. <br><input type="text" name="start" id="start" size="8" class="formElements dateField validated date" autocomplete="off" maxlength="255" value="" oldvalue="1" entrytype="DATE">
  1485. <span title="calendar" id="starts_inputDate" class="teamworkIcon openCalendar" onclick="$(this).dateField({inputField:$(this).prevAll(':input:first'),isSearchField:false});">m</span>
  1486. </div>
  1487. </td>
  1488. <td nowrap="">
  1489. <label for="end">结束</label>&nbsp;&nbsp;&nbsp;&nbsp;
  1490. <input type="checkbox" id="endIsMilestone" name="endIsMilestone" value="yes"> &nbsp;<label for="endIsMilestone">里程碑</label>&nbsp;
  1491. <br><input type="text" name="end" id="end" size="8" class="formElements dateField validated date" autocomplete="off" maxlength="255" value="" oldvalue="1" entrytype="DATE">
  1492. <span title="calendar" id="ends_inputDate" class="teamworkIcon openCalendar" onclick="$(this).dateField({inputField:$(this).prevAll(':input:first'),isSearchField:false});">m</span>
  1493. </td>
  1494. <td nowrap="">
  1495. <label for="duration" class=" ">天数</label><br>
  1496. <input type="text" name="duration" id="duration" size="4" class="formElements validated durationdays" title="Duration is in working days." autocomplete="off" maxlength="255" value="" oldvalue="1" entrytype="DURATIONDAYS">&nbsp;
  1497. </td>
  1498. </tr>
  1499. <tr>
  1500. <td colspan="2">
  1501. <label for="status" class=" ">状态</label><br>
  1502. <select id="status" name="status" class="taskStatus" status="(#=obj.status#)" onchange="$(this).attr('STATUS',$(this).val());">
  1503. <option value="STATUS_ACTIVE" class="taskStatus" status="STATUS_ACTIVE">进行</option>
  1504. <option value="STATUS_SUSPENDED" class="taskStatus" status="STATUS_SUSPENDED">延期</option>
  1505. <option value="STATUS_DONE" class="taskStatus" status="STATUS_DONE">完成</option>
  1506. <option value="STATUS_FAILED" class="taskStatus" status="STATUS_FAILED">失败</option>
  1507. <option value="STATUS_UNDEFINED" class="taskStatus" status="STATUS_UNDEFINED">未定义</option>
  1508. </select>
  1509. </td>
  1510. <td valign="top" nowrap>
  1511. <label>完成度%</label><br>
  1512. <input type="text" name="progress" id="progress" size="7" class="formElements validated percentile" autocomplete="off" maxlength="255" value="" oldvalue="1" entrytype="PERCENTILE">
  1513. </td>
  1514. </tr>
  1515. <tr>
  1516. <td colspan="4">
  1517. <label for="description">描述</label><br>
  1518. <textarea rows="3" cols="30" id="description" name="description" class="formElements" style="width:100%"></textarea>
  1519. </td>
  1520. </tr>
  1521. </table>
  1522. <h2>资源分配</h2>
  1523. <table cellspacing="1" cellpadding="0" width="100%" id="assigsTable">
  1524. <tr>
  1525. <th style="width:100px;">姓名</th>
  1526. <th style="width:70px;">角色</th>
  1527. <th style="width:30px;">估计工作时间</th>
  1528. <th style="width:30px;" id="addAssig"><span class="teamworkIcon" style="cursor: pointer">+</span></th>
  1529. </tr>
  1530. </table>
  1531. <div style="text-align: right; padding-top: 20px">
  1532. <span id="saveButton" class="button first" onClick="$(this).trigger('saveFullEditor.gantt');">Save</span>
  1533. </div>
  1534. </div>
  1535. </div>
  1536. <div class="__template__" type="ASSIGNMENT_ROW">
  1537. <!--
  1538. <tr taskId="(#=obj.task.id#)" assId="(#=obj.assig.id#)" class="assigEditRow" >
  1539. <td ><select name="resourceId" class="formElements" (#=obj.assig.id.indexOf("tmp_")==0?"":"disabled"#) ></select></td>
  1540. <td ><select type="select" name="roleId" class="formElements"></select></td>
  1541. <td ><input type="text" name="effort" value="(#=getMillisInHoursMinutes(obj.assig.effort)#)" size="5" class="formElements"></td>
  1542. <td align="center"><span class="teamworkIcon delAssig del" style="cursor: pointer">d</span></td>
  1543. </tr>
  1544. -->
  1545. </div>
  1546. <div class="__template__" type="RESOURCE_EDITOR">
  1547. <div class="resourceEditor" style="padding: 5px;">
  1548. <h2>项目组</h2>
  1549. <table cellspacing="1" cellpadding="0" width="100%" id="resourcesTable">
  1550. <tr>
  1551. <th style="width:100px;">姓名</th>
  1552. <th style="width:30px;" id="addResource"><span class="teamworkIcon" style="cursor: pointer">+</span></th>
  1553. </tr>
  1554. </table>
  1555. <div style="text-align: right; padding-top: 20px"><button id="resSaveButton" class="button big">保存</button></div>
  1556. </div>
  1557. </div>
  1558. <div class="__template__" type="RESOURCE_ROW">
  1559. <!--
  1560. <tr resId="(#=obj.id#)" class="resRow" >
  1561. <td ><input type="text" name="name" value="(#=obj.name#)" style="width:100%;" class="formElements"></td>
  1562. <td align="center"><span class="teamworkIcon delRes del" style="cursor: pointer">d</span></td>
  1563. </tr>
  1564. -->
  1565. </div>
  1566. </div>
  1567. <script type="text/javascript">
  1568. $.JST.loadDecorator("RESOURCE_ROW", function(resTr, res) {
  1569. resTr.find(".delRes").click(function() {
  1570. var tr = $(this).closest("[resid]").fadeOut(200, function() {
  1571. $(this).remove()
  1572. });
  1573. // $(this).closest("tr").remove()这句消失
  1574. });
  1575. });
  1576. $.JST.loadDecorator("ASSIGNMENT_ROW", function(assigTr, taskAssig) {
  1577. var resEl = assigTr.find("[name=resourceId]");
  1578. var opt = $("<option>");
  1579. resEl.append(opt);
  1580. for (var i = 0; i < taskAssig.task.master.resources.length; i++) {
  1581. var res = taskAssig.task.master.resources[i];
  1582. opt = $("<option>");
  1583. opt.val(res.id).html(res.name);
  1584. if (taskAssig.assig.resourceId == res.id)
  1585. opt.attr("selected", "true");
  1586. resEl.append(opt);
  1587. }
  1588. var roleEl = assigTr.find("[name=roleId]");
  1589. for (var i = 0; i < taskAssig.task.master.roles.length; i++) {
  1590. var role = taskAssig.task.master.roles[i];
  1591. var optr = $("<option>");
  1592. optr.val(role.id).html(role.name);
  1593. if (taskAssig.assig.roleId == role.id)
  1594. optr.attr("selected", "true");
  1595. roleEl.append(optr);
  1596. }
  1597. if (taskAssig.task.master.permissions.canWrite && taskAssig.task.canWrite) {
  1598. assigTr.find(".delAssig").click(function() {
  1599. var tr = $(this).closest("[assId]").fadeOut(200, function() {
  1600. $(this).remove()
  1601. });
  1602. });
  1603. }
  1604. });
  1605. function loadI18n() {
  1606. GanttMaster.messages = {
  1607. "CANNOT_WRITE": "No permission to change the following task:",
  1608. "CHANGE_OUT_OF_SCOPE": "Project update not possible as you lack rights for updating a parent project.",
  1609. "START_IS_MILESTONE": "Start date is a milestone.",
  1610. "END_IS_MILESTONE": "End date is a milestone.",
  1611. "TASK_HAS_CONSTRAINTS": "Task has constraints.",
  1612. "GANTT_ERROR_DEPENDS_ON_OPEN_TASK": "Error: there is a dependency on an open task.",
  1613. "GANTT_ERROR_DESCENDANT_OF_CLOSED_TASK": "Error: due to a descendant of a closed task.",
  1614. "TASK_HAS_EXTERNAL_DEPS": "This task has external dependencies.",
  1615. "GANNT_ERROR_LOADING_DATA_TASK_REMOVED": "GANNT_ERROR_LOADING_DATA_TASK_REMOVED",
  1616. "CIRCULAR_REFERENCE": "Circular reference.",
  1617. "CANNOT_DEPENDS_ON_ANCESTORS": "Cannot depend on ancestors.",
  1618. "INVALID_DATE_FORMAT": "The data inserted are invalid for the field format.",
  1619. "GANTT_ERROR_LOADING_DATA_TASK_REMOVED": "An error has occurred while loading the data. A task has been trashed.",
  1620. "CANNOT_CLOSE_TASK_IF_OPEN_ISSUE": "Cannot close a task with open issues",
  1621. "TASK_MOVE_INCONSISTENT_LEVEL": "You cannot exchange tasks of different depth.",
  1622. "GANTT_QUARTER_SHORT": "Quarter",
  1623. "GANTT_SEMESTER_SHORT": "Sem",
  1624. "CANNOT_MOVE_TASK": "CANNOT_MOVE_TASK",
  1625. "PLEASE_SAVE_PROJECT": "PLEASE_SAVE_PROJECT"
  1626. };
  1627. }
  1628. function createNewResource(el) {
  1629. var row = el.closest("tr[taskid]");
  1630. var name = row.find("[name=resourceId_txt]").val();
  1631. var url = contextPath + "/applications/teamwork/resource/resourceNew.jsp?CM=ADD&name=" + encodeURI(name);
  1632. openBlackPopup(url, 700, 320, function(response) {
  1633. //fillare lo smart combo
  1634. if (response && response.resId && response.resName) {
  1635. //fillare lo smart combo e chiudere l'editor
  1636. row.find("[name=resourceId]").val(response.resId);
  1637. row.find("[name=resourceId_txt]").val(response.resName).focus().blur();
  1638. }
  1639. });
  1640. }
  1641. </script>
  1642. <script type="text/javascript" src="~/Content/jquerygantt/bootstrap.min.js"></script>
  1643. <script src="~/Content/jquerygantt/jquery.form.js"></script>
  1644. <script type="text/javascript">
  1645. function importgants() {
  1646. $('#importgants').modal({
  1647. show: true,
  1648. backdrop: 'static'
  1649. });
  1650. }
  1651. </script>
  1652. </body>
  1653. </html>