index.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <template>
  2. <v-card class="card-box pa-5" style="height: 100%;">
  3. <div class="d-flex justify-space-between">
  4. <div></div>
  5. <v-btn color="primary" class="half-button" variant="tonal" @click="openDrawer">职位匹配</v-btn>
  6. </div>
  7. <!-- 人员信息表单 -->
  8. <v-data-table
  9. class="mt-3"
  10. :items="dataList"
  11. :headers="headers"
  12. hover
  13. :disable-sort="true"
  14. :loading="loading"
  15. loading-text="Loading... Please wait"
  16. item-value="id"
  17. >
  18. <template #bottom></template>
  19. <template v-slot:[`item.name`]="{ item }">
  20. <div class="d-flex align-center cursor-pointer" @click="null">
  21. <v-badge
  22. bordered
  23. offset-y="6"
  24. :color="badgeColor(item)"
  25. :icon="badgeIcon(item)">
  26. <v-avatar size="40" :image="getUserAvatar(item.avatar, item.sex)"></v-avatar>
  27. </v-badge>
  28. <span class="defaultLink ml-3">{{ item?.name }}</span>
  29. </div>
  30. </template>
  31. <template v-slot:[`item.advantage`]="{ item }">
  32. <template v-if="item.advantage">
  33. <v-btn color="primary" variant="tonal" @click="advantageDetail(item.advantage)">查看</v-btn>
  34. </template>
  35. </template>
  36. </v-data-table>
  37. <CtPagination
  38. v-if="total > 0"
  39. :total="total"
  40. :page="pageInfo.pageNo"
  41. :limit="pageInfo.pageSize"
  42. @handleChange="handleChangePage"
  43. ></CtPagination>
  44. <!-- <Empty v-else :message="tipsText" :elevation="false" class="mt-15"></Empty> -->
  45. <v-navigation-drawer v-model="screen" location="right" absolute temporary width="700">
  46. <FilterPage
  47. ref="FilterPageRef"
  48. @confirm="handleConfirm"
  49. @cancel="screen = false"
  50. ></FilterPage>
  51. </v-navigation-drawer>
  52. <v-navigation-drawer v-model="advantageShow" location="right" absolute temporary width="800">
  53. <div class="pa-3">
  54. <div class="resume-header">
  55. <div class="resume-title">个人优势</div>
  56. </div>
  57. <div class="requirement" v-html="advantageText?.replace(/\n/g, '</br>')"></div>
  58. </div>
  59. </v-navigation-drawer>
  60. </v-card>
  61. </template>
  62. <script setup>
  63. defineOptions({ name: 'enterprise-talent-map'})
  64. import { getRecruitPersonMapPage } from '@/api/recruit/enterprise/resumeManagement/talentMap'
  65. import { dealDictArrayData } from '@/utils/position'
  66. import { getUserAvatar } from '@/utils/avatar'
  67. import { timesTampChange } from '@/utils/date'
  68. import FilterPage from './components/filter.vue'
  69. import { computed, reactive, ref } from 'vue'
  70. const screen = ref(false)
  71. const loading = ref(false)
  72. let query = {}
  73. const pageInfo = reactive({ pageNo: 1, pageSize: 10 })
  74. const dataList = ref([])
  75. const total = ref(0)
  76. const headers = [
  77. { title: '姓名', key: 'name', sortable: false },
  78. { title: '求职状态', key: 'jobStatusName', sortable: false },
  79. // { title: '求职类型', key: 'jobName', sortable: false },
  80. { title: '电话号码', key: 'phone', sortable: false },
  81. { title: '常用邮箱', key: 'email', sortable: false },
  82. // { title: '微信二维码', key: 'wxCode', sortable: false },
  83. { title: '出生日期', key: 'birthday', sortable: false, value: item => timesTampChange(item.birthday, 'Y-M-D') },
  84. { title: '婚姻状况', key: 'maritalStatusName', sortable: false },
  85. { title: '所在城市', key: 'areaName', sortable: false },
  86. { title: '户籍地', key: 'regName', sortable: false },
  87. { title: '首次工作时间', key: 'firstWorkTime', sortable: false, value: item => timesTampChange(item.firstWorkTime, 'Y-M-D') },
  88. { title: '个人优势', key: 'advantage', sortable: false },
  89. { title: '工作年限', key: 'expName', sortable: false },
  90. { title: '最高学历', key: 'eduName', sortable: false },
  91. ]
  92. // 获取数据
  93. const getData = async () => {
  94. const obj = { ...pageInfo, ...query }
  95. // console.log('obj', obj)
  96. loading.value = true
  97. const { list, total: number } = await getRecruitPersonMapPage(obj)
  98. total.value = number
  99. dataList.value = list?.length ? dealDictArrayData([], list) : []
  100. loading.value = false
  101. }
  102. getData()
  103. const handleChangePage = (e) => {
  104. pageInfo.pageNo = e
  105. getData()
  106. }
  107. // 筛选
  108. const handleConfirm = (params) => {
  109. screen.value = false
  110. pageInfo.pageNo = 1
  111. query = { ...params }
  112. getData()
  113. }
  114. const advantageShow = ref(false)
  115. let advantageText = ''
  116. const advantageDetail = (advantage) => {
  117. advantageText = advantage
  118. advantageShow.value = true
  119. }
  120. const FilterPageRef = ref()
  121. const openDrawer = () => {
  122. screen.value = true
  123. if (Object.keys(query).length) FilterPageRef.value?.setValue(query)
  124. else FilterPageRef.value?.resetValue()
  125. }
  126. const badgeColor = computed(() => (item) => {
  127. return (item && item.sex) ? (item.sex === '1' ? '#1867c0' : 'error') : 'error'
  128. })
  129. const badgeIcon = computed(() => (item) => {
  130. return (item && item.sex) ? (item.sex === '1' ? 'mdi-gender-male' : 'mdi-gender-female') : 'mdi-gender-female'
  131. })
  132. </script>
  133. <style scoped lang="scss">
  134. :deep(.v-table > .v-table__wrapper > table > thead) {
  135. background-color: #f7f8fa !important;
  136. }
  137. :deep(.v-selection-control__input) {
  138. color: var(--v-primary-base) !important;
  139. }
  140. .requirementBox {
  141. width: 150px;
  142. height: 28px;
  143. line-height: 28px;
  144. // overflow: hidden;
  145. }
  146. .requirement {
  147. white-space: pre-wrap;
  148. word-break: break-all;
  149. line-height: 28px;
  150. color: var(--color-333);
  151. font-size: 15px;
  152. text-align: justify;
  153. letter-spacing: 0;
  154. // width: 60%;
  155. }
  156. .list-item {
  157. border: 1px solid #e5e6eb;
  158. }
  159. .top {
  160. display: flex;
  161. background-color: #f7f8fa;
  162. height: 50px;
  163. line-height: 50px;
  164. font-size: 14px;
  165. color: var(--color-666);
  166. padding: 0 20px;
  167. }
  168. .user-name {
  169. font-size: 18px;
  170. font-weight: 700;
  171. color: #555;
  172. }
  173. .user-info {
  174. color: var(--color-666);
  175. font-size: 14px;
  176. font-weight: 500;
  177. }
  178. :deep(.v-timeline-divider__dot--size-small) {
  179. width: 10px !important;
  180. height: 10px !important;
  181. margin-top: 10px !important;
  182. }
  183. :deep(.v-timeline-divider__inner-dot) {
  184. width: 10px !important;
  185. height: 10px !important;
  186. }
  187. .bottom {
  188. display: flex;
  189. justify-content: space-between;
  190. padding-bottom: 12px;
  191. .experience {
  192. width: 54%;
  193. height: 100%;
  194. }
  195. .edu {
  196. width: 40%;
  197. height: 100%;
  198. }
  199. }
  200. .second-title {
  201. color: var(--color-666);
  202. font-size: 15px;
  203. }
  204. .timeline-item {
  205. display: flex;
  206. align-items: center;
  207. justify-content: space-between;
  208. width: 100%;
  209. color: var(--color-666);
  210. font-size: 13px;
  211. .timeline-item-name {
  212. width: 26%;
  213. }
  214. }
  215. :deep(.v-timeline-item__body) {
  216. width: 100%;
  217. }
  218. :deep(.v-timeline--vertical.v-timeline) {
  219. row-gap: 0;
  220. }
  221. </style>