base-info.vue 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <view class="tabs-swiper-content pb-40">
  3. <view class="p-30">
  4. <view class="p-30 bg-white mx-card">
  5. <view class="fx-row fx-bet-sta mb-20">
  6. <view class="text-tips text-xs">
  7. <view v-for="p in majorPaths" :key="p">{{ p }}</view>
  8. </view>
  9. <major-item-collect :code="major.code" :model="detail"/>
  10. </view>
  11. <uv-text type="content" size="13" :text="detail.introduction"/>
  12. </view>
  13. </view>
  14. <view class="p-30 bg-white">
  15. <index-title-wrap title="核心课程" class="mb-10"/>
  16. <view class="bg-slate-100 p-30 rounded-lg text-xs text-content">
  17. {{ detail.mainCourse || '暂无介绍' }}
  18. </view>
  19. </view>
  20. <view class="p-30 bg-white">
  21. <index-title-wrap title="就业方向" class="mb-10"/>
  22. <view class="bg-slate-100 p-30 rounded-lg text-xs text-content">
  23. {{ detail.jobDirection || '暂无介绍' }}
  24. </view>
  25. </view>
  26. <view class="p-30 bg-white">
  27. <index-title-wrap title="职业能力" class="mb-10"/>
  28. <view class="bg-slate-100 p-30 rounded-lg text-xs text-content">
  29. {{ detail.loreAndAbility || '暂无介绍' }}
  30. </view>
  31. </view>
  32. <view class="p-30 bg-white">
  33. <index-title-wrap title="资格证书" class="mb-10"/>
  34. <view class="bg-slate-100 p-30 rounded-lg text-xs text-content">
  35. {{ detail.qualification || '暂无介绍' }}
  36. </view>
  37. </view>
  38. <view class="p-30 bg-white">
  39. <index-title-wrap title="衔接中职专业" class="mb-10"/>
  40. <view class="bg-slate-100 p-30 rounded-lg text-xs text-content">
  41. {{ detail.zhongzhiMajors || '暂无介绍' }}
  42. </view>
  43. </view>
  44. <view class="p-30 bg-white">
  45. <index-title-wrap title="衔接本科专业" class="mb-10"/>
  46. <view class="bg-slate-100 p-30 rounded-lg text-xs text-content">{{ detail.benMajors || '暂无介绍' }}</view>
  47. </view>
  48. <view class="mt-30 bg-white">
  49. <view class="p-30">
  50. <uv-text type="main" bold size="18" text="相关专业"/>
  51. </view>
  52. <uv-cell v-for="m in relatedMajors" :key="m.code" :title="m.name" is-link @click="goMajorDetail(m)"/>
  53. </view>
  54. </view>
  55. </template>
  56. <script setup>
  57. import {ref, computed, onMounted} from 'vue';
  58. import _ from 'lodash';
  59. import {createPropDefine} from "@/utils";
  60. import {findTreePath} from "@/utils/tree-helper";
  61. import {majorOverview} from "@/api/webApi/collegemajor";
  62. import IndexTitleWrap from "@/pages/index/components/index-title-wrap.vue";
  63. import {useCacheStore} from "@/hooks/useCacheStore";
  64. import {cacheActions} from "@/hooks/defineCacheActions";
  65. import MajorItemCollect from "@/pages/major-library/detail/components/major-item-collect.vue";
  66. import {useTransfer} from "@/hooks/useTransfer";
  67. const props = defineProps({
  68. major: createPropDefine({}, Object)
  69. })
  70. const {dispatchCache} = useCacheStore()
  71. const {transferTo} = useTransfer()
  72. const majorTree = ref([])
  73. const detail = ref({})
  74. const paths = computed(() => findTreePath(majorTree.value, m => m.code == props.major.code) || [])
  75. const majorPaths = computed(() => paths.value.map((m, idx) => Array(idx).fill('➣ ').join('') + m.name))
  76. const relatedMajors = computed(() => props.major.parent.children.filter(m => m != props.major))
  77. const goMajorDetail = (major) => {
  78. transferTo('/pages/major-library/detail/detail', ['code'], major)
  79. }
  80. onMounted(async () => {
  81. majorTree.value = await dispatchCache(cacheActions.getMajorTree)
  82. })
  83. onMounted(async () => {
  84. const {code} = props.major
  85. const res = await majorOverview({code})
  86. detail.value = res.data
  87. })
  88. </script>
  89. <style scoped>
  90. </style>