Browse Source

文件上传问题解决

master
ljlong_2630 7 months ago
parent
commit
8c435fa7e3
  1. 4
      src/components/Detail/src/DetailDeviceLedger.vue
  2. 15
      src/components/UploadFile/src/UploadFile.vue

4
src/components/Detail/src/DetailDeviceLedger.vue

@ -984,8 +984,8 @@ const getDialogUpload = (row) => {
function dialogUploadFile() { function dialogUploadFile() {
let data = { let data = {
number: dialogUploadNumber.value, number: dialogUploadNumber.value,
filePathList: fileDialogUploadData.value.filePathList.map((item) => item.url), filePathList: fileDialogUploadData.value.filePathList?fileDialogUploadData.value.filePathList.map((item) => item.url):null,
fileInfoList: fileDialogUploadData.value.filePathList, fileInfoList: fileDialogUploadData.value.filePathList?fileDialogUploadData.value.filePathList:[],
funcCode: props.milestoneFuncCode, funcCode: props.milestoneFuncCode,
fileBusiType: dialogUploadBusiCode.value fileBusiType: dialogUploadBusiCode.value
} }

15
src/components/UploadFile/src/UploadFile.vue

@ -145,15 +145,12 @@ const excelUploadError: UploadProps['onError'] = (): void => {
} }
// //
const handleRemove = (file) => { const handleRemove = (file) => {
debugger // const findex = fileList.value.map((f) => f.name).indexOf(file.name)
console.log(fileList.value) // console.log(findex)
console.log(file.name) // if (findex > -1) {
const findex = fileList.value.map((f) => f.name).indexOf(file.name) // fileList.value.splice(findex, 1)
console.log(findex) // emit('update:modelValue', listToString(fileList.value))
if (findex > -1) { // }
fileList.value.splice(findex, 1)
emit('update:modelValue', listToString(fileList.value))
}
} }
const handlePreview: UploadProps['onPreview'] = (uploadFile) => { const handlePreview: UploadProps['onPreview'] = (uploadFile) => {
console.log(uploadFile) console.log(uploadFile)

Loading…
Cancel
Save