|
@@ -157,21 +157,25 @@ export default {
|
|
|
imageSuccessCBK(arr) {
|
|
|
const that = this
|
|
|
arr.forEach(v => {
|
|
|
+ const isImg = v.url.indexOf('jpg') !== -1 || v.url.indexOf('png') !== -1
|
|
|
const isPdf = v.url.indexOf('pdf') !== -1
|
|
|
const isDocx = v.url.indexOf('docx') !== -1
|
|
|
let isDownload = false
|
|
|
const fileName = v.url.substring(v.url.lastIndexOf('/') + 1)
|
|
|
let href = ''
|
|
|
- if (isPdf) {
|
|
|
- href = `/pdf/web/viewer.html?file=${encodeURIComponent(v.url)}`
|
|
|
- } else if (isDocx) {
|
|
|
- href = `/#/docxPreview?file=${encodeURIComponent(v.url)}`
|
|
|
+ if (!isImg) {
|
|
|
+ if (isPdf) {
|
|
|
+ href = `/pdf/web/viewer.html?file=${encodeURIComponent(v.url)}`
|
|
|
+ } else if (isDocx) {
|
|
|
+ href = `/#/docxPreview?file=${encodeURIComponent(v.url)}`
|
|
|
+ } else {
|
|
|
+ href = v.url
|
|
|
+ isDownload = true
|
|
|
+ }
|
|
|
+ window.tinymce.get(that.tinymceId).insertContent(`<a class="wscnph" target="_blank" ${isDownload ? 'download' : ''} href="${href}" >${fileName}</a>`)
|
|
|
} else {
|
|
|
- href = v.url
|
|
|
- isDownload = true
|
|
|
+ window.tinymce.get(that.tinymceId).insertContent(`<img class="wscnph" src="${v.url}" >`)
|
|
|
}
|
|
|
- // window.tinymce.get(that.tinymceId).insertContent(`<img class="wscnph" src="${v.url}" >`)
|
|
|
- window.tinymce.get(that.tinymceId).insertContent(`<a class="wscnph" target="_blank" ${isDownload ? 'download' : ''} href="${href}" >${fileName}</a>`)
|
|
|
})
|
|
|
}
|
|
|
}
|