| | |
| | | <div style="padding: 5px"> |
| | | <el-row :gutter="5"> |
| | | <el-col :span="22"> |
| | | <el-input placeholder="搜索" size="small" v-model="searchForm.keyword"/> |
| | | <el-input placeholder="搜索" size="small" clearable @input="getStudentList" @clear="getStudentList" v-model="searchForm.keyword"/> |
| | | </el-col> |
| | | <el-col :span="2"> |
| | | <el-button type="primary" size="small" @click="getRoomInfo">搜索</el-button> |
| | | <el-button type="primary" size="small" @click="getStudentList">搜索</el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | |
| | | |
| | | let jitsiApi = null |
| | | export default { |
| | | data() { |
| | | data () { |
| | | return { |
| | | intervalId: null, |
| | | meetId: null, |
| | |
| | | searchForm: { |
| | | keyword: '', |
| | | // 0 未在线、 1 在线 |
| | | onlineStatus: 0, |
| | | onlineStatus: 0 |
| | | }, |
| | | studentList: [], |
| | | showStudentList: [], |
| | | showStudentList: [] |
| | | } |
| | | }, |
| | | methods: { |
| | | getStatus(status) { |
| | | getStatus (status) { |
| | | if (status === 1) { |
| | | return "在线" |
| | | return '在线' |
| | | } else if (status === 0) { |
| | | return "离线" |
| | | return '离线' |
| | | } |
| | | }, |
| | | handleTabChange(tab) { |
| | | handleTabChange (tab) { |
| | | let status = parseInt(tab.name) |
| | | this.showStudentList = this.studentList.filter(student => { |
| | | return student.onlineStatus === status |
| | |
| | | }, |
| | | getStudentList () { |
| | | let params = { |
| | | keyword: this.keyword |
| | | keyword: this.searchForm.keyword |
| | | } |
| | | getStudentList(this.meetId, params).then(res => { |
| | | this.studentList = res.data.data |
| | | this.showStudentList = this.studentList.filter(student => { |
| | | return student.onlineStatus === 0 |
| | | return student.onlineStatus === this.searchForm.onlineStatus |
| | | }) |
| | | }) |
| | | }, |
| | |
| | | // 每三秒更学员在线状态 |
| | | this.intervalId = setInterval(() => { |
| | | this.getRoomInfo() |
| | | }, 3000) |
| | | }, 2500) |
| | | }, |
| | | beforeDestroy () { |
| | | // 清除定时器,避免内存泄漏 |