browse.ui.js 890 B

123456789101112131415161718192021222324
  1. window.insertToDoc = function(blockID, insertLink)
  2. {
  3. const docID = getDocApp()?.docID;
  4. const blockType = 'gantt';
  5. const url = $.createLink('doc', 'buildZentaoList', `docID=${docID}&type=${blockType}&blockID=${blockID}`);
  6. const formData = new FormData();
  7. formData.append('ganttOptions', JSON.stringify(ganttOptions));
  8. formData.append('ganttFields', JSON.stringify(ganttFields));
  9. formData.append('showFields', JSON.stringify(showFields));
  10. formData.append('url', insertLink);
  11. $.post(url, formData, function(resp)
  12. {
  13. resp = JSON.parse(resp);
  14. if(resp.result == 'success')
  15. {
  16. const oldBlockID = resp.oldBlockID;
  17. const newBlockID = resp.newBlockID;
  18. zui.Modal.hide();
  19. window.insertZentaoList && window.insertZentaoList(blockType, newBlockID, null, oldBlockID);
  20. }
  21. });
  22. }