fix(培训页面优化):1.请检查所有企业培训相关页面带有列表展示都要进行分页,使用分页共用组件默认每页15条!
deploy-hxtesting / build-and-deploy (push) Successful in 1m8s
deploy-hxtesting / build-and-deploy (push) Successful in 1m8s
2.课程管理页面右侧固定太宽如图二所示收缩够用就可以,可参考培训计划页面 3.月培训计划数据默认显示计划培训和授课培训是当月数据,可筛选其他月份支持多选或全部数据 4.月培训计划只需要保留一个【创建月度计划】按钮,无法创建月度计划请核实根因!
This commit is contained in:
1 parent
2483dd933a
commit
102d94e6c8
10 files changed
+387
-50
No files matched your search
@@ -43,7 +43,7 @@
|
||||
|
||||
<t-table
|
||||
v-model:selected-row-keys="selectedKeys"
|
||||
:data="filteredItems" :columns="columns" row-key="id" size="small" :loading="loading"
|
||||
:data="pagedItems" :columns="columns" row-key="id" size="small" :loading="loading"
|
||||
>
|
||||
<template #code="{ row }">{{ row.code || '-' }}</template>
|
||||
<template #name="{ row }"><span class="clamp-2">{{ row.name }}</span></template>
|
||||
@@ -135,6 +135,8 @@
|
||||
</t-popconfirm>
|
||||
</template>
|
||||
</t-table>
|
||||
<!-- 共用分页(000163):默认每页 15 条 -->
|
||||
<TrainingPagination v-model:current="itemPage" v-model:page-size="itemPageSize" :total="itemTotal" />
|
||||
</div>
|
||||
|
||||
<!-- 新增/编辑课程弹窗:分类/讲师支持下拉选择或手动输入(输入即保存为新分类/外部讲师) -->
|
||||
@@ -322,7 +324,7 @@
|
||||
同名题库重新导入会整体替换;解析 Excel 题目自动建题库并挂到本课程(月培训计划选课后自动具备随堂考试能力);Excel 原件同步知识库「企业培训(题库)」;课件已上传时文档同步知识库「企业培训(课件)」,支持 AI 出题与对话问答。
|
||||
</div>
|
||||
|
||||
<t-table :data="banks" :columns="bankColumns" row-key="id" size="small" :loading="banksLoading">
|
||||
<t-table :data="pagedBanks" :columns="bankColumns" row-key="id" size="small" :loading="banksLoading">
|
||||
<template #op="{ row }">
|
||||
<t-button variant="text" theme="primary" size="small" @click="selectBank(row)">查看试题</t-button>
|
||||
<t-popconfirm content="删除题库将连带删除全部题目与试卷,确定?" theme="danger" @confirm="onDeleteBank(row)">
|
||||
@@ -330,6 +332,7 @@
|
||||
</t-popconfirm>
|
||||
</template>
|
||||
</t-table>
|
||||
<TrainingPagination v-model:current="bankPage" v-model:page-size="bankPageSize" :total="bankTotal" />
|
||||
<t-empty v-if="!banksLoading && !banks.length" description="暂无题库,可在上方上传 Excel / 从知识库导入 / AI 生成" />
|
||||
|
||||
<template v-if="activeBank">
|
||||
@@ -337,7 +340,7 @@
|
||||
题库「{{ activeBank.name }}」({{ activeBank.question_count }}题)
|
||||
<t-button theme="primary" variant="outline" size="small" class="bank-section-add" @click="openQuestionForm()">+ 新增试题</t-button>
|
||||
</div>
|
||||
<t-table :data="questions" :columns="questionColumns" row-key="id" size="small" :loading="questionsLoading">
|
||||
<t-table :data="pagedQuestions" :columns="questionColumns" row-key="id" size="small" :loading="questionsLoading">
|
||||
<template #type="{ row }">{{ questionTypeText(row.type) }}</template>
|
||||
<template #stem="{ row }">
|
||||
<t-tooltip v-if="row.stem" :content="row.stem">
|
||||
@@ -353,6 +356,7 @@
|
||||
</t-popconfirm>
|
||||
</template>
|
||||
</t-table>
|
||||
<TrainingPagination v-model:current="questionPage" v-model:page-size="questionPageSize" :total="questionTotal" />
|
||||
<t-empty v-if="!questionsLoading && !questions.length" description="该题库暂无试题,可新增或重新导入" />
|
||||
</template>
|
||||
</t-drawer>
|
||||
@@ -501,6 +505,8 @@ import * as XLSX from 'xlsx'
|
||||
import { COURSE_LIBRARY_TEMPLATE_KEY, QUESTION_TEMPLATE_KEY, downloadTrainingTemplate } from '../trainingTemplates'
|
||||
import { apiErrorMessage, get } from '@/utils/request'
|
||||
import { fmtBeijingTime } from '@/utils/datetime'
|
||||
import TrainingPagination from './TrainingPagination.vue'
|
||||
import { useTrainingPager } from './useTrainingPager'
|
||||
import {
|
||||
attachCourseLibraryMaterialFromKb,
|
||||
deleteCourseLibraryItem,
|
||||
@@ -628,6 +634,18 @@ const filteredItems = computed(() => {
|
||||
})
|
||||
})
|
||||
|
||||
// 共用分页(000163):课程列表默认每页 15 条;查询条件变化后回到第 1 页
|
||||
const {
|
||||
page: itemPage,
|
||||
pageSize: itemPageSize,
|
||||
total: itemTotal,
|
||||
paged: pagedItems,
|
||||
reset: resetItemPage,
|
||||
} = useTrainingPager(filteredItems)
|
||||
|
||||
// 查询条件变化(重置/筛选)后列表回到第 1 页
|
||||
watch(filteredItems, resetItemPage)
|
||||
|
||||
const columns = [
|
||||
// 批量勾选列(000157):配合批量核验/批量删除
|
||||
{ colKey: 'row-select', type: 'multiple', width: 44 },
|
||||
@@ -650,9 +668,10 @@ const columns = [
|
||||
{ colKey: 'created_at', title: '创建时间', width: 140 },
|
||||
// 创建人(联查 users):记录课程录入人员
|
||||
{ colKey: 'creator_name', title: '创建人', width: 96 },
|
||||
// 核验状态(000157):固定右侧置于操作列前
|
||||
{ colKey: 'verify_status', title: '状态', width: 90, fixed: 'right' },
|
||||
{ colKey: 'op', title: '操作', width: 340, fixed: 'right' },
|
||||
// 000163 右侧固定区收缩(参考年培训计划页):状态 84,操作收窄至够用,
|
||||
// 按钮紧凑排布(见下方样式),消除固定区的空白浪费
|
||||
{ colKey: 'verify_status', title: '状态', width: 84, fixed: 'right' },
|
||||
{ colKey: 'op', title: '操作', width: 260, fixed: 'right', className: 'op-cell' },
|
||||
]
|
||||
|
||||
const lecturerText = (row: TrainingLibraryCourse) =>
|
||||
@@ -1266,6 +1285,21 @@ const activeBank = ref<TrainingQuestionBank | null>(null)
|
||||
const questions = ref<TrainingQuestion[]>([])
|
||||
const questionsLoading = ref(false)
|
||||
|
||||
// 题库/试题列表分页(000163):默认每页 15 条;切换题库后试题回到第 1 页
|
||||
const {
|
||||
page: bankPage,
|
||||
pageSize: bankPageSize,
|
||||
total: bankTotal,
|
||||
paged: pagedBanks,
|
||||
} = useTrainingPager(banks)
|
||||
const {
|
||||
page: questionPage,
|
||||
pageSize: questionPageSize,
|
||||
total: questionTotal,
|
||||
paged: pagedQuestions,
|
||||
reset: resetQuestionPage,
|
||||
} = useTrainingPager(questions)
|
||||
|
||||
const bankColumns = [
|
||||
{ colKey: 'code', title: '题库编号', width: 105 },
|
||||
{ colKey: 'name', title: '题库名称', minWidth: 180 },
|
||||
@@ -1318,6 +1352,7 @@ const loadBanks = async () => {
|
||||
const selectBank = async (bank: TrainingQuestionBank) => {
|
||||
activeBank.value = bank
|
||||
questionsLoading.value = true
|
||||
resetQuestionPage()
|
||||
try {
|
||||
const res = await listQuestions(bank.id)
|
||||
questions.value = unwrap(res) || []
|
||||
@@ -1700,6 +1735,16 @@ onMounted(loadAll)
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
// 000163 操作列按钮紧凑排布:缩小左右内边距并固定按钮间距,
|
||||
// 使右侧固定区(状态 84 + 操作 260)收窄至够用,不再出现大片空白
|
||||
.library-panel :deep(.op-cell .t-button) {
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
.library-panel :deep(.op-cell .t-button + .t-button) {
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
// 批量导入弹窗:模板下载 + Excel 上传一行排布(与培训计划导入同款)
|
||||
.import-row {
|
||||
display: flex;
|
||||
|
||||
Reference in new issue
Block a user