fix:修复预览扭转不生效

main
zhu.yawen 1 year ago
parent 510712ddbe
commit 1529a2a85e

@ -13,14 +13,7 @@
<div
v-for="chart in chartList"
:key="chart.code"
:style="{
position: 'absolute',
width: chart.w + 'px',
height: chart.h + 'px',
left: chart.x + 'px',
top: chart.y + 'px',
zIndex: chart.z || 0
}"
:style="getStyle(chart)"
>
<Configuration
:config="chart"
@ -181,6 +174,28 @@ export default {
'changePageConfig',
'changeChartConfig'
]),
getStyle (chart) {
if (chart.perspective > 0) {
return {
position: 'absolute',
width: chart.w + 'px',
height: chart.h + 'px',
left: chart.x + 'px',
top: chart.y + 'px',
transform: `perspective(${chart.perspective}px) skew(${chart.skewX}deg, ${chart.skewY}deg) rotateX(${chart.rotateX}deg) rotateY(${chart.rotateY}deg) rotateZ(${chart.rotateZ}deg)`,
zIndex: chart.z || 0
}
}
return {
position: 'absolute',
width: chart.w + 'px',
height: chart.h + 'px',
left: chart.x + 'px',
top: chart.y + 'px',
transform: `skew(${chart.skewX}deg, ${chart.skewY}deg) rotateX(${chart.rotateX}deg) rotateY(${chart.rotateY}deg) rotateZ(${chart.rotateZ}deg)`,
zIndex: chart.z || 0
}
},
//
openDataViewDialog (config) {
this.$refs.dataViewDialog.init(config)

Loading…
Cancel
Save