dusenyao 3 年之前
父節點
當前提交
50cccaec66

+ 8 - 1
.vscode/settings.json

@@ -3,5 +3,12 @@
     "GCLS",
     "KHPJ",
     "XYZP"
-  ]
+  ],
+  "workbench.colorCustomizations": {
+    "titleBar.activeBackground": "#42b883",
+    "titleBar.activeForeground": "#15202b",
+    "titleBar.inactiveBackground": "#42b88399",
+    "titleBar.inactiveForeground": "#15202b99"
+  },
+  "peacock.color": "#42b883"
 }

+ 13 - 0
src/api/app.js

@@ -106,6 +106,19 @@ export function GetFileStoreInfo(data) {
 }
 
 /**
+ * 得到系统标志
+ */
+export function GetLogo() {
+  let params = getRequestParams('sys_config_manager-GetLogo');
+
+  return request({
+    method: 'post',
+    url: process.env.VUE_APP_FileServer,
+    params
+  });
+}
+
+/**
  * 通用请求
  * @param {String} MethodName 方法名
  * @param {Object} data

+ 6 - 0
src/main.js

@@ -2,6 +2,8 @@ import Vue from 'vue';
 import App from './App.vue';
 import router from './router';
 import store from './store';
+import { GetLogo } from '@/api/app';
+import { app } from '@/store/mutation-types';
 
 import ElementUI from 'element-ui';
 import 'element-ui/lib/theme-chalk/index.css';
@@ -17,6 +19,10 @@ import 'normalize.css/normalize.css';
 import i18n from '@/utils/i18n';
 import '@/permission'; // 权限控制
 
+GetLogo().then(({ title }) => {
+  store.commit(`app/${app.SET_TITLE}`, title);
+});
+
 Vue.use(ElementUI);
 Vue.use(GCLSBookQuestionUI);
 Vue.use(VueDND);

+ 0 - 1
src/store/getters.js

@@ -1,5 +1,4 @@
 const getters = {
-  state: state => state.user.state,
   language_type: state => state.user.language_type,
   showProgress: state => state.app.showProgress,
   percentage: state => state.app.percentage

+ 6 - 1
src/store/modules/app.js

@@ -13,7 +13,8 @@ const getDefaultSate = () => {
   return {
     liveDevice: device,
     showProgress: false,
-    percentage: 0
+    percentage: 0,
+    title: ''
   };
 };
 
@@ -29,6 +30,10 @@ const mutations = {
   },
   [app.SET_PERCENTAGE]: (state, percentage) => {
     state.percentage = percentage;
+  },
+  [app.SET_TITLE]: (state, title) => {
+    state.title = title;
+    document.title = title;
   }
 };
 

+ 2 - 1
src/store/mutation-types.js

@@ -7,7 +7,8 @@ const user = {
 const app = {
   SET_DEVICE: 'SET_DEVICE',
   SHOW_PROGRESS: 'SHOW_PROGRESS',
-  SET_PERCENTAGE: 'SET_PERCENTAGE'
+  SET_PERCENTAGE: 'SET_PERCENTAGE',
+  SET_TITLE: 'SET_TITLE'
 };
 
 export { user, app };

+ 14 - 6
src/views/live/student/group.vue

@@ -50,6 +50,7 @@
             <div class="live-wrapper-stream">
               {{ searchStudentName(item.id()) }}
               <svg-icon :icon-class="item.hasAudio() ? 'mike-on-grey' : ''" />
+              <svg-icon v-if="isMobile(item.id())" icon-class="mobile" />
             </div>
           </div>
           <!-- 无流列表 -->
@@ -373,8 +374,8 @@ export default {
     // 分组讨论
     GetGroupStatus() {
       this.timer = setInterval(() => {
-        GetGroupStatus({ task_id: this.task_id })
-          .then(({ is_enable_group, is_has_group_message, group_message_text }) => {
+        GetGroupStatus({ task_id: this.task_id }).then(
+          ({ is_enable_group, is_has_group_message, group_message_text }) => {
             if (is_enable_group === 'false') {
               clearInterval(this.timer);
               CreateEnterLiveRoomSession({
@@ -398,10 +399,8 @@ export default {
                 confirmButtonText: '关闭'
               });
             }
-          })
-          .catch(() => {
-            clearInterval(this.timer);
-          });
+          }
+        );
       }, 5000);
     },
 
@@ -414,6 +413,15 @@ export default {
       return '';
     },
 
+    isMobile(id) {
+      let uid = id.split('-')[0];
+      if (uid) {
+        let student = this.student_list.find(item => item.room_user_id === uid);
+        return student ? student.is_mobile === 'true' : false;
+      }
+      return false;
+    },
+
     getMyGroupInfo_Student() {
       GetMyGroupInfo_Student({
         task_id: this.task_id

+ 38 - 18
src/views/live/student/index.vue

@@ -117,6 +117,10 @@
         <ul>
           <li v-for="item in student_list" :key="item.room_user_id">
             <div class="li-top">
+              <svg-icon
+                v-if="item.is_mobile === 'true'"
+                :icon-class="item.is_exit_page === 'true' ? 'mobile-close' : 'mobile'"
+              />
               <el-avatar icon="el-icon-user" :size="40" :src="item.student_image_url" />
             </div>
             <div class="li-bottom">
@@ -419,6 +423,21 @@ export default {
     },
 
     inviteAccept() {
+      let device = this.$store.state.app.liveDevice;
+      if (
+        (this.roomInfo.video_mode === 1 && device.video.length === 0) ||
+        (this.roomInfo.video_mode === 2 && device.audio.length === 0)
+      ) {
+        common.sendPublishMessage({
+          type: 'no-device',
+          video_mode: this.roomInfo.video_mode
+        });
+        this.handsDown();
+        return this.$message.warning(
+          `当前没有设置${this.roomInfo.video_mode === 1 ? '视频' : '音频'}设备`
+        );
+      }
+
       common.inviteAccept({
         success: str => {
           this.dealStudentConnection(this.room_user_id, 2, this.roomInfo.video_mode);
@@ -447,19 +466,15 @@ export default {
     // 分组讨论
     GetGroupStatus() {
       this.timer_group = setInterval(() => {
-        GetGroupStatus({ task_id: this.task_id })
-          .then(({ is_enable_group }) => {
-            if (is_enable_group === 'true') {
-              clearInterval(this.timer_group);
-              this.$router.push({
-                path: '/live/student/group',
-                query: { task_id: this.task_id }
-              });
-            }
-          })
-          .catch(() => {
+        GetGroupStatus({ task_id: this.task_id }).then(({ is_enable_group }) => {
+          if (is_enable_group === 'true') {
             clearInterval(this.timer_group);
-          });
+            this.$router.push({
+              path: '/live/student/group',
+              query: { task_id: this.task_id }
+            });
+          }
+        });
       }, 5000);
     },
 
@@ -493,8 +508,8 @@ export default {
 
     getCurMaterialSent() {
       const timer = setInterval(() => {
-        GetCurMaterialSent({ task_id: this.task_id })
-          .then(({ material_id, material_name, material_type, material_picture_url }) => {
+        GetCurMaterialSent({ task_id: this.task_id }).then(
+          ({ material_id, material_name, material_type, material_picture_url }) => {
             if (material_id !== undefined && material_id.length > 0) {
               this.dialogVisibleMaterial = true;
               this.material_id = material_id;
@@ -503,10 +518,8 @@ export default {
               this.material_picture_url = material_picture_url;
               clearInterval(timer);
             }
-          })
-          .catch(() => {
-            clearInterval(timer);
-          });
+          }
+        );
       }, 2000);
     }
   }
@@ -817,11 +830,18 @@ $draw-h: 520px;
           margin: 0 8px 8px 0;
 
           .li-top {
+            position: relative;
             width: 100%;
             background-color: #000;
             height: 72px;
             text-align: center;
 
+            .svg-icon {
+              position: absolute;
+              top: 10px;
+              right: 10px;
+            }
+
             .el-avatar--icon {
               margin-top: 16px;
             }

+ 10 - 0
src/views/live/teacher/group.vue

@@ -42,6 +42,7 @@
             <div class="live-wrapper-stream">
               {{ searchStudentName(item.id()) }}
               <svg-icon :icon-class="item.hasAudio() ? 'mike-on-grey' : ''" />
+              <svg-icon v-if="isMobile(item.id())" icon-class="mobile" />
             </div>
           </div>
 
@@ -364,6 +365,15 @@ export default {
       return '';
     },
 
+    isMobile(id) {
+      let uid = id.split('-')[0];
+      if (uid) {
+        let student = this.student_list.find(item => item.room_user_id === uid);
+        return student ? student.is_mobile === 'true' : false;
+      }
+      return false;
+    },
+
     exitCurGroup_Teacher() {
       ExitCurGroup_Teacher({ task_id: this.task_id }).then(() => {
         this.isGroup = false;

+ 9 - 0
src/views/live/teacher/live.js

@@ -335,6 +335,15 @@ export function initListener(vue) {
         message: '对方已挂断'
       });
     }
+
+    // 无对应设备
+    if (data.type === 'no-device') {
+      vue.callLoading = false;
+      Message({
+        type: 'warning',
+        message: `对方当前没有${data.video_mode === 1 ? '视频' : '音频'}设备`
+      });
+    }
   });
 }
 

+ 2 - 2
vue.config.js

@@ -1,5 +1,5 @@
-const path = require('path');
-const StyleLintPlugin = require('stylelint-webpack-plugin');
+import path from 'path';
+import StyleLintPlugin from 'stylelint-webpack-plugin';
 
 function resolve(dir) {
   return path.join(__dirname, './', dir);