fix(training): 修复出国培训规则培训bug
This commit is contained in:
1 parent
683f602475
commit
258098ea7b
13 files changed
+280
-26
No files matched your search
@@ -500,6 +500,17 @@ const stopNonSafetyVideoTimer = () => {
|
||||
workspace.stopMaterialTimer();
|
||||
};
|
||||
|
||||
/**
|
||||
* 处理普通培训主视频播放结束事件。
|
||||
* AI 触发时机:学员完整播放当前主视频到结尾时调用;仅出国规章培训将视频播放结束作为一次学习完成,其他培训类型保持现有阶段推进入口。
|
||||
*/
|
||||
const handleNonSafetyVideoEnded = () => {
|
||||
stopNonSafetyVideoTimer();
|
||||
if (workspace.isOverseasRegulationsTraining) {
|
||||
workspace.markVideoCompleted();
|
||||
}
|
||||
};
|
||||
|
||||
watch([() => workspace.learnerTab, nonSafetyVideoMaterials], () => {
|
||||
if (!nonSafetyVideoMaterials.value.some((material) => material.id === activeNonSafetyVideoId.value)) {
|
||||
activeNonSafetyVideoId.value = nonSafetyVideoMaterials.value[0]?.id ?? null;
|
||||
@@ -589,8 +600,8 @@ const leanStatusMeta: Record<LeanTrainingTaskStatus, { badgeClass: string; label
|
||||
/** 看板总结弹框上下文:员工姓名 + 完整总结文案;为 null 时弹框关闭。 */
|
||||
const summaryModal = ref<{ name: string; text: string } | null>(null);
|
||||
|
||||
/** 总结列预览截断:最多显示 15 个字,超出部分以省略号收尾,点击可弹框查看全文。 */
|
||||
const truncateSummary = (text: string) => (text.length > 15 ? `${text.slice(0, 15)}…` : text);
|
||||
/** 总结列预览截断:最多显示 4 个字,超出部分以省略号收尾,点击可弹框查看全文。 */
|
||||
const truncateSummary = (text: string) => (text.length > 4 ? `${text.slice(0, 4)}…` : text);
|
||||
|
||||
/** 打开总结详情弹框:仅当该行有总结文案时可点击(无总结的行显示 "--" 不可点)。 */
|
||||
const openSummaryModal = (name: string, text: string) => {
|
||||
@@ -992,7 +1003,7 @@ const currentSafetyStageText = computed(() => {
|
||||
:src="activeNonSafetyVideo.resource?.fileUrl"
|
||||
@play="startNonSafetyVideoTimer"
|
||||
@pause="stopNonSafetyVideoTimer"
|
||||
@ended="stopNonSafetyVideoTimer"
|
||||
@ended="handleNonSafetyVideoEnded"
|
||||
/>
|
||||
</div>
|
||||
<div v-else class="mt-3 rounded-2xl border border-dashed border-default bg-surface-soft px-4 py-10 text-center text-sm text-muted">
|
||||
@@ -1831,6 +1842,10 @@ const currentSafetyStageText = computed(() => {
|
||||
>
|
||||
<option v-for="period in workspace.leanDashboard.periods" :key="period.id" :value="period.id">{{ $t('chat.training.lean.dashboard.periodLabel', { index: period.index }) }}({{ period.weekKey }})</option>
|
||||
</select>
|
||||
<button type="button" class="inline-flex items-center gap-1.5 rounded-lg bg-emerald-600 px-2.5 py-1.5 text-xs font-medium text-white transition hover:bg-emerald-700 disabled:cursor-not-allowed disabled:opacity-60" :disabled="workspace.leanExportLoading" @click="workspace.exportLeanDashboard">
|
||||
<Download class="h-3.5 w-3.5" />
|
||||
{{ workspace.leanExportLoading ? $t('chat.training.lean.dashboard.exporting') : $t('chat.training.lean.dashboard.export') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="rounded-full bg-white px-3 py-1 text-xs font-medium text-emerald-700">{{ $t('chat.training.lean.dueAt', { time: workspace.leanDashboard.task.dueAt.slice(0, 16).replace('T', ' ') }) }}</div>
|
||||
@@ -1862,7 +1877,7 @@ const currentSafetyStageText = computed(() => {
|
||||
<td class="border-b border-default px-3 py-2.5 text-secondary"><div v-for="video in row.videos" :key="`${video.name}-${video.watchedAt}`" class="whitespace-nowrap">{{ video.watchedAt ? video.watchedAt.slice(0, 16).replace('T', ' ') : '--' }}</div><span v-if="!row.videos.length">--</span></td>
|
||||
<!-- 状态徽章三态:已完成(绿)/已延期(红)/进行中(蓝),文案统一中文(含其余三语言),禁止回显原始键。 -->
|
||||
<td class="border-b border-default px-3 py-2.5"><span class="inline-flex rounded-full px-2.5 py-1 text-xs font-semibold" :class="row.status === 'completed' ? 'bg-emerald-50 text-emerald-700' : row.status === 'overdue' ? 'bg-red-50 text-red-700' : 'bg-blue-50 text-blue-700'">{{ $t(`chat.training.lean.status.${row.status}`) }}</span></td>
|
||||
<!-- [RULE] 总结列最多显示 15 个字:超出截断并显示省略号,点击弹框查看全部文案;无总结显示 "--"。
|
||||
<!-- [RULE] 总结列最多显示 4 个字:超出截断并显示省略号,点击弹框查看全部文案;无总结显示 "--"。
|
||||
常显虚线下划线提示可点击(用户复测反馈点击无效,实为部署版本差异,此处强化可点性视觉)。 -->
|
||||
<td class="border-b border-default px-3 py-2.5 text-secondary">
|
||||
<button v-if="row.summaryText" type="button" class="max-w-56 cursor-pointer text-left whitespace-pre-wrap break-words underline decoration-dotted decoration-secondary/60 underline-offset-2 transition hover:decoration-solid hover:text-primary" :title="$t('chat.training.lean.summaryModal.viewHint')" @click="openSummaryModal(row.name, row.summaryText)">{{ truncateSummary(row.summaryText) }}</button>
|
||||
|
||||
Reference in new issue
Block a user