style: 移除各页面冗余的页面画布和行高样式,统一全局样式管理

1.  移除了20+个页面内单独编写的app-main背景覆盖和行高样式代码
2.  仅保留学生首页的padding和margin清零调整,背景渐变由student-training.scss统一管理
3.  简化代码结构,将页面样式统一收敛到全局配置,减少重复代码
fix/exam-question-access-material-excel-delete-draft
qinzhenpen 3 weeks ago
parent b17d47caa6
commit 29b2a35661

@ -85,7 +85,8 @@
* layout's older black gradient as a vertical block beside the sidebar. * layout's older black gradient as a vertical block beside the sidebar.
*/ */
#app .studentLayout .app-main:has(.student-training-shell), #app .studentLayout .app-main:has(.student-training-shell),
#app .teacherLayout .app-main:has(.student-training-shell) { #app .teacherLayout .app-main:has(.student-training-shell),
#app .studentLayout .app-main:has(.student-home) {
background: linear-gradient(135deg, #f5f8fc 0%, #eaf2fb 52%, #f3f8ff 100%) !important; background: linear-gradient(135deg, #f5f8fc 0%, #eaf2fb 52%, #f3f8ff 100%) !important;
} }

@ -337,16 +337,3 @@ onMounted(() => {
} }
} }
</style> </style>
<style lang="scss">
/* 非 scoped:覆盖祖先 app-main 画布(浅蓝渐变),本页纯白 */
#app .studentLayout .app-main:has(.stu-analysis-page),
#app .teacherLayout .app-main:has(.stu-analysis-page) {
background: #ffffff !important;
}
#app .studentLayout .app-main:has(.stu-analysis-page) .stu-analysis-page,
#app .teacherLayout .app-main:has(.stu-analysis-page) .stu-analysis-page {
line-height: 1.55 !important;
}
</style>

@ -673,11 +673,3 @@ const exportData = () => {
} }
} }
</style> </style>
<style lang="scss">
/* 非 scoped:覆盖祖先 app-main 浅蓝渐变画布,本页纯白 */
#app .studentLayout .app-main:has(.ai-dialogue-page),
#app .teacherLayout .app-main:has(.ai-dialogue-page) {
background: #ffffff !important;
}
</style>

@ -1079,14 +1079,6 @@ button.is-disabled {
</style> </style>
<style lang="scss"> <style lang="scss">
/* ===== 画布 + 行高 ===== */
#app .studentLayout .app-main:has(.diagnosis-page) {
background: #ffffff !important;
}
#app .studentLayout .app-main:has(.diagnosis-page) .diagnosis-page {
line-height: 1.55 !important;
}
/* ===== 步骤导航:按钮切换风 ===== */ /* ===== 步骤导航:按钮切换风 ===== */
#app .studentLayout section.app-main:has(.diagnosis-page) .step-indicator { #app .studentLayout section.app-main:has(.diagnosis-page) .step-indicator {
display: flex !important; display: flex !important;

@ -1102,14 +1102,6 @@ button:disabled {
</style> </style>
<style lang="scss"> <style lang="scss">
/* ===== 画布 + 行高 ===== */
#app .studentLayout .app-main:has(.optimization-page) {
background: #ffffff !important;
}
#app .studentLayout .app-main:has(.optimization-page) .optimization-page {
line-height: 1.55 !important;
}
/* ===== 步骤导航:按钮切换风 ===== */ /* ===== 步骤导航:按钮切换风 ===== */
#app .studentLayout section.app-main:has(.optimization-page) .step-indicator { #app .studentLayout section.app-main:has(.optimization-page) .step-indicator {
display: flex !important; display: flex !important;

@ -955,14 +955,6 @@ onMounted(async () => {
</style> </style>
<style lang="scss"> <style lang="scss">
/* ===== 画布 + 行高 ===== */
#app .studentLayout .app-main:has(.supplier-page) {
background: #ffffff !important;
}
#app .studentLayout .app-main:has(.supplier-page) .supplier-page {
line-height: 1.55 !important;
}
/* ===== 步骤导航:按钮切换风 ===== */ /* ===== 步骤导航:按钮切换风 ===== */
#app .studentLayout section.app-main:has(.supplier-page) .step-indicator { #app .studentLayout section.app-main:has(.supplier-page) .step-indicator {
display: flex !important; display: flex !important;

