forked from github/dataease
Merge pull request #9431 from dataease/pr@dev@refactor_export-details
refactor(仪表板): 公共链接禁用导出明细等问题
This commit is contained in:
commit
68faeaea59
@ -169,6 +169,17 @@
|
||||
class="ds-icon-excel"
|
||||
/>{{ $t('chart.export') }}Excel
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="showChartInfoType==='details' && !userId && hasDataPermission('export',panelInfo.privileges)"
|
||||
size="mini"
|
||||
:disabled="$store.getters.loadingMap[$store.getters.currentPath] || dialogLoading"
|
||||
@click="exportSourceDetails"
|
||||
>
|
||||
<svg-icon
|
||||
icon-class="ds-excel"
|
||||
class="ds-icon-excel"
|
||||
/>{{ $t('chart.export_source') }}
|
||||
</el-button>
|
||||
</span>
|
||||
<user-view-dialog
|
||||
v-if="chartDetailsVisible"
|
||||
@ -865,6 +876,9 @@ export default {
|
||||
exportExcel() {
|
||||
this.$refs['userViewDialog-canvas-main'].exportExcel()
|
||||
},
|
||||
exportSourceDetails() {
|
||||
this.$refs['userViewDialog-canvas-main'].exportExcel()
|
||||
},
|
||||
exportViewImg() {
|
||||
this.imageDownloading = true
|
||||
this.$refs['userViewDialog-canvas-main'].exportViewImg(this.pixel, () => {
|
||||
|
@ -204,7 +204,7 @@
|
||||
</el-button>
|
||||
|
||||
<el-button
|
||||
v-if="showChartInfoType==='details' && hasDataPermission('export',panelInfo.privileges)"
|
||||
v-if="showChartInfoType==='details' && !userId && hasDataPermission('export',panelInfo.privileges)"
|
||||
size="mini"
|
||||
:disabled="$store.getters.loadingMap[$store.getters.currentPath] || dialogLoading"
|
||||
@click="exportSourceDetails"
|
||||
|
@ -536,7 +536,7 @@ export function exportExcelDownload(chart, snapshot, width, height, loadingWrapp
|
||||
let method = innerExportDetails
|
||||
const token = store.getters.token || getToken()
|
||||
const linkToken = store.getters.linkToken || getLinkToken()
|
||||
if (!token && linkToken) {
|
||||
if (linkToken) {
|
||||
method = exportDetails
|
||||
loadingWrapper && (loadingWrapper.val = true)
|
||||
}
|
||||
@ -545,7 +545,7 @@ export function exportExcelDownload(chart, snapshot, width, height, loadingWrapp
|
||||
request.proxy = { userId: panelInfo.proxy }
|
||||
}
|
||||
method(request).then((res) => {
|
||||
if (!token && linkToken) {
|
||||
if (linkToken) {
|
||||
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
|
||||
const link = document.createElement('a')
|
||||
link.style.display = 'none'
|
||||
|
Loading…
Reference in New Issue
Block a user