index.vue 6.0 KB

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