瀏覽代碼

院校投档线

shilipojs 2 年之前
父節點
當前提交
170abfed46

+ 69 - 87
src/views/career/components/UniversitiesLine.vue

@@ -1,12 +1,12 @@
 <template>
   <div>
-    <div style="background-color: #ffffff;font-size: 14px;padding:5px;">
+    <div>
       <!-- 录取年份 -->
       <el-row class="radioInput">
         <div>
-          <span class="radiaTitle">录 取 年 份:</span>
+          <span class="radiaTitle">录取年份:</span>
         </div>
-        <el-radio-group v-model="universityParams.yearRes">
+        <el-radio-group v-model="universityParams.year">
           <el-radio-button v-for="item in years" :key="item" :label="item"
                            style="margin-bottom:10px"></el-radio-button>
         </el-radio-group>
@@ -14,145 +14,127 @@
       <!-- 科类 -->
       <el-row class="radioInput">
         <div>
-          <span class="radiaTitle">科 类:</span>
+          <span class="radiaTitle">科类:</span>
         </div>
-        <el-radio-group v-model="universityParams.typeRes">
+        <el-radio-group v-model="universityParams.liberalScience">
           <el-radio-button label="">所有</el-radio-button>
           <el-radio-button v-for="item in types" :key="item" :label="item"
                            style="margin-bottom:10px"></el-radio-button>
         </el-radio-group>
       </el-row>
-      <!-- 院校筛选数据  -->
-      <filter-form></filter-form>
-
-
-    <!-- 表格数据 -->
-      <universities-line-table :universityParams="universityParams"></universities-line-table>
+      <!-- 院校过滤条件 -->
+      <filter-form :filter="filter_form"></filter-form>
+      <mx-search-group class="mb10" justify="end" :span="6" v-model="name" placeholder="搜索" @search="clickSuffix"
+      ></mx-search-group>
+      <!-- 表格数据 -->
+      <universities-line-table :universityParams="all_form"></universities-line-table>
     </div>
   </div>
 </template>
 
 <script>
   import {
-    selectUniversityLocations,
-    selectUniversityLevels,
     selectUniversityTypes,
     selectUniversityYears
   } from '@/api/webApi/shiftLine'
   import UniversitiesLineTable from '@/views/career/components/UniversitiesLineTable'
