Explorar o código

Merge branch 'liqk/develop-0620' into develop

liqk %!s(int64=3) %!d(string=hai) anos
pai
achega
d3be736bc7

+ 2 - 0
TEAMModelOS/ClientApp/src/boot-app.js

@@ -49,6 +49,8 @@ import fabric from 'fabric'
 import VideoPlayer from 'vue-video-player'
 import NewChooseContent from '@/components/selflearn/NewChooseContent'
 
+
+jsFn.setLocalLang()
 require('video.js/dist/video-js.css')
 require('vue-video-player/src/custom-theme.css')
 // 图片预览组件

+ 2 - 6
TEAMModelOS/ClientApp/src/locale/index.js

@@ -1,15 +1,11 @@
 import Vue from 'vue'
 import VueI18n from 'vue-i18n'
+import jsFn from '@/utils/js-fn.js'
 import tools from '@/utils/public.js'
 import ElementLocale from 'element-ui/lib/locale'
 ElementLocale.i18n((key, value) => i18n.t(key, value))
 Vue.use(VueI18n)
-// 自动根据浏览器系统语言设置语言(优先判断本地设置的语言,如果有则使用本地设置的语言,如果没有则使用浏览器系统语言)
-const curLang = localStorage.getItem('cloudSetting') ? JSON.parse(localStorage.getItem('cloudSetting')).curLang : null
-const navLang = curLang || navigator.language.toLowerCase()
-const localLang = (navLang === 'zh' || navLang === 'zh-tw' || navLang === 'zh-cn' || navLang === 'zh-hk') ? navLang : false
-let lang = localLang || 'en-us'
-localStorage.setItem('local', lang)
+let lang = jsFn.setLocalLang()
 Vue.config.lang = lang
 Vue.locale = () => { }
 const i18n = new VueI18n({

+ 12 - 1
TEAMModelOS/ClientApp/src/utils/js-fn.js

@@ -430,6 +430,16 @@ function getBlobInfo(scope) {
     }
 }
 
+function setLocalLang() {
+    // 自动根据浏览器系统语言设置语言(优先判断本地设置的语言,如果有则使用本地设置的语言,如果没有则使用浏览器系统语言)
+    const curLang = localStorage.getItem('cloudSetting') ? JSON.parse(localStorage.getItem('cloudSetting')).curLang : null
+    const navLang = curLang || navigator.language.toLowerCase()
+    const localLang = (navLang === 'zh' || navLang === 'zh-tw' || navLang === 'zh-cn' || navLang === 'zh-hk') ? navLang : false
+    let lang = localLang || 'en-us'
+    localStorage.setItem('local', lang)
+    return lang
+}
+
 export default {
     groupBy,
     isObjEqual,
@@ -453,5 +463,6 @@ export default {
     checkJinNiu,
     checkTrain,
     handleStudentAnswer,
-    getBlobInfo
+    getBlobInfo,
+    setLocalLang
 }

+ 11 - 2
TEAMModelOS/ClientApp/src/view/mycourse/MyCourse.vue

@@ -369,11 +369,21 @@ export default {
             return data
         },
         courseListShow() {
+            if(!this.courseList.length){
+                return []
+            }
             let data = this.courseList.filter(item => item.scope == this.listType)
             if (data.length) {
                 this.courseId = data[0].id
             }
-            return data
+            if (data.length) {
+                return data
+            } else {
+                setTimeout(()=>{
+                    this.listType = this.listType == 'school' ? 'private' : 'school'
+                },100)
+                return []
+            }
         },
         //课程名单 —— 去重处理后的数据
         teaClassList() {
@@ -816,7 +826,6 @@ export default {
                                 }
 
                                 // 删除列表数据
-                                let index = this.curCusIndex
                                 this.curCusIndex = 0
                                 this.$Message.success(this.$t('cusMgt.delOk'))
                             } else {

+ 1 - 2
TEAMModelOS/ClientApp/src/view/mycourse/student/Student.vue

@@ -47,7 +47,7 @@
             </Dropdown>
         </div>
         <vuescroll style="height:100%;">
-            <Alert @on-close="isClose = true" v-show="!isClose" show-icon type="warning" style="margin-bottom:0px" closable>
+            <Alert v-show="!isStuList" show-icon type="warning" style="margin-bottom:0px" closable>
                 {{$t('cusMgt.groupTips')}}
             </Alert>
             <Table :columns="isStuList ? listColumn : classColumn" :data="students" @on-selection-change="(selections)=>{delSelection = selections}" class="system-classroom-table" :loading="stuLoading" :no-data-text="$t('cusMgt.noStu')">
@@ -140,7 +140,6 @@ export default {
             editIndex: -1,
             delSelection: [],
             stuLoading: false,
-            isClose: false,
             classColumn: [
                 {
                     title: ' ',