|
@@ -1,16 +1,12 @@
|
|
|
<template>
|
|
|
<div id="lineTable">
|
|
|
- <div style="text-align: right;margin-bottom: 10px;" class="search">
|
|
|
- <el-input style="width:40%;" suffix-icon=" " placeholder="搜索" v-model="tableParams.univerName" @keyup.enter.native="clickSuffix">
|
|
|
- <span slot="suffix" @click="clickSuffix" style="cursor: pointer">
|
|
|
- <i class="el-icon-search" style="margin-right: 10px;"></i>
|
|
|
- </span>
|
|
|
- </el-input>
|
|
|
- </div>
|
|
|
- <el-table :data="tableData" border>
|
|
|
+ <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">
|
|
|
- <el-link :underline="false" @click="goDetails(scope.row.universityId)">【{{scope.row.universityName}}】</el-link>
|
|
|
+ <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>
|
|
@@ -33,77 +29,90 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import {selectUniversityList} from '@/api/webApi/shiftLine'
|
|
|
- export default {
|
|
|
- name: "UniversitiesLineTable",
|
|
|
- props:{
|
|
|
- universityParams:{type:Object,default(){return {}}}
|
|
|
- },
|
|
|
- data(){
|
|
|
- return{
|
|
|
- examRecordTotal:0,
|
|
|
- tableParams:{
|
|
|
- pageSize:20,
|
|
|
- pageNum:1,
|
|
|
- level:'',
|
|
|
- location:'',
|
|
|
- type:'',
|
|
|
- univerName:'',
|
|
|
- year:''
|
|
|
- },
|
|
|
- tableData:[]
|
|
|
- }
|
|
|
- },
|
|
|
- watch:{
|
|
|
- universityParams:{
|
|
|
- immediate:true,
|
|
|
- deep:true,
|
|
|
- handler(val){
|
|
|
- this.tableParams.level=val.levelsRes
|
|
|
- this.tableParams.location=val.locationsRes
|
|
|
- this.tableParams.type=val.typeRes
|
|
|
- this.tableParams.year=val.yearRes
|
|
|
- this.getUniversityList()
|
|
|
- }
|
|
|
- }
|
|
|
+import { selectUniversityList } from '@/api/webApi/shiftLine'
|
|
|
+import MxSearchGroup from '@/components/MxSearch/mx-search-group'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'UniversitiesLineTable',
|
|
|
+ components: {
|
|
|
+ MxSearchGroup
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ universityParams: {
|
|
|
+ type: Object, default() {
|
|
|
+ return {}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ tableLoading: '',
|
|
|
+ examRecordTotal: 0,
|
|
|
+ tableParams: {
|
|
|
+ pageSize: 20,
|
|
|
+ pageNum: 1,
|
|
|
+ level: '',
|
|
|
+ location: '',
|
|
|
+ type: '',
|
|
|
+ univerName: '',
|
|
|
+ year: ''
|
|
|
},
|
|
|
- methods:{
|
|
|
- clickSuffix(){
|
|
|
- this.getUniversityList()
|
|
|
- },
|
|
|
- getUniversityList(){
|
|
|
- console.log(this.tableParams)
|
|
|
- selectUniversityList(this.tableParams).then(res=>{
|
|
|
- console.log(res)
|
|
|
- this.tableData=res.rows
|
|
|
- this.examRecordTotal=res.total
|
|
|
- })
|
|
|
- },
|
|
|
- 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 } })
|
|
|
- }
|
|
|
+ tableData: []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ universityParams: {
|
|
|
+ immediate: true,
|
|
|
+ deep: true,
|
|
|
+ handler(val) {
|
|
|
+ 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 => {
|
|
|
+ console.log(res)
|
|
|
+ this.tableData = res.rows
|
|
|
+ this.examRecordTotal = 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 } })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
- #lineTable{
|
|
|
- .search{
|
|
|
- .el-input {
|
|
|
- .el-input__inner {
|
|
|
- border-radius: 50px;
|
|
|
- }
|
|
|
+#lineTable {
|
|
|
+ .search {
|
|
|
+ .el-input {
|
|
|
+ .el-input__inner {
|
|
|
+ border-radius: 50px;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
|
|
|
</style>
|