search.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <!-- 搜索工作栏 -->
  3. <ContentWrap>
  4. <el-form
  5. class="-mb-15px"
  6. :model="queryParams"
  7. ref="queryFormRef"
  8. :inline="true"
  9. label-width="68px"
  10. >
  11. <el-form-item label="姓名" prop="name">
  12. <el-input v-model="queryParams.name" placeholder="请输入姓名" clearable @keyup.enter="handleQuery" class="!w-130px" />
  13. </el-form-item>
  14. <el-form-item label="联系电话" prop="phone">
  15. <el-input v-model="queryParams.phone" placeholder="请输入联系电话" clearable @keyup.enter="handleQuery" class="!w-130px" />
  16. </el-form-item>
  17. <el-form-item>
  18. <el-button @click="handleQuery" type="primary"><Icon icon="ep:search" /> 搜索</el-button>
  19. <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
  20. </el-form-item>
  21. </el-form>
  22. </ContentWrap>
  23. <div v-if="paramsVerify && !list?.length" class="tip">
  24. <div>{{ tipContent }}</div>
  25. </div>
  26. <!-- 列表 -->
  27. <ContentWrap>
  28. <div class="listBox" v-loading="loading">
  29. <personCard
  30. v-for="item of list"
  31. :key="item.id"
  32. :data="item"
  33. class="item"
  34. @detail="detail"
  35. />
  36. </div>
  37. </ContentWrap>
  38. <ContentWrap>
  39. <!-- <el-table v-loading="loading" :data="list" :stripe="true">
  40. <el-table-column label="姓名" align="center" prop="person.name" fixed="left" />
  41. <el-table-column label="联系电话" align="center" prop="user.phone" width="120px" />
  42. <el-table-column label="求职状态" align="center" prop="person.jobStatus" width="130px">
  43. <template #default="scope">
  44. <dict-tag v-if="scope.row.person?.jobStatus" :type="DICT_TYPE.MENDUNER_JOB_SEEK_STATUS" :value="scope.row.person?.jobStatus" />
  45. </template>
  46. </el-table-column>
  47. <el-table-column label="学历" align="center" prop="person.eduType">
  48. <template #default="scope">
  49. <dict-tag v-if="scope.row.person?.eduType" :type="DICT_TYPE.MENDUNER_EDUCATION_TYPE" :value="scope.row.person?.eduType" />
  50. </template>
  51. </el-table-column>
  52. <el-table-column label="工作经验" align="center" prop="person.expType">
  53. <template #default="scope">
  54. <dict-tag v-if="scope.row.person?.expType" :type="DICT_TYPE.MENDUNER_EXP_TYPE" :value="scope.row.person?.expType" />
  55. </template>
  56. </el-table-column>
  57. <el-table-column label="操作" align="center" fixed="right" min-width="60">
  58. <template #default="scope">
  59. <el-button link type="primary" @click="handleDetail(scope.row)">{{ detailButTxt || '详情'}}</el-button>
  60. </template>
  61. </el-table-column>
  62. </el-table> -->
  63. <!-- 分页 -->
  64. <Pagination
  65. :total="total"
  66. layout="total, prev, pager, next"
  67. v-model:page="queryParams.pageNo"
  68. v-model:limit="queryParams.pageSize"
  69. @pagination="getList"
  70. />
  71. </ContentWrap>
  72. </template>
  73. <script setup>
  74. defineOptions({ name: 'TalentMapSearch' })
  75. import { TalentMap } from '@/api/menduner/system/talentMap'
  76. import { PersonInfoApi } from '@/api/menduner/system/person'
  77. import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
  78. import personCard from './personCard.vue'
  79. const emit = defineEmits(['detail'])
  80. const props = defineProps({
  81. detailButTxt: String,
  82. paramsVerify: Boolean,
  83. searchName: String
  84. })
  85. const message = useMessage() // 消息弹窗
  86. const { t } = useI18n() // 国际化
  87. const loading = ref(false) // 列表的加载中
  88. const list = ref([]) // 列表的数据
  89. const total = ref(0) // 列表的总页数
  90. const queryParams = reactive({
  91. pageNo: 1,
  92. pageSize: 5,
  93. name: '',
  94. phone: undefined
  95. })
  96. const queryFormRef = ref() // 搜索的表单
  97. /** 查询列表 */
  98. const getList = async () => {
  99. loading.value = true
  100. try {
  101. const data = await PersonInfoApi.getPersonInfoPage(queryParams)
  102. list.value = data?.list.map(e => {
  103. return {
  104. ...e.person,
  105. // Boolean(exp.year) || Boolean(exp.enterpriseName) || Boolean(exp.positionName)
  106. workExpList: e.work ? [e.work] : []
  107. }
  108. }) || []
  109. total.value = data?.total || 0
  110. } finally {
  111. loading.value = false
  112. }
  113. }
  114. const tipContent = '输入人才姓名、电话查询后可使用门墩儿人才库数据填充表单!'
  115. /** 搜索按钮操作 */
  116. const handleQuery = () => {
  117. queryParams.pageNo = 1
  118. if (props.paramsVerify && !queryParams.name && !queryParams.phone) {
  119. message.warning('请输入后查询 !')
  120. return
  121. }
  122. getList()
  123. }
  124. /** 重置按钮操作 */
  125. const resetQuery = () => {
  126. queryFormRef.value.resetFields()
  127. handleQuery()
  128. }
  129. const detail = (row) => {
  130. emit('detail', { id: row.id, userId: row.userId })
  131. }
  132. /** 初始化 **/
  133. // onMounted(async () => {
  134. // if (props.paramsVerify) return
  135. // setTimeout(() => {
  136. // if (props.searchName) {
  137. // queryParams.name = props.searchName
  138. // }
  139. // }, 1000)
  140. // getList()
  141. // })
  142. if (!props.paramsVerify) getList()
  143. </script>
  144. <style lang="scss" scoped>
  145. .tip {
  146. text-align: center;
  147. margin-bottom: 10px;
  148. color: #e6a23c;
  149. }
  150. .listBox {
  151. min-height: 200px;
  152. max-height: calc(100vh - 400px);
  153. overflow-y: auto;
  154. padding: 10px;
  155. .item {
  156. margin-bottom: 10px;
  157. }
  158. }
  159. </style>