ai-analysis-dialog.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <el-dialog
  3. v-if="dialogVisible"
  4. title="AI分析"
  5. :visible.sync="dialogVisible"
  6. width="80%"
  7. >
  8. 当前Generation {{current}}
  9. <mx-table :propDefines="formatTable.cols" :rows="formatTable.rows">
  10. <template #subjects="{row}">
  11. <el-row>
  12. <el-col :span="8" v-for="subject in row.subjects">
  13. <el-tag type="success" class="mr10 mb10">{{ subject[0] }}</el-tag>
  14. </el-col>
  15. </el-row>
  16. </template>
  17. <template #group="{row}">
  18. <span :class="{'f-primary': row.allowSelect,'f-red':!row.allowSelect}">{{row.groupName}}</span>
  19. </template>
  20. <template #colleges="{row}">
  21. <el-row>
  22. <el-col :span="12" v-for="college in row.colleges">
  23. <el-tag type="success" class="mb10">{{ college.major[0] }}</el-tag>
  24. :
  25. <span>{{ college.college }}</span>
  26. </el-col>
  27. </el-row>
  28. </template>
  29. <template #report="{row}">
  30. <el-button >查看</el-button>
  31. </template>
  32. </mx-table>
  33. <span slot="footer" class="dialog-footer">
  34. <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
  35. </span>
  36. </el-dialog>
  37. </template>
  38. <script>
  39. import config from '@/common/mx-config'
  40. export default {
  41. data() {
  42. return{
  43. dialogVisible:false,
  44. tableInfo: {},
  45. current: ''
  46. }
  47. },
  48. computed: {
  49. steps() {
  50. return config.electiveGenerationOptions
  51. },
  52. formatTable() {
  53. if(!Object.keys(this.tableInfo).length) return {}
  54. const cols = {
  55. groupName: {
  56. label: '科目组合',
  57. width: '80',
  58. slot:'group'
  59. },
  60. scoreSumGroup: {
  61. label: '组合成绩',
  62. width: '80'
  63. },
  64. groupIndicator: {
  65. label: '剩余计划',
  66. width: '80'
  67. },
  68. bestInIndicator: {
  69. label: '组合成绩最高人数'
  70. },
  71. rankInBest: {
  72. label: '组合成绩最高人数排名'
  73. },
  74. rankInDisenroll: {
  75. label: '补录人数排名'
  76. },
  77. subjects: {
  78. label: '已选专业',
  79. slot: 'subjects',
  80. width: '150'
  81. },
  82. colleges: {
  83. label: '院校',
  84. slot: 'colleges',
  85. width: '250'
  86. },
  87. report: {
  88. label: '报告',
  89. slot:'report'
  90. },
  91. }
  92. // 剩余指标累计
  93. const groupIndicatorAll = this.tableInfo.rows.reduce((prev,current)=> {
  94. console.log(current.groupIndicator )
  95. return prev + current.groupIndicator
  96. },0)
  97. const rows = this.tableInfo.rows.map(item => {
  98. return {
  99. groupName: item.groupName,
  100. isRecommend: item.isRecommend,
  101. rankInDisenroll: item.rankInDisenroll ? `${item.rankInDisenroll}/${groupIndicatorAll}` : '/',
  102. rankInBest: item.rankInBest ? `${item.rankInBest}/${item.bestInIndicator}` : '/',
  103. bestInIndicator: item.bestInIndicator || '/',
  104. groupIndicator: item.groupIndicator,
  105. scoreSumGroup: item.scoreSumGroup,
  106. groupId: item.groupId,
  107. subjects: item.subjects,
  108. allowSelect: item.allowSelect,
  109. colleges: item.colleges
  110. }
  111. })
  112. return {
  113. cols,
  114. rows
  115. }
  116. }
  117. },
  118. methods: {
  119. open(tableInfo,currentGeneration) {
  120. this.current = currentGeneration
  121. this.dialogVisible = true
  122. this.tableInfo = tableInfo
  123. },
  124. handleClose() {
  125. }
  126. }
  127. }
  128. </script>
  129. <style scoped>
  130. </style>