Browse Source

课程时段加载中

liqk 4 years ago
parent
commit
38f53193b9

+ 6 - 9
TEAMModelOS/ClientApp/src/view/newcourse/NewCusMgt.vue

@@ -173,7 +173,7 @@
                             </div>
                             </div>
                             <!-- 教师课表 -->
                             <!-- 教师课表 -->
                             <vuescroll v-show="curTab == 1">
                             <vuescroll v-show="curTab == 1">
-                                <TeaTable style="height: calc(100% - 45px)" :courseId="courseId" v-if="hasTimeTable" :teaClassList="schdClassList" :teacher="teaList[curTeaIndex] ? teaList[curTeaIndex].id : ''" :periodId="filterPeriod" :schedData="schdData" @selectCell="selectCell" @cancelCell="cancelCell"></TeaTable>
+                                <TeaTable style="height: calc(100% - 45px)" :tableLoading="tableLoading" :courseId="courseId" v-if="hasTimeTable" :teaClassList="schdClassList" :teacher="teaList[curTeaIndex] ? teaList[curTeaIndex].id : ''" :periodId="filterPeriod" :schedData="schdData" @selectCell="selectCell" @cancelCell="cancelCell"></TeaTable>
                                 <div v-else>
                                 <div v-else>
                                     <p class="no-time-table-tips">
                                     <p class="no-time-table-tips">
                                         {{filterPeriodName}}{{$t('cusMgt.notime1')}}
                                         {{filterPeriodName}}{{$t('cusMgt.notime1')}}
@@ -306,6 +306,7 @@ export default {
             }
             }
         }
         }
         return {
         return {
+            tableLoading: false,
             listLoading: false,
             listLoading: false,
             classList: [],
             classList: [],
             addType: 'class',
             addType: 'class',
@@ -524,17 +525,17 @@ export default {
         async getTeaSchd() {
         async getTeaSchd() {
             let teaId = this.teaList[this.curTeaIndex].id
             let teaId = this.teaList[this.curTeaIndex].id
             try {
             try {
+                this.tableLoading = true
                 let cusList = await this.getTeaCourse(teaId)
                 let cusList = await this.getTeaCourse(teaId)
                 let cusSchd = await this.getTeaDetail(cusList)
                 let cusSchd = await this.getTeaDetail(cusList)
                 this.$set(this.teaSchds, teaId, [])
                 this.$set(this.teaSchds, teaId, [])
-                console.log(cusSchd)
                 cusSchd.forEach(item => {
                 cusSchd.forEach(item => {
                     this.teaSchds[teaId].push(...item.courses)
                     this.teaSchds[teaId].push(...item.courses)
                 })
                 })
-                console.log('hehe', this.teaSchds)
+                this.tableLoading = false
             } catch (e) {
             } catch (e) {
-                console.log(e)
                 this.$Message.error('API ERROR!')
                 this.$Message.error('API ERROR!')
+                this.tableLoading = false
             }
             }
         },
         },
         //获取教师所有课程列表
         //获取教师所有课程列表
@@ -1122,7 +1123,6 @@ export default {
         },
         },
         //获取课程列表
         //获取课程列表
         getCourseList() {
         getCourseList() {
-            this.tableLoading = true
             this.listLoading = true
             this.listLoading = true
             let requestData = {
             let requestData = {
                 'code': this.$store.state.userInfo.schoolCode,
                 'code': this.$store.state.userInfo.schoolCode,
@@ -1145,7 +1145,6 @@ export default {
                 }
                 }
             ).finally(() => {
             ).finally(() => {
                 setTimeout(() => {
                 setTimeout(() => {
-                    this.tableLoading = false
                     this.listLoading = false
                     this.listLoading = false
                 }, 500)
                 }, 500)
             })
             })
@@ -1200,7 +1199,6 @@ export default {
                     }
                     }
                 ).finally(() => {
                 ).finally(() => {
                     setTimeout(() => {
                     setTimeout(() => {
-                        this.tableLoading = false
                         this.listLoading = false
                         this.listLoading = false
                     }, 500)
                     }, 500)
                 })
                 })
@@ -1245,7 +1243,6 @@ export default {
                 title: this.$t('cusMgt.delCus'),
                 title: this.$t('cusMgt.delCus'),
                 content: `${this.$t('cusMgt.delContent')}${cusNames.join(', ')}?`,
                 content: `${this.$t('cusMgt.delContent')}${cusNames.join(', ')}?`,
                 onOk: () => {
                 onOk: () => {
-                    this.tableLoading = true
                     this.confirmDelCus()
                     this.confirmDelCus()
                 }
                 }
             })
             })
@@ -1283,7 +1280,7 @@ export default {
                         this.$Message.error(this.$t('cusMgt.delErr'))
                         this.$Message.error(this.$t('cusMgt.delErr'))
                     }
                     }
                 ).finally(() => {
                 ).finally(() => {
-                    this.tableLoading = false
+                    // this.tableLoading = false
                 })
                 })
             }
             }
 
 

+ 6 - 1
TEAMModelOS/ClientApp/src/view/newcourse/TeaTable.vue

@@ -5,7 +5,8 @@
                 <div class="class-filter-wrap">
                 <div class="class-filter-wrap">
                 </div>
                 </div>
             </div>
             </div>
-            <Table :columns="timeColumns" disabled-hover :data="timetable" border :span-method="handleSpan" style="width:calc(100% - 15px);margin-top:00px;">
+            <Table :columns="timeColumns" disabled-hover :data="timetable" border :span-method="handleSpan" style="width:calc(100% - 15px);margin-top:00px;" :loading="tableLoading">
+                <Loading slot="loading" :top="0" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
                 <!--上午/下午-->
                 <!--上午/下午-->
                 <template slot-scope="{ row, index }" slot="sub">
                 <template slot-scope="{ row, index }" slot="sub">
                     <p class="am-pm" style="">
                     <p class="am-pm" style="">
@@ -141,6 +142,10 @@ export default {
         mode:{
         mode:{
             type:String,
             type:String,
             default:'set' //set:设置模式 view:视图模式,只渲染功能
             default:'set' //set:设置模式 view:视图模式,只渲染功能
+        },
+        tableLoading:{
+            type:Boolean,
+            default:false
         }
         }
     },
     },
     data() {
     data() {