mirror of
https://gitee.com/dromara/go-view.git
synced 2025-02-24 16:22:57 +08:00
feat: 新增解除组件还原位置
This commit is contained in:
parent
0779aeca6a
commit
fbc689b235
@ -650,7 +650,11 @@ export const useChartEditStore = defineStore({
|
||||
// 解组
|
||||
const unGroup = (targetIndex: number) => {
|
||||
const targetGroup = this.getComponentList[targetIndex] as CreateComponentGroupType
|
||||
|
||||
// 分离组件并还原位置属性
|
||||
targetGroup.groupList.forEach(item => {
|
||||
item.attr.x = item.attr.x + targetGroup.attr.x
|
||||
item.attr.y = item.attr.y + targetGroup.attr.y
|
||||
this.addComponentList(item)
|
||||
})
|
||||
this.setTargetSelectChart(targetGroup.id)
|
||||
|
@ -5,6 +5,7 @@
|
||||
:data-id="groupData.id"
|
||||
:index="groupIndex"
|
||||
:item="groupData"
|
||||
:hiddenPoint="true"
|
||||
:style="{
|
||||
...useComponentStyle(groupData.attr, groupIndex),
|
||||
...useSizeStyle(groupData.attr),
|
||||
@ -24,6 +25,7 @@
|
||||
:data-id="item.id"
|
||||
:index="groupIndex"
|
||||
:item="item"
|
||||
:hiddenPoint="true"
|
||||
:style="{
|
||||
...useComponentStyle(item.attr, groupIndex)
|
||||
}"
|
||||
|
@ -2,13 +2,15 @@
|
||||
<div class="go-shape-box">
|
||||
<slot></slot>
|
||||
<!-- 锚点 -->
|
||||
<div
|
||||
:class="`shape-point ${point}`"
|
||||
v-for="(point, index) in select ? pointList : []"
|
||||
:key="index"
|
||||
:style="usePointStyle(point, index, item.attr, cursorResize)"
|
||||
@mousedown="useMousePointHandle($event, point, item.attr)"
|
||||
></div>
|
||||
<template v-if="!hiddenPoint">
|
||||
<div
|
||||
:class="`shape-point ${point}`"
|
||||
v-for="(point, index) in select ? pointList : []"
|
||||
:key="index"
|
||||
:style="usePointStyle(point, index, item.attr, cursorResize)"
|
||||
@mousedown="useMousePointHandle($event, point, item.attr)"
|
||||
></div>
|
||||
</template>
|
||||
|
||||
<!-- 选中 -->
|
||||
<div class="shape-modal" :style="useSizeStyle(item.attr)">
|
||||
@ -30,6 +32,10 @@ const props = defineProps({
|
||||
item: {
|
||||
type: Object as PropType<CreateComponentType | CreateComponentGroupType>,
|
||||
required: true
|
||||
},
|
||||
hiddenPoint: {
|
||||
type: Boolean,
|
||||
required: false
|
||||
}
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user