zhangwencui
2026-02-09 fbd83ef832adf315d3cf5c9c6bd8164c897d283a
src/pages/attendance/report.vue
@@ -98,14 +98,6 @@
    dept: "生产一部",
  });
  // 部门选项
  const deptOptions = [
    { label: "生产一部", value: "生产一部" },
    { label: "生产二部", value: "生产二部" },
    { label: "设备维护部", value: "设备维护部" },
    { label: "质检部", value: "质检部" },
  ];
  // 模拟考勤原始数据
  const rawAttendance = ref([
    {
@@ -182,7 +174,6 @@
  // 查询表单
  const searchForm = reactive({
    dept: "",
    date: "",
  });
@@ -220,9 +211,6 @@
  // 查询
  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;
      }
@@ -235,27 +223,7 @@
    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>
@@ -425,33 +393,11 @@
    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;
    }
@@ -478,8 +424,7 @@
  .search-section,
  .record-item-card,
  .empty-state,
  .export-section {
  .empty-state {
    animation: fadeInUp 0.5s ease-out;
  }
@@ -497,9 +442,5 @@
  .empty-state {
    animation-delay: 0.2s;
  }
  .export-section {
    animation-delay: 0.3s;
  }
</style>