|
|
@@ -609,19 +609,21 @@ const handleDragOver = (e) => {
|
|
|
const handleDrop = async (e) => {
|
|
|
if (!draggedPhoto.value || !editor.value) return;
|
|
|
const check = await editor.value.checkIndexing();
|
|
|
-
|
|
|
// 获取拖拽到的页面和位置
|
|
|
const position = editor.value.getPhotoPositionInPage(e);
|
|
|
const { pageIndex, itemIndex } = position;
|
|
|
console.log("getPhotoPositionInPage", position, );
|
|
|
|
|
|
if (pageIndex === -1 || itemIndex === -1) return;
|
|
|
-
|
|
|
+
|
|
|
+ console.log("handleDrop", pages);
|
|
|
// 更新页面数据
|
|
|
const newPages = [...pages.value];
|
|
|
// 确保页面数组存在
|
|
|
+ console.log("handleDrop", newPages);
|
|
|
if (!newPages[pageIndex]) newPages[pageIndex] = [];
|
|
|
// 确保位置足够
|
|
|
+ console.log("handleDrop", newPages[pageIndex], itemIndex);
|
|
|
while (newPages[pageIndex].list.length <= itemIndex) {
|
|
|
newPages[pageIndex].list.push("");
|
|
|
}
|