feat:drag and drop date element
This commit is contained in:
@@ -31,10 +31,7 @@ export function mouseup(evt: MouseEvent, host: CanvasEvent) {
|
|||||||
const range = rangeManager.getRange()
|
const range = rangeManager.getRange()
|
||||||
// 是否是不可拖拽的控件结构元素
|
// 是否是不可拖拽的控件结构元素
|
||||||
const dragElementList = cacheElementList.slice(cacheRange.startIndex + 1, cacheRange.endIndex + 1)
|
const dragElementList = cacheElementList.slice(cacheRange.startIndex + 1, cacheRange.endIndex + 1)
|
||||||
const isContainControl = dragElementList.find(element =>
|
const isContainControl = dragElementList.find(element => element.type === ElementType.CONTROL)
|
||||||
element.type === ElementType.CONTROL ||
|
|
||||||
element.type === ElementType.DATE
|
|
||||||
)
|
|
||||||
if (isContainControl) {
|
if (isContainControl) {
|
||||||
// 仅允许 (最前/后元素不是控件 || 在控件前后 || 文本控件且是值) 拖拽
|
// 仅允许 (最前/后元素不是控件 || 在控件前后 || 文本控件且是值) 拖拽
|
||||||
const cacheStartElement = cacheElementList[cacheRange.startIndex + 1]
|
const cacheStartElement = cacheElementList[cacheRange.startIndex + 1]
|
||||||
@@ -48,9 +45,7 @@ export function mouseup(evt: MouseEvent, host: CanvasEvent) {
|
|||||||
(
|
(
|
||||||
cacheEndElement.type !== ElementType.CONTROL ||
|
cacheEndElement.type !== ElementType.CONTROL ||
|
||||||
cacheEndElement.controlComponent === ControlComponent.POSTFIX
|
cacheEndElement.controlComponent === ControlComponent.POSTFIX
|
||||||
) &&
|
)
|
||||||
cacheStartElement.type !== ElementType.DATE &&
|
|
||||||
cacheEndElement.type !== ElementType.DATE
|
|
||||||
) ||
|
) ||
|
||||||
(
|
(
|
||||||
cacheStartElement.controlId === cacheEndElement.controlId &&
|
cacheStartElement.controlId === cacheEndElement.controlId &&
|
||||||
|
|||||||
Reference in New Issue
Block a user