Merge branch 'main'
This commit is contained in:
@@ -26,6 +26,24 @@
|
|||||||
<view class="filter-right">
|
<view class="filter-right">
|
||||||
<!-- 内容区域 -->
|
<!-- 内容区域 -->
|
||||||
<view class="filter-content">
|
<view class="filter-content">
|
||||||
|
<!-- 薪资 -->
|
||||||
|
<view v-if="activeTab === 'salary'" class="content-section">
|
||||||
|
<radio-group @change="(e) => handleSelect('salary', e)">
|
||||||
|
<label
|
||||||
|
v-for="option in salaryOptions"
|
||||||
|
:key="option.value"
|
||||||
|
class="radio-item"
|
||||||
|
:class="{ checked: selectedValues['salary'] === String(option.value) }"
|
||||||
|
>
|
||||||
|
<radio
|
||||||
|
:value="String(option.value)"
|
||||||
|
:checked="selectedValues['salary'] === String(option.value)"
|
||||||
|
/>
|
||||||
|
<text class="option-label">{{ option.label }}</text>
|
||||||
|
</label>
|
||||||
|
</radio-group>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 学历要求 -->
|
<!-- 学历要求 -->
|
||||||
<view v-if="activeTab === 'education'" class="content-section">
|
<view v-if="activeTab === 'education'" class="content-section">
|
||||||
<radio-group @change="(e) => handleSelect('education', e)">
|
<radio-group @change="(e) => handleSelect('education', e)">
|
||||||
@@ -62,24 +80,6 @@
|
|||||||
</radio-group>
|
</radio-group>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 薪资 -->
|
|
||||||
<view v-if="activeTab === 'salary'" class="content-section">
|
|
||||||
<radio-group @change="(e) => handleSelect('salary', e)">
|
|
||||||
<label
|
|
||||||
v-for="option in salaryOptions"
|
|
||||||
:key="option.value"
|
|
||||||
class="radio-item"
|
|
||||||
:class="{ checked: selectedValues['salary'] === String(option.value) }"
|
|
||||||
>
|
|
||||||
<radio
|
|
||||||
:value="String(option.value)"
|
|
||||||
:checked="selectedValues['salary'] === String(option.value)"
|
|
||||||
/>
|
|
||||||
<text class="option-label">{{ option.label }}</text>
|
|
||||||
</label>
|
|
||||||
</radio-group>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 公司规模 -->
|
<!-- 公司规模 -->
|
||||||
<view v-if="activeTab === 'scale'" class="content-section">
|
<view v-if="activeTab === 'scale'" class="content-section">
|
||||||
<radio-group @change="(e) => handleSelect('scale', e)">
|
<radio-group @change="(e) => handleSelect('scale', e)">
|
||||||
@@ -169,16 +169,16 @@ const getJobTypeData = () => {
|
|||||||
|
|
||||||
// 标签页数据
|
// 标签页数据
|
||||||
const tabs = [
|
const tabs = [
|
||||||
|
{ key: 'salary', label: '薪资' },
|
||||||
{ key: 'education', label: '学历要求' },
|
{ key: 'education', label: '学历要求' },
|
||||||
{ key: 'experience', label: '工作经验' },
|
{ key: 'experience', label: '工作经验' },
|
||||||
{ key: 'salary', label: '薪资' },
|
|
||||||
{ key: 'scale', label: '公司规模' },
|
{ key: 'scale', label: '公司规模' },
|
||||||
{ key: 'jobType', label: '岗位类型' },
|
{ key: 'jobType', label: '岗位类型' },
|
||||||
{ key: 'area', label: '地区' }
|
{ key: 'area', label: '地区' }
|
||||||
];
|
];
|
||||||
|
|
||||||
// 当前激活的标签
|
// 当前激活的标签
|
||||||
const activeTab = ref('education');
|
const activeTab = ref('salary');
|
||||||
|
|
||||||
// 存储已选中的值
|
// 存储已选中的值
|
||||||
const selectedValues = reactive({
|
const selectedValues = reactive({
|
||||||
|
|||||||
@@ -847,6 +847,28 @@ onUnmounted(() => {
|
|||||||
uni.$off('citySelected');
|
uni.$off('citySelected');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const isFourLevelLinkagePurview = ref(false);
|
||||||
|
const getIsFourLevelLinkagePurview = () => {
|
||||||
|
let userInfo = uni.getStorageSync('userInfo');
|
||||||
|
if (userInfo) {
|
||||||
|
$api.myRequest(
|
||||||
|
'/auth/login2/ks',
|
||||||
|
{ userid: userInfo.dwUserid, idcardno: userInfo.idCard },
|
||||||
|
'POST',
|
||||||
|
9100,
|
||||||
|
{}
|
||||||
|
).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
uni.setStorageSync('fourLevelLinkage-token', res.data.access_token);
|
||||||
|
let roleIdList = ['103', '106', '107'];
|
||||||
|
if (res.data.roleIdList.some((item) => roleIdList.includes(item))) {
|
||||||
|
isFourLevelLinkagePurview.value = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
onShow(() => {
|
onShow(() => {
|
||||||
// 页面显示时获取最新的企业信息
|
// 页面显示时获取最新的企业信息
|
||||||
getCompanyInfo();
|
getCompanyInfo();
|
||||||
@@ -1458,27 +1480,6 @@ const toggleJobStatus = (job) => {
|
|||||||
$api.msg(isCurrentlyUp ? '下架失败,请重试' : '上架失败,请重试');
|
$api.msg(isCurrentlyUp ? '下架失败,请重试' : '上架失败,请重试');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const isFourLevelLinkagePurview = ref(false);
|
|
||||||
const getIsFourLevelLinkagePurview = () => {
|
|
||||||
let userInfo = uni.getStorageSync('userInfo');
|
|
||||||
if (userInfo) {
|
|
||||||
$api.myRequest(
|
|
||||||
'/auth/login2/ks',
|
|
||||||
{ userid: userInfo.dwUserid, idcardno: userInfo.idCard },
|
|
||||||
'POST',
|
|
||||||
9100,
|
|
||||||
{}
|
|
||||||
).then((res) => {
|
|
||||||
if (res.code == 200) {
|
|
||||||
uni.setStorageSync('fourLevelLinkage-token', res.data.access_token);
|
|
||||||
let roleIdList = ['103', '106', '107'];
|
|
||||||
if (res.data.roleIdList.some((item) => roleIdList.includes(item))) {
|
|
||||||
isFourLevelLinkagePurview.value = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
function dataToImg(data) {
|
function dataToImg(data) {
|
||||||
const result = data.map((item) => ({
|
const result = data.map((item) => ({
|
||||||
...item,
|
...item,
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ import {
|
|||||||
|
|
||||||
// 静态树 O(1) 超快查询!!!!!
|
// 静态树 O(1) 超快查询!!!!!
|
||||||
let IndustryMap = null
|
let IndustryMap = null
|
||||||
|
// 复用同一批字典请求,避免 App 启动和页面组件同时初始化时产生竞态。
|
||||||
|
let dictDataPromise = null
|
||||||
// 构建索引
|
// 构建索引
|
||||||
function buildIndex(tree) {
|
function buildIndex(tree) {
|
||||||
const map = new Map();
|
const map = new Map();
|
||||||
@@ -50,46 +52,54 @@ const useDictStore = defineStore("dict", () => {
|
|||||||
return data
|
return data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (complete.value) return
|
if (complete.value) return Promise.resolve()
|
||||||
if (dictLoading.value) return
|
// App.vue 会在启动时加载字典,页面组件也可能同时加载。
|
||||||
dictLoading.value = true
|
// 不能在请求进行中直接 return,否则调用方会把当时的空 state 复制下来。
|
||||||
try {
|
if (dictDataPromise) return dictDataPromise
|
||||||
const [education, experience, area, scale, sex, affiliation, nature, noticeType] =
|
|
||||||
await Promise.all([
|
|
||||||
getDictSelectOption('education'),
|
|
||||||
getDictSelectOption('experience'),
|
|
||||||
getDictSelectOption('area', true),
|
|
||||||
getDictSelectOption('scale'),
|
|
||||||
getDictSelectOption('app_sex'),
|
|
||||||
getDictSelectOption('political_affiliation'),
|
|
||||||
getDictSelectOption('company_nature'),
|
|
||||||
getDictSelectOption('sys_notice_type'),
|
|
||||||
]);
|
|
||||||
|
|
||||||
state.education = education;
|
dictLoading.value = true
|
||||||
state.experience = experience;
|
dictDataPromise = (async () => {
|
||||||
state.area = area;
|
try {
|
||||||
state.scale = scale;
|
const [education, experience, area, scale, sex, affiliation, nature, noticeType] =
|
||||||
state.sex = sex;
|
await Promise.all([
|
||||||
state.affiliation = affiliation;
|
getDictSelectOption('education'),
|
||||||
state.nature = nature
|
getDictSelectOption('experience'),
|
||||||
state.noticeType = noticeType
|
getDictSelectOption('area', true),
|
||||||
complete.value = true
|
getDictSelectOption('scale'),
|
||||||
getIndustryDict() // 获取行业
|
getDictSelectOption('app_sex'),
|
||||||
} catch (error) {
|
getDictSelectOption('political_affiliation'),
|
||||||
console.error('Error fetching dictionary data:', error);
|
getDictSelectOption('company_nature'),
|
||||||
// 确保即使出错也能返回空数组
|
getDictSelectOption('sys_notice_type'),
|
||||||
state.education = [];
|
]);
|
||||||
state.experience = [];
|
|
||||||
state.area = [];
|
state.education = education;
|
||||||
state.scale = [];
|
state.experience = experience;
|
||||||
state.sex = [];
|
state.area = area;
|
||||||
state.affiliation = [];
|
state.scale = scale;
|
||||||
state.nature = [];
|
state.sex = sex;
|
||||||
state.noticeType = [];
|
state.affiliation = affiliation;
|
||||||
} finally {
|
state.nature = nature
|
||||||
dictLoading.value = false
|
state.noticeType = noticeType
|
||||||
}
|
complete.value = true
|
||||||
|
getIndustryDict() // 获取行业
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error fetching dictionary data:', error);
|
||||||
|
// 确保即使出错也能返回空数组
|
||||||
|
state.education = [];
|
||||||
|
state.experience = [];
|
||||||
|
state.area = [];
|
||||||
|
state.scale = [];
|
||||||
|
state.sex = [];
|
||||||
|
state.affiliation = [];
|
||||||
|
state.nature = [];
|
||||||
|
state.noticeType = [];
|
||||||
|
} finally {
|
||||||
|
dictLoading.value = false
|
||||||
|
dictDataPromise = null
|
||||||
|
}
|
||||||
|
})()
|
||||||
|
|
||||||
|
return dictDataPromise
|
||||||
};
|
};
|
||||||
|
|
||||||
async function getIndustryDict() {
|
async function getIndustryDict() {
|
||||||
|
|||||||
Reference in New Issue
Block a user