修复项目在自定义排序拖拽移动项目问题。

This commit is contained in:
unknown 2025-01-12 12:06:26 +08:00
parent 018bd91931
commit d51a5404ee

View File

@ -130,6 +130,7 @@ import {
setItemWidth, setItemWidth,
run, run,
removeInvalidItem, removeInvalidItem,
showItemList,
} from "../js"; } from "../js";
import ItemList from "./List.vue"; import ItemList from "./List.vue";
import { Item } from "../../../../types/item"; import { Item } from "../../../../types/item";
@ -315,12 +316,21 @@ function createItemSortable() {
let fromClassificationId = parseInt( let fromClassificationId = parseInt(
event.from.getAttribute("classification-id")! event.from.getAttribute("classification-id")!
); );
// let fromClassification =
const currentItem = getClassificationById(fromClassificationId);
getItemListByClassificationId(fromClassificationId)[ if (fromClassification) {
event.oldIndex let itemList =
]; getItemListByClassificationId(fromClassificationId);
fromIdList.push(currentItem.id); if (itemList) {
let copyItemList = JSON.parse(JSON.stringify(itemList));
//
const currentItem = showItemList(
copyItemList,
fromClassification
)[event.oldIndex];
fromIdList.push(currentItem.id);
}
}
} else { } else {
// //
for (const value of store.itemBatchOperationDataArray) { for (const value of store.itemBatchOperationDataArray) {