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

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