123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246 |
- <template>
- <!-- 搜索工作栏 -->
- <ContentWrap>
- <el-form
- class="-mb-15px"
- :model="queryParams"
- ref="queryFormRef"
- :inline="true"
- label-width="68px"
- >
- <el-form-item label="姓名" prop="name">
- <el-input v-model="queryParams.name" placeholder="请输入" clearable @keyup.enter="handleQuery" class="!w-160px" />
- </el-form-item>
- <el-form-item label="联系电话" prop="phone">
- <el-input v-model="queryParams.phone" placeholder="请输入" clearable @keyup.enter="handleQuery" class="!w-160px" />
- </el-form-item>
- <el-form-item label="酒店品牌" prop="brand">
- <el-input v-model="queryParams.brand" placeholder="请输入" clearable @keyup.enter="handleQuery" class="!w-160px" />
- </el-form-item>
- <el-form-item label="最高学历" prop="eduType">
- <el-select
- v-model="queryParams.eduType"
- placeholder="请选择"
- clearable
- class="!w-160px"
- >
- <el-option
- v-for="dict in getIntDictOptions(DICT_TYPE.MENDUNER_EDUCATION_TYPE)"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="工作经验" prop="expType">
- <el-select
- v-model="queryParams.expType"
- placeholder="请选择"
- clearable
- class="!w-160px"
- >
- <el-option
- v-for="dict in getIntDictOptions(DICT_TYPE.MENDUNER_EXP_TYPE)"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- />
- </el-select>
- </el-form-item>
- <el-form-item label="所在城市" prop="areaId">
- <el-cascader
- v-model="queryParams.areaId"
- :options="areaTreeData"
- :props="{ label: 'name', value: 'id', multiple: true, emitPath: false, checkStrictly: true }"
- collapse-tags
- collapse-tags-tooltip
- class="!w-160px"
- />
- </el-form-item>
- <el-form-item label="意向城市" prop="workAreaIds">
- <el-cascader
- v-model="queryParams.workAreaIds"
- :options="areaTreeData"
- :props="{ label: 'name', value: 'id', multiple: true, emitPath: false, checkStrictly: true }"
- collapse-tags
- collapse-tags-tooltip
- class="!w-160px"
- />
- </el-form-item>
- <el-form-item label="意向职位" prop="positionIds">
- <el-select
- v-model="queryParams.positionIds"
- placeholder="请选择"
- clearable
- multiple
- collapse-tags
- collapse-tags-tooltip
- class="!w-160px"
- >
- <el-option
- v-for="dict in positionTreeData"
- :key="dict?.id"
- :label="dict?.nameCn"
- :value="dict?.id"
- />
- </el-select>
- </el-form-item>
- <el-form-item>
- <el-button @click="handleQuery" type="primary"><Icon icon="ep:search" /> 搜索</el-button>
- <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
- </el-form-item>
- </el-form>
- </ContentWrap>
- <!-- 列表 -->
- <ContentWrap v-loading="loading">
- <div class="listBox">
- <div v-if="!loading && !list?.length" class="tip" style="line-height: 200px;">
- <div v-if="paramsBool">未查到任何数据,请更换查询条件后再试!</div>
- <div v-else>请输入查询条件!</div>
- </div>
- <personCard
- v-for="item of list"
- :key="item.id"
- :data="item"
- class="item"
- @detail="detail"
- />
- </div>
- </ContentWrap>
- <ContentWrap v-if="total">
- <Pagination
- :total="total"
- layout="total, prev, pager, next"
- v-model:page="queryParams.pageNo"
- v-model:limit="queryParams.pageSize"
- @pagination="getList"
- />
- </ContentWrap>
- </template>
- <script setup>
- defineOptions({ name: 'TalentMapSearch' })
- import { TalentMap } from '@/api/menduner/system/talentMap'
- import { PersonInfoApi } from '@/api/menduner/system/person'
- import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
- import personCard from './personCard.vue'
- import { getDict } from '@/hooks/web/useDictionaries'
- const emit = defineEmits(['detail'])
- const props = defineProps({
- paramsVerify: Boolean, // 查询条件必传
- searchName: String
- })
- const message = useMessage() // 消息弹窗
- const { t } = useI18n() // 国际化
- const loading = ref(false) // 列表的加载中
- const list = ref([]) // 列表的数据
- const total = ref(0) // 列表的总页数
- const queryParams = reactive({
- pageNo: 1,
- pageSize: 5,
- name: '',
- phone: undefined,
- brand: '',
- eduType: undefined,
- expType: undefined,
- areaId: [],
- workAreaIds: [],
- positionIds: [],
- })
- const queryFormRef = ref() // 搜索的表单
- // 地区列表
- const areaTreeData = ref([])
- const getDictData = async () => {
- const { data } = await getDict('areaTreeData', {}, 'areaTreeData')
- const obj = data.find(e => e.name === '中国')
- const list = obj?.children ? obj.children.map(e =>{
- // 市辖区直接显示区
- const municipality = e.children && e.children.length && e.children[0].name === '市辖区'
- if (municipality && e.children[0].children?.length) e.children = e.children[0].children
- return e
- }) : []
- areaTreeData.value = list.length ? list : []
- }
- getDictData()
- const positionTreeData = ref([])
- const getPositionTreeData = async () => {
- const { data } = await getDict('positionTreeData', {}, 'positionTreeData')
- positionTreeData.value = data || []
- }
- getPositionTreeData()
- /** 查询列表 */
- const getList = async () => {
- loading.value = true
- try {
- const data = await PersonInfoApi.getPersonInfoPage(queryParams)
- list.value = data?.list.map(e => {
- return {
- ...e.person,
- workExpList: e.work ? [e.work] : []
- }
- }) || []
- total.value = data?.total || 0
- } finally {
- loading.value = false
- }
- }
- const paramsBool = ref(false) // 是否存在筛选条件
- /** 搜索按钮操作 */
- const handleQuery = () => {
- const obj = { pageNo: null, pageSize: null, ...queryParams }
- paramsBool.value = Object.values(obj).some(value => value !== undefined && value !== null && value !== '' && value.length)
- if (props.paramsVerify && !paramsBool.value) return message.warning('请输入查询条件后再查询 !')
- queryParams.pageNo = 1
- getList()
- }
- /** 重置按钮操作 */
- const resetQuery = () => {
- queryFormRef.value.resetFields()
- handleQuery()
- }
- const detail = (row) => {
- emit('detail', { id: row.id, userId: row.userId })
- }
- /** 初始化 **/
- // onMounted(async () => {
- // if (props.paramsVerify) return
- // setTimeout(() => {
- // if (props.searchName) {
- // queryParams.name = props.searchName
- // }
- // }, 1000)
- // getList()
- // })
- if (!props.paramsVerify) getList()
- </script>
- <style lang="scss" scoped>
- .tip {
- text-align: center;
- margin-bottom: 10px;
- color: #e6a23c;
- }
- .listBox {
- min-height: 200px;
- max-height: calc(100vh - 400px);
- overflow-y: auto;
- padding: 10px;
- .item {
- margin-bottom: 10px;
- }
- }
- </style>
|