fix(培训页面优化):1.请检查所有企业培训相关页面带有列表展示都要进行分页,使用分页共用组件默认每页15条!
deploy-hxtesting / build-and-deploy (push) Successful in 1m8s

2.课程管理页面右侧固定太宽如图二所示收缩够用就可以,可参考培训计划页面
3.月培训计划数据默认显示计划培训和授课培训是当月数据,可筛选其他月份支持多选或全部数据
4.月培训计划只需要保留一个【创建月度计划】按钮,无法创建月度计划请核实根因!
This commit is contained in:
runny committed 2026-11-25 13:45:36 +08:00
1 parent 2483dd933a
commit 102d94e6c8
10 files changed
+387 -50

No files matched your search

@@ -36,9 +36,9 @@
clearable
placeholder="课程名称模糊搜索"
style="width: 200px"
@enter="loadDemands"
@enter="onSearchDemands"
/>
<t-button variant="outline" @click="loadDemands">查询</t-button>
<t-button variant="outline" @click="onSearchDemands">查询</t-button>
<t-button variant="outline" @click="onResetDemandSearch">重置</t-button>
<t-button v-if="canConfirm" theme="primary" variant="outline" :disabled="!selectedDemandKeys.length" :loading="batchSaving" @click="onBatchConfirm">批量确认</t-button>
<t-button v-if="canManage" theme="danger" variant="outline" :disabled="!selectedDemandKeys.length" :loading="batchSaving" @click="onBatchDelete">批量删除</t-button>
@@ -46,7 +46,7 @@
</div>
<t-table
v-model:selected-row-keys="selectedDemandKeys"
:data="demands"
:data="pagedDemands"
:columns="demandColumns"
row-key="id"
size="small"
@@ -99,6 +99,8 @@
</template>
</template>
</t-table>
<!-- 共用分页(000163):默认每页 15 条 -->
<TrainingPagination v-model:current="demandPage" v-model:page-size="demandPageSize" :total="demandTotal" />
</div>
<!-- 提报需求弹窗(编辑态复用:部门按提报人自动获取) -->
@@ -250,6 +252,8 @@ import * as XLSX from 'xlsx'
import { fmtBeijingTime } from '@/utils/datetime'
import { DEMAND_TEMPLATE_KEY, downloadTrainingTemplate } from '../trainingTemplates'
import { apiErrorMessage } from '@/utils/request'
import TrainingPagination from './TrainingPagination.vue'
import { useTrainingPager } from './useTrainingPager'
import {
broadcastTrainingNotification,
confirmDemand,
@@ -291,7 +295,10 @@ const currentYear = now.getFullYear()
// 年度需求收集:年份下拉为需求库实际年份(降序),默认展示最新一年(无数据回退当前年)
const selectedYear = ref(currentYear)
const yearOptions = ref<number[]>([])
const onYearChange = () => loadDemands()
const onYearChange = () => {
resetDemandPage()
loadDemands()
}
const loading = ref(false)
const saving = ref(false)
@@ -515,6 +522,15 @@ const loadDemands = async () => {
demands.value = unwrap(d)?.items || []
}
// 共用分页(000163):需求列表默认每页 15 条;查询条件/年度切换后回到第 1 页
const {
page: demandPage,
pageSize: demandPageSize,
total: demandTotal,
paged: pagedDemands,
reset: resetDemandPage,
} = useTrainingPager(demands)
// 年份下拉数据源:需求库实际年份(降序)。resetSelection=true 时默认选中最新一年
// (首次进入);后续刷新仅在当前选中年份已无数据时回退最新,避免打断用户选择。
const loadDemandYears = async (resetSelection = false) => {
@@ -531,6 +547,13 @@ const loadDemandYears = async (resetSelection = false) => {
const onResetDemandSearch = () => {
demandSearch.value = { state: '', dept_id: '', keyword: '' }
resetDemandPage()
loadDemands()
}
// 查询/年度切换:过滤条件变化后需求列表回到第 1 页
const onSearchDemands = () => {
resetDemandPage()
loadDemands()
}