diff --git a/.gitignore b/.gitignore index 07d3c72db3..57dd1a3990 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ node/ # local env files .env.local .env.*.local +.history/ # Log files npm-debug.log* diff --git a/framework/sdk-parent/frontend/src/components/chart/MsChart.vue b/framework/sdk-parent/frontend/src/components/chart/MsChart.vue index 8ccbbd33f7..c5e99bf00b 100644 --- a/framework/sdk-parent/frontend/src/components/chart/MsChart.vue +++ b/framework/sdk-parent/frontend/src/components/chart/MsChart.vue @@ -87,10 +87,10 @@ export default { exportCharts(fileName, type) { if (document.getElementsByClassName('ms-chart')) { let chartsCanvas = document.getElementsByClassName('ms-chart')[0].querySelectorAll('canvas')[0]; - let mime = 'image/png'; + let mime = `image/${type?.toLowerCase() || 'png'}`; if (chartsCanvas) { // toDataURL()是canvas对象的一种方法,用于将canvas对象转换为base64位编码 - let imageUrl = chartsCanvas && chartsCanvas.toDataURL("image/png"); + let imageUrl = chartsCanvas.toDataURL(mime); if (navigator.userAgent.indexOf('Trident') > -1) { // IE11 let arr = imageUrl.split(','); diff --git a/framework/sdk-parent/frontend/src/components/head/DrawerHeader.vue b/framework/sdk-parent/frontend/src/components/head/DrawerHeader.vue index 8ccedaa25f..9312f31378 100644 --- a/framework/sdk-parent/frontend/src/components/head/DrawerHeader.vue +++ b/framework/sdk-parent/frontend/src/components/head/DrawerHeader.vue @@ -19,7 +19,7 @@ {{ $t('commons.export') }} - JPG + JPEG PNG @@ -44,7 +44,7 @@ export default { }, methods: { exportJPG() { - this.$emit("export","JPG") + this.$emit("export","JPEG") }, exportPNG() { this.$emit("export","PNG")