@ -1046,15 +1046,6 @@ th:last-child, td:last-child { border-right: 0; }
</style> </style>
<style lang="scss"> <style lang="scss">
/* 画布背景:纯白,去旧浅蓝渐变 */
#app .studentLayout section.app-main:has(.feasibility-page) {
background: #ffffff !important;
}
#app .studentLayout section.app-main:has(.feasibility-page) .feasibility-page {
line-height: 1.55 !important;
}
/* ===== 步骤导航:按钮切换风(foundation 同款) ===== */ /* ===== 步骤导航:按钮切换风(foundation 同款) ===== */
#app .studentLayout section.app-main:has(.feasibility-page) .step-indicator { #app .studentLayout section.app-main:has(.feasibility-page) .step-indicator {
display: flex !important; display: flex !important;

@ -654,14 +654,6 @@ function exportOutcome() { const blob = new Blob([JSON.stringify(buildDraft(), n
</style> </style>
<style lang="scss"> <style lang="scss">
/* ===== 画布 + 行高 ===== */
#app .studentLayout .app-main:has(.competitive-analysis-page) {
background: #ffffff !important;
}
#app .studentLayout .app-main:has(.competitive-analysis-page) .competitive-analysis-page {
line-height: 1.55 !important;
}
/* ===== 步骤导航:按钮切换风 ===== */ /* ===== 步骤导航:按钮切换风 ===== */
#app .studentLayout section.app-main:has(.competitive-analysis-page) .step-indicator { #app .studentLayout section.app-main:has(.competitive-analysis-page) .step-indicator {
display: flex !important; display: flex !important;

@ -1762,11 +1762,6 @@ function downloadSurveyReportTemplate() {
</style> </style>
<style lang="scss"> <style lang="scss">
/* === 画布背景 === */
#app .studentLayout section.app-main:has(.consumer-behavior-page) {
background: #ffffff !important;
}
/* === 步骤导航:按钮切换风(foundation 同款) === */ /* === 步骤导航:按钮切换风(foundation 同款) === */
#app .studentLayout section.app-main:has(.consumer-behavior-page) .step-indicator { #app .studentLayout section.app-main:has(.consumer-behavior-page) .step-indicator {
display: flex !important; display: flex !important;

@ -1669,14 +1669,6 @@ function exportOutcome() {
</style> </style>
<style lang="scss"> <style lang="scss">
/* ===== 画布 + 行高 ===== */
#app .studentLayout .app-main:has(.consumer-scenario-page) {
background: #ffffff !important;
}
#app .studentLayout .app-main:has(.consumer-scenario-page) .consumer-scenario-page {
line-height: 1.55 !important;
}
/* ===== 步骤导航:按钮切换风 ===== */ /* ===== 步骤导航:按钮切换风 ===== */
#app .studentLayout section.app-main:has(.consumer-scenario-page) .step-indicator { #app .studentLayout section.app-main:has(.consumer-scenario-page) .step-indicator {
display: flex !important; display: flex !important;

@ -1375,14 +1375,6 @@ function exportOutcome() {
</style> </style>
<style lang="scss"> <style lang="scss">
/* ===== 画布 + 行高 ===== */
#app .studentLayout .app-main:has(.feature-conversion-page) {
background: #ffffff !important;
}
#app .studentLayout .app-main:has(.feature-conversion-page) .feature-conversion-page {
line-height: 1.55 !important;
}
/* ===== 步骤导航:按钮切换风 ===== */ /* ===== 步骤导航:按钮切换风 ===== */
#app .studentLayout section.app-main:has(.feature-conversion-page) .step-indicator { #app .studentLayout section.app-main:has(.feature-conversion-page) .step-indicator {
display: flex !important; display: flex !important;

@ -666,14 +666,6 @@ function exportOutcome() { const blob = new Blob([JSON.stringify(buildDraft(), n
</style> </style>
<style lang="scss"> <style lang="scss">
/* ===== 画布 + 行高 ===== */
#app .studentLayout .app-main:has(.industry-pest-page) {
background: #ffffff !important;
}
#app .studentLayout .app-main:has(.industry-pest-page) .industry-pest-page {
line-height: 1.55 !important;
}
/* ===== 步骤导航:按钮切换风 ===== */ /* ===== 步骤导航:按钮切换风 ===== */
#app .studentLayout section.app-main:has(.industry-pest-page) .step-indicator { #app .studentLayout section.app-main:has(.industry-pest-page) .step-indicator {
display: flex !important; display: flex !important;

@ -1942,11 +1942,6 @@ function exportOutcome() {
* 带 !important 锁定浅蓝,必须在页面非 scoped 块中覆盖) * 带 !important 锁定浅蓝,必须在页面非 scoped 块中覆盖)
* ========================================================== --> * ========================================================== -->
<style lang="scss"> <style lang="scss">
/* 画布:纯白,去渐变 */
#app .studentLayout section.app-main:has(.target-profile-page) {
background: #ffffff !important;
}
/* ===== 步骤导航:按钮切换风(foundation 同款) ===== */ /* ===== 步骤导航:按钮切换风(foundation 同款) ===== */
#app .studentLayout section.app-main:has(.target-profile-page) .step-indicator { #app .studentLayout section.app-main:has(.target-profile-page) .step-indicator {
display: flex !important; display: flex !important;

