[update] 修改bug80750
This commit is contained in:
@@ -131,7 +131,7 @@ export default {
|
||||
// pdf预览
|
||||
const url = previewPdf(file.id)
|
||||
this.iframeSrc = url
|
||||
} else if (fileSuffix === 'docx') {
|
||||
} else if (fileSuffix === 'docx' || fileSuffix === 'doc') {
|
||||
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}`
|
||||
// word文件仍使用KKFile进行预览
|
||||
const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
|
||||
|
||||
@@ -166,10 +166,20 @@ export default {
|
||||
const value = this.$refs.addForm.formInline
|
||||
// 过程稿件id 发布稿>修改单>报批稿>送审稿>征求意见稿>草稿
|
||||
const fieldArr = ['publish_of_original', 'modification_list', 'draft_for_review', 'draft_for_comment', 'draft']
|
||||
const needSuffixArr = ['doc', 'docx', 'pdf']
|
||||
let fileId = ''
|
||||
for (const item of fieldArr) {
|
||||
if (!fileId) {
|
||||
fileId = value[item] ? value[item].split(',')[0] : ''
|
||||
const fileNameArr = value[item + '_dictText'].split(',')
|
||||
for (let i = 0; i < fileNameArr.length; i++) {
|
||||
// 截取文件后缀名
|
||||
const fileSuffix = (fileNameArr[i] ? fileNameArr[i].split('.')[fileNameArr[i].split('.').length - 1] : '').toLowerCase()
|
||||
if (needSuffixArr.includes(fileSuffix)) {
|
||||
// 说明是可以预览的文件格式
|
||||
console.log('支持文件预览的文件', value[item].split(',')[i], value[item + '_dictText'].split(',')[i])
|
||||
fileId = value[item].split(',')[i]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$refs.checkContentModal.title = this.$t('newlyAdded')
|
||||
@@ -180,10 +190,20 @@ export default {
|
||||
const value = this.$refs.addForm.formInline
|
||||
// 过程稿件id 发布稿>修改单>报批稿>送审稿>征求意见稿>草稿
|
||||
const fieldArr = ['publish_of_original', 'modification_list', 'draft_for_review', 'draft_for_comment', 'draft']
|
||||
const needSuffixArr = ['doc', 'docx', 'pdf']
|
||||
let fileId = ''
|
||||
for (const item of fieldArr) {
|
||||
if (!fileId) {
|
||||
fileId = value[item] ? value[item].split(',')[0] : ''
|
||||
const fileNameArr = value[item + '_dictText'].split(',')
|
||||
for (let i = 0; i < fileNameArr.length; i++) {
|
||||
// 截取文件后缀名
|
||||
const fileSuffix = (fileNameArr[i] ? fileNameArr[i].split('.')[fileNameArr[i].split('.').length - 1] : '').toLowerCase()
|
||||
if (needSuffixArr.includes(fileSuffix)) {
|
||||
// 说明是支持文件预览的文件格式
|
||||
console.log('支持文件预览的文件', value[item].split(',')[i], value[item + '_dictText'].split(',')[i])
|
||||
fileId = value[item].split(',')[i]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$refs.checkContentModal.title = this.$t('edit')
|
||||
|
||||
@@ -174,10 +174,20 @@ export default {
|
||||
if (res.success) {
|
||||
// 过程稿件id 发布稿>修改单>报批稿>送审稿>征求意见稿>草稿
|
||||
const fieldArr = ['publish_of_original', 'modification_list', 'draft_for_review', 'draft_for_comment', 'draft']
|
||||
const needSuffixArr = ['doc', 'docx', 'pdf']
|
||||
let fileId = ''
|
||||
for (const item of fieldArr) {
|
||||
if (!fileId) {
|
||||
fileId = res.result[item] ? res.result[item].split(',')[0] : ''
|
||||
const fileNameArr = res.result[item + '_dictText'].split(',')
|
||||
for (let i = 0; i < fileNameArr.length; i++) {
|
||||
// 截取文件后缀名
|
||||
const fileSuffix = (fileNameArr[i] ? fileNameArr[i].split('.')[fileNameArr[i].split('.').length - 1] : '').toLowerCase()
|
||||
if (needSuffixArr.includes(fileSuffix)) {
|
||||
// 说明是可以预览的文件格式
|
||||
console.log('支持文件预览的文件', res.result[item].split(',')[i], res.result[item + '_dictText'].split(',')[i])
|
||||
fileId = res.result[item].split(',')[i]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (fileId) {
|
||||
|
||||
Reference in New Issue
Block a user