forked from github/dataease
Merge pull request #12610 from dataease/pr@dev-v2@fix_tab-position
fix(数据大屏): 修复tab组件内组件在坐标系里的定位不正确问题
This commit is contained in:
commit
ebb2307b1b
@ -21,7 +21,7 @@ const props = defineProps({
|
|||||||
|
|
||||||
const labelInterval = 5
|
const labelInterval = 5
|
||||||
|
|
||||||
const { canvasStyleData, curComponent } = storeToRefs(dvMainStore)
|
const { canvasStyleData, curComponent, componentData } = storeToRefs(dvMainStore)
|
||||||
|
|
||||||
const rulerSize = computed(() =>
|
const rulerSize = computed(() =>
|
||||||
props.direction === 'horizontal' ? canvasStyleData.value.width : canvasStyleData.value.height
|
props.direction === 'horizontal' ? canvasStyleData.value.width : canvasStyleData.value.height
|
||||||
@ -41,13 +41,27 @@ const curComponentSize = computed(() => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 计算复合画布内部组件偏移量
|
||||||
|
const parentStyle = computed(() => {
|
||||||
|
const style = { left: 0, top: 0 }
|
||||||
|
if (curComponent.value && curComponent.value.canvasId !== 'canvas-main') {
|
||||||
|
componentData.value.forEach(item => {
|
||||||
|
if (curComponent.value.canvasId.index(item.id) > -1) {
|
||||||
|
style.left = item.style.left
|
||||||
|
style.top = item.style.top
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return style
|
||||||
|
})
|
||||||
|
|
||||||
const curComponentShadow = computed(() => {
|
const curComponentShadow = computed(() => {
|
||||||
if (curComponent.value) {
|
if (curComponent.value) {
|
||||||
return {
|
return {
|
||||||
left:
|
left:
|
||||||
(props.direction === 'horizontal'
|
(props.direction === 'horizontal'
|
||||||
? curComponent.value.style.left
|
? curComponent.value.style.left + parentStyle.value.left
|
||||||
: curComponent.value.style.top) + 'px',
|
: curComponent.value.style.top + parentStyle.value.top) + 'px',
|
||||||
width:
|
width:
|
||||||
(props.direction === 'horizontal'
|
(props.direction === 'horizontal'
|
||||||
? curComponent.value.style.width
|
? curComponent.value.style.width
|
||||||
|
Loading…
Reference in New Issue
Block a user