= {
dashboard: { title: '工作台', desc: '培训运营总览、待办与达成率一览' },
plan: { title: '培训计划', desc: '年度培训需求收集与汇总(可切换年度)' },
course: { title: '培训课程', desc: '课程资产库、场次安排与学员名单;课件自动同步知识库' },
- sign: { title: '课堂签到', desc: '签到码生成、签到明细复核与佐证导出' },
+ sign: { title: '培训签到', desc: '签到码生成、签到明细复核与佐证导出' },
study: { title: '学习考试', desc: '我的课程学习、课程学习情况、课程考试情况与 AI 课程分析' },
members: { title: '职称角色', desc: '名册来自「组织架构」,此处维护员工职称角色' },
rules: { title: '配置中心', desc: '培训业务规则在线配置,改配置不改代码' },
@@ -111,7 +111,7 @@ const isAdmin = computed(() =>
myRoles.value.some((r) => r === 'hr') ||
authStore.hasRole('admin'))
-// 培训管理页签(培训计划/培训课程/课堂签到)门槛:课长/经理/人事/讲师
+// 培训管理页签(培训计划/培训课程/培训签到)门槛:课长/经理/人事/讲师
// (myRoles 已按权限组展开,自定义角色继承系统角色后自动生效)。
const canManageTabs = computed(() =>
isAdmin.value ||
diff --git a/frontend/src/views/training/components/CourseAIAnalysis.vue b/frontend/src/views/training/components/CourseAIAnalysis.vue
index 64e6099..e54a442 100644
--- a/frontend/src/views/training/components/CourseAIAnalysis.vue
+++ b/frontend/src/views/training/components/CourseAIAnalysis.vue
@@ -22,7 +22,7 @@
- 汇总{{ scopeHint }}的课程学习、考试成绩、课堂签到与错题情况,由大模型生成本次分析报告与指导建议。
+ 汇总{{ scopeHint }}的课程学习、考试成绩、培训签到与错题情况,由大模型生成本次分析报告与指导建议。
分析约需数十秒,请耐心等待。
diff --git a/frontend/src/views/training/components/CourseCatalog.vue b/frontend/src/views/training/components/CourseCatalog.vue
index 36aa146..81654d3 100644
--- a/frontend/src/views/training/components/CourseCatalog.vue
+++ b/frontend/src/views/training/components/CourseCatalog.vue
@@ -24,11 +24,12 @@
+ 待维护 = 我主讲且「草稿」状态的课程数(2026-11 需求;>0 时用与「草稿」一致的橙色提醒)。
+ 待开始 = 已排期且开课时间未到的课程数(按「我的课程」口径:我主讲/我参加,2026-11 需求)。 -->
{{ statsText }}
待维护 {{ maintainCount }} 门
+ 待开始 {{ pendingStartCount }} 门
@@ -181,10 +182,19 @@ const myTeachingCourses = computed(() => {
return [...map.values()]
})
-// 待维护 = 我任讲师且未发布(草稿/待审)、或已发布但未上传课件的课程
-// (线上课发布强制有课件,实际命中的多为线下课:学员通知在课件上传前不会推送)
+// 「我的课程」数据源:我相关的已发布课 + 我任讲师的课(含未发布,按 id 去重);
+// 页签列表与「待开始」统计共用同一口径。
+const myCoursesSource = computed(() => {
+ const minePublished = publishedCourses.value.filter(isMyCourse)
+ const mineIds = new Set(minePublished.map((c) => c.id))
+ return [...minePublished, ...myTeachingCourses.value.filter((c) => !mineIds.has(c.id))]
+})
+
+// 待维护 = 我主讲且「草稿」状态的课程(2026-11 需求:待审/已发布缺课件不再计入统计)
+const maintainCount = computed(() => myTeachingCourses.value.filter((c) => c.status === 'draft').length)
+
+// 置顶排序/维护按钮仍关注未发布(草稿/待审)或已发布但未上传课件的课程
const needsMaintain = (c: TrainingCourse) => c.status !== 'published' || !c.material_ids?.length
-const maintainCount = computed(() => myTeachingCourses.value.filter(needsMaintain).length)
// 线下课排期索引:取最近一场排期/已完成场次汇总
const sessionByCourse = computed(() => {
@@ -197,6 +207,13 @@ const sessionByCourse = computed(() => {
return map
})
+// [2026-11 需求] 待开始 = 已排期且开课时间还没到的课程(按「我的课程」口径统计)
+const hasUpcomingSession = (c: TrainingCourse) =>
+ (sessionByCourse.value.get(c.id) || []).some(
+ (s) => s.status === 'scheduled' && !!s.start_at && new Date(s.start_at).getTime() > Date.now(),
+ )
+const pendingStartCount = computed(() => myCoursesSource.value.filter(hasUpcomingSession).length)
+
const typeText = (c: TrainingCourse) => (c.type === 'elective' ? '选修' : '必修')
const fmtMonthDay = (raw: string | null) => {
if (!raw) return ''
@@ -247,11 +264,7 @@ const visibleCards = computed(() => {
const kw = keyword.value.trim().toLowerCase()
// 数据源:全部/线上/线下 = 已发布目录;我的课程 = 我相关的已发布课 + 我任讲师的课(含未发布,已发布的按 id 去重)
let source = publishedCourses.value
- if (filter.value === 'mine') {
- const minePublished = publishedCourses.value.filter(isMyCourse)
- const mineIds = new Set(minePublished.map((c) => c.id))
- source = [...minePublished, ...myTeachingCourses.value.filter((c) => !mineIds.has(c.id))]
- }
+ if (filter.value === 'mine') source = myCoursesSource.value
let list = source.filter((c) => {
if (filter.value === 'online' && c.mode !== 'online') return false
if (filter.value === 'offline' && c.mode !== 'offline') return false
@@ -259,7 +272,7 @@ const visibleCards = computed(() => {
if (kw && !(c.name.toLowerCase().includes(kw) || (c.tags || []).some((t) => String(t).toLowerCase().includes(kw)))) return false
return true
})
- // [2026-11 需求] 「我的课程」排序:待维护(我主讲未发布/缺课件)置顶,
+ // [2026-11 需求] 「我的课程」排序:需关注的课程(我主讲未发布/缺课件)置顶,
// 其余按与当前时间的邻近度升序(临近开课/结课的在前,无时间锚点的排最后)
if (filter.value === 'mine') {
const now = Date.now()
@@ -440,6 +453,16 @@ onMounted(loadAll)
font-weight: 600;
}
}
+
+ // 待开始统计:与「已排期」状态同色(品牌色)
+ &__pending {
+ margin-left: 6px;
+
+ &.is-info {
+ color: var(--td-brand-color);
+ font-weight: 600;
+ }
+ }
}
.catalog-grid-wrap {
diff --git a/frontend/src/views/training/components/CoursePanel.vue b/frontend/src/views/training/components/CoursePanel.vue
index ccb5cfa..baa4deb 100644
--- a/frontend/src/views/training/components/CoursePanel.vue
+++ b/frontend/src/views/training/components/CoursePanel.vue
@@ -32,7 +32,9 @@
- {{ row.name }}
+
+ {{ row.name }}
+
{{ row.mode === 'online' ? '线上' : '线下' }}
@@ -536,6 +538,11 @@ const goStudyStatus = (row: TrainingCourse, section: 'learning' | 'exam') => {
router.push({ path: '/platform/training/study', query: { section, courseId: row.id } })
}
+// 课程名称点击 → 培训签到页,携带 courseId 自动选中该课程的场次
+const goSignTab = (row: TrainingCourse) => {
+ router.push({ path: '/platform/training/sign', query: { courseId: row.id } })
+}
+
const loading = ref(false)
const saving = ref(false)
const courses = ref([])
@@ -1766,15 +1773,17 @@ watch(() => route.query.courseId, openDetailFromRoute)
overflow-wrap: anywhere;
}
+// 列表单元格内容垂直居中:用行内级 -webkit-inline-box 承接两行截断,
+// 配合下方 .t-table__cell 的 vertical-align: middle,单行/双行内容均随行居中
.clamp-2 {
- display: -webkit-box;
+ display: -webkit-inline-box;
-webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
word-break: break-all;
line-height: 1.5;
- min-height: 3em;
+ vertical-align: middle;
}
// 学习/考试状态 tag 可点击跳转学习考试页
@@ -1786,6 +1795,16 @@ watch(() => route.query.courseId, openDetailFromRoute)
}
}
+// 课程名称可点击 → 培训签到页(与状态 tag 同款可点击观感,品牌色区分)
+.course-name-link {
+ cursor: pointer;
+ color: var(--td-brand-color);
+
+ &:hover {
+ text-decoration: underline;
+ }
+}
+
.course-panel :deep(.t-table .t-table__cell) {
vertical-align: middle;
}
diff --git a/frontend/src/views/training/components/PlanPanel.vue b/frontend/src/views/training/components/PlanPanel.vue
index 0bc0be8..88a44c2 100644
--- a/frontend/src/views/training/components/PlanPanel.vue
+++ b/frontend/src/views/training/components/PlanPanel.vue
@@ -88,67 +88,6 @@
-
-
-
-
- {{ deptMap[row.dept_id] || row.dept_id || '-' }}
- {{ fmtStartAt(row.start_at) }}
-
- 已通过
- 已驳回
- 待审批
- 已滚动
- 草稿
-
- {{ row.reject_reason || '-' }}
-
-
- 通过
- 调整
- 驳回
-
-
-
-
-
-
-
-
-
- 取消
- 确认
-
-
-
@@ -264,7 +203,6 @@ import * as XLSX from 'xlsx'
import { DEMAND_TEMPLATE_KEY, downloadTrainingTemplate } from '../trainingTemplates'
import { apiErrorMessage } from '@/utils/request'
import {
- approveMonthPlan,
broadcastTrainingNotification,
confirmDemand,
deleteDemand,
@@ -274,12 +212,9 @@ import {
listDepts,
listLecturers,
listMembers,
- listMonthPlans,
- rollMonthPlans,
saveDemand,
type TrainingDept,
type TrainingDemand,
- type TrainingMonthPlan,
type TrainingLecturerOption,
type TrainingMember,
unwrap,
@@ -289,10 +224,6 @@ const props = defineProps<{ roles: string[]; admin?: boolean }>()
// 计划管理(录入/推送/排课):人事/课长(roles 已按权限组展开,经理自动命中课长)
const canManage = computed(() => props.admin || props.roles.some((r) => r === 'hr' || r === 'supervisor'))
-// 审批决策:经理(exec)/人事 — 与后端 ApproveMonthPlan 的 requireRoles 口径一致
-const canApprove = computed(() => props.admin || props.roles.some((r) => r === 'hr' || r === 'exec'))
-// 月底滚动等运营动作仅人事
-const isHr = computed(() => props.admin || props.roles.includes('hr'))
const now = new Date()
const currentYear = now.getFullYear()
@@ -468,98 +399,12 @@ const loadFormOptions = async () => {
const loadAll = async () => {
loading.value = true
try {
- await Promise.all([loadDemands(), loadMonthPlans()])
+ await loadDemands()
} finally {
loading.value = false
}
}
-// ---- 月度培训计划与审批 ----
-
-const monthPlans = ref([])
-const monthPlansLoading = ref(false)
-const monthPlansYear = ref(currentYear)
-
-const monthPlanColumns = [
- { colKey: 'title', title: '计划主题' },
- { colKey: 'month', title: '月份', width: 64 },
- { colKey: 'dept_id', title: '部门', width: 110 },
- { colKey: 'start_at', title: '开始时间', width: 130 },
- { colKey: 'location', title: '地点', width: 100 },
- { colKey: 'status', title: '状态', width: 84 },
- { colKey: 'reject_reason', title: '审批意见', width: 150 },
- { colKey: 'op', title: '操作', width: 170 },
-]
-
-const fmtStartAt = (v: string | null) => (v ? String(v).slice(0, 16).replace('T', ' ') : '-')
-
-const loadMonthPlans = async () => {
- monthPlansLoading.value = true
- try {
- const res = await listMonthPlans({ year: monthPlansYear.value, page_size: 200 })
- monthPlans.value = unwrap(res) || []
- } catch (e: any) {
- MessagePlugin.error(apiErrorMessage(e, '月度计划加载失败'))
- } finally {
- monthPlansLoading.value = false
- }
-}
-
-// 审批决策:通过直达;调整/驳回弹窗填审批意见
-const approveVisible = ref(false)
-const approving = ref(false)
-const approveAction = ref<'pass' | 'adjust' | 'reject'>('pass')
-const approveRow = ref(null)
-const approveReason = ref('')
-const approveTitle = computed(() => {
- const name = approveRow.value?.title || ''
- if (approveAction.value === 'reject') return `驳回计划:${name}`
- if (approveAction.value === 'adjust') return `调整意见:${name}`
- return `通过计划:${name}`
-})
-
-const onConfirmApprove = async () => {
- const row = approveRow.value
- if (!row) return
- approving.value = true
- try {
- await approveMonthPlan(row.id, approveAction.value, approveReason.value.trim())
- MessagePlugin.success(approveAction.value === 'pass' ? '已通过该月度计划' : '审批意见已提交')
- approveVisible.value = false
- loadMonthPlans()
- } catch (e: any) {
- MessagePlugin.error(apiErrorMessage(e, '审批失败,请稍后重试'))
- } finally {
- approving.value = false
- }
-}
-
-const onApprove = (row: TrainingMonthPlan, action: 'pass' | 'adjust' | 'reject') => {
- approveRow.value = row
- approveAction.value = action
- approveReason.value = ''
- if (action === 'pass') {
- onConfirmApprove()
- return
- }
- approveVisible.value = true
-}
-
-// 月底滚动(人事):未完成计划滚动生成下月计划
-const rolling = ref(false)
-const onRollMonthPlans = async () => {
- rolling.value = true
- try {
- const res = await rollMonthPlans(monthPlansYear.value, new Date().getMonth() + 1)
- MessagePlugin.success(`已滚动 ${unwrap(res)?.rolled ?? 0} 条未完成计划到下月`)
- loadMonthPlans()
- } catch (e: any) {
- MessagePlugin.error(apiErrorMessage(e, '滚动失败,请稍后重试'))
- } finally {
- rolling.value = false
- }
-}
-
const onOpenDemandForm = () => {
demandForm.value = {
id: '',
diff --git a/frontend/src/views/training/components/RulePanel.vue b/frontend/src/views/training/components/RulePanel.vue
index 7d8717e..d1901ce 100644
--- a/frontend/src/views/training/components/RulePanel.vue
+++ b/frontend/src/views/training/components/RulePanel.vue
@@ -404,7 +404,7 @@ const RULE_SCHEMAS: RuleSchemaDesc[] = [
{
key: 'sign_policy',
title: '签到策略',
- desc: '课堂签到的迟到判定与定位校验',
+ desc: '培训签到的迟到判定与定位校验',
fields: [
{ key: 'late_after_min', label: '迟到阈值', type: 'number', min: 1, max: 120, unit: '分钟后算迟到' },
{ key: 'geo_radius_m', label: '定位有效半径', type: 'number', min: 50, max: 5000, unit: '米' },
diff --git a/frontend/src/views/training/components/SignPanel.vue b/frontend/src/views/training/components/SignPanel.vue
index 28fc3d5..a22820b 100644
--- a/frontend/src/views/training/components/SignPanel.vue
+++ b/frontend/src/views/training/components/SignPanel.vue
@@ -2,7 +2,7 @@