From 97914d8ff2c60009751a39b388c91220d67095e4 Mon Sep 17 00:00:00 2001 From: TianyangZhang Date: Fri, 27 Mar 2026 13:55:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=AD=A6=E5=8E=86?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=EF=BC=8C=E9=A6=96=E9=A1=B5=E9=9B=86=E6=88=90?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD=E5=B9=B6=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Job模型新增education字段(博士/硕士/本科及以下),支持筛选 - 首页整合搜索栏:关键词、城市、类别、学历下拉筛选 - 左侧企业列表新增"全部职位"选项,搜索与企业选择联动 - 职位详情页展示学历要求,管理后台发布职位支持选择学历 - 导航栏去掉独立"职位列表"入口,统一由首页承载 Co-Authored-By: Claude Opus 4.6 --- offer_backend/apps/jobs/filters.py | 3 +- .../jobs/migrations/0003_job_education.py | 18 + offer_backend/apps/jobs/models.py | 6 + offer_backend/apps/jobs/serializers.py | 4 +- offer_frontend/src/layouts/PortalLayout.vue | 16 +- .../src/views/admin/JobManageView.vue | 12 +- offer_frontend/src/views/portal/HomeView.vue | 317 ++++++++++++++---- .../src/views/portal/JobDetailView.vue | 4 + 8 files changed, 299 insertions(+), 81 deletions(-) create mode 100644 offer_backend/apps/jobs/migrations/0003_job_education.py diff --git a/offer_backend/apps/jobs/filters.py b/offer_backend/apps/jobs/filters.py index b14e44f..1a9a164 100644 --- a/offer_backend/apps/jobs/filters.py +++ b/offer_backend/apps/jobs/filters.py @@ -7,7 +7,8 @@ class JobFilter(django_filters.FilterSet): category = django_filters.CharFilter(lookup_expr='exact') location = django_filters.CharFilter(lookup_expr='icontains') organization = django_filters.NumberFilter(field_name='organization__id') + education = django_filters.BaseInFilter(field_name='education', lookup_expr='in') class Meta: model = Job - fields = ['title', 'category', 'location', 'organization'] + fields = ['title', 'category', 'location', 'organization', 'education'] diff --git a/offer_backend/apps/jobs/migrations/0003_job_education.py b/offer_backend/apps/jobs/migrations/0003_job_education.py new file mode 100644 index 0000000..2b9f666 --- /dev/null +++ b/offer_backend/apps/jobs/migrations/0003_job_education.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.20 on 2026-03-27 05:39 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('jobs', '0002_jobfavorite'), + ] + + operations = [ + migrations.AddField( + model_name='job', + name='education', + field=models.CharField(choices=[('博士', '博士'), ('硕士', '硕士'), ('本科及以下', '本科及以下')], default='本科及以下', max_length=20, verbose_name='学历要求'), + ), + ] diff --git a/offer_backend/apps/jobs/models.py b/offer_backend/apps/jobs/models.py index 835ab1a..93387ad 100644 --- a/offer_backend/apps/jobs/models.py +++ b/offer_backend/apps/jobs/models.py @@ -7,6 +7,11 @@ class Job(models.Model): ('published', '已发布'), ('closed', '已关闭'), ] + EDUCATION_CHOICES = [ + ('博士', '博士'), + ('硕士', '硕士'), + ('本科及以下', '本科及以下'), + ] organization = models.ForeignKey( 'organizations.Organization', on_delete=models.CASCADE, @@ -16,6 +21,7 @@ class Job(models.Model): category = models.CharField(max_length=50, verbose_name='职位类别') location = models.CharField(max_length=100, verbose_name='工作地点') salary = models.CharField(max_length=50, verbose_name='薪资范围') + education = models.CharField(max_length=20, choices=EDUCATION_CHOICES, default='本科及以下', verbose_name='学历要求') description = models.TextField(verbose_name='职位描述', blank=True) status = models.CharField(max_length=20, choices=STATUS_CHOICES, default='draft') created_at = models.DateTimeField(auto_now_add=True) diff --git a/offer_backend/apps/jobs/serializers.py b/offer_backend/apps/jobs/serializers.py index a91aedf..cba1775 100644 --- a/offer_backend/apps/jobs/serializers.py +++ b/offer_backend/apps/jobs/serializers.py @@ -9,7 +9,7 @@ class JobListSerializer(serializers.ModelSerializer): class Meta: model = Job - fields = ['id', 'title', 'category', 'location', 'salary', + fields = ['id', 'title', 'category', 'location', 'salary', 'education', 'organization', 'organization_name', 'status', 'created_at'] @@ -24,7 +24,7 @@ class JobDetailSerializer(serializers.ModelSerializer): class Meta: model = Job - fields = ['id', 'title', 'category', 'location', 'salary', + fields = ['id', 'title', 'category', 'location', 'salary', 'education', 'description', 'organization', 'organization_id', 'status', 'created_at'] diff --git a/offer_frontend/src/layouts/PortalLayout.vue b/offer_frontend/src/layouts/PortalLayout.vue index 0b6d038..3d5ea1c 100644 --- a/offer_frontend/src/layouts/PortalLayout.vue +++ b/offer_frontend/src/layouts/PortalLayout.vue @@ -36,7 +36,6 @@ @@ -71,8 +70,8 @@ - -