🎨 数据库分组划选

This commit is contained in:
Vanessa 2025-08-13 12:08:46 +08:00
parent 8d1693bd9b
commit de670dfa8a

View file

@ -810,6 +810,7 @@ export class WYSIWYG {
let lastCellElement: HTMLElement;
const nodeRect = nodeElement.getBoundingClientRect();
const scrollElement = nodeElement.querySelector(".av__scroll");
const bodyElement = hasClosestByClassName(avCellElement, "av__body") as HTMLElement;
documentSelf.onmousemove = (moveEvent: MouseEvent) => {
const tempCellElement = hasClosestByClassName(moveEvent.target as HTMLElement, "av__cell") as HTMLElement;
if (scrollElement.scrollWidth > scrollElement.clientWidth + 2) {
@ -824,7 +825,8 @@ export class WYSIWYG {
protyle.contentElement.scrollTop += 5;
}
}
if (moveSelectCellElement && tempCellElement && tempCellElement === moveSelectCellElement) {
if (bodyElement !== hasClosestByClassName(tempCellElement, "av__body") ||
(moveSelectCellElement && tempCellElement && tempCellElement === moveSelectCellElement)) {
return;
}
if (tempCellElement && tempCellElement.dataset.id && (event.clientX !== moveEvent.clientX || event.clientY !== moveEvent.clientY)) {
@ -832,7 +834,7 @@ export class WYSIWYG {
nodeElement.querySelectorAll(".av__cell--active").forEach((item: HTMLElement) => {
item.classList.remove("av__cell--active");
});
nodeElement.querySelectorAll(".av__row").forEach((rowElement: HTMLElement, index: number) => {
bodyElement.querySelectorAll(".av__row").forEach((rowElement: HTMLElement, index: number) => {
if (index >= Math.min(originIndex.rowIndex, newIndex.rowIndex) && index <= Math.max(originIndex.rowIndex, newIndex.rowIndex)) {
rowElement.querySelectorAll(".av__cell").forEach((cellElement: HTMLElement, cellIndex: number) => {
if (cellIndex >= Math.min(originIndex.celIndex, newIndex.celIndex) && cellIndex <= Math.max(originIndex.celIndex, newIndex.celIndex)) {