group-subject-query.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <div>
  3. <div v-if="Object.keys(model).length > 0">
  4. <h3>{{`${year}年${model.location}省选科大数据分析`}}</h3>
  5. <el-row class="mb20" :gutter="10">
  6. <el-col class="f14" :span="col.span" v-for="col in cols">
  7. <p class="pb10" style="border-bottom: 1px solid #ebeef5;"> {{col.label}}</p>
  8. <p class="f20 f-333 pt10 pb10"> {{col.value}}</p>
  9. <p class="f16"> {{col.subValue}}</p>
  10. </el-col>
  11. </el-row>
  12. <mx-table :prop-defines="propDefines" :rows="model.majorCombine">
  13. <template #groupInfo="{row}">
  14. <div >
  15. <span >{{row.name}}</span >
  16. <el-progress style="width:70%;float: right" :text-inside="true" :stroke-width="24" :percentage="row.percent" status="success"></el-progress>
  17. </div>
  18. </template>
  19. </mx-table>
  20. </div>
  21. <div v-else>
  22. 暂无数据
  23. </div>
  24. </div>
  25. </template>
  26. <script>
  27. import { getSelectCourseBigdata } from '@/api/webApi/selection'
  28. export default {
  29. name: 'GroupSubjectQuery',
  30. props: {
  31. level:{
  32. type: String,
  33. default: ''
  34. },
  35. year:{
  36. type: Number,
  37. default: ''
  38. }
  39. },
  40. data() {
  41. return{
  42. model: {},
  43. propDefines:{
  44. index:{
  45. label: '序号',
  46. type: 'index'
  47. },
  48. name:{
  49. label: '选科组合',
  50. slot: 'groupInfo'
  51. },
  52. count:{
  53. label: '匹配专业',
  54. width:'100px',
  55. },
  56. percentview:{
  57. label: '匹配率',
  58. width:'100px',
  59. },
  60. }
  61. }
  62. },
  63. computed: {
  64. cols(){
  65. if(!this.model) return []
  66. const cols = [
  67. {
  68. label: '院校',
  69. span: 3,
  70. value: this.model.countcollege
  71. },
  72. {
  73. label: '专业',
  74. span: 3,
  75. value: this.model.countmajor
  76. }
  77. ]
  78. this.model.majorSubject.forEach(item => {
  79. cols.push(
  80. {
  81. label: item.name,
  82. value: item.count,
  83. span: 2,
  84. subValue: item.percentview
  85. }
  86. )
  87. })
  88. return cols
  89. }
  90. },
  91. created() {
  92. console.log(111111111111111)
  93. this.getList()
  94. },
  95. methods: {
  96. getList() {
  97. getSelectCourseBigdata({
  98. year: this.year,
  99. eduLevel:this.level
  100. }).then(res => {
  101. this.model = res.data || {}
  102. console.log(res)
  103. })
  104. }
  105. }
  106. }
  107. </script>
  108. <style scoped>
  109. </style>