|
@@ -297,12 +297,19 @@ export function useMenu() {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (siblingIds.length <= 1) return;
|
|
|
|
|
|
|
+ console.log("[menu-sort] draggedData.parentId:", parentId, "type:", typeof parentId);
|
|
|
|
|
+ console.log("[menu-sort] siblingIds:", siblingIds, "count:", siblingIds.length);
|
|
|
|
|
+
|
|
|
|
|
+ if (siblingIds.length <= 1) {
|
|
|
|
|
+ console.log("[menu-sort] 同级兄弟不足2个,跳过排序");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
const sortData = siblingIds.map((id, index) => ({
|
|
const sortData = siblingIds.map((id, index) => ({
|
|
|
id,
|
|
id,
|
|
|
rank: index + 1
|
|
rank: index + 1
|
|
|
}));
|
|
}));
|
|
|
|
|
+ console.log("[menu-sort] sortData:", sortData);
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
await updateMenuSort(sortData);
|
|
await updateMenuSort(sortData);
|