讲师管理bug

This commit is contained in:
zhangsir
2025-01-08 11:50:21 +08:00
parent 245a3a763d
commit cad23a1599
7 changed files with 92 additions and 16 deletions

View File

@@ -77,6 +77,10 @@ import * as lecturerApi from "@/api/Lecturer.js";
AddContentList:{
type:Array,
default: ()=>[],
},
isParent:{
type:String,
default: '',
}
})
const emit = defineEmits({})
@@ -119,7 +123,7 @@ import * as lecturerApi from "@/api/Lecturer.js";
});
const notLists = ref([])
const getNot = () => {
lecturerApi.getUnSelectOrg().then(res=>{
lecturerApi.getUnSelectOrg(props.isParent).then(res=>{
if(res.data.code == 200){
notLists.value = res.data.data
}
@@ -144,7 +148,10 @@ import * as lecturerApi from "@/api/Lecturer.js";
const onCheck = async (checkedKey, {checked: bool, checkedNodes, node, event}) => {
// "965356037047586816"
let length = treeAddData.value.length
if(checkedNodes.length > length){
const checkedNodeIds = checkedNodes.map(item => item.id);
const treeAddDataOrgIds = treeAddData.value.map(item => item.orgId);
const combinedUniqueIds = [...new Set([...checkedNodeIds, ...treeAddDataOrgIds])];
if(combinedUniqueIds.length > length){
await lecturerApi.getSelectOrg(node.id).then(res=>{
const targetNode = checkedNodes.find(item=>item.id == res?.data?.data[0]?.orgId)
if(targetNode){