Merge pull request #12325 from dataease/pr@dev-v2@refactor_download2

refactor(数据大屏、仪表板): 模板图表禁用导出
This commit is contained in:
王嘉豪 2024-09-20 12:28:31 +08:00 committed by GitHub
commit 73d1e44f9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 5 deletions

View File

@ -118,7 +118,7 @@
>
<el-dropdown-item
style="padding: 0"
v-if="element.innerType !== 'rich-text' && barShowCheck('download')"
v-if="element.innerType !== 'rich-text' && barShowCheck('download') && showDownload"
@click.prevent
>
<el-dropdown style="width: 100%" trigger="hover" placement="right-start">
@ -161,7 +161,12 @@
<el-dropdown
trigger="click"
placement="right-start"
v-if="element.innerType !== 'rich-text' && barShowCheck('previewDownload') && authShow"
v-if="
element.innerType !== 'rich-text' &&
barShowCheck('previewDownload') &&
authShow &&
showDownload
"
>
<el-icon @click="downloadClick" class="bar-base-icon">
<el-tooltip :content="t('chart.export')" effect="dark" placement="bottom">
@ -583,6 +588,8 @@ const initCurFields = () => {
}
}
}
const showDownload = computed(() => canvasViewInfo.value[element.value.id]?.dataFrom !== 'template')
// -End
const datasetParamsSetShow = computed(() => {

View File

@ -41,7 +41,9 @@
icon="Download"
size="middle"
:loading="exportLoading"
:disabled="requestStore.loadingMap[permissionStore.currentPath] > 0"
:disabled="
requestStore.loadingMap[permissionStore.currentPath] > 0 || state.dataFrom === 'template'
"
@click="downloadViewDetails('view')"
>
导出Excel
@ -54,7 +56,9 @@
size="middle"
:loading="exportLoading"
@click="downloadViewDetails('dataset')"
:disabled="requestStore.loadingMap[permissionStore.currentPath] > 0"
:disabled="
requestStore.loadingMap[permissionStore.currentPath] > 0 || state.dataFrom === 'template'
"
>
导出原始明细
</el-button>
@ -196,7 +200,8 @@ const DETAIL_CHART_ATTR: DeepPartial<ChartObj> = {
const state = reactive({
scale: 0.5,
componentSourceType: null
componentSourceType: null,
dataFrom: null
})
const DETAIL_TABLE_ATTR: DeepPartial<ChartObj> = {
senior: {
@ -269,6 +274,7 @@ const dialogInit = (canvasStyle, view, item, opt, params = { scale: 0.5 }) => {
optType.value = opt
dialogShow.value = true
state.componentSourceType = view.type
state.dataFrom = view.dataFrom
viewInfo.value = deepCopy(view) as DeepPartial<ChartObj>
viewInfo.value.customStyle.text.show = false
config.value = deepCopy(item)