4 Commits

Author SHA1 Message Date
cb83a3269e Merge branch 'main' of http://124.243.245.42:3000/sdz/ks-app-employment-service 2026-03-16 10:53:27 +08:00
f2f802b73a 招聘会样式修改 2026-03-16 10:52:52 +08:00
冯辉
4078f2e543 增加地区选项添加 2026-03-13 11:45:01 +08:00
冯辉
94439fddaa 11 2026-03-12 23:23:18 +08:00
3 changed files with 96 additions and 48 deletions

View File

@@ -78,6 +78,24 @@
</radio-group>
</view>
<!-- 地区 -->
<view v-if="activeTab === 'area'" class="content-section">
<radio-group @change="(e) => handleSelect('area', e)">
<label
v-for="option in areaOptions"
:key="option.value"
class="radio-item"
:class="{ checked: selectedValues['area'] === String(option.value) }"
>
<radio
:value="String(option.value)"
:checked="selectedValues['area'] === String(option.value)"
/>
<text class="option-label">{{ option.label }}</text>
</label>
</radio-group>
</view>
<!-- 岗位类型 -->
<view v-if="activeTab === 'jobType'" class="content-section">
<radio-group @change="(e) => handleSelect('jobType', e)">
@@ -108,7 +126,8 @@
<script setup>
import { ref, reactive, onBeforeMount } from 'vue';
import useDictStore from '@/stores/useDictStore';
const { getTransformChildren } = useDictStore();
const dictStore = useDictStore();
const { getTransformChildren } = dictStore;
const props = defineProps({
show: Boolean,
@@ -131,7 +150,8 @@ const tabs = [
{ key: 'education', label: '学历要求' },
{ key: 'experience', label: '工作经验' },
{ key: 'scale', label: '公司规模' },
{ key: 'jobType', label: '岗位类型' }
{ key: 'jobType', label: '岗位类型' },
{ key: 'area', label: '地区' }
];
// 当前激活的标签
@@ -142,6 +162,7 @@ const selectedValues = reactive({
education: '',
experience: '',
scale: '',
area: '',
jobType: ''
});
@@ -149,14 +170,28 @@ const selectedValues = reactive({
const educationOptions = ref([]);
const experienceOptions = ref([]);
const scaleOptions = ref([]);
const areaOptions = ref([]);
const jobTypeOptions = ref([]);
// 加载状态
const loading = ref(true);
// 初始化获取数据
onBeforeMount(() => {
educationOptions.value = getTransformChildren('education', '学历要求').options || [];
experienceOptions.value = getTransformChildren('experience', '工作经验').options || [];
scaleOptions.value = getTransformChildren('scale', '公司规模').options || [];
jobTypeOptions.value = getJobTypeData();
onBeforeMount(async () => {
try {
// 先获取字典数据
await dictStore.getDictData();
// 再初始化选项数据
educationOptions.value = getTransformChildren('education', '学历要求').options || [];
experienceOptions.value = getTransformChildren('experience', '工作经验').options || [];
scaleOptions.value = getTransformChildren('scale', '公司规模').options || [];
areaOptions.value = getTransformChildren('area', '地区').options || [];
jobTypeOptions.value = getJobTypeData();
} catch (error) {
console.error('获取字典数据失败:', error);
} finally {
loading.value = false;
}
});
// 处理选项选择

View File

@@ -87,12 +87,13 @@
<view class="cards" v-if="fairList.length">
<view class="card press-button" v-for="(item, index) in fairList" :key="index"
@click="goDetail(item.jobFairId)">
<view class="center-date"
:style="{ color: getTimeStatus(item.jobFairStartTime, item.jobFairEndTime).color,borderColor: getTimeStatus(item.jobFairStartTime, item.jobFairEndTime).color }">
{{ getTimeStatus(item.jobFairStartTime, item.jobFairEndTime).statusText }}
</view>
<view class="card-title">
{{ item.jobFairTitle }}
<view class="center-date"
:style="{ color: getTimeStatus(item.jobFairStartTime, item.jobFairEndTime).color,borderColor: getTimeStatus(item.jobFairStartTime, item.jobFairEndTime).color }">
{{ getTimeStatus(item.jobFairStartTime, item.jobFairEndTime).statusText }}
</view>
</view>
<view class="card-row">
<text class="">{{ item.jobFairAddress }}</text>
@@ -514,7 +515,6 @@
} else {
$api.msg('请先登录');
}
}
function getFair(type = "add") {
@@ -1012,10 +1012,21 @@
.cards .card {
margin-top: 28rpx;
padding: 32rpx;
padding: 45rpx 32rpx 32rpx 32rpx;
background: linear-gradient(to bottom, #e3efff 0%, #fbfdff 100%);
box-shadow: 0rpx 0rpx 8rpx 0rpx rgba(0, 0, 0, 0.04);
border-radius: 20rpx;
position: relative;
.center-date {
font-weight: 400;
font-size: 24rpx;
position: absolute;
right: 0;
top: 0;
border: 1rpx solid;
padding: 5rpx 10rpx;
margin-left: 10rpx;
}
}
.cards .card-title {
@@ -1041,16 +1052,7 @@
transform: translate(-50%, -50%);
}
.center-date {
font-weight: 400;
font-size: 24rpx;
// position: absolute;
// right: 0;
// top: 0;
border: 1rpx solid;
padding: 5rpx 10rpx;
margin-left: 10rpx;
}
}
.cards .card-row {

View File

@@ -50,7 +50,7 @@ const useDictStore = defineStore("dict", () => {
return data
})
}
const [education, experience, area, scale, sex, affiliation, nature, noticeType] =
const [education, experience, area, scale, sex, affiliation, nature, noticeType] =
await Promise.all([
getDictSelectOption('education'),
getDictSelectOption('experience'),
@@ -74,6 +74,17 @@ const useDictStore = defineStore("dict", () => {
getIndustryDict() // 获取行业
} catch (error) {
console.error('Error fetching dictionary data:', error);
// 确保即使出错也能返回空数组
if (!dictType && !dictName) {
state.education = [];
state.experience = [];
state.area = [];
state.scale = [];
state.sex = [];
state.affiliation = [];
state.nature = [];
state.noticeType = [];
}
}
};
@@ -97,31 +108,31 @@ const useDictStore = defineStore("dict", () => {
return null
}
function dictLabel(dictType, value) {
if (state[dictType] && Array.isArray(state[dictType])) {
for (let i = 0; i < state[dictType].length; i++) {
let element = state[dictType][i];
if (element.value === value) {
return element.label
}
}
}
return ''
function dictLabel(dictType, value) {
if (state[dictType] && Array.isArray(state[dictType])) {
for (let i = 0; i < state[dictType].length; i++) {
let element = state[dictType][i];
if (element.value === value) {
return element.label
}
}
}
return ''
}
function oneDictData(dictType, value) {
if (!value) {
return state[dictType]
}
if (state[dictType]) {
for (let i = 0; i < state[dictType].length; i++) {
let element = state[dictType][i];
if (element.value === value) {
return element
}
}
}
return null
function oneDictData(dictType, value) {
if (!value) {
return state[dictType]
}
if (state[dictType]) {
for (let i = 0; i < state[dictType].length; i++) {
let element = state[dictType][i];
if (element.value === value) {
return element
}
}
}
return null
}
function getTransformChildren(dictType, title = '', key = '') {
@@ -129,7 +140,7 @@ const useDictStore = defineStore("dict", () => {
return {
label: title,
key: key || dictType,
options: state[dictType],
options: state[dictType] || [],
}
}
return null