shilipojs 2 лет назад
Родитель
Сommit
fff340f87c

+ 1 - 1
src/components/dynamic-table/index.vue

@@ -36,7 +36,7 @@ export default {
     },
     tableCore() {
       return this.$refs.table
-    }
+    },
   }
 }
 </script>

+ 7 - 4
src/views/career/zhiyuan/components/recommend.vue

@@ -1,6 +1,6 @@
 <template>
   <div style="width: 90%; margin:0 auto" >
-    <div class="zhiyuan-filter">
+    <div class="zhiyuan-filter" >
       <div class="header">
         <h3 class="f-666">您的选考科目为:<em>{{ formSubject.firstSubject }}<em v-for="item in formSubject.lastSubject"
         >,{{ item }}</em> </em>,  <span class="mr20">总分:<em  class="f-primary">{{ formSubject.score }}</em></span>
@@ -65,7 +65,7 @@
       ></mx-search-group>
     </div>
     <div class="zhiyuan-list">
-      <zhiyuan-list  :tableList="rows" @apply="apply" :cols="cols" @expand="expand"></zhiyuan-list>
+      <zhiyuan-list :loading="loading" :tableList="rows" @apply="apply" :cols="cols" @expand="expand"></zhiyuan-list>
     </div>
     <div :class="{'active':show,'right_cart': true}" >
       <div class="btn-wrap" @click="show = !show">
@@ -164,7 +164,6 @@ export default {
     console.log(dom)
     dom.addEventListener("scroll", (v) => {
       const scrollDistance = dom.scrollHeight - dom.scrollTop - dom.clientHeight;
-      console.log('scrollDistance',scrollDistance)
       // 判断是否到底,可以加载下一页
       if (scrollDistance <= 0.5) {
         this.load()
@@ -245,6 +244,10 @@ export default {
     confirm() {
       this.pageForm.pageNum = 1
       this.getList()
+      //在执行完跳转页码的数据请求后
+      this.$nextTick(() => {
+        document.querySelector(".el-table__body-wrapper").scrollTop = 0;
+      })
     },
     load() {
       if (Math.ceil(this.total / this.pageForm.pageSize) > this.pageForm.pageNum) {
@@ -340,7 +343,7 @@ export default {
         pickType:  this.filter_form.pickType,
         // "rank": 0,
         score: this.formSubject.score,
-        batchMinScore:this.batch.score2,
+        batchMinScore:this.batch.score2 || this.batch.score1,
         university: {
           // "code": "string",
           features: this.filter_form.features,

+ 14 - 50
src/views/career/zhiyuan/components/zhiyuan-list.vue

@@ -1,5 +1,5 @@
 <template>
-    <dynamic-table   height="800px"  :rows="tableList" :columns="columns" @expand-change="expand" >
+    <dynamic-table v-loading="loading" ref="table"  height="800px"  :rows="tableList" :columns="columns" @expand-change="expand" >
       <template #t0="{row}">
         <!--    录取概率 -->
         <div>
@@ -40,35 +40,17 @@
       </template>
       <template #t4="{row}">
         <div class="f14">
-          <div v-if="row.histories[0]">
-            <p>{{ row.histories[0].numReal || '-' }}</p>
-<!--            <p>{{ row.histories[0].lineDiff || '-' }}</p>-->
-            <p>{{ row.histories[0].score || '-' }}</p>
-            <p>{{ row.histories[0].seat || '-' }}</p>
-          </div>
-          <span v-else>暂无</span>
+            <p>{{ row.history? row.history.numReal || '-' : '-'}}</p>
         </div>
       </template>
       <template #t5="{row}">
         <div class="f14">
-          <div v-if="row.histories[1]">
-            <p>{{ row.histories[1].numReal || '-' }}</p>
-<!--            <p>{{ row.histories[1].lineDiff || '-' }}</p>-->
-            <p>{{ row.histories[1].score || '-' }}</p>
-            <p>{{ row.histories[1].seat || '-' }}</p>
-          </div>
-          <span v-else>暂无</span>
+            <p>{{ row.history? row.history.score || '-' : '-' }}</p>
         </div>
       </template>
       <template #t6="{row}">
         <div class="f14">
-          <div v-if="row.histories[2]">
-            <p>{{ row.histories[2].numReal || '-' }}</p>
-<!--            <p>{{ row.histories[2].lineDiff || '-' }}</p>-->
-            <p>{{ row.histories[2].score || '-' }}</p>
-            <p>{{ row.histories[2].seat || '-' }}</p>
-          </div>
-          <span v-else>暂无</span>
+            <p>{{  row.history? row.history.seat || '-' : '-'}}</p>
         </div>
       </template>
       <template #t7="{row}">
@@ -81,13 +63,6 @@
             <template #t0="{row}">
               <!--    录取概率 -->
               <div>
-<!--                <p class="mb10"><span class="f18">{{ row.enrollRatio }}</span>%</p>-->
-<!--                <p class="mb10 f-9b f12">{{ row.enrollRatioText }}</p>-->
-                <p>
-<!--                  <el-tag type="success">冲</el-tag>-->
-                  <!--                  <el-tag type="success">稳</el-tag>-->
-                  <!--                  <el-tag type="success">保</el-tag>-->
-                </p>
               </div>
             </template>
             <template #t1="{row}">
@@ -112,35 +87,17 @@
             </template>
             <template #t4="{row}">
               <div class="f14">
-                <div v-if="row.histories[0]">
-                  <p>{{ row.histories[0].numReal || '-' }}</p>
-<!--                  <p>{{ row.histories[0].lineDiff || '-' }}</p>-->
-                  <p>{{ row.histories[0].score || '-' }}</p>
-                  <p>{{ row.histories[0].seat || '-' }}</p>
-                </div>
-                <span v-else>暂无</span>
+                  <p>{{ row.history? row.history.numReal || '-' : '-' }}</p>
               </div>
             </template>
             <template #t5="{row}">
               <div class="f14">
-                <div v-if="row.histories[1]">
-                  <p>{{ row.histories[1].numReal || '-' }}</p>
-<!--                  <p>{{ row.histories[1].lineDiff || '-' }}</p>-->
-                  <p>{{ row.histories[1].score || '-' }}</p>
-                  <p>{{ row.histories[1].seat || '-' }}</p>
-                </div>
-                <span v-else>暂无</span>
+                  <p>{{ row.history ? row.history.score || '-' : '-' }}</p>
               </div>
             </template>
             <template #t6="{row}">
               <div class="f14">
-                <div v-if="row.histories[2]">
-                  <p>{{ row.histories[2].numReal || '-' }}</p>
-<!--                  <p>{{ row.histories[2].lineDiff || '-' }}</p>-->
-                  <p>{{ row.histories[2].score || '-' }}</p>
-                  <p>{{ row.histories[2].seat || '-' }}</p>
-                </div>
-                <span v-else>暂无</span>
+                  <p>{{ row.history? row.history.seat || '-' : '-' }}</p>
               </div>
             </template>
             <template #t7="{row}">
@@ -167,6 +124,10 @@ export default {
       type: Array,
       default: []
     },
+    loading:{
+      type: Boolean,
+      default: []
+    }
   },
   data() {
     return {
@@ -212,6 +173,9 @@ export default {
     expand(item) {
       this.$emit('expand', item)
     },
+    scrollTop() {
+      this.$refs.table.toScrollTop()
+    },
     apply(item,index) {
       this.$emit('apply',item,index)
     },