fix: 表格明细无需显示导出图片按钮

This commit is contained in:
wangjiahao 2022-04-25 13:25:20 +08:00
parent c0140bafbd
commit edc6edafeb
2 changed files with 18 additions and 11 deletions

View File

@ -31,14 +31,14 @@
class="dialog-css" class="dialog-css"
:destroy-on-close="true" :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-dropdown>
<el-button size="mini"> <el-button size="mini">
{{ $t('chart.export') }}<i class="el-icon-download" /> {{ $t('chart.export') }}<i class="el-icon-download" />
</el-button> </el-button>
<el-dropdown-menu slot="dropdown"> <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 @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-menu>
</el-dropdown> </el-dropdown>
</span> </span>
@ -137,6 +137,9 @@ export default {
created() { created() {
}, },
computed: { computed: {
showExportImgButton() {
return this.showChartInfo.type && !this.showChartInfo.type.includes('table')
},
canvasInfoMainStyle() { canvasInfoMainStyle() {
if (this.backScreenShot) { if (this.backScreenShot) {
return { return {

View File

@ -153,16 +153,16 @@
:destroy-on-close="true" :destroy-on-close="true"
:show-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-dropdown>
<el-button size="mini"> <el-button size="mini">
{{ $t('chart.export') }}<i class="el-icon-download" /> {{ $t('chart.export') }}<i class="el-icon-download" />
</el-button> </el-button>
<el-dropdown-menu slot="dropdown"> <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 @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-menu>
</el-dropdown> </el-dropdown>
</span> </span>
<UserViewDialog <UserViewDialog
v-if="chartDetailsVisible" v-if="chartDetailsVisible"
@ -952,6 +952,10 @@ export default {
} }
}, },
computed: { 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() { showGrid() {
if (this.canvasStyleData && this.canvasStyleData.aidedDesign) { if (this.canvasStyleData && this.canvasStyleData.aidedDesign) {
return this.canvasStyleData.aidedDesign.showGrid return this.canvasStyleData.aidedDesign.showGrid