!238 update src/views/chart/ContentEdit/components/EditRule/index.vue.

Merge pull request !238 from zhong/N/A
This commit is contained in:
奔跑的面条 2024-07-01 07:38:21 +00:00 committed by Gitee
commit f603aef022
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -13,7 +13,7 @@
> >
</sketch-rule> </sketch-rule>
<div ref="$app" class="edit-screens" @scroll="handleScroll"> <div ref="$app" class="edit-screens" @scroll="handleScroll">
<div ref="$container" class="edit-screen-container" :style="{ width: width * 2 + 'px' }"> <div ref="$container" class="edit-screen-container" :style="{ width: containerWidth }">
<div <div
ref="refSketchRuleBox" ref="refSketchRuleBox"
class="canvas" class="canvas"
@ -62,8 +62,13 @@ const scale = computed(() => {
return chartEditStore.getEditCanvas.scale return chartEditStore.getEditCanvas.scale
}) })
// //
const containerWidth = computed(() => { const containerWidth = computed(() => {
return `${window.innerWidth * 2}px`
})
//
const containerHeight = computed(() => {
return `${height.value * 2}px` return `${height.value * 2}px`
}) })
@ -203,14 +208,12 @@ watch(
(newValue, oldValue) => { (newValue, oldValue) => {
if (oldValue !== newValue && chartLayoutStore.getRePositionCanvas) { if (oldValue !== newValue && chartLayoutStore.getRePositionCanvas) {
chartLayoutStore.setItemUnHandle(ChartLayoutStoreEnum.RE_POSITION_CANVAS, false) chartLayoutStore.setItemUnHandle(ChartLayoutStoreEnum.RE_POSITION_CANVAS, false)
handleScroll() }
setTimeout(() => { handleScroll()
setTimeout(() => {
canvasPosCenter() canvasPosCenter()
reDraw() reDraw()
}, 400) }, 400)
} else {
reDraw();
}
} }
) )
@ -337,7 +340,7 @@ window.onKeySpacePressHold = (isHold: boolean) => {
.edit-screen-container { .edit-screen-container {
position: absolute; position: absolute;
height: v-bind('containerWidth'); height: v-bind('containerHeight');
top: 0; top: 0;
left: 0; left: 0;
} }