dusenyao пре 3 година
родитељ
комит
8b61f4a1a3

+ 15 - 9
package-lock.json

@@ -10,7 +10,7 @@
       "dependencies": {
         "ailp-book-question-ui": "file:../ailp-book-question-ui-0.1.1.tgz",
         "awe-dnd": "^0.3.4",
-        "axios": "^0.24.0",
+        "axios": "^0.25.0",
         "book-ui": "file:../book-ui-0.2.14.tgz",
         "core-js": "^3.20.3",
         "dayjs": "^1.10.7",
@@ -4510,10 +4510,11 @@
       "license": "MIT"
     },
     "node_modules/axios": {
-      "version": "0.24.0",
-      "license": "MIT",
+      "version": "0.25.0",
+      "resolved": "https://registry.npmjs.org/axios/-/axios-0.25.0.tgz",
+      "integrity": "sha512-cD8FOb0tRH3uuEe6+evtAbgJtfxr7ly3fQjYcMcuPlgkwVS9xboaVIpcDV+cYQe+yGykgwZCs1pzjntcGa6l5g==",
       "dependencies": {
-        "follow-redirects": "^1.14.4"
+        "follow-redirects": "^1.14.7"
       }
     },
     "node_modules/babel-code-frame": {
@@ -9979,14 +9980,15 @@
       }
     },
     "node_modules/follow-redirects": {
-      "version": "1.14.4",
+      "version": "1.14.7",
+      "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.7.tgz",
+      "integrity": "sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==",
       "funding": [
         {
           "type": "individual",
           "url": "https://github.com/sponsors/RubenVerborgh"
         }
       ],
-      "license": "MIT",
       "engines": {
         "node": ">=4.0"
       },
@@ -25818,9 +25820,11 @@
       "version": "1.11.0"
     },
     "axios": {
-      "version": "0.24.0",
+      "version": "0.25.0",
+      "resolved": "https://registry.npmjs.org/axios/-/axios-0.25.0.tgz",
+      "integrity": "sha512-cD8FOb0tRH3uuEe6+evtAbgJtfxr7ly3fQjYcMcuPlgkwVS9xboaVIpcDV+cYQe+yGykgwZCs1pzjntcGa6l5g==",
       "requires": {
-        "follow-redirects": "^1.14.4"
+        "follow-redirects": "^1.14.7"
       }
     },
     "babel-code-frame": {
@@ -29588,7 +29592,9 @@
       }
     },
     "follow-redirects": {
-      "version": "1.14.4"
+      "version": "1.14.7",
+      "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.7.tgz",
+      "integrity": "sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ=="
     },
     "for-each": {
       "version": "0.3.3",

+ 1 - 1
package.json

@@ -15,7 +15,7 @@
   "dependencies": {
     "ailp-book-question-ui": "file:../ailp-book-question-ui-0.1.1.tgz",
     "awe-dnd": "^0.3.4",
-    "axios": "^0.24.0",
+    "axios": "^0.25.0",
     "book-ui": "file:../book-ui-0.2.14.tgz",
     "core-js": "^3.20.3",
     "dayjs": "^1.10.7",

+ 1 - 2
src/App.vue

@@ -6,10 +6,9 @@
 </template>
 
 <script>
-import ProgressBar from '@/common/progress_bar';
+import ProgressBar from '@/common/progress_bar/index.vue';
 
 export default {
-  name: 'App',
   components: {
     ProgressBar
   }

+ 0 - 6
src/components/live/SelectMaterial.vue

@@ -9,7 +9,6 @@
       @close="dialogClose"
     >
       <div v-for="item in material_list" :key="item.material_id" class="material">
-        <el-image fit="contain" :src="item.material_picture_url" />
         <div class="material-info">
           <div class="material-info-name">
             {{ item.material_name }}
@@ -92,11 +91,6 @@ $list-h: 120px;
     margin-bottom: 16px;
     border: 1px solid #d9d9d9;
 
-    .el-image {
-      width: 192px;
-      height: $list-h;
-    }
-
     &-info {
       display: flex;
       flex: 6;

+ 4 - 8
src/views/live/student/live.js

@@ -97,14 +97,10 @@ export function initListener(vue) {
         let device = store.state.app.liveDevice;
         vue.device = data;
 
-        let isVideo =
-          data.video.some(item => item.deviceId === device.video) ||
-          (data.video.length === 0 && device.video.length === 0);
-        let isAudio =
-          data.audio.some(item => item.deviceId === device.audio) ||
-          (data.audio.length === 0 && device.audio.length === 0);
-
-        if (!isVideo || !isAudio) {
+        let isVideo = device.video.length > 0 && data.video.some(item => item.deviceId === device.video);
+        let isAudio = device.audio.length > 0 && data.audio.some(item => item.deviceId === device.audio);
+
+        if (!isVideo && !isAudio) {
           vue.setDevice();
         }
       },

+ 30 - 6
src/views/live/teacher/index.vue

@@ -94,20 +94,23 @@
         </div>
         <div class="button-group">
           <div class="button-group-left">
-            <span class="icon-button" @click="publishShareStream">
+            <span
+              class="icon-button"
+              :data-name="remoteStreamType === 1 ? '结束共享' : '屏幕共享'"
+              @click="publishShareStream"
+            >
               <svg-icon :icon-class="remoteStreamType === 1 ? 'close' : 'share'" />
             </span>
-            <span class="icon-button" @click="showDrawSetting">
+            <span class="icon-button" data-name="白板" @click="showDrawSetting">
               <svg-icon icon-class="draw" />
             </span>
-            <span class="icon-button" @click="startGroup">
+            <span class="icon-button" data-name="群组讨论" @click="startGroup">
               <svg-icon icon-class="group" />
             </span>
-            <span class="icon-button" @click="dialogVisible = true">
+            <span class="icon-button" data-name="课件推送" @click="dialogVisible = true">
               <svg-icon icon-class="push" />
             </span>
           </div>
-          <div class="button-group-right" />
         </div>
       </div>
       <!-- 右侧 -->
@@ -276,6 +279,7 @@ import SelectDevice from '../SelectDevice.vue';
 import * as common from './live';
 
 export default {
+  name: 'TeacherLive',
   components: {
     SelectMaterial,
     CompleteList,
@@ -1117,7 +1121,8 @@ $draw-h: 520px;
             color: #fff;
           }
 
-          > .icon-button {
+          .icon-button {
+            position: relative;
             display: inline-block;
             height: 100%;
             padding: 14px 16px;
@@ -1127,6 +1132,25 @@ $draw-h: 520px;
             &:hover {
               background-color: #3d3d3d;
             }
+
+            &:hover::after {
+              position: absolute;
+              top: 60px;
+              left: -50%;
+              height: 40px;
+              padding: 8px 24px;
+              line-height: 24px;
+              color: #fff;
+              word-break: keep-all;
+              white-space: nowrap;
+              content: attr(data-name);
+              background-color: #3d3d3d;
+              border-radius: 4px;
+            }
+
+            &:first-child:hover::after {
+              left: -12px;
+            }
           }
         }
       }

+ 4 - 8
src/views/live/teacher/live.js

@@ -134,14 +134,10 @@ export function initListener(vue) {
           });
         }
 
-        let isVideo =
-          data.video.some(item => item.deviceId === device.video) ||
-          (data.video.length === 0 && device.video.length === 0);
-        let isAudio =
-          data.audio.some(item => item.deviceId === device.audio) ||
-          (data.audio.length === 0 && device.audio.length === 0);
-
-        if (!isVideo || !isAudio) {
+        let isVideo = device.video.length > 0 && data.video.some(item => item.deviceId === device.video);
+        let isAudio = device.audio.length > 0 && data.audio.some(item => item.deviceId === device.audio);
+
+        if (!isVideo && !isAudio) {
           vue.setDevice(false);
         } else {
           createLocalStream(vue);

+ 6 - 8
src/views/main/TaskList.vue

@@ -68,9 +68,7 @@
             {{ date_stamp }}
           </li>
           <li
-            v-for="(
-              { id, cs_item_name, time_type, course_name, teaching_type, time_space_view_txt, name }, j
-            ) in task_list"
+            v-for="{ id, cs_item_name, time_type, course_name, teaching_type, time_space_view_txt, name } in task_list"
             :key="id"
             class="task-item"
             :style="{
@@ -90,10 +88,10 @@
               </span>
               <span
                 class="task-button"
-                :style="{ 'background-color': buttonColorList[j % 3] }"
+                :style="{ 'background-color': buttonColorList.get(time_type) }"
                 @click.stop="taskLink(teaching_type, id)"
               >
-                {{ getTimeTypeName(time_type) }}{{ $t('Key289') }}
+                {{ $t(getTimeTypeName(time_type)) }}{{ $t('Key289') }}
               </span>
             </div>
             <div class="task-item-bottom">
@@ -175,9 +173,9 @@ export default {
   },
   methods: {
     getTimeTypeName(type) {
-      if (type === 0) return this.$i18n.t('Key292');
-      if (type === 1) return this.$i18n.t('Key293');
-      if (type === 2) return this.$i18n.t('Key294');
+      if (type === 0) return 'Key292';
+      if (type === 1) return 'Key293';
+      if (type === 2) return 'Key294';
       return '';
     },
 

+ 5 - 1
src/views/main/data.js

@@ -38,7 +38,11 @@ const colorMatching = [
   }
 ];
 
-const buttonColorList = ['#f90', '#00CD8F', '#63A1FF'];
+const buttonColorList = new Map([
+  [0, '#63A1FF'],
+  [1, '#f90'],
+  [2, '#00CD8F']
+]);
 
 function getMenuList() {
   let popedom_code_list = store.state.user.popedom_code_list;

+ 1 - 0
stylelint.config.js

@@ -9,6 +9,7 @@ module.exports = {
   ],
   plugins: ['stylelint-declaration-block-no-ignored-properties'],
   rules: {
+    'scss/no-global-function-names': null,
     'plugin/declaration-block-no-ignored-properties': true,
     'order/properties-alphabetical-order': null,
     // 指定2个空格