| | |
| | | } |
| | | |
| | | const handleRemove = async (file, uploadFiles) => { |
| | | if (file && file.status === 'success') { |
| | | ElMessageBox.confirm( |
| | | '确定删除该附件?', |
| | | '提示', |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then( async() => { |
| | | .then(async () => { |
| | | let accessoryFileId = ""; |
| | | if(file.id){ |
| | | if (file.id) { |
| | | accessoryFileId = file.id |
| | | }else { |
| | | } else { |
| | | accessoryFileId = file.response.data.id |
| | | } |
| | | const res = await delAccessoryFile(accessoryFileId) |
| | | if(res.code == 200){ |
| | | if (res.code == 200) { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '文件已删除' |
| | | }) |
| | | await getProcessFiles() |
| | | }else{ |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(()=>{ |
| | | .catch(() => { |
| | | getProcessFiles() |
| | | }) |
| | | } |
| | | } |
| | | |
| | | defineExpose({ |
| | |
| | | } |
| | | |
| | | const picSize = async (rawFile) => { |
| | | console.log("111",rawFile.name.length) |
| | | if(rawFile.name.length >100){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件名不能超过100字' |
| | | }); |
| | | return false |
| | | } |
| | | if(rawFile.size / 1024 / 1024 > 15){ |
| | | ElMessage({ |
| | | type: 'warning', |
| | |
| | | } |
| | | }; |
| | | const handleRemove = async (file, uploadFiles) => { |
| | | if (file && file.status === 'success') { |
| | | ElMessageBox.confirm( |
| | | '确定删除该附件?', |
| | | '提示', |
| | |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then( async() => { |
| | | .then(async () => { |
| | | let path = ""; |
| | | if(file.path){ |
| | | if (file.path) { |
| | | path = file.path |
| | | }else { |
| | | } else { |
| | | path = file.response.data.path |
| | | } |
| | | const res = await delPic({path:path}) |
| | | if(res.code == 200){ |
| | | const res = await delPic({path: path}) |
| | | if (res.code == 200) { |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '文件已删除' |
| | | }) |
| | | state.form.files = state.fileList; |
| | | }else{ |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(()=>{ |
| | | .catch(() => { |
| | | }) |
| | | } |
| | | } |
| | | const handlePreview = (file) => { |
| | | let path = ""; |