Commit 822f5ddd authored by gengchunlei's avatar gengchunlei

慢综 医生端 图片上传bug修复

parent 60c14dac
...@@ -337,7 +337,7 @@ export default { ...@@ -337,7 +337,7 @@ export default {
let input = document.getElementById('imgId') let input = document.getElementById('imgId')
let file = input.files let file = input.files
let newFile = Array.from(file) let newFile = Array.from(file)
let maxIndexF = Math.max(...this.imgList.map(item => item.indexF)) let maxIndexF = this.imgList.length ? Math.max(...this.imgList2.map(item => item.indexF)) : 0
newFile.forEach((item, index) => { newFile.forEach((item, index) => {
item['indexF'] = maxIndexF + index + 1 item['indexF'] = maxIndexF + index + 1
item['trueDownloadUrl'] = window.URL.createObjectURL(item) item['trueDownloadUrl'] = window.URL.createObjectURL(item)
...@@ -345,7 +345,7 @@ export default { ...@@ -345,7 +345,7 @@ export default {
if (item.type == 'application/pdf') { if (item.type == 'application/pdf') {
item['imgFlag'] = 'pdf' item['imgFlag'] = 'pdf'
} }
if (item.type == 'image/jpeg' || item.type == 'image/png') { if (item.type == 'image/jpeg' || item.type == 'image/png' || 'image/gif' || 'image/webp') {
item['imgFlag'] = 'img' item['imgFlag'] = 'img'
} }
}) })
...@@ -356,7 +356,7 @@ export default { ...@@ -356,7 +356,7 @@ export default {
let input = document.getElementById('imgId2') let input = document.getElementById('imgId2')
let file = input.files let file = input.files
let newFile = Array.from(file) let newFile = Array.from(file)
let maxIndexF = Math.max(...this.imgList2.map(item => item.indexF)) let maxIndexF = this.imgList2.length ? Math.max(...this.imgList2.map(item => item.indexF)) : 0
newFile.forEach((item, index) => { newFile.forEach((item, index) => {
item['indexF'] = maxIndexF + index + 1 item['indexF'] = maxIndexF + index + 1
item['trueDownloadUrl'] = window.URL.createObjectURL(item) item['trueDownloadUrl'] = window.URL.createObjectURL(item)
...@@ -364,7 +364,7 @@ export default { ...@@ -364,7 +364,7 @@ export default {
if (item.type == 'application/pdf') { if (item.type == 'application/pdf') {
item['imgFlag'] = 'pdf' item['imgFlag'] = 'pdf'
} }
if (item.type == 'image/jpeg' || item.type == 'image/png') { if (item.type == 'image/jpeg' || item.type == 'image/png' || 'image/gif' || 'image/webp') {
item['imgFlag'] = 'img' item['imgFlag'] = 'img'
} }
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment