|
@@ -170,7 +170,8 @@ export default {
|
|
originalName: data.originalName,
|
|
originalName: data.originalName,
|
|
path: data.path,
|
|
path: data.path,
|
|
absolutePath: data.absolutePath,
|
|
absolutePath: data.absolutePath,
|
|
- type: data.type
|
|
|
|
|
|
+ type: data.type,
|
|
|
|
+ fileType: data.fileType
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
return item
|
|
return item
|
|
@@ -184,7 +185,7 @@ export default {
|
|
handler(newV) {
|
|
handler(newV) {
|
|
if (newV.length) {
|
|
if (newV.length) {
|
|
this.fileLists = newV.map(item => {
|
|
this.fileLists = newV.map(item => {
|
|
- const { id, path, originalName, absolutePath, type } = item
|
|
|
|
|
|
+ const { id, path, originalName, absolutePath, type, fileType } = item
|
|
return {
|
|
return {
|
|
id,
|
|
id,
|
|
url: path,
|
|
url: path,
|
|
@@ -192,7 +193,8 @@ export default {
|
|
originalName,
|
|
originalName,
|
|
path,
|
|
path,
|
|
absolutePath,
|
|
absolutePath,
|
|
- type
|
|
|
|
|
|
+ type,
|
|
|
|
+ fileType
|
|
}
|
|
}
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
@@ -429,24 +431,27 @@ export default {
|
|
var name = ''
|
|
var name = ''
|
|
var absolutePath = ''
|
|
var absolutePath = ''
|
|
var type = ''
|
|
var type = ''
|
|
|
|
+ var fileType = ''
|
|
if (file.response) {
|
|
if (file.response) {
|
|
const { response: { data }} = file
|
|
const { response: { data }} = file
|
|
idNum = data.id
|
|
idNum = data.id
|
|
name = data.originalName || data.name
|
|
name = data.originalName || data.name
|
|
absolutePath = data.absolutePath
|
|
absolutePath = data.absolutePath
|
|
type = data.type
|
|
type = data.type
|
|
|
|
+ fileType = data.fileType
|
|
} else {
|
|
} else {
|
|
idNum = file.id
|
|
idNum = file.id
|
|
name = file.name
|
|
name = file.name
|
|
absolutePath = file.absolutePath
|
|
absolutePath = file.absolutePath
|
|
type = file.type
|
|
type = file.type
|
|
|
|
+ fileType = file.fileType
|
|
}
|
|
}
|
|
// window.open(`#/perview?fileId=${idNum}&name=${name}&absolutePath=${absolutePath}`)
|
|
// window.open(`#/perview?fileId=${idNum}&name=${name}&absolutePath=${absolutePath}`)
|
|
const imgType = ['.jpg', '.png', '.jpeg', '.gif', '.bmp']
|
|
const imgType = ['.jpg', '.png', '.jpeg', '.gif', '.bmp']
|
|
- if (imgType.includes(type.toLowerCase())) {
|
|
|
|
|
|
+ if ((type && imgType.includes(type.toLowerCase())) || imgType.includes(fileType?.toLowerCase())) {
|
|
window.open(`#/perview?fileId=${idNum}&name=${name}&absolutePath=${absolutePath}`)
|
|
window.open(`#/perview?fileId=${idNum}&name=${name}&absolutePath=${absolutePath}`)
|
|
} else {
|
|
} else {
|
|
- window.open(`${process.env.VUE_APP_BASE_API}/system/fileStorage/preview?fileId=${idNum}`)
|
|
|
|
|
|
+ window.open(`${process.env.VUE_APP_BASE_API}/system/fileStorage/preview?fileId=${idNum}&resource=${fileType ? 0 : 1}`)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
downloadClick(row) {
|
|
downloadClick(row) {
|