提交 f9a0ec3d authored 作者: wangjiahao's avatar wangjiahao

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

上级 0f91ee66
...@@ -610,7 +610,7 @@ export default { ...@@ -610,7 +610,7 @@ export default {
const rect = this.$el.parentNode.getBoundingClientRect() const rect = this.$el.parentNode.getBoundingClientRect()
this.parentX = rect.x this.parentX = rect.x
this.parentY = rect.y 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') { if (typeof this.parent === 'string') {
const parentNode = document.querySelector(this.parent) const parentNode = document.querySelector(this.parent)
......
...@@ -110,12 +110,16 @@ export default { ...@@ -110,12 +110,16 @@ export default {
} }
} }
} }
if (this.canvasStyleData.selfAdaption) { // if (this.canvasStyleData.selfAdaption) {
style = { // style = {
overflow: 'hidden', // overflow: 'hidden',
...style // ...style
} // }
} // }
// style = {
// overflow-x :'hidden',
// ...style
// }
return style return style
}, },
// 此处单独计算componentData的值 不放入全局mapState中 // 此处单独计算componentData的值 不放入全局mapState中
...@@ -168,10 +172,13 @@ export default { ...@@ -168,10 +172,13 @@ export default {
const canvasWidth = document.getElementById('canvasInfoTemp').offsetWidth const canvasWidth = document.getElementById('canvasInfoTemp').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.scaleHeight = this.scaleWidth
this.mainHeight = this.canvasStyleData.height * this.scaleHeight / 100 + 'px' // 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() this.handleScaleChange()
}, },
resetID(data) { resetID(data) {
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
@mousedown="handleMouseDown" @mousedown="handleMouseDown"
> >
<!-- 网格线 --> <!-- 网格线 -->
<Grid v-if="canvasStyleData.auxiliaryMatrix&&!linkageSettingStatus" :matrix-style="matrixStyle" /> <!-- <Grid v-if="canvasStyleData.auxiliaryMatrix&&!linkageSettingStatus" :matrix-style="matrixStyle" />-->
<!-- 仪表板联动清除按钮--> <!-- 仪表板联动清除按钮-->
<canvas-opt-bar /> <canvas-opt-bar />
...@@ -216,10 +216,10 @@ export default { ...@@ -216,10 +216,10 @@ export default {
width: 80, width: 80,
height: 20 height: 20
}, },
// 矩阵数量 默认 12 * 24 // 矩阵数量 默认 128 * 72
matrixCount: { matrixCount: {
x: 24, x: 80,
y: 72 y: 45
}, },
customStyleHistory: null, customStyleHistory: null,
showDrag: true, showDrag: true,
...@@ -555,6 +555,9 @@ export default { ...@@ -555,6 +555,9 @@ export default {
if (this.canvasStyleData.matrixCount) { if (this.canvasStyleData.matrixCount) {
this.matrixCount = 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.outStyle.width && this.outStyle.height) {
// 矩阵计算 // 矩阵计算
if (!this.canvasStyleData.selfAdaption) { if (!this.canvasStyleData.selfAdaption) {
...@@ -642,6 +645,7 @@ export default { ...@@ -642,6 +645,7 @@ export default {
position: relative; position: relative;
/*background: #fff;*/ /*background: #fff;*/
margin: auto; margin: auto;
overflow-x: hidden;
background-size:100% 100% !important; background-size:100% 100% !important;
/*transform-style:preserve-3d;*/ /*transform-style:preserve-3d;*/
.lock { .lock {
......
...@@ -17,18 +17,6 @@ ...@@ -17,18 +17,6 @@
<el-switch v-model="canvasStyleData.auxiliaryMatrix" :width="35" name="auxiliaryMatrix" /> <el-switch v-model="canvasStyleData.auxiliaryMatrix" :width="35" name="auxiliaryMatrix" />
<span>{{ $t('panel.matrix_design') }}</span> <span>{{ $t('panel.matrix_design') }}</span>
</div> </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">--> <!-- <div class="canvas-config" style="margin-right: 10px">-->
<!-- <span> {{ $t('panel.canvas_scale') }} </span>--> <!-- <span> {{ $t('panel.canvas_scale') }} </span>-->
<!-- <input v-model="scale" @input="handleScaleChange"> %--> <!-- <input v-model="scale" @input="handleScaleChange"> %-->
...@@ -383,7 +371,7 @@ export default { ...@@ -383,7 +371,7 @@ export default {
float: right; float: right;
height: 35px; height: 35px;
line-height: 35px; line-height: 35px;
min-width: 900px; min-width: 500px;
/*background: #fff;*/ /*background: #fff;*/
/*border-bottom: 1px solid #ddd;*/ /*border-bottom: 1px solid #ddd;*/
......
...@@ -79,6 +79,9 @@ const data = { ...@@ -79,6 +79,9 @@ const data = {
}, },
setCanvasStyle(state, style) { setCanvasStyle(state, style) {
if (style) {
style['selfAdaption'] = true
}
state.canvasStyleData = style state.canvasStyleData = style
}, },
......
...@@ -96,7 +96,6 @@ ...@@ -96,7 +96,6 @@
<div <div
id="canvasInfo" id="canvasInfo"
:class="{'style-hidden':canvasStyleData.selfAdaption}"
class="content this_canvas" class="content this_canvas"
@drop="handleDrop" @drop="handleDrop"
@dragover="handleDragOver" @dragover="handleDragOver"
...@@ -839,7 +838,7 @@ export default { ...@@ -839,7 +838,7 @@ export default {
} }
} }
.style-hidden{ .style-hidden{
overflow: hidden; overflow-x: hidden;
} }
</style> </style>
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<el-row class="panel-design-preview"> <el-row class="panel-design-preview">
<div id="imageWrapper" ref="imageWrapper" style="width: 100%;height: 100%"> <div id="imageWrapper" ref="imageWrapper" style="width: 100%;height: 100%">
<fullscreen style="height: 100%;background: #f7f8fa;overflow-y: auto" :fullscreen.sync="fullscreen"> <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> </fullscreen>
</div> </div>
</el-row> </el-row>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论