diff --git a/src/api/Lecturer.js b/src/api/Lecturer.js index c7237da4..02a82d54 100644 --- a/src/api/Lecturer.js +++ b/src/api/Lecturer.js @@ -50,4 +50,8 @@ export const getTeacherByNameOrUserNo = (obj) => http.get(`/admin/thirdApi/user/ //根据userid获取讲师体系信息 export const getSystemInfoByUserId = (id) => http.get(`/admin/system/getSystemInfoByUserId?id=${id}`) //讲师搜索 -export const getUserList = (keyword) => http.get(`/admin/thirdApi/user/list?pageNo=${1}&pageSize=${30}&keyword=${keyword}`) \ No newline at end of file +export const getUserList = (keyword) => http.get(`/admin/thirdApi/user/list?pageNo=${1}&pageSize=${30}&keyword=${keyword}`) +//查询弹框选择的组织信息 +export const getSelectOrg = (id) => http.get(`/admin/affiliation/getSelectOrg?id=${id}`) +//查询弹框不可选择组织(审核中的组织) +export const getUnSelectOrg = () => http.get(`/admin/affiliation/getUnSelectOrg`) \ No newline at end of file diff --git a/src/components/project/AddOrgContent.vue b/src/components/project/AddOrgContent.vue index 045cdacd..e057fc66 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?.name }} - (原:{{ item?.orgName || '-' }})
+
@@ -64,6 +64,7 @@ import { useStore } from "vuex"; import { ORG_CHILD_LIST, ORG_LIST} from "@/api/apis"; import { defineProps,defineEmits } from "vue"; import { request, useRequest} from "@/api/request"; +import * as lecturerApi from "@/api/Lecturer.js"; const props = defineProps({ showContent: { type: Boolean, @@ -87,6 +88,8 @@ import { request, useRequest} from "@/api/request"; function onLoadData(treeNode) { return request(ORG_CHILD_LIST, { keyword: "", orgId: treeNode.id }).then( (r) => { + //等待接口联调 + // lecturerApi.getUnSelectOrg().then(res=>{}) // r.data.map(item=>item.disabled = true) treeNode.dataRef.treeChildList = r.data; treeData.value = [...treeData.value]; @@ -101,6 +104,18 @@ import { request, useRequest} from "@/api/request"; } }); const onCheck = (checkedKeys, {checked: bool, checkedNodes, node, event}) => { + console.log(checkedKeys.value,'选中的id值') + // "965356037047586816" + let length = treeAddData.value.length + if(checkedNodes.length > length){ + lecturerApi.getSelectOrg(node.id).then(res=>{ + console.log(res,'ressssss') + const targetNode = checkedNodes.find(item=>item.id === res?.data[0]?.orgId) + if(targetNode){ + Object.assign(targetNode,res.data[0]); + } + }) + } treeAddData.value = checkedNodes; } const clearTree = () => { @@ -212,6 +227,12 @@ import { request, useRequest} from "@/api/request"; display: flex; justify-content: space-between; align-items: center; + .tag_text{ + max-width: 240px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } .tag_delete{ display: none; color: #4ea6ff;