| | |
| | | dept: "生产一部", |
| | | }); |
| | | |
| | | // 部门选项 |
| | | const deptOptions = [ |
| | | { label: "生产一部", value: "生产一部" }, |
| | | { label: "生产二部", value: "生产二部" }, |
| | | { label: "设备维护部", value: "设备维护部" }, |
| | | { label: "质检部", value: "质检部" }, |
| | | ]; |
| | | |
| | | // 模拟考勤原始数据 |
| | | const rawAttendance = ref([ |
| | | { |
| | |
| | | |
| | | // 查询表单 |
| | | const searchForm = reactive({ |
| | | dept: "", |
| | | date: "", |
| | | }); |
| | | |
| | |
| | | // 查询 |
| | | const recomputeTable = () => { |
| | | const list = rawAttendance.value.filter(item => { |
| | | if (searchForm.dept && item.dept !== searchForm.dept) { |
| | | return false; |
| | | } |
| | | if (searchForm.date && item.date !== searchForm.date) { |
| | | return false; |
| | | } |
| | |
| | | recomputeTable(); |
| | | }; |
| | | |
| | | const resetSearch = () => { |
| | | searchForm.dept = ""; |
| | | searchForm.date = ""; |
| | | recomputeTable(); |
| | | }; |
| | | |
| | | // 导出(演示) |
| | | const handleExport = () => { |
| | | uni.showToast({ |
| | | title: "当前为演示页面,导出功能未对接实际接口", |
| | | icon: "none", |
| | | }); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | // 默认展示当天数据 |
| | | // const today = new Date(); |
| | | // const Y = today.getFullYear(); |
| | | // const M = String(today.getMonth() + 1).padStart(2, "0"); |
| | | // const D = String(today.getDate()).padStart(2, "0"); |
| | | // searchForm.date = `${Y}-${M}-${D}`; |
| | | recomputeTable(); |
| | | }); |
| | | </script> |
| | |
| | | font-weight: 500; |
| | | } |
| | | |
| | | /* 导出按钮 */ |
| | | .export-section { |
| | | text-align: center; |
| | | margin: 0 20rpx 30rpx; |
| | | } |
| | | |
| | | .export-btn { |
| | | width: 100%; |
| | | border-radius: 8rpx; |
| | | border: 1rpx solid $primary-color; |
| | | color: $primary-color; |
| | | transition: all 0.3s ease; |
| | | } |
| | | |
| | | .export-btn:hover { |
| | | background-color: $primary-color; |
| | | color: #ffffff; |
| | | box-shadow: 0 4rpx 12rpx rgba($primary-color, 0.3); |
| | | transform: translateY(-2rpx); |
| | | } |
| | | |
| | | /* 响应式调整 */ |
| | | @media (max-width: 375px) { |
| | | .search-section, |
| | | .record-list, |
| | | .empty-state, |
| | | .export-section { |
| | | .empty-state { |
| | | margin: 12rpx; |
| | | } |
| | | |
| | |
| | | |
| | | .search-section, |
| | | .record-item-card, |
| | | .empty-state, |
| | | .export-section { |
| | | .empty-state { |
| | | animation: fadeInUp 0.5s ease-out; |
| | | } |
| | | |
| | |
| | | |
| | | .empty-state { |
| | | animation-delay: 0.2s; |
| | | } |
| | | |
| | | .export-section { |
| | | animation-delay: 0.3s; |
| | | } |
| | | </style> |