forked from github/dataease
feat(数据大屏): 支持分组内部移动定位操作
This commit is contained in:
parent
ad03dd723f
commit
7a14372864
@ -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>
|
@ -2,9 +2,9 @@
|
|||||||
import { toRefs } from 'vue'
|
import { toRefs } from 'vue'
|
||||||
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
|
||||||
import { storeToRefs } from 'pinia'
|
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 dvMainStore = dvMainStoreWithOut()
|
||||||
const { canvasViewInfo } = storeToRefs(dvMainStore)
|
const { canvasViewInfo, canvasStyleData } = storeToRefs(dvMainStore)
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
propValue: {
|
propValue: {
|
||||||
@ -33,6 +33,11 @@ const props = defineProps({
|
|||||||
type: Number,
|
type: Number,
|
||||||
required: false,
|
required: false,
|
||||||
default: 0
|
default: 0
|
||||||
|
},
|
||||||
|
isEdit: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -42,18 +47,17 @@ const { propValue, dvInfo, searchCount } = toRefs(props)
|
|||||||
<template>
|
<template>
|
||||||
<div class="group">
|
<div class="group">
|
||||||
<div>
|
<div>
|
||||||
<component-wrapper
|
<canvas-group
|
||||||
v-for="(item, index) in propValue"
|
:component-data="propValue"
|
||||||
:id="'component' + item.id"
|
|
||||||
:view-info="canvasViewInfo[item.id]"
|
|
||||||
:key="index"
|
|
||||||
:config="item"
|
|
||||||
:index="index"
|
|
||||||
:dv-info="dvInfo"
|
:dv-info="dvInfo"
|
||||||
:style="item.groupStyle"
|
|
||||||
:show-position="showPosition"
|
: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>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
Reference in New Issue
Block a user