feat: add new product survey step four

dev-QQq
chenyuan 3 weeks ago
parent c6765189d4
commit 4c727afe91

@ -170,3 +170,34 @@ export function checkNewProductSurveyStepThree(payload) {
headers: { repeatSubmit: false },
});
}
function validateNewProductSurveyStepFourDemo(form) {
const value = form || {};
const fields = [
["coreValue", "核心层"],
["tangibleValue", "有形层"],
["extendedValue", "延伸层"],
];
for (const [field, label] of fields) {
if (!String(value[field] || "").trim()) {
throw new Error(`请填写${label}AI应用价值分析`);
}
}
return { valid: true, message: "校验通过" };
}
export function checkNewProductSurveyStepFour(form) {
if (isStudentDemo()) {
try {
return Promise.resolve({ code: 200, data: validateNewProductSurveyStepFourDemo(form) });
} catch (error) {
return Promise.reject(error);
}
}
return request({
url: "/api/student-training-answers/new-product-survey/step-4/validate",
method: "post",
data: form,
headers: { repeatSubmit: false },
});
}

@ -197,19 +197,19 @@
</div>
<span class="step-chip">价值判断</span>
</div>
<p class="step-desc">根据上面分析围绕核心层有形层延伸层回答以下问题并形成产品开发启发</p>
<p class="step-desc">结合上面实训针对AI技术在产品中的应用价值进行分析回答以下问题</p>
<label class="field-block">
<span>核心层价值AI 技术解决了用户什么真实问题</span>
<textarea v-model="step4Form.coreValue" class="input-field" rows="5" />
<span><b>1核心层</b>AI技术是否实现产品功能突破是否形成差异化卖点</span>
<textarea v-model="step4Form.coreValue" class="input-field step4-input" rows="7" placeholder="请填写核心层AI应用价值分析" />
</label>
<label class="field-block">
<span>有形层价值哪些功能设计或参数最能体现差异化</span>
<textarea v-model="step4Form.tangibleValue" class="input-field" rows="5" />
<span><b>2有形层</b>AI技术是否影响产品形态如产品外形包装电商主图设计参数配置价格带定位</span>
<textarea v-model="step4Form.tangibleValue" class="input-field step4-input" rows="7" placeholder="请填写有形层AI应用价值分析" />
</label>
<label class="field-block">
<span>延伸层价值哪些服务内容生态或售后能增强竞争优势</span>
<textarea v-model="step4Form.extendedValue" class="input-field" rows="5" />
<span><b>3延伸层</b>AI技术如何通过服务升级内容更新提升用户粘性推动付费服务</span>
<textarea v-model="step4Form.extendedValue" class="input-field step4-input" rows="7" placeholder="请填写延伸层AI应用价值分析" />
</label>
</div>
</section>
@ -230,9 +230,9 @@
</div>
<div class="task-actions">
<button type="button" class="btn-nav btn-submit" :disabled="saving" @click="submitTask">
<button type="button" class="btn-nav btn-submit" :disabled="saving || checking" @click="submitTask">
<el-icon><CircleCheck /></el-icon>
提交任务
{{ checking ? "正在提交" : "提交任务" }}
</button>
<button type="button" class="btn-nav" :disabled="saving" @click="resetExample">
<el-icon><RefreshLeft /></el-icon>
@ -270,7 +270,7 @@ import {
TrendCharts,
} from "@element-plus/icons-vue";
import { getTrainingTaskByKey } from "@/api/trainingTask";
import { checkNewProductSurveyStepOne, checkNewProductSurveyStepThree, checkNewProductSurveyStepTwo, getStudentTrainingAnswer, saveStudentTrainingAnswer, uploadStudentTrainingFile } from "@/api/studentTrainingAnswer";
import { checkNewProductSurveyStepFour, checkNewProductSurveyStepOne, checkNewProductSurveyStepThree, checkNewProductSurveyStepTwo, getStudentTrainingAnswer, saveStudentTrainingAnswer, uploadStudentTrainingFile } from "@/api/studentTrainingAnswer";
import useUserStore from "@/store/modules/user";
import { extractTrainingStepNames } from "@/views/training/taskKeyMap";
import TrainingAiSidebar from "@/views/components/TrainingAiSidebar.vue";
@ -709,8 +709,16 @@ function saveCurrentProgress() {
return saveAnswer("IN_PROGRESS");
}
function submitTask() {
return saveAnswer("SUBMITTED");
async function submitTask() {
checking.value = true;
try {
await checkNewProductSurveyStepFour(step4Form.value);
await saveAnswer("SUBMITTED");
} catch (error) {
proxy?.$modal?.msgWarning(error?.message || "请完成三层次AI应用价值分析");
} finally {
checking.value = false;
}
}
async function nextStep() {
@ -1271,6 +1279,10 @@ function exportOutcome() {
line-height: 1.65;
}
.step4-input {
min-height: 168px;
}
.input-single {
min-height: 42px;
padding: 0 14px;

@ -29,6 +29,11 @@ assert.match(page, /step2Form\.productName \|\| '所选产品'/, "step three mus
assert.match(page, /countStepThreePoints\(row\.analysis\)/, "step three must show the number of entered analysis points");
assert.match(page, /checkNewProductSurveyStepThree\(buildStepThreeValidationPayload\(\)\)/, "step three must validate its rows before advancing");
assert.match(api, /new-product-survey\/step-3\/validate/, "the student API must call the step-three validation endpoint");
assert.match(page, /AI技术是否实现产品功能突破是否形成差异化卖点/, "step four must show the core-layer prototype question");
assert.match(page, /AI技术是否影响产品形态如产品外形包装、电商主图设计、参数配置、价格带定位。/, "step four must show the tangible-layer prototype question");
assert.match(page, /AI技术如何通过服务升级、内容更新提升用户粘性推动付费服务/, "step four must show the extended-layer prototype question");
assert.match(page, /checkNewProductSurveyStepFour\(step4Form\.value\)/, "step four must validate before submission");
assert.match(api, /new-product-survey\/step-4\/validate/, "the student API must call the step-four validation endpoint");
assert.match(materialButton, /下载案例资料/, "the download button must use a fixed student-facing label");
assert.doesNotMatch(materialButton, /\{\{ material\?\.name \|\| "案例文档" \}\}/, "the upload file name must not become button text");

Loading…
Cancel
Save