Browse Source

选科报名表格上增加插槽

shilipojs 2 years ago
parent
commit
6c65643c7a

+ 4 - 1
src/views/system/user/profile/components/report-table.vue

@@ -1,6 +1,9 @@
 <template>
   <div>
-    <div class="mb10 fx-row fx-end-base">
+    <div class="mb10 fx-row fx-end-base jc-between">
+      <div>
+        <slot name="header-prefix"></slot>
+      </div>
       <div v-if="!readonly">
         <el-button v-if="aiButtonShow" type="primary" @click="toAiAnalysis">AI分析</el-button>
 <!--        <el-button>选科历史记录</el-button>-->

+ 10 - 2
src/views/system/user/profile/round-select.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="app-container">
+  <div class="app-container" v-loading="loading">
     <el-card shadow="hover">
       <template #header>选科信息</template>
       <el-row :gutter="20">
@@ -27,7 +27,11 @@
         <elective-generation-steps v-if="selectObj" v-model="activeStep" :generation="generation"
                                    disable-hidden-feature></elective-generation-steps>
       </template>
-      <report-table v-if="generation.active <= generation.current" :generation="generation" :optional-majors="optionalMajors"></report-table>
+      <report-table v-if="generation.active <= generation.current" :generation="generation" :optional-majors="optionalMajors">
+        <template #header-prefix>
+          <el-button circle icon="el-icon-refresh" @click="getStudentElectiveModels" class="mr30"></el-button>
+        </template>
+      </report-table>
       <evaluation-empty v-else :shadow="false" :title="emptyTitle"></evaluation-empty>
     </el-card>
     <el-card shadow="hover" class="mt20">
@@ -72,6 +76,7 @@ export default {
         src: '9fca0b997b8346ce8c3ce69feaf89294',
         aliIdType: 2
       },
+      loading: false,
       //
       optionalMajors: [],
       evaluationMajors: [],
@@ -142,8 +147,11 @@ export default {
   },
   methods: {
     getStudentElectiveModels() {
+      this.loading = true
       getStudentElectiveModels().then(res => {
         this.generationModels = res.data
+      }).finally(_ => {
+        this.loading = false
       })
     },
     getRecommendMajor() {