mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-05 05:29:29 +08:00
fix(测试计划): 修复测试计划组内拖拽失效&防止只有一个时参数报错
This commit is contained in:
parent
697d0d47c6
commit
8e958e5128
@ -142,8 +142,6 @@ export default function useModuleSelections<T>(
|
||||
// 更新选择数据
|
||||
function updateSelectModule(moduleId: string, id: string) {
|
||||
const selectedProps = innerSelectedModulesMaps[moduleId];
|
||||
console.log(222);
|
||||
|
||||
if (selectedProps) {
|
||||
const selectedSet = selectedProps.selectIds;
|
||||
const excludedSet = selectedProps.excludeIds;
|
||||
|
@ -655,7 +655,6 @@
|
||||
newIndex = newDragData.findIndex((item: any) => item[rowKey || 'id'] === extra.dragTarget?.[rowKey || 'id']);
|
||||
oldIndex = oldDragData.findIndex((item: any) => item[rowKey || 'id'] === extra.dragTarget?.[rowKey || 'id']);
|
||||
let position: 'AFTER' | 'BEFORE' = 'BEFORE';
|
||||
|
||||
position = newIndex > oldIndex ? 'AFTER' : 'BEFORE';
|
||||
const params: DragSortParams = {
|
||||
projectId: appStore.currentProjectId,
|
||||
@ -677,9 +676,8 @@
|
||||
targetIndex = newIndex - 1;
|
||||
}
|
||||
params.targetId = newDragData[targetIndex]?.[rowKey || 'id'] ?? newDragData[newIndex]?.[rowKey || 'id'];
|
||||
|
||||
if (oldIndex !== newIndex) {
|
||||
// 原地移动不触发
|
||||
// 只有一个的时候不允许拖拽放置参数报错
|
||||
if (newDragData.length > 1) {
|
||||
emit('dragChange', params);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user