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]
|
||||
|
||||
Reference in new issue
Block a user