@ -259,13 +259,3 @@ function count(value){return value==="ALL"?exams.value.length:exams.value.filter
} }
} }
</style> </style>
<style lang="scss">
/* 页面画布:纯白,无渐变 */
#app .studentLayout .app-main:has(.student-exams) {
background: #ffffff !important;
}
#app .studentLayout .app-main:has(.student-exams) .student-exams {
line-height: 1.55 !important;
}
</style>

@ -261,13 +261,3 @@ aside {
} }
} }
</style> </style>
<style lang="scss">
/* 页面画布:纯白,无渐变 */
#app .studentLayout .app-main:has(.result-page) {
background: #ffffff !important;
}
#app .studentLayout .app-main:has(.result-page) .result-page {
line-height: 1.55 !important;
}
</style>

@ -384,13 +384,3 @@ function formatTime(v){return v?new Date(v).toLocaleString("zh-CN",{hour12:false
} }
} }
</style> </style>
<style lang="scss">
/* 页面画布:纯白,无渐变 */
#app .studentLayout .app-main:has(.take-page) {
background: #ffffff !important;
}
#app .studentLayout .app-main:has(.take-page) .take-page {
line-height: 1.55 !important;
}
</style>

@ -1960,16 +1960,6 @@ function exportOutcome() {
所有选择器均以 .new-product-value-page 为根,不影响其他页面。 所有选择器均以 .new-product-value-page 为根,不影响其他页面。
--> -->
<style lang="scss"> <style lang="scss">
/* 页面画布:纯白,不使用任何底色渐变 */
#app .studentLayout .app-main:has(.new-product-value-page) {
background: #ffffff !important;
}
/* 全局 shell 行高为 1.8,本页收紧为 1.55(选择器特异性对齐全局规则) */
#app .studentLayout .app-main:has(.new-product-value-page) .new-product-value-page {
line-height: 1.55 !important;
}
/* ============================================================ /* ============================================================
* 步骤导航重设计:按钮切换风(分段按钮 + 墨黑激活) * 步骤导航重设计:按钮切换风(分段按钮 + 墨黑激活)
* id 锚点 + !important 覆盖全局浅蓝胶囊与杂志风旧规则。 * id 锚点 + !important 覆盖全局浅蓝胶囊与杂志风旧规则。

@ -934,17 +934,6 @@ function exportOutcome() {
</style> </style>
<style lang="scss"> <style lang="scss">
/* 页面画布:纯白,不使用任何底色渐变(scoped 无法触及祖先 app-main) */
#app .studentLayout section.app-main:has(.product-factors) {
background: #ffffff !important;
background-image: none !important;
}
/* 全局 shell 行高 1.8,本页收紧为 1.55 */
#app .studentLayout .app-main:has(.product-factors) .product-factors {
line-height: 1.55 !important;
}
/* ===== AI 侧栏样式已收敛进 TrainingAiSidebar 组件(墨黑极简),此处不再覆盖 ===== */ /* ===== AI 侧栏样式已收敛进 TrainingAiSidebar 组件(墨黑极简),此处不再覆盖 ===== */
/* ============================================================ /* ============================================================

@ -1359,17 +1359,6 @@ tr.is-incorrect .classification-feedback {
</style> </style>
<style lang="scss"> <style lang="scss">
/* 页面画布:纯白,不使用任何底色渐变(scoped 无法触及祖先 app-main) */
#app .studentLayout section.app-main:has(.product-process) {
background: #ffffff !important;
background-image: none !important;
}
/* 全局 shell 行高 1.8,本页收紧为 1.55 */
#app .studentLayout .app-main:has(.product-process) .product-process {
line-height: 1.55 !important;
}
/* ===== AI 侧栏样式已收敛进 TrainingAiSidebar 组件(墨黑极简),此处不再覆盖 ===== */ /* ===== AI 侧栏样式已收敛进 TrainingAiSidebar 组件(墨黑极简),此处不再覆盖 ===== */
/* ============================================================ /* ============================================================

@ -1156,14 +1156,6 @@ button:disabled {
</style> </style>
<style lang="scss"> <style lang="scss">
/* ===== 画布白底 + 1.55 行高 ===== */
#app .studentLayout .app-main:has(.after-sales-page) {
background: #ffffff !important;
}
#app .studentLayout .app-main:has(.after-sales-page) .after-sales-page {
line-height: 1.55 !important;
}
/* ===== 步骤导航:按钮切换风(覆盖全局 !important 浅蓝胶囊) ===== */ /* ===== 步骤导航:按钮切换风(覆盖全局 !important 浅蓝胶囊) ===== */
#app .studentLayout section.app-main:has(.after-sales-page) .step-indicator { #app .studentLayout section.app-main:has(.after-sales-page) .step-indicator {
display: flex !important; display: flex !important;

