diff --git a/.cursor/skills/ink-training-theme/SKILL.md b/.cursor/skills/ink-training-theme/SKILL.md new file mode 100644 index 0000000..b604190 --- /dev/null +++ b/.cursor/skills/ink-training-theme/SKILL.md @@ -0,0 +1,1420 @@ +--- +name: ink-training-theme +description: Apply ink-minimal style to student training pages (Vue 3 + Element Plus). Use when restyling student pages, sidebar el-menu, step tabs, buttons, tables, or type scale in this repo. Do not use for admin pages or business-logic changes. +--- + +# 教育蓝极简 · 学生实训页设计规范 + +本技能用于把学生端实训页(`.student-training-shell` 体系)统一为 +「教育蓝极简」风格:纯白画布、教育蓝主操作、中性灰文字层次、紧凑排版。 +**教育蓝标准样例:`src/views/foundation/new-product-survey.vue`** +(根类 `.new-product-value-page.student-training-shell`); +**步骤导航**以本规范「步骤导航:按钮切换风」一节为准, +**左侧课程菜单**换肤见「侧边栏 el-menu 教育蓝换肤」与「折叠把手」两节。 + +> **注意**:`src/views/foundation/product-development-process.vue` 一页仍沿用旧「墨黑极简」, +> 属遗留页面。新页面一律按本文档教育蓝极简落地。 + +## 边界 + +- 只动 template 结构与样式;script 业务逻辑(判题/保存/草稿/上传/接口)一律不碰。 +- 仅作用于当前页根类,不得影响其他页面;**但必须同步修改全局 + `src/assets/styles/student-training.scss`**(见下一节「全局 !important 覆盖 + 机制」),否则页面样式会被带 `!important` 的旧蓝色规则碾压。 +- 表格类内容区不铺任何底色,对错只靠文字反馈,不靠行背景。 + +## 选择器边界(防污染教师端/超管端) + +### 必须遵守的规则 + +**改全局 `student-training.scss` 时,所有视觉样式选择器必须以以下锚点开头 +之一——否则会漏到教师端或超管端的普通页面:** + +| 安全锚点 | 覆盖范围 | +| ------------------------------------------------------------ | ------------------------------------------------------------- | +| `.student-training-shell` | **实训页面专用容器类**(学生端 + 教师端预览共用,是实训风格) | +| `#app .studentLayout .app-main:has(.xxx-page)` | 精确限定在学生端某个路由页面 | +| `#app .teacherLayout .app-main:has(.student-training-shell)` | 限定在教师端预览实训页面(如需差异化) | + +**危险锚点(绝对不能用)**: + +| 危险选择器 | 后果 | +| -------------------------------------------- | -------------------------------------------------------------- | +| `.el-button { ... }` | 污染全站所有 Element Plus 按钮(教师端/超管端/学生端都会被改) | +| `.btn-primary { ... }` | 同上 | +| `.task-actions { ... }` (裸写,不带前置锚) | 教师端/超管端如果也有 `.task-actions` 类就会被改 | +| `button.outline-action { ... }` (裸写) | 全站所有 outline-action 按钮被改 | +| `:root { --xxx: ... }` (视觉令牌) | CSS 自定义属性会全局继承,但字体/字号/间距这类无害 | + +**项目实际验证**: + +- 教师端 `views/teacher/**/*.vue` 和超管端 `views/admin/**/*.vue` 均不直接使用 + `.student-training-shell` 类 +- 教师端预览学生实训页面时,才会通过布局嵌套间接使用 +- **超管端完全不涉及实训模块**,所以以 `.student-training-shell` 为锚点最安全 + +### 页面非 scoped 块的边界 + +每个页面自己写的非 scoped ` +``` + +### 改色判定原则(防误改) + +| 场景 | 教育蓝页处理 | 例子 | +| ----------------------------------- | ------------------------- | -------------------------------------------------- | +| `#1f2937` 作**文字色** | ✅ 保留 | `dimension-cell / classification-selling-point` 等 | +| `#1f2937` 作**实底/描边/聚焦/阴影** | ❌ 改 `#2563eb` | 按钮、步骤胶囊、textarea focus | +| `#f3f4f6` 作 accent-soft | ❌ 改 `#eff6ff` | 徽章底、hover 底 | +| `#f3f4f6` 作**三级 save 按钮底** | ✅ 保留 | `.btn-save` 灰色中性保留 | +| 品牌阴影 `rgba(31,41,55,*)` | ❌ 改 `rgba(37,99,235,*)` | 主按钮投影 | +| 极淡中性阴影 `rgba(17,24,39,.04)` | ✅ 保留 | 卡片影 | +| 语义红 `#d9554c` | ❌ 改 `#ef4444` | 判题错、删除 | +| 语义绿 `#4a9d6e / #3f8a5f` | ❌ 改 `#2ba471 / #16915f` | 判题对、完成态 | + +### teacher-light.scss 特异性修复(必做) + +全局有一条 `body.student-light-mode .el-button:not(.is-text)...` 高特异性(0,8,1)规则把默认按钮强制锁为墨黑。在 `teacher-light.scss` L2781 的 `:not()` 链加: + +```scss +:not(.task-toolbar-button): not(.material-button); +``` + +否则页面自己的教育蓝按钮样式无法生效。 + +### 后续 29 页批量改色模板 + +本页是教育蓝落地的**参考基准**。后续墨黑页统一改色时: + +1. **令牌块**:直接替换为上述教育蓝令牌(含 EP 变量) +2. **共用组件换肤**:复制上述非 scoped 覆盖(task-toolbar-button / material-button / submit) +3. **步骤导航**:如果有步骤导航,复制分段胶囊三态 +4. **底部按钮**:复制 step-navigation + btn-nav 规格 +5. **特有元素**:task-head-top 脉动状态、step-chip 小胶囊、section-eyebrow 眉标 + 按需添加(可无) +6. **表格**:three-layer 页加 layer-legend 色条 + layer-core/tangible/extended 竖条 +7. **业务逻辑**:script 一字不动 diff --git a/src/views/assessment/diagnosis.vue b/src/views/assessment/diagnosis.vue index a3e7359..4496b48 100644 --- a/src/views/assessment/diagnosis.vue +++ b/src/views/assessment/diagnosis.vue @@ -348,15 +348,15 @@ onMounted(async () => { try { taskConfig.value = (await getTrainingTaskByKey(TAS diff --git a/src/views/assessment/optimization.vue b/src/views/assessment/optimization.vue index 48e06c1..b24ce7c 100644 --- a/src/views/assessment/optimization.vue +++ b/src/views/assessment/optimization.vue @@ -410,15 +410,15 @@ onMounted(async () => { diff --git a/src/views/channel/purchase.vue b/src/views/channel/purchase.vue index 896343c..3d342c2 100644 --- a/src/views/channel/purchase.vue +++ b/src/views/channel/purchase.vue @@ -7,186 +7,148 @@ * @Description: 卡拉杰克模型分析页面,展示采购品类矩阵 --> - + + diff --git a/src/views/channel/supplier.vue b/src/views/channel/supplier.vue index 6c3b532..d9f1520 100644 --- a/src/views/channel/supplier.vue +++ b/src/views/channel/supplier.vue @@ -3,7 +3,10 @@
- 核心实训 · 供应渠道评估 +
+ 核心实训 · 供应渠道评估 + 进行中 · Step {{ String(currentStep).padStart(2, "0") }} +

