|
@@ -28,8 +28,9 @@
|
|
|
defineOptions({ name: 'personalPositionRecommend'})
|
|
|
import buttons from '@/views/recruit/personal/components/buttons.vue'
|
|
|
import { ref, reactive, nextTick } from 'vue'
|
|
|
-import { getJobAdvertisedSearch } from '@/api/position'
|
|
|
-import { dealDictObjData } from '@/utils/position'
|
|
|
+// import { getJobAdvertisedSearch } from '@/api/position'
|
|
|
+import { getPromotedPosition } from '@/api/position'
|
|
|
+import { dealDictArrayData } from '@/utils/position'
|
|
|
import PositionList from './components/item'
|
|
|
import recommendDetails from '@/views/recruit/personal/position/components/details.vue'
|
|
|
|
|
@@ -46,22 +47,42 @@ const query = reactive({
|
|
|
pageSize: 10
|
|
|
})
|
|
|
const items = ref([])
|
|
|
-const getData = async () => {
|
|
|
- const { list } = await getJobAdvertisedSearch(query)
|
|
|
- if (!list.length) return
|
|
|
- items.value = list.map((e, index) => {
|
|
|
- const id = e?.job?.id || ''
|
|
|
+
|
|
|
+const getList = async () => {
|
|
|
+ const { list } = await getPromotedPosition(query)
|
|
|
+ if (!list.length) return items.value = []
|
|
|
+ items.value = list.map(e=> {
|
|
|
+ const id = e?.id || ''
|
|
|
if (!id) return ''
|
|
|
jobId.value = id
|
|
|
- showRecommendDetails.value = true
|
|
|
- e.job = { ...e.job, ...dealDictObjData({}, e.job) }
|
|
|
- e.enterprise = { ...e.enterprise, ...dealDictObjData({}, e.enterprise) }
|
|
|
- e.active = index ? false : true
|
|
|
- return e
|
|
|
- }).filter(Boolean)
|
|
|
- console.log('personalPositionRecommend-data', items.value)
|
|
|
+ })
|
|
|
+ // 处理数据
|
|
|
+ items.value = dealDictArrayData([], list)
|
|
|
+ if (items.value?.length) showRecommendDetails.value = true
|
|
|
+ else {
|
|
|
+ // if (query.pageNum> 3) return
|
|
|
+ // query.pageNum++
|
|
|
+ // getList()
|
|
|
+ }
|
|
|
}
|
|
|
-getData()
|
|
|
+getList()
|
|
|
+
|
|
|
+// const getData = async () => {
|
|
|
+// const { list } = await getJobAdvertisedSearch(query)
|
|
|
+// if (!list.length) return
|
|
|
+// items.value = list.map((e, index) => {
|
|
|
+// const id = e?.job?.id || ''
|
|
|
+// if (!id) return ''
|
|
|
+// jobId.value = id
|
|
|
+// showRecommendDetails.value = true
|
|
|
+// e.job = { ...e.job, ...dealDictObjData({}, e.job) }
|
|
|
+// e.enterprise = { ...e.enterprise, ...dealDictObjData({}, e.enterprise) }
|
|
|
+// e.active = index ? false : true
|
|
|
+// return e
|
|
|
+// }).filter(Boolean)
|
|
|
+// console.log('personalPositionRecommend-data', items.value)
|
|
|
+// }
|
|
|
+// getData()
|
|
|
|
|
|
</script>
|
|
|
|