From 780a40caae3cabd9ceea347ae796ccfda9e9b3ef Mon Sep 17 00:00:00 2001 From: Hufe921 Date: Mon, 13 Mar 2023 21:48:48 +0800 Subject: [PATCH] feat:drag and drop date element --- src/editor/core/event/handlers/mouseup.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/editor/core/event/handlers/mouseup.ts b/src/editor/core/event/handlers/mouseup.ts index 4f20dab..a55b460 100644 --- a/src/editor/core/event/handlers/mouseup.ts +++ b/src/editor/core/event/handlers/mouseup.ts @@ -31,10 +31,7 @@ export function mouseup(evt: MouseEvent, host: CanvasEvent) { const range = rangeManager.getRange() // 是否是不可拖拽的控件结构元素 const dragElementList = cacheElementList.slice(cacheRange.startIndex + 1, cacheRange.endIndex + 1) - const isContainControl = dragElementList.find(element => - element.type === ElementType.CONTROL || - element.type === ElementType.DATE - ) + const isContainControl = dragElementList.find(element => element.type === ElementType.CONTROL) if (isContainControl) { // 仅允许 (最前/后元素不是控件 || 在控件前后 || 文本控件且是值) 拖拽 const cacheStartElement = cacheElementList[cacheRange.startIndex + 1] @@ -48,9 +45,7 @@ export function mouseup(evt: MouseEvent, host: CanvasEvent) { ( cacheEndElement.type !== ElementType.CONTROL || cacheEndElement.controlComponent === ControlComponent.POSTFIX - ) && - cacheStartElement.type !== ElementType.DATE && - cacheEndElement.type !== ElementType.DATE + ) ) || ( cacheStartElement.controlId === cacheEndElement.controlId &&