feat(数据大屏): 支持分组内部移动定位操作

This commit is contained in:
wangjiahao 2023-12-13 17:38:37 +08:00
parent ad03dd723f
commit 7a14372864
2 changed files with 92 additions and 12 deletions

View File

@ -0,0 +1,76 @@
<script setup lang="ts">
import { toRefs } from 'vue'
import DePreview from '@/components/data-visualization/canvas/DePreview.vue'
import DeCanvas from '@/views/canvas/DeCanvas.vue'
const props = defineProps({
canvasStyleData: {
type: Object,
required: true
},
componentData: {
type: Array,
required: true
},
canvasViewInfo: {
type: Object,
required: true
},
dvInfo: {
type: Object,
required: true
},
element: {
type: Object,
default() {
return {
propValue: []
}
}
},
isEdit: {
type: Boolean,
default: false
},
showPosition: {
type: String,
required: false,
default: 'canvas'
},
canvasId: {
type: String,
required: true
},
//
searchCount: {
type: Number,
required: false,
default: 0
}
})
const { element, isEdit, showPosition, canvasStyleData, canvasViewInfo, dvInfo, componentData } =
toRefs(props)
</script>
<template>
<de-canvas
v-if="isEdit"
ref="canvasGroup"
:component-data="componentData"
:canvas-style-data="canvasStyleData"
:canvas-view-info="canvasViewInfo"
:canvas-id="canvasId"
></de-canvas>
<de-preview
v-else
:ref="'dashboardPreview'"
:dv-info="dvInfo"
:component-data="componentData"
:canvas-style-data="canvasStyleData"
:canvas-view-info="canvasViewInfo"
:canvas-id="canvasId"
:show-position="showPosition"
></de-preview>
</template>
<style lang="less" scoped></style>

View File

@ -2,9 +2,9 @@
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'
import CanvasGroup from '@/custom-component/common/CanvasGroup.vue'
const dvMainStore = dvMainStoreWithOut()
const { canvasViewInfo } = storeToRefs(dvMainStore)
const { canvasViewInfo, canvasStyleData } = storeToRefs(dvMainStore)
const props = defineProps({
propValue: {
@ -33,6 +33,11 @@ const props = defineProps({
type: Number,
required: false,
default: 0
},
isEdit: {
type: Boolean,
required: false,
default: false
}
})
@ -42,18 +47,17 @@ const { propValue, dvInfo, searchCount } = toRefs(props)
<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"
<canvas-group
:component-data="propValue"
:dv-info="dvInfo"
:style="item.groupStyle"
:show-position="showPosition"
:search-count="searchCount"
/>
:canvas-id="'group-' + element.id"
:canvas-style-data="canvasStyleData"
:canvas-view-info="canvasViewInfo"
:is-edit="isEdit"
:element="element"
>
</canvas-group>
</div>
</div>
</template>