|
@@ -14,10 +14,10 @@
|
|
|
v-if="currentBlock"
|
|
|
class="temp-block"
|
|
|
:style="{
|
|
|
- left: `${Math.min(currentBlock.startX, currentBlock.currentX)}px`,
|
|
|
- top: `${Math.min(currentBlock.startY, currentBlock.currentY)}px`,
|
|
|
- width: `${Math.abs(currentBlock.currentX - currentBlock.startX)}px`,
|
|
|
- height: `${Math.abs(currentBlock.currentY - currentBlock.startY)}px`,
|
|
|
+ left: `${Math.min(currentBlock.startY, currentBlock.currentY)}px`,
|
|
|
+ top: `${Math.min(currentBlock.startX, currentBlock.currentX)}px`,
|
|
|
+ width: `${Math.abs(currentBlock.currentY - currentBlock.startY)}px`,
|
|
|
+ height: `${Math.abs(currentBlock.currentX - currentBlock.startX)}px`,
|
|
|
}"
|
|
|
></div>
|
|
|
|
|
@@ -27,8 +27,8 @@
|
|
|
:key="block.id"
|
|
|
class="block-item"
|
|
|
:style="{
|
|
|
- left: `${block.x}px`,
|
|
|
- top: `${block.y}px`,
|
|
|
+ left: `${block.y}px`,
|
|
|
+ top: `${block.x}px`,
|
|
|
width: `${block.width}px`,
|
|
|
height: `${block.height}px`,
|
|
|
border: `2px solid ${block?.isBed ? '#1abc1a' : block.isActice ? 'yellow' : '#1890ff'}`,
|
|
@@ -51,7 +51,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div v-if="selectedBlock" class="mapConfig">
|
|
|
+ <!-- <div v-if="selectedBlock" class="mapConfig">
|
|
|
<div class="mapConfig-header">
|
|
|
<span class="title">子区域属性</span>
|
|
|
<span class="close" @click="closeSubregionAttr"><CloseOutlined /></span>
|
|
@@ -146,7 +146,9 @@
|
|
|
<DeleteOutlined @click="deleteBlockArea(selectedBlock.id || '')" />
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+
|
|
|
+ <pre>{{ selectedBlock }}</pre>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -154,7 +156,7 @@
|
|
|
import { ref, computed, watch } from 'vue'
|
|
|
import { message } from 'ant-design-vue'
|
|
|
import { nanoid } from 'nanoid'
|
|
|
-import { DeleteOutlined, CloseOutlined } from '@ant-design/icons-vue'
|
|
|
+// import { DeleteOutlined, CloseOutlined } from '@ant-design/icons-vue'
|
|
|
import { getOriginPosition } from '@/utils'
|
|
|
import type { SubRegions } from '@/api/room/types'
|
|
|
|
|
@@ -166,28 +168,29 @@ interface Props {
|
|
|
length: number // 区域宽度
|
|
|
subRegions?: SubRegions[]
|
|
|
editable?: boolean
|
|
|
+ hasBed?: boolean
|
|
|
}
|
|
|
|
|
|
interface BlockItem {
|
|
|
// 本地用
|
|
|
id: string // 唯一标识
|
|
|
- x: number // 区块基于父元素的X偏移量,区块的左上角x坐标
|
|
|
- y: number // 区块基于父元素的Y偏移量,区块的左上角y坐标
|
|
|
- ox: number // 区块基于原点的X偏移量,区块的左上角x坐标
|
|
|
- oy: number // 区块基于原点的Y偏移量,区块的左上角y坐标
|
|
|
- width: number // 区块宽度
|
|
|
- height: number // 区块高度
|
|
|
+ x: number // 区块基于父元素的X偏移量(垂直方向,朝上为正)
|
|
|
+ y: number // 区块基于父元素的Y偏移量(水平方向,朝右为正)
|
|
|
+ ox: number // 区块基于原点的X偏移量
|
|
|
+ oy: number // 区块基于原点的Y偏移量
|
|
|
+ width: number // 区块宽度(水平方向)
|
|
|
+ height: number // 区块高度(垂直方向)
|
|
|
isDragging: boolean // 是否正在拖动
|
|
|
isResizing: boolean // 是否正在调整大小
|
|
|
isActice: boolean // 是否选中
|
|
|
- isTracking: boolean // 是否开启区域跟踪 0-否,1-是 对应 trackPresence 字段
|
|
|
- isFalling: boolean // 是否屏蔽区域跌倒检测 0-否,1-是 对应 excludeFalling 字段
|
|
|
- isBed?: boolean // 是否是床 本地判断使用
|
|
|
+ isTracking: boolean // 是否开启区域跟踪
|
|
|
+ isFalling: boolean // 是否屏蔽区域跌倒检测
|
|
|
+ isBed?: boolean // 是否是床
|
|
|
// 接口用
|
|
|
- startXx: number // 屏蔽子区域X开始
|
|
|
- stopXx: number // 屏蔽子区域X结束
|
|
|
- startYy: number // 屏蔽子区域Y开始
|
|
|
- stopYy: number // 屏蔽子区域Y结束
|
|
|
+ startXx: number // 屏蔽子区域X开始(水平)
|
|
|
+ stopXx: number // 屏蔽子区域X结束(水平)
|
|
|
+ startYy: number // 屏蔽子区域Y开始(垂直)
|
|
|
+ stopYy: number // 屏蔽子区域Y结束(垂直)
|
|
|
startZz: number // 屏蔽子区域Z开始
|
|
|
stopZz: number // 屏蔽子区域Z结束
|
|
|
isLowSnr: number // 是否为床 0-不是,1-是
|
|
@@ -208,7 +211,7 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
const emit = defineEmits<{
|
|
|
(e: 'update:subRegions', regions: SubRegions[]): void
|
|
|
(e: 'create'): void
|
|
|
- (e: 'update'): void
|
|
|
+ (e: 'update', regions: SubRegions[]): void
|
|
|
}>()
|
|
|
|
|
|
// 检测区域宽度 length
|
|
@@ -225,10 +228,10 @@ const editable = computed(() => props.editable)
|
|
|
const blocks = ref<BlockItem[]>([])
|
|
|
const isCreating = ref(false)
|
|
|
const currentBlock = ref<{
|
|
|
- startX: number
|
|
|
- startY: number
|
|
|
- currentX: number
|
|
|
- currentY: number
|
|
|
+ startX: number // 垂直方向起点
|
|
|
+ startY: number // 水平方向起点
|
|
|
+ currentX: number // 垂直方向当前点
|
|
|
+ currentY: number // 水平方向当前点
|
|
|
} | null>(null)
|
|
|
const selectedBlock = ref<BlockItem | null>(null)
|
|
|
|
|
@@ -241,10 +244,10 @@ watch(
|
|
|
if (newSubRegions && newSubRegions.length > 0) {
|
|
|
blocks.value = newSubRegions.map((item, index) => ({
|
|
|
id: nanoid(),
|
|
|
- x: item.startXx + originX,
|
|
|
- y: originY - item.startYy,
|
|
|
- ox: item.startXx + originX - originX,
|
|
|
- oy: originY - item.startYy - originY,
|
|
|
+ x: originY - Number(item.startYy), // x对应垂直方向
|
|
|
+ y: Number(item.startXx) + originX, // y对应水平方向
|
|
|
+ ox: originY - item.startYy - originY,
|
|
|
+ oy: item.startXx + originX - originX,
|
|
|
width: Math.abs(item.stopXx - item.startXx),
|
|
|
height: Math.abs(item.stopYy - item.startYy),
|
|
|
isDragging: false,
|
|
@@ -252,7 +255,7 @@ watch(
|
|
|
isActice: false,
|
|
|
isTracking: Boolean(item.trackPresence),
|
|
|
isFalling: Boolean(item.excludeFalling),
|
|
|
- isBed: index === 0, // 简单判断,实际应该基于家具信息
|
|
|
+ isBed: index === 0 && props.hasBed,
|
|
|
// 来自接口回显的数据
|
|
|
startXx: item.startXx,
|
|
|
stopXx: item.stopXx,
|
|
@@ -291,7 +294,8 @@ const updateSubRegionsData = () => {
|
|
|
trackPresence: Number(item.isTracking),
|
|
|
excludeFalling: Number(item.isFalling),
|
|
|
}))
|
|
|
- emit('update:subRegions', subRegionsData)
|
|
|
+ // emit('update:subRegions', subRegionsData)
|
|
|
+ emit('update', subRegionsData)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -317,41 +321,44 @@ const handleMouseMove = (e: MouseEvent) => {
|
|
|
if (!currentBlock.value) return
|
|
|
|
|
|
const rect = getContainerRect()
|
|
|
- currentBlock.value.currentX = Math.max(0, Math.min(e.clientX - rect.left, rect.width))
|
|
|
- currentBlock.value.currentY = Math.max(0, Math.min(e.clientY - rect.top, rect.height))
|
|
|
+ // currentX 对应垂直方向(y轴)
|
|
|
+ currentBlock.value.currentX = Math.max(0, Math.min(e.clientY - rect.top, rect.height))
|
|
|
+ // currentY 对应水平方向(x轴)
|
|
|
+ currentBlock.value.currentY = Math.max(0, Math.min(e.clientX - rect.left, rect.width))
|
|
|
}
|
|
|
|
|
|
-// 修复鼠标释放处理中的坐标计算
|
|
|
+// 鼠标释放处理
|
|
|
const handleMouseUp = () => {
|
|
|
if (!currentBlock.value) return
|
|
|
|
|
|
const { startX, startY, currentX, currentY } = currentBlock.value
|
|
|
- const width = Math.abs(currentX - startX)
|
|
|
- const height = Math.abs(currentY - startY)
|
|
|
+ // 宽度由水平方向(y)差值决定,高度由垂直方向(x)差值决定
|
|
|
+ const width = Math.abs(currentY - startY)
|
|
|
+ const height = Math.abs(currentX - startX)
|
|
|
|
|
|
if (width > 10 && height > 10) {
|
|
|
- const minX = Math.round(Math.min(startX, currentX))
|
|
|
- const minY = Math.round(Math.min(startY, currentY))
|
|
|
+ const minX = Math.round(Math.min(startX, currentX)) // 垂直方向最小坐标
|
|
|
+ const minY = Math.round(Math.min(startY, currentY)) // 水平方向最小坐标
|
|
|
|
|
|
blocks.value.push({
|
|
|
// 本地用
|
|
|
id: nanoid(),
|
|
|
- x: minX,
|
|
|
- y: minY,
|
|
|
- ox: minX - originX,
|
|
|
- oy: originY - minY, // 注意这里是originY - minY
|
|
|
- width,
|
|
|
- height,
|
|
|
+ x: minX, // 垂直方向位置
|
|
|
+ y: minY, // 水平方向位置
|
|
|
+ ox: minX - originY,
|
|
|
+ oy: minY - originX,
|
|
|
+ width, // 水平宽度
|
|
|
+ height, // 垂直高度
|
|
|
isDragging: false,
|
|
|
isResizing: false,
|
|
|
isActice: false,
|
|
|
isTracking: false,
|
|
|
isFalling: false,
|
|
|
// 接口用
|
|
|
- startXx: minX - originX,
|
|
|
- stopXx: minX - originX + width,
|
|
|
- startYy: originY - minY, // 注意这里是originY - minY
|
|
|
- stopYy: originY - minY - height, // 注意这里是originY - minY - height
|
|
|
+ startXx: minY - originX,
|
|
|
+ stopXx: minY - originX + width,
|
|
|
+ startYy: originY - minX,
|
|
|
+ stopYy: originY - minX - height,
|
|
|
startZz: 0,
|
|
|
stopZz: 0,
|
|
|
isLowSnr: 0,
|
|
@@ -362,7 +369,6 @@ const handleMouseUp = () => {
|
|
|
excludeFalling: 0,
|
|
|
})
|
|
|
emit('create')
|
|
|
- // 新创建区块后也调用手动更新函数
|
|
|
updateSubRegionsData()
|
|
|
}
|
|
|
|
|
@@ -372,7 +378,7 @@ const handleMouseUp = () => {
|
|
|
document.removeEventListener('mouseup', handleMouseUp)
|
|
|
}
|
|
|
|
|
|
-// 修复区块拖动中的坐标计算
|
|
|
+// 区块拖动
|
|
|
const startDrag = (block: BlockItem, e: MouseEvent) => {
|
|
|
if (!editable.value) return
|
|
|
e.stopPropagation()
|
|
@@ -386,22 +392,26 @@ const startDrag = (block: BlockItem, e: MouseEvent) => {
|
|
|
block.isActice = true
|
|
|
const container = document.querySelector('.blockArea') as HTMLElement
|
|
|
const rect = container.getBoundingClientRect()
|
|
|
- const offsetX = e.clientX - rect.left - block.x
|
|
|
- const offsetY = e.clientY - rect.top - block.y
|
|
|
+ // 垂直方向偏移(x轴)基于clientY,水平方向偏移(y轴)基于clientX
|
|
|
+ const offsetX = e.clientY - rect.top - block.x
|
|
|
+ const offsetY = e.clientX - rect.left - block.y
|
|
|
|
|
|
const initialOx = block.ox
|
|
|
const initialOy = block.oy
|
|
|
|
|
|
const moveHandler = (e: MouseEvent) => {
|
|
|
- const newX = e.clientX - rect.left - offsetX
|
|
|
- const newY = e.clientY - rect.top - offsetY
|
|
|
+ // 新垂直位置(x轴)= 鼠标垂直位置 - 容器顶部 - 偏移量
|
|
|
+ const newX = e.clientY - rect.top - offsetX
|
|
|
+ // 新水平位置(y轴)= 鼠标水平位置 - 容器左侧 - 偏移量
|
|
|
+ const newY = e.clientX - rect.left - offsetY
|
|
|
const containerWidth = container.offsetWidth
|
|
|
const containerHeight = container.offsetHeight
|
|
|
|
|
|
- block.x = Math.max(0, Math.min(newX, containerWidth - block.width))
|
|
|
- block.y = Math.max(0, Math.min(newY, containerHeight - block.height))
|
|
|
- block.ox = block.x - originX
|
|
|
- block.oy = originY - block.y // 注意这里是originY - block.y
|
|
|
+ // 限制边界:x(垂直)不超过容器高度,y(水平)不超过容器宽度
|
|
|
+ block.x = Math.max(0, Math.min(newX, containerHeight - block.height))
|
|
|
+ block.y = Math.max(0, Math.min(newY, containerWidth - block.width))
|
|
|
+ block.ox = block.x - originY
|
|
|
+ block.oy = block.y - originX
|
|
|
}
|
|
|
|
|
|
const upHandler = () => {
|
|
@@ -409,10 +419,10 @@ const startDrag = (block: BlockItem, e: MouseEvent) => {
|
|
|
block.isActice = false
|
|
|
|
|
|
if (block.ox !== initialOx || block.oy !== initialOy) {
|
|
|
- block.startXx = block.ox
|
|
|
- block.stopXx = block.ox + block.width
|
|
|
- block.startYy = block.oy
|
|
|
- block.stopYy = block.oy - block.height
|
|
|
+ block.startXx = block.oy
|
|
|
+ block.stopXx = block.oy + block.width
|
|
|
+ block.startYy = originY - block.x
|
|
|
+ block.stopYy = originY - block.x - block.height
|
|
|
|
|
|
updateSubRegionsData()
|
|
|
}
|
|
@@ -425,7 +435,7 @@ const startDrag = (block: BlockItem, e: MouseEvent) => {
|
|
|
document.addEventListener('mouseup', upHandler)
|
|
|
}
|
|
|
|
|
|
-// 修复区块调整大小中的坐标计算
|
|
|
+// 区块调整大小
|
|
|
const startResize = (block: BlockItem, e: MouseEvent) => {
|
|
|
if (!editable.value) return
|
|
|
e.stopPropagation()
|
|
@@ -433,18 +443,18 @@ const startResize = (block: BlockItem, e: MouseEvent) => {
|
|
|
|
|
|
block.isResizing = true
|
|
|
selectedBlock.value = block
|
|
|
- const startX = e.clientX
|
|
|
- const startY = e.clientY
|
|
|
+ const startX = e.clientY // 垂直方向起点使用clientY
|
|
|
+ const startY = e.clientX // 水平方向起点使用clientX
|
|
|
const initialWidth = block.width
|
|
|
const initialHeight = block.height
|
|
|
|
|
|
const moveHandler = (e: MouseEvent) => {
|
|
|
const rect = getContainerRect()
|
|
|
- const deltaX = e.clientX - startX
|
|
|
- const deltaY = e.clientY - startY
|
|
|
+ const deltaX = e.clientY - startX // 垂直方向变化
|
|
|
+ const deltaY = e.clientX - startY // 水平方向变化
|
|
|
// 限制最小尺寸和容器边界
|
|
|
- block.width = Math.max(50, Math.min(initialWidth + deltaX, rect.width - block.x))
|
|
|
- block.height = Math.max(50, Math.min(initialHeight + deltaY, rect.height - block.y))
|
|
|
+ block.width = Math.max(50, Math.min(initialWidth + deltaY, rect.width - block.y))
|
|
|
+ block.height = Math.max(50, Math.min(initialHeight + deltaX, rect.height - block.x))
|
|
|
}
|
|
|
|
|
|
const upHandler = () => {
|
|
@@ -452,11 +462,10 @@ const startResize = (block: BlockItem, e: MouseEvent) => {
|
|
|
selectedBlock.value = null
|
|
|
|
|
|
block.stopXx = block.startXx + block.width
|
|
|
- block.stopYy = block.startYy - block.height // 使用减号,与blockInputPressEnter中的逻辑保持一致
|
|
|
+ block.stopYy = block.startYy - block.height
|
|
|
|
|
|
document.removeEventListener('mousemove', moveHandler)
|
|
|
document.removeEventListener('mouseup', upHandler)
|
|
|
- // 使用手动更新函数而不是emit('update')
|
|
|
updateSubRegionsData()
|
|
|
}
|
|
|
|
|
@@ -464,39 +473,41 @@ const startResize = (block: BlockItem, e: MouseEvent) => {
|
|
|
document.addEventListener('mouseup', upHandler)
|
|
|
}
|
|
|
|
|
|
-// 修复输入框回车事件中的坐标计算
|
|
|
-const blockInputPressEnter = (e: Event, el: BlockItem, attr: string) => {
|
|
|
- if (!el) return
|
|
|
- if (attr === 'startXx') {
|
|
|
- el.startXx = Number(el[attr as keyof BlockItem])
|
|
|
- el.x = el.startXx + originX
|
|
|
- }
|
|
|
- if (attr === 'stopXx') {
|
|
|
- el.stopXx = Number(el[attr as keyof BlockItem])
|
|
|
- el.width = el.stopXx - el.startXx
|
|
|
- }
|
|
|
-
|
|
|
- if (attr === 'startYy') {
|
|
|
- el.startYy = Number(el[attr as keyof BlockItem])
|
|
|
- el.y = originY - el.startYy // 修复这里,之前错误地设置到了x坐标
|
|
|
- }
|
|
|
- if (attr === 'stopYy') {
|
|
|
- el.stopYy = Number(el[attr as keyof BlockItem])
|
|
|
- el.height = el.startYy - el.stopYy // 修复这里,与整体坐标系统保持一致
|
|
|
- }
|
|
|
-
|
|
|
- // 输入框修改后也调用手动更新函数
|
|
|
- updateSubRegionsData()
|
|
|
-}
|
|
|
-
|
|
|
-// 修复鼠标按下事件中的坐标计算
|
|
|
+// 输入框回车事件
|
|
|
+// const blockInputPressEnter = (e: Event, el: BlockItem, attr: string) => {
|
|
|
+// if (!el) return
|
|
|
+// // X范围(水平方向)对应y轴逻辑
|
|
|
+// if (attr === 'startXx') {
|
|
|
+// el.startXx = Number(el[attr as keyof BlockItem])
|
|
|
+// el.y = el.startXx + originX // y控制水平位置
|
|
|
+// }
|
|
|
+// if (attr === 'stopXx') {
|
|
|
+// el.stopXx = Number(el[attr as keyof BlockItem])
|
|
|
+// el.width = el.stopXx - el.startXx // 宽度由X范围决定
|
|
|
+// }
|
|
|
+
|
|
|
+// // Y范围(垂直方向,朝上为正)对应x轴逻辑
|
|
|
+// if (attr === 'startYy') {
|
|
|
+// el.startYy = Number(el[attr as keyof BlockItem])
|
|
|
+// el.x = originY - el.startYy // x控制垂直位置
|
|
|
+// }
|
|
|
+// if (attr === 'stopYy') {
|
|
|
+// el.stopYy = Number(el[attr as keyof BlockItem])
|
|
|
+// el.height = el.startYy - el.stopYy // 高度由Y范围决定(朝上为正,差值为正)
|
|
|
+// }
|
|
|
+
|
|
|
+// updateSubRegionsData()
|
|
|
+// }
|
|
|
+
|
|
|
+// 鼠标按下事件
|
|
|
const handleMouseDown = (e: MouseEvent) => {
|
|
|
if (!editable.value) return
|
|
|
if (!isCreating.value) return
|
|
|
|
|
|
const rect = getContainerRect()
|
|
|
- const startX = e.clientX - rect.left
|
|
|
- const startY = e.clientY - rect.top
|
|
|
+ // 交换x/y轴:startX 对应垂直方向(clientY),startY 对应水平方向(clientX)
|
|
|
+ const startX = e.clientY - rect.top // 垂直方向起点(x轴)
|
|
|
+ const startY = e.clientX - rect.left // 水平方向起点(y轴)
|
|
|
|
|
|
currentBlock.value = {
|
|
|
startX,
|
|
@@ -518,42 +529,44 @@ const selectBlock = (block: BlockItem) => {
|
|
|
}
|
|
|
|
|
|
// 关闭子区域属性
|
|
|
-const closeSubregionAttr = () => {
|
|
|
- blocks.value.forEach((item) => {
|
|
|
- item.isActice = false
|
|
|
- })
|
|
|
- selectedBlock.value = null
|
|
|
-}
|
|
|
-
|
|
|
-const blockInputBlur = (e: Event, el: BlockItem, attr: string) => {
|
|
|
- if (!el) return
|
|
|
- if (attr === 'startXx') {
|
|
|
- el.startXx = Number(el[attr as keyof BlockItem])
|
|
|
- el.x = el.startXx + originX
|
|
|
- }
|
|
|
- if (attr === 'stopXx') {
|
|
|
- el.stopXx = Number(el[attr as keyof BlockItem])
|
|
|
- el.width = el.stopXx - el.startXx
|
|
|
- }
|
|
|
-
|
|
|
- if (attr === 'startYy') {
|
|
|
- el.startYy = Number(el[attr as keyof BlockItem])
|
|
|
- el.x = el.startYy + originY
|
|
|
- }
|
|
|
- if (attr === 'stopYy') {
|
|
|
- el.stopYy = Number(el[attr as keyof BlockItem])
|
|
|
- el.height = el.stopYy - el.startYy
|
|
|
- }
|
|
|
- emit('update')
|
|
|
-}
|
|
|
-
|
|
|
-const deleteBlockArea = (id: string) => {
|
|
|
- if (id) {
|
|
|
- blocks.value = blocks.value.filter((item) => item.id !== id)
|
|
|
- selectedBlock.value = null
|
|
|
- emit('update')
|
|
|
- }
|
|
|
-}
|
|
|
+// const closeSubregionAttr = () => {
|
|
|
+// blocks.value.forEach((item) => {
|
|
|
+// item.isActice = false
|
|
|
+// })
|
|
|
+// selectedBlock.value = null
|
|
|
+// }
|
|
|
+
|
|
|
+// const blockInputBlur = (e: Event, el: BlockItem, attr: string) => {
|
|
|
+// if (!el) return
|
|
|
+// // X范围(水平方向)
|
|
|
+// if (attr === 'startXx') {
|
|
|
+// el.startXx = Number(el[attr as keyof BlockItem])
|
|
|
+// el.y = el.startXx + originX
|
|
|
+// }
|
|
|
+// if (attr === 'stopXx') {
|
|
|
+// el.stopXx = Number(el[attr as keyof BlockItem])
|
|
|
+// el.width = el.stopXx - el.startXx
|
|
|
+// }
|
|
|
+
|
|
|
+// // Y范围(垂直方向)
|
|
|
+// if (attr === 'startYy') {
|
|
|
+// el.startYy = Number(el[attr as keyof BlockItem])
|
|
|
+// el.x = originY - el.startYy
|
|
|
+// }
|
|
|
+// if (attr === 'stopYy') {
|
|
|
+// el.stopYy = Number(el[attr as keyof BlockItem])
|
|
|
+// el.height = el.startYy - el.stopYy
|
|
|
+// }
|
|
|
+// updateSubRegionsData()
|
|
|
+// }
|
|
|
+
|
|
|
+// const deleteBlockArea = (id: string) => {
|
|
|
+// if (id) {
|
|
|
+// blocks.value = blocks.value.filter((item) => item.id !== id)
|
|
|
+// selectedBlock.value = null
|
|
|
+// updateSubRegionsData()
|
|
|
+// }
|
|
|
+// }
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="less">
|