UniversitiesTable.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <div id="univerTable">
  3. <el-table :data="tableData" script>
  4. <el-table-column prop="code" label="院校代码" align="center">
  5. <template slot-scope="scope">
  6. <el-link :underline="false" @click="goDetails(scope.row.id)">【{{ scope.row.code }}】</el-link>
  7. </template>
  8. </el-table-column>
  9. <el-table-column prop="name" label="院校名称" align="center">
  10. <template slot-scope="scope">
  11. <el-link :underline="false" @click="goDetails(scope.row.id)">{{ scope.row.name }}</el-link>
  12. </template>
  13. </el-table-column>
  14. <el-table-column prop="location" label="所在地" width="70" align="center" />
  15. <el-table-column prop="managerType" label="主管部门" align="center" />
  16. <el-table-column prop="type" label="院校类型" align="center" />
  17. <el-table-column prop="level" label="学历层次" align="center" />
  18. <!--sortable 排序-->
  19. <el-table-column label="一流大学建设高校" align="center" width="100">
  20. <template slot-scope="scope">
  21. <el-image v-if="scope.row.ylxx===2" :src="require('@/assets/images/career/icon_duigou.png')" />
  22. </template>
  23. </el-table-column>
  24. <el-table-column label="一流学科建设高校" align="center" width="100">
  25. <template slot-scope="scope">
  26. <el-image v-if="scope.row.ylxk===2" :src="require('@/assets/images/career/icon_duigou.png')" />
  27. </template>
  28. </el-table-column>
  29. <el-table-column label="研究生院" align="center">
  30. <template slot-scope="scope">
  31. <el-image v-if="scope.row.yjsy===2" :src="require('@/assets/images/career/icon_duigou.png')" />
  32. </template>
  33. </el-table-column>
  34. </el-table>
  35. <el-pagination
  36. style="margin-top:10px;"
  37. :page-sizes="[10,20,30,40,50,60,70,80,90,100]"
  38. :page-size="tableParams.limit"
  39. layout="prev,pager,next,jumper,total,sizes"
  40. :total="tableParams.examRecordTotal"
  41. @current-change="currentChange"
  42. @size-change="sizeChange"
  43. />
  44. </div>
  45. </template>
  46. <script>
  47. import { selectUniversityList } from '@/api/webApi/career-course'
  48. export default {
  49. name: 'UniversitiesTable',
  50. props: {
  51. filterForm: { type: Object, default() { return {} } }
  52. },
  53. data() {
  54. return {
  55. tableParams: {
  56. examRecordTotal: 0,
  57. pageSize: 1,
  58. limit: 20
  59. },
  60. tableData: []
  61. }
  62. },
  63. watch: {
  64. filterForm: {
  65. immediate: true,
  66. deep: true,
  67. handler(val) {
  68. this.getUniversityList()
  69. }
  70. }
  71. },
  72. methods: {
  73. goDetails(id) {
  74. this.$router.push({ path: '/career/components/UniversityDetail', query: { id: id }})
  75. },
  76. sizeChange(e) {
  77. // 每页条数
  78. this.tableParams.limit = e
  79. this.getUniversityList()
  80. },
  81. currentChange(e) {
  82. // 页数
  83. this.tableParams.pageSize = e
  84. this.getUniversityList()
  85. },
  86. getUniversityList() {
  87. // console.log(params)
  88. selectUniversityList({ ...this.filterForm,
  89. pageNum: this.tableParams.pageSize,
  90. pageSize: this.tableParams.limit
  91. }).then(res => {
  92. this.tableData = res.rows
  93. this.tableParams.examRecordTotal = res.total
  94. })
  95. },
  96. getUniverCharact(type) { // 判断学院特性
  97. let result = '' // 1-->否 2-->是
  98. const flag = this.universityParams.checkList.some(item => {
  99. return item === type
  100. })
  101. if (flag) {
  102. result = 2
  103. } else {
  104. result = ''
  105. }
  106. return result
  107. }
  108. }
  109. }
  110. </script>
  111. <style lang="scss">
  112. #univerTable{
  113. .el-table .descending .sort-caret.descending{
  114. border-top-color:#ffffff;
  115. }
  116. .el-table .ascending .sort-caret.ascending{
  117. border-bottom-color:#ffffff;
  118. }
  119. }
  120. </style>