UniversitiesColleges.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <template>
  2. <div ref="UniversitiesColleges" class="app-container" v-loading="loading">
  3. <el-card :style="{'background-image':backimg}" style="padding:30px;margin:10px 0;background-color:white;background-repeat: no-repeat;background-position: bottom right;">
  4. <p style="color:#A6A6A6;font-size:24px;font-weight:bold;">UNIVERSITIES AND COLLECGES</p>
  5. <p style="color:#414141;font-size:24px;font-weight:bold;">院校库</p>
  6. <hr class="layui-bg-orange" style="width:40px;height:4px;margin-top:10px;" />
  7. </el-card>
  8. <el-card style="background-color: #ffffff;font-size: 14px;padding:5px;">
  9. <el-row class="radioInput">
  10. <div>
  11. <span class="radiaTitle">院校省份:</span>
  12. </div>
  13. <el-radio-group v-model="filter_form.location">
  14. <el-radio-button label="">所有</el-radio-button>
  15. <el-radio-button v-for="item in filter_list.locations" :key="item" :label="item" style="margin-bottom:10px"></el-radio-button>
  16. </el-radio-group>
  17. </el-row>
  18. <el-row class="radioInput" style="background-color: #ffffff;font-size: 14px;padding:5px;">
  19. <div>
  20. <span class="radiaTitle">院校类型:</span>
  21. </div>
  22. <el-radio-group v-model="filter_form.type">
  23. <el-radio-button label="">所有</el-radio-button>
  24. <el-radio-button v-for="item in filter_list.types" :key="item" :label="item" style="margin-bottom:10px"></el-radio-button>
  25. </el-radio-group>
  26. </el-row>
  27. <el-row class="radioInput" style="background-color: #ffffff;font-size: 14px;padding:5px;">
  28. <div>
  29. <span class="radiaTitle">院校层次:</span>
  30. </div>
  31. <el-radio-group v-model="filter_form.features">
  32. <el-radio-button label="">所有</el-radio-button>
  33. <el-radio-button v-for="item in filter_list.features" :key="item" :label="item" style="margin-bottom:10px"></el-radio-button>
  34. </el-radio-group>
  35. </el-row>
  36. <el-row class="radioInput" style="background-color: #ffffff;font-size: 14px;padding:5px;">
  37. <div>
  38. <span class="radiaTitle">学历层次:</span>
  39. </div>
  40. <el-radio-group v-model="filter_form.level">
  41. <el-radio-button label="">所有</el-radio-button>
  42. <el-radio-button v-for="item in filter_list.levels" :key="item" :label="item" style="margin-bottom:10px"></el-radio-button>
  43. </el-radio-group>
  44. </el-row>
  45. <el-row class="radioInput" style="background-color: #ffffff;font-size: 14px;padding:5px;">
  46. <div>
  47. <span class="radiaTitle">办学类型:</span>
  48. </div>
  49. <el-radio-group v-model="filter_form.natureTypeCN">
  50. <el-radio-button label="">所有</el-radio-button>
  51. <el-radio-button v-for="item in filter_list.natureTypes" :key="item" :label="item" style="margin-bottom:10px"></el-radio-button>
  52. </el-radio-group>
  53. </el-row>
  54. <mx-search-group justify="end" v-model="collegeName" @search="clickSuffix">
  55. <p>共 <span class="f-primary">{{pageForm.total}}</span> 条</p>
  56. </mx-search-group>
  57. <el-row class="mt10 ">
  58. <div v-if="pageForm.total > 0">
  59. <div class="list-wrap pl30">
  60. <div class="list-item fx-row mb30" v-for="item in collegeList">
  61. <div class="img" >
  62. <img style="width: 100%;height: 100%" :src="item.logo" alt="">
  63. </div>
  64. <div class="info ml20">
  65. <div class="college_name pointer f-333 f20 mb5" @click="toDetail(item)">{{item.name}}</div>
  66. <div class="tags" v-if="item.features">
  67. <span class="mr5 el-tag el-tag--info el-tag--plain" v-for="feature in item.features.split(',')">{{ feature }}</span>
  68. </div>
  69. <div class="college-desc mt5 f14 f-666">
  70. <p>{{`${item.location} ${item.cityName} ${item.type} / ${item.natureTypeCN} / ${item.managerType} `}}</p>
  71. </div>
  72. </div>
  73. <div class="heat f12 f-666">
  74. <p>排名</p>
  75. <p class="mt3">{{ `第${item.ranking}名 / 综合指数${item.comScore}` }}</p>
  76. </div>
  77. <div class="heat f12 f-666">
  78. <p>热度</p>
  79. <p class="mt3">{{ (item.hits/10000).toFixed(1) }}万</p>
  80. </div>
  81. </div>
  82. </div>
  83. <pagination class="mt10" :total="pageForm.total" :autoScroll="false" @pagination="onChangePage"
  84. :page.sync="pageForm.pageNum"
  85. :limit.sync="pageForm.pageSize"
  86. ></pagination>
  87. </div>
  88. <evaluation-empty v-else shadow title="暂无数据"></evaluation-empty>
  89. </el-row>
  90. </el-card>
  91. </div>
  92. </template>
  93. <script>
  94. import { mapState } from 'vuex';
  95. import UniversitiesTable from '@/views/career/components/UniversitiesTable';
  96. import { selectUniversityList, universityFilters } from '@/api/webApi/career-course'
  97. import MxSearchGroup from '@/components/MxSearch/mx-search-group'
  98. export default {
  99. name: "UniversitiesColleges",
  100. components: { MxSearchGroup, UniversitiesTable },
  101. data() {
  102. return {
  103. backimg: 'url(' + require('@/assets/images/career/icon_colleges.png') + ')',
  104. filter_form:{
  105. location:'',
  106. natureTypeCN:'',
  107. type:'',
  108. level:'',
  109. features:'',
  110. name:''
  111. },
  112. loading:false,
  113. collegeName:'',
  114. pageForm:{
  115. pageSize:10,
  116. pageNum:1,
  117. total:0
  118. },
  119. filter_list:{},
  120. collegeList:[],
  121. headerFixed: true
  122. }
  123. },
  124. computed: {
  125. ...mapState({ theme: state => state.settings.theme }),
  126. },
  127. watch: {
  128. theme: {
  129. immediate: true,
  130. handler(val) {
  131. this.$nextTick(() => {
  132. this.$refs.UniversitiesColleges.style.setProperty('--themeColor', val)
  133. })
  134. }
  135. },
  136. filter_form:{
  137. immediate: true,
  138. deep:true,
  139. handler(val) {
  140. this.getUniversityList()
  141. }
  142. },
  143. 'universityParams.locationsRes': {
  144. handler(val) {
  145. this.universityParams.name = ''
  146. this.univerName = ''
  147. }
  148. }
  149. },
  150. created() {
  151. this.getFilter()
  152. },
  153. methods: {
  154. toDetail(item) {
  155. console.log(item)
  156. this.$router.push({path:'/career/plan/UniversityDetail',query: {code:item.code}})
  157. },
  158. onChangePage(page) {
  159. this.pageForm.pageSize = page.limit
  160. this.pageForm.pageNum = page.page
  161. this.getUniversityList()
  162. },
  163. clickSuffix() {
  164. this.filter_form.name = this.univerName
  165. },
  166. getFilter() {
  167. universityFilters().then(res => {
  168. this.filter_list = res.data
  169. })
  170. },
  171. getUniversityList(){
  172. this.loading = true
  173. // console.log(params)
  174. selectUniversityList({ ...this.filter_form,
  175. pageNum:this.pageForm.pageNum,
  176. pageSize:this.pageForm.pageSize,
  177. }).then(res=>{
  178. this.pageForm.total =res.total
  179. this.collegeList =res.rows
  180. }).finally(() => {
  181. this.loading = false
  182. })
  183. },
  184. }
  185. }
  186. </script>
  187. <style lang="scss" scoped>
  188. .layui-bg-orange {
  189. background-color: var(--themeColor);
  190. margin-left: 0;
  191. }
  192. .heat{
  193. width: 200px;
  194. height: 72px;
  195. padding-top: 22px;
  196. color: #666;
  197. }
  198. .info{
  199. width: 400px;
  200. }
  201. .img{
  202. width: 72px;
  203. height: 72px;
  204. }
  205. .tags {
  206. .el-tag{
  207. height: 16px;
  208. line-height: 16px;
  209. font-size: 12px;
  210. color: #909399;
  211. }
  212. }
  213. .radioInput ::v-deep {
  214. .el-radio {
  215. .el-radio__input {
  216. display: none;
  217. }
  218. }
  219. }
  220. .radioInput ::v-deep {
  221. display: flex;
  222. .el-radio-button .el-radio-button__inner {
  223. border-radius: 4px !important;
  224. border: none;
  225. padding: 5px 10px !important;
  226. font-weight: 400;
  227. font-family: PingFangSC-Regular, PingFang SC;
  228. }
  229. .el-radio-button__orig-radio:checked + .el-radio-button__inner {
  230. box-shadow: none;
  231. }
  232. .radiaTitle {
  233. display: inline-block;
  234. width: 80px;
  235. font-size: 14px;
  236. text-align: right;
  237. margin-top: 2px;
  238. margin-right:10px;
  239. }
  240. }
  241. // 吸顶
  242. .issFixed{
  243. position: absolute;
  244. top: 0px;
  245. background: #fff;
  246. left: 0px;
  247. right: 0px;
  248. z-index: 4;
  249. }
  250. </style>