style(报表统计): 优化测试用例统计图表最大化时的展示
--bug=1015436 --user=宋天阳 【报表统计】项目报表-测试用例统计,柱状图表全屏展示有点丑 https://www.tapd.cn/55049933/s/1216749
This commit is contained in:
parent
342ac765c1
commit
d9a6c67d58
|
@ -31,7 +31,8 @@
|
||||||
<el-row>
|
<el-row>
|
||||||
<div class="chart-style">
|
<div class="chart-style">
|
||||||
<ms-chart ref="chart1" v-if="!loading" :options="dataOption"
|
<ms-chart ref="chart1" v-if="!loading" :options="dataOption"
|
||||||
:style="{width: chartWidthNumber+'px', height: (h-70) + 'px'}" class="chart-config"
|
:style="{width: chartWidthNumber+'px', height: (h-70) + 'px'}"
|
||||||
|
class="chart-config"
|
||||||
:autoresize="true"
|
:autoresize="true"
|
||||||
id="picChart"/>
|
id="picChart"/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -148,14 +149,19 @@ export default {
|
||||||
this.originalW = this.w;
|
this.originalW = this.w;
|
||||||
this.originalH = this.h;
|
this.originalH = this.h;
|
||||||
this.w = document.body.clientWidth - 50;
|
this.w = document.body.clientWidth - 50;
|
||||||
this.h = document.body.clientHeight;
|
|
||||||
this.isFullScreen = true;
|
this.isFullScreen = true;
|
||||||
|
if (this.chartType === 'bar') {
|
||||||
|
this.chartWidthNumber = this.w;
|
||||||
|
}
|
||||||
this.$emit('hidePage', true);
|
this.$emit('hidePage', true);
|
||||||
},
|
},
|
||||||
unFullScreen() {
|
unFullScreen() {
|
||||||
this.w = this.originalW;
|
this.w = this.originalW;
|
||||||
this.h = this.originalH;
|
this.h = this.originalH;
|
||||||
this.isFullScreen = false;
|
this.isFullScreen = false;
|
||||||
|
if (this.chartType === 'bar') {
|
||||||
|
this.chartWidthNumber = this.w;
|
||||||
|
}
|
||||||
this.$emit('hidePage', false);
|
this.$emit('hidePage', false);
|
||||||
},
|
},
|
||||||
getImages(command) {
|
getImages(command) {
|
||||||
|
@ -167,7 +173,6 @@ export default {
|
||||||
if (document.getElementById('picChart')) {
|
if (document.getElementById('picChart')) {
|
||||||
let chartsCanvas = document.getElementById('picChart').querySelectorAll('canvas')[0];
|
let chartsCanvas = document.getElementById('picChart').querySelectorAll('canvas')[0];
|
||||||
if (chartsCanvas) {
|
if (chartsCanvas) {
|
||||||
// toDataURL()是canvas对象的一种方法,用于将canvas对象转换为base64位编码
|
|
||||||
returnImageDatas = chartsCanvas && chartsCanvas.toDataURL(imageType);
|
returnImageDatas = chartsCanvas && chartsCanvas.toDataURL(imageType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue