removeFile.js 716 B

12345678910111213141516171819202122232425262728293031323334
  1. /**
  2. * @descript
  3. * 删除指定的附件
  4. */
  5. import api from '@/api/api'
  6. export default {
  7. removeFileList(file) {
  8. let linksids = [];
  9. if (file.length) {
  10. for (let i = 0; i < file.length; i++) {
  11. linksids.push(file[i].linksid)
  12. }
  13. }
  14. let param = {
  15. "accesstoken": "4a6559d45d2a4c6e0ebac2c803344106",
  16. "classname": "system.attachment.Attachment",
  17. "method": "deleteFileLink",
  18. "content": {
  19. "linksids": [
  20. 1
  21. ]
  22. }
  23. }
  24. return new Promise(resolve => {
  25. param.content.linksids = linksids
  26. api.requested(param).then( res => {
  27. if(res.code == 1) {
  28. resolve(res.code)
  29. }
  30. })
  31. })
  32. }
  33. }