forked from github/dataease
fix: 修改大屏预览分组位置定位不准确问题
This commit is contained in:
parent
0711ea8bc2
commit
d3b9bb68b9
@ -371,9 +371,7 @@ const areaDataPush = component => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const handleDbClick = e => {
|
const handleDbClick = e => {
|
||||||
console.log('111=0' + element.value.canvasId)
|
|
||||||
if (element.value.canvasId !== 'canvas-main') {
|
if (element.value.canvasId !== 'canvas-main') {
|
||||||
console.log('111=1' + canvasActive.value)
|
|
||||||
dvMainStore.setCurComponent({ component: element.value, index: index.value })
|
dvMainStore.setCurComponent({ component: element.value, index: index.value })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { toRefs } from 'vue'
|
import { toRefs } from 'vue'
|
||||||
import DePreview from '@/components/data-visualization/canvas/DePreview.vue'
|
|
||||||
import CanvasCore from '@/components/data-visualization/canvas/CanvasCore.vue'
|
import CanvasCore from '@/components/data-visualization/canvas/CanvasCore.vue'
|
||||||
|
import GroupPreview from '@/custom-component/group/GroupPreview.vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
canvasStyleData: {
|
canvasStyleData: {
|
||||||
@ -63,16 +63,15 @@ const { element, isEdit, showPosition, canvasStyleData, canvasViewInfo, dvInfo,
|
|||||||
:canvas-id="canvasId"
|
:canvas-id="canvasId"
|
||||||
:canvas-active="element['canvasActive']"
|
:canvas-active="element['canvasActive']"
|
||||||
></canvas-core>
|
></canvas-core>
|
||||||
<de-preview
|
<group-preview
|
||||||
v-else
|
v-else
|
||||||
:ref="'dashboardPreview'"
|
:ref="'dashboardPreview'"
|
||||||
:dv-info="dvInfo"
|
:dv-info="dvInfo"
|
||||||
:component-data="componentData"
|
:element="element"
|
||||||
:canvas-style-data="canvasStyleData"
|
:search-count="searchCount"
|
||||||
:canvas-view-info="canvasViewInfo"
|
:prop-value="element.propValue"
|
||||||
:canvas-id="canvasId"
|
|
||||||
:show-position="showPosition"
|
:show-position="showPosition"
|
||||||
></de-preview>
|
></group-preview>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="less" scoped></style>
|
<style lang="less" scoped></style>
|
||||||
|
@ -0,0 +1,73 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { toRefs } from 'vue'
|
||||||
|
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||||
|
import { storeToRefs } from 'pinia'
|
||||||
|
import ComponentWrapper from '@/components/data-visualization/canvas/ComponentWrapper.vue'
|
||||||
|
const dvMainStore = dvMainStoreWithOut()
|
||||||
|
const { canvasViewInfo } = storeToRefs(dvMainStore)
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
propValue: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
element: {
|
||||||
|
type: Object,
|
||||||
|
default() {
|
||||||
|
return {
|
||||||
|
propValue: null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
showPosition: {
|
||||||
|
type: String,
|
||||||
|
required: false,
|
||||||
|
default: 'canvas'
|
||||||
|
},
|
||||||
|
dvInfo: {
|
||||||
|
type: Object,
|
||||||
|
required: true
|
||||||
|
},
|
||||||
|
// 仪表板刷新计时器
|
||||||
|
searchCount: {
|
||||||
|
type: Number,
|
||||||
|
required: false,
|
||||||
|
default: 0
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const { propValue, dvInfo, searchCount } = toRefs(props)
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="group">
|
||||||
|
<div>
|
||||||
|
<component-wrapper
|
||||||
|
v-for="(item, index) in propValue"
|
||||||
|
:id="'component' + item.id"
|
||||||
|
:view-info="canvasViewInfo[item.id]"
|
||||||
|
:key="index"
|
||||||
|
:config="item"
|
||||||
|
:index="index"
|
||||||
|
:dv-info="dvInfo"
|
||||||
|
:style="item.groupStyle"
|
||||||
|
:show-position="showPosition"
|
||||||
|
:search-count="searchCount"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.group {
|
||||||
|
& > div {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.component {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -125,7 +125,6 @@ export function listenGlobalKeyDown() {
|
|||||||
lockMap[keyCode]()
|
lockMap[keyCode]()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log('1111=isCtrlOrCommandDown' + isCtrlOrCommandDown + ';isShiftDown=' + isShiftDown)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onkeyup = e => {
|
window.onkeyup = e => {
|
||||||
|
@ -141,8 +141,14 @@ export function canvasSave(callBack) {
|
|||||||
if (item.component === 'UserView') {
|
if (item.component === 'UserView') {
|
||||||
item.linkageFilters = []
|
item.linkageFilters = []
|
||||||
} else if (item.component === 'Group') {
|
} else if (item.component === 'Group') {
|
||||||
|
const groupStyle = item.style
|
||||||
item.propValue.forEach(groupItem => {
|
item.propValue.forEach(groupItem => {
|
||||||
groupItem.linkageFilters = []
|
groupItem.linkageFilters = []
|
||||||
|
// 计算groupStyle
|
||||||
|
groupItem.groupStyle.left = groupItem.style.left / groupStyle.width
|
||||||
|
groupItem.groupStyle.top = groupItem.style.top / groupStyle.height
|
||||||
|
groupItem.groupStyle.width = groupItem.style.width / groupStyle.width
|
||||||
|
groupItem.groupStyle.height = groupItem.style.height / groupStyle.height
|
||||||
})
|
})
|
||||||
} else if (item.component === 'DeTabs') {
|
} else if (item.component === 'DeTabs') {
|
||||||
item.propValue.forEach(tabItem => {
|
item.propValue.forEach(tabItem => {
|
||||||
|
Loading…
Reference in New Issue
Block a user