groups-match.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <el-dialog
  3. :title="`整体组合匹配(${type == 1 ? '自选专业' : '测评专业'})`"
  4. :visible.sync="show"
  5. width="70%"
  6. >
  7. <div>
  8. <mx-table :propDefines="propDefines" :rows="formatList">
  9. </mx-table>
  10. </div>
  11. <span slot="footer" class="dialog-footer">
  12. <el-button type="primary" @click="show = false">确 定</el-button>
  13. </span>
  14. </el-dialog>
  15. </template>
  16. <script>
  17. export default {
  18. data() {
  19. return {
  20. show: false,
  21. majors: [],
  22. type: 1,
  23. reports: [],
  24. }
  25. },
  26. computed: {
  27. formatList() {
  28. if (!this.reports.length) return []
  29. return this.reports.map(item => {
  30. let tempProp = {}
  31. this.majors.map((major) => {
  32. if(major.matchedGroupIds.findIndex(gi => item.groupId == gi) != -1) {
  33. tempProp[`a${major.majorCategoryCode}`] = `符合${major.collegeName ? `(${major.collegeName})` : '' }`
  34. }
  35. })
  36. return {
  37. groupName: item.groupName,
  38. rankInGrade: item.rankInGrade,
  39. ...tempProp
  40. }
  41. })
  42. },
  43. propDefines() {
  44. if(!this.majors.length) return {}
  45. console.log(this.majors)
  46. const props = {}
  47. this.majors.map((item) => {
  48. props[`a${item.majorCategoryCode}`] = {label:item.majorCategoryName }
  49. })
  50. return {
  51. groupName: {
  52. label: '专业/组合'
  53. },
  54. rankInGrade: {
  55. label: '当前组合全校排名'
  56. },
  57. ...props,
  58. }
  59. },
  60. },
  61. methods: {
  62. open(reports,majors,type) {
  63. this.show = true
  64. this.type = type
  65. this.reports = reports
  66. this.majors = majors
  67. },
  68. }
  69. }
  70. </script>
  71. <style scoped>
  72. .cell .el-tag{
  73. margin-right: 5px;
  74. }
  75. </style>