@ -1432,14 +1432,6 @@ async function handleValueCanvasUpload(event) {
</style> </style>
<style lang="scss"> <style lang="scss">
/* ===== 画布 + 行高 ===== */
#app .studentLayout .app-main:has(.product-positioning-page) {
background: #ffffff !important;
}
#app .studentLayout .app-main:has(.product-positioning-page) .product-positioning-page {
line-height: 1.55 !important;
}
/* ===== 步骤导航:按钮切换风 ===== */ /* ===== 步骤导航:按钮切换风 ===== */
#app .studentLayout section.app-main:has(.product-positioning-page) .step-indicator { #app .studentLayout section.app-main:has(.product-positioning-page) .step-indicator {
display: flex !important; display: flex !important;

@ -1422,14 +1422,6 @@ onMounted(async () => {
</style> </style>
<style lang="scss"> <style lang="scss">
/* ===== 画布 + 行高 ===== */
#app .studentLayout .app-main:has(.hardware-cost-page) {
background: #ffffff !important;
}
#app .studentLayout .app-main:has(.hardware-cost-page) .hardware-cost-page {
line-height: 1.55 !important;
}
/* ===== 步骤导航:按钮切换风 ===== */ /* ===== 步骤导航:按钮切换风 ===== */
#app .studentLayout section.app-main:has(.hardware-cost-page) .step-indicator { #app .studentLayout section.app-main:has(.hardware-cost-page) .step-indicator {
display: flex !important; display: flex !important;

