修改搜索中心加文件名称和预览
This commit is contained in:
@@ -145,6 +145,12 @@
|
||||
</template>
|
||||
<span style="cursor: pointer" v-html="item.title" @click="titleClick(item)"></span>
|
||||
</a-tooltip>
|
||||
<a-tooltip placement="topLeft" :mouseEnterDelay="0.5">
|
||||
<template slot="title">
|
||||
<span v-html="item.file_name"></span>
|
||||
</template>
|
||||
<span style="cursor: pointer" v-html="item.file_name" @click="fileClick(item)"></span>
|
||||
</a-tooltip>
|
||||
</div>
|
||||
<a-tooltip placement="topLeft" :mouseEnterDelay="0.5" v-if="!queryParam.selectValue">
|
||||
<template slot="title">
|
||||
@@ -343,6 +349,7 @@
|
||||
|
||||
},
|
||||
selectListModel(val) {
|
||||
this.pageNo = 1
|
||||
this.queryParam = { ...this.queryParamOne, ...this.searchQueryOne }
|
||||
this.isTrue = val == 'list' ? true : false
|
||||
if (this.isTrue) {
|
||||
@@ -607,20 +614,20 @@
|
||||
}
|
||||
},
|
||||
fileClick(fileQuery) {
|
||||
let fileName = fileQuery.fileName
|
||||
let fileName = fileQuery.fileName || fileQuery.file_name
|
||||
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))
|
||||
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + fileQuery.file_id || fileQuery.id))
|
||||
} else if (fileSuffix == '.docx') {
|
||||
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
|
||||
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.file_id || fileQuery.id + fileSuffix)
|
||||
window.open(url, '_blank')
|
||||
} else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') {
|
||||
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
|
||||
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.file_id || fileQuery.id + fileSuffix)
|
||||
window.open(url, '_blank')
|
||||
} else {
|
||||
downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.id })
|
||||
downloadFile('/sys/common/downLoadFile', fileQuery.fileName || fileQuery.file_name, { id: fileQuery.id })
|
||||
}
|
||||
},
|
||||
titleClick(item) {
|
||||
|
||||
@@ -30,7 +30,12 @@
|
||||
</template>
|
||||
<span style="cursor: pointer" v-html="item.title" @click="titleClick(item)"></span>
|
||||
</a-tooltip>
|
||||
|
||||
<a-tooltip placement="topLeft" :mouseEnterDelay="0.5">
|
||||
<template slot="title">
|
||||
<span v-html="item.file_name"></span>
|
||||
</template>
|
||||
<span style="cursor: pointer" v-html="item.file_name" @click="fileClick(item)"></span>
|
||||
</a-tooltip>
|
||||
</div>
|
||||
<a-tooltip placement="topLeft" v-if="!queryParam.selectValue" :mouseEnterDelay="0.5">
|
||||
<template slot="title">
|
||||
@@ -84,6 +89,7 @@
|
||||
|
||||
<script>
|
||||
import { getAction, postAction, downloadFile } from '@/api/manage'
|
||||
import { Base64 } from 'js-base64'
|
||||
|
||||
export default {
|
||||
name: 'whole',
|
||||
@@ -130,14 +136,32 @@
|
||||
} else {
|
||||
this.checkboxText.push(item.id)
|
||||
}
|
||||
console.log(this.checkboxText)
|
||||
},
|
||||
fileClick(fileQuery) {
|
||||
let fileName = fileQuery.file_name
|
||||
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.file_id))
|
||||
} else if (fileSuffix == '.docx') {
|
||||
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.file_id + fileSuffix)
|
||||
window.open(url, '_blank')
|
||||
} else if (fileSuffix == '.xlsx' || fileSuffix == '.xls') {
|
||||
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.file_id + fileSuffix)
|
||||
window.open(url, '_blank')
|
||||
} else {
|
||||
downloadFile('/sys/common/downLoadFile', fileQuery.file_name, { id: fileQuery.file_id })
|
||||
}
|
||||
},
|
||||
pageOnChange(page, pageSize) {
|
||||
this.pageNo = page
|
||||
this.getList()
|
||||
},
|
||||
SizeChange(page, pageSize) {
|
||||
this.pageNo = 1
|
||||
this.pageSize = pageSize
|
||||
this.getList()
|
||||
},
|
||||
searchData(value) {
|
||||
this.queryParam.selectValue = value || undefined
|
||||
|
||||
Reference in New Issue
Block a user