relation.ui.js 783 B

1234567891011121314151617181920212223
  1. window.clickSubmit = function()
  2. {
  3. let existedName = '';
  4. $('[name^=relation]').each(function()
  5. {
  6. if(allRelationName['relation'].includes($(this).val())) existedName += ' ' + $(this).val();
  7. });
  8. $('[name^=relativeRelation]').each(function()
  9. {
  10. if(allRelationName['relativeRelation'].includes($(this).val())) existedName += ' ' + $(this).val();
  11. });
  12. if(existedName.length)
  13. {
  14. const formUrl = $('#relationForm').attr('action');
  15. const formData = new FormData($("#relationForm")[0]);
  16. const confirmMessage = hasRelationTip.replace('%s', existedName);
  17. zui.Modal.confirm(confirmMessage).then((res) => {
  18. if(res) $.ajaxSubmit({url: formUrl, data: formData})
  19. });
  20. return false;
  21. }
  22. }