+  import FilterForm from '@/views/career/components/FilterForm'
+  import MxSearchGroup from '@/components/MxSearch/mx-search-group'
   export default {
     name: "UniversitiesLine",
-    components: {UniversitiesLineTable},
+    components: {UniversitiesLineTable,FilterForm,MxSearchGroup},
     data() {
       return {
-        locations: [],//所在地
-        levels: [],
         types: [],
         years: [],
+        filter_form:{
+          location:'',
+          natureTypeCN:'',
+          type:'',
+          level:'',
+          features:'',
+          name:''
+        },
+        name:'',
         universityParams: {
-          locationsRes: '',
-          levelsRes: '',
-          typeRes: '',
-          yearRes: ''
+          liberalScience: '',
+          year: ''
         }
       }
     },
+    computed:{
+      all_form(){
+       return {
+         ...this.filter_form,
+         ...this.universityParams,
+       }
+      }
+    },
     watch: {
-      'universityParams.yearRes': {
+      'universityParams.year': {
         immediate: false,
         handler(val) {
-          console.log(val)
-          this.getUniversityLevels()
           this.getUniversityTypes()
         }
       }
     },
     created() {
-      this.getUniversityLocations()
       this.getUniversityYears()
     },
     methods: {
-      handleQuery() {
-
-      },
-      handleInvalidQuery() {
-
-      },
-      getUniversityLocations() {
-        selectUniversityLocations().then(res => {
-          this.universityParams.locationsRes = res.rows[0]
-          this.locations = res.rows
-        })
-      },
-      getUniversityLevels() {
-        const params = {
-          // location: this.universityParams.locationsRes,
-          year: this.universityParams.yearRes,
-        }
-        selectUniversityLevels(params).then(res => {
-          // this.universityParams.levelsRes = res.rows[0]
-          this.levels = res.rows
-        })
+      clickSuffix() {
+        this.filter_form.name = this.name
       },
       getUniversityTypes() {
         const params = {
-          // location: this.universityParams.locationsRes,
-          year: this.universityParams.yearRes,
+          year: this.universityParams.year,
         }
         selectUniversityTypes(params).then(res => {
-          // this.universityParams.typeRes = res.rows[0]
           this.types = res.rows
         })
       },
       getUniversityYears() {
-        const params = {
-          level: '',
-          location: '',
-          type: ''
-        }
-        selectUniversityYears(params).then(res => {
-          this.universityParams.yearRes = res.rows[0]
+        selectUniversityYears().then(res => {
+          this.universityParams.year = res.rows[0]
           this.years = res.rows
-          // this.$nextTick(_ => {
-          //   this.getUniversityTypes()
-          //   this.getUniversityLevels()
-          // })
         })
       }
     }
   }
 </script>
 
-<style lang="scss">
-  .radioInput {
-    .el-radio {
-      .el-radio__input {
-        display: none;
-      }
-    }
-  }
-
-  .radioInput {
-    display: flex;
-    margin-top: 5px;
-    .el-radio-button .el-radio-button__inner {
-      border-radius: 4px !important;
-      border: none;
-      padding: 5px 10px !important;
-      font-weight: 400;
-      font-family: PingFangSC-Regular, PingFang SC;
-    }
+<style lang="scss" scoped>
 
-    .el-radio-button__orig-radio:checked + .el-radio-button__inner {
-      box-shadow: none;
+.radioInput ::v-deep {
+  background-color: #ffffff;
+  font-size: 14px;
+  padding:5px;
+  .el-radio {
+    .el-radio__input {
+      display: none;
     }
+  }
+}
 
-    .radiaTitle {
-      display: inline-block;
-      width: 130px;
-      font-size: 14px;
-      text-align: right;
-      margin-top: 2px;
-    }
+.radioInput ::v-deep {
+  display: flex;
+  .el-radio-button .el-radio-button__inner {
+    border-radius: 4px !important;
+    border: none;
+    padding: 5px 10px !important;
+    font-weight: 400;
+    font-family: PingFangSC-Regular, PingFang SC;
+  }
+  .el-radio-button__orig-radio:checked + .el-radio-button__inner {
+    box-shadow: none;
+  }
+  .radiaTitle {
+    display: inline-block;
+    width: 80px;
+    font-size: 14px;
+    text-align: right;
+    margin-top: 2px;
+    margin-right: 10px;
   }
+}
 </style>

+ 11 - 41
src/views/career/components/UniversitiesLineTable.vue

@@ -1,7 +1,6 @@
 <template>
   <div id="lineTable">
-    <mx-search-group class="mb10" justify="end" :span="6" v-model="tableParams.univerName" placeholder="搜索" @search="clickSuffix"
-    ></mx-search-group>
+
     <el-table :data="tableData" v-loading="tableLoading" border>
       <el-table-column prop="code" label="院校" align="center">
         <template slot-scope="scope">
@@ -20,16 +19,10 @@
       >
       </el-table-column>
     </el-table>
-    <el-pagination
-      style="margin-top:10px;"
-      :page-sizes="[10,20,30,40,50,60,70,80,90,100]"
-      :page-size=tableParams.pageSize
-      layout="prev,pager,next,jumper,total,sizes"
-      :total="examRecordTotal"
-      @current-change="currentChange"
-      @size-change="sizeChange"
-    >
-    </el-pagination>
+    <pagination class="mt10" :total="total" :autoScroll="false" @pagination="getUniversityList"
+                :page.sync="pageForm.pageNum"
+                :limit.sync="pageForm.pageSize"
+    ></pagination>
   </div>
 </template>
 
@@ -44,7 +37,8 @@ export default {
   },
   props: {
     universityParams: {
-      type: Object, default() {
+      type: Object,
+      default() {
         return {}
       }
     }
@@ -53,15 +47,11 @@ export default {
     return {
       tableLoading: '',
       examRecordTotal: 0,
-      tableParams: {
+      pageForm: {
         pageSize: 20,
         pageNum: 1,
-        level: '',
-        location: '',
-        type: '',
-        univerName: '',
-        year: ''
       },
+      total:0,
       tableData: []
     }
   },
@@ -70,41 +60,21 @@ export default {
       immediate: true,
       deep: true,
       handler(val) {
-        if ( val.locationsRes == ''  || val.yearRes == '' ) {
-          return
-        }
-        this.tableParams.level = val.levelsRes
-        this.tableParams.location = val.locationsRes
-        this.tableParams.type = val.typeRes
-        this.tableParams.year = val.yearRes
         this.getUniversityList()
       }
     }
   },
   methods: {
-    clickSuffix() {
-      this.getUniversityList()
-    },
     getUniversityList() {
       this.tableLoading = true
-      console.log(this.tableParams)
-      selectUniversityList(this.tableParams).then(res => {
+      selectUniversityList({ ...this.universityParams,...this.pageForm }).then(res => {
         console.log(res)
         this.tableData = res.rows
-        this.examRecordTotal = res.total
+        this.total = res.total
       }).finally(_ => {
         this.tableLoading = false
       })
     },
-    sizeChange(e) {
-      this.tableParams.pageSize = e
-      this.getUniversityList()
-    },
-    currentChange(e) {
-      //页数
-      this.tableParams.pageNum = e
-      this.getUniversityList()
-    },
     goDetails(id) {
       this.$router.push({ name: 'UniversityDetail', params: { id: id } })
     }

+ 1 - 1
src/views/career/plan/UniversitiesDetail.vue

@@ -135,7 +135,7 @@
             <mx-table border :propDefines="collegeProps" :rows="departments">
               <template #tmp="{row}">
                 <p class="major-wrap">
-                  <span v-for="item in row.departmentMajor">{{ item.name }}</span>
+                  <a @click="toMajorDetail(item.code)" v-for="item in row.departmentMajor">{{ item.name }}</a>
                 </p>
               </template>
             </mx-table>

+ 6 - 1
src/views/career/zhiyuan/ShiftLine.vue

@@ -1,5 +1,5 @@
 <template>
-  <div style="padding:24px 8%;background-color:#f7f7f7;">
+  <div class="shiftLine">
     <el-tabs v-model="activeName" stretch>
       <el-tab-pane label="院校投档线" name="universities"></el-tab-pane>
       <el-tab-pane label="专业投档线" name="colleges"></el-tab-pane>
@@ -24,5 +24,10 @@
       }
     }
 </script>
+<style scoped>
+.shiftLine{
+  padding:20px 40px;
+}
+</style>