|
@@ -32,6 +32,10 @@
|
|
|
<span>开放选座</span>
|
|
|
<el-switch v-model="islock" active-text="" class="switchCss" @change="lockChair"></el-switch>
|
|
|
</div>
|
|
|
+ <!-- <div class="group_switch">
|
|
|
+ <span>开启分组</span>
|
|
|
+ <el-switch v-model="isopen" class="switchCss" @change="openChair"></el-switch>
|
|
|
+ </div> -->
|
|
|
<div type="primary" @click="updateGroup" class="returnBtn" style="background-color: #225bc7">
|
|
|
分组设置
|
|
|
</div>
|
|
@@ -408,6 +412,7 @@ export default {
|
|
|
islock: 1,
|
|
|
},
|
|
|
islock: false,
|
|
|
+ isopen:true,
|
|
|
timer: null,
|
|
|
groupStudent: {},
|
|
|
groupStudentUid: {},
|
|
@@ -474,6 +479,7 @@ export default {
|
|
|
islock: 1,
|
|
|
}
|
|
|
this.islock = false
|
|
|
+ this.isopen = true
|
|
|
this.getCourseGroup();
|
|
|
},
|
|
|
guid() {
|
|
@@ -524,6 +530,7 @@ export default {
|
|
|
islock: 1,
|
|
|
}
|
|
|
this.islock = false
|
|
|
+ this.isopen = true
|
|
|
this.$message.success("操作成功");
|
|
|
this.getCourseGroup();
|
|
|
this.$forceUpdate()
|
|
@@ -545,7 +552,27 @@ export default {
|
|
|
},
|
|
|
lockChair() {
|
|
|
this.groupJson2 = JSON.parse(JSON.stringify(this.groupJson));
|
|
|
- this.groupJson2.islock = this.groupJson2.islock == 1 ? 2 : 1;
|
|
|
+ if(this.groupJson2.isopen == 2){
|
|
|
+ this.$message.error("请开启分组后才能开放选座")
|
|
|
+ this.islock = false
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ this.groupJson2.islock = this.groupJson2.islock == 1 ? 2 : 1;
|
|
|
+ }
|
|
|
+ this.updateGroupJson();
|
|
|
+ },
|
|
|
+ openChair() {
|
|
|
+ this.groupJson2 = JSON.parse(JSON.stringify(this.groupJson));
|
|
|
+ if(!this.groupJson2.isopen){
|
|
|
+ this.groupJson2.isopen = 2;
|
|
|
+ }else{
|
|
|
+ this.groupJson2.isopen = this.groupJson2.isopen == 1 ? 2 : 1;
|
|
|
+ }
|
|
|
+ if(this.groupJson2.isopen == 2){
|
|
|
+ this.groupJson2.islock = 2
|
|
|
+ }else{
|
|
|
+ this.groupJson2.islock = 1
|
|
|
+ }
|
|
|
this.updateGroupJson();
|
|
|
},
|
|
|
updateGroupJson() {
|
|
@@ -600,6 +627,11 @@ export default {
|
|
|
if (res.data && res.data[0].length) {
|
|
|
this.groupJson = JSON.parse(res.data[0][0].group);
|
|
|
this.islock = this.groupJson.islock == 1 ? true : false;
|
|
|
+ if(!this.groupJson.isopen){
|
|
|
+ this.isopen = true
|
|
|
+ }else{
|
|
|
+ this.isopen = this.groupJson.isopen == 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
|