Pārlūkot izejas kodu

院校投档线

shilipojs 2 gadi atpakaļ
vecāks
revīzija
11f6e5069e

+ 52 - 36
src/views/career/components/UniversitiesLine.vue

@@ -43,26 +43,31 @@
                            style="margin-bottom:10px"></el-radio-button>
         </el-radio-group>
       </el-row>
-
-
-
+      <mx-search-group class="mb10" justify="end" :span="6" v-model="name" placeholder="请输入名称" @search="toGetList"
+      ></mx-search-group>
       <!-- 表格数据 -->
-      <universities-line-table :universityParams="universityParams"></universities-line-table>
+      <universities-line-table :tableList="tableList"></universities-line-table>
+      <pagination class="mt10" :total="total" :autoScroll="false" @pagination="getUniversityList"
+                  :page.sync="pageForm.pageNum"
+                  :limit.sync="pageForm.pageSize"
+      ></pagination>
     </div>
   </div>
 </template>
 
 <script>
-  import {
-    selectUniversityLocations,
-    selectUniversityLevels,
-    selectUniversityTypes,
-    selectUniversityYears
-  } from '@/api/webApi/shiftLine'
+import {
+  selectUniversityLocations,
+  selectUniversityLevels,
+  selectUniversityTypes,
+  selectUniversityYears, selectUniversityList
+} from '@/api/webApi/shiftLine'
   import UniversitiesLineTable from '@/views/career/components/UniversitiesLineTable'
+  import MxSearchGroup from '@/components/MxSearch/mx-search-group'
+
   export default {
     name: "UniversitiesLine",
-    components: {UniversitiesLineTable},
+    components: {UniversitiesLineTable,MxSearchGroup},
     data() {
       return {
         locations: [],//所在地
@@ -73,7 +78,16 @@
           location: '',
           level: '',
           type: '',
-          year: ''
+          year: '',
+          univerName:''
+        },
+        name:'',
+        tableLoading:false,
+        total:0,
+        tableList:[],
+        pageForm:{
+          pageSize:10,
+          pageNum:1
         }
       }
     },
