fix(测试跟踪): 用例审批中导出依赖关系JPG格式,但导出的是PNG格式
--bug=1025873 --user=白奇 【测试跟踪】用例审批中导出依赖关系JPG格式,但导出的是PNG格式 https://www.tapd.cn/55049933/s/1368138
This commit is contained in:
parent
0967768aff
commit
7046725e64
|
@ -7,6 +7,7 @@ node/
|
|||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
.history/
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
|
|
|
@ -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(',');
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
{{ $t('commons.export') }}
|
||||
</span>
|
||||
<el-dropdown-menu slot="dropdown" class="drawer-header">
|
||||
<el-dropdown-item @click.native.stop="exportJPG">JPG</el-dropdown-item>
|
||||
<el-dropdown-item @click.native.stop="exportJPG">JPEG</el-dropdown-item>
|
||||
<el-dropdown-item @click.native.stop="exportPNG">PNG</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
|
@ -44,7 +44,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
exportJPG() {
|
||||
this.$emit("export","JPG")
|
||||
this.$emit("export","JPEG")
|
||||
},
|
||||
exportPNG() {
|
||||
this.$emit("export","PNG")
|
||||
|
|
Loading…
Reference in New Issue