|
@@ -8,19 +8,25 @@
|
|
|
v-for="k in positionCategory"
|
|
|
:key="k.id"
|
|
|
@click="handleClickCategory(k)"
|
|
|
- >{{ k.id === '-1' ? `${k.label}` : `${k.label} (${k.number})` }}</span>
|
|
|
+ >{{ k.id === -1 ? `${k.label}` : `${k.label} (${k.number})` }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="d-flex mt-3">
|
|
|
- <areaType v-if="areaList.length" :list="areaList"></areaType>
|
|
|
- <expType></expType>
|
|
|
+ <areaType v-if="areaList.length" :list="areaList" @inputChange="val => handleSearch('areaIds', val)"></areaType>
|
|
|
+ <expType :isSingle="true" @inputChange="val => handleSearch('expType', val)"></expType>
|
|
|
<educationType></educationType>
|
|
|
<payScope></payScope>
|
|
|
- <div style="width: 200px;">
|
|
|
- <v-text-field variant="outlined" placeholder="请输入职位名称" hide-details>
|
|
|
- <template #append-inner>
|
|
|
- <v-btn color="primary" size="x-small" @click="getPositionList">搜索</v-btn>
|
|
|
- </template>
|
|
|
+ <div style="width: 300px;">
|
|
|
+ <v-text-field
|
|
|
+ v-model="query.content"
|
|
|
+ variant="outlined"
|
|
|
+ label="查找职位中的关键字"
|
|
|
+ hide-details
|
|
|
+ color="primary"
|
|
|
+ append-inner-icon="mdi-magnify"
|
|
|
+ @click:append-inner="handleSearch(query.content, 'content')"
|
|
|
+ @keyup.enter="handleSearch(query.content, 'content')"
|
|
|
+ >
|
|
|
</v-text-field>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -58,8 +64,8 @@
|
|
|
</div>
|
|
|
<MPagination
|
|
|
:total="total"
|
|
|
- :page="pageInfo.current"
|
|
|
- :limit="pageInfo.size"
|
|
|
+ :page="pageInfo.pageNo"
|
|
|
+ :limit="pageInfo.pageSize"
|
|
|
@handleChange="handleChangePage"
|
|
|
></MPagination>
|
|
|
</div>
|
|
@@ -67,7 +73,8 @@
|
|
|
|
|
|
<script setup>
|
|
|
defineOptions({ name: 'recruitment-positions'})
|
|
|
-import { ref } from 'vue'
|
|
|
+import { reactive, ref, provide } from 'vue'
|
|
|
+import { useRoute, useRouter } from 'vue-router'
|
|
|
import { timesTampChange } from '@/utils/date'
|
|
|
import { getDict } from '@/hooks/web/useDictionaries'
|
|
|
import { dealDictData } from '@/views/recruit/position/components/dict'
|
|
@@ -87,10 +94,14 @@ const props = defineProps({
|
|
|
|
|
|
const total = ref(0)
|
|
|
const pageInfo = ref({
|
|
|
- size: 10,
|
|
|
- current: 1
|
|
|
+ pageSize: 10,
|
|
|
+ pageNo: 1
|
|
|
})
|
|
|
+const route = useRoute(); const router = useRouter()
|
|
|
+const routeQuery = (route?.query && route.query && Object.keys(route?.query).length) ? route.query : null
|
|
|
+provide('routeQuery', routeQuery)
|
|
|
|
|
|
+// 职位详情
|
|
|
const handlePosition = (val) => {
|
|
|
window.open(`/recruit/position/details/${val.job.positionId}`)
|
|
|
}
|
|
@@ -113,7 +124,7 @@ const getData = async () => {
|
|
|
const value = industryList.value.find(e => Number(e.id) === Number(val.key))
|
|
|
return { id: value.id, label: value.nameCn, number: val.value, active: false }
|
|
|
})
|
|
|
- positionCategory.value = [{ id: '-1', label: '全部', active: true }, ...list]
|
|
|
+ positionCategory.value = [{ id: -1, label: '全部', active: true }, ...list]
|
|
|
}
|
|
|
getData()
|
|
|
|
|
@@ -121,37 +132,50 @@ getData()
|
|
|
const handleClickCategory = (k) => {
|
|
|
positionCategory.value.map(e => e.active = false)
|
|
|
k.active = !k.active
|
|
|
+ handleSearch(k.id, 'positionId')
|
|
|
+}
|
|
|
+
|
|
|
+const dealRouteQuery = () => {
|
|
|
+ const arr = Object.keys(query).map((e, i) => {
|
|
|
+ return `${i ? '&' : ''}${e}=${query[e]}`
|
|
|
+ })
|
|
|
+ const str = arr.join()
|
|
|
+ if (str) router.push(`${route.path}?${str}`)
|
|
|
+}
|
|
|
+
|
|
|
+const handleSearch = (key, { values }) => {
|
|
|
+ console.log(values, key, 'handle-search')
|
|
|
+ if (values === -1 || !values || values[0] === -1) delete query[key]
|
|
|
+ else query[key] = values
|
|
|
+ dealRouteQuery()
|
|
|
+ query.pageNo = 1
|
|
|
+ // getPositionList()
|
|
|
}
|
|
|
|
|
|
// 职位列表
|
|
|
const list = ref([])
|
|
|
+const query = reactive({
|
|
|
+ // content: '',
|
|
|
+ // areaIds: [],
|
|
|
+ // expType: 0,
|
|
|
+ // eduType: 0,
|
|
|
+ // payType: 0,
|
|
|
+ // positionId: 0,
|
|
|
+})
|
|
|
+// 职位列表
|
|
|
const getPositionList = async () => {
|
|
|
- const pageReqVO = {
|
|
|
- ...pageInfo.value,
|
|
|
- // content: '',
|
|
|
- // areaIds: [],
|
|
|
- // expType: 0,
|
|
|
- // eduType: 0,
|
|
|
- // payType: 0,
|
|
|
- // jobType: 0,
|
|
|
- // positionId: 0,
|
|
|
- // enterpriseType: 0,
|
|
|
- // industryIds: [],
|
|
|
- // scale: 0,
|
|
|
- // financingStatus: 0,
|
|
|
- enterpriseId: props.info.enterprise.id
|
|
|
- }
|
|
|
- const { list: arr, total: number } = await getJobAdvertisedSearch({ ...pageReqVO })
|
|
|
+ const { list: arr, total: number } = await getJobAdvertisedSearch(Object.assign(query, pageInfo.value, { enterpriseId: props.info.enterprise.id }))
|
|
|
total.value = number
|
|
|
list.value = arr.map(e => {
|
|
|
+ e.active = false
|
|
|
e.job = { ...e.job, ...dealDictData({}, e.job) }
|
|
|
return e
|
|
|
})
|
|
|
}
|
|
|
-getPositionList()
|
|
|
+// getPositionList()
|
|
|
|
|
|
const handleChangePage = (index) => {
|
|
|
- pageInfo.value.current = index
|
|
|
+ pageInfo.value.pageNo = index
|
|
|
getPositionList()
|
|
|
}
|
|
|
|
|
@@ -210,10 +234,10 @@ const desc = [
|
|
|
flex: 1;
|
|
|
}
|
|
|
.category-item {
|
|
|
+ display: inline-block;
|
|
|
margin-right: 20px;
|
|
|
font-size: 15px;
|
|
|
- color: #888;
|
|
|
- font-weight: 600;
|
|
|
+ color: #666;
|
|
|
cursor: pointer;
|
|
|
&:hover {
|
|
|
color: var(--v-primary-base);
|