1.新增排班时间管理页面及其对接接口

2.对接排班人员列表接口
3.修改部分样式
This commit is contained in:
re-JZzzz
2025-09-22 20:47:13 +08:00
parent bc158f9bd5
commit 07c5dcde11
12 changed files with 566 additions and 16 deletions

View File

@ -37,6 +37,19 @@
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<div class="pagination-container">
<el-pagination
v-model:current-page="currentPage"
v-model:page-size="pageSize"
:page-sizes="[10, 20, 50, 100]"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</div>
</template>
@ -110,9 +123,17 @@ const getCurrentMonthDates = () => {
return dates;
};
// 分页相关状态
const currentPage = ref(1);
const pageSize = ref(10);
const total = ref(50); // 总数据条数,模拟数据
// 生成排班数据
const scheduleData = computed(() => {
return Array.from({ length: 20 }, (_, index) => {
const startIndex = (currentPage.value - 1) * pageSize.value;
const endIndex = startIndex + pageSize.value;
return Array.from({ length: total.value }, (_, index) => {
// 循环使用员工数据
const employee = employees[index % employees.length];
@ -131,9 +152,20 @@ const scheduleData = computed(() => {
});
return rowData;
});
}).slice(startIndex, endIndex);
});
// 分页大小变化处理
const handleSizeChange = (size: number) => {
pageSize.value = size;
currentPage.value = 1; // 重置为第一页
};
// 当前页码变化处理
const handleCurrentChange = (current: number) => {
currentPage.value = current;
};
// 组件挂载时获取当前月数据
onMounted(() => {
currentMonthDates.value = getCurrentMonthDates();
@ -216,7 +248,20 @@ const handleCellClick = (rowData: any, columnData: any, cellEvent: any) => {
}
.week-day {
font-size: 12px;
color: #666;
}
font-size: 12px;
color: #666;
}
/* 分页容器样式 */
.pagination-container {
margin-top: 16px;
display: flex;
justify-content: flex-end;
align-items: center;
}
/* 分页组件样式优化 */
:deep(.el-pagination) {
font-size: 14px;
}
</style>