feat:接入添加小组成员数据

This commit is contained in:
lixg
2023-02-14 01:18:10 +08:00
parent e1a45d38e1
commit 1fcd299abc
5 changed files with 473 additions and 234 deletions

View File

@@ -2,7 +2,7 @@
* @Author: lixg lixg@dongwu-inc.com * @Author: lixg lixg@dongwu-inc.com
* @Date: 2022-11-04 22:45:31 * @Date: 2022-11-04 22:45:31
* @LastEditors: lixg lixg@dongwu-inc.com * @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2023-02-11 16:22:43 * @LastEditTime: 2023-02-13 23:09:53
* @FilePath: /fe-manage/src/api/index1.js * @FilePath: /fe-manage/src/api/index1.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
@@ -65,7 +65,7 @@ export const setConfig = (obj) => http.post("/admin/router/setConfig", obj);
//获取学员列表 //获取学员列表
export const getStudent = (obj) => http.post("/admin/router/studentList", obj); export const getStudent = (obj) => http.post("/admin/router/studentList", obj);
//获取路径图详情-包含关卡及任务列表 //获取路径图详情-包含关卡及任务列表
export const getRouterDetail = (routerId,useTask) => export const getRouterDetail = (routerId, useTask) =>
http.get("/admin/router/detail", { http.get("/admin/router/detail", {
params: { params: {
routerId: routerId, routerId: routerId,
@@ -225,3 +225,11 @@ export const ImportExternalExamScore = (obj) => http.post('/admin/external/exam/
export const changeGroupByStudentId = (obj) => http.post('/admin/student/changeGroupByStudentId', obj) export const changeGroupByStudentId = (obj) => http.post('/admin/student/changeGroupByStudentId', obj)
//导入小组 //导入小组
export const importGroup = (uuid) => http.post('/admin/studentGroup/importGroup/{pid}', { params: { uuid: uuid } }) export const importGroup = (uuid) => http.post('/admin/studentGroup/importGroup/{pid}', { params: { uuid: uuid } })
//添加小组学员
export const addGroupMember = (obj) => http.post('/admin/studentGroup/addGroupMember', obj)
//获取小组成员
export const groupMemberList = (obj) => http.post('/admin/studentGroup/groupMemberList', obj)
//删除小组成员
export const delGroupStudent = (obj) => http.post('/admin/studentGroup/delStudent', obj)
//随机分组
export const randomGroup = (obj, projectId) => http.post(`/admin/studentGroup/randomGroup/${projectId}`, obj)

View File

@@ -38,10 +38,33 @@
</div> </div>
</div> </div>
<div class="btnss" style="margin-top: 20px"> <div class="btnss" style="margin-top: 20px">
<div class="btn btn1" @click="showStuAdd" style="margin-right: 20px"> <!-- <div
class="btn btn1"
@click="showStuAdd"
style="margin-right: 20px; color: #fff"
>
<div class="img1"></div> <div class="img1"></div>
<div class="wz">添加组员</div> <div class="wz">添加组员</div>
</div> </div> -->
<CommonStudent
:type="1"
title="添加组员"
@finash="submitCall"
:isGroup="true"
:id="projectId"
:groupId="chooseGroupId"
:groupName="chooseGroupName"
>
<a-button class="cus-btn" style="background: #4ea6ff; color: #fff">
<template #icon
><img
style="margin-right: 10px"
src="../../assets/images/courseManage/add0.png"
/></template>
添加组员
</a-button></CommonStudent
>
<div class="btn btn2" @click="showModal"> <div class="btn btn2" @click="showModal">
<div class="img3"></div> <div class="img3"></div>
<div class="wz">批量删除</div> <div class="wz">批量删除</div>
@@ -148,32 +171,31 @@
</div> </div>
</a-modal> </a-modal>
<!-- <stu-add v-model:Stuvisible="Stuvisible" /> --> <!-- <stu-add v-model:Stuvisible="Stuvisible" /> -->
<add-group-members <!-- <add-group-members
v-model:AGMembers="Stuvisible" v-model:AGMembers="Stuvisible"
:chooseGroupId="chooseGroupId" :chooseGroupId="chooseGroupId"
:projectId="projectId" :projectId="projectId"
@getStuPro="getStu" @getStuPro="getStu"
/> /> -->
</div> </div>
</a-drawer> </a-drawer>
</template> </template>
<script> <script>
import { toRefs, reactive } from "vue"; import { toRefs, reactive, watch } from "vue";
// import StuAdd from "./StuAdd.vue"; // import StuAdd from "./StuAdd.vue";
import { // import { getProjStu } from "../../api/indexProjStu";
// getProjStu, import { groupMemberList, delGroupStudent } from "@/api/index1";
removeGroupStudent,
groupMemberList,
} from "../../api/indexProjStu";
import { toDate } from "../../api/method"; import { toDate } from "../../api/method";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import AddGroupMembers from "./AddGroupMembers.vue"; // import AddGroupMembers from "./AddGroupMembers.vue";
import CommonStudent from "@/components/student/CommonStudent";
export default { export default {
name: "MemberList", name: "MemberList",
components: { components: {
// StuAdd, // StuAdd,
AddGroupMembers, // AddGroupMembers,
CommonStudent,
}, },
props: { props: {
Lvisible: { Lvisible: {
@@ -184,6 +206,10 @@ export default {
type: Number, type: Number,
default: null, default: null,
}, },
chooseGroupName: {
type: String,
default: null,
},
projectId: { projectId: {
type: Number, type: Number,
default: null, default: null,
@@ -224,7 +250,7 @@ export default {
dataIndex: "name", dataIndex: "name",
key: "name", key: "name",
width: 40, width: 40,
align: "left", align: "center",
className: "h head", className: "h head",
}, },
{ {
@@ -272,6 +298,8 @@ export default {
}, },
}, },
], ],
addAuthList: [], //学员
authClassify: 3,
}); });
const closeDrawer = () => { const closeDrawer = () => {
ctx.emit("update:Lvisible", false); ctx.emit("update:Lvisible", false);
@@ -295,7 +323,7 @@ export default {
studentIds: state.selectedRows, studentIds: state.selectedRows,
}; };
removeGroupStudent(obj) delGroupStudent(obj)
.then((res) => { .then((res) => {
console.log(res, "删除成功"); console.log(res, "删除成功");
message.success("删除成功"); message.success("删除成功");
@@ -329,9 +357,9 @@ export default {
group: value.groupName, //小组名 group: value.groupName, //小组名
studentId: value.studentId, //学生id studentId: value.studentId, //学生id
currentStageId: value.currentStageId, //当前关卡id currentStageId: value.currentStageId, //当前关卡id
name: value.name, //用户名 name: value.studentName, //用户名
bum: value.userInfoBo.deptName, //部门 bum: value.studentDepartName, //部门
gangw: value.userInfoBo.jobName, //岗位 gangw: value.studentJobName, //岗位
completeStageCnt: value.completeStageCnt, //当前完成阶段数 completeStageCnt: value.completeStageCnt, //当前完成阶段数
totalStageCnt: value.totalStageCnt, //总阶段数 totalStageCnt: value.totalStageCnt, //总阶段数
progress: value.completeStageCnt + "/" + value.totalStageCnt, progress: value.completeStageCnt + "/" + value.totalStageCnt,
@@ -344,8 +372,9 @@ export default {
}; };
//获取组员列表 //获取组员列表
const getStu = (obj) => { const getStu = (obj) => {
console.log("获取学员");
let objf = obj || { let objf = obj || {
studentName: "", studentName: state.name,
pageNo: state.currentPage, pageNo: state.currentPage,
pageSize: 10, pageSize: 10,
pid: props.projectId, pid: props.projectId,
@@ -357,7 +386,8 @@ export default {
if (res.data.code === 200) { if (res.data.code === 200) {
state.total = res.data.data.total; state.total = res.data.data.total;
state.tableDataTotal = res.data.data.total; state.tableDataTotal = res.data.data.total;
let arr = res.data.data.rows; let arr = res.data.data.records;
console.log("获取小组学员", arr);
getTableDataList(arr); getTableDataList(arr);
} }
// let leng = res.data.data.rows.length; // let leng = res.data.data.rows.length;
@@ -410,33 +440,31 @@ export default {
}; };
//学员搜索 //学员搜索
const searchStu = () => { const searchStu = () => {
let obj = { // let obj = {
deptIds: [], //部门 // studentName: state.name,
groupName: "", // pageNo: state.currentPage,
name: state.name, // pageSize: 10,
pageNo: state.currentPage, // pid: props.projectId,
pageSize: 10, // groupId: props.chooseGroupId, //暂时写死
projectId: props.projectId, // };
topFlag: "",
};
//重新获取列表 //重新获取列表
getStu(obj); getStu();
}; };
//重置 //重置
const resetSearch = () => { const resetSearch = () => {
state.name = null; state.name = null;
let obj = { // let obj = {
deptIds: [], //部门 // deptIds: [], //部门
groupName: "", // groupName: "",
name: "", // name: "",
pageNo: 1, // pageNo: 1,
pageSize: 10, // pageSize: 10,
projectId: props.projectId, // projectId: props.projectId,
groupId: props.chooseGroupId, // groupId: props.chooseGroupId,
topFlag: "", // topFlag: "",
}; // };
//重新获取列表 //重新获取列表
getStu(obj); getStu();
}; };
const deleteOne = (id) => { const deleteOne = (id) => {
// console.log(id, "fewfew"); // console.log(id, "fewfew");
@@ -459,7 +487,7 @@ export default {
studentIds: state.selectedRows, studentIds: state.selectedRows,
}; };
console.log("删除小组学员obj", obj); console.log("删除小组学员obj", obj);
removeGroupStudent(obj) delGroupStudent(obj)
.then((res) => { .then((res) => {
state.deone = false; state.deone = false;
console.log(res, "单个删除成功"); console.log(res, "单个删除成功");
@@ -473,6 +501,35 @@ export default {
state.selectedRows = []; state.selectedRows = [];
}; };
//添加学员
watch(
() => state.addAuthList,
(res) => {
console.log("res", res, state.addAuthList);
// let obj = {
// deptList: res[1],
// groupList: res[2],
// projectId: state.projectId,
// studentList: res[0],
// projectGroupId: 0,
// };
// console.log("obj", obj);
// state.loading = true;
// api
// .addStudentProject(obj)
// .then((res) => {
// console.log("添加学员成功", res);
// message.success("添加学员成功");
// getStu();
// })
// .catch((err) => {
// console.log("添加学员失败", err);
// });
}
);
function submitCall(flag) {
flag && getStu();
}
return { return {
...toRefs(state), ...toRefs(state),
closeDrawer, closeDrawer,
@@ -491,6 +548,7 @@ export default {
deleteOne, deleteOne,
closedeleone, closedeleone,
yesdele, yesdele,
submitCall,
}; };
}, },
}; };

View File

@@ -39,14 +39,14 @@
<div> <div>
<div class="groupin" v-for="(value, index) in groupNum2" :key="index"> <div class="groupin" v-for="(value, index) in groupNum2" :key="index">
<a-input <a-input
v-model:value="value.name" v-model:value="value.groupName"
style="border-radius: 8px; height: 40px" style="border-radius: 8px; height: 40px"
/> />
<a-input-number <a-input-number
:min="1" :min="1"
:precision="0" :precision="0"
style="width: 64px; height: 40px; border-radius: 8px" style="width: 64px; height: 40px; border-radius: 8px"
v-model:value="peopleNum" v-model:value="value.capacity"
/> />
<span style="margin-left: 3px"></span> <span style="margin-left: 3px"></span>
<div class="delete" @click="deleteGroup(value)">删除</div> <div class="delete" @click="deleteGroup(value)">删除</div>
@@ -72,6 +72,7 @@
import { reactive, toRefs } from "vue"; import { reactive, toRefs } from "vue";
import AddGroup from "./AddGroup.vue"; import AddGroup from "./AddGroup.vue";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import { randomGroup } from "@/api/index1";
export default { export default {
name: "SubsetManage", name: "SubsetManage",
components: { AddGroup }, components: { AddGroup },
@@ -80,6 +81,10 @@ export default {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
projectId: {
type: Number,
default: null,
},
}, },
setup(props, ctx) { setup(props, ctx) {
const state = reactive({ const state = reactive({
@@ -116,8 +121,8 @@ export default {
for (let i = 0; i < state.groupNum; i++) { for (let i = 0; i < state.groupNum; i++) {
let obj = { let obj = {
key: i, key: i,
name: "", groupName: "",
number: state.peopleNum, capacity: state.peopleNum,
}; };
arr.push(obj); arr.push(obj);
} }
@@ -135,6 +140,17 @@ export default {
//添加小组 //添加小组
const addGroup = () => { const addGroup = () => {
console.log("state.groupNum2", state.groupNum2); console.log("state.groupNum2", state.groupNum2);
let obj = {
pid: props.projectId,
randomGroups: state.groupNum2,
};
randomGroup(obj, props.projectId)
.then((res) => {
console.log("随机分组结果", res);
})
.catch((err) => {
console.log("随机分组失败", err);
});
}; };
return { return {

View File

@@ -3,97 +3,136 @@
<template> <template>
<div class="CommonStudent"> <div class="CommonStudent">
<a-drawer <a-drawer
:visible="visiable" :visible="visiable"
class="drawerStyle ProjCheckship CommonStudent" class="drawerStyle ProjCheckship CommonStudent"
placement="right" placement="right"
width="60%" width="60%"
> >
<div class="drawerMain" id="ProjCheckship" style=""> <div class="drawerMain" id="ProjCheckship" style="">
<div class="header"> <div class="header">
<div class="headerTitle"> <div class="headerTitle">
{{ {1: "添加学员", 2: "添加学员", 3: "添加学员"}[type] || title }} {{ { 1: "添加学员", 2: "添加学员", 3: "添加学员" }[type] || title }}
</div> </div>
<img <img
style="width: 29px; height: 29px; cursor: pointer" style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png" src="../../assets/images/basicinfo/close.png"
@click="closeDrawer" @click="closeDrawer"
/> />
</div> </div>
<div style="display: flex; overflow-x: auto; overflow-y: auto"> <div style="display: flex; overflow-x: auto; overflow-y: auto">
<div class="tabs" style="min-width: 800px"> <div class="tabs" style="min-width: 800px">
<a-tabs v-model:activeKey="activeKey"> <a-tabs v-model:activeKey="activeKey">
<!-- <a-tab-pane v-if="isGroup" :key="4" tab="项目内学员">
<div :style="{ height: screenHeight - 235 + 'px' }">
<div>
<a-form-item label="姓名:">
<a-input
v-model:value="proStudentName"
style="width: 260px; height: 40px; border-radius: 8px"
placeholder="请输入姓名"
/>
<a-button
type="primary"
@click="searchAudi"
style="margin-left: 20px; border-radius: 4px"
>
<template #icon>
<SearchOutlined />
</template>
搜索
</a-button>
<a-button
@click="resetAudienceInfo"
style="margin-left: 20px; border-radius: 4px"
>重置
</a-button>
</a-form-item>
</div>
<div class="tableBox tabb">
<a-table
style="border: 1px solid #f2f6fe; width: 800px"
row-key="id"
:columns="stuColumns"
:data-source="projectList"
:loading="projectListTotal"
:pagination="projectPagination"
:row-selection="projectRowSelection"
/>
</div>
</div>
</a-tab-pane> -->
<a-tab-pane :key="1" tab="快速选人"> <a-tab-pane :key="1" tab="快速选人">
<div :style="{ height: screenHeight - 235 + 'px' }"> <div :style="{ height: screenHeight - 235 + 'px' }">
<div class="tab1"> <div class="tab1">
<a-form-item label="姓名"> <a-form-item label="姓名">
<a-input <a-input
v-model:value="nameSearch.keyword" v-model:value="nameSearch.keyword"
style="width: 270px; height: 40px; border-radius: 8px" style="width: 270px; height: 40px; border-radius: 8px"
placeholder="请输入姓名" placeholder="请输入姓名"
@change="peopleName" @change="peopleName"
/> />
<a-button <a-button
type="primary" type="primary"
@click="onSearchStu" @click="onSearchStu"
style="margin-left: 20px; border-radius: 4px" style="margin-left: 20px; border-radius: 4px"
> >
<template #icon> <template #icon>
<SearchOutlined/> <SearchOutlined />
</template> </template>
搜索 搜索
</a-button> </a-button>
<a-button <a-button
@click="resetStu" @click="resetStu"
style="margin-left: 20px; border-radius: 4px" style="margin-left: 20px; border-radius: 4px"
>重置 >重置
</a-button> </a-button>
</a-form-item> </a-form-item>
</div> </div>
<div <div
class="chooseLeft" class="chooseLeft"
style="display: grid; grid-template-columns: 250px auto" style="display: grid; grid-template-columns: 250px auto"
> >
<div <div
:style="{ :style="{
height: screenHeight - 180 + 'px', height: screenHeight - 180 + 'px',
overflowY: 'auto', overflowY: 'auto',
}" }"
style="border: 1px solid #f0f0f0" style="border: 1px solid #f0f0f0"
> >
<div class="tree" style="margin: 10px 4px 220px 10px"> <div class="tree" style="margin: 10px 4px 220px 10px">
<a-tree <a-tree
allow-clear allow-clear
tree-default-expand-all tree-default-expand-all
:tree-data="treeData" :tree-data="treeData"
:loading="orgLoading" :loading="orgLoading"
:load-data="onLoadData" :load-data="onLoadData"
v-model:selectedKeys="stuTreeSelectKeys" v-model:selectedKeys="stuTreeSelectKeys"
v-model:expandedKeys="stuTreeExpandedKeys" v-model:expandedKeys="stuTreeExpandedKeys"
:fieldNames="{ :fieldNames="{
children: 'treeChildList', children: 'treeChildList',
key: 'id', key: 'id',
title: 'name', title: 'name',
value: 'name', value: 'name',
}" }"
@select="stuStuOrgSelect" @select="stuStuOrgSelect"
> >
</a-tree> </a-tree>
</div> </div>
</div> </div>
<div <div
class="tableBox tabb" class="tableBox tabb"
style=" style="
margin: 0px 4px 120px 10px; margin: 0px 4px 120px 10px;
border: 1px solid #f0f0f0; border: 1px solid #f0f0f0;
" "
> >
<a-table <a-table
:columns="stuColumns" :columns="stuColumns"
:data-source="stuData" :data-source="stuData"
:pagination="stuPagination" :pagination="stuPagination"
:loading="stuLoading" :loading="stuLoading"
row-key="id" row-key="id"
:row-selection="stuRowSelection" :row-selection="stuRowSelection"
/> />
</div> </div>
</div> </div>
@@ -104,43 +143,42 @@
<div class="tab2"> <div class="tab2">
<a-form-item label="组织:"> <a-form-item label="组织:">
<a-input <a-input
v-model:value="searchOrgName.keyword" v-model:value="searchOrgName.keyword"
style="width: 230px; height: 40px; border-radius: 8px" style="width: 230px; height: 40px; border-radius: 8px"
placeholder="请输入组织" placeholder="请输入组织"
/> />
<a-button <a-button
type="primary" type="primary"
@click="searchOrg" @click="searchOrg"
style="margin-left: 20px; border-radius: 4px" style="margin-left: 20px; border-radius: 4px"
> >
<template #icon> <template #icon>
<SearchOutlined/> <SearchOutlined />
</template> </template>
搜索 搜索
</a-button> </a-button>
<a-button <a-button
@click="resetOrg" @click="resetOrg"
style="margin-left: 20px; border-radius: 4px" style="margin-left: 20px; border-radius: 4px"
>重置 >重置
</a-button </a-button>
>
</a-form-item> </a-form-item>
</div> </div>
<div class="boeTree"> <div class="boeTree">
<a-tree <a-tree
:tree-data="searchOrgName.keyword ? orgData : treeOrgData" :tree-data="searchOrgName.keyword ? orgData : treeOrgData"
@select="onOrgSelectChange" @select="onOrgSelectChange"
:loading="orgOrgLoading" :loading="orgOrgLoading"
:load-data="onLoadOrgData" :load-data="onLoadOrgData"
:fieldNames="{ :fieldNames="{
children: 'treeChildList', children: 'treeChildList',
key: 'id', key: 'id',
title: 'name', title: 'name',
value: 'name', value: 'name',
}" }"
row-key="id" row-key="id"
:row-selection="orgRowSelection" :row-selection="orgRowSelection"
multiple multiple
> >
</a-tree> </a-tree>
</div> </div>
@@ -151,36 +189,36 @@
<div> <div>
<a-form-item label="受众名称:"> <a-form-item label="受众名称:">
<a-input <a-input
v-model:value="audienceName.keyword" v-model:value="audienceName.keyword"
style="width: 260px; height: 40px; border-radius: 8px" style="width: 260px; height: 40px; border-radius: 8px"
placeholder="请输入受众名称" placeholder="请输入受众名称"
/> />
<a-button <a-button
type="primary" type="primary"
@click="searchAudi" @click="searchAudi"
style="margin-left: 20px; border-radius: 4px" style="margin-left: 20px; border-radius: 4px"
> >
<template #icon> <template #icon>
<SearchOutlined/> <SearchOutlined />
</template> </template>
搜索 搜索
</a-button> </a-button>
<a-button <a-button
@click="resetAudienceInfo" @click="resetAudienceInfo"
style="margin-left: 20px; border-radius: 4px" style="margin-left: 20px; border-radius: 4px"
>重置 >重置
</a-button> </a-button>
</a-form-item> </a-form-item>
</div> </div>
<div class="tableBox tabb"> <div class="tableBox tabb">
<a-table <a-table
style="border: 1px solid #f2f6fe;width:800px" style="border: 1px solid #f2f6fe; width: 800px"
row-key="id" row-key="id"
:columns="audiColums" :columns="audiColums"
:data-source="audiData" :data-source="audiData"
:loading="audiLoading" :loading="audiLoading"
:pagination="auditPagination" :pagination="auditPagination"
:row-selection="auditRowSelection" :row-selection="auditRowSelection"
/> />
</div> </div>
</div> </div>
@@ -193,7 +231,10 @@
<div class="already">已选</div> <div class="already">已选</div>
</div> </div>
</div> </div>
<div :style="{ 'max-height': screenHeight - 235 + 'px' }" style="overflow-y: auto"> <div
:style="{ 'max-height': screenHeight - 235 + 'px' }"
style="overflow-y: auto"
>
<div class="selecteds"> <div class="selecteds">
<div class="person">快速选人</div> <div class="person">快速选人</div>
<div v-for="(item, i) in selectsData.studentList"> <div v-for="(item, i) in selectsData.studentList">
@@ -213,72 +254,78 @@
</div> </div>
</div> </div>
<div <div
v-if="!person && selectsData.studentList.length > 10" v-if="!person && selectsData.studentList.length > 10"
class="ifsw" class="ifsw"
> >
<div @click="person = !person" class="“sw”">查看更多></div> <div @click="person = !person" class="“sw”">查看更多></div>
</div> </div>
<div <div
v-if="person && selectsData.studentList.length > 10" v-if="person && selectsData.studentList.length > 10"
class="ifsw" class="ifsw"
> >
<div @click="person = !person" class="sw">收起&lt;</div> <div @click="person = !person" class="sw">收起&lt;</div>
</div> </div>
</div> </div>
<div v-if="!selectStu" class="selecteds"> <div v-if="!selectStu" class="selecteds">
<div class="dept">添加组织</div> <div class="dept">添加组织</div>
<div v-for="(item,i) in selectsData.deptList"> <div v-for="(item, i) in selectsData.deptList">
<div v-if="i<11"> <div v-if="i < 11">
<div class="chose1"> <div class="chose1">
<div class="span"> {{ item.name }}</div> <div class="span">{{ item.name }}</div>
<div class="ch1" @click="orgDel(i)"></div> <div class="ch1" @click="orgDel(i)"></div>
</div> </div>
</div> </div>
<div v-else> <div v-else>
<div v-if="dept"> <div v-if="dept">
<div class="chose1"> <div class="chose1">
<div class="span"> {{ item.name }}</div> <div class="span">{{ item.name }}</div>
<div class="ch1" @click="orgDel(i)"></div> <div class="ch1" @click="orgDel(i)"></div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div v-if="!dept && selectsData.deptList.length >10" class="ifsw"> <div
<div @click="dept = !dept" class=sw>查看更多></div> v-if="!dept && selectsData.deptList.length > 10"
class="ifsw"
>
<div @click="dept = !dept" class="“sw”">查看更多></div>
</div> </div>
<div v-if="dept && selectsData.deptList.length >10" class="ifsw"> <div
<div @click="dept = !dept" class="sw"> 收起&lt;</div> v-if="dept && selectsData.deptList.length > 10"
class="ifsw"
>
<div @click="dept = !dept" class="sw">收起&lt;</div>
</div> </div>
</div> </div>
<!--受众--> <!--受众-->
<div v-if="!selectStu" class="selecteds"> <div v-if="!selectStu" class="selecteds">
<div class="group">受众关联</div> <div class="group">受众关联</div>
<div v-for="(item, i) in selectsData.groupList"> <div v-for="(item, i) in selectsData.groupList">
<div v-if="i < 11"> <div v-if="i < 11">
<div class="chose2"> <div class="chose2">
<div class="span">{{ item.audienceName }}</div> <div class="span">{{ item.audienceName }}</div>
<div class="ch2" @click="AuditDel(i)"></div> <div class="ch2" @click="AuditDel(i)"></div>
</div> </div>
</div> </div>
<div v-else> <div v-else>
<div v-if="group"> <div v-if="group">
<div class="chose2"> <div class="chose2">
<div class="span">{{ item.audienceName }}</div> <div class="span">{{ item.audienceName }}</div>
<div class="ch2" @click="AuditDel(i)"></div> <div class="ch2" @click="AuditDel(i)"></div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div <div
v-if="!group && selectsData.groupList.length > 10" v-if="!group && selectsData.groupList.length > 10"
class="ifsw" class="ifsw"
> >
<div @click="group = !group" class="“sw”">查看更多></div> <div @click="group = !group" class="“sw”">查看更多></div>
</div> </div>
<div v-if="group && selectsData.groupList > 10" class="ifsw"> <div v-if="group && selectsData.groupList > 10" class="ifsw">
<div @click="group = !group" class="sw">收起&lt;</div> <div @click="group = !group" class="sw">收起&lt;</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@@ -291,13 +338,13 @@
<a-button @click="openDrawer" type="link"><slot></slot></a-button> <a-button @click="openDrawer" type="link"><slot></slot></a-button>
</div> </div>
<a-modal <a-modal
:style="{padding: 0,position: relative,right: '-20%'}" :style="{ padding: 0, position: relative, right: '-20%' }"
:closable="true" :closable="true"
:visible="stageVisible" :visible="stageVisible"
:footer="null" :footer="null"
centered="true" centered="true"
@ok="handleStageOk" @ok="handleStageOk"
wrapClassName="changeModal" wrapClassName="changeModal"
> >
<div class="con"> <div class="con">
<div class="header"> <div class="header">
@@ -311,34 +358,34 @@
<!-- <div class="cur">当前关卡关卡2</div> --> <!-- <div class="cur">当前关卡关卡2</div> -->
<div class="select"> <div class="select">
<a-select <a-select
style="width: 400px" style="width: 400px"
:placeholder="type === 1 ? '选择阶段' : '选择关卡'" :placeholder="type === 1 ? '选择阶段' : '选择关卡'"
v-model:value="selectsData.stageId" v-model:value="selectsData.stageId"
className="cus-select" className="cus-select"
> >
<a-select-option <a-select-option
v-for="(item, i) in stageIds" v-for="(item, i) in stageIds"
:key="i" :key="i"
:value="item.id" :value="item.id"
>{{ item.name || "默认" }} >{{ item.name || "默认" }}
</a-select-option> </a-select-option>
</a-select> </a-select>
</div> </div>
<span style="color: #999999; margin-left: 10px" <span style="color: #999999; margin-left: 10px"
><minus-circle-outlined/>已在其他关卡的学员不会被添加到该关卡</span ><minus-circle-outlined />已在其他关卡的学员不会被添加到该关卡</span
> >
<div class="btn" style="margin-top: 50px"> <div class="btn" style="margin-top: 50px">
<button <button
class="sameb btn1" class="sameb btn1"
@click="closeChangeModal" @click="closeChangeModal"
style="cursor: pointer" style="cursor: pointer"
> >
取消 取消
</button> </button>
<button <button
class="sameb btn2" class="sameb btn2"
@click="handleStageOk" @click="handleStageOk"
style="cursor: pointer" style="cursor: pointer"
> >
确定 确定
</button> </button>
@@ -349,23 +396,27 @@
</a-modal> </a-modal>
</template> </template>
<script setup> <script setup>
import {computed, defineEmits, defineProps, ref, watch} from "vue"; import { computed, defineEmits, defineProps, ref, watch } from "vue";
import {boeRequest, useBoeApi, useBoeApiPage} from "@/api/request"; import { boeRequest, useBoeApi, useBoeApiPage } from "@/api/request";
import { import {
AUDIENCE_LIST, AUDIENCE_LIST,
ORG_CHILD_LIST, ORG_CHILD_LIST,
ORG_LIST, ORG_LIST,
USER_LIST, USER_LIST,
} from "@/api/ThirdApi"; } from "@/api/ThirdApi";
import {saveStu} from "@/api/index1"; import {
saveStu,
// addGroupMember,
// getStuPage,
} from "@/api/index1";
// import { getProjStu } from "@/api/indexProjStu";
const emit = defineEmits({}); const emit = defineEmits({});
const props = defineProps({ const props = defineProps({
type: Number, type: Number,
id: String, id: String,
title: { title: {
type: String, type: String,
default: '', default: "",
}, },
clear: { clear: {
type: Boolean, type: Boolean,
@@ -383,12 +434,85 @@ const props = defineProps({
type: Array, type: Array,
default: () => [], default: () => [],
}, },
isGroup: {
type: Boolean,
default: false,
},
projectId: {
type: Number,
default: null,
},
groupId: {
type: Number,
default: null,
},
groupName: {
type: String,
default: null,
},
}); });
//获取项目学员
// const procurrentPage = ref(1);
// const projectList = ref([]);
// const proStudentName = ref("");
// const projectListTotal = ref(-1);
// const projectPageSize = ref(10);
// const projectSelectKeys = ref([]);
// const projectPagination = computed(() => ({
// total: projectListTotal.value,
// showSizeChanger: false,
// current: procurrentPage.value,
// pageSize: projectPageSize.value,
// onChange: projectChangePagination,
// }));
// const projectRowSelection = computed(() => ({
// columnWidth: 20,
// selectedRowKeys: projectSelectKeys.value,
// onChange: onProjectSelectChange,
// preserveSelectedRowKeys: true,
// }));
// const getStu = () => {
// let obj = {
// studentName: proStudentName.value,
// pageNo: procurrentPage.value,
// pageSize: 10,
// projectId: props.projectId,
// };
// projectListTotal.value = -1;
// console.log("获取项目学员", obj);
// getStuPage(obj).then((res) => {
// console.log("获取项目学员", res);
// if (res.data.code === 200) {
// let arr = res.data.data.records;
// let array = [];
// arr.map((value) => {
// let obj = {
// id: value.id,
// realName: value.studentName,
// userNo: value.studentId,
// orgName: value.studentOrgName ? value.studentOrgName : "-",
// departName: value.studentDepartName ? value.studentDepartName : "-",
// };
// array.push(obj);
// });
// projectList.value = array;
// projectListTotal.value = res.data.data.total;
// }
// });
// };
// getStu();
// const projectChangePagination = () => {};
// function onProjectSelectChange(e, l) {
// console.log("eeeee", e, l);
// projectSelectKeys.value = e;
// selectsData.value.projectMemberList = l;
// }
const person = ref(false); const person = ref(false);
// const dept =ref(false) // const dept =ref(false)
const group = ref(false); const group = ref(false);
const visiable = ref(false); const visiable = ref(false);
// const activeKey = ref(props.isGroup ? 4 : 1);
const activeKey = ref(1); const activeKey = ref(1);
const stageVisible = ref(false); const stageVisible = ref(false);
const selectsData = ref({ const selectsData = ref({
@@ -411,10 +535,10 @@ const audienceName = ref({
pageSize: 10, pageSize: 10,
}); });
const searchOrgName = ref({ const searchOrgName = ref({
keyword: '', keyword: "",
page: 1, page: 1,
pageSize: 10 pageSize: 10,
}) });
const stageIds = computed(() => props.stage); const stageIds = computed(() => props.stage);
const { const {
data: stuData, data: stuData,
@@ -430,25 +554,25 @@ const {
totalPage: (res) => res.result.totalPage, totalPage: (res) => res.result.totalPage,
total: (res) => res.result.totalElement, total: (res) => res.result.totalElement,
}); });
const { const { data: orgData, fetch: searchOrg } = useBoeApiPage(
data: orgData, ORG_LIST,
fetch: searchOrg, searchOrgName.value
} = useBoeApiPage(ORG_LIST, searchOrgName.value)
const {data: treeData, loading: orgLoading} = useBoeApi(
ORG_LIST,
{keyword: ""},
{
init: true,
result: (res) => res.result.map((e) => ({...e, isLeaf: false})),
}
); );
const {data: treeOrgData, loading: orgOrgLoading} = useBoeApi( const { data: treeData, loading: orgLoading } = useBoeApi(
ORG_LIST, ORG_LIST,
{keyword: ""}, { keyword: "" },
{ {
init: true, init: true,
result: (res) => res.result.map((e) => ({...e, isLeaf: false})), result: (res) => res.result.map((e) => ({ ...e, isLeaf: false })),
} }
);
const { data: treeOrgData, loading: orgOrgLoading } = useBoeApi(
ORG_LIST,
{ keyword: "" },
{
init: true,
result: (res) => res.result.map((e) => ({ ...e, isLeaf: false })),
}
); );
const { const {
@@ -462,7 +586,7 @@ const {
} = useBoeApiPage(AUDIENCE_LIST, audienceName.value, { } = useBoeApiPage(AUDIENCE_LIST, audienceName.value, {
init: true, init: true,
result: (res) => result: (res) =>
res.result.audienceList.map((e) => ({...e, id: e.id + ""})), res.result.audienceList.map((e) => ({ ...e, id: e.id + "" })),
totalPage: (res) => res.result.totalPage, totalPage: (res) => res.result.totalPage,
total: (res) => res.result.totalElement, total: (res) => res.result.totalElement,
}); });
@@ -537,7 +661,7 @@ const auditSelectKeys = ref([]);
const screenHeight = ref(document.body.clientHeight); const screenHeight = ref(document.body.clientHeight);
//const screenWidth = ref(document.body.clientWidth); //const screenWidth = ref(document.body.clientWidth);
const stuRowSelection = computed(() => ({ const stuRowSelection = computed(() => ({
type:props.selectOne?'radio':'checkbox', type: props.selectOne ? "radio" : "checkbox",
columnWidth: 20, columnWidth: 20,
selectedRowKeys: stuSelectKeys.value, selectedRowKeys: stuSelectKeys.value,
onChange: onStuSelectChange, onChange: onStuSelectChange,
@@ -577,20 +701,20 @@ const closeDrawer = () => {
}; };
function onLoadData(treeNode) { function onLoadData(treeNode) {
return boeRequest(ORG_CHILD_LIST, {keyword: "", orgId: treeNode.id}).then( return boeRequest(ORG_CHILD_LIST, { keyword: "", orgId: treeNode.id }).then(
(r) => { (r) => {
treeNode.dataRef.treeChildList = r.result.directChildList; treeNode.dataRef.treeChildList = r.result.directChildList;
treeData.value = [...treeData.value]; treeData.value = [...treeData.value];
} }
); );
} }
function onLoadOrgData(treeNode) { function onLoadOrgData(treeNode) {
return boeRequest(ORG_CHILD_LIST, {keyword: "", orgId: treeNode.id}).then( return boeRequest(ORG_CHILD_LIST, { keyword: "", orgId: treeNode.id }).then(
(r) => { (r) => {
treeNode.dataRef.treeChildList = r.result.directChildList; treeNode.dataRef.treeChildList = r.result.directChildList;
treeOrgData.value = [...treeOrgData.value]; treeOrgData.value = [...treeOrgData.value];
} }
); );
} }
@@ -617,7 +741,7 @@ function stuStuOrgSelect(e) {
function stuDel(i) { function stuDel(i) {
stuSelectKeys.value = stuSelectKeys.value.filter( stuSelectKeys.value = stuSelectKeys.value.filter(
(e) => e !== selectsData.value.studentList[i].id (e) => e !== selectsData.value.studentList[i].id
); );
selectsData.value.studentList.splice(i, 1); selectsData.value.studentList.splice(i, 1);
} }
@@ -628,7 +752,7 @@ function stuDel(i) {
// } // }
function AuditDel(i) { function AuditDel(i) {
auditSelectKeys.value = auditSelectKeys.value.filter( auditSelectKeys.value = auditSelectKeys.value.filter(
(e) => e !== selectsData.value.groupList[i].id (e) => e !== selectsData.value.groupList[i].id
); );
selectsData.value.groupList.splice(i, 1); selectsData.value.groupList.splice(i, 1);
} }
@@ -690,7 +814,7 @@ const deleteDepSelect = () => {
}; };
//重置组织 //重置组织
const resetOrg = () => { const resetOrg = () => {
searchOrgName.value = {keyword: '', page: 1, pageSize: 10} searchOrgName.value = { keyword: "", page: 1, pageSize: 10 };
}; };
//重置受众 //重置受众
const resetAudienceInfo = () => { const resetAudienceInfo = () => {
@@ -725,15 +849,42 @@ function handleStageOk() {
saveStu({ saveStu({
targetId: props.id, targetId: props.id,
type: props.type, type: props.type,
clear:props.clear, clear: props.clear,
deptIds: selectsData.value.deptList?.map((e) => e.id), deptIds: selectsData.value.deptList?.map((e) => e.id),
stageId: selectsData.value.stageId, stageId: selectsData.value.stageId,
groupIds: selectsData.value.groupList?.map((e) => e.id), groupIds: selectsData.value.groupList?.map((e) => e.id),
studentList: selectsData.value.studentList, studentList: selectsData.value.studentList,
groupName: props.groupName,
groupId: props.groupId,
}).then(() => { }).then(() => {
deleteDepSelect(); deleteDepSelect();
emit("finash", true); emit("finash", true);
}); });
// //添加小组学员
// if (props.isGroup) {
// console.log("添加组员传参", selectsData.value, {
// groupId: props.groupId,
// pid: props.projectId,
// groupName: props.groupName,
// ids: selectsData.value.studentList?.map((e) => e.id),
// });
// addGroupMember({
// groupId: props.groupId,
// pid: props.projectId,
// groupName: props.groupName,
// studentIds: selectsData.value.studentList?.map((e) => e.id),
// })
// .then((res) => {
// console.log("添加小组学员", res);
// deleteDepSelect();
// emit("finash", true);
// })
// .catch((err) => {
// console.log("添加小组学员失败", err);
// });
// } else {
// }
} }
watch(visiable, () => { watch(visiable, () => {
@@ -746,6 +897,7 @@ watch(visiable, () => {
nameSearch.value.departId = null; nameSearch.value.departId = null;
stuTreeExpandedKeys.value = []; stuTreeExpandedKeys.value = [];
stuTreeSelectKeys.value = []; stuTreeSelectKeys.value = [];
// activeKey.value = props.isGroup ? 4 : 1;
activeKey.value = 1; activeKey.value = 1;
selectsData.value = { selectsData.value = {
stageId: "", stageId: "",

View File

@@ -803,7 +803,9 @@
</div> </div>
<div <div
class="grofooter" class="grofooter"
@click="showMemberList(item.projectGroupId)" @click="
showMemberList(item.projectGroupId, item.groupName)
"
> >
<div class="ftext">组员名单 ></div> <div class="ftext">组员名单 ></div>
<!-- <div class="peoples"> <!-- <div class="peoples">
@@ -1496,7 +1498,7 @@
</a-modal> </a-modal>
<!-- 学员(小组管理)创建小组抽屉 --> <!-- 学员(小组管理)创建小组抽屉 -->
<subset-manage v-model:Svisible="subsetVisivle" /> <subset-manage v-model:Svisible="subsetVisivle" :projectId="projectId" />
<!-- 学员管理-添加学员抽屉 --> <!-- 学员管理-添加学员抽屉 -->
<!-- <stu-add v-model:Stuvisible="Stuvisible" /> --> <!-- <stu-add v-model:Stuvisible="Stuvisible" /> -->
<!-- 添加学员抽屉 --> <!-- 添加学员抽屉 -->
@@ -1529,6 +1531,7 @@
<member-list <member-list
v-model:Lvisible="Lvisible" v-model:Lvisible="Lvisible"
v-model:chooseGroupId="chooseGroupId" v-model:chooseGroupId="chooseGroupId"
v-model:chooseGroupName="chooseGroupName"
v-model:projectId="projectId" v-model:projectId="projectId"
/> />
<!-- 面授学员抽屉 --> <!-- 面授学员抽屉 -->
@@ -2425,7 +2428,8 @@ export default {
TaskFaceImpStuvisible: false, //批量面授报名 TaskFaceImpStuvisible: false, //批量面授报名
valuestugn: "", //小组管理的输入的小组名称 valuestugn: "", //小组管理的输入的小组名称
checkStuId: null, //要查看的学员id checkStuId: null, //要查看的学员id
chooseGroupId: null, chooseGroupId: null, //选择的小组id
chooseGroupName: null, //选择的小组名称
morFaceT: false, //批量面授报名按钮 morFaceT: false, //批量面授报名按钮
faceArr: [], //任务大纲列表所有name faceArr: [], //任务大纲列表所有name
action: null, action: null,
@@ -3216,10 +3220,11 @@ export default {
console.log("facestudent", state.facestudent); console.log("facestudent", state.facestudent);
}; };
//面授学员的弹窗 //面授学员的弹窗
const showMemberList = (id) => { const showMemberList = (id, name) => {
state.Lvisible = true; state.Lvisible = true;
console.log("ssdsdsdsd", id); console.log("ssdsdsdsd", id);
state.chooseGroupId = id; state.chooseGroupId = id;
state.chooseGroupName = name;
}; };
//活动考勤的抽屉 //活动考勤的抽屉
{ {