mirror of
https://github.com/fanchenio/DawnLauncher.git
synced 2025-07-13 21:02:10 +08:00
修复项目在自定义排序拖拽移动项目问题。
This commit is contained in:
parent
018bd91931
commit
d51a5404ee
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user