index.vue 4.3 KB

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