select-subject.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <template>
  2. <el-row :gutter="20">
  3. <el-col :span="12">
  4. <el-card>
  5. <template #header>
  6. <div class="fx-row fx-bet-cen">
  7. 您的自选专业:
  8. <el-button @click="toMatch(matchTypes.optional)">整体匹配</el-button>
  9. </div>
  10. </template>
  11. <div v-if="!!optionalMajors.length">
  12. <el-popover
  13. placement="bottom"
  14. trigger="hover"
  15. v-for="item in optionalMajors"
  16. popper-class="zero-padding-popover"
  17. >
  18. <div class="fx-column">
  19. <el-button plain type="text" @click="toGroupMatch(item)">匹配组合</el-button>
  20. </div>
  21. <el-tag class="mr10 mb10" type="success" slot="reference">{{ item.majorCategoryName }}</el-tag>
  22. </el-popover>
  23. </div>
  24. <el-tag v-else class="mr10 mb10" type="success">暂无</el-tag>
  25. </el-card>
  26. </el-col>
  27. <el-col :span="12">
  28. <el-card>
  29. <template #header>
  30. <div class="fx-row fx-bet-cen">
  31. 您的测评推荐专业:
  32. <div>
  33. <el-button type="primary" @click="$router.push('/elective/test/index')">查看报告</el-button>
  34. <el-button @click="toMatch(matchTypes.electiveTest)">整体匹配</el-button>
  35. </div>
  36. </div>
  37. </template>
  38. <div v-if="!!evaluationMajors.length">
  39. <el-popover
  40. placement="bottom"
  41. trigger="hover"
  42. v-for="item in evaluationMajors"
  43. popper-class="zero-padding-popover"
  44. >
  45. <div class="fx-column">
  46. <el-button plain type="text" @click="toGroupMatch(item)">匹配组合</el-button>
  47. </div>
  48. <el-tag class="mr10 mb10" type="success" slot="reference">{{ item.majorCategoryName }}</el-tag>
  49. </el-popover>
  50. </div>
  51. <el-tag v-else class="mr10 mb10" type="success">暂无</el-tag>
  52. </el-card>
  53. </el-col>
  54. <!-- 整体组合匹配 -->
  55. <group-match-dialog ref="groupMatch"></group-match-dialog>
  56. <!-- 单组合匹配-->
  57. <single-group-match ref="singleMatch"></single-group-match>
  58. </el-row>
  59. </template>
  60. <script>
  61. import consts from '@/common/mx-const'
  62. import GroupMatchDialog from '../../../../elective/select/components/groups-match-dialog'
  63. import SingleGroupMatch from './single-group-match'
  64. export default {
  65. components: {
  66. GroupMatchDialog,
  67. SingleGroupMatch
  68. },
  69. props: {
  70. list: {
  71. type: Array,
  72. default: _ => []
  73. },
  74. optionalMajors: {
  75. type: Array,
  76. default: _ => []
  77. },
  78. evaluationMajors: {
  79. type: Array,
  80. default: _ => []
  81. }
  82. },
  83. data() {
  84. return {
  85. dialogVisible: false,
  86. propDefines: {}
  87. }
  88. },
  89. computed: {
  90. matchTypes() {
  91. return consts.enum.electiveMajorMatchType
  92. },
  93. majorSource() {
  94. return {
  95. 1: this.optionalMajors,
  96. 2: this.evaluationMajors
  97. }
  98. }
  99. },
  100. methods: {
  101. // 整体组合匹配
  102. toMatch(type) {
  103. const majors = this.majorSource[type.value]
  104. this.$refs.groupMatch.open(this.list, majors, type)
  105. },
  106. // 单组合匹配
  107. toGroupMatch(major) {
  108. this.$refs.singleMatch.open(major, this.list)
  109. }
  110. }
  111. }
  112. </script>
  113. <style scoped>
  114. </style>