From 8a7fdd668f6ed415ff0bfa53d9e759cca73a6dbc Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期五, 12 七月 2024 15:20:32 +0800
Subject: [PATCH] 优化

---
 src/views/meet/index.vue |   70 +++++++++++++++++++---------------
 1 files changed, 39 insertions(+), 31 deletions(-)

diff --git a/src/views/meet/index.vue b/src/views/meet/index.vue
index d66df30..a4c38cb 100644
--- a/src/views/meet/index.vue
+++ b/src/views/meet/index.vue
@@ -2,32 +2,32 @@
   <div>
     <div style="display: flex; flex-direction: row; position: relative">
       <div id="meet" ref="meet"/>
-      <div style="padding: 5px;position: absolute;right: 0">
-        <el-button type="primary" size="small" @click="showStudent = ! showStudent" style="float: right">{{getShowText()}}</el-button>
+      <div style="padding-top: 5px; padding-left: 5px; position: absolute;right: 15px">
+        <el-button type="success" size="small" @click="hiddenStudent" >{{getShowText()}}</el-button>
         <el-row v-show="showStudent">
           <el-row :gutter="5">
-            <el-col :span="22">
-              <el-input placeholder="鎼滅储" size="small" clearable @input="getStudentList" @clear="getStudentList" v-model="searchForm.keyword"/>
+            <el-col :span="12">
+              <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="getStudentList">鎼滅储</el-button>
             </el-col>
-            <el-tabs v-model="searchForm.onlineStatus" @tab-click="handleTabChange" style="margin-left: 3px">
-              <el-tab-pane label="鍦ㄧ嚎瀛﹀憳" name="1"></el-tab-pane>
-              <el-tab-pane label="绂荤嚎瀛﹀憳" name="0"></el-tab-pane>
-            </el-tabs>
-            <el-row :gutter="20" v-for="student in showStudentList" :key="student.id" class="student-row">
-              <el-col :span="18">
-                <div>
-                  {{student.realName}}
-                </div>
-              </el-col>
-              <el-col :span="6">
-                <div :class="{online: student.onlineStatus === 1, outline: student.onlineStatus === 0}">
-                  {{getStatus(student.onlineStatus)}}
-                </div>
-              </el-col>
-            </el-row>
+          </el-row>
+          <el-tabs v-model="searchForm.onlineStatus" @tab-click="handleTabChange" style="margin-left: 3px">
+            <el-tab-pane label="鍦ㄧ嚎瀛﹀憳" name="1"></el-tab-pane>
+            <el-tab-pane label="绂荤嚎瀛﹀憳" name="0"></el-tab-pane>
+          </el-tabs>
+          <el-row :gutter="20" v-for="student in showStudentList" :key="student.id" class="student-row">
+            <el-col :span="18">
+              <div>
+                {{student.realName}}
+              </div>
+            </el-col>
+            <el-col :span="6">
+              <div :class="{online: student.onlineStatus === 1, outline: student.onlineStatus === 0}">
+                {{getStatus(student.onlineStatus)}}
+              </div>
+            </el-col>
           </el-row>
         </el-row>
       </div>
@@ -38,10 +38,12 @@
 <script>
 import { getStudentList } from '@/api/meet'
 
-let jitsiApi = null
 export default {
   data () {
     return {
+      jitsiApi: null,
+      width: 0,
+      height: 0,
       showStudent: true,
       intervalId: null,
       meetId: null,
@@ -57,11 +59,17 @@
     }
   },
   methods: {
-    getShowText() {
+    hiddenStudent () {
+      this.showStudent = !this.showStudent
+    },
+    changeJitsiWindowSize (width, height) {
+      this.jitsiApi.resizeLargeVideo(width, height)
+    },
+    getShowText () {
       if (this.showStudent) {
-        return '闅愯棌鍦ㄧ嚎鎯呭喌'
+        return '闅愯棌'
       } else {
-        return '灞曠ず鍦ㄧ嚎鎯呭喌'
+        return '鏄剧ず'
       }
     },
     getStatus (status) {
@@ -89,7 +97,7 @@
       })
     },
     getRoomInfo () {
-      jitsiApi.getRoomsInfo().then(rooms => {
+      this.jitsiApi.getRoomsInfo().then(rooms => {
         rooms.rooms.forEach(room => {
           // 鎴块棿鐨刬d鏄竴涓瓙鍩熷悕锛屼笖@绗﹀墠鐨勪細璁悕绉版槸缁忚繃URL缂栫爜鐨�
           let encodedPart = room.id.split('@')[0]
@@ -119,8 +127,8 @@
     }
   },
   mounted () {
-    const width = window.innerWidth * 0.8
-    const height = window.innerHeight
+    this.width = window.innerWidth * 0.8
+    this.height = window.innerHeight
     this.meetId = this.$route.query.meetId
     this.getStudentList()
     const domain = this.$route.query.domain
@@ -130,8 +138,8 @@
     const userInfo = userInfoStr ? JSON.parse(userInfoStr) : null
     const options = {
       roomName: roomName,
-      width: width,
-      height: height,
+      width: this.width,
+      height: this.height,
       parentNode: this.$refs.meet,
       lang: 'zh_CN',
       userInfo: userInfo,
@@ -146,9 +154,9 @@
       toolbarButtons: ['whiteboard']
     }
 
-    jitsiApi = new window.JitsiMeetExternalAPI(domain, options)
+    this.jitsiApi = new window.JitsiMeetExternalAPI(domain, options)
 
-    jitsiApi.addListener('readyToClose', () => {
+    this.jitsiApi.addListener('readyToClose', () => {
       window.close()
     })
     // 姣忎笁绉掓洿瀛﹀憳鍦ㄧ嚎鐘舵��

--
Gitblit v1.8.0