Merge pull request #2169 from dataease/pr@dev@fix_view-image-export-botton

fix: 表格明细无需显示导出图片按钮
This commit is contained in:
王嘉豪 2022-04-25 13:26:10 +08:00 committed by GitHub
commit ae38dc2715
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 11 deletions

View File

@ -31,14 +31,14 @@
class="dialog-css"
:destroy-on-close="true"
>
<span v-if="chartDetailsVisible" style="position: absolute;right: 70px;top:15px">
<span v-if="chartDetailsVisible" style="position: absolute;right: 70px;top:15px">
<el-dropdown>
<el-button size="mini">
{{ $t('chart.export') }}<i class="el-icon-download" />
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="exportExcel"><svg-icon icon-class="ds-excel" class="ds-icon-excel" />Excle</el-dropdown-item>
<el-dropdown-item icon="el-icon-picture-outline" @click.native="exportViewImg">{{ $t('chart.image') }}</el-dropdown-item>
<el-dropdown-item v-if="showExportImgButton" icon="el-icon-picture-outline" @click.native="exportViewImg">{{ $t('chart.image') }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</span>
@ -137,6 +137,9 @@ export default {
created() {
},
computed: {
showExportImgButton() {
return this.showChartInfo.type && !this.showChartInfo.type.includes('table')
},
canvasInfoMainStyle() {
if (this.backScreenShot) {
return {

View File

@ -153,16 +153,16 @@
:destroy-on-close="true"
:show-close="true"
>
<span v-if="chartDetailsVisible" style="position: absolute;right: 70px;top:15px">
<span v-if="chartDetailsVisible" style="position: absolute;right: 70px;top:15px">
<el-dropdown>
<el-button size="mini">
{{ $t('chart.export') }}<i class="el-icon-download" />
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="exportExcel"><svg-icon icon-class="ds-excel" class="ds-icon-excel" />Excle</el-dropdown-item>
<el-dropdown-item icon="el-icon-picture-outline" @click.native="exportViewImg">{{ $t('chart.image') }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button size="mini">
{{ $t('chart.export') }}<i class="el-icon-download" />
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="exportExcel"><svg-icon icon-class="ds-excel" class="ds-icon-excel" />Excle</el-dropdown-item>
<el-dropdown-item v-if="showExportImgButton" icon="el-icon-picture-outline" @click.native="exportViewImg">{{ $t('chart.image') }}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</span>
<UserViewDialog
v-if="chartDetailsVisible"
@ -952,6 +952,10 @@ export default {
}
},
computed: {
showExportImgButton() {
// if the chart type belong to table,'export image' button should be hidden
return this.showChartInfo.type && !this.showChartInfo.type.includes('table')
},
showGrid() {
if (this.canvasStyleData && this.canvasStyleData.aidedDesign) {
return this.canvasStyleData.aidedDesign.showGrid