diff --git a/src/api/Lecturer.js b/src/api/Lecturer.js index f9480722..b9d872d0 100644 --- a/src/api/Lecturer.js +++ b/src/api/Lecturer.js @@ -57,3 +57,7 @@ export const getSelectOrg = (id) => http.get(`/admin/affiliation/getSelectOrg?id export const getUnSelectOrg = () => http.get(`/admin/affiliation/getUnSelectOrg`) //获取培训发生组织编号 export const getAffiliationCode = () => http.get('/admin/affiliation/getAffiliationCode') +//查看或编辑回显培训发生组织 +export const getAffiliationById = (id) => http.get(`/admin/affiliation/queryById?id=${id}`) +//删除培训发生组织 +export const affiliationDelById = (id)=>http.post(`/admin/affiliation/delById?id=${id}`) \ No newline at end of file diff --git a/src/components/project/AddOrgContent.vue b/src/components/project/AddOrgContent.vue index e057fc66..fceb11e5 100644 --- a/src/components/project/AddOrgContent.vue +++ b/src/components/project/AddOrgContent.vue @@ -42,7 +42,7 @@ v-for="(item, index) in treeAddData" :key="index" > -
{{ item?.name }} - (原:{{ item?.orgName || '-' }})
+
{{ item?.orgName }} - (原:{{ item?.updateName || '-' }})
+
@@ -101,10 +101,13 @@ import * as lecturerApi from "@/api/Lecturer.js"; expandedKeys.value = [] selectedKeys.value = [] checkedKeys.value = [] + }else{ + console.log(props.AddContentList,'xixiixix') + treeAddData.value = props?.AddContentList + checkedKeys.value = props?.AddContentList?.map(item=>item.orgId) } }); const onCheck = (checkedKeys, {checked: bool, checkedNodes, node, event}) => { - console.log(checkedKeys.value,'选中的id值') // "965356037047586816" let length = treeAddData.value.length if(checkedNodes.length > length){ @@ -116,22 +119,31 @@ import * as lecturerApi from "@/api/Lecturer.js"; } }) } + checkedNodes = checkedNodes.map(item=>{ + return { + orgId: item.id, + orgName: item.name, + affiliationId: item.id, + ...item + } + }) treeAddData.value = checkedNodes; + console.log(treeAddData.value,'checkedNodes') } const clearTree = () => { treeAddData.value = []; checkedKeys.value = []; } const deleteTree = (item) => { - treeAddData.value = treeAddData.value.filter(node => node.id !== item.id); - checkedKeys.value = treeAddData.value.map(item=>item.id) + treeAddData.value = treeAddData.value.filter(node => node.orgId !== item.orgId); + checkedKeys.value = treeAddData.value.map(item=>item.orgId) } const closeCodeModal = () => { emit("update:showContent", false); clearTree() }; const queryCreate = () => { - emit("AddContentList", treeAddData.value); + emit("update:AddContentList", treeAddData.value); closeCodeModal() } const expandedKeys = ref([]); diff --git a/src/components/project/ProjectManagerLecturer.vue b/src/components/project/ProjectManagerLecturer.vue index 960aca86..eae285a3 100644 --- a/src/components/project/ProjectManagerLecturer.vue +++ b/src/components/project/ProjectManagerLecturer.vue @@ -57,6 +57,9 @@ onMounted(()=>{ managerArray.value = props.arrayList options.value = props.arrayList }) +watch(()=>props.arrayList, ()=>{ + managerArray.value = props.arrayList +}) const options = ref([]) const getList = () => { getUserList(keyword.value).then(res=>{ diff --git a/src/components/project/lockLecturer.vue b/src/components/project/lockLecturer.vue new file mode 100644 index 00000000..5aaf86b7 --- /dev/null +++ b/src/components/project/lockLecturer.vue @@ -0,0 +1,251 @@ + + + + + diff --git a/src/views/lecturer/Organization.vue b/src/views/lecturer/Organization.vue index b9d7ff74..2538a883 100644 --- a/src/views/lecturer/Organization.vue +++ b/src/views/lecturer/Organization.vue @@ -22,11 +22,13 @@ + @expand="expandTable" :pagination="false">