diff --git a/src/api/studentTrainingAnswer.js b/src/api/studentTrainingAnswer.js index 3b40677..7cf4307 100644 --- a/src/api/studentTrainingAnswer.js +++ b/src/api/studentTrainingAnswer.js @@ -1753,3 +1753,9 @@ export function checkFeatureConversionStepThree(payload) { if (isStudentDemo()) { const valid = scoreRows.length >= 8 && scoreRows.length <= 12 && rows.length === scoreRows.length && rows.every((row, index) => row?.name === scoreRows[index]?.name && ["P0", "P1", "P2", "P3"].includes(row?.priority) && String(row?.reason || "").trim()); return Promise.resolve({ code: 200, data: { valid, message: valid ? "功能优先级填写完整。" : "请完整填写功能优先级与理由。" } }); } return request({ url: "/api/student-training-answers/feature-conversion/step-3/validate", method: "post", data: { scoreRows, rows }, headers: { repeatSubmit: false } }); } + +function checkIndustryDemandDemo(value, required) { if (required.some((key) => !String(value?.[key] || "").trim())) throw new Error("请完整填写 PEST 分析信息"); return { valid: true, message: "校验通过" }; } +export function checkIndustryDemandAnalysisStepOne(payload) { const value = payload || {}; if (isStudentDemo()) { try { return Promise.resolve({ code: 200, data: checkIndustryDemandDemo(value, ["political", "economic", "social", "technology"]) }); } catch (error) { return Promise.reject(error); } } return request({ url: "/api/student-training-answers/industry-demand-analysis/step-1/validate", method: "post", data: value, headers: { repeatSubmit: false } }); } +export function checkIndustryDemandAnalysisStepTwo(payload) { const value = payload || {}; if (isStudentDemo()) { try { return Promise.resolve({ code: 200, data: checkIndustryDemandDemo(value, ["political", "economic", "social", "technology"]) }); } catch (error) { return Promise.reject(error); } } return request({ url: "/api/student-training-answers/industry-demand-analysis/step-2/validate", method: "post", data: value, headers: { repeatSubmit: false } }); } +export function checkIndustryDemandAnalysisStepThree(payload) { const rows = Array.isArray(payload?.rows) ? payload.rows : []; if (isStudentDemo()) { const valid = rows.length === 4 && ["political", "economic", "social", "technology"].every((dimension) => rows.some((row) => row?.dimension === dimension && String(row?.opportunities || "").trim() && String(row?.challenges || "").trim() && String(row?.strategies || "").trim())); return Promise.resolve({ code: 200, data: { valid, message: valid ? "校验通过" : "请完成四个维度的机会、挑战和策略" } }); } return request({ url: "/api/student-training-answers/industry-demand-analysis/step-3/validate", method: "post", data: { rows }, headers: { repeatSubmit: false } }); } +export function checkIndustryDemandAnalysisStepFour(payload) { const value = payload || {}; if (isStudentDemo()) { const valid = ["高度友好", "较为友好", "中性", "存在风险", "风险较高"].includes(String(value.overallAssessment || "").trim()) && ["建议进入", "谨慎进入", "建议暂缓"].includes(String(value.marketDecision || "").trim()) && String(value.decisionReason || "").trim(); return Promise.resolve({ code: 200, data: { valid, message: valid ? "校验通过" : "请完整填写总体评估、市场进入结论和理由" } }); } return request({ url: "/api/student-training-answers/industry-demand-analysis/step-4/validate", method: "post", data: value, headers: { repeatSubmit: false } }); } diff --git a/src/router/index.js b/src/router/index.js index 9152e88..b8d5ce5 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -221,9 +221,9 @@ export const dynamicRoutes = [ alwaysShow: true, children: [ //行业需求分析 - { + { path: "index", - component: () => import("@/views/demand/index.vue"), + component: () => import("@/views/demand/industry-demand-analysis.vue"), name: "demand", meta: { title: "行业需求分析", icon: "需求挖掘", affix: true, pageKey: "industry-demand-analysis" }, }, diff --git a/src/views/demand/industry-demand-analysis.vue b/src/views/demand/industry-demand-analysis.vue new file mode 100644 index 0000000..934df1b --- /dev/null +++ b/src/views/demand/industry-demand-analysis.vue @@ -0,0 +1,186 @@ +