@@ -258,12 +259,12 @@
class="draggable-group"
ghostClass="dragClass"
:group="{ name: 'people', pull: false, put: true }"
- itemKey="name"
+ itemKey="_bindingKey"
>
{{ index + 1 }} 、{{ element.name }}
-
+
@@ -395,6 +396,9 @@ const { queryParams, form, rules, paramsFormList } = toRefs(data);
const taskLeftList = ref([]);
const taskRightList = ref([]);
+let bindingSequence = 0;
+const createBindingKey = () => `item-${Date.now()}-${bindingSequence++}`;
+const cloneBindingItem = (item) => ({ ...item, _bindingKey: createBindingKey() });
/** 查询任务流程编排列表 */
function getList() {
@@ -537,17 +541,9 @@ const getLiftTaskList = () => {
return {
name: item.detectName,
id: item.id,
+ _bindingKey: createBindingKey(),
};
}) || [];
- // if (taskRightList.value.length === 0) {
- // taskLeftList.value = tempLeftData;
- // return;
- // }
- // taskLeftList.value = tempLeftData.filter((item) => {
- // return !taskRightList.value.some((item2) => {
- // return item.id === item2.id;
- // });
- // });
taskLeftList.value = tempLeftData;
});
};
@@ -559,6 +555,7 @@ const getRightTaskList = () => {
return {
name: item.itemName,
id: item.itemId,
+ _bindingKey: createBindingKey(),
};
}) || [];
getLiftTaskList();
@@ -618,9 +615,8 @@ function handleGetSystemGroup(row) {
});
}
-const removeFromB = (id) => {
- const index = taskRightList.value.findIndex(item => item.id === id)
- if (index !== -1) taskRightList.value.splice(index, 1)
+const removeFromB = (index) => {
+ taskRightList.value.splice(index, 1)
}
onMounted(() => {