{{ taskTitle }}

{{ taskBackground }} @@ -535,22 +538,32 @@ onMounted(async () => { + + diff --git a/src/views/product/differentiation.vue b/src/views/product/differentiation.vue index a36a6cf..80ab36a 100644 --- a/src/views/product/differentiation.vue +++ b/src/views/product/differentiation.vue @@ -3,9 +3,12 @@

-
- - 市场洞察与需求分析 +
+ + + 市场洞察与需求分析 + + 进行中 · Step {{ String(form.activeStep).padStart(2, "0") }}

{{ taskTitle }}

@@ -771,6 +774,41 @@ async function handleValueCanvasUpload(event) { flex: 1 1 auto; } +/* task-head-top:badge + 脉动状态横排 */ +.task-head-top { + display: flex; + align-items: center; + gap: 10px; + flex-wrap: nowrap; +} + +.task-status { + display: inline-flex; + align-items: center; + gap: 5px; + padding: 3px 10px; + border-radius: 999px; + color: var(--student-text-secondary); + background: #f3f4f6; + font-size: var(--student-fs-caption); + font-weight: 600; + white-space: nowrap; + + &::before { + content: ""; + width: 6px; + height: 6px; + border-radius: 50%; + background: var(--student-accent-light); + animation: pulse 1.8s ease-in-out infinite; + } +} + +@keyframes pulse { + 0%, 100% { opacity: 0.4; } + 50% { opacity: 1; } +} + .task-badge { display: inline-flex; align-items: center; diff --git a/src/views/product/index.vue b/src/views/product/index.vue index 8974a6d..d0016c4 100644 --- a/src/views/product/index.vue +++ b/src/views/product/index.vue @@ -2,54 +2,61 @@

-
产品规划与设计
-

{{ taskTitle }}

-
- - - -
-
-
- - +
+
+ + + 核心实训 · 产品规划与设计 + + 进行中 · Step {{ String(currentStep).padStart(2, "0") }}
+

{{ taskTitle }}

+

+ {{ taskBackground }} + + + 实训目标 +

  • {{ goal }}
+ 实训要求 +

{{ taskRequirement }}

+ +

+
+ + +
+
+
@@ -222,10 +229,9 @@ + + diff --git a/src/views/product/market-opportunity-selection.vue b/src/views/product/market-opportunity-selection.vue index ec5b3f8..2d9a9a2 100644 --- a/src/views/product/market-opportunity-selection.vue +++ b/src/views/product/market-opportunity-selection.vue @@ -3,7 +3,10 @@
- 核心实训 · 市场洞察与需求分析 +
+ 核心实训 · 市场洞察与需求分析 + 进行中 · Step {{ String(currentStep).padStart(2, "0") }} +

{{ taskTitle }}

{{ taskBackground }} @@ -340,6 +343,41 @@ function exportOutcome() { const blob = new Blob([JSON.stringify({ taskName: tas flex: 1 1 auto; } +/* task-head-top:badge + 脉动状态横排 */ +.task-head-top { + display: flex; + align-items: center; + gap: 10px; + flex-wrap: nowrap; +} + +.task-status { + display: inline-flex; + align-items: center; + gap: 5px; + padding: 3px 10px; + border-radius: 999px; + color: var(--student-text-secondary); + background: #f3f4f6; + font-size: var(--student-fs-caption); + font-weight: 600; + white-space: nowrap; + + &::before { + content: ""; + width: 6px; + height: 6px; + border-radius: 50%; + background: var(--student-accent-light); + animation: pulse 1.8s ease-in-out infinite; + } +} + +@keyframes pulse { + 0%, 100% { opacity: 0.4; } + 50% { opacity: 1; } +} + .task-brief { margin: 0; color: var(--student-text-secondary); diff --git a/src/views/product/price.vue b/src/views/product/price.vue index 14cc576..9f2623b 100644 --- a/src/views/product/price.vue +++ b/src/views/product/price.vue @@ -3,7 +3,10 @@

- 核心实训 · 新产品定价 +
+ 核心实训 · 新产品定价 + 进行中 · Step {{ String(currentStep).padStart(2, "0") }} +

{{ taskTitle }}

{{ taskBackground }} @@ -1548,22 +1551,32 @@ onMounted(async () => { diff --git a/src/views/test/index.vue b/src/views/test/index.vue index bc13f8f..ebed1a6 100644 --- a/src/views/test/index.vue +++ b/src/views/test/index.vue @@ -283,15 +283,15 @@ onMounted(async () => { try { const result = await getTrainingTaskByKey(TASK_KEY diff --git a/src/views/test/promotion.vue b/src/views/test/promotion.vue index d8239a1..7d32ad5 100644 --- a/src/views/test/promotion.vue +++ b/src/views/test/promotion.vue @@ -293,15 +293,15 @@ onMounted(async () => { try { const result = await getTrainingTaskByKey(TASK_KEY