1.月度计划调整上传临时课件、试题后月度计划详情这里的课件名称也要跟随变更、试题!
deploy-hxtesting / build-and-deploy (push) Successful in 1m15s
deploy-hxtesting / build-and-deploy (push) Successful in 1m15s
2.课程管理默认模板excel下载后课程名称下拉列表不对显示了部门名称,所属部门放在列表第一列下拉选择所属部门, 3.excel时长下拉列表中显示了人员应该放到讲师字段 4.选择对应课程后默认带出课程相关信息!
This commit is contained in:
1 parent
aa2c89f69e
commit
95e74ae5d5
7 files changed
+96
-28
No files matched your search
@@ -143,8 +143,9 @@
|
||||
</t-form-item>
|
||||
<t-form-item label="课件">
|
||||
<div class="asset-row">
|
||||
<!-- 000165 复测:file_name 恒镜像最新一条课件,上传/更换后名称跟随变更 -->
|
||||
<t-input
|
||||
:value="formLibraryCourse?.material_name || formLibraryCourse?.file_name || '-'"
|
||||
:value="formLibraryCourse?.file_name || formLibraryCourse?.material_name || '-'"
|
||||
disabled
|
||||
placeholder="随所选课程带出,可上传/更换"
|
||||
class="asset-value"
|
||||
@@ -434,8 +435,10 @@
|
||||
</t-form-item>
|
||||
<t-form-item label="课件">
|
||||
<div class="asset-row">
|
||||
<!-- 000165 复测:file_name 恒镜像最新一条课件,上传/更换后名称跟随变更;
|
||||
material_name 为旧「名称登记」仅兜底 -->
|
||||
<t-input
|
||||
:value="activeLibraryCourse?.material_name || activeLibraryCourse?.file_name || '-'"
|
||||
:value="activeLibraryCourse?.file_name || activeLibraryCourse?.material_name || '-'"
|
||||
disabled
|
||||
placeholder="随所选课程带出(课程管理维护)"
|
||||
class="asset-value"
|
||||
@@ -678,6 +681,15 @@ const ensureLibraryCourse = async (): Promise<TrainingLibraryCourse | null> => {
|
||||
MessagePlugin.warning('缺少课程名称,无法维护课件/试题')
|
||||
return null
|
||||
}
|
||||
// 000165 复测:先按课程名匹配既有条目并补挂(回写计划),同名课程已存在时
|
||||
// 不再另建重复空条目,课件/试题维护落到正确课程
|
||||
const byName = libraryCourses.value.find((c) => c.name === name)
|
||||
if (byName) {
|
||||
editForm.value.library_course_id = byName.id
|
||||
activeCourse.value = { ...row, library_course_id: byName.id }
|
||||
await saveCourse(detailSavePayload({ ...row, library_course_id: byName.id }))
|
||||
return byName
|
||||
}
|
||||
assetSaving.value = true
|
||||
try {
|
||||
const created = unwrap(await saveCourseLibraryItem({
|
||||
@@ -722,7 +734,7 @@ const onChangeMaterial = async (e: Event) => {
|
||||
fd.append('file', file)
|
||||
const updated = unwrap(await uploadCourseLibraryMaterial(lc.id, fd)) as TrainingLibraryCourse | null
|
||||
replaceLibraryCourse(updated)
|
||||
MessagePlugin.success(`课件已更换为「${updated?.material_name || updated?.file_name || file.name}」,已同步到课程管理「${lc.name}」`)
|
||||
MessagePlugin.success(`课件已更换为「${updated?.file_name || updated?.material_name || file.name}」,已同步到课程管理「${lc.name}」`)
|
||||
} catch (e: any) {
|
||||
MessagePlugin.error(apiErrorMessage(e, '课件更换失败,请稍后重试'))
|
||||
} finally {
|
||||
@@ -765,6 +777,28 @@ const replaceLibraryCourse = (updated?: TrainingLibraryCourse | null) => {
|
||||
else libraryCourses.value = [...libraryCourses.value, updated]
|
||||
}
|
||||
|
||||
// 详情打开回源课程管理(000165 复测):本地列表缓存可能滞后(课件/试题刚在
|
||||
// 课程管理或另一计划里更新过),按课程名拉取最新条目替换缓存,课件/试题/适合
|
||||
// 人员展示与后续上传落点都跟随最新数据;计划未挂接条目时按名称补挂(回写
|
||||
// library_course_id),试题列表一并刷新。失败保持本地缓存展示,不阻断详情打开。
|
||||
const refreshDetailLibraryCourse = async (row: TrainingCourse) => {
|
||||
if (!canManage.value || !row.name) return
|
||||
try {
|
||||
const res = unwrap(await listCourseLibrary({ keyword: row.name, page_size: 20 }))
|
||||
const items = ((unwrap(res)?.items as TrainingLibraryCourse[]) || [])
|
||||
const hit = items.find((c) => c.id && c.id === row.library_course_id) || items.find((c) => c.name === row.name)
|
||||
if (!hit) return
|
||||
replaceLibraryCourse(hit)
|
||||
if (!row.library_course_id && editForm.value.library_course_id !== hit.id) {
|
||||
editForm.value.library_course_id = hit.id
|
||||
activeCourse.value = { ...row, library_course_id: hit.id }
|
||||
}
|
||||
loadCourseBanks(editForm.value.library_course_id || '')
|
||||
} catch {
|
||||
/* 回源失败保持本地缓存展示 */
|
||||
}
|
||||
}
|
||||
|
||||
// ---- 从知识库选择课件/试题(000158):与课程管理同口径(课件 from-kb 挂载,
|
||||
// 试题 KB 文档解析建题库挂课程条目),月计划详情「知识库」入口 ----
|
||||
const kbRefs = ref<TrainingKnowledgeBases>({ courseware: null, question_bank: null })
|
||||
@@ -1668,6 +1702,9 @@ const openDetail = async (row: TrainingCourse) => {
|
||||
}
|
||||
// 课程资产侧信息(000156):适合人员/课件/试题随 library_course_id 展示
|
||||
loadCourseBanks(row.library_course_id || '')
|
||||
// 000165 复测:打开详情即回源课程管理最新信息(他人刚更新的课件/试题名称跟随变更);
|
||||
// 计划未挂接条目时按课程名补挂既有条目,避免资产维护另建重复空条目
|
||||
void refreshDetailLibraryCourse(row)
|
||||
// 授课时间回填:优先课程授课时间(期望月份默认值 YYYY-MM 展开为当月 1 日),否则回退最近场次排期
|
||||
const list = courseSessions.value[row.id] || []
|
||||
const nearest = list.find((s) => s.status === 'scheduled' && s.start_at) || list.find((s) => s.start_at) || list[0]
|
||||
|
||||
@@ -242,8 +242,8 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-hint">
|
||||
模板列序与列表字段一致:课程名称(必填)/讲师/课件收集(已有课件或暂无课件)/课程权限/课程分类/类型(必修课或选修课)/线上或线下/时长(学时)/所属部门/课程说明/适合人员备注;
|
||||
所属部门、课程分类、类型、线上或线下、讲师、课件收集在模板中支持下拉选择(讲师可选系统员工或直接输入外部姓名);课程权限列填「全部」或部门/人员名(与课程权限下拉同口径,旧模板「适合人员」列同样兼容);适合人员备注列仅做展示说明;分类可填配置中心预设分类或自定义分类,导入后保存;课程编号由系统自动生成。
|
||||
模板列序(000165 复测,无课件收集列,课件导入后在列表「课件」入口上传维护):所属部门(第一列,下拉选择组织架构部门)/课程名称(必填,下拉可选课程管理已有课程,新课程直接填写)/讲师(下拉选系统员工或直接输入外部姓名)/课程权限/课程分类/类型(必修课或选修课)/线上或线下/时长(学时)/课程说明/适合人员备注;
|
||||
课程权限列填「全部」或部门/人员名(与课程权限下拉同口径,旧模板「适合人员」列同样兼容);适合人员备注列仅做展示说明;课程分类可填配置中心预设分类或自定义分类,导入后保存;课程编号由系统自动生成。
|
||||
</div>
|
||||
<template #footer>
|
||||
<t-button variant="outline" @click="importVisible = false">关闭</t-button>
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
* 「题库与考试 → Excel 批量导入」与「培训课程 → 创建课程 → 关联题库」指引使用;
|
||||
* 工作表:单选题/多选题/判断题,列:题目/课程名称/难度/正确答案/答案A..答案L。
|
||||
* - course_library 课程管理导入模板.xlsx:「课程管理 → 批量导入」使用;
|
||||
* 列:课程名称/说明/分类/类型/线上,线下/讲师/时长(学时)/课件。
|
||||
* 000165 复测列序:所属部门/课程名称/讲师/课程权限/课程分类/类型/线上或线下/
|
||||
* 时长(学时)/课程说明/适合人员备注(无课件收集列,课件经列表「课件」入口维护)。
|
||||
*/
|
||||
import { downloadTrainingTemplateFile, type TrainingTemplateKey } from '@/api/training'
|
||||
import { MessagePlugin } from 'tdesign-vue-next'
|
||||
|
||||
Reference in new issue
Block a user