mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-11 03:46:45 +08:00
feat:接入添加小组成员数据
This commit is contained in:
@@ -39,14 +39,14 @@
|
||||
<div>
|
||||
<div class="groupin" v-for="(value, index) in groupNum2" :key="index">
|
||||
<a-input
|
||||
v-model:value="value.name"
|
||||
v-model:value="value.groupName"
|
||||
style="border-radius: 8px; height: 40px"
|
||||
/>
|
||||
<a-input-number
|
||||
:min="1"
|
||||
:precision="0"
|
||||
style="width: 64px; height: 40px; border-radius: 8px"
|
||||
v-model:value="peopleNum"
|
||||
v-model:value="value.capacity"
|
||||
/>
|
||||
<span style="margin-left: 3px">人</span>
|
||||
<div class="delete" @click="deleteGroup(value)">删除</div>
|
||||
@@ -72,6 +72,7 @@
|
||||
import { reactive, toRefs } from "vue";
|
||||
import AddGroup from "./AddGroup.vue";
|
||||
import { message } from "ant-design-vue";
|
||||
import { randomGroup } from "@/api/index1";
|
||||
export default {
|
||||
name: "SubsetManage",
|
||||
components: { AddGroup },
|
||||
@@ -80,6 +81,10 @@ export default {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
projectId: {
|
||||
type: Number,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const state = reactive({
|
||||
@@ -116,8 +121,8 @@ export default {
|
||||
for (let i = 0; i < state.groupNum; i++) {
|
||||
let obj = {
|
||||
key: i,
|
||||
name: "",
|
||||
number: state.peopleNum,
|
||||
groupName: "",
|
||||
capacity: state.peopleNum,
|
||||
};
|
||||
arr.push(obj);
|
||||
}
|
||||
@@ -135,6 +140,17 @@ export default {
|
||||
//添加小组
|
||||
const addGroup = () => {
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user