single-group-match.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <el-dialog
  3. title="单组合匹配"
  4. :visible.sync="singleShow"
  5. width="30%"
  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="singleShow = false">确 定</el-button>
  13. </span>
  14. </el-dialog>
  15. </template>
  16. <script>
  17. export default {
  18. data() {
  19. return {
  20. singleShow: false,
  21. major: [],
  22. reports: [],
  23. }
  24. },
  25. computed: {
  26. formatList() {
  27. if (!this.reports.length) return []
  28. return this.reports.map(item => {
  29. return {
  30. groupName: item.groupName,
  31. status: this.major.matchedGroupIds.findIndex(gi => gi == item.groupId) != -1 ? '符合' : '不符合',
  32. }
  33. })
  34. },
  35. propDefines() {
  36. if (!this.major) return {}
  37. return {
  38. groupName: {
  39. label: `${this.major.majorCategoryName}${this.major.collegeName ? `(${this.major.collegeName})`: '' }`
  40. },
  41. status: {
  42. label: '符合'
  43. },
  44. }
  45. },
  46. },
  47. methods: {
  48. open(major,reports) {
  49. this.singleShow = true
  50. this.major = major
  51. this.reports = reports
  52. },
  53. }
  54. }
  55. </script>
  56. <style scoped>
  57. .cell .el-tag{
  58. margin-right: 5px;
  59. }
  60. </style>