From 80342c08624a0b9343bcd707a673934678ca5dcc Mon Sep 17 00:00:00 2001 From: zhangsir Date: Sat, 26 Oct 2024 15:34:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=B9=E8=AE=AD=E5=8F=91=E7=94=9F=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E5=9F=BA=E6=9C=AC=E8=81=94=E8=B0=83=E5=AE=8C=E6=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/Lecturer.js | 4 + src/components/project/AddOrgContent.vue | 17 +- .../project/ProjectManagerLecturer.vue | 3 + src/components/project/lockLecturer.vue | 251 ++++++++++++++++++ src/views/lecturer/Organization.vue | 193 +++++++++----- 5 files changed, 398 insertions(+), 70 deletions(-) create mode 100644 src/components/project/lockLecturer.vue 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 993dc3c6..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 || '-' }})
+
@@ -104,7 +104,7 @@ import * as lecturerApi from "@/api/Lecturer.js"; }else{ console.log(props.AddContentList,'xixiixix') treeAddData.value = props?.AddContentList - checkedKeys.value = props?.AddContentList?.map(item=>item.id) + checkedKeys.value = props?.AddContentList?.map(item=>item.orgId) } }); const onCheck = (checkedKeys, {checked: bool, checkedNodes, node, event}) => { @@ -119,15 +119,24 @@ 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); 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 2db21cf5..2538a883 100644 --- a/src/views/lecturer/Organization.vue +++ b/src/views/lecturer/Organization.vue @@ -22,11 +22,13 @@ + @expand="expandTable" :pagination="false">