|
@@ -18,13 +18,18 @@
|
|
|
<div style="color: rgb(171 171 171); margin: 0 10px 0 0">
|
|
|
提示:需要锁定位置,才能点击头像修改座位。
|
|
|
</div>
|
|
|
- <div type="primary" v-if="groupJson.islock == 1 && groupJson.group.length" class="returnBtn"
|
|
|
+ <!-- 开放选座 -->
|
|
|
+ <!-- <div type="primary" v-if="groupJson.islock == 1 && groupJson.group.length" class="returnBtn"
|
|
|
style="background-color: #225bc7" @click="lockChair">
|
|
|
锁定位置
|
|
|
</div>
|
|
|
<div type="primary" v-else-if="groupJson.group.length" class="returnBtn"
|
|
|
style="background-color: #225bc7" @click="lockChair">
|
|
|
解锁位置
|
|
|
+ </div> -->
|
|
|
+ <div class="group_switch">
|
|
|
+ <span>开放选座</span>
|
|
|
+ <el-switch v-model="islock" active-text="" class="switchCss" @change="lockChair"></el-switch>
|
|
|
</div>
|
|
|
<div type="primary" @click="updateGroup" class="returnBtn" style="background-color: #225bc7">
|
|
|
分组设置
|
|
@@ -151,7 +156,7 @@
|
|
|
退出分组
|
|
|
</div>
|
|
|
<div style="margin-top:10px"
|
|
|
- v-if="courseDetail.userid == userid && groupJson.islock == 2 && groupStudent[g.id].length < groupJson.number"
|
|
|
+ v-if="courseDetail.userid == userid && groupStudent[g.id].length < groupJson.number"
|
|
|
@click="addGroupStudent(g.id)">
|
|
|
添加组员
|
|
|
</div>
|
|
@@ -326,7 +331,7 @@
|
|
|
<el-button type="primary" @click="updateChair">确定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
- <el-dialog title="添加学生" :visible.sync="dialogVisibleMember" :append-to-body="true" width="500px" height="80%"
|
|
|
+ <el-dialog title="添加学生" :visible.sync="dialogVisibleMember" :append-to-body="true" width="540px" height="80%"
|
|
|
:before-close="handleClose" class="addNewPP">
|
|
|
<div class="people">
|
|
|
<div class="people_top">
|
|
@@ -340,15 +345,15 @@
|
|
|
</div>
|
|
|
<div class="people_nav">选择成员</div>
|
|
|
</div>
|
|
|
- <div class="t_j_box" style="
|
|
|
- padding: 20px 0 0 25px;
|
|
|
- width: calc(100% - 55px);
|
|
|
- margin-left: 25px;
|
|
|
- ">
|
|
|
+ <!-- <div class="t_j_box" style="
|
|
|
+ padding: 20px 0 0 25px;
|
|
|
+ width: calc(100% - 55px);
|
|
|
+ margin-left: 25px;
|
|
|
+ ">
|
|
|
<span>姓名</span>
|
|
|
<span>账号</span>
|
|
|
- </div>
|
|
|
- <el-checkbox-group v-model="checkboxList3" class="people_name" v-if="classJuri.length">
|
|
|
+ </div> -->
|
|
|
+ <!-- <el-checkbox-group v-model="checkboxList3" class="people_name" v-if="classJuri.length">
|
|
|
<el-checkbox v-for="item in classJuri" :key="item.userid" :label="item.userid">
|
|
|
<div class="t_j_box">
|
|
|
<el-tooltip placement="top" :content="item.name ? item.name : '暂无姓名'">
|
|
@@ -359,14 +364,21 @@
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
</el-checkbox>
|
|
|
- </el-checkbox-group>
|
|
|
+ </el-checkbox-group> -->
|
|
|
+ <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 : '暂无姓名'">
|
|
|
+ <span>{{ item.name ? item.name : "暂无姓名" }}</span>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<div style="text-align: center; margin-top: 10px" v-else>暂无数据</div>
|
|
|
</div>
|
|
|
- <div style="margin-top: 10px;">
|
|
|
+ <!-- <div style="margin-top: 10px;">
|
|
|
<el-pagination background layout="prev, pager, next" :page-size="pageSize" :total="total"
|
|
|
v-if="page && classJuri.length" style="padding-bottom: 20px"
|
|
|
@current-change="handleCurrentChange"></el-pagination>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
<el-button @click="dialogVisibleMember = false">取 消</el-button>
|
|
|
<el-button type="primary" @click="joinGroup2">确定</el-button>
|
|
@@ -377,7 +389,7 @@
|
|
|
|
|
|
<script>
|
|
|
export default {
|
|
|
- props: ['cid', 'dialogVisibleGroup', 'classList', 'courseDetail', 'userid',"type","classId"],
|
|
|
+ props: ['cid', 'dialogVisibleGroup', 'classList', 'courseDetail', 'userid', "type", "classId", "oid"],
|
|
|
data() {
|
|
|
return {
|
|
|
groupJson2: {},
|
|
@@ -389,6 +401,7 @@ export default {
|
|
|
number: undefined,
|
|
|
islock: 1,
|
|
|
},
|
|
|
+ islock:false,
|
|
|
timer: null,
|
|
|
groupStudent: {},
|
|
|
groupStudentUid: {},
|
|
@@ -430,14 +443,12 @@ export default {
|
|
|
selectCStudent() {
|
|
|
let params = {
|
|
|
cid: this.classid,
|
|
|
+ oid: this.oid,
|
|
|
cn: this.searchTN,
|
|
|
- page: this.page,
|
|
|
- num: this.pageSize
|
|
|
};
|
|
|
this.ajax
|
|
|
- .get(this.$store.state.api + "selectSnameByCidPage", params)
|
|
|
+ .get(this.$store.state.api + "selectSnameByCidGroup", params)
|
|
|
.then((res) => {
|
|
|
- this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
|
|
|
if (res.data && res.data[0].length) {
|
|
|
this.classJuri = res.data[0].filter((el) => {
|
|
|
return this.allGroupStudentUid.indexOf(el.userid) == -1
|
|
@@ -456,6 +467,7 @@ export default {
|
|
|
number: undefined,
|
|
|
islock: 1,
|
|
|
}
|
|
|
+ this.islock = false
|
|
|
this.getCourseGroup();
|
|
|
},
|
|
|
guid() {
|
|
@@ -547,6 +559,7 @@ export default {
|
|
|
.then((res) => {
|
|
|
if (res.data && res.data[0].length) {
|
|
|
this.groupJson = JSON.parse(res.data[0][0].group);
|
|
|
+ this.islock = this.groupJson.islock == 1 ? true : false;
|
|
|
this.groupid = res.data[0][0].id;
|
|
|
let groupPerson = res.data[1]
|
|
|
let group = JSON.parse(res.data[0][0].group).group
|
|
@@ -693,6 +706,7 @@ export default {
|
|
|
.post(this.$store.state.api + "joinCourseGroup", params)
|
|
|
.then((res) => {
|
|
|
this.$message.success("加入成功");
|
|
|
+ this.$emit('getGroup')
|
|
|
this.getCourseGroup();
|
|
|
})
|
|
|
.catch((err) => {
|
|
@@ -700,6 +714,13 @@ export default {
|
|
|
console.error(err);
|
|
|
});
|
|
|
},
|
|
|
+ addGroupUser(uid){
|
|
|
+ if(this.checkboxList3.indexOf(uid) == -1){
|
|
|
+ this.checkboxList3.push(uid)
|
|
|
+ }else{
|
|
|
+ this.checkboxList3.splice(this.checkboxList3.indexOf(uid),1)
|
|
|
+ }
|
|
|
+ },
|
|
|
async joinGroup2() {
|
|
|
if (
|
|
|
this.groupStudent[this.gid].length + this.checkboxList3.length >
|
|
@@ -738,6 +759,7 @@ export default {
|
|
|
.post(this.$store.state.api + "exitCourseGroup", params)
|
|
|
.then((res) => {
|
|
|
this.$message.success("退出成功");
|
|
|
+ this.$emit('getGroup')
|
|
|
this.getCourseGroup();
|
|
|
})
|
|
|
.catch((err) => {
|
|
@@ -758,12 +780,12 @@ export default {
|
|
|
watch: {
|
|
|
dialogVisibleGroup(newValue, oldValue) {
|
|
|
if (this.classList.length) {
|
|
|
- if(this.type == 2){
|
|
|
- this.classList = this.classList.filter(el =>{
|
|
|
+ if (this.type == 2) {
|
|
|
+ this.classList = this.classList.filter(el => {
|
|
|
return this.classId.indexOf(el.id) != -1
|
|
|
})
|
|
|
this.classid = this.classList[0].id
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
this.classid = this.classList[0].id
|
|
|
}
|
|
|
} else {
|
|
@@ -1085,14 +1107,14 @@ export default {
|
|
|
|
|
|
.people_search>>>.el-input__inner {
|
|
|
/* height: 25px; */
|
|
|
- width: 95%;
|
|
|
+ width: 100%;
|
|
|
}
|
|
|
|
|
|
.search_img {
|
|
|
width: 20px;
|
|
|
height: 20px;
|
|
|
position: absolute;
|
|
|
- right: 30px;
|
|
|
+ right: 10px;
|
|
|
top: 50%;
|
|
|
transform: translateY(-50%);
|
|
|
}
|
|
@@ -1146,4 +1168,54 @@ export default {
|
|
|
text-overflow: ellipsis;
|
|
|
white-space: nowrap;
|
|
|
}
|
|
|
+
|
|
|
+.i_box_login2 {
|
|
|
+ height: calc(100% - 80px);
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ overflow: auto;
|
|
|
+ padding-bottom: 10px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ align-content: flex-start;
|
|
|
+ padding: 10px 25px 0;
|
|
|
+}
|
|
|
+
|
|
|
+.i_box_login2>div {
|
|
|
+ cursor: pointer;
|
|
|
+ width: 80px;
|
|
|
+ text-align: center;
|
|
|
+ height: 30px;
|
|
|
+ line-height: 30px;
|
|
|
+ padding: 0 5px;
|
|
|
+ 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;
|
|
|
+}
|
|
|
+.i_box_login2>div:nth-child(5n) {
|
|
|
+ margin: 10px 0 0 0 ;
|
|
|
+}
|
|
|
+.i_box_login2 > .active{
|
|
|
+ background: rgb(92, 157, 255);
|
|
|
+ color: #fff;
|
|
|
+}
|
|
|
+.i_box_login2>div>span {
|
|
|
+ width: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+}
|
|
|
+
|
|
|
+.group_switch{
|
|
|
+ margin-right: 10px;
|
|
|
+ height: 30px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+.group_switch>span{
|
|
|
+ margin-right: 5px;
|
|
|
+}
|
|
|
</style>
|