forked from github/dataease
Merge pull request #830 from dataease/pr@dev@refactor_panel-text
feat:仪表板视图改变大矩阵式设计预判视图实际尺寸大小
This commit is contained in:
commit
abf70efc37
@ -32,7 +32,9 @@
|
|||||||
>
|
>
|
||||||
<slot :name="handlei" />
|
<slot :name="handlei" />
|
||||||
</div>
|
</div>
|
||||||
<slot />
|
<div :style="mainSlotStyle">
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -445,7 +447,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
width: this.computedWidth,
|
width: this.computedWidth,
|
||||||
height: this.computedHeight,
|
height: this.computedHeight,
|
||||||
opacity: 0.2,
|
opacity: 0.4,
|
||||||
background: 'gray'
|
background: 'gray'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -473,7 +475,44 @@ export default {
|
|||||||
return this.height + 'px'
|
return this.height + 'px'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 根据left right 算出元素的宽度
|
||||||
|
computedMainSlotWidth() {
|
||||||
|
if (this.w === 'auto') {
|
||||||
|
if (!this.widthTouched) {
|
||||||
|
return 'auto'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.canvasStyleData.auxiliaryMatrix) {
|
||||||
|
const width = Math.round(this.width / this.curCanvasScale.matrixStyleWidth) * this.curCanvasScale.matrixStyleWidth
|
||||||
|
return width + 'px'
|
||||||
|
} else {
|
||||||
|
return this.width + 'px'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 根据top bottom 算出元素的宽度
|
||||||
|
computedMainSlotHeight() {
|
||||||
|
if (this.h === 'auto') {
|
||||||
|
if (!this.heightTouched) {
|
||||||
|
return 'auto'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.canvasStyleData.auxiliaryMatrix) {
|
||||||
|
const height = Math.round(this.height / this.curCanvasScale.matrixStyleHeight) * this.curCanvasScale.matrixStyleHeight
|
||||||
|
return height + 'px'
|
||||||
|
} else {
|
||||||
|
return this.height + 'px'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// private
|
// private
|
||||||
|
mainSlotStyle() {
|
||||||
|
const style = {
|
||||||
|
width: this.computedMainSlotWidth,
|
||||||
|
height: this.computedMainSlotHeight
|
||||||
|
}
|
||||||
|
console.log('style=>' + JSON.stringify(style))
|
||||||
|
return style
|
||||||
|
},
|
||||||
...mapState([
|
...mapState([
|
||||||
'curComponent',
|
'curComponent',
|
||||||
'editor',
|
'editor',
|
||||||
|
@ -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 />
|
||||||
@ -221,8 +221,8 @@ export default {
|
|||||||
},
|
},
|
||||||
// 矩阵数量 默认 128 * 72
|
// 矩阵数量 默认 128 * 72
|
||||||
matrixCount: {
|
matrixCount: {
|
||||||
x: 80,
|
x: 36,
|
||||||
y: 45
|
y: 18
|
||||||
},
|
},
|
||||||
customStyleHistory: null,
|
customStyleHistory: null,
|
||||||
showDrag: true,
|
showDrag: true,
|
||||||
@ -636,6 +636,7 @@ export default {
|
|||||||
},
|
},
|
||||||
resizeView(index, item) {
|
resizeView(index, item) {
|
||||||
if (item.type === 'view') {
|
if (item.type === 'view') {
|
||||||
|
console.log('view:resizeView')
|
||||||
this.$refs.wrapperChild[index].chartResize()
|
this.$refs.wrapperChild[index].chartResize()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -435,7 +435,7 @@ export default {
|
|||||||
this.$refs[this.element.propValue.id].chartResize()
|
this.$refs[this.element.propValue.id].chartResize()
|
||||||
}
|
}
|
||||||
this.destroyTimeMachine()
|
this.destroyTimeMachine()
|
||||||
}, 200)
|
}, 50)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user