|
|
|
|
|
export const trainingTaskKeyByPath = {
|
|
|
|
|
|
"/foundation/new-product-survey": "new-product-survey",
|
|
|
|
|
|
"/foundation/product-development-factors": "product-development-factors",
|
|
|
|
|
|
"/foundation/product-development-process": "product-development-process",
|
|
|
|
|
|
"/demand/index": "industry-demand-analysis",
|
|
|
|
|
|
"/demand/environment": "competitive-environment-analysis",
|
|
|
|
|
|
"/demand/people": "target-user-profile",
|
|
|
|
|
|
"/demand/user": "target-user-profile",
|
|
|
|
|
|
"/demand/business-feasibility": "business-feasibility",
|
|
|
|
|
|
"/demand/consumer-behavior": "consumer-behavior",
|
|
|
|
|
|
"/demand/consumer-scenario": "consumer-scenario",
|
|
|
|
|
|
"/demand/feature-conversion": "feature-conversion",
|
|
|
|
|
|
"/product/index": "market-opportunity-selection",
|
|
|
|
|
|
"/product/differentiation": "product-value-positioning",
|
|
|
|
|
|
"/product/structure": "product-structure",
|
|
|
|
|
|
"/product/price": "product-pricing",
|
|
|
|
|
|
"/product/after-sales-service": "after-sales-service",
|
|
|
|
|
|
"/product/requirements-doc": "requirements-doc",
|
|
|
|
|
|
"/product/hardware-cost": "hardware-cost",
|
|
|
|
|
|
"/test/index": "release-channel-evaluation",
|
|
|
|
|
|
"/test/channelas": "release-channel-evaluation",
|
|
|
|
|
|
"/test/promotion": "promotion-effect-optimization",
|
|
|
|
|
|
"/test/marketing": "promotion-effect-optimization",
|
|
|
|
|
|
"/channel/index": "purchase-demand-forecast",
|
|
|
|
|
|
"/channel/purchase": "purchase-demand-forecast",
|
|
|
|
|
|
"/channel/supplier": "supplier-evaluation",
|
|
|
|
|
|
"/assessment/index": "product-diagnosis-iteration",
|
|
|
|
|
|
"/assessment/diagnosis": "product-diagnosis-iteration",
|
|
|
|
|
|
"/assessment/five": "product-diagnosis-iteration",
|
|
|
|
|
|
"/assessment/kano": "product-diagnosis-iteration",
|
|
|
|
|
|
"/assessment/market": "product-diagnosis-iteration",
|
|
|
|
|
|
"/assessment/traffic": "product-diagnosis-iteration",
|
|
|
|
|
|
"/assessment/optimization": "category-optimization",
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export function resolveTrainingTaskKey(route, explicitTaskKey = "") {
|
|
|
|
|
|
return explicitTaskKey || route?.meta?.pageKey || trainingTaskKeyByPath[route?.path] || "";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export function parseTrainingArray(value, fallback = []) {
|
|
|
|
|
|
if (Array.isArray(value)) {
|
|
|
|
|
|
const result = value.map((item) => String(item || "").trim()).filter(Boolean);
|
|
|
|
|
|
return result.length ? result : fallback;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!value) {
|
|
|
|
|
|
return fallback;
|
|
|
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
|
|
|
const parsed = JSON.parse(value);
|
|
|
|
|
|
if (Array.isArray(parsed)) {
|
|
|
|
|
|
const result = parsed.map((item) => String(item || "").trim()).filter(Boolean);
|
|
|
|
|
|
return result.length ? result : fallback;
|
|
|
|
|
|
}
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
// Fall through to delimiter parsing.
|
|
|
|
|
|
}
|
|
|
|
|
|
const result = String(value)
|
|
|
|
|
|
.split(/[;;||\n]/)
|
|
|
|
|
|
.map((item) => item.trim())
|
|
|
|
|
|
.filter(Boolean);
|
|
|
|
|
|
return result.length ? result : fallback;
|
|
|
|
|
|
}
|