feat:仪表板可以自动进行无限下拉,取消仪表板尺寸设置,统一为自适应

This commit is contained in:
wangjiahao 2021-09-15 18:11:05 +08:00
parent 0f91ee6615
commit f9a0ec3d20
7 changed files with 32 additions and 31 deletions

View File

@ -610,7 +610,7 @@ export default {
const rect = this.$el.parentNode.getBoundingClientRect()
this.parentX = rect.x
this.parentY = rect.y
return [Math.round(parseFloat(style.getPropertyValue('width'), 10)), Math.round(parseFloat(style.getPropertyValue('height'), 10))]
return [Math.round(parseFloat(style.getPropertyValue('width'), 10)), 100000]
}
if (typeof this.parent === 'string') {
const parentNode = document.querySelector(this.parent)

View File

@ -110,12 +110,16 @@ export default {
}
}
}
if (this.canvasStyleData.selfAdaption) {
style = {
overflow: 'hidden',
...style
}
}
// if (this.canvasStyleData.selfAdaption) {
// style = {
// overflow: 'hidden',
// ...style
// }
// }
// style = {
// overflow-x :'hidden',
// ...style
// }
return style
},
// componentData mapState
@ -168,10 +172,13 @@ export default {
const canvasWidth = document.getElementById('canvasInfoTemp').offsetWidth
this.scaleWidth = canvasWidth * 100 / parseInt(this.canvasStyleData.width)//
this.scaleHeight = canvasHeight * 100 / parseInt(this.canvasStyleData.height)//
if (this.showType === 'width') {
this.scaleHeight = this.scaleWidth
this.mainHeight = this.canvasStyleData.height * this.scaleHeight / 100 + 'px'
}
this.scaleHeight = this.scaleWidth
// this.mainHeight = this.canvasStyleData.height * this.scaleHeight / 100 + 'px'
// if (this.showType === 'width') {
// this.scaleHeight = this.scaleWidth
// this.mainHeight = this.canvasStyleData.height * this.scaleHeight / 100 + 'px'
// }
this.handleScaleChange()
},
resetID(data) {

View File

@ -12,7 +12,7 @@
@mousedown="handleMouseDown"
>
<!-- 网格线 -->
<Grid v-if="canvasStyleData.auxiliaryMatrix&&!linkageSettingStatus" :matrix-style="matrixStyle" />
<!-- <Grid v-if="canvasStyleData.auxiliaryMatrix&&!linkageSettingStatus" :matrix-style="matrixStyle" />-->
<!-- 仪表板联动清除按钮-->
<canvas-opt-bar />
@ -216,10 +216,10 @@ export default {
width: 80,
height: 20
},
// 12 * 24
// 128 * 72
matrixCount: {
x: 24,
y: 72
x: 80,
y: 45
},
customStyleHistory: null,
showDrag: true,
@ -555,6 +555,9 @@ export default {
if (this.canvasStyleData.matrixCount) {
this.matrixCount = this.canvasStyleData.matrixCount
}
// 1.3 1600*900 scaleWidth
// scaleHeight = scaleWidth 128*72 12.5*12.5
if (this.outStyle.width && this.outStyle.height) {
//
if (!this.canvasStyleData.selfAdaption) {
@ -642,6 +645,7 @@ export default {
position: relative;
/*background: #fff;*/
margin: auto;
overflow-x: hidden;
background-size:100% 100% !important;
/*transform-style:preserve-3d;*/
.lock {

View File

@ -17,18 +17,6 @@
<el-switch v-model="canvasStyleData.auxiliaryMatrix" :width="35" name="auxiliaryMatrix" />
<span>{{ $t('panel.matrix_design') }}</span>
</div>
<div class="canvas-config" style="margin-right: 10px">
<el-switch v-model="canvasStyleData.selfAdaption" :width="35" name="selfAdaption" />
<span>{{ $t('panel.canvas_self_adaption') }} </span>
</div>
<div class="canvas-config" style="margin-right: 55px">
<span> {{ $t('panel.canvas_size') }} </span>
<input v-model="canvasStyleData.width" :disabled="canvasStyleData.selfAdaption">
<span>*</span>
<input v-model="canvasStyleData.height" :disabled="canvasStyleData.selfAdaption">
</div>
<!-- <div class="canvas-config" style="margin-right: 10px">-->
<!-- <span> {{ $t('panel.canvas_scale') }} </span>-->
<!-- <input v-model="scale" @input="handleScaleChange"> %-->
@ -383,7 +371,7 @@ export default {
float: right;
height: 35px;
line-height: 35px;
min-width: 900px;
min-width: 500px;
/*background: #fff;*/
/*border-bottom: 1px solid #ddd;*/

View File

@ -79,6 +79,9 @@ const data = {
},
setCanvasStyle(state, style) {
if (style) {
style['selfAdaption'] = true
}
state.canvasStyleData = style
},

View File

@ -96,7 +96,6 @@
<div
id="canvasInfo"
:class="{'style-hidden':canvasStyleData.selfAdaption}"
class="content this_canvas"
@drop="handleDrop"
@dragover="handleDragOver"
@ -839,7 +838,7 @@ export default {
}
}
.style-hidden{
overflow: hidden;
overflow-x: hidden;
}
</style>

View File

@ -56,7 +56,7 @@
<el-row class="panel-design-preview">
<div id="imageWrapper" ref="imageWrapper" style="width: 100%;height: 100%">
<fullscreen style="height: 100%;background: #f7f8fa;overflow-y: auto" :fullscreen.sync="fullscreen">
<Preview v-if="showMain" :in-screen="!fullscreen" :show-type="canvasStyleData.selfAdaption?'full':'width'" />
<Preview v-if="showMain" :in-screen="!fullscreen" :show-type="'width'" />
</fullscreen>
</div>
</el-row>