暂时搁置

This commit is contained in:
zhangsir
2024-10-25 16:46:50 +08:00
parent 01e569ead6
commit 53c7ba8f7c
2 changed files with 27 additions and 2 deletions

View File

@@ -51,3 +51,7 @@ export const getTeacherByNameOrUserNo = (obj) => http.get(`/admin/thirdApi/user/
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}`)
//查询弹框选择的组织信息
export const getSelectOrg = (id) => http.get(`/admin/affiliation/getSelectOrg?id=${id}`)
//查询弹框不可选择组织(审核中的组织)
export const getUnSelectOrg = () => http.get(`/admin/affiliation/getUnSelectOrg`)

View File

@@ -42,7 +42,7 @@
v-for="(item, index) in treeAddData"
:key="index"
>
<div>{{ item?.name }}</div>
<div class="tag_text" :title="`${item?.name} - (原:${item?.orgName || '-'})`">{{ item?.name }} - ({{ item?.orgName || '-' }})</div>
<div @click="deleteTree(item)" class="tag_delete">+</div>
</div>
</div>
@@ -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;