SelectUniversity.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <div class="selectUniversity" id="selectUniversity" ref="selectUniversity">
  3. <div>
  4. <mx-search-group class="mb10" justify="space-between" :span="10" v-model="collegeName" placeholder="请输入院校名称"
  5. @search="clickSuffix"
  6. >
  7. <h1 class="title">选择院校</h1>
  8. </mx-search-group>
  9. <filter-form :filter="filter_form"></filter-form>
  10. </div>
  11. <div style="margin-top: 20px;">
  12. <div>
  13. <el-row :gutter="20">
  14. <el-col :span="6" v-for="item in tableData" :key="item.id">
  15. <div @click="changeUniversity(item)" class="universityList">{{ item.name }}</div>
  16. </el-col>
  17. </el-row>
  18. </div>
  19. <pagination class="mt10" :total="total" :autoScroll="false" @pagination="getUniversityList"
  20. :page.sync="pageForm.pageNum"
  21. :limit.sync="pageForm.pageSize"
  22. ></pagination>
  23. </div>
  24. </div>
  25. </template>
  26. <script>
  27. import { mapState } from 'vuex'
  28. import MxSearchGroup from '@/components/MxSearch/mx-search-group'
  29. import FilterForm from '@/views/career/components/FilterForm'
  30. import { selectUniversityList } from '@/api/webApi/career-course'
  31. export default {
  32. name: 'SelectUniversity',
  33. components: { MxSearchGroup,FilterForm },
  34. data() {
  35. return {
  36. pageForm: {
  37. pageSize: 20,
  38. pageNum: 1,
  39. },
  40. collegeName:'',
  41. total: 0,
  42. filter_form:{
  43. location:'',
  44. natureTypeCN:'',
  45. type:'',
  46. level:'',
  47. features:'',
  48. name:''
  49. },
  50. tableData: []
  51. }
  52. },
  53. computed: {
  54. ...mapState({ theme: (state) => state.settings.theme })
  55. },
  56. watch: {
  57. theme: {
  58. immediate: true,
  59. handler(val) {
  60. this.$nextTick(() => {
  61. this.$refs.selectUniversity.style.setProperty('--themeColor', val)
  62. })
  63. }
  64. },
  65. filter_form:{
  66. immediate: true,
  67. deep:true,
  68. handler(val) {
  69. this.getUniversityList()
  70. }
  71. }
  72. },
  73. methods: {
  74. changeUniversity(data) {
  75. this.$emit('changeUniversity', data)
  76. },
  77. getUniversityList() {
  78. selectUniversityList({ ...this.pageForm,...this.filter_form }).then(res => {
  79. this.tableData = res.rows
  80. this.total = res.total
  81. })
  82. },
  83. clickSuffix() {
  84. this.filter_form.name = this.collegeName
  85. },
  86. }
  87. }
  88. </script>
  89. <style scoped lang="scss">
  90. #selectUniversity {
  91. font-family: PingFangSC-Regular, PingFang SC;
  92. font-weight: 400;
  93. padding: 0 30px;
  94. .title {
  95. font-weight: 400;
  96. border-left: 6px solid var(--themeColor);
  97. padding: 5px 20px;
  98. color: var(--themeColor);
  99. }
  100. .search {
  101. .el-input {
  102. .el-input__inner {
  103. border-radius: 50px;
  104. }
  105. }
  106. }
  107. .universityList {
  108. background-color: var(--themeColor);
  109. line-height: 60px;
  110. margin-bottom: 10px;
  111. text-align: center;
  112. }
  113. }
  114. </style>
  115. <style lang="scss">
  116. .selectUniversity {
  117. .search {
  118. .el-input {
  119. .el-input__inner {
  120. border-radius: 50px;
  121. }
  122. }
  123. }
  124. .radioInput {
  125. .el-radio {
  126. .el-radio__input {
  127. display: none;
  128. }
  129. }
  130. }
  131. .radioInput {
  132. display: flex;
  133. margin-top: 5px;
  134. .el-radio-button .el-radio-button__inner {
  135. border-radius: 4px !important;
  136. border: none;
  137. padding: 5px 10px !important;
  138. font-weight: 400;
  139. font-family: PingFangSC-Regular, PingFang SC;
  140. }
  141. .el-radio-button__orig-radio:checked + .el-radio-button__inner {
  142. box-shadow: none;
  143. }
  144. }
  145. }
  146. </style>