批量换组

This commit is contained in:
lpq
2023-02-23 01:37:12 +08:00
parent b8bf1cd2dd
commit 9ab0016efc
3 changed files with 35 additions and 21 deletions

View File

@@ -100,24 +100,29 @@ const selectGroup = (e, v) => {
}; };
//确认换组 //确认换组
const changeGroup = (item) => { const changeGroup = (item) => {
debugger
console.log("换组", selectGroupId.value, item); console.log("换组", selectGroupId.value, item);
let obj = { props.checkgroupStuId.forEach(stu => {
groupId: selectGroupId.value, let obj = {
groupName: selectGroupName.value, groupId: selectGroupId.value,
studentId: props.checkgroupStuId, groupName: selectGroupName.value,
}; studentId: stu,
console.log("换组obj", obj); };
api console.log("换组obj", obj);
.changeGroupByStudentId(obj) api
.then((res) => { .changeGroupByStudentId(obj)
console.log("换组成功", res); .then((res) => {
if (res.data.code === 200) { console.log("换组成功", res);
message.success("换组成功"); if (res.data.code === 200) {
} message.success("换组成功");
}) closeChangeModal();
.catch((err) => { }
console.log("换组失败", err); })
}); .catch((err) => {
console.log("换组失败", err);
});
})
}; };
</script> </script>
@@ -240,4 +245,4 @@ const changeGroup = (item) => {
} }
} }
} }
</style> </style>

View File

@@ -255,8 +255,8 @@
<!-- 换组弹窗 --> <!-- 换组弹窗 -->
<ChangeGroupModal <ChangeGroupModal
v-model:changegroupV="checkgroupParam.changegroupV" v-model:changegroupV="checkgroupParam.changegroupV"
:groupList="checkgroupParam.checkgroupList" :groupList="groupList"
:checkgroupStuId="checkgroupParam.checkgroupStuId" :checkgroupStuId="stuSelectKeys"
/> />
<!-- 批量调整关卡弹窗 --> <!-- 批量调整关卡弹窗 -->
<!-- 取消学员弹窗 --> <!-- 取消学员弹窗 -->
@@ -394,6 +394,10 @@ const props = defineProps({
type: Boolean, type: Boolean,
default: null, default: null,
}, },
groupList: {
type: Array,
default: () => [],
}
}); });
const topFlagList = ref([ const topFlagList = ref([
{ {
@@ -533,6 +537,7 @@ const tableData = ref({
loading: false, loading: false,
}); });
const stuRowSelection = computed(() => ({ const stuRowSelection = computed(() => ({
columnWidth: 20, columnWidth: 20,
selectedRowKeys: stuSelectKeys.value, selectedRowKeys: stuSelectKeys.value,
@@ -542,6 +547,8 @@ const stuRowSelection = computed(() => ({
//显示学员换组弹窗 //显示学员换组弹窗
function showChangeGroupModal() { function showChangeGroupModal() {
const d = props.groupList
console.log("d"+d)
// debugger // debugger
checkgroupParam.value.changegroupV = true; checkgroupParam.value.changegroupV = true;
} }
@@ -609,6 +616,8 @@ function getStuList() {
}); });
} }
function reset() { function reset() {
tableParam.value.studentName = ""; tableParam.value.studentName = "";
tableParam.value.groupName = ""; //学员小组 tableParam.value.groupName = ""; //学员小组
@@ -619,7 +628,6 @@ function reset() {
} }
function bathDel() { function bathDel() {
debugger
if (stuSelectKeys.value && stuSelectKeys.value.length === 0) { if (stuSelectKeys.value && stuSelectKeys.value.length === 0) {
message.destroy(); message.destroy();
return message.warning("请先选中学员"); return message.warning("请先选中学员");

View File

@@ -712,6 +712,7 @@
:columns="stuColumns" :columns="stuColumns"
:stage="stage" :stage="stage"
:visable="tabFlag" :visable="tabFlag"
:groupList="groupList"
> >
<template #extension="{ data: { record } }"> <template #extension="{ data: { record } }">
<a-button @click="showStudent(record)" type="link" <a-button @click="showStudent(record)" type="link"