index.vue 6.6 KB

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