+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+
-
-
+
+
+
+
+
+
+
+
+ {{ hasFilters ? '未找到匹配的职位,请调整筛选条件' : '暂无职位数据' }}
+
+
+
+ 加载失败,请刷新重试
+
+
+
-
-
-
-
-
-
- 搜索
-
-
-
- 当前企业:
- {{ selectedOrg.name }}
-
-
-
-
-
-
-
-
-
-
- {{ hasFilters ? '未找到匹配的职位,请调整筛选条件' : '暂无职位数据' }}
-
-
-
- 加载失败,请刷新重试
-
-
-
-
-
{{ job.title }}
-
{{ job.salary }}
-
-
- {{ job.organization_name || job.organization?.name }}
- ·
- {{ job.location }}
- ·
- {{ job.education }}
-
-
+
+
+
-
-
-
-
+
@@ -210,6 +255,12 @@ const pageSize = 20
const filters = reactive({ search: '', location: '', category: '', education: '' })
+const eduLevels = [
+ { key: '博士', label: '博士' },
+ { key: '硕士', label: '硕士' },
+ { key: '本科及以下', label: '本科' },
+]
+
const totalOrgs = computed(() => {
return orgs.value.reduce((n, o) => n + 1 + (o.children?.length || 0), 0)
})
@@ -218,12 +269,33 @@ const hasFilters = computed(() => {
return filters.search || filters.location || filters.category || filters.education
})
+const eduGroups = computed(() => {
+ const groups = { '博士': [], '硕士': [], '本科及以下': [] }
+ jobs.value.forEach(job => {
+ if (groups[job.education] !== undefined) {
+ groups[job.education].push(job)
+ }
+ })
+ return groups
+})
+
+const eduTotals = computed(() => {
+ const totals = {}
+ for (const [key, list] of Object.entries(eduGroups.value)) {
+ totals[key] = list.reduce((sum, job) => sum + (job.headcount || 0), 0)
+ }
+ return totals
+})
+
async function fetchJobs(page = 1) {
jobsLoading.value = true
jobsError.value = false
try {
const params = { page }
- if (selectedOrg.value) params.organization = selectedOrg.value.id
+ if (selectedOrg.value) {
+ params.organization = selectedOrg.value.id
+ params.page_size = 200 // 选中公司时拉取全部岗位用于分组
+ }
if (filters.search) params.search = filters.search
if (filters.location) params.location = filters.location
if (filters.category) params.category = filters.category
@@ -277,6 +349,9 @@ onMounted(async () => {
const child = org.children?.find(c => c.id === targetOrgId)
if (child) { selectedOrg.value = child; break }
}
+ } else if (orgs.value.length > 0) {
+ // 默认选中第一家公司
+ selectedOrg.value = orgs.value[0]
}
} catch { orgsError.value = true }
finally { orgsLoading.value = false }
@@ -286,13 +361,15 @@ onMounted(async () => {