|
@@ -14,8 +14,7 @@
|
|
|
</div> -->
|
|
|
<div></div>
|
|
|
<!-- || (courseDetail.course_teacher && courseDetail.course_teacher.indexOf(userid) != -1) -->
|
|
|
- <div class="btn_right"
|
|
|
- v-if="courseDetail.userid == userid">
|
|
|
+ <div class="btn_right" v-if="courseDetail.userid == userid">
|
|
|
<div style="color: rgb(171 171 171); margin: 0 10px 0 0" v-show="false">
|
|
|
提示:开启【开放选座】,能够自由加入和退出小组。
|
|
|
</div>
|
|
@@ -39,18 +38,18 @@
|
|
|
<div type="primary" @click="updateGroup" class="returnBtn" style="background-color: #225bc7">
|
|
|
添加分组
|
|
|
</div>
|
|
|
- <div type="primary" @click="deleteCourseGroup" class="returnBtn" style="background-color: #225bc7" >
|
|
|
+ <div type="primary" @click="deleteCourseGroup" class="returnBtn" style="background-color: #225bc7">
|
|
|
删除分组
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="btn_right"
|
|
|
- v-else>
|
|
|
+ <div class="btn_right" v-else>
|
|
|
<div style="color: rgb(171 171 171); margin: 0 10px 0 0">
|
|
|
提示:开启【开放选座】,能够自由加入和退出小组。
|
|
|
</div>
|
|
|
<div class="group_switch">
|
|
|
<span>开放选座</span>
|
|
|
- <el-switch v-model="islock" active-text="" class="switchCss" @change="lockChair" disabled></el-switch>
|
|
|
+ <el-switch v-model="islock" active-text="" class="switchCss" @change="lockChair"
|
|
|
+ disabled></el-switch>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -158,8 +157,7 @@
|
|
|
</div>
|
|
|
<div>
|
|
|
<!-- && groupJson.islock == 2 -->
|
|
|
- <div v-if="courseDetail.userid == userid"
|
|
|
- @click="deleteGroupChair(g.id, gindex)">
|
|
|
+ <div v-if="courseDetail.userid == userid" @click="deleteGroupChair(g.id, gindex)">
|
|
|
移除组员
|
|
|
</div>
|
|
|
<div @click="selectGroup(g.id)"
|
|
@@ -171,12 +169,11 @@
|
|
|
groupStudent[g.id][
|
|
|
groupStudentUid[g.id].indexOf(userid)
|
|
|
].id)
|
|
|
- "
|
|
|
- v-else-if="groupStudentUid && groupStudentUid[g.id].indexOf(userid) != -1">
|
|
|
+ " v-else-if="groupStudentUid && groupStudentUid[g.id].indexOf(userid) != -1">
|
|
|
退出分组
|
|
|
</div>
|
|
|
<div style="margin-top:10px"
|
|
|
- v-if="(courseDetail.userid == userid ) && groupStudent[g.id].length < groupJson.number"
|
|
|
+ v-if="(courseDetail.userid == userid) && groupStudent[g.id].length < groupJson.number"
|
|
|
@click="addGroupStudent(g.id)">
|
|
|
添加组员
|
|
|
<!-- || (courseDetail.course_teacher && courseDetail.course_teacher.indexOf(userid) != -1) -->
|
|
@@ -304,11 +301,9 @@
|
|
|
</div>
|
|
|
<div class="batch_add_group">
|
|
|
<span>批量添加小组:</span>
|
|
|
- <el-input-number v-model="addGroupNum"
|
|
|
- :min="0"
|
|
|
- label="批量添加小组"></el-input-number>
|
|
|
+ <el-input-number v-model="addGroupNum" :min="0" label="批量添加小组"></el-input-number>
|
|
|
<el-button style="margin-left:5px" type="primary" size="small" @click="handleAddGroupNumChange()">
|
|
|
- 批量添加</el-button>
|
|
|
+ 批量添加</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="groupContent">
|
|
@@ -318,7 +313,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="dialogVisibleGroup2 = false;addGroupNum=0;">取 消</el-button>
|
|
|
+ <el-button @click="dialogVisibleGroup2 = false; addGroupNum = 0;">取 消</el-button>
|
|
|
<el-button type="primary" @click="updateGroupJson(2)">确定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
@@ -397,9 +392,10 @@
|
|
|
<div class="i_box_login2" v-if="classJuri.length">
|
|
|
<div :class="{ active: checkboxList3.indexOf(item.userid) != -1 }" v-for="item in classJuri"
|
|
|
:key="item.userid" :label="item.userid" @click="addGroupUser(item.userid)">
|
|
|
- <el-tooltip placement="top" :content="item.name ? item.name : '暂无姓名'">
|
|
|
+ <el-tooltip placement="top" :content="`${item.name ? item.name : '暂无姓名'}${item.group.length > 0 ? '在'+item.group.join('、') : ''}`">
|
|
|
<span>{{ item.name ? item.name : "暂无姓名" }}</span>
|
|
|
</el-tooltip>
|
|
|
+ <div class="grouplBox" v-if="item.group.length">{{ item.group.length }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="text-align: center; margin-top: 10px" v-else>暂无数据</div>
|
|
@@ -422,7 +418,7 @@ export default {
|
|
|
props: ['cid', 'classList', 'courseDetail', 'userid', "type", "classId", "oid", "people"],
|
|
|
data() {
|
|
|
return {
|
|
|
- addGroupNum:0,
|
|
|
+ addGroupNum: 0,
|
|
|
groupJson2: {},
|
|
|
classid: "1",
|
|
|
groupid: "",
|
|
@@ -458,20 +454,20 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- handleAddGroupNumChange(){
|
|
|
- for(let i=0;i<this.addGroupNum;i++){
|
|
|
+ handleAddGroupNumChange() {
|
|
|
+ for (let i = 0; i < this.addGroupNum; i++) {
|
|
|
this.groupJson2.group.push({
|
|
|
name: "第" + (this.groupJson2.group.length + 1) + "组",
|
|
|
id: this.guid()
|
|
|
});
|
|
|
- }
|
|
|
+ }
|
|
|
},
|
|
|
handleClose2(done) {
|
|
|
this.$emit('update:dialogVisibleGroup', false)
|
|
|
done();
|
|
|
},
|
|
|
handleClose(done) {
|
|
|
- this.addGroupNum=0;
|
|
|
+ this.addGroupNum = 0;
|
|
|
done();
|
|
|
},
|
|
|
getStudent() {
|
|
@@ -508,26 +504,45 @@ export default {
|
|
|
// if(_user.indexOf(this.courseDetail.userid) == -1){
|
|
|
// _user.push(this.courseDetail.userid);
|
|
|
// }
|
|
|
- if(_user.indexOf(this.courseDetail.userid) !== -1){
|
|
|
+ if (_user.indexOf(this.courseDetail.userid) !== -1) {
|
|
|
_user.splice(_user.indexOf(this.courseDetail.userid), 1);
|
|
|
}
|
|
|
let params = {
|
|
|
uid: _user.join(","),
|
|
|
};
|
|
|
this.ajax
|
|
|
- .get(this.$store.state.api + "getAllUserById", params)
|
|
|
- .then((res) => {
|
|
|
- this.loading = false
|
|
|
+ .get(this.$store.state.api + "getAllUserById", params)
|
|
|
+ .then((res) => {
|
|
|
+ this.loading = false
|
|
|
if (res.data && res.data[0].length) {
|
|
|
- this.classJuri = res.data[0].filter((el) => {
|
|
|
- return this.allGroupStudentUid.indexOf(el.userid) == -1
|
|
|
+ let students = res.data[0].filter((el) => {
|
|
|
+ return this.groupStudentUid[this.gid].indexOf(el.userid) == -1
|
|
|
+ // return el
|
|
|
});
|
|
|
+ let studentsJson = {}
|
|
|
+ for(var i = 0; i < students.length; i++){
|
|
|
+ studentsJson[students[i].userid] = students[i]
|
|
|
+ students[i].group = []
|
|
|
+ let groupk = Object.keys(this.groupStudentUid)
|
|
|
+ for(var j = 0; j < groupk.length; j++){
|
|
|
+ let uid = this.groupStudentUid[groupk[j]]
|
|
|
+ if(uid.indexOf(students[i].userid) !== -1){
|
|
|
+ for(var k = 0; k < this.groupJson.group.length; k++){
|
|
|
+ if(this.groupJson.group[k].id == groupk[j]){
|
|
|
+ students[i].group.push(this.groupJson.group[k].name)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.classJuri = Object.values(studentsJson)
|
|
|
}
|
|
|
- })
|
|
|
+ })
|
|
|
.catch((err) => {
|
|
|
- this.loading = false
|
|
|
- console.error(err);
|
|
|
- });
|
|
|
+ this.loading = false
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
},
|
|
|
setClassid(cid) {
|
|
|
this.classid = cid
|
|
@@ -931,36 +946,37 @@ export default {
|
|
|
},
|
|
|
mounted() {
|
|
|
if (this.classList.length) {
|
|
|
- if (this.type == 2) {
|
|
|
- this.classList = this.classList.filter(el => {
|
|
|
- return this.classId.indexOf(el.id) != -1
|
|
|
- })
|
|
|
- this.classid = this.classList[0].id
|
|
|
- } else {
|
|
|
- this.classid = this.classList[0].id
|
|
|
- }
|
|
|
+ if (this.type == 2) {
|
|
|
+ this.classList = this.classList.filter(el => {
|
|
|
+ return this.classId.indexOf(el.id) != -1
|
|
|
+ })
|
|
|
+ this.classid = this.classList[0].id
|
|
|
} else {
|
|
|
- this.classid = '1'
|
|
|
+ this.classid = this.classList[0].id
|
|
|
}
|
|
|
- this.setClassid(this.classid)
|
|
|
+ } else {
|
|
|
+ this.classid = '1'
|
|
|
+ }
|
|
|
+ this.setClassid(this.classid)
|
|
|
+ this.getCourseGroup();
|
|
|
+ // if (this.dialogVisibleGroup) {
|
|
|
+ // this.getCourseGroup();
|
|
|
+ this.timer = setInterval(() => {
|
|
|
this.getCourseGroup();
|
|
|
- // if (this.dialogVisibleGroup) {
|
|
|
- // this.getCourseGroup();
|
|
|
- this.timer = setInterval(() => {
|
|
|
- this.getCourseGroup();
|
|
|
- }, 5000)
|
|
|
- // } else {
|
|
|
- // clearInterval(this.timer)
|
|
|
- // this.timer = null
|
|
|
- // }
|
|
|
+ }, 5000)
|
|
|
+ // } else {
|
|
|
+ // clearInterval(this.timer)
|
|
|
+ // this.timer = null
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
-.batch_add_group{
|
|
|
+.batch_add_group {
|
|
|
margin-top: 15px;
|
|
|
}
|
|
|
+
|
|
|
.dialog_diy>>>.el-dialog {
|
|
|
margin-top: 10vh !important;
|
|
|
}
|
|
@@ -1336,12 +1352,13 @@ export default {
|
|
|
height: 30px;
|
|
|
line-height: 30px;
|
|
|
padding: 0 5px;
|
|
|
- overflow: hidden;
|
|
|
+ /* overflow: hidden; */
|
|
|
background: rgb(225, 237, 255);
|
|
|
margin: 10px calc((100% - (80px*5)) / 4) 0 0;
|
|
|
color: rgb(37 124 255);
|
|
|
border-radius: 5px;
|
|
|
box-sizing: border-box;
|
|
|
+ position: relative;
|
|
|
}
|
|
|
|
|
|
.i_box_login2>div:nth-child(5n) {
|
|
@@ -1371,4 +1388,19 @@ export default {
|
|
|
.group_switch>span {
|
|
|
margin-right: 5px;
|
|
|
}
|
|
|
+
|
|
|
+.grouplBox{
|
|
|
+ position: absolute;
|
|
|
+ top: -5px;
|
|
|
+ right: -5px;
|
|
|
+ background: rgb(225, 237, 255);
|
|
|
+ border: 1px solid #3281f7;
|
|
|
+ border-radius: 50%;
|
|
|
+ height: 15px;
|
|
|
+ width: 15px;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 15px;
|
|
|
+ font-size: 12px;
|
|
|
+ color: rgb(37 124 255);
|
|
|
+}
|
|
|
</style>
|