UniversitiesColleges.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <div ref="UniversitiesColleges" class="app-container" >
  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. <div slot="header" class="radioInput" >
  10. <span class="radioTitle" :class="filter_type == 'all'?'active' : ''" @click="filter_type= 'all'">全部院校</span>
  11. <span class="radioTitle" :class="filter_type == 'top'?'active' : ''" @click="filter_type= 'top'">大学排名</span>
  12. </div>
  13. <keep-alive>
  14. <all-university v-if="filter_type == 'all'"></all-university>
  15. </keep-alive>
  16. <keep-alive>
  17. <rank-university v-if="filter_type == 'top'"></rank-university>
  18. </keep-alive>
  19. </el-card>
  20. </div>
  21. </template>
  22. <script>
  23. import { mapState } from 'vuex';
  24. import AllUniversity from '@/views/career/plan/compoents/AllUniversity';
  25. import RankUniversity from '@/views/career/plan/compoents/RankUniversity';
  26. import MxTransferMixin from "@/components/mx-transfer-mixin";
  27. export default {
  28. name: "UniversitiesColleges",
  29. components:{
  30. AllUniversity,
  31. RankUniversity
  32. },
  33. mixins: [MxTransferMixin],
  34. data() {
  35. return {
  36. backimg: 'url(' + require('@/assets/images/career/icon_colleges.png') + ')',
  37. filter_type:'all'
  38. }
  39. },
  40. computed: {
  41. ...mapState({ theme: state => state.settings.theme }),
  42. },
  43. watch: {
  44. theme: {
  45. immediate: true,
  46. handler(val) {
  47. this.$nextTick(() => {
  48. this.$refs.UniversitiesColleges.style.setProperty('--themeColor', val)
  49. })
  50. }
  51. },
  52. },
  53. created() {
  54. const validTypes = ['all', 'top']
  55. const queryType = this.prevData.type
  56. if (validTypes.includes(queryType)) this.filter_type = queryType
  57. },
  58. methods: {
  59. }
  60. }
  61. </script>
  62. <style lang="scss" scoped>
  63. .layui-bg-orange {
  64. background-color: var(--themeColor);
  65. margin-left: 0;
  66. }
  67. .radioInput{
  68. background-color: #ffffff;
  69. padding:5px;
  70. padding-left: 30px;
  71. .radioTitle{
  72. cursor: pointer;
  73. display: inline-block;
  74. width: 80px;
  75. font-size: 14px;
  76. padding: 5px 10px ;
  77. text-align: center;
  78. &.active{
  79. color: #fff;
  80. border-radius: 4px ;
  81. border: none;
  82. font-weight: 400;
  83. background: #42b983;
  84. }
  85. }
  86. }
  87. </style>