index.vue 7.3 KB

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