|
@@ -4,7 +4,8 @@
|
|
|
<el-col :span="24" class="classGroup">
|
|
|
<el-col :span="24" class="one" v-if="this.user.job === '班长'">
|
|
|
<el-button type="primary" size="mini" @click="createGroupDialog = true">创建分组</el-button>
|
|
|
- <el-button type="primary" size="mini" @click="affirm()">确定小组</el-button>
|
|
|
+ <el-button type="primary" size="mini" @click="affirm()" v-if="groupList ? groupList[0].status == '0' : ''">确认小组</el-button>
|
|
|
+ <el-button type="primary" size="mini" @click="cancel()" v-if="groupList ? groupList[0].status == '1' : ''">取消小组</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="two">
|
|
|
<el-col :span="24" class="list" v-for="(item, index) in groupList" :key="index">
|
|
@@ -14,16 +15,14 @@
|
|
|
<el-col :span="2" style="text-align:center;">{{ index + 1 }}.</el-col>
|
|
|
<el-col :span="6"> {{ item.name }} {{ item.students.length }}人</el-col>
|
|
|
<el-col :span="24" v-if="item.status !== '1'">
|
|
|
- <el-col :span="2">
|
|
|
+ <!-- <el-col :span="2">
|
|
|
<el-button v-if="item.students.length >= 10" type="danger" size="mini" disabled>已满员</el-button>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
<el-col :span="6" v-if="user.job === '班长'">
|
|
|
<el-button type="danger" size="mini" @click="deleteGroup(item.id)">删除</el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
- <el-button type="success" size="mini" v-if="stuIdAndGroupId.groupId === '' && item.students.length <= 10" @click="joinGroup(item.id)"
|
|
|
- >加入</el-button
|
|
|
- >
|
|
|
+ <el-button type="success" size="mini" v-if="stuIdAndGroupId.groupId === ''" @click="joinGroup(item.id)">加入</el-button>
|
|
|
<el-button type="danger" size="mini" v-if="stuIdAndGroupId.groupId === item.id" @click="exitGroup(item.id)">退出</el-button>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
@@ -87,6 +86,10 @@ export default {
|
|
|
affirm() {
|
|
|
this.$emit('affirm');
|
|
|
},
|
|
|
+ // 取消小组
|
|
|
+ cancel() {
|
|
|
+ this.$emit('cancel');
|
|
|
+ },
|
|
|
// 加入
|
|
|
joinGroup(groupId) {
|
|
|
Dialog.confirm({
|