feat:修改随机分组等

This commit is contained in:
lixg
2023-02-14 15:40:17 +08:00
parent 1c69724d3f
commit d2bb0fabfc
4 changed files with 135 additions and 84 deletions

View File

@@ -85,6 +85,10 @@ export default {
type: Number,
default: null,
},
getGroup: {
type: Function,
default: null,
},
},
setup(props, ctx) {
const state = reactive({
@@ -121,7 +125,7 @@ export default {
for (let i = 0; i < state.groupNum; i++) {
let obj = {
key: i,
groupName: "",
groupName: "第" + (i + 1) + "小组",
capacity: state.peopleNum,
};
arr.push(obj);
@@ -144,9 +148,14 @@ export default {
pid: props.projectId,
randomGroups: state.groupNum2,
};
ctx.emit("update:Svisible", false);
randomGroup(obj, props.projectId)
.then((res) => {
console.log("随机分组结果", res);
if (res.data.code === 200) {
message.success("小组添加成功");
props.getGroup && props.getGroup();
}
})
.catch((err) => {
console.log("随机分组失败", err);