= 职业规划推荐

This commit is contained in:
2026-01-13 23:31:04 +08:00
parent 9d37f3a22a
commit 17366c05ee
3 changed files with 54 additions and 47 deletions

View File

@@ -16,15 +16,17 @@ export function getJobPathPage(params) {
// 根据职业路径ID获取详情
export function getJobPathDetail(params) {
const {startJobId, endJobId} = params;
const requestParams = {};
if (params?.jobPathId !== undefined && params?.jobPathId !== null && params?.jobPathId !== '') {
requestParams.id = params.jobPathId;
} else if (params?.id !== undefined && params?.id !== null && params?.id !== '') {
requestParams.id = params.id;
if (startJobId !== undefined && startJobId !== null && startJobId !== '') {
requestParams.startJobId = startJobId;
}
if (endJobId !== undefined && endJobId !== null && endJobId !== '') {
requestParams.endJobId = endJobId;
}
if (!requestParams.id) {
return Promise.reject('缺少必需的 id 参数');
if (!startJobId || !endJobId) {
return Promise.reject('缺少必需的 startJobId 和 endJobId 参数');
}
return request({

2
package-lock.json generated
View File

@@ -1,5 +1,5 @@
{
"name": "ks-app",
"name": "ks-app-employment-service",
"lockfileVersion": 3,
"requires": true,
"packages": {

View File

@@ -188,7 +188,9 @@ async function fetchTargetCareerOptions(keyword = '') {
value: item.id,
startJob: item.startJob,
endJob: item.endJob,
jobOrder: item.jobOrder
jobOrder: item.jobOrder,
startJobId: item.startJobId,
endJobId: item.endJobId
}));
if (targetCareerOptions.value.length === 0) {
@@ -215,8 +217,8 @@ async function fetchPathCount() {
}
}
async function loadPathDetail(jobPathId) {
if (!jobPathId || jobPathId === null || jobPathId === undefined || jobPathId === '') {
async function loadPathDetail(startJobId, endJobId) {
if (startJobId === null || startJobId === undefined || startJobId === '' || endJobId === null || endJobId === undefined || endJobId === '') {
uni.showToast({
title: '职业路径ID无效',
icon: 'none'
@@ -227,7 +229,8 @@ async function loadPathDetail(jobPathId) {
try {
const requestParams = {
jobPathId: jobPathId
startJobId,
endJobId
};
const response = await getJobPathDetail(requestParams);
@@ -264,6 +267,7 @@ async function loadPathDetail(jobPathId) {
targetCareer: targetCareerOptions.value[selectedTargetIndex.value]?.label || ''
});
} catch (error) {
console.warn(error, 22222);
uni.showToast({
title: '获取路径详情失败',
icon: 'none'
@@ -301,16 +305,16 @@ async function handleQuery() {
return;
}
let jobPathId = option.value;
isLoadingPath.value = true;
uni.showLoading({
title: '加载中...',
mask: true
});
console.log(option);
try {
if (!jobPathId) {
let { value: jobPathId, startJobId, endJobId } = option;
/*if (!jobPathId) {
const response = await getJobPathPage({
jobName: option.label,
pageNo: 1,
@@ -326,11 +330,12 @@ async function handleQuery() {
});
resetPathData();
return;
}
}*/
selectedJobPathId.value = jobPathId;
await loadPathDetail(jobPathId);
// selectedJobPathId.value = jobPathId;
await loadPathDetail(startJobId, endJobId);
} catch (error) {
console.warn(error, 11111);
uni.showToast({
title: '查询失败,请重试',
icon: 'none'