Browse Source

update .eslintrc.js

dusenyao 3 years ago
parent
commit
032ed15f55

+ 26 - 86
.eslintrc.js

@@ -87,19 +87,17 @@ module.exports = {
       }
     ],
     'comma-style': [2, 'last'],
-    'constructor-super': 2,
     curly: [2, 'multi-line'],
     'dot-location': [2, 'property'],
     'eol-last': 2,
-    eqeqeq: ['error', 'always', { null: 'ignore' }],
+    eqeqeq: [1, 'always'],
     'generator-star-spacing': [
       2,
       {
-        before: true,
+        before: false,
         after: true
       }
     ],
-    'handle-callback-err': [2, '^(err|error)$'],
     indent: [
       2,
       2,
@@ -130,11 +128,7 @@ module.exports = {
       }
     ],
     'no-caller': 2,
-    'no-control-regex': 0,
-    'no-dupe-class-members': 2,
-    'no-empty-pattern': 2,
     'no-eval': 2,
-    'no-fallthrough': 2,
     'no-labels': [
       2,
       {
@@ -142,7 +136,6 @@ module.exports = {
         allowSwitch: false
       }
     ],
-    'no-mixed-spaces-and-tabs': 2,
     'no-multi-spaces': 2,
     'no-multiple-empty-lines': [
       2,
@@ -150,12 +143,8 @@ module.exports = {
         max: 1
       }
     ],
-    'no-new-symbol': 2,
-    'no-path-concat': 2,
     'no-return-assign': [2, 'except-parens'],
-    'no-self-assign': 2,
     'no-sequences': 2,
-    'no-this-before-super': 2,
     'no-trailing-spaces': 2,
     'no-unmodified-loop-condition': 2,
     'no-unneeded-ternary': [
@@ -164,9 +153,8 @@ module.exports = {
         defaultAssignment: false
       }
     ],
-    'no-unsafe-finally': 2,
     'no-unused-vars': [
-      2,
+      1,
       {
         vars: 'all',
         args: 'none'
@@ -174,7 +162,6 @@ module.exports = {
     ],
     'no-useless-computed-key': 2,
     'no-useless-constructor': 2,
-    'no-useless-escape': 0,
     'no-whitespace-before-property': 2,
     'one-var': [
       2,
@@ -201,7 +188,7 @@ module.exports = {
         allowTemplateLiterals: true
       }
     ],
-    semi: [0, 'never'],
+    semi: [2, 'always'],
     'semi-spacing': [
       2,
       {
@@ -227,8 +214,6 @@ module.exports = {
       }
     ],
     'template-curly-spacing': [2, 'never'],
-    'use-isnan': 2,
-    'valid-typeof': 2,
     'wrap-iife': [2, 'any'],
     'yield-star-spacing': [2, 'both'],
     'object-curly-spacing': [
@@ -238,84 +223,47 @@ module.exports = {
         objectsInObjects: false
       }
     ],
-    'no-alert': 0,
+    'no-alert': process.env.NODE_ENV === 'production' ? 1 : 0,
     'no-array-constructor': 2,
-    'no-bitwise': 0,
-    'no-catch-shadow': 2,
-    'no-class-assign': 2,
-    'no-cond-assign': 2,
-    'no-const-assign': 2,
-    'no-constant-condition': 2,
-    'no-continue': 0,
-    'no-delete-var': 2,
+    'no-bitwise': 1,
     'no-div-regex': 1,
-    'no-dupe-keys': 2,
-    'no-dupe-args': 2,
-    'no-duplicate-case': 2,
     'no-else-return': 2,
-    'no-empty': 2,
-    'no-empty-character-class': 2,
-    'no-empty-label': 0,
+    'no-empty': 1,
     'no-eq-null': 2,
-    'no-ex-assign': 2,
     'no-extend-native': 2,
     'no-extra-bind': 2,
-    'no-extra-boolean-cast': 2,
     'no-extra-parens': [2, 'functions'],
-    'no-extra-semi': 2,
     'no-floating-decimal': 2,
-    'no-func-assign': 2,
     'no-implicit-coercion': 1,
     'no-implied-eval': 2,
     'no-inline-comments': 0,
-    'no-inner-declarations': [2, 'functions'],
-    'no-invalid-regexp': 2,
     'no-invalid-this': 2,
-    'no-irregular-whitespace': 2,
     'no-iterator': 2,
     'no-label-var': 2,
     'no-lone-blocks': 2,
     'no-lonely-if': 2,
     'no-loop-func': 1,
-    'no-mixed-requires': [0, false],
     'linebreak-style': [0, 'windows'],
     'no-multi-str': 2,
-    'no-native-reassign': 2,
-    'no-negated-in-lhs': 2,
     'no-nested-ternary': 0,
     'no-new': 1,
     'no-new-func': 1,
     'no-new-object': 2,
-    'no-new-require': 2,
     'no-new-wrappers': 2,
-    'no-obj-calls': 2,
-    'no-octal': 2,
     'no-octal-escape': 2,
     'no-param-reassign': 2,
-    'no-plusplus': 0,
-    'no-process-env': 0,
-    'no-process-exit': 0,
+    'no-plusplus': [1, { allowForLoopAfterthoughts: true }],
     'no-proto': 2,
-    'no-redeclare': 2,
-    'no-regex-spaces': 2,
-    'no-restricted-modules': 0,
-    'no-script-url': 0,
     'no-self-compare': 2,
-    'no-shadow-restricted-names': 2,
-    'no-spaced-func': 2,
-    'no-sparse-arrays': 2,
-    'no-sync': 0,
+    'func-call-spacing': 2,
     'no-ternary': 0,
     'no-throw-literal': 2,
-    'no-undef': 2,
     'no-undef-init': 2,
-    'no-unexpected-multiline': 2,
     'no-underscore-dangle': 1,
-    'no-unreachable': 2,
     'no-use-before-define': 2,
     'no-useless-call': 2,
     'no-void': 2,
-    'no-var': 0,
+    'no-var': 2,
     'no-warning-comments': [
       1,
       {
@@ -323,45 +271,37 @@ module.exports = {
         location: 'start'
       }
     ],
-    'no-with': 2,
     'array-bracket-spacing': [2, 'never'],
-    'arrow-parens': 0,
-    'block-scoped-var': 0,
-    'computed-property-spacing': [0, 'never'],
+    'arrow-parens': [1, 'as-needed'],
+    'computed-property-spacing': [1, 'never'],
     'consistent-return': 0,
-    'consistent-this': 0,
-    'default-case': 0,
+    'default-case': 1,
     'dot-notation': [
       0,
       {
         allowKeywords: true
       }
     ],
-    'func-names': 0,
+    'func-names': 1,
     'func-style': [0, 'declaration'],
     'guard-for-in': 0,
     'id-length': 0,
-    'init-declarations': 0,
+    'init-declarations': 1,
     'lines-around-comment': 0,
-    'max-depth': [0, 4],
-    'max-len': [0, 100, 4],
-    'max-nested-callbacks': [0, 2],
-    'max-params': [0, 3],
-    'max-statements': [0, 10],
+    'max-depth': [1, 4],
+    'max-len': [1, { code: 120, ignoreUrls: true, ignoreTemplateLiterals: true, ignoreRegExpLiterals: true }],
+    'max-nested-callbacks': 1,
+    'max-params': [1, 6],
+    'max-statements': [1, 40],
     'new-parens': 2,
-    'object-shorthand': 0,
-    'operator-assignment': [0, 'always'],
-    'prefer-spread': 0,
-    'prefer-reflect': 0,
-    'quote-props': [0, 'always'],
-    radix: 0,
+    'object-shorthand': 1,
+    'operator-assignment': 1,
+    'prefer-spread': 1,
+    'quote-props': [1, 'as-needed'],
+    radix: [1, 'as-needed'],
     'id-match': 0,
-    'require-yield': 0,
-    'sort-vars': 0,
-    'space-after-keywords': [0, 'always'],
-    'space-return-throw-case': 0,
+    'sort-vars': [1, { ignoreCase: true }],
     strict: 2,
-    'valid-jsdoc': 0,
     'vars-on-top': 2,
     'wrap-regex': 0,
     yoda: [2, 'never']

+ 1 - 1
src/api/app.js

@@ -56,7 +56,7 @@ export function fileUpload(SecurityLevel, file) {
     },
     data: formData,
     onUploadProgress: progressEvent => {
-      store.commit(`app/${app.SET_PERCENTAGE}`, ((progressEvent.loaded / progressEvent.total) * 100) | 0);
+      store.commit(`app/${app.SET_PERCENTAGE}`, (progressEvent.loaded / progressEvent.total) * 100 || 0);
     }
   }).finally(() => {
     store.commit(`app/${app.SHOW_PROGRESS}`, false);

+ 3 - 8
src/common/SvgIcon/index.vue

@@ -1,10 +1,5 @@
 <template>
-  <div
-    v-if="isExternal"
-    :style="styleExternalIcon"
-    class="svg-external-icon svg-icon"
-    v-on="$listeners"
-  />
+  <div v-if="isExternal" :style="styleExternalIcon" class="svg-external-icon svg-icon" v-on="$listeners" />
   <svg v-else :class="svgClass" aria-hidden="true" v-on="$listeners">
     <use :xlink:href="iconName" />
   </svg>
@@ -53,14 +48,14 @@ export default {
 .svg-icon {
   width: 1em;
   height: 1em;
+  overflow: hidden;
   vertical-align: -0.15em;
   fill: currentColor;
-  overflow: hidden;
 }
 
 .svg-external-icon {
+  display: inline-block;
   background-color: currentColor;
   mask-size: cover !important;
-  display: inline-block;
 }
 </style>

+ 8 - 0
src/common/show_file/index.vue

@@ -75,6 +75,14 @@ export default {
       if (newVal.length > 0) {
         this.getFileStoreInfo();
       }
+    },
+    dialogVisibleShowFile(newVal) {
+      if (!newVal) {
+        this.pdfSrc = '';
+        this.numPages = 0;
+        this.fileUrl = '';
+        this.text = '';
+      }
     }
   },
   methods: {

+ 1 - 0
src/components/live/CurMaterial.vue

@@ -176,6 +176,7 @@ export default {
         this.material_name = '';
         this.material_type = '';
         this.material_picture_url = '';
+        this.text = '';
       }
     },
 

+ 34 - 34
src/components/payment/Audit.vue

@@ -86,36 +86,36 @@ export default {
 <style lang="scss" scoped>
 .product-details {
   .message {
+    display: flex;
     width: 656px;
     height: 152px;
     background: rgba(70, 70, 70, 0.03);
     border-radius: 8px;
-    display: flex;
 
     .el-image {
       width: 120px;
       height: 120px;
-      margin-left: 16px;
       margin-top: 16px;
+      margin-left: 16px;
     }
 
     .text {
       margin-left: 24px;
 
       .p1 {
+        display: -webkit-box;
         width: 360px;
         max-height: 48px;
+        margin-top: 22px;
+        overflow: hidden;
         font-size: 16px;
         line-height: 20px;
         color: #2c2c2c;
-        margin-top: 22px;
+        text-overflow: ellipsis;
         word-break: break-all;
+        -webkit-line-clamp: 2;
         // 多行文本的情况下,用省略号 “...” 隐藏超出范围的文本
-        display: -webkit-box;
         -webkit-box-orient: vertical;
-        -webkit-line-clamp: 2;
-        text-overflow: ellipsis;
-        overflow: hidden;
       }
 
       .p2 {
@@ -124,14 +124,14 @@ export default {
         span {
           width: 64px;
           height: 24px;
-          background: #ffefd8;
-          border-radius: 4px;
-          font-weight: bold;
+          padding: 2px 8px;
           font-size: 12px;
-          text-align: center;
-          color: $basicColor;
+          font-weight: bold;
           line-height: 24px;
-          padding: 2px 8px;
+          color: $basicColor;
+          text-align: center;
+          background: #ffefd8;
+          border-radius: 4px;
         }
       }
 
@@ -142,23 +142,23 @@ export default {
 
     .price {
       p {
-        margin-left: 67px;
         margin-top: 22px;
-        font-weight: bold;
+        margin-left: 67px;
         font-size: 16px;
-        text-align: right;
+        font-weight: bold;
         color: #ff4c00;
+        text-align: right;
       }
     }
   }
 
   .promotionCode {
     display: flex;
-    justify-content: flex-start;
     align-self: center;
+    justify-content: flex-start;
     width: 100%;
-    margin-top: 24px;
     height: 58px;
+    margin-top: 24px;
     line-height: 56px;
     border-top: 1px solid rgba(44, 44, 44, 0.15);
     border-bottom: 1px solid rgba(44, 44, 44, 0.15);
@@ -169,27 +169,27 @@ export default {
     }
 
     input {
-      padding: 0 24px;
+      box-sizing: border-box;
       flex: 1;
       height: 56px;
-      outline: none;
+      padding: 0 24px;
       border: none;
-      box-sizing: border-box;
+      outline: none;
     }
 
     .sp2 {
-      cursor: pointer;
       font-size: 16px;
       color: $basicColor;
+      cursor: pointer;
     }
   }
 
   .total {
     width: 656px;
-    text-align: right;
-    color: #000;
-    font-size: 16px;
     padding-top: 24px;
+    font-size: 16px;
+    color: #000;
+    text-align: right;
 
     .useCode {
       font-size: 12px;
@@ -228,35 +228,35 @@ export default {
 
   .submitBtn {
     display: flex;
-    justify-content: space-between;
     align-items: center;
+    justify-content: space-between;
     margin-top: 16px;
 
     .text {
+      display: flex;
+      align-items: center;
       width: 520px;
       height: 40px;
+      color: #fff;
       background: #ff6c69;
       border-radius: 4px;
-      color: white;
-      display: flex;
-      align-items: center;
 
       img {
         width: 24px;
-        margin-left: 18px;
         margin-right: 10px;
+        margin-left: 18px;
       }
     }
 
     button {
       width: 120px;
       height: 40px;
-      background: $basicColor;
-      border-radius: 4px;
-      color: white;
       line-height: 40px;
-      border: none;
+      color: #fff;
       cursor: pointer;
+      background: $basicColor;
+      border: none;
+      border-radius: 4px;
     }
   }
 }

+ 9 - 26
src/components/select/SelectCourse.vue

@@ -1,11 +1,5 @@
 <template>
-  <el-dialog
-    class="select-course"
-    :visible="dialogVisible"
-    width="1100px"
-    title="添加课件"
-    @close="dialogClose"
-  >
+  <el-dialog class="select-course" :visible="dialogVisible" width="1100px" title="添加课件" @close="dialogClose">
     <div>
       <el-dropdown trigger="click" placement="top" @command="selectBook">
         <span class="el-dropdown-link">{{ curBook.book_name }}</span>
@@ -19,23 +13,12 @@
     <!--课件内容及章节结构-->
     <div class="content-structure">
       <div class="content-structure-tree">
-        <tree-menus
-          ref="tree"
-          :current-course="currentCourse"
-          :list="nodes"
-          @curCourse="curCourse"
-        />
+        <tree-menus ref="tree" :current-course="currentCourse" :list="nodes" @curCourse="curCourse" />
       </div>
       <div class="content-structure-container">
         <bookquestion v-if="sys_type === 'GCLS'" :context="context" />
 
-        <bookailp
-          v-else
-          :context="context"
-          :ui-type="ui_type"
-          :preview-width="720"
-          :preview-height="405"
-        />
+        <bookailp v-else :context="context" :ui-type="ui_type" :preview-width="720" :preview-height="405" />
       </div>
     </div>
 
@@ -145,8 +128,8 @@ export default {
 <style lang="scss">
 .select-course {
   .el-dialog__body {
-    padding: 15px 20px 0;
     height: 55vh;
+    padding: 15px 20px 0;
     color: $color;
   }
 
@@ -155,28 +138,28 @@ export default {
   }
 
   .el-dropdown-link {
-    cursor: pointer;
     font-size: 24px;
-    color: $color;
     font-weight: 600;
+    color: $color;
+    cursor: pointer;
   }
 
   .content-structure {
     display: flex;
-    margin-top: 8px;
     height: calc(100% - 36px);
+    margin-top: 8px;
 
     &-tree {
       flex: 2.8;
       height: 100%;
-      overflow: auto;
       padding: 0 4px 0 8px;
+      overflow: auto;
     }
 
     &-container {
       flex: 7;
-      overflow: auto;
       padding: 0 8px;
+      overflow: auto;
     }
   }
 }

+ 3 - 16
src/components/select/SelectTeacher.vue

@@ -1,11 +1,5 @@
 <template>
-  <el-dialog
-    class="select-teacher"
-    :visible="dialogVisible"
-    width="900px"
-    title="选择授课教师"
-    @close="dialogClose"
-  >
+  <el-dialog class="select-teacher" :visible="dialogVisible" width="900px" title="选择授课教师" @close="dialogClose">
     <!--查询条件-->
     <el-form :inline="true" :model="searchForm" size="mini">
       <el-form-item label="用户名">
@@ -16,19 +10,12 @@
       </el-form-item>
 
       <el-form-item class="search-button">
-        <el-button type="primary" @click="getTeacherUserList">
-          <i class="el-icon-search" /> 搜索
-        </el-button>
+        <el-button type="primary" @click="getTeacherUserList"> <i class="el-icon-search" /> 搜索 </el-button>
       </el-form-item>
     </el-form>
 
     <!--表格-->
-    <el-table
-      ref="teacherTable"
-      :data="teacherList"
-      height="35vh"
-      @selection-change="handleSelectionChange"
-    >
+    <el-table ref="teacherTable" :data="teacherList" height="35vh" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" />
       <el-table-column prop="user_name" label="用户名" width="120" />
       <el-table-column prop="user_real_name" label="真实姓名" width="120" />

+ 4 - 14
src/components/select/SelectTemplate.vue

@@ -1,11 +1,5 @@
 <template>
-  <el-dialog
-    :visible="dialogVisible"
-    width="900px"
-    title="选择模板"
-    :close-on-click-modal="false"
-    @close="dialogClose"
-  >
+  <el-dialog :visible="dialogVisible" width="900px" title="选择模板" :close-on-click-modal="false" @close="dialogClose">
     <!-- 查询条件 -->
     <div class="query-criteria">
       <el-form :inline="true" :model="searchForm" size="mini">
@@ -14,9 +8,7 @@
         </el-form-item>
 
         <el-form-item class="search-button">
-          <el-button type="primary" @click="queryCourseList">
-            <i class="el-icon-search" /> 搜索
-          </el-button>
+          <el-button type="primary" @click="queryCourseList"> <i class="el-icon-search" /> 搜索 </el-button>
         </el-form-item>
       </el-form>
     </div>
@@ -30,9 +22,7 @@
     >
       <el-table-column prop="name" label="用户名" width="320" />
       <el-table-column label="课程周期">
-        <template slot-scope="{ row }">
-          <i class="el-icon-date" /> {{ row.begin_date }} - {{ row.end_date }}
-        </template>
+        <template slot-scope="{ row }"> <i class="el-icon-date" /> {{ row.begin_date }} - {{ row.end_date }} </template>
       </el-table-column>
     </el-table>
 
@@ -121,7 +111,7 @@ export default {
 </script>
 
 <style lang="scss">
-@import '~@/styles/mixin.scss';
+@import '~@/styles/mixin';
 
 @include dialog;
 @include pagination;

+ 2 - 2
src/components/select/treeMenus.vue

@@ -104,8 +104,8 @@ export default {
   &-name {
     display: flex;
     padding: 12px 0;
-    cursor: pointer;
     font-weight: 700;
+    cursor: pointer;
 
     :nth-child(2):hover {
       color: $basicColor;
@@ -118,8 +118,8 @@ export default {
   }
 
   &.selected {
-    background-color: $basicColor;
     color: #fff;
+    background-color: $basicColor;
   }
 
   &.children {

+ 5 - 5
src/layouts/components/BreadCrumb.vue

@@ -49,30 +49,30 @@ export default {
 
 <style lang="scss">
 .breadcrumb {
+  z-index: 999;
   width: 100%;
   height: 56px;
   line-height: 56px;
   background-color: #f6ecdd;
-  z-index: 999;
 
   &-container {
     width: $basicWidth;
-    height: 100%;
     min-width: $basicWidth;
-    margin: 0 auto;
+    height: 100%;
     padding: 15px 0;
+    margin: 0 auto;
     font-weight: 700;
     line-height: 26px;
     color: #948e85;
     vertical-align: middle;
 
     &::before {
-      content: '';
       display: inline-block;
       width: 6px;
       height: 100%;
-      vertical-align: bottom;
       margin-right: 24px;
+      vertical-align: bottom;
+      content: '';
       background-color: $basicColor;
     }
 

+ 2 - 2
src/layouts/index.vue

@@ -28,7 +28,7 @@ export default {
     }
   },
   created() {
-    window.onerror = function (msg, source, lineno, colno, error) {
+    window.onerror = (msg, source, lineno, colno, error) => {
       if (msg === 'Script error.' && lineno === 0 && colno === 0) return true;
     };
   }
@@ -41,10 +41,10 @@ export default {
   padding-top: $header-h;
 
   &-header {
-    z-index: 1002;
     position: fixed;
     top: 0;
     left: 0;
+    z-index: 1002;
     width: 100%;
   }
 

+ 5 - 14
src/router/index.js

@@ -52,8 +52,7 @@ const routes = [
     children: [
       {
         path: '/create_course/index',
-        component: () =>
-          import(/* webpackChunkName: 'create_course'*/ '@/views/teacher/create_course/index'),
+        component: () => import(/* webpackChunkName: 'create_course'*/ '@/views/teacher/create_course/index'),
         meta: { title: '创建课程' }
       }
     ]
@@ -68,34 +67,26 @@ const routes = [
       {
         path: '/create_course_step_table/course_info',
         component: () =>
-          import(
-            /* webpackChunkName: 'create_course'*/ '@/views/teacher/create_course/step_table/CourseInfo'
-          )
+          import(/* webpackChunkName: 'create_course'*/ '@/views/teacher/create_course/step_table/CourseInfo')
       },
       // 分步表单 -> 第二步
       {
         path: '/create_course_step_table/select_book/:id',
         name: 'SelectBook',
         component: () =>
-          import(
-            /* webpackChunkName: 'create_course'*/ '@/views/teacher/create_course/step_table/SelectBook'
-          )
+          import(/* webpackChunkName: 'create_course'*/ '@/views/teacher/create_course/step_table/SelectBook')
       },
       // 分步表单 -> 第三步
       {
         path: '/create_course_step_table/create_task/:id',
         component: () =>
-          import(
-            /* webpackChunkName: 'create_course'*/ '@/views/teacher/create_course/step_table/CreateTask'
-          )
+          import(/* webpackChunkName: 'create_course'*/ '@/views/teacher/create_course/step_table/CreateTask')
       },
       // 分步表单 -> 第三步 -> 新建课节任务
       {
         path: '/create_course_step_table/new_task/:time_type/:id/:cs_item_id',
         component: () =>
-          import(
-            /* webpackChunkName: 'create_course'*/ '@/views/teacher/create_course/step_table/NewTask'
-          )
+          import(/* webpackChunkName: 'create_course'*/ '@/views/teacher/create_course/step_table/NewTask')
       }
     ]
   },

+ 1 - 1
src/settings.js

@@ -8,5 +8,5 @@ if (config) {
 }
 
 module.exports = {
-  title: title
+  title
 };

+ 1 - 9
src/store/modules/user.js

@@ -26,15 +26,7 @@ const mutations = {
   },
   [user.SET_USER_INFO]: (
     state,
-    {
-      user_code,
-      user_real_name,
-      user_type,
-      language_type,
-      session_id,
-      image_url,
-      popedom_code_list
-    }
+    { user_code, user_real_name, user_type, language_type, session_id, image_url, popedom_code_list }
   ) => {
     state.user_code = user_code;
     state.user_real_name = user_real_name;

+ 1 - 1
src/utils/validate.js

@@ -20,7 +20,7 @@ export function twoDecimal(value) {
   val = val.replace(/[^\d.]/g, ''); // 清除"数字"和"."以外的字符
   val = val.replace(/\.{2,}/g, '.'); // 只保留第一个 "." 清除多余的
   val = val.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.');
-  val = val.replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); // 只能输入两位小数
+  val = val.replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3'); // 只能输入两位小数
   return val;
 }
 

+ 2 - 2
src/views/404.vue

@@ -12,11 +12,11 @@ export default {
 
 <style lang="scss">
 .http-404 {
-  transform: translate(-50%, -50%);
   position: absolute;
   top: 40%;
   left: 50%;
-  color: rgb(0, 174, 255);
   font-size: 32px;
+  color: rgb(0, 174, 255);
+  transform: translate(-50%, -50%);
 }
 </style>

+ 1 - 1
src/views/live/student/group.js

@@ -193,7 +193,7 @@ export function initListener(vue) {
     // 直播开启状态下,尝试重推这条流
   });
 
-  rtc.on('kick_out', function () {
+  rtc.on('kick_out', () => {
     console.log('自己被踢出房间');
   });
 

+ 3 - 3
src/views/live/student/live.js

@@ -154,7 +154,7 @@ export function initListener(vue) {
   });
 
   // 推流前查询直播状态失败,导致没有推流
-  rtc.on('local_stream_publish_failed', function () {
+  rtc.on('local_stream_publish_failed', () => {
     console.log('推流前查询直播状态失败,导致没有推流');
     Message({
       message: '推流前查询直播状态失败,导致没有推流',
@@ -222,7 +222,7 @@ export function initListener(vue) {
     console.log(data);
   });
 
-  rtc.on('kick_out', function () {
+  rtc.on('kick_out', () => {
     console.log('自己被踢出房间');
   });
 
@@ -330,7 +330,7 @@ export function initListener(vue) {
   });
 
   // 接收自定义消息
-  rtc.on('publish_message', function (data) {
+  rtc.on('publish_message', data => {
     // 连接中途下麦
     if (data.type === 'handsDown-load' && data.uid === vue.room_user_id) {
       vue.callLoading = false;

+ 1 - 0
src/views/live/teacher/CompleteList.vue

@@ -185,6 +185,7 @@ export default {
         this.context = null;
         this.curStudentID = '';
         this.bookAnswerContent = '';
+        this.text = '';
       }
     },
 

+ 5 - 5
src/views/live/teacher/group.js

@@ -105,7 +105,7 @@ export function initListener(vue) {
   });
 
   // 新增订阅流事件
-  rtc.on('allow_sub', function (stream) {
+  rtc.on('allow_sub', stream => {
     if (stream.isMixed()) {
       console.log('是混合流,不订阅');
     } else {
@@ -129,7 +129,7 @@ export function initListener(vue) {
   });
 
   // 直播未开始,不能推流
-  rtc.on('not_live', function () {
+  rtc.on('not_live', () => {
     console.log('直播未开始,不能推流');
     Message({
       message: '直播未开始,不能推流',
@@ -138,7 +138,7 @@ export function initListener(vue) {
   });
 
   // 推流前查询直播状态失败,导致没有推流
-  rtc.on('local_stream_publish_failed', function () {
+  rtc.on('local_stream_publish_failed', () => {
     console.log('推流前查询直播状态失败,导致没有推流');
     Message({
       message: '推流前查询直播状态失败,导致没有推流',
@@ -197,13 +197,13 @@ export function initListener(vue) {
   });
 
   // 停止订阅流
-  rtc.on('unSub', function (stream) {
+  rtc.on('unSub', stream => {
     console.log('停止订阅流', stream);
     unSubscribeStream(stream);
   });
 
   // 用户退出房间通知其他人员事件
-  rtc.on('exit_room_user', function (data) {
+  rtc.on('exit_room_user', data => {
     console.log('用户退出房间通知其他人员事件', data);
   });
 

+ 1 - 1
src/views/live/teacher/index.vue

@@ -699,7 +699,7 @@ export default {
     // 画笔变更
     drawChange(action, value) {
       if (action === 'color') {
-        common.drawChange(action, parseInt(Number(value.replace('#', '0x')), 10));
+        common.drawChange(action, parseInt(Number(value.replace('#', '0x'))));
         this.curColor = value;
       } else {
         common.drawChange(action, value);

+ 3 - 3
src/views/live/teacher/live.js

@@ -196,7 +196,7 @@ export function initListener(vue) {
   });
 
   // 直播未开始,不能推流
-  rtc.on('not_live', function () {
+  rtc.on('not_live', () => {
     console.log('直播未开始,不能推流');
     Message({
       message: '直播未开始,不能推流',
@@ -205,7 +205,7 @@ export function initListener(vue) {
   });
 
   // 推流前查询直播状态失败,导致没有推流
-  rtc.on('local_stream_publish_failed', function () {
+  rtc.on('local_stream_publish_failed', () => {
     console.log('推流前查询直播状态失败,导致没有推流');
     Message({
       message: '推流前查询直播状态失败,导致没有推流',
@@ -427,7 +427,7 @@ export function unPubShareStream() {
  */
 export function liveRecord(status) {
   rtc.liveRecord({
-    status: status,
+    status,
     success(data) {
       console.log('成功', data);
     },

+ 1 - 1
src/views/teacher/create_course/step_table/NewTask.vue

@@ -284,7 +284,7 @@ export default {
             cs_item_id: this.cs_item_id,
             name: this.form.name,
             time_type: Number(this.time_type),
-            teaching_type: teaching_type,
+            teaching_type,
             begin_time: `${this.form.begin_date} ${this.form.begin_date_hour}:${this.form.begin_date_minute}`,
             end_time: `${this.form.end_date} ${this.form.end_date_hour}:${this.form.end_date_minute}`,
             teacher_id: this.form.teacher_id,