修改三期优化点

This commit is contained in:
sunFlower
2022-09-29 09:47:42 +08:00
parent d0b93b1b7a
commit 16c2239f17
@@ -53,11 +53,14 @@
:class="{'content-box-box-text-admin':!item2.lableName || item2.lableName == 'null' || item2.lableName == 'undefined'? true : false}"
class="content-box-box-text content-box-box-text-index"
v-else-if="item2.lableType == 7 && item2.lableName && index2 != 0">
<!-- <span v-if="item2.lableName && item2.lableName.split(',').length == 1">-->
<!-- <span class="file-text">{{item2.lableName}}</span>-->
<!-- <a-icon @click="download(item2)" type="download" class="icon-text"/>-->
<!-- </span>-->
<span @click="viewFileClick(item2.lableName)">
<span v-if="item2.lableName && item2.lableName.split(',').length == 1">
<span class="file-text" @click="pdfPreview(item2)" :title="item2.contentFileName">
{{item2.contentFileName}}
</span>
<a-icon @click="download(item2)" type="download" class="icon-text"/>
</span>
<span v-else :title="$t('viewFile')"
@click="viewFileClick(item2.lableName)">
{{$t('viewFile')}}
</span>
</span>
@@ -102,6 +105,7 @@
import countryCardViewAdd from './countryCardViewAdd'
import viewFileModel from '@/components/viewFileModel/index'
import { mapGetters } from 'vuex'
import { Base64 } from 'js-base64'
export default {
name: 'countryCardView',
@@ -122,6 +126,7 @@
countryCardViewList: [],
applyMarkets: '',
header_text: '',
downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download',
url: {
list: '/problemKnowledgeBase/countryCardTempEO/list',
deleteOne: ''
@@ -137,6 +142,25 @@
},
methods: {
...mapGetters(['userInfo']),
pdfPreview(fileQuery) {
let fileName = fileQuery.contentFileName
fileQuery.id = fileQuery.lableName
let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix == '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.id+'&userName='+this.userInfo().username))
} else if (fileSuffix == '.docx' || fileSuffix == '.doc') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank')
} else if (fileSuffix == '.xlsx' || fileSuffix == '.xls'
|| fileSuffix == '.png' || fileSuffix == '.jpeg' || fileSuffix == '.gif' || fileSuffix == '.jpg') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
window.open(url, '_blank')
} else {
downloadFile('/sys/common/downLoadFile', fileQuery.contentFileName, { id: fileQuery.id })
}
},
displayInformationClick() {
this.$refs.displayInformationModelRef.getData(JSON.parse(JSON.stringify(this.displayList)))
},
@@ -149,7 +173,7 @@
this.$refs.countryCardViewAddRef.add(this.countryCardViewList)
},
download(item) {
downloadFile('/sys/common/downLoadFile', item.fileName, { id: item.id, userName: this.userInfo().username })
downloadFile('/sys/common/downLoadFile', item.contentFileName, { id: item.lableName, userName: this.userInfo().username })
},
countryCardViewAddForm(val) {
this.countryCardViewList = JSON.parse(JSON.stringify(val))
@@ -222,12 +246,14 @@
if (val.lableType == 3) {
res1.list.push({
lableName: val.contentDropDownValue,
lableType: val.lableType
lableType: val.lableType,
contentFileName:val.contentFileName || ''
})
} else {
res1.list.push({
lableName: val.content,
lableType: val.lableType
lableType: val.lableType,
contentFileName:val.contentFileName || ''
})
}
}
@@ -490,6 +516,7 @@
text-overflow: ellipsis;
white-space: nowrap;
float: left;
color: #040B29
}
.icon-text {