提交 698f12fc authored 作者: wangjiahao's avatar wangjiahao

feat: 非自适应画布的 仪表盘展示时 超高显示滚动条

上级 0c4f54bb
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
:style="getStyle(config.style)" :style="getStyle(config.style)"
:out-style="config.style" :out-style="config.style"
:element="config" :element="config"
:class="{'gap_class':canvasStyleData.panel.gap==='yes'}"
/> />
<component <component
:is="config.component" :is="config.component"
...@@ -17,6 +18,7 @@ ...@@ -17,6 +18,7 @@
:style="getStyle(config.style)" :style="getStyle(config.style)"
:prop-value="config.propValue" :prop-value="config.propValue"
:element="config" :element="config"
:class="{'gap_class':canvasStyleData.panel.gap==='yes'}"
/> />
</div> </div>
</template> </template>
...@@ -25,6 +27,7 @@ ...@@ -25,6 +27,7 @@
import { getStyle } from '@/components/canvas/utils/style' import { getStyle } from '@/components/canvas/utils/style'
import runAnimation from '@/components/canvas/utils/runAnimation' import runAnimation from '@/components/canvas/utils/runAnimation'
import { mixins } from '@/components/canvas/utils/events' import { mixins } from '@/components/canvas/utils/events'
import { mapState } from 'vuex'
export default { export default {
mixins: [mixins], mixins: [mixins],
...@@ -40,6 +43,11 @@ export default { ...@@ -40,6 +43,11 @@ export default {
default: null default: null
} }
}, },
computed: {
...mapState([
'canvasStyleData'
])
},
mounted() { mounted() {
runAnimation(this.$el, this.config.animations) runAnimation(this.$el, this.config.animations)
}, },
...@@ -60,4 +68,8 @@ export default { ...@@ -60,4 +68,8 @@ export default {
.component { .component {
position: absolute; position: absolute;
} }
.gap_class{
padding:3px;
}
</style> </style>
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
v-for="(item, index) in componentDataInfo" v-for="(item, index) in componentDataInfo"
:key="index" :key="index"
:config="item" :config="item"
:class="{'gap_class':canvasStyleData.panel.gap==='yes'}"
/> />
</div> </div>
</template> </template>
...@@ -32,6 +31,11 @@ export default { ...@@ -32,6 +31,11 @@ export default {
show: { show: {
type: Boolean, type: Boolean,
default: false default: false
},
showType: {
type: String,
required: false,
default: 'full'
} }
}, },
data() { data() {
...@@ -56,7 +60,11 @@ export default { ...@@ -56,7 +60,11 @@ export default {
}, },
computed: { computed: {
customStyle() { customStyle() {
let style = {} let style = {
margin: 'auto',
width: '100%',
height: '100%'
}
if (this.canvasStyleData.openCommonStyle) { if (this.canvasStyleData.openCommonStyle) {
if (this.canvasStyleData.panel.backgroundType === 'image' && this.canvasStyleData.panel.imageUrl) { if (this.canvasStyleData.panel.backgroundType === 'image' && this.canvasStyleData.panel.imageUrl) {
style = { style = {
...@@ -113,6 +121,9 @@ export default { ...@@ -113,6 +121,9 @@ export default {
const canvasWidth = document.getElementById('canvasInfo').offsetWidth const canvasWidth = document.getElementById('canvasInfo').offsetWidth
this.scaleWidth = canvasWidth * 100 / parseInt(this.canvasStyleData.width)// 获取宽度比 this.scaleWidth = canvasWidth * 100 / parseInt(this.canvasStyleData.width)// 获取宽度比
this.scaleHeight = canvasHeight * 100 / parseInt(this.canvasStyleData.height)// 获取高度比 this.scaleHeight = canvasHeight * 100 / parseInt(this.canvasStyleData.height)// 获取高度比
if (this.showType === 'width') {
this.scaleHeight = this.scaleWidth
}
this.handleScaleChange() this.handleScaleChange()
}, },
resetID(data) { resetID(data) {
......
...@@ -47,8 +47,8 @@ ...@@ -47,8 +47,8 @@
<!-- 仪表板预览区域--> <!-- 仪表板预览区域-->
<el-row class="panel-design-preview"> <el-row class="panel-design-preview">
<div ref="imageWrapper" style="width: 100%;height: 100%"> <div ref="imageWrapper" style="width: 100%;height: 100%">
<fullscreen style="background: #ffffff;height: 100%" :fullscreen.sync="fullscreen"> <fullscreen style="background: none;height: 100%" :fullscreen.sync="fullscreen">
<Preview v-if="showMain" /> <Preview v-if="showMain" :show-type="canvasStyleData.selfAdaption?'full':'width'" />
</fullscreen> </fullscreen>
</div> </div>
</el-row> </el-row>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论