voluntary-card.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <template>
  2. <view class="bg-gradient-to-br from-primary-deep to-primary-light mx-card fx-col gap-20 p-30 text-2xs text-white">
  3. <view class="fx-row fx-bet-cen">
  4. <text>专业类别:{{ majorCategory.name }}</text>
  5. <text>省份:{{ userSnapshot.provinceName }}</text>
  6. </view>
  7. <view class="fx-row fx-bet-cen">
  8. <text>考生类别:{{ userSnapshot.examType }}</text>
  9. <view class="fx-row fx-end-center">
  10. <uv-icon name="clock" color="white"></uv-icon>
  11. <text class="text-right ml-10">{{ data.createTime }}</text>
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. import {findTreeNode} from "@/utils/tree-helper";
  18. import {useInjectUserSnapshot} from "@/pages/ie/hooks/useUserSnapshotInjection";
  19. import {useInjectMajorTreeService} from "@/pages/ie/hooks/useMajorTreeInjection";
  20. export default {
  21. name: 'voluntary-card',
  22. props: {
  23. data: {
  24. type: Object,
  25. default: () => ({})
  26. }
  27. },
  28. setup() {
  29. const {userSnapshot} = useInjectUserSnapshot()
  30. const {majorTree} = useInjectMajorTreeService()
  31. return {
  32. userSnapshot,
  33. majorTree
  34. }
  35. },
  36. computed: {
  37. majorCategory() {
  38. if (!this.majorTree) return {}
  39. return findTreeNode(this.majorTree, n => n.code == this.data.request?.majorCategory) || {}
  40. }
  41. }
  42. };
  43. </script>
  44. <style lang="scss" scoped>
  45. </style>