@ -798,14 +798,6 @@ function exportOutcome() { const blob = new Blob([JSON.stringify({ taskName: tas
</style> </style>
<style lang="scss"> <style lang="scss">
/* ===== 画布 + 行高 ===== */
#app .studentLayout .app-main:has(.opportunity-page) {
background: #ffffff !important;
}
#app .studentLayout .app-main:has(.opportunity-page) .opportunity-page {
line-height: 1.55 !important;
}
/* ===== 步骤导航:按钮切换风 ===== */ /* ===== 步骤导航:按钮切换风 ===== */
#app .studentLayout section.app-main:has(.opportunity-page) .step-indicator { #app .studentLayout section.app-main:has(.opportunity-page) .step-indicator {
display: flex !important; display: flex !important;

@ -2325,14 +2325,6 @@ onMounted(async () => {
</style> </style>
<style lang="scss"> <style lang="scss">
/* ===== 画布 + 行高 ===== */
#app .studentLayout .app-main:has(.price-page) {
background: #ffffff !important;
}
#app .studentLayout .app-main:has(.price-page) .price-page {
line-height: 1.55 !important;
}
/* ===== 步骤导航:按钮切换风 ===== */ /* ===== 步骤导航:按钮切换风 ===== */
#app .studentLayout section.app-main:has(.price-page) .step-indicator { #app .studentLayout section.app-main:has(.price-page) .step-indicator {
display: flex !important; display: flex !important;

@ -1397,14 +1397,6 @@ function exportOutcome() { if (currentStep.value === 2) { exportStepTwoTable();
</style> </style>
<style lang="scss"> <style lang="scss">
/* ===== 画布 + 行高 ===== */
#app .studentLayout .app-main:has(.requirements-doc-page) {
background: #ffffff !important;
}
#app .studentLayout .app-main:has(.requirements-doc-page) .requirements-doc-page {
line-height: 1.55 !important;
}
/* ===== 步骤导航:按钮切换风 ===== */ /* ===== 步骤导航:按钮切换风 ===== */
#app .studentLayout section.app-main:has(.requirements-doc-page) .step-indicator { #app .studentLayout section.app-main:has(.requirements-doc-page) .step-indicator {
display: flex !important; display: flex !important;

@ -1148,14 +1148,6 @@ button:disabled {
</style> </style>
<style lang="scss"> <style lang="scss">
/* ===== 画布 + 行高 ===== */
#app .studentLayout .app-main:has(.architecture-page) {
background: #ffffff !important;
}
#app .studentLayout .app-main:has(.architecture-page) .architecture-page {
line-height: 1.55 !important;
}
/* ===== 步骤导航:按钮切换风 ===== */ /* ===== 步骤导航:按钮切换风 ===== */
#app .studentLayout section.app-main:has(.architecture-page) .step-indicator { #app .studentLayout section.app-main:has(.architecture-page) .step-indicator {
display: flex !important; display: flex !important;

@ -424,15 +424,12 @@ onBeforeUnmount(() => {
<style lang="scss"> <style lang="scss">
/* /*
* 学生首页贴边纯白(scoped 无法触及祖先,故放在非 scoped 块): * 学生首页贴边布局(scoped 无法触及祖先,故放在非 scoped 块):
* 1) app-main 深蓝背景图/渐变 → 纯白,padding 清零; * 背景渐变由全局 student-training.scss 统一提供(.app-main:has(.student-home));
* 2) 外层 .index 的 10px margin 清零,内容贴边。 * 此处仅保留 padding 清零与外层 .index 的 margin 清零,使首页内容贴边。
* 选择器以 .student-home :has 为锚,不影响其他角色/页面。
*/ */
#app .studentLayout section.app-main:has(.student-home) { #app .studentLayout section.app-main:has(.student-home) {
padding: 0 !important; padding: 0 !important;
background: #ffffff !important;
background-image: none !important;
} }
#app .studentLayout .app-main:has(.student-home) .index { #app .studentLayout .app-main:has(.student-home) .index {

@ -108,12 +108,4 @@ onMounted(async()=>{const res=await getCurrentExperimentReport(); report.value=r
</style> </style>
<style lang="scss"> <style lang="scss">
/* 墨黑极简 · 纯白画布覆盖(scoped 触及不到祖先画布) */
#app .studentLayout .app-main:has(.test-report) {
background: #ffffff !important;
}
#app .studentLayout .app-main:has(.test-report) .test-report {
line-height: 1.55 !important;
}
</style> </style>

@ -405,6 +405,17 @@ onMounted(async () => { try { const result = await getTrainingTaskByKey(TASK_KEY
.release-channel-toolbar { .release-channel-toolbar {
flex: 0 0 auto; flex: 0 0 auto;
width: 320px;
:deep(.material-actions) {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
}
:deep(.material-button) {
width: 100%;
}
} }
/* ===== task-card:透明容器 ===== */ /* ===== task-card:透明容器 ===== */
@ -673,14 +684,6 @@ onMounted(async () => { try { const result = await getTrainingTaskByKey(TASK_KEY
</style> </style>
<style lang="scss"> <style lang="scss">
/* ===== 画布 + 行高 ===== */
#app .studentLayout .app-main:has(.release-channel-page) {
background: #ffffff !important;
}
#app .studentLayout .app-main:has(.release-channel-page) .release-channel-page {
line-height: 1.55 !important;
}
/* ===== 步骤条:按钮切换风 ===== */ /* ===== 步骤条:按钮切换风 ===== */
#app .studentLayout section.app-main:has(.release-channel-page) .step-tabs { #app .studentLayout section.app-main:has(.release-channel-page) .step-tabs {
display: flex !important; display: flex !important;

@ -713,14 +713,6 @@ onMounted(async () => { try { const result = await getTrainingTaskByKey(TASK_KEY
</style> </style>
<style lang="scss"> <style lang="scss">
/* ===== 画布 + 行高 ===== */
#app .studentLayout .app-main:has(.promotion-page) {
background: #ffffff !important;
}
#app .studentLayout .app-main:has(.promotion-page) .promotion-page {
line-height: 1.55 !important;
}
/* ===== 步骤导航:按钮切换风 ===== */ /* ===== 步骤导航:按钮切换风 ===== */
#app .studentLayout section.app-main:has(.promotion-page) .step-indicator { #app .studentLayout section.app-main:has(.promotion-page) .step-indicator {
display: flex !important; display: flex !important;

@ -3912,13 +3912,4 @@ function exportOutcome() {
</style> </style>
<style lang="scss"> <style lang="scss">
/* 墨黑极简 · 纯白画布覆盖(scoped 触及不到祖先画布;用 id + 页面根类双类锚点压过全局浅蓝渐变) */
#app .studentLayout .app-main:has(.student-training-page.student-training-shell),
#app .teacherLayout .app-main:has(.student-training-page.student-training-shell) {
background: #ffffff !important;
}
#app .studentLayout .app-main:has(.student-training-page.student-training-shell) .student-training-page {
line-height: 1.55 !important;
}
</style> </style>

Loading…
Cancel
Save