feat: 重构步骤导航为统一的组件化样式

将多个页面的旧版步骤导航(step-actions)替换为新的统一设计,新增步骤进度显示,优化按钮样式与布局,提升界面一致性与用户体验。
fix/exam-question-access-material-excel-delete-draft
qinzhenpen 2 months ago
parent 1de23486f3
commit c391961159

@ -33,13 +33,6 @@
</section>
<section class="purchase-workbench">
<div class="workbench-head">
<div>
<p class="section-eyebrow">Kraljic Matrix Analysis</p>
<h2>卡拉杰克模型分析</h2>
</div>
</div>
<p class="step-intro">
卡拉杰克模型是由彼得·卡拉杰克于1983年提出的一种采购管理工具,旨在帮助企业更好地管理供应链和采购策略。该模型从供应风险和利润影响两个维度出发,把物品分为四个象限:
</p>
@ -656,32 +649,6 @@ onMounted(() => {
gap: 20px;
}
.workbench-head {
display: flex;
align-items: flex-start;
gap: 16px;
margin: 0;
padding: 0;
border-bottom: 0;
}
.section-eyebrow {
margin: 0;
color: var(--student-accent);
font-size: 11px;
font-weight: 700;
letter-spacing: 0.12em;
text-transform: uppercase;
}
.workbench-head h2 {
margin: 4px 0 0;
color: var(--student-text);
font-size: var(--student-fs-h1);
font-weight: 700;
line-height: 1.35;
}
.step-intro {
margin: 0;
color: var(--student-text-secondary);

@ -245,11 +245,6 @@
</div>
</section>
<div class="step-actions"><button class="action-button primary" type="button" :disabled="saving"
@click="validateAndContinue">{{ saving ? '校验并保存中…' : '校验并进入第 2 步' }}</button><button
class="action-button" type="button" :disabled="saving" @click="resetForm"><el-icon>
<RefreshLeft />
</el-icon>清空填写</button></div>
</section>
<section v-else-if="currentStep === 2" class="step-card">
@ -284,11 +279,6 @@
</el-checkbox>
</el-checkbox-group>
</section>
<div class="step-actions"><button class="action-button primary" type="button" :disabled="saving"
@click="saveStepTwo">{{ saving ? '校验并保存中…' : '保存并进入第 3 步' }}<el-icon><ArrowRight /></el-icon></button><button
class="action-button" type="button" :disabled="saving" @click="resetStepTwo"><el-icon>
<RefreshLeft />
</el-icon>清空填写</button></div>
</section>
<section v-else-if="currentStep === 3" class="step-card report-step">
<div class="step-heading">
@ -340,9 +330,6 @@
</div>
</template>
</section>
<div class="step-actions"><button class="action-button primary" type="button"
:disabled="saving || uploading" @click="saveStepThree">{{ saving ? '校验并保存中…' : '保存并进入第 4 步'
}}<el-icon><ArrowRight /></el-icon></button></div>
<el-dialog v-model="reportPreviewVisible" class="report-preview-dialog"
:title="report.name || '可行性论证报告预览'" width="min(1100px, 94vw)" destroy-on-close append-to-body>
<div class="report-preview"><el-image v-if="reportKind === 'image'" :src="report.url"
@ -358,6 +345,26 @@
@click="currentStep = 3">返回第 3
步</button>
</section>
<div class="step-navigation">
<div class="step-nav-left">
<button v-if="currentStep > 1" type="button" class="btn-nav btn-ghost" @click="prevStep">
<el-icon><ArrowLeft /></el-icon>
上一步
</button>
<button type="button" class="btn-nav btn-save" :disabled="saving || uploading" @click="saveCurrentProgress">
<el-icon><CircleCheck /></el-icon>
保存当前进度
</button>
</div>
<div class="step-nav-right">
<span class="step-progress">Step {{ String(currentStep).padStart(2, "0") }} / {{ String(trainingSteps.length).padStart(2, "0") }}</span>
<button v-if="currentStep < trainingSteps.length" type="button" class="btn-nav btn-primary" :disabled="saving || uploading" @click="nextStep">
{{ saving ? "处理中…" : "下一步" }}
<el-icon><ArrowRight /></el-icon>
</button>
</div>
</div>
</section>
</main>
<TrainingAiSidebar study-tip="先从案例资料中提炼可验证的市场、用户与成本依据,再形成一致的商业论证。" reference-title="可行性论证提示"
@ -367,7 +374,7 @@
</template>
<script setup>
import { ArrowRight, Check, CircleCheck, Delete, Document, Download, RefreshLeft, UploadFilled, View } from "@element-plus/icons-vue"
import { ArrowLeft, ArrowRight, Check, CircleCheck, Delete, Document, Download, RefreshLeft, UploadFilled, View } from "@element-plus/icons-vue"
import { checkBusinessFeasibilityStepOne, checkBusinessFeasibilityStepTwo, checkBusinessFeasibilityStepThree, getStudentTrainingAnswer, saveStudentTrainingAnswer, uploadStudentTrainingFile } from "@/api/studentTrainingAnswer"
import { getTrainingTaskByKey } from "@/api/trainingTask"
import { parseTrainingArray } from "@/views/training/taskKeyMap"
@ -444,6 +451,9 @@ function downloadReport() { if (!report.value.url) return; const link = document
function clearReport() { report.value = createReport(); reportPreviewVisible.value = false; stepThreeCompleted.value = false }
async function saveStepThree() { if (saving.value) return; saving.value = true; try { await checkBusinessFeasibilityStepThree({ reportUrl: report.value.url, reportName: report.value.name }); await saveStudentTrainingAnswer(TASK_KEY, { step3Answer: JSON.stringify({ report: report.value }), currentStep: 4, submitted: false, saveAction: "SAVE" }); stepThreeCompleted.value = true; currentStep.value = 4; proxy?.$modal?.msgSuccess("报告已保存,已进入第 4 步") } catch (error) { proxy?.$modal?.msgError?.(error?.message || "请先上传可行性论证报告") } finally { saving.value = false } }
function switchStep(step) { if (step > 1 && !completed.value) { proxy?.$modal?.msgWarning("请先完成并保存第 1 步"); return } if (step > 2 && !stepTwoCompleted.value) { proxy?.$modal?.msgWarning("请先完成并保存第 2 步"); return } if (step > 3 && !stepThreeCompleted.value) { proxy?.$modal?.msgWarning("请先上传并保存第 3 步报告"); return } currentStep.value = step }
function prevStep() { if (currentStep.value > 1) currentStep.value -= 1 }
async function saveCurrentProgress() { if (saving.value) return; saving.value = true; try { const step = currentStep.value; const payload = { currentStep: step, submitted: false, saveAction: "SAVE" }; if (step === 1) payload.step1Answer = JSON.stringify({ form: form.value, calculations: { unitTotalCost: totalCost.value, unitGrossProfit: unitGrossProfit.value, grossMargin: grossMargin.value } }); else if (step === 2) payload.step2Answer = JSON.stringify({ stepTwo: stepTwo.value }); else if (step === 3) payload.step3Answer = JSON.stringify({ report: report.value }); await saveStudentTrainingAnswer(TASK_KEY, payload); proxy?.$modal?.msgSuccess("已保存当前进度") } catch (error) { proxy?.$modal?.msgError?.(error?.message || "保存失败,请稍后重试") } finally { saving.value = false } }
async function nextStep() { if (currentStep.value === 1) return validateAndContinue(); if (currentStep.value === 2) return saveStepTwo(); if (currentStep.value === 3) return saveStepThree() }
function exportOutcome() { const blob = new Blob([JSON.stringify({ task: taskTitle.value, step: 1, ...payload(), calculations: { unitTotalCost: totalCost.value, unitGrossProfit: unitGrossProfit.value, grossMargin: grossMargin.value } }, null, 2)], { type: "application/json;charset=utf-8" }); const link = document.createElement("a"); link.href = URL.createObjectURL(blob); link.download = "商业可行性论证-第1步.json"; link.click(); URL.revokeObjectURL(link.href) }
</script>
@ -926,11 +936,112 @@ td:last-child {
font-size: 13px;
}
.step-actions {
/* ===== 底部导航:工具栏式 ===== */
.step-navigation {
position: relative;
display: flex;
justify-content: center;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 10px;
margin-top: 24px;
margin-top: 16px;
padding: 12px 16px;
border: 1px solid var(--student-panel-border);
border-radius: 10px;
background: #ffffff;
}
.step-nav-left,
.step-nav-right {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: nowrap;
}
.step-nav-right {
margin-left: auto;
}
.btn-nav {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-height: 36px;
height: 36px;
padding: 0 14px;
border-radius: 8px;
font-family: inherit;
font-size: var(--student-fs-button);
font-weight: 600;
cursor: pointer;
transition: all 0.16s ease;
white-space: nowrap;
.el-icon {
font-size: 14px;
}
}
.btn-primary {
border: 1px solid var(--student-accent);
color: #ffffff;
background: var(--student-accent);
box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2), 0 2px 8px rgba(37, 99, 235, 0.15);
&:hover:not(:disabled) {
border-color: var(--student-accent-deep);
background: var(--student-accent-deep);
transform: translateY(-1px);
box-shadow: 0 2px 6px rgba(29, 78, 216, 0.3), 0 4px 12px rgba(29, 78, 216, 0.22);
}
&:active:not(:disabled) {
transform: translateY(0);
}
}
.btn-ghost {
border: 1px solid rgba(37, 99, 235, 0.35);
color: var(--student-accent);
background: #ffffff;
&:hover:not(:disabled) {
border-color: var(--student-accent);
background: var(--student-accent-soft);
transform: translateY(-1px);
box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}
}
.btn-save {
border: 1px solid #e5e7eb;
color: #4b5563;
background: #f9fafb;
&:hover:not(:disabled) {
border-color: #d1d5db;
background: #f3f4f6;
}
}
.btn-primary:disabled,
.btn-ghost:disabled,
.btn-save:disabled,
.btn-nav:disabled {
cursor: not-allowed;
opacity: 0.5;
transform: none;
box-shadow: none;
}
.step-progress {
color: var(--student-text-secondary);
font-size: var(--student-fs-caption);
font-weight: 700;
letter-spacing: 0.05em;
white-space: nowrap;
}
/* placeholder */
@ -1374,7 +1485,7 @@ td:last-child {
display: none;
}
.step-actions {
.step-navigation {
flex-wrap: wrap;
}
}

File diff suppressed because it is too large Load Diff

@ -244,19 +244,24 @@
</div>
</section>
<div class="step-actions">
<el-button class="nav-action nav-action--previous" :disabled="form.activeStep === 0" @click="goPrev">
<el-icon><ArrowLeft /></el-icon>
上一步
</el-button>
<el-button class="nav-action nav-action--save" :loading="saving" @click="saveCurrentProgress">
<el-icon><CircleCheck /></el-icon>
保存当前进度
</el-button>
<el-button class="nav-action nav-action--next" :disabled="form.activeStep === flowSteps.length - 1" @click="goNext">
下一步
<el-icon><ArrowRight /></el-icon>
</el-button>
<div class="step-navigation">
<div class="step-nav-left">
<button v-if="form.activeStep > 0" type="button" class="btn-nav btn-ghost" :disabled="saving" @click="goPrev">
<el-icon><ArrowLeft /></el-icon>
上一步
</button>
<button type="button" class="btn-nav btn-save" :disabled="saving" @click="saveCurrentProgress">
<el-icon><CircleCheck /></el-icon>
保存当前进度
</button>
</div>
<div class="step-nav-right">
<span class="step-progress">Step {{ String(form.activeStep + 1).padStart(2, "0") }} / {{ String(flowSteps.length).padStart(2, "0") }}</span>
<button v-if="form.activeStep < flowSteps.length - 1" type="button" class="btn-nav btn-primary" :disabled="saving" @click="goNext">
下一步
<el-icon><ArrowRight /></el-icon>
</button>
</div>
</div>
<div class="training-actions">
@ -1704,21 +1709,146 @@ function downloadSurveyReportTemplate() {
.file-input { display: none; }
.step-actions {
/* ============ 底部步骤导航 ============ */
.step-navigation {
position: relative;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 10px;
margin-top: 16px;
padding: 12px 16px;
border: 1px solid var(--student-panel-border);
border-radius: 10px;
background: #ffffff;
}
.step-nav-left,
.step-nav-right {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: nowrap;
}
.step-nav-right {
margin-left: auto;
}
.btn-primary {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 14px;
margin-top: 22px;
gap: 6px;
min-height: 36px;
height: 36px;
padding: 0 14px;
border: 1px solid var(--student-accent);
border-radius: 8px;
color: #ffffff;
background: var(--student-accent);
font-family: inherit;
font-size: var(--student-fs-button);
font-weight: 600;
box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2), 0 2px 8px rgba(37, 99, 235, 0.15);
cursor: pointer;
transition: all 0.16s ease;
white-space: nowrap;
.el-icon {
font-size: 16px;
}
&:hover:not(:disabled) {
border-color: var(--student-accent-deep);
background: var(--student-accent-deep);
transform: translateY(-1px);
box-shadow: 0 2px 6px rgba(29, 78, 216, 0.3), 0 4px 12px rgba(29, 78, 216, 0.22);
}
&:active:not(:disabled) {
transform: translateY(0);
}
}
.btn-ghost {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-height: 36px;
height: 36px;
padding: 0 14px;
border: 1px solid rgba(37, 99, 235, 0.35);
border-radius: 8px;
color: var(--student-accent);
background: #ffffff;
font-family: inherit;
font-size: var(--student-fs-button);
font-weight: 600;
cursor: pointer;
transition: all 0.16s ease;
white-space: nowrap;
.el-icon {
font-size: 16px;
}
&:hover:not(:disabled) {
border-color: var(--student-accent);
background: var(--student-accent-soft);
transform: translateY(-1px);
box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}
}
.nav-action {
.btn-save {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-height: 36px;
height: 36px;
padding: 0 14px;
border: 1px solid #e5e7eb;
border-radius: 8px;
color: #4b5563;
background: #f9fafb;
font-family: inherit;
font-size: var(--student-fs-button);
font-weight: 600;
cursor: pointer;
transition: all 0.16s ease;
white-space: nowrap;
.el-icon {
font-size: 16px;
}
&:hover:not(:disabled) {
border-color: #d1d5db;
background: #f3f4f6;
}
}
.btn-primary:disabled,
.btn-ghost:disabled,
.btn-save:disabled,
.btn-nav:disabled {
cursor: not-allowed;
opacity: 0.5;
transform: none;
box-shadow: none;
}
.step-progress {
color: var(--student-text-secondary);
font-family: var(--student-font-data);
font-size: var(--student-fs-caption);
font-weight: 700;
letter-spacing: 0.05em;
white-space: nowrap;
}
.training-actions {
@ -1740,12 +1870,18 @@ function downloadSurveyReportTemplate() {
.workbench-actions,
.step-title-row,
.step-actions,
.step-navigation,
.training-actions {
flex-direction: column;
align-items: stretch;
}
.step-nav-left,
.step-nav-right,
.btn-nav {
width: 100%;
}
.hypothesis-head { grid-template-columns: 1fr; }
.training-eight-action {
@ -1973,63 +2109,7 @@ function downloadSurveyReportTemplate() {
box-shadow: 0 5px 14px rgba(29, 78, 216, 0.32) !important;
}
/* === nav-action (step-actions) === */
#app .studentLayout section.app-main:has(.consumer-behavior-page) .step-actions .el-button.nav-action {
min-height: 34px !important;
height: 34px !important;
padding: 0 14px !important;
border: 1px solid rgba(37, 99, 235, 0.35) !important;
border-radius: 8px !important;
color: var(--student-accent) !important;
background: #ffffff !important;
font-size: 13px !important;
font-weight: 700 !important;
box-shadow: none !important;
transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease !important;
}
#app .studentLayout section.app-main:has(.consumer-behavior-page) .step-actions .el-button.nav-action:hover:not(.is-disabled) {
transform: translateY(-1px) !important;
border-color: var(--student-accent) !important;
background: var(--student-accent-soft) !important;
color: var(--student-accent) !important;
box-shadow: 0 3px 10px rgba(37, 99, 235, 0.12) !important;
}
#app .studentLayout section.app-main:has(.consumer-behavior-page) .step-actions .el-button.nav-action:disabled,
#app .studentLayout section.app-main:has(.consumer-behavior-page) .step-actions .el-button.nav-action.is-disabled {
opacity: 0.45 !important;
cursor: not-allowed !important;
transform: none !important;
}
#app .studentLayout section.app-main:has(.consumer-behavior-page) .step-actions .el-button.nav-action--next {
border-color: var(--student-accent) !important;
color: #ffffff !important;
background: var(--student-accent) !important;
box-shadow: 0 3px 10px rgba(37, 99, 235, 0.28) !important;
}
#app .studentLayout section.app-main:has(.consumer-behavior-page) .step-actions .el-button.nav-action--next:hover:not(.is-disabled) {
border-color: var(--student-accent-deep) !important;
background: var(--student-accent-deep) !important;
color: #ffffff !important;
box-shadow: 0 5px 14px rgba(29, 78, 216, 0.32) !important;
}
#app .studentLayout section.app-main:has(.consumer-behavior-page) .step-actions .el-button.nav-action--save {
border-color: #e5e7eb !important;
color: #374151 !important;
background: #f3f4f6 !important;
font-weight: 700 !important;
}
#app .studentLayout section.app-main:has(.consumer-behavior-page) .step-actions .el-button.nav-action--save:hover:not(.is-disabled) {
border-color: #d1d5db !important;
background: #e5e7eb !important;
color: var(--student-accent) !important;
box-shadow: none !important;
}
/* === nav-action (step-navigation):原生 button,样式见 scoped 块 === */
/* ============================================================
* 顶部工具栏:TrainingMaterialButton 资料按钮 → 教育蓝

@ -217,19 +217,24 @@
<p v-if="journeyOptimizationMessage" class="journey-check-message" role="status">{{ journeyOptimizationMessage }}</p>
</section>
<div v-if="hasConfiguredSteps" class="step-actions">
<button type="button" class="nav-action nav-action--previous" :disabled="form.activeStep === 1" @click="goPreviousStep">
<el-icon><ArrowLeft /></el-icon>
上一步
</button>
<button type="button" class="nav-action nav-action--save" :disabled="saving" @click="saveCurrentProgress">
<el-icon><CircleCheck /></el-icon>
保存当前进度
</button>
<button type="button" class="nav-action nav-action--next" :disabled="form.activeStep >= trainingSteps.length" @click="goNextStep">
下一步
<el-icon><ArrowRight /></el-icon>
</button>
<div v-if="hasConfiguredSteps" class="step-navigation">
<div class="step-nav-left">
<button type="button" class="btn-nav btn-ghost" :disabled="form.activeStep === 1" @click="goPreviousStep">
<el-icon><ArrowLeft /></el-icon>
上一步
</button>
<button type="button" class="btn-nav btn-save" :disabled="saving" @click="saveCurrentProgress">
<el-icon><CircleCheck /></el-icon>
保存当前进度
</button>
</div>
<div class="step-nav-right">
<span class="step-progress">Step {{ String(form.activeStep).padStart(2, "0") }} / {{ String(trainingSteps.length).padStart(2, "0") }}</span>
<button type="button" class="btn-nav btn-primary" :disabled="form.activeStep >= trainingSteps.length" @click="goNextStep">
下一步
<el-icon><ArrowRight /></el-icon>
</button>
</div>
</div>
<div class="training-actions">
@ -1568,64 +1573,184 @@ function exportOutcome() {
}
}
/* ===== 底部按钮 ===== */
.step-actions {
/* ===== 底部步骤导航按钮 ===== */
.step-navigation {
position: relative;
display: flex;
justify-content: center;
gap: 14px;
margin-top: 20px;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 10px;
margin-top: 16px;
padding: 12px 16px;
border: 1px solid var(--student-panel-border);
border-radius: 10px;
background: #ffffff;
}
.step-nav-left,
.step-nav-right {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: nowrap;
}
.step-nav-right {
margin-left: auto;
}
.nav-action {
.btn-nav {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-width: 112px;
min-height: 36px;
padding: 0 18px;
height: 36px;
padding: 0 14px;
border: 1px solid rgba(37, 99, 235, 0.35);
border-radius: 10px;
color: var(--student-text);
border-radius: 8px;
color: var(--student-accent);
background: #ffffff;
font-family: inherit;
font-size: var(--student-fs-button);
font-weight: 600;
cursor: pointer;
text-shadow: none;
transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
transition: all 0.16s ease;
white-space: nowrap;
.el-icon {
font-size: 16px;
}
&:hover:not(:disabled) {
border-color: var(--student-accent);
background: var(--student-accent-soft);
color: var(--student-accent);
transform: translateY(-1px);
box-shadow: 0 3px 10px rgba(37, 99, 235, 0.12);
box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}
&:disabled {
cursor: not-allowed;
opacity: 0.5;
opacity: 0.45;
transform: none;
box-shadow: none;
}
}
.nav-action--next,
.nav-action--save {
border-color: var(--student-accent);
.btn-primary {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-height: 36px;
height: 36px;
padding: 0 14px;
border: 1px solid var(--student-accent);
border-radius: 8px;
color: #ffffff;
background: var(--student-accent);
font-weight: 700;
box-shadow: 0 3px 10px rgba(37, 99, 235, 0.28);
font-family: inherit;
font-size: var(--student-fs-button);
font-weight: 600;
box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2), 0 2px 8px rgba(37, 99, 235, 0.15);
cursor: pointer;
transition: all 0.16s ease;
white-space: nowrap;
.el-icon {
font-size: 16px;
}
&:hover:not(:disabled) {
border-color: var(--student-accent-deep);
background: var(--student-accent-deep);
transform: translateY(-1px);
box-shadow: 0 2px 6px rgba(29, 78, 216, 0.3), 0 4px 12px rgba(29, 78, 216, 0.22);
}
&:active:not(:disabled) {
transform: translateY(0);
}
}
.nav-action--next:hover:not(:disabled),
.nav-action--save:hover:not(:disabled) {
background: var(--student-accent-deep);
border-color: var(--student-accent-deep);
color: #ffffff;
box-shadow: 0 5px 14px rgba(29, 78, 216, 0.32);
.btn-ghost {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-height: 36px;
height: 36px;
padding: 0 14px;
border: 1px solid rgba(37, 99, 235, 0.35);
border-radius: 8px;
color: var(--student-accent);
background: #ffffff;
font-family: inherit;
font-size: var(--student-fs-button);
font-weight: 600;
cursor: pointer;
transition: all 0.16s ease;
white-space: nowrap;
.el-icon {
font-size: 16px;
}
&:hover:not(:disabled) {
border-color: var(--student-accent);
background: var(--student-accent-soft);
transform: translateY(-1px);
box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}
}
.btn-save {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-height: 36px;
height: 36px;
padding: 0 14px;
border: 1px solid #e5e7eb;
border-radius: 8px;
color: #4b5563;
background: #f9fafb;
font-family: inherit;
font-size: var(--student-fs-button);
font-weight: 600;
cursor: pointer;
transition: all 0.16s ease;
white-space: nowrap;
.el-icon {
font-size: 16px;
}
&:hover:not(:disabled) {
border-color: #d1d5db;
background: #f3f4f6;
}
}
.btn-primary:disabled,
.btn-ghost:disabled,
.btn-save:disabled,
.btn-nav:disabled {
cursor: not-allowed;
opacity: 0.5;
transform: none;
box-shadow: none;
}
.step-progress {
color: var(--student-text-secondary);
font-family: var(--student-font-data);
font-size: var(--student-fs-caption);
font-weight: 700;
letter-spacing: 0.05em;
white-space: nowrap;
}
/* training-actions 容器:el-button 由全局样式接管 */
@ -1641,12 +1766,28 @@ function exportOutcome() {
@media (max-width: 900px) {
.workbench-head--actions-only,
.step-title-row,
.step-actions,
.training-actions {
flex-direction: column;
align-items: stretch;
}
.step-navigation {
flex-direction: column;
align-items: stretch;
}
.step-nav-left,
.step-nav-right {
justify-content: center;
}
.btn-nav,
.btn-primary,
.btn-ghost,
.btn-save {
width: 100%;
}
.journey-sort-head {
flex-direction: column;
}
@ -1675,10 +1816,6 @@ function exportOutcome() {
.journey-map-helper .el-button {
width: 100%;
}
.nav-action {
width: 100%;
}
}
</style>

@ -188,18 +188,23 @@
</section>
<div v-if="hasConfiguredSteps" class="step-navigation">
<button type="button" class="btn-nav" :disabled="form.activeStep === 1" @click="goPreviousStep">
<el-icon><ArrowLeft /></el-icon>
上一步
</button>
<button type="button" class="btn-nav btn-save" :disabled="saving" @click="saveCurrentProgress">
<el-icon><CircleCheck /></el-icon>
保存当前进度
</button>
<button type="button" class="btn-nav btn-primary" :disabled="form.activeStep === flowSteps.length" @click="goNextStep">
下一步
<el-icon><ArrowRight /></el-icon>
</button>
<div class="step-nav-left">
<button type="button" class="btn-nav btn-ghost" :disabled="form.activeStep === 1" @click="goPreviousStep">
<el-icon><ArrowLeft /></el-icon>
上一步
</button>
<button type="button" class="btn-nav btn-save" :disabled="saving" @click="saveCurrentProgress">
<el-icon><CircleCheck /></el-icon>
保存当前进度
</button>
</div>
<div class="step-nav-right">
<span class="step-progress">Step {{ String(form.activeStep).padStart(2, '0') }} / {{ String(flowSteps.length).padStart(2, '0') }}</span>
<button type="button" class="btn-nav btn-primary" :disabled="form.activeStep === flowSteps.length" @click="goNextStep">
下一步
<el-icon><ArrowRight /></el-icon>
</button>
</div>
</div>
<div class="training-actions">
@ -1281,67 +1286,168 @@ function exportOutcome() {
/* ===== 底部步骤导航按钮 ===== */
.step-navigation {
position: relative;
display: flex;
justify-content: center;
gap: 14px;
margin-top: 20px;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 10px;
margin-top: 16px;
padding: 12px 16px;
border: 1px solid var(--student-panel-border);
border-radius: 10px;
background: #ffffff;
}
.step-nav-left,
.step-nav-right {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: nowrap;
}
.step-nav-right {
margin-left: auto;
}
.btn-nav {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
gap: 6px;
min-height: 36px;
height: 36px;
padding: 0 14px;
border: 1px solid rgba(37, 99, 235, 0.35);
border-radius: 8px;
color: var(--student-text);
color: var(--student-accent);
background: #ffffff;
font-family: inherit;
font-size: var(--student-fs-button);
font-weight: 700;
font-weight: 600;
cursor: pointer;
text-shadow: none;
transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}
transition: all 0.16s ease;
white-space: nowrap;
.btn-nav:hover:not(:disabled) {
border-color: var(--student-accent);
background: var(--student-accent-soft);
color: var(--student-accent);
transform: translateY(-1px);
box-shadow: 0 3px 10px rgba(37, 99, 235, 0.12);
.el-icon {
font-size: 16px;
}
&:hover:not(:disabled) {
border-color: var(--student-accent);
background: var(--student-accent-soft);
transform: translateY(-1px);
box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}
&:disabled {
cursor: not-allowed;
opacity: 0.45;
transform: none;
box-shadow: none;
}
}
.btn-nav.btn-primary {
border-color: var(--student-accent);
.btn-primary {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-height: 36px;
height: 36px;
padding: 0 14px;
border: 1px solid var(--student-accent);
border-radius: 8px;
color: #ffffff;
background: var(--student-accent);
font-weight: 700;
box-shadow: 0 3px 10px rgba(37, 99, 235, 0.28);
}
font-family: inherit;
font-size: var(--student-fs-button);
font-weight: 600;
box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2), 0 2px 8px rgba(37, 99, 235, 0.15);
cursor: pointer;
transition: all 0.16s ease;
white-space: nowrap;
.btn-nav.btn-primary:hover:not(:disabled) {
background: var(--student-accent-deep);
border-color: var(--student-accent-deep);
box-shadow: 0 5px 14px rgba(29, 78, 216, 0.32);
}
.el-icon {
font-size: 16px;
}
.btn-nav.btn-save {
border-color: #e5e7eb;
color: var(--student-accent-light);
background: var(--student-accent-soft);
box-shadow: none;
&:hover:not(:disabled) {
border-color: var(--student-accent-deep);
background: var(--student-accent-deep);
transform: translateY(-1px);
box-shadow: 0 2px 6px rgba(29, 78, 216, 0.3), 0 4px 12px rgba(29, 78, 216, 0.22);
}
&:active:not(:disabled) {
transform: translateY(0);
}
}
.btn-nav.btn-save:hover:not(:disabled) {
border-color: var(--student-accent);
background: #e9ecef;
.btn-ghost {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-height: 36px;
height: 36px;
padding: 0 14px;
border: 1px solid rgba(37, 99, 235, 0.35);
border-radius: 8px;
color: var(--student-accent);
box-shadow: none;
background: #ffffff;
font-family: inherit;
font-size: var(--student-fs-button);
font-weight: 600;
cursor: pointer;
transition: all 0.16s ease;
white-space: nowrap;
.el-icon {
font-size: 16px;
}
&:hover:not(:disabled) {
border-color: var(--student-accent);
background: var(--student-accent-soft);
transform: translateY(-1px);
box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}
}
.btn-save {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-height: 36px;
height: 36px;
padding: 0 14px;
border: 1px solid #e5e7eb;
border-radius: 8px;
color: #4b5563;
background: #f9fafb;
font-family: inherit;
font-size: var(--student-fs-button);
font-weight: 600;
cursor: pointer;
transition: all 0.16s ease;
white-space: nowrap;
.el-icon {
font-size: 16px;
}
&:hover:not(:disabled) {
border-color: #d1d5db;
background: #f3f4f6;
}
}
.btn-primary:disabled,
.btn-ghost:disabled,
.btn-save:disabled,
.btn-nav:disabled {
cursor: not-allowed;
opacity: 0.5;
@ -1349,6 +1455,15 @@ function exportOutcome() {
box-shadow: none;
}
.step-progress {
color: var(--student-text-secondary);
font-family: var(--student-font-data);
font-size: var(--student-fs-caption);
font-weight: 700;
letter-spacing: 0.05em;
white-space: nowrap;
}
/* training-actions 容器:保留,el-button 由全局样式接管 */
.training-actions {
display: flex;
@ -1368,12 +1483,21 @@ function exportOutcome() {
.outline-action,
.step-navigation,
.btn-nav {
.btn-nav,
.btn-primary,
.btn-ghost,
.btn-save {
width: 100%;
}
.step-navigation {
flex-direction: column;
align-items: stretch;
}
.step-nav-left,
.step-nav-right {
justify-content: center;
}
.conversion-intro,

@ -83,9 +83,23 @@
<div v-else class="step-placeholder"><p>第 {{ currentStep }} 步内容待配置</p><span>前序步骤已保存,可从上方步骤栏返回查看。</span></div>
<div class="step-navigation">
<button v-if="currentStep > 1" type="button" class="btn-nav" :disabled="saving" @click="previousStep">上一步</button>
<button type="button" class="btn-nav btn-primary" :disabled="saving" @click="saveCurrentProgress">保存当前进度</button>
<button v-if="currentStep < trainingSteps.length" type="button" class="btn-nav btn-primary" :disabled="saving" @click="nextStep">下一步</button>
<div class="step-nav-left">
<button v-if="currentStep > 1" type="button" class="btn-nav btn-ghost" :disabled="saving" @click="previousStep">
<el-icon><ArrowLeft /></el-icon>
上一步
</button>
<button type="button" class="btn-nav btn-save" :disabled="saving" @click="saveCurrentProgress">
<el-icon><CircleCheck /></el-icon>
保存当前进度
</button>
</div>
<div class="step-nav-right">
<span class="step-progress">Step {{ String(currentStep).padStart(2, "0") }} / {{ String(trainingSteps.length).padStart(2, "0") }}</span>
<button v-if="currentStep < trainingSteps.length" type="button" class="btn-nav btn-primary" :disabled="saving" @click="nextStep">
下一步
<el-icon><ArrowRight /></el-icon>
</button>
</div>
</div>
</section>
</section>
@ -95,7 +109,7 @@
</template>
<script setup>
import { DataAnalysis } from "@element-plus/icons-vue";
import { ArrowLeft, ArrowRight, CircleCheck, DataAnalysis } from "@element-plus/icons-vue";
import { checkIndustryDemandAnalysisStepOne, checkIndustryDemandAnalysisStepTwo, checkIndustryDemandAnalysisStepThree, checkIndustryDemandAnalysisStepFour, deleteStudentTrainingAnswer, getStudentTrainingAnswer, saveStudentTrainingAnswer } from "@/api/studentTrainingAnswer";
import { getTrainingTaskByKey } from "@/api/trainingTask";
import { parseTrainingArray } from "@/views/training/taskKeyMap";
@ -605,13 +619,68 @@ function exportOutcome() { const blob = new Blob([JSON.stringify(buildDraft(), n
/* ===== 底部步骤导航按钮(scoped 基础) ===== */
.step-navigation {
position: relative;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 10px;
margin-top: 16px;
padding: 12px 16px;
border: 1px solid var(--student-panel-border);
border-radius: 10px;
background: #ffffff;
}
.step-nav-left,
.step-nav-right {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: nowrap;
}
.step-nav-right {
margin-left: auto;
}
.btn-primary {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 14px;
margin-top: 20px;
gap: 6px;
min-height: 36px;
height: 36px;
padding: 0 14px;
border: 1px solid var(--student-accent);
border-radius: 8px;
color: #ffffff;
background: var(--student-accent);
font-family: inherit;
font-size: var(--student-fs-button);
font-weight: 600;
box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2), 0 2px 8px rgba(37, 99, 235, 0.15);
cursor: pointer;
transition: all 0.16s ease;
white-space: nowrap;
.el-icon {
font-size: 16px;
}
&:hover:not(:disabled) {
border-color: var(--student-accent-deep);
background: var(--student-accent-deep);
transform: translateY(-1px);
box-shadow: 0 2px 6px rgba(29, 78, 216, 0.3), 0 4px 12px rgba(29, 78, 216, 0.22);
}
&:active:not(:disabled) {
transform: translateY(0);
}
}
.step-navigation .btn-nav {
.btn-ghost {
display: inline-flex;
align-items: center;
justify-content: center;
@ -621,44 +690,75 @@ function exportOutcome() { const blob = new Blob([JSON.stringify(buildDraft(), n
padding: 0 14px;
border: 1px solid rgba(37, 99, 235, 0.35);
border-radius: 8px;
color: var(--student-text);
color: var(--student-accent);
background: #ffffff;
font-family: inherit;
font-size: var(--student-fs-button);
font-weight: 600;
cursor: pointer;
text-shadow: none;
transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}
transition: all 0.16s ease;
white-space: nowrap;
.step-navigation .btn-nav:hover {
border-color: var(--student-accent);
background: var(--student-accent-soft);
color: var(--student-accent);
transform: translateY(-1px);
box-shadow: 0 3px 10px rgba(37, 99, 235, 0.12);
}
.el-icon {
font-size: 16px;
}
.step-navigation .btn-nav.btn-primary {
border-color: var(--student-accent);
color: #ffffff;
background: var(--student-accent);
font-weight: 700;
box-shadow: 0 3px 10px rgba(37, 99, 235, 0.28);
&:hover:not(:disabled) {
border-color: var(--student-accent);
background: var(--student-accent-soft);
transform: translateY(-1px);
box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}
}
.step-navigation .btn-nav.btn-primary:hover {
background: var(--student-accent-deep);
border-color: var(--student-accent-deep);
box-shadow: 0 5px 14px rgba(29, 78, 216, 0.32);
.btn-save {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-height: 36px;
height: 36px;
padding: 0 14px;
border: 1px solid #e5e7eb;
border-radius: 8px;
color: #4b5563;
background: #f9fafb;
font-family: inherit;
font-size: var(--student-fs-button);
font-weight: 600;
cursor: pointer;
transition: all 0.16s ease;
white-space: nowrap;
.el-icon {
font-size: 16px;
}
&:hover:not(:disabled) {
border-color: #d1d5db;
background: #f3f4f6;
}
}
.step-navigation .btn-nav:disabled {
.btn-primary:disabled,
.btn-ghost:disabled,
.btn-save:disabled,
.btn-nav:disabled {
cursor: not-allowed;
opacity: 0.5;
transform: none;
box-shadow: none;
}
.step-progress {
color: var(--student-text-secondary);
font-family: var(--student-font-data);
font-size: var(--student-fs-caption);
font-weight: 700;
letter-spacing: 0.05em;
white-space: nowrap;
}
.step-placeholder {
padding: 60px 20px;
text-align: center;
@ -679,8 +779,10 @@ function exportOutcome() { const blob = new Blob([JSON.stringify(buildDraft(), n
@media (max-width: 720px) {
.task-header { flex-direction: column; align-items: flex-start; }
.step-chip { display: none; }
.step-navigation { flex-direction: column; }
.step-navigation .btn-nav { width: 100%; }
.step-navigation { flex-direction: column; align-items: stretch; }
.step-nav-left,
.step-nav-right { width: 100%; }
.btn-nav { width: 100%; }
}
</style>

@ -315,27 +315,33 @@
</div>
</section>
<div v-if="steps.length" class="step-actions">
<el-button class="step-action step-action--previous" :disabled="currentStep <= 1"
@click="currentStep -= 1">
<el-icon>
<ArrowLeft />
</el-icon>
上一步
</el-button>
<el-button class="step-action step-action--save" :loading="saving" @click="saveCurrentProgress">
<el-icon>
<CircleCheck />
</el-icon>
保存当前进度
</el-button>
<el-button class="step-action step-action--next" :disabled="currentStep >= steps.length"
@click="goNext">
下一步
<el-icon>
<ArrowRight />
</el-icon>
</el-button>
<div v-if="steps.length" class="step-navigation">
<div class="step-nav-left">
<button v-if="currentStep > 1" type="button" class="btn-nav btn-ghost" :disabled="saving"
@click="currentStep -= 1">
<el-icon>
<ArrowLeft />
</el-icon>
上一步
</button>
<button type="button" class="btn-nav btn-save" :disabled="saving" @click="saveCurrentProgress">
<el-icon>
<CircleCheck />
</el-icon>
保存当前进度
</button>
</div>
<div class="step-nav-right">
<span class="step-progress">Step {{ String(currentStep).padStart(2, "0") }} / {{
String(steps.length).padStart(2, "0") }}</span>
<button v-if="currentStep < steps.length" type="button" class="btn-nav btn-primary"
:disabled="saving" @click="goNext">
下一步
<el-icon>
<ArrowRight />
</el-icon>
</button>
</div>
</div>
<div class="training-actions">
@ -1934,53 +1940,145 @@ function exportOutcome() {
}
/* ============ 底部步骤导航 ============ */
.step-actions {
.step-navigation {
position: relative;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 10px;
margin-top: 16px;
padding: 12px 16px;
border: 1px solid var(--student-panel-border);
border-radius: 10px;
background: #ffffff;
}
.step-nav-left,
.step-nav-right {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: nowrap;
}
.step-nav-right {
margin-left: auto;
}
.btn-primary {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 12px;
margin-top: 18px;
gap: 6px;
min-height: 36px;
height: 36px;
padding: 0 14px;
border: 1px solid var(--student-accent);
border-radius: 8px;
color: #ffffff;
background: var(--student-accent);
font-family: inherit;
font-size: var(--student-fs-button);
font-weight: 600;
box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2), 0 2px 8px rgba(37, 99, 235, 0.15);
cursor: pointer;
transition: all 0.16s ease;
white-space: nowrap;
.el-icon {
font-size: 16px;
}
&:hover:not(:disabled) {
border-color: var(--student-accent-deep);
background: var(--student-accent-deep);
transform: translateY(-1px);
box-shadow: 0 2px 6px rgba(29, 78, 216, 0.3), 0 4px 12px rgba(29, 78, 216, 0.22);
}
&:active:not(:disabled) {
transform: translateY(0);
}
}
.step-actions :deep(.step-action) {
min-height: 40px;
padding: 0 18px;
.btn-ghost {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-height: 36px;
height: 36px;
padding: 0 14px;
border: 1px solid rgba(37, 99, 235, 0.35);
border-radius: 10px;
border-radius: 8px;
color: var(--student-accent);
background: #ffffff;
font-size: 13px;
font-weight: 700;
transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
font-family: inherit;
font-size: var(--student-fs-button);
font-weight: 600;
cursor: pointer;
transition: all 0.16s ease;
white-space: nowrap;
&:hover:not(.is-disabled) {
transform: translateY(-1px);
.el-icon {
font-size: 16px;
}
&:hover:not(:disabled) {
border-color: var(--student-accent);
background: var(--student-accent-soft);
color: var(--student-accent);
box-shadow: 0 3px 10px rgba(37, 99, 235, 0.12);
transform: translateY(-1px);
box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}
}
.step-actions :deep(.step-action--save),
.step-actions :deep(.step-action--next) {
border-color: var(--student-accent);
color: #ffffff;
background: var(--student-accent);
box-shadow: 0 3px 10px rgba(37, 99, 235, 0.28);
.btn-save {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-height: 36px;
height: 36px;
padding: 0 14px;
border: 1px solid #e5e7eb;
border-radius: 8px;
color: #4b5563;
background: #f9fafb;
font-family: inherit;
font-size: var(--student-fs-button);
font-weight: 600;
cursor: pointer;
transition: all 0.16s ease;
white-space: nowrap;
&:hover:not(.is-disabled) {
transform: translateY(-1px);
background: var(--student-accent-deep);
border-color: var(--student-accent-deep);
box-shadow: 0 5px 14px rgba(29, 78, 216, 0.32);
color: #ffffff;
.el-icon {
font-size: 16px;
}
&:hover:not(:disabled) {
border-color: #d1d5db;
background: #f3f4f6;
}
}
.step-actions :deep(.step-action.is-disabled) {
opacity: 0.5;
.btn-primary:disabled,
.btn-ghost:disabled,
.btn-save:disabled,
.btn-nav:disabled {
cursor: not-allowed;
opacity: 0.5;
transform: none;
box-shadow: none;
}
.step-progress {
color: var(--student-text-secondary);
font-family: var(--student-font-data);
font-size: var(--student-fs-caption);
font-weight: 700;
letter-spacing: 0.05em;
white-space: nowrap;
}
/* ============ 底部提交/重新实训 ============ */
@ -2052,7 +2150,7 @@ function exportOutcome() {
.workbench-actions,
.upload-panel,
.step-title-row,
.step-actions,
.step-navigation,
.training-actions {
flex-direction: column;
align-items: stretch;
@ -2062,7 +2160,9 @@ function exportOutcome() {
.workbench-actions .outline-action,
.upload-action,
.preview-action,
.step-actions :deep(.step-action),
.step-nav-left,
.step-nav-right,
.btn-nav,
.training-actions :deep(.training-action) {
width: 100%;
}
@ -2365,52 +2465,8 @@ function exportOutcome() {
}
/* ============================================================
* 底部步骤按钮:step-action
* 底部步骤按钮:step-navigation(原生 button,样式见 scoped 块)
* ============================================================ */
#app .studentLayout section.app-main:has(.target-profile-page) .step-actions .el-button.step-action {
height: 34px !important;
min-height: 34px !important;
padding: 0 14px !important;
border: 1px solid rgba(37, 99, 235, 0.35) !important;
border-radius: 8px !important;
color: #2563eb !important;
background: #ffffff !important;
box-shadow: none !important;
&:hover:not(.is-disabled) {
border-color: #2563eb !important;
color: #2563eb !important;
background: #eff6ff !important;
box-shadow: 0 3px 10px rgba(37, 99, 235, 0.12) !important;
}
}
#app .studentLayout section.app-main:has(.target-profile-page) .step-actions .el-button.step-action--save {
border-color: #e5e7eb !important;
color: #374151 !important;
background: #f3f4f6 !important;
&:hover:not(.is-disabled) {
border-color: #d1d5db !important;
color: #2563eb !important;
background: #e5e7eb !important;
box-shadow: none !important;
}
}
#app .studentLayout section.app-main:has(.target-profile-page) .step-actions .el-button.step-action--next {
border-color: #2563eb !important;
color: #ffffff !important;
background: #2563eb !important;
box-shadow: 0 3px 10px rgba(37, 99, 235, 0.28) !important;
&:hover:not(.is-disabled) {
border-color: #1d4ed8 !important;
color: #ffffff !important;
background: #1d4ed8 !important;
box-shadow: 0 5px 14px rgba(29, 78, 216, 0.32) !important;
}
}
/* ============================================================
* 底部提交/清空:training-actions

File diff suppressed because it is too large Load Diff

@ -1,4 +1,4 @@
<template>
<template>
<div class="product-factors student-training-shell">
<main class="factors-core">
<section class="task-header">
@ -97,17 +97,6 @@
</tbody>
</table>
</div>
<div class="task-actions">
<button type="button" class="btn-nav btn-submit" :disabled="saving" @click="saveAndGoToStepTwo">
保存并进入第 2 步
<el-icon><ArrowRight /></el-icon>
</button>
<button type="button" class="btn-nav" :disabled="saving" @click="resetTraining">
<el-icon><RefreshLeft /></el-icon>
清空填写
</button>
</div>
</template>
<template v-else-if="currentStep === 1">
@ -115,7 +104,6 @@
<div class="training-table-wrap"><table class="factor-table"><thead><tr><th class="dimension-col">维度</th><th class="criteria-col">评估项</th><th>成功产品</th><th>失败产品</th></tr></thead><tbody>
<tr v-for="row in stepTwoRows" :key="row.dimension"><td class="dimension-cell">{{ row.dimension }}</td><td class="criteria-cell">{{ row.criteria }}</td><td><textarea v-model="row.successAnalysis" class="table-textarea" placeholder="填写成功产品在该维度的分析" /></td><td><textarea v-model="row.failedAnalysis" class="table-textarea" placeholder="填写失败产品在该维度的分析" /></td></tr>
</tbody></table></div>
<div class="task-actions"><button type="button" class="btn-nav btn-submit" :disabled="saving" @click="saveAndGoToStepThree">保存并进入第 3 步<el-icon><ArrowRight /></el-icon></button><button type="button" class="btn-nav" :disabled="saving" @click="resetTraining"><el-icon><RefreshLeft /></el-icon>清空填写</button></div>
</template>
<template v-else-if="currentStep === 2">
@ -123,7 +111,6 @@
<div class="training-table-wrap"><table class="factor-table"><thead><tr><th class="dimension-col">维度</th><th class="criteria-col">评估项</th><th>成功产品</th><th>失败产品</th></tr></thead><tbody>
<tr v-for="row in stepThreeRows" :key="row.dimension"><td class="dimension-cell">{{ row.dimension }}</td><td class="criteria-cell">{{ row.criteria }}</td><td><textarea v-model="row.successAnalysis" class="table-textarea" placeholder="填写成功产品在该维度的分析" /></td><td><textarea v-model="row.failedAnalysis" class="table-textarea" placeholder="填写失败产品在该维度的分析" /></td></tr>
</tbody></table></div>
<div class="task-actions"><button type="button" class="btn-nav btn-submit" :disabled="saving" @click="saveAndGoToStepFour">保存并进入第 4 步<el-icon><ArrowRight /></el-icon></button><button type="button" class="btn-nav" :disabled="saving" @click="resetTraining"><el-icon><RefreshLeft /></el-icon>清空填写</button></div>
</template>
<template v-else-if="currentStep === 3">
@ -136,6 +123,26 @@
<span>已保存的分析可从上方步骤栏返回查看。</span>
</div>
</section>
<div class="step-navigation">
<div class="step-nav-left">
<button v-if="currentStep > 0" type="button" class="btn-nav btn-ghost" @click="prevStep">
<el-icon><ArrowLeft /></el-icon>
上一步
</button>
<button type="button" class="btn-nav btn-save" :disabled="saving" @click="saveCurrentProgress">
<el-icon><CircleCheck /></el-icon>
保存当前进度
</button>
</div>
<div class="step-nav-right">
<span class="step-progress">Step {{ String(currentStep + 1).padStart(2, '0') }} / {{ String(trainingSteps.length).padStart(2, '0') }}</span>
<button v-if="currentStep < trainingSteps.length - 1" type="button" class="btn-nav btn-primary" :disabled="saving" @click="nextStep">
{{ saving ? '处理中…' : '下一步' }}
<el-icon><ArrowRight /></el-icon>
</button>
</div>
</div>
</section>
</main>
@ -150,7 +157,7 @@
</template>
<script setup>
import { ArrowRight, CircleCheck, Operation, RefreshLeft } from "@element-plus/icons-vue";
import { ArrowLeft, ArrowRight, CircleCheck, Operation, RefreshLeft } from "@element-plus/icons-vue";
import { getTrainingTaskByKey } from "@/api/trainingTask";
import { parseTrainingArray } from "@/views/training/taskKeyMap";
import { checkProductDevelopmentFactorsStepOne, checkProductDevelopmentFactorsStepTwo, checkProductDevelopmentFactorsStepThree, checkProductDevelopmentFactorsStepFour, getStudentTrainingAnswer, saveStudentTrainingAnswer } from "@/api/studentTrainingAnswer";
@ -483,6 +490,49 @@ function exportOutcome() {
URL.revokeObjectURL(url);
proxy?.$modal?.msgSuccess("导出成功");
}
function prevStep() {
if (currentStep.value > 0) {
currentStep.value -= 1;
}
}
async function saveCurrentProgress() {
if (saving.value) return;
saving.value = true;
try {
let payload;
const persistedStep = currentStep.value + 1;
if (currentStep.value === 0) {
payload = buildStepOneAnswerPayload("SAVE", persistedStep);
} else if (currentStep.value === 1) {
payload = buildStepTwoAnswerPayload("SAVE", persistedStep);
} else if (currentStep.value === 2) {
payload = buildStepThreeAnswerPayload("SAVE", persistedStep);
} else {
payload = buildStepFourAnswerPayload("SAVE", persistedStep);
payload.submitted = false;
}
await saveStudentTrainingAnswer(TASK_KEY, payload);
clearDraft();
proxy?.$modal?.msgSuccess("保存成功");
} catch (error) {
proxy?.$modal?.msgError?.(error?.message || "保存失败,请稍后重试");
} finally {
saving.value = false;
}
}
async function nextStep() {
if (saving.value) return;
if (currentStep.value === 0) {
await saveAndGoToStepTwo();
} else if (currentStep.value === 1) {
await saveAndGoToStepThree();
} else if (currentStep.value === 2) {
await saveAndGoToStepFour();
}
}
</script>
<style lang="scss" scoped>
@ -910,6 +960,155 @@ function exportOutcome() {
}
}
/* ============================================================
* 底部步骤导航:上一步 / 保存当前进度 / 下一步
* ============================================================ */
.step-navigation {
position: relative;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 10px;
margin-top: 16px;
padding: 12px 16px;
border: 1px solid var(--student-panel-border);
border-radius: 10px;
background: #ffffff;
}
.step-nav-left,
.step-nav-right {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: nowrap;
}
.step-nav-right {
margin-left: auto;
}
.btn-primary {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-height: 36px;
height: 36px;
padding: 0 14px;
border: 1px solid var(--student-accent);
border-radius: 8px;
color: #ffffff;
background: var(--student-accent);
font-family: inherit;
font-size: 13px;
font-weight: 600;
box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2), 0 2px 8px rgba(37, 99, 235, 0.15);
cursor: pointer;
transition: all 0.16s ease;
white-space: nowrap;
.el-icon {
font-size: 14px;
}
&:hover:not(:disabled) {
border-color: var(--student-accent-deep);
background: var(--student-accent-deep);
transform: translateY(-1px);
box-shadow: 0 2px 6px rgba(29, 78, 216, 0.3), 0 4px 12px rgba(29, 78, 216, 0.22);
}
&:active:not(:disabled) {
transform: translateY(0);
}
}
.btn-ghost {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-height: 36px;
height: 36px;
padding: 0 14px;
border: 1px solid rgba(37, 99, 235, 0.35);
border-radius: 8px;
color: var(--student-accent);
background: #ffffff;
font-family: inherit;
font-size: 13px;
font-weight: 600;
cursor: pointer;
transition: all 0.16s ease;
white-space: nowrap;
.el-icon {
font-size: 14px;
}
&:hover:not(:disabled) {
border-color: var(--student-accent);
background: var(--student-accent-soft);
transform: translateY(-1px);
box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}
}
.btn-save {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-height: 36px;
height: 36px;
padding: 0 14px;
border: 1px solid #e5e7eb;
border-radius: 8px;
color: #4b5563;
background: #f9fafb;
font-family: inherit;
font-size: 13px;
font-weight: 600;
cursor: pointer;
transition: all 0.16s ease;
white-space: nowrap;
.el-icon {
font-size: 14px;
}
&:hover:not(:disabled) {
border-color: #d1d5db;
background: #f3f4f6;
}
}
.btn-primary:disabled,
.btn-ghost:disabled,
.btn-save:disabled {
cursor: not-allowed;
opacity: 0.5;
transform: none;
box-shadow: none;
}
.step-progress {
color: var(--student-text-secondary);
font-family: var(--student-font-data);
font-size: 11px;
font-weight: 700;
letter-spacing: 0.05em;
white-space: nowrap;
}
@media (max-width: 1100px) {
.step-nav-right {
margin-left: 0;
}
}
@media (max-width: 900px) {
/* 窄屏全宽规则的强制覆盖见非 scoped 块(scoped 打不赢全局 !important) */

@ -1,4 +1,4 @@
<template>
<template>
<div class="product-process student-training-shell">
<main class="process-core">
<section class="task-header">
@ -81,10 +81,6 @@
</table>
</div>
<p v-if="checkResult" class="classification-summary" :class="{ 'is-success': checkResult.allCorrect }">本次判题:{{ checkResult.correctCount }} / {{ checkResult.totalCount }} 项分类正确</p>
<div class="task-actions">
<button type="button" class="btn-nav btn-submit" :disabled="checking" @click="saveAndGoToStepTwo">{{ checking ? '判题中…' : '保存并进入第 2 步' }}</button>
<button type="button" class="btn-nav" :disabled="checking" @click="resetTraining"><el-icon><RefreshLeft /></el-icon>清空填写</button>
</div>
</template>
<template v-else-if="currentStep === 2">
<div class="step-title-row">
@ -112,10 +108,6 @@
</tbody>
</table>
</div>
<div class="task-actions">
<button type="button" class="btn-nav btn-submit" :disabled="checking || !hasCompletedStepOne" @click="saveAndGoToStepThree">{{ checking ? '校验中…' : '保存并进入第 3 步' }}</button>
<button type="button" class="btn-nav" :disabled="checking" @click="resetStepTwo"><el-icon><RefreshLeft /></el-icon>清空本步</button>
</div>
</template>
<template v-else-if="currentStep === 3">
<div class="step-title-row">
@ -144,10 +136,6 @@
<li>导出步骤二信息表,上传到通用AI绘图模型,通过大模型绘制甘特图。参考提示词:请根据产品WBS任务拆解与排期表生成甘特图用于后续项目管理。</li>
</ol>
</section>
<div class="task-actions">
<button type="button" class="btn-nav btn-submit" :disabled="uploadingGantt || !stepTwoPassed" @click="saveAndGoToStepFour">保存并进入第 4 步<el-icon><ArrowRight /></el-icon></button>
<button type="button" class="btn-nav" :disabled="uploadingGantt" @click="resetStepThree"><el-icon><RefreshLeft /></el-icon>清空本步</button>
</div>
</template>
<template v-else-if="currentStep === 4">
<div class="step-title-row">
@ -169,6 +157,26 @@
</template>
<div v-else class="step-placeholder"><p>第 {{ currentStep }} 步内容待配置</p><span>第 1 步答案已保存,可从上方步骤栏返回查看。</span></div>
</section>
<div class="step-navigation">
<div class="step-nav-left">
<button v-if="currentStep > 1" type="button" class="btn-nav btn-ghost" @click="prevStep">
<el-icon><ArrowLeft /></el-icon>
上一步
</button>
<button type="button" class="btn-nav btn-save" :disabled="saving || uploadingGantt" @click="saveCurrentProgress">
<el-icon><CircleCheck /></el-icon>
保存当前进度
</button>
</div>
<div class="step-nav-right">
<span class="step-progress">Step {{ String(currentStep).padStart(2, '0') }} / {{ String(trainingSteps.length).padStart(2, '0') }}</span>
<button v-if="currentStep < trainingSteps.length" type="button" class="btn-nav btn-primary" :disabled="checking || saving || uploadingGantt" @click="nextStep">
{{ checking ? '判题中…' : '下一步' }}
<el-icon><ArrowRight /></el-icon>
</button>
</div>
</div>
</section>
</main>
@ -182,7 +190,7 @@
</template>
<script setup>
import { ArrowRight, CircleCheck, Operation, RefreshLeft, Upload } from "@element-plus/icons-vue";
import { ArrowLeft, ArrowRight, CircleCheck, Operation, RefreshLeft, Upload } from "@element-plus/icons-vue";
import * as XLSX from "xlsx";
import { checkProductDevelopmentProcessStepOne, checkProductDevelopmentProcessStepTwo, checkProductDevelopmentProcessStepThree, checkProductDevelopmentProcessStepFour, getStudentTrainingAnswer, saveStudentTrainingAnswer, uploadStudentTrainingFile } from "@/api/studentTrainingAnswer";
import { getTrainingTaskByKey } from "@/api/trainingTask";
@ -220,6 +228,7 @@ const processRows = ref(createProcessRows());
const currentStep = ref(1);
const briefOpen = ref(false);
const checking = ref(false);
const saving = ref(false);
const draftReady = ref(false);
const checkResult = ref(null);
const stepOnePassed = ref(false);
@ -618,6 +627,47 @@ function exportOutcome() {
URL.revokeObjectURL(url);
proxy?.$modal?.msgSuccess("导出成功");
}
function prevStep() {
if (currentStep.value > 1) {
currentStep.value -= 1;
}
}
async function saveCurrentProgress() {
if (saving.value || uploadingGantt.value) return;
saving.value = true;
try {
let payload;
if (currentStep.value === 1) {
payload = { step1Answer: JSON.stringify(buildOutcome()), currentStep: 1, submitted: false, saveAction: "SAVE" };
} else if (currentStep.value === 2) {
payload = { step2Answer: JSON.stringify(buildStepTwoOutcome()), currentStep: 2, submitted: false, saveAction: "SAVE" };
} else if (currentStep.value === 3) {
payload = { step3Answer: JSON.stringify(buildStepThreeOutcome()), currentStep: 3, submitted: false, saveAction: "SAVE" };
} else {
payload = { step4Answer: JSON.stringify(buildStepFourOutcome()), currentStep: 4, submitted: false, saveAction: "SAVE" };
}
await saveStudentTrainingAnswer(TASK_KEY, payload);
clearDraft();
proxy?.$modal?.msgSuccess("保存成功");
} catch (error) {
proxy?.$modal?.msgError?.(error?.message || "保存失败,请稍后重试");
} finally {
saving.value = false;
}
}
async function nextStep() {
if (checking.value || saving.value) return;
if (currentStep.value === 1) {
await saveAndGoToStepTwo();
} else if (currentStep.value === 2) {
await saveAndGoToStepThree();
} else if (currentStep.value === 3) {
await saveAndGoToStepFour();
}
}
</script>
<style lang="scss" scoped>
@ -1052,6 +1102,173 @@ tr.is-incorrect .classification-feedback {
box-shadow: none;
}
/* ============================================================
* 底部步骤导航:上一步 / 保存当前进度 / 下一步
* ============================================================ */
.step-navigation {
position: relative;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 10px;
margin-top: 16px;
padding: 12px 16px;
border: 1px solid var(--student-panel-border);
border-radius: 10px;
background: #ffffff;
}
.step-nav-left,
.step-nav-right {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: nowrap;
}
.step-nav-right {
margin-left: auto;
}
.btn-primary {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-height: 36px;
height: 36px;
padding: 0 14px;
border: 1px solid var(--student-accent);
border-radius: 8px;
color: #ffffff;
background: var(--student-accent);
font-family: inherit;
font-size: 13px;
font-weight: 600;
box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2), 0 2px 8px rgba(37, 99, 235, 0.15);
cursor: pointer;
transition: all 0.16s ease;
white-space: nowrap;
.el-icon {
font-size: 14px;
}
&:hover:not(:disabled) {
border-color: var(--student-accent-deep);
background: var(--student-accent-deep);
transform: translateY(-1px);
box-shadow: 0 2px 6px rgba(29, 78, 216, 0.3), 0 4px 12px rgba(29, 78, 216, 0.22);
}
&:active:not(:disabled) {
transform: translateY(0);
}
}
.btn-ghost {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-height: 36px;
height: 36px;
padding: 0 14px;
border: 1px solid rgba(37, 99, 235, 0.35);
border-radius: 8px;
color: var(--student-accent);
background: #ffffff;
font-family: inherit;
font-size: 13px;
font-weight: 600;
cursor: pointer;
transition: all 0.16s ease;
white-space: nowrap;
.el-icon {
font-size: 14px;
}
&:hover:not(:disabled) {
border-color: var(--student-accent);
background: var(--student-accent-soft);
transform: translateY(-1px);
box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
}
}
.btn-save {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
min-height: 36px;
height: 36px;
padding: 0 14px;
border: 1px solid #e5e7eb;
border-radius: 8px;
color: #4b5563;
background: #f9fafb;
font-family: inherit;
font-size: 13px;
font-weight: 600;
cursor: pointer;
transition: all 0.16s ease;
white-space: nowrap;
.el-icon {
font-size: 14px;
}
&:hover:not(:disabled) {
border-color: #d1d5db;
background: #f3f4f6;
}
}
.btn-primary:disabled,
.btn-ghost:disabled,
.btn-save:disabled {
cursor: not-allowed;
opacity: 0.5;
transform: none;
box-shadow: none;
}
.step-progress {
color: var(--student-text-secondary);
font-family: var(--student-font-data);
font-size: 11px;
font-weight: 700;
letter-spacing: 0.05em;
white-space: nowrap;
}
@media (max-width: 1100px) {
.step-nav-right {
margin-left: 0;
}
}
@media (max-width: 900px) {
.step-navigation {
flex-direction: column;
align-items: stretch;
}
.step-nav-left,
.step-nav-right {
justify-content: center;
}
.btn-primary,
.btn-ghost,
.btn-save {
width: 100%;
}
}
/* 空步骤占位 */
.step-placeholder {
display: grid;

@ -24,13 +24,6 @@
</section>
<section class="after-sales-workbench">
<div class="workbench-head">
<div>
<p class="section-eyebrow">After-sales diagnostic routing</p>
<h2>售后故障类型分类</h2>
</div>
</div>
<nav class="step-indicator" aria-label="售后服务流程设计步骤">
<template v-for="(step, index) in trainingSteps" :key="`${step}-${index}`">
<button type="button" :class="['step-tab', { active: currentStep === index + 1, complete: currentStep > index + 1 }]" @click="switchStep(index + 1)">
@ -613,15 +606,6 @@ function exportOutcome() { const blob = new Blob([JSON.stringify({ currentStep:
box-shadow: none;
}
.workbench-head {
display: flex;
align-items: flex-start;
gap: 16px;
margin: 0;
padding: 0;
border-bottom: 0;
}
.section-eyebrow {
margin: 0;
color: var(--student-accent);
@ -631,14 +615,6 @@ function exportOutcome() { const blob = new Blob([JSON.stringify({ currentStep:
text-transform: uppercase;
}
.workbench-head h2 {
margin: 4px 0 0;
color: var(--student-text);
font-size: var(--student-fs-h1);
font-weight: 700;
line-height: 1.35;
}
/* ===== step-card:透明化 ===== */
.step-card {
padding: 0;

@ -24,13 +24,6 @@
</section>
<section class="hardware-workbench">
<div class="workbench-head hardware-workbench-head">
<div>
<p class="section-eyebrow">BOM cost workspace</p>
<h2>智能硬件成本估算</h2>
</div>
</div>
<nav class="step-indicator" aria-label="智能硬件成本估算步骤">
<button type="button" :class="['step-tab', { active: currentStep === 1, complete: currentStep > 1 }]" aria-label="切换至第 1 步:BOM 物料选型" :aria-current="currentStep === 1 ? 'step' : undefined" @click="currentStep = 1">
<span class="step-marker" aria-hidden="true">01</span>
@ -54,13 +47,6 @@
</nav>
<section v-if="currentStep === 1" class="step-card hardware-step-card">
<div class="workbench-head">
<div>
<p class="section-eyebrow">Step 01 · BOM selection</p>
<h2>核心元器件选型组合</h2>
</div>
</div>
<section class="cost-brief">
<span class="cost-brief__index">01</span>
<p>在目标成本约束下,权衡性能与成本,为每个元器件选择合适档位。请基于案例资料中的"元器件选型库",完成核心元器件的选型组合。</p>
@ -112,11 +98,7 @@
</section>
<section v-else-if="currentStep === 2" class="step-card hardware-step-card">
<div class="workbench-head">
<div>
<p class="section-eyebrow">Step 02 · Volume costing</p>
<h2>批量成本核算与约束验证</h2>
</div>
<div class="step-title-actions">
<button type="button" class="btn-nav" :disabled="exporting || !costRows.length" @click="exportStepTwo">{{ exporting ? "导出中…" : "导出成本核算表" }}</button>
</div>
<section class="cost-brief">
@ -175,11 +157,7 @@
</section>
<section v-else-if="currentStep === 3" class="step-card hardware-step-card">
<div class="workbench-head">
<div>
<p class="section-eyebrow">Step 03 · Manufacturing costing</p>
<h2>制造费用与单件总成本核算</h2>
</div>
<div class="step-title-actions">
<button type="button" class="btn-nav" :disabled="exportingStepThree" @click="exportStepThree">
{{ exportingStepThree ? "导出中…" : "导出单件总成本表" }}
</button>
@ -234,11 +212,7 @@
</section>
<section v-else class="step-card hardware-step-card">
<div class="workbench-head">
<div>
<p class="section-eyebrow">Step 04 · Cost optimisation</p>
<h2>成本结构可视化与优化决策</h2>
</div>
<div class="step-title-actions">
<span class="step-chip">以第 2、3 步核算结果为依据</span>
</div>
@ -952,7 +926,7 @@ onMounted(async () => {
gap: 14px;
}
.workbench-head,
.step-title-actions,
.step-title-row,
.bom-toolbar,
.task-actions {
@ -962,14 +936,7 @@ onMounted(async () => {
gap: 14px;
}
.workbench-head { margin-bottom: 4px; }
.workbench-head h2 {
margin: 4px 0 0;
color: var(--student-text);
font-size: var(--student-fs-h1);
font-weight: 700;
line-height: 1.35;
}
.step-title-actions { justify-content: flex-end; margin-bottom: 4px; }
.step-card {
padding: 0;

@ -24,13 +24,6 @@
</section>
<section class="task-card">
<div class="workbench-head">
<div>
<p class="section-eyebrow">{{ currentStep === 3 ? 'PRD document delivery' : currentStep === 2 ? 'PRD detailed specification' : 'PRD module matching' }}</p>
<h2>{{ currentStep === 3 ? '生成并提交产品需求文档' : currentStep === 2 ? '填写 PRD 七大模块详细信息' : '认识 PRD 的核心模块' }}</h2>
</div>
</div>
<nav class="step-indicator" aria-label="产品需求文档撰写步骤">
<template v-for="(step, index) in trainingSteps" :key="`${step}-${index}`">
<button
@ -683,21 +676,6 @@ function exportOutcome() { if (currentStep.value === 2) { exportStepTwoTable();
gap: 10px;
}
.workbench-head {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 16px;
}
.workbench-head h2 {
margin: 4px 0 0;
color: var(--student-text);
font-size: var(--student-fs-h1);
font-weight: 700;
line-height: 1.35;
}
.section-eyebrow {
margin: 0;
color: var(--student-accent);
@ -1380,7 +1358,6 @@ function exportOutcome() { if (currentStep.value === 2) { exportStepTwoTable();
.matching-workspace { grid-template-columns: 1fr; }
.purpose-bank { position: static; }
.purpose-card-list { max-height: 360px; }
.workbench-head { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 680px) {

@ -1,564 +1,429 @@
<template>
<div v-loading="loading" class="student-home app-container">
<el-alert v-if="loadError" class="load-error" type="error" :title="loadError" :closable="false" show-icon />
<el-card class="dashboard-card score-card">
<template #header>
<div class="card-header">
<span>我的实训成绩</span>
<small>按当前教学班发布的实训模块统计</small>
</div>
</template>
<div v-if="!loadError" class="score-layout">
<section class="score-visual" aria-label="模块成绩分布">
<div ref="scoreChartRef" class="score-chart"></div>
<div class="score-summary">
<div class="score-metric score-metric--ai">
<span class="summary-label">AI评分</span>
<strong>{{ formatScore(aiScore) }}</strong>
<span class="summary-unit">分</span>
</div>
</div>
</section>
<section class="score-table-wrap" aria-label="模块成绩明细">
<el-table :data="displayModules" stripe border class="score-table" empty-text="暂无实训模块">
<el-table-column type="index" label="序号" width="64" align="center" />
<el-table-column prop="moduleName" label="实训模块" min-width="280" />
<el-table-column label="成绩占比" width="116" align="center">
<template #default="scope">{{ formatWeight(scope.row.weight) }}</template>
</el-table-column>
<el-table-column label="模块得分" width="110" align="center">
<template #default="scope">{{ formatScore(scope.row.score) }}</template>
</el-table-column>
<el-table-column label="完成进度" width="138" align="center">
<template #default="scope">{{ progressText(scope.row) }}</template>
</el-table-column>
</el-table>
</section>
<div v-loading="loading" class="student-home app-container">
<el-alert
v-if="loadError"
class="load-error"
type="error"
:title="loadError"
:closable="false"
show-icon
/>
<el-card class="dashboard-card score-card">
<template #header>
<div class="card-header">
<span>我的实训成绩</span>
<small>按当前教学班发布的实训模块统计</small>
</div>
</template>
<div v-if="!loadError" class="score-layout">
<section class="score-visual" aria-label="模块成绩分布">
<div ref="scoreChartRef" class="score-chart"></div>
<div class="score-summary">
<div class="score-metric score-metric--ai">
<span class="summary-label">AI评分</span>
<strong>{{ formatScore(aiScore) }}</strong>
<span class="summary-unit">分</span>
</div>
</el-card>
<el-card class="dashboard-card progress-card">
<template #header>
<div class="card-header">
<span>实训进度概览</span>
<small>项目学习时长与任务完成进度对比</small>
</div>
</template>
<div v-if="!loadError" class="progress-layout">
<section class="learning-time" aria-label="有效学习时间">
<div class="time-orbit">
<div class="time-value">{{ studyHours }}</div>
<div class="time-unit">HRS</div>
</div>
<strong>有效学习时间</strong>
<span>累计投入 {{ totalStudyMinutes }} 分钟</span>
</section>
<section class="study-time-chart-wrap" aria-label="项目学习时长">
<div ref="studyTimeChartRef" class="study-time-chart"></div>
</section>
<section class="progress-chart-wrap" aria-label="模块任务完成情况">
<div ref="progressChartRef" class="progress-chart"></div>
</section>
<div class="score-metric score-metric--teacher">
<span class="summary-label">老师评分</span>
<strong>{{ formatTeacherScore(teacherScore) }}</strong>
<span v-if="hasTeacherScore(teacherScore)" class="summary-unit">分</span>
</div>
</el-card>
</div>
</div>
</section>
<section class="score-table-wrap" aria-label="模块成绩明细">
<el-table :data="displayModules" stripe border class="score-table" empty-text="暂无实训模块">
<el-table-column type="index" label="序号" width="64" align="center" />
<el-table-column prop="moduleName" label="实训模块" min-width="280" />
<el-table-column label="成绩占比" width="116" align="center">
<template #default="scope">{{ formatWeight(scope.row.weight) }}</template>
</el-table-column>
<el-table-column label="模块得分" width="110" align="center">
<template #default="scope">{{ formatScore(scope.row.score) }}</template>
</el-table-column>
<el-table-column label="完成进度" width="138" align="center">
<template #default="scope">{{ progressText(scope.row) }}</template>
</el-table-column>
</el-table>
</section>
</div>
</el-card>
<el-card class="dashboard-card progress-card">
<template #header>
<div class="card-header">
<span>实训进度概览</span>
<small>项目学习时长与任务完成进度对比</small>
</div>
</template>
<div v-if="!loadError" class="progress-layout">
<section class="learning-time" aria-label="有效学习时间">
<div class="time-orbit">
<div class="time-value">{{ studyHours }}</div>
<div class="time-unit">HRS</div>
</div>
<strong>有效学习时间</strong>
<span>累计投入 {{ totalStudyMinutes }} 分钟</span>
</section>
<section class="study-time-chart-wrap" aria-label="项目学习时长">
<div ref="studyTimeChartRef" class="study-time-chart"></div>
</section>
<section class="progress-chart-wrap" aria-label="模块任务完成情况">
<div ref="progressChartRef" class="progress-chart"></div>
</section>
</div>
</el-card>
</div>
</template>
<script setup>
import * as echarts from "echarts"
import useUserStore from "@/store/modules/user"
import * as indexApi from "@/api/index"
import { getCurrentProjectStudyTime } from "@/api/projectStudyTime"
const userStore = useUserStore()
const scoreChartRef = ref(null)
const studyTimeChartRef = ref(null)
const progressChartRef = ref(null)
const report = ref({ totalScore: 0, modules: [] })
const projectStudyTimes = ref([])
const loading = ref(true)
const loadError = ref("")
const MODULE_COLORS = ["#1d4ed8", "#2563eb", "#3b82f6", "#60a5fa", "#93c5fd", "#bfdbfe"]
let scoreChart
let studyTimeChart
let progressChart
const displayModules = computed(() => report.value.modules || [])
const aiScore = computed(() => report.value.aiAssessmentScore ?? report.value.aiScore ?? report.value.totalScore)
const teacherScore = computed(() => report.value.teacherScore)
import * as echarts from "echarts";
import useUserStore from "@/store/modules/user";
import * as indexApi from "@/api/index";
import { getCurrentProjectStudyTime } from "@/api/projectStudyTime";
const userStore = useUserStore();
const scoreChartRef = ref(null);
const studyTimeChartRef = ref(null);
const progressChartRef = ref(null);
const report = ref({ totalScore: 0, modules: [] });
const projectStudyTimes = ref([]);
const loading = ref(true);
const loadError = ref("");
const MODULE_COLORS = ["#1d4ed8", "#2563eb", "#3b82f6", "#60a5fa", "#93c5fd", "#bfdbfe"];
let scoreChart;
let studyTimeChart;
let progressChart;
const displayModules = computed(() => report.value.modules || []);
const aiScore = computed(() => report.value.aiAssessmentScore ?? report.value.aiScore ?? report.value.totalScore);
const teacherScore = computed(() => report.value.teacherScore);
const studySecondsByProject = computed(() => Object.fromEntries(
projectStudyTimes.value.map((item) => [item.projectName, Number(item.studySeconds) || 0])
))
projectStudyTimes.value.map((item) => [item.projectName, Number(item.studySeconds) || 0])
));
const displayStudyProjects = computed(() => {
const knownProjects = displayModules.value.map((module) => module.moduleName)
const extraProjects = projectStudyTimes.value.map((item) => item.projectName).filter((name) => !knownProjects.includes(name))
return [...knownProjects, ...extraProjects].map((projectName) => ({
projectName,
studySeconds: studySecondsByProject.value[projectName] || 0,
}))
})
const knownProjects = displayModules.value.map((module) => module.moduleName);
const extraProjects = projectStudyTimes.value.map((item) => item.projectName).filter((name) => !knownProjects.includes(name));
return [...knownProjects, ...extraProjects].map((projectName) => ({
projectName,
studySeconds: studySecondsByProject.value[projectName] || 0,
}));
});
const totalStudyMinutes = computed(() => Math.round(
displayStudyProjects.value.reduce((total, item) => total + item.studySeconds, 0) / 60
))
displayStudyProjects.value.reduce((total, item) => total + item.studySeconds, 0) / 60
));
const studyHours = computed(() => (totalStudyMinutes.value / 60).toFixed(1))
const studyHours = computed(() => (totalStudyMinutes.value / 60).toFixed(1));
const formatScore = (value) => Number(value || 0).toFixed(2).replace(/\.00$/, "")
const hasTeacherScore = (value) => value !== null && value !== undefined && value !== ""
const formatTeacherScore = (value) => hasTeacherScore(value) ? formatScore(value) : "待评阅"
const formatWeight = (weight) => `${(Number(weight || 0) * 100).toFixed(0)}%`
const moduleColor = (index) => MODULE_COLORS[index % MODULE_COLORS.length]
const formatScore = (value) => Number(value || 0).toFixed(2).replace(/\.00$/, "");
const hasTeacherScore = (value) => value !== null && value !== undefined && value !== "";
const formatTeacherScore = (value) => hasTeacherScore(value) ? formatScore(value) : "待评阅";
const formatWeight = (weight) => `${(Number(weight || 0) * 100).toFixed(0)}%`;
const moduleColor = (index) => MODULE_COLORS[index % MODULE_COLORS.length];
const progressPercent = (module) => {
const total = Number(module.totalTaskCount) || 0
const completed = Number(module.completedTaskCount) || 0
return total > 0 ? Math.min(100, Math.round((completed / total) * 100)) : 0
}
const progressText = (module) => `${Number(module.completedTaskCount) || 0}/${Number(module.totalTaskCount) || 0}`
const total = Number(module.totalTaskCount) || 0;
const completed = Number(module.completedTaskCount) || 0;
return total > 0 ? Math.min(100, Math.round((completed / total) * 100)) : 0;
};
const progressText = (module) => `${Number(module.completedTaskCount) || 0}/${Number(module.totalTaskCount) || 0}`;
const renderScoreChart = () => {
if (!scoreChartRef.value) return
scoreChart = scoreChart || echarts.init(scoreChartRef.value)
scoreChart.setOption({
tooltip: { trigger: "item", valueFormatter: (value) => `${formatScore(value)} 分` },
legend: { orient: "vertical", right: 8, top: "middle", itemWidth: 12, itemHeight: 12 },
series: [{
name: "模块得分",
type: "pie",
radius: ["42%", "72%"],
center: ["34%", "50%"],
avoidLabelOverlap: true,
label: { show: false },
labelLine: { show: false },
data: displayModules.value.map((module, index) => ({
name: module.moduleName,
value: Number(module.score) || 0,
itemStyle: { color: moduleColor(index) }
}))
}]
}, true)
}
if (!scoreChartRef.value) return;
scoreChart = scoreChart || echarts.init(scoreChartRef.value);
scoreChart.setOption({
tooltip: { trigger: "item", valueFormatter: (value) => `${formatScore(value)} 分` },
legend: { orient: "vertical", right: 8, top: "middle", itemWidth: 12, itemHeight: 12 },
series: [{
name: "模块得分",
type: "pie",
radius: ["42%", "72%"],
center: ["34%", "50%"],
avoidLabelOverlap: true,
label: { show: false },
labelLine: { show: false },
data: displayModules.value.map((module, index) => ({
name: module.moduleName,
value: Number(module.score) || 0,
itemStyle: { color: moduleColor(index) }
}))
}]
}, true);
};
const renderProgressChart = () => {
if (!progressChartRef.value) return
progressChart = progressChart || echarts.init(progressChartRef.value)
const modules = displayModules.value
progressChart.setOption({
tooltip: { trigger: "axis", axisPointer: { type: "shadow" } },
legend: { top: 0, data: ["已完成", "待完成"] },
grid: { left: 24, right: 24, top: 40, bottom: 22, containLabel: true },
xAxis: { type: "value", minInterval: 1 },
yAxis: {
type: "category",
inverse: true,
axisLabel: { width: 132, overflow: "truncate" },
data: modules.map((module) => module.moduleName)
},
series: [
{
name: "已完成",
type: "bar",
stack: "tasks",
barMaxWidth: 18,
itemStyle: { color: "#2563eb", borderRadius: [9, 0, 0, 9] },
data: modules.map((module) => Number(module.completedTaskCount) || 0)
},
{
name: "待完成",
type: "bar",
stack: "tasks",
barMaxWidth: 18,
itemStyle: { color: "#dbeafe", borderRadius: [0, 9, 9, 0] },
data: modules.map((module) => Math.max(0, (Number(module.totalTaskCount) || 0) - (Number(module.completedTaskCount) || 0)))
}
]
}, true)
}
if (!progressChartRef.value) return;
progressChart = progressChart || echarts.init(progressChartRef.value);
const modules = displayModules.value;
progressChart.setOption({
tooltip: { trigger: "axis", axisPointer: { type: "shadow" } },
legend: { top: 0, data: ["已完成", "待完成"] },
grid: { left: 24, right: 24, top: 40, bottom: 22, containLabel: true },
xAxis: { type: "value", minInterval: 1 },
yAxis: {
type: "category",
inverse: true,
axisLabel: { width: 132, overflow: "truncate" },
data: modules.map((module) => module.moduleName)
},
series: [
{
name: "已完成",
type: "bar",
stack: "tasks",
barMaxWidth: 18,
itemStyle: { color: "#2563eb", borderRadius: [9, 0, 0, 9] },
data: modules.map((module) => Number(module.completedTaskCount) || 0)
},
{
name: "待完成",
type: "bar",
stack: "tasks",
barMaxWidth: 18,
itemStyle: { color: "#dbeafe", borderRadius: [0, 9, 9, 0] },
data: modules.map((module) => Math.max(0, (Number(module.totalTaskCount) || 0) - (Number(module.completedTaskCount) || 0)))
}
]
}, true);
};
const renderStudyTimeChart = () => {
if (!studyTimeChartRef.value) return
studyTimeChart = studyTimeChart || echarts.init(studyTimeChartRef.value)
const projects = displayStudyProjects.value
studyTimeChart.setOption({
tooltip: {
trigger: "axis",
axisPointer: { type: "shadow" },
valueFormatter: (value) => `${(Number(value) || 0).toFixed(1)} 分钟`,
},
grid: { left: 24, right: 24, top: 36, bottom: 22, containLabel: true },
xAxis: { type: "value", name: "分钟", minInterval: 1 },
yAxis: {
type: "category",
inverse: true,
axisLabel: { width: 136, overflow: "truncate" },
data: projects.map((item) => item.projectName),
},
series: [{
name: "学习时长",
type: "bar",
barMaxWidth: 18,
itemStyle: { color: "#3b82f6", borderRadius: [0, 9, 9, 0] },
data: projects.map((item) => Number((item.studySeconds / 60).toFixed(1))),
}],
}, true)
}
if (!studyTimeChartRef.value) return;
studyTimeChart = studyTimeChart || echarts.init(studyTimeChartRef.value);
const projects = displayStudyProjects.value;
studyTimeChart.setOption({
tooltip: {
trigger: "axis",
axisPointer: { type: "shadow" },
valueFormatter: (value) => `${(Number(value) || 0).toFixed(1)} 分钟`,
},
grid: { left: 24, right: 24, top: 36, bottom: 22, containLabel: true },
xAxis: { type: "value", name: "分钟", minInterval: 1 },
yAxis: {
type: "category",
inverse: true,
axisLabel: { width: 136, overflow: "truncate" },
data: projects.map((item) => item.projectName),
},
series: [{
name: "学习时长",
type: "bar",
barMaxWidth: 18,
itemStyle: { color: "#3b82f6", borderRadius: [0, 9, 9, 0] },
data: projects.map((item) => Number((item.studySeconds / 60).toFixed(1))),
}],
}, true);
};
const renderCharts = () => {
renderScoreChart()
renderStudyTimeChart()
renderProgressChart()
}
renderScoreChart();
renderStudyTimeChart();
renderProgressChart();
};
const resizeCharts = () => {
scoreChart?.resize()
studyTimeChart?.resize()
progressChart?.resize()
}
scoreChart?.resize();
studyTimeChart?.resize();
progressChart?.resize();
};
const loadDashboard = async () => {
loading.value = true
loadError.value = ""
const [reportResult, projectStudyTimeResult] = await Promise.allSettled([
indexApi.getCurrentExperimentReport(),
getCurrentProjectStudyTime(),
])
if (reportResult.status !== "fulfilled") {
loadError.value = "新版实训报告加载失败,请刷新页面后重试。"
loading.value = false
return
}
report.value = reportResult.value?.data || { totalScore: 0, modules: [] }
projectStudyTimes.value = projectStudyTimeResult.status === "fulfilled" && Array.isArray(projectStudyTimeResult.value?.data)
? projectStudyTimeResult.value.data
: []
loading.value = false
await nextTick()
renderCharts()
}
loading.value = true;
loadError.value = "";
const [reportResult, projectStudyTimeResult] = await Promise.allSettled([
indexApi.getCurrentExperimentReport(),
getCurrentProjectStudyTime(),
]);
if (reportResult.status !== "fulfilled") {
loadError.value = "新版实训报告加载失败,请刷新页面后重试。";
loading.value = false;
return;
}
report.value = reportResult.value?.data || { totalScore: 0, modules: [] };
projectStudyTimes.value = projectStudyTimeResult.status === "fulfilled" && Array.isArray(projectStudyTimeResult.value?.data)
? projectStudyTimeResult.value.data
: [];
loading.value = false;
await nextTick();
renderCharts();
};
onMounted(() => {
window.addEventListener("resize", resizeCharts)
loadDashboard()
})
window.addEventListener("resize", resizeCharts);
loadDashboard();
});
onBeforeUnmount(() => {
window.removeEventListener("resize", resizeCharts)
scoreChart?.dispose()
studyTimeChart?.dispose()
progressChart?.dispose()
})
window.removeEventListener("resize", resizeCharts);
scoreChart?.dispose();
studyTimeChart?.dispose();
progressChart?.dispose();
});
</script>
<style lang="scss" scoped>
.student-home {
min-height: calc(100vh - 70px);
background: #ffffff;
padding: 0;
min-height: calc(100vh - 70px);
background: #ffffff;
padding: 0;
}
.load-error {
margin-bottom: 12px;
}
.load-error { margin-bottom: 12px; }
.dashboard-card {
margin-bottom: 14px;
border: 1px solid #e5e7eb;
box-shadow: 0 2px 10px rgba(17, 24, 39, 0.05);
:deep(.el-card__header) {
padding: 13px 16px;
border-bottom: 1px solid #e5e7eb;
}
margin-bottom: 14px;
border: 1px solid #e5e7eb;
box-shadow: 0 2px 10px rgba(17, 24, 39, 0.05);
:deep(.el-card__header) { padding: 13px 16px; border-bottom: 1px solid #e5e7eb; }
}
.card-header {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 12px;
span {
color: #1f2937;
font-size: 15px;
font-weight: 700;
}
small {
color: #9ca3af;
font-size: 12px;
}
}
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 12px;
.score-layout {
display: grid;
grid-template-columns: minmax(520px, 0.95fr) minmax(760px, 1.35fr);
min-height: 330px;
span { color: #1f2937; font-size: 15px; font-weight: 700; }
small { color: #9ca3af; font-size: 12px; }
}
.score-layout { display: grid; grid-template-columns: minmax(520px, 0.95fr) minmax(760px, 1.35fr); min-height: 330px; }
.score-visual {
position: relative;
display: flex;
min-width: 0;
border-right: 1px dashed #e5e7eb;
position: relative;
display: flex;
min-width: 0;
border-right: 1px dashed #e5e7eb;
}
.score-chart {
width: 100%;
min-height: 330px;
}
.score-chart { width: 100%; min-height: 330px; }
/* 评分摘要竖排居中于环形图圆心(34%, 50%),避免覆盖圆环图形 */
.score-summary {
position: absolute;
left: 34%;
top: 50%;
transform: translate(-50%, -50%);
display: flex;
align-items: center;
gap: 18px;
flex-wrap: nowrap;
white-space: nowrap;
color: #72809a;
pointer-events: none;
strong {
font-size: 26px;
line-height: 1;
}
.summary-unit {
font-weight: 600;
}
}
.score-metric {
display: inline-flex;
align-items: baseline;
gap: 4px;
}
.score-metric--ai {
color: #1d4ed8;
}
.score-metric--teacher {
color: #6b7280;
}
.summary-label {
font-size: 12px;
font-weight: 600;
}
.score-table-wrap {
display: flex;
align-items: center;
min-width: 0;
overflow-x: auto;
padding: 8px 0 8px 24px;
}
.score-table {
width: 100%;
min-width: 760px;
}
.score-table :deep(.el-table__cell) {
white-space: nowrap;
}
position: absolute;
left: 34%;
top: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
white-space: nowrap;
text-align: center;
color: #72809a;
strong { font-size: 26px; line-height: 1; }
.summary-unit { font-weight: 600; }
}
.score-metric { display: inline-flex; align-items: baseline; gap: 4px; }
.score-metric--ai { color: #1d4ed8; }
.score-metric--teacher { color: #6b7280; }
.score-metric--teacher strong { font-size: 20px; }
.summary-label { font-size: 12px; font-weight: 600; }
.score-table-wrap { display: flex; align-items: center; min-width: 0; overflow-x: auto; padding: 8px 0 8px 24px; }
.score-table { width: 100%; min-width: 760px; }
.score-table :deep(.el-table__cell) { white-space: nowrap; }
/* 成绩表:纯白底 + 中性灰边框,无蓝色/斑马重色 */
.score-table :deep(th.el-table__cell) {
color: #1f2937;
background: #ffffff;
border-color: #e5e7eb;
font-size: 12px;
font-weight: 700;
color: #1f2937;
background: #ffffff;
border-color: #e5e7eb;
font-size: 12px;
font-weight: 700;
}
.score-table :deep(td.el-table__cell) {
color: #374151;
border-color: #e5e7eb;
font-size: 12px;
color: #374151;
border-color: #e5e7eb;
font-size: 12px;
}
.score-table :deep(.el-table__row--striped td.el-table__cell) {
background: #fafbfc;
background: #fafbfc;
}
.score-table :deep(.el-table__body tr:hover > td.el-table__cell) {
background: #f3f4f6;
background: #f3f4f6;
}
.progress-layout {
display: grid;
grid-template-columns: 190px minmax(370px, 1fr) minmax(370px, 1fr);
gap: 24px;
align-items: stretch;
}
.progress-layout { display: grid; grid-template-columns: 190px minmax(370px, 1fr) minmax(370px, 1fr); gap: 24px; align-items: stretch; }
.learning-time {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 270px;
color: #1f2937;
border: 1px solid #e5e7eb;
border-radius: 14px;
background: #fafbfc;
strong {
margin-top: 16px;
font-size: 14px;
font-weight: 800;
}
span {
margin-top: 6px;
font-size: 12px;
color: #6b7280;
}
}
.time-orbit {
display: grid;
place-content: center;
width: 108px;
height: 108px;
text-align: center;
border: 3px solid #2563eb;
border-radius: 50%;
box-shadow: inset 0 0 0 7px #eff6ff;
}
.time-value {
font-size: 25px;
font-weight: 800;
line-height: 1;
}
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 270px;
color: #1f2937;
border: 1px solid #e5e7eb;
border-radius: 14px;
background: #fafbfc;
.time-unit {
margin-top: 5px;
font-size: 12px;
letter-spacing: 0.08em;
color: #6b7280;
strong { margin-top: 16px; font-size: 14px; font-weight: 800; }
span { margin-top: 6px; font-size: 12px; color: #6b7280; }
}
.study-time-chart-wrap,
.progress-chart-wrap {
min-width: 0;
.time-orbit {
display: grid;
place-content: center;
width: 108px;
height: 108px;
text-align: center;
border: 3px solid #2563eb;
border-radius: 50%;
box-shadow: inset 0 0 0 7px #eff6ff;
}
.study-time-chart,
.progress-chart {
min-height: 270px;
width: 100%;
}
.time-value { font-size: 25px; font-weight: 800; line-height: 1; }
.time-unit { margin-top: 5px; font-size: 12px; letter-spacing: 0.08em; color: #6b7280; }
.study-time-chart-wrap, .progress-chart-wrap { min-width: 0; }
.study-time-chart, .progress-chart { min-height: 270px; width: 100%; }
.module-progress-list {
display: flex;
flex-direction: column;
justify-content: center;
gap: 14px;
min-width: 0;
padding: 8px 4px;
display: flex;
flex-direction: column;
justify-content: center;
gap: 14px;
min-width: 0;
padding: 8px 4px;
}
.module-progress-item {
min-width: 0;
}
.module-progress-head {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 7px;
color: #6f7b91;
font-size: 13px;
}
.module-progress-head strong {
flex: 1;
overflow: hidden;
color: #273858;
font-size: 14px;
text-overflow: ellipsis;
white-space: nowrap;
}
.module-color {
flex: 0 0 auto;
width: 8px;
height: 8px;
border-radius: 50%;
}
.module-progress-item { min-width: 0; }
.module-progress-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; color: #6f7b91; font-size: 13px; }
.module-progress-head strong { flex: 1; overflow: hidden; color: #273858; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.module-color { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; }
@media (max-width: 1320px) {
.score-layout {
grid-template-columns: 1fr;
}
.score-visual {
border-bottom: 1px dashed #e5e7eb;
}
.score-table-wrap {
padding: 20px 0 0;
}
.progress-layout {
grid-template-columns: 180px 1fr;
}
.progress-chart-wrap {
grid-column: 1 / -1;
}
.score-layout { grid-template-columns: 1fr; }
.score-visual { border-bottom: 1px dashed #e5e7eb; }
.score-table-wrap { padding: 20px 0 0; }
.progress-layout { grid-template-columns: 180px 1fr; }
.progress-chart-wrap { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
.student-home {
padding: 12px;
}
.card-header {
align-items: flex-start;
flex-direction: column;
}
.score-visual {
min-height: 290px;
}
.score-chart {
min-height: 290px;
}
.score-summary {
left: 18px;
top: 18px;
}
.progress-layout {
grid-template-columns: 1fr;
}
.learning-time {
min-height: 210px;
}
.progress-chart-wrap {
grid-column: auto;
}
.student-home { padding: 12px; }
.card-header { align-items: flex-start; flex-direction: column; }
.score-visual { min-height: 290px; }
.score-chart { min-height: 290px; }
.score-summary { gap: 4px; strong { font-size: 22px; } }
.score-metric--teacher strong { font-size: 16px; }
.progress-layout { grid-template-columns: 1fr; }
.learning-time { min-height: 210px; }
.progress-chart-wrap { grid-column: auto; }
}
</style>
@ -569,10 +434,10 @@ onBeforeUnmount(() => {
* 此处仅保留 padding 清零与外层 .index 的 margin 清零,使首页内容贴边。
*/
#app .studentLayout section.app-main:has(.student-home) {
padding: 0 !important;
padding: 0 !important;
}
#app .studentLayout .app-main:has(.student-home) .index {
margin: 0 !important;
margin: 0 !important;
}
</style>

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save