Fix calculate_attendance_status missing return result, move chart imports to top
This commit is contained in:
@@ -309,6 +309,7 @@ def calculate_attendance_status(check_in, check_out, shift_start, shift_end):
|
|||||||
result["status_text"] = " / ".join(status_parts) if status_parts else "正常"
|
result["status_text"] = " / ".join(status_parts) if status_parts else "正常"
|
||||||
|
|
||||||
|
|
||||||
|
return result
|
||||||
@app.get("/api/attendance/lateness")
|
@app.get("/api/attendance/lateness")
|
||||||
async def get_lateness_stats(current_user: User = Depends(get_current_user)):
|
async def get_lateness_stats(current_user: User = Depends(get_current_user)):
|
||||||
"""Calculate full attendance statistics: late, early, OT"""
|
"""Calculate full attendance statistics: late, early, OT"""
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { useState, useEffect } from 'react'
|
|||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
import api from '../api'
|
import api from '../api'
|
||||||
import { Users, AlertTriangle, FileSpreadsheet, RefreshCw, TrendingUp, MapPin, Clock, AlertCircle, FileCode } from 'lucide-react'
|
import { Users, AlertTriangle, FileSpreadsheet, RefreshCw, TrendingUp, MapPin, Clock, AlertCircle, FileCode } from 'lucide-react'
|
||||||
|
import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, PieChart, Pie, Cell, LineChart, Line } from 'recharts'
|
||||||
|
|
||||||
const handleExportHTML = (section) => {
|
const handleExportHTML = (section) => {
|
||||||
const token = localStorage.getItem('aars_token')
|
const token = localStorage.getItem('aars_token')
|
||||||
@@ -9,7 +10,6 @@ const handleExportHTML = (section) => {
|
|||||||
window.open(`/api/report/${section}/html?token=${token}`, '_blank')
|
window.open(`/api/report/${section}/html?token=${token}`, '_blank')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, PieChart, Pie, Cell, LineChart, Line } from 'recharts'
|
|
||||||
|
|
||||||
const COLORS = ['#3b82f6', '#ef4444', '#22c55e', '#f59e0b', '#8b5cf6', '#ec4899', '#06b6d4', '#84cc16']
|
const COLORS = ['#3b82f6', '#ef4444', '#22c55e', '#f59e0b', '#8b5cf6', '#ec4899', '#06b6d4', '#84cc16']
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user