@@ -81,10 +95,18 @@
       'universityParams.year': {
         immediate: false,
         handler(val) {
-          console.log(val)
           this.getUniversityLevels()
           this.getUniversityTypes()
         }
+      },
+      universityParams:{
+        immediate: true,
+        deep:true,
+        handler(val) {
+          if(val.year && val.location){
+            this.getUniversityList()
+          }
+        }
       }
     },
     created() {
@@ -92,11 +114,8 @@
       this.getUniversityYears()
     },
     methods: {
-      handleQuery() {
-
-      },
-      handleInvalidQuery() {
-
+      toGetList() {
+        this.universityParams.univerName = this.name
       },
       getUniversityLocations() {
         selectUniversityLocations().then(res => {
@@ -104,39 +123,36 @@
           this.locations = res.rows
         })
       },
-      getUniversityLevels() {
+      async getUniversityLevels() {
         const params = {
-          // location: this.universityParams.locations,
           year: this.universityParams.year,
         }
-        selectUniversityLevels(params).then(res => {
-          // this.universityParams.level = res.rows[0]
+        await selectUniversityLevels(params).then(res => {
           this.levels = res.rows
         })
       },
-      getUniversityTypes() {
+      async getUniversityTypes() {
         const params = {
-          // location: this.universityParams.locations,
           year: this.universityParams.year,
         }
-        selectUniversityTypes(params).then(res => {
-          // this.universityParams.type = res.rows[0]
+          await selectUniversityTypes(params).then(res => {
           this.types = res.rows
         })
       },
       getUniversityYears() {
-        const params = {
-          level: '',
-          location: '',
-          type: ''
-        }
-        selectUniversityYears(params).then(res => {
+        selectUniversityYears().then(res => {
           this.universityParams.year = res.rows[0]
           this.years = res.rows
-          // this.$nextTick(_ => {
-          //   this.getUniversityTypes()
-          //   this.getUniversityLevels()
-          // })
+        })
+      },
+      async getUniversityList() {
+        this.tableLoading = true
+        await selectUniversityList({ ...this.universityParams,...this.pageForm }).then(res => {
+          console.log(res)
+          this.tableList = res.rows
+          this.total = res.total
+        }).finally(_ => {
+          this.tableLoading = false
         })
       }
     }

+ 46 - 58
src/views/career/components/UniversitiesLineTable.vue

@@ -1,33 +1,19 @@
 <template>
-  <div id="lineTable">
-
-    <el-table :data="tableData" v-loading="tableLoading" border>
-      <el-table-column prop="code" label="院校" align="center">
-        <template slot-scope="scope">
-          <el-link :underline="false" @click="goDetails(scope.row.universityId)">【{{ scope.row.universityName }}】
-          </el-link>
-        </template>
-      </el-table-column>
-      <el-table-column prop="location" label="所在地" align="center"></el-table-column>
-      <el-table-column prop="year" label="年份" align="center"></el-table-column>
-      <el-table-column prop="type" label="科类" align="center"></el-table-column>
-      <el-table-column prop="level" label="层次" align="center"></el-table-column>
-      <el-table-column prop="score" label="投档线" align="center"></el-table-column>
-      <el-table-column
-        prop="seat"
-        label="投档分位次"
-      >
-      </el-table-column>
-    </el-table>
-    <pagination class="mt10" :total="total" :autoScroll="false" @pagination="getUniversityList"
-                :page.sync="pageForm.pageNum"
-                :limit.sync="pageForm.pageSize"
-    ></pagination>
+  <div id="lineTable" >
+    <mx-table :prop-defines="propsDefine" :rows="tableList" border>
+      <template #temp="{row}">
+        <el-link  :underline="false" @click="goDetails(row)">
+          {{row.collegeCode}}  {{row.universityName}}
+        </el-link>
+        <p v-if="row.collegeRemark">{{`(${row.collegeRemark})` }}</p>
+      </template>
+      <template #numReal="{row}">
+         <p>{{row.numReal || '-'}}</p>
+      </template>
+    </mx-table>
   </div>
 </template>
-
 <script>
-import { selectUniversityList } from '@/api/webApi/shiftLine'
 import MxSearchGroup from '@/components/MxSearch/mx-search-group'
 
 export default {
@@ -36,47 +22,49 @@ export default {
     MxSearchGroup
   },
   props: {
-    universityParams: {
-      type: Object,
+    tableList: {
+      type: Array,
       default() {
-        return {}
+        return []
       }
     }
   },
   data() {
     return {
-      tableLoading: '',
-      examRecordTotal: 0,
-      pageForm: {
-        pageSize: 20,
-        pageNum: 1,
+      propsDefine:{
+        code:{
+          label:'院校',
+          slot:'temp',
+          width:'200'
+        },
+        location:{
+          label:'所在地'
+        },
+        year:{
+          label:'年份'
+        },
+        batchName:{
+          label:'批次/段'
+        },
+        course:{
+          label:'选考要求'
+        },
+        score:{
+          label:'投档分'
+        },
+        seat:{
+          label:'投档分位次'
+        },
+        numReal:{
+          label:'录取数',
+          slot:'numReal'
+        }
       },
-      total:0,
-      tableData: []
-    }
-  },
-  watch: {
-    universityParams: {
-      immediate: true,
-      deep: true,
-      handler(val) {
-        this.getUniversityList()
-      }
     }
   },
-  methods: {
-    getUniversityList() {
-      this.tableLoading = true
-      selectUniversityList({ ...this.universityParams,...this.pageForm }).then(res => {
-        console.log(res)
-        this.tableData = res.rows
-        this.total = res.total
-      }).finally(_ => {
-        this.tableLoading = false
-      })
-    },
-    goDetails(id) {
-      this.$router.push({ name: 'UniversityDetail', params: { id: id } })
+  methods:{
+    goDetails(item){
+      this.$router.push({path:'/career/plan/UniversityDetail',query: {code:item.universityCode}})
     }
   }
 }

+ 0 - 1
src/views/career/zhiyuan/batch.vue

@@ -85,7 +85,6 @@ export default {
     ...mapGetters(['currentUser']),
   },
   created() {
-    this.getBatchList();
     this.queryParams.location = this.currentUser.provinceName
   },
   methods: {

+ 137 - 32
src/views/career/zhiyuan/components/recommend.vue

@@ -9,18 +9,44 @@
         <!-- 院校筛选条件 -->
         <filter-form :filter="filter_form"></filter-form>
         <!--其他筛选 -->
-        <div class="filter">
-          <div class="filter_name">推荐类型:</div>
+        <el-row class="radioInput">
+          <div>
+            <span class="radiaTitle">院校层次:</span>
+          </div>
+          <el-radio-group v-model="filter_form.pickType">
+            <el-radio-button label="">所有</el-radio-button>
+            <el-radio-button v-for="item in localFilters.picks" :key="item.value" :label="item.value" style="margin-bottom:10px"
+            >
+              {{ item.label }}
+            </el-radio-button>
+          </el-radio-group>
+        </el-row>
+        <!-- 专业 -->
+        <el-row class="radioInput">
+          <div>
+            <span class="radiaTitle">专业类别:</span>
+          </div>
+          <el-radio-group v-model="currentMajor">
+            <el-radio-button label="">所有</el-radio-button>
+            <el-radio-button v-for="item in majorList" :key="item.code" :label="item.code" style="margin-bottom:10px">
+              {{ item.name }}
+            </el-radio-button>
+          </el-radio-group>
+        </el-row>
+        <!--    专业子类    -->
+        <el-row class="radioInput filter" v-if="childrenMajors.length">
+          <div>
+            <span class="radiaTitle"></span>
+          </div>
           <div class="items fx-row">
             <div class="no_limited">
-              <el-checkbox @change="change('pick',$event)" v-model="isAll.pickType">不限</el-checkbox>
+              <el-checkbox @change="changeAll"   v-model="isAll">全部</el-checkbox>
             </div>
-            <el-radio-group v-model="filter_form.pickType">
-              <el-radio v-for="pick in localFilters.picks" :label="pick.value" :key="pick.value">{{ pick.label }}
-              </el-radio>
-            </el-radio-group>
+            <el-checkbox-group v-model="checkedList" >
+              <el-checkbox  v-for="item in childrenMajors" :label="item.code" :key="item.code">{{item.name}}</el-checkbox>
+            </el-checkbox-group>
           </div>
-        </div>
+        </el-row>
       </div>
     </div>
     <div class="zhiyuan-list">
@@ -29,8 +55,8 @@
   </div>
 </template>
 <script>
-import { zytbFilter } from '@/api/webApi/webQue'
 import FilterForm from '@/views/career/components/FilterForm';
+import { allMajor } from '@/api/webApi/professlib'
 export default {
   props: {
     formSubject: {
@@ -47,13 +73,18 @@ export default {
   },
   data() {
     return {
+      indeterminate:false,
+      checkedList:[],
       filter_form:{
         location:'',
         natureTypeCN:'',
         type:'',
         level:'',
         features:'',
+        pickType:'',
       },
+      currentMajor:'',
+      majorList:[],
       localFilters: {
         picks: [
           { label: '冲刺型', value: '0' },
@@ -61,7 +92,6 @@ export default {
           { label: '保守型', value: '2' }
         ]
       },
-      filters: {},
       rows: [{}],
       propDefines: {
         name: {
@@ -82,38 +112,79 @@ export default {
         action: {
           label: '填报'
         }
-      }
+      },
     }
   },
   created() {
-    this.$nextTick(_ => zytbFilter(this.batch.batch).then((res) => {
-      this.filters = res.data
-    }))
+    this.$nextTick(_ => {
+      this.getAllMajor()
+    })
   },
   computed: {
-    isAll: {
-      get() {
-        return {
-          pickType: !this.filter_form.pickType,
-        }
+    childrenMajors() {
+      if(!this.currentMajor) return []
+      return this.majorList.find(item => {
+        return item.code == this.currentMajor
+      }).children || []
+    },
+    isAll:{
+      get(){
+        // 当前children 全选
+        let count = 0
+        const childrenMajors = this.childrenMajors
+        this.checkedList.forEach(item => {
+          if(childrenMajors.findIndex(major => {return major.code == item}) != -1){
+            count++
+          }
+        })
+        console.log('选中数',count)
+        return count == childrenMajors.length
       },
-      set() {
+      set(){
+
       }
-    }
+    },
   },
   methods: {
-    change(val, $event) {
-      if ($event) {
-        if (val == 'pick') {
-          this.filter_form.pickType = ''
-        }
+    changeAll(val){
+      const checkedList =  this.checkedList
+      if(val) {
+        // 添加
+        this.childrenMajors.forEach(item => {
+          if(this.checkedList.findIndex(code => code == item.code) == -1 ){
+            this.checkedList.push(item.code)
+          }
+        })
+      }else {
+        // 移除
+        this.childrenMajors.forEach(item => {
+          for (let i = 0; i < checkedList.length; i++) {
+            if(item.code == checkedList[i]){
+              this.checkedList.remove(item.code)
+            }
+          }
+        })
       }
-    }
+
+      console.log(val)
+    },
+    handleCheckAllChange(val) {
+      this.isIndeterminate = false;
+    },
+    getAllMajor(){
+      allMajor({
+        level:2,
+        batch:this.batch.batch
+      }).then(res => {
+        this.majorList = res.data
+        console.log(res)
+      })
+    },
   }
 }
 </script>
 
-<style scoped>
+<style scoped lang="scss">
 .more span {
   margin-right: 10px;
 }
@@ -138,7 +209,7 @@ export default {
   margin-right: 10px;
 }
 
-.zhiyuan-filter .filters .filter .items .no_limited >>> .el-checkbox__input {
+.zhiyuan-filter .filters .filter .items .no_limited ::v-deep .el-checkbox__input {
   display: none;
 }
 
@@ -152,7 +223,7 @@ export default {
   border-bottom: 0;
 }
 
-.zhiyuan-filter .filters .filter >>> .el-checkbox, .zhiyuan-filter .filters .filter >>> .el-radio {
+.zhiyuan-filter .filters .filter ::v-deep .el-checkbox, .zhiyuan-filter .filters .filter ::v-deep .el-radio {
   -webkit-box-sizing: border-box;
   box-sizing: border-box;
   height: 32px;
@@ -165,12 +236,46 @@ em {
   font-style: normal;
 }
 
->>> .el-input--medium .el-input__inner {
+::v-deep .el-input--medium .el-input__inner {
   height: 30px;
   line-height: 30px;
 }
 
->>> .el-input {
+::v-deep .el-input {
   width: 260px;
 }
+
+.radioInput ::v-deep {
+  background-color: #ffffff;font-size: 14px;padding:5px;
+  .el-radio {
+    .el-radio__input {
+      display: none;
+    }
+  }
+}
+
+.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>