mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-17 14:56:46 +08:00
讲师管理bug
This commit is contained in:
@@ -141,7 +141,7 @@ import * as lecturerApi from "@/api/Lecturer.js";
|
||||
})
|
||||
}
|
||||
const orgLists = ref([])
|
||||
const onCheck = async (checkedKeys, {checked: bool, checkedNodes, node, event}) => {
|
||||
const onCheck = async (checkedKey, {checked: bool, checkedNodes, node, event}) => {
|
||||
// "965356037047586816"
|
||||
let length = treeAddData.value.length
|
||||
if(checkedNodes.length > length){
|
||||
@@ -154,7 +154,7 @@ import * as lecturerApi from "@/api/Lecturer.js";
|
||||
message.error('获取被占用组织失败,请重新尝试')
|
||||
})
|
||||
}
|
||||
treeAddData.value = checkedNodes.map(item => {
|
||||
const checkLists = checkedNodes.map(item => {
|
||||
if (!item || !item.id) {
|
||||
return item;
|
||||
}
|
||||
@@ -176,6 +176,14 @@ import * as lecturerApi from "@/api/Lecturer.js";
|
||||
return item;
|
||||
}
|
||||
});
|
||||
const endLists = [...checkLists,...orgLists.value]
|
||||
const seen = new Set();
|
||||
const uniqueEndLists = endLists.filter(item => {
|
||||
const isDuplicate = seen.has(item.orgId);
|
||||
seen.add(item.orgId);
|
||||
return !isDuplicate;
|
||||
});
|
||||
treeAddData.value = uniqueEndLists?.filter(item => checkedKeys.value?.checked?.includes(item.orgId));
|
||||
// treeAddData.value = checkedNodes;
|
||||
console.log(treeAddData.value,'checkedNodes',orgLists.value)
|
||||
}
|
||||
@@ -193,6 +201,13 @@ import * as lecturerApi from "@/api/Lecturer.js";
|
||||
clearTree()
|
||||
};
|
||||
const queryCreate = () => {
|
||||
treeAddData.value?.map(item=>{
|
||||
props?.AddContentList?.map(i=>{
|
||||
if(item.orgId === i.orgId){
|
||||
item.affiliationOrgId = i.affiliationOrgId
|
||||
}
|
||||
})
|
||||
})
|
||||
emit("update:AddContentList", treeAddData.value);
|
||||
closeCodeModal()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user