index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <view style="padding: 15px 15px 70px 15px; position: relative;">
  3. <baseInfo v-if="cvData?.person" :data="cvData?.person" />
  4. <view v-if="skillExp?.length">
  5. <view class="gap-line"></view>
  6. <view class="title-line">职业技能</view>
  7. <view class="tags">
  8. <view
  9. v-for="skill in skillExp"
  10. :key="skill.title"
  11. class="tag"
  12. >
  13. {{ skill.title }}
  14. </view>
  15. </view>
  16. </view>
  17. <view v-if="cvData?.person?.advantage">
  18. <view class="gap-line"></view>
  19. <view class="title-line">个人优势</view>
  20. <advantage :data="cvData?.person?.advantage" />
  21. </view>
  22. <view v-if="cvData?.interestedList?.length">
  23. <view class="gap-line"></view>
  24. <view class="title-line">求职意向</view>
  25. <jobIntention :data="dealJobData(cvData?.interestedList || [])" />
  26. </view>
  27. <view v-if="cvData?.eduList?.length">
  28. <view class="gap-line"></view>
  29. <view class="title-line">教育经历</view>
  30. <eduExp :data="cvData?.eduList" />
  31. </view>
  32. <view v-if="cvData?.workList?.length">
  33. <view class="gap-line"></view>
  34. <view class="title-line">工作经历</view>
  35. <workExp :data="cvData?.workList" />
  36. </view>
  37. <view v-if="cvData?.trainList?.length">
  38. <view class="gap-line"></view>
  39. <view class="title-line">培训经历</view>
  40. <trainingExperience :data="cvData?.trainList" />
  41. </view>
  42. <view class="bottom-actions">
  43. 操作按钮
  44. </view>
  45. </view>
  46. </template>
  47. <script setup>
  48. import { ref } from 'vue'
  49. import { onLoad } from '@dcloudio/uni-app'
  50. import { dealJobData } from '@/utils/dict'
  51. import { getDict } from '@/hooks/useDictionaries'
  52. import { getText } from '@/utils/getText'
  53. import { dealDictObjData } from '@/utils/position'
  54. import { getPersonCvDetail } from '@/api/enterprise.js'
  55. import baseInfo from './components/baseInfo.vue'
  56. import advantage from './components/advantage.vue'
  57. import jobIntention from './components/jobIntention.vue'
  58. import workExp from './components/workExp.vue'
  59. import eduExp from './components/eduExp.vue'
  60. import trainingExperience from './components/trainingExperience.vue'
  61. const cvData = ref({})
  62. const skillExp = ref([])
  63. const getSkillExp = async (data) => {
  64. if (!data || !data.length) {
  65. return
  66. }
  67. const { data: _skillList} = await getDict('skillList', {}, 'skillList')
  68. const skillList = _skillList?.data
  69. if (!skillList || !skillList.length) {
  70. return
  71. }
  72. const { data: _skillLevelArr } = await getDict('menduner_skill_level')
  73. const skillLevelArr = _skillLevelArr?.data
  74. if (!skillLevelArr || !skillLevelArr.length) {
  75. return
  76. }
  77. skillExp.value = data.map(e => {
  78. return {
  79. ...e,
  80. title: `${getText(e.skillId, skillList, 'nameCn', 'id')} / ${getText(e.level, skillLevelArr)}`
  81. }
  82. })
  83. }
  84. const getDetail = async (id) => {
  85. uni.showLoading({ title: '加载中' })
  86. try {
  87. const { data } = await getPersonCvDetail(id)
  88. if (!data) return
  89. data.person = dealDictObjData({}, data.person)
  90. cvData.value = data || {}
  91. getSkillExp(data?.skillList || [])
  92. uni.hideLoading()
  93. } catch {
  94. uni.hideLoading()
  95. }
  96. }
  97. onLoad(async (options) => {
  98. const { id } = options
  99. if (!id) {
  100. uni.showToast({
  101. title: '缺少人员id',
  102. icon: 'none'
  103. })
  104. setTimeout(() => {
  105. uni.navigateBack({ delta: 1 })
  106. }, 1000)
  107. return
  108. }
  109. await getDetail(id)
  110. })
  111. </script>
  112. <style scoped lang="scss">
  113. .gap-line {
  114. border-bottom: 1px solid #eee;
  115. margin: 30px 0;
  116. }
  117. .title-line {
  118. font-size: 20px;
  119. position: relative;
  120. line-height: 20px;
  121. margin-left: 12px;
  122. margin-bottom: 20px;
  123. padding-left: 10px;
  124. &::before {
  125. content: '';
  126. position: absolute;
  127. width: 6px;
  128. height: 20px;
  129. background: #00B760;
  130. left: -10px;
  131. border-radius: 6px;
  132. }
  133. }
  134. .tags {
  135. display: flex;
  136. flex-wrap: wrap;
  137. .tag {
  138. margin: 0 10rpx 10rpx 0;
  139. border: 2rpx solid #00B760;
  140. color: #00B760;
  141. white-space: nowrap;
  142. padding: 4rpx 10rpx;
  143. border-radius: 10rpx;
  144. font-size: 24rpx;
  145. }
  146. }
  147. .bottom-actions {
  148. position: fixed;
  149. width: 100%;
  150. bottom: 0;
  151. height: 50px;
  152. background-color: #fff;
  153. }
  154. </style>