voluntary-history-list.vue 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <template>
  2. <view v-if="list.length" class="mt-20">
  3. <uv-row class="text-2xs text-content">
  4. <uv-col :span="3">年份</uv-col>
  5. <uv-col :span="3">录取</uv-col>
  6. <uv-col :span="3">最低分</uv-col>
  7. <uv-col :span="3">最低位次</uv-col>
  8. </uv-row>
  9. <uv-row v-for="(history, idx) in list.filter(h => h)" class="mt-10 text-xs text-content">
  10. <uv-col :span="3">
  11. <view v-if="history">{{ history.year }}</view>
  12. <view v-else>{{ historyYears[idx] }}</view>
  13. </uv-col>
  14. <template v-if="history">
  15. <uv-col :span="3">
  16. <view>
  17. {{ history.numReal || '-' }}
  18. <text>人</text>
  19. </view>
  20. </uv-col>
  21. <uv-col :span="3">
  22. <view class="fx-row">
  23. <text v-if="!history.inheritScore">{{ history.score || '-' }}</text>
  24. <view v-else class="fx-row" @click="$emit('notify', inheritScoreTips)">
  25. {{ history.score || '-' }}
  26. <uv-icon name="question-circle"/>
  27. </view>
  28. <uv-badge v-if="history.collect" value="征集" shape="horn" class="mr3"
  29. @click.native="$emit('notify', history.collectDesc)"/>
  30. </view>
  31. </uv-col>
  32. <uv-col :span="3">
  33. <view>{{ history.seat || '-' }}</view>
  34. </uv-col>
  35. </template>
  36. <template v-else>
  37. <uv-col :span="9">
  38. <view class="fx-row" @click="$emit('notify', unmatchedTips)">
  39. 未招生
  40. <uv-icon name="question-circle"/>
  41. </view>
  42. </uv-col>
  43. </template>
  44. </uv-row>
  45. </view>
  46. </template>
  47. <script>
  48. import {useInjectVoluntaryHeader} from "@/pages/voluntary/hooks/useVoluntaryHeaderInjection";
  49. export default {
  50. name: "voluntary-history-list",
  51. emits: ['notify'],
  52. props: {
  53. container: {
  54. type: Object,
  55. default: () => ({})
  56. }
  57. },
  58. data() {
  59. return {
  60. unmatchedTips: '未招生,或者专业名称/备注发生变化',
  61. inheritScoreTips: '院校或专业组分数线,专业分数线未更新或者官网未公布'
  62. }
  63. },
  64. setup() {
  65. const {historyYears} = useInjectVoluntaryHeader()
  66. return {
  67. historyYears
  68. }
  69. },
  70. computed: {
  71. list() {
  72. return this.container?.histories || []
  73. }
  74. }
  75. }
  76. </script>
  77. <style scoped>
  78. </style>