import React, { Fragment, PureComponent } from 'react';
import {
    DeleteOutlined,
    EditOutlined,
    PlusOutlined,
    SearchOutlined,
    RedoOutlined,
    DownOutlined,
    ExclamationCircleFilled,
    UpOutlined,
} from '@ant-design/icons';
import { connect, history } from '@umijs/max';
import { Button, Input, Card, Divider, Dropdown, message, Modal, Popconfirm, Space, Switch, Tag, Row, Col, Table, Select } from 'antd';
const { Option } = Select;
import StandardTable from '@/components/StandardTable';

import { MyIcon } from "@/components/Icon"
import style from "@/global.less";
import TimeSheetCreateForm from './form/TimeSheetCreateForm'; //新增表单
import TimeSheetUpdateForm from './form/TimeSheetUpdateForm'; //修改表单
import TimeSheetViewForm from './form/TimeSheetViewForm'; //查看表单
import TimeSheetRenderSimpleForm from './form/TimeSheetRenderSimpleForm'; //简单查询表单
import TimeSheetRenderAdvancedForm from './form/TimeSheetRenderAdvancedForm'; //高级查询表单
import styles from './TimeSheetList.less';
import datadictionary from "@/utils/dataDictionary";
import { formatDate } from "@/utils/formatUtils";
import { formatDictText, checkButtonAuthority } from "@/utils/globalCommon";

const { confirm } = Modal;

//预约类型
const sex_type = datadictionary.sex
const user_status = datadictionary.user_status
const sys_user_post = datadictionary.sys_user_post

const mockData = {
    list: [
        {
            ygh: "A00001",
            xm: "员工1",
            rq: "2025/6/10",
            dw: "清河中医院",
            bm: "心内科",
            kqsc: 8,
            zysc: 7,
            kxsc: 1,
        },
        {
            ygh: "A00002",
            xm: "员工2",
            rq: "2025/6/10",
            dw: "清河中医院",
            bm: "心外科",
            kqsc: 8,
            zysc: 6,
            kxsc: 2,
        },
        {
            ygh: "A00003",
            xm: "员工3",
            rq: "2025/6/10",
            dw: "清河中医院",
            bm: "康复科",
            kqsc: 8,
            zysc: 8,
            kxsc: 0,
        },
        {
            ygh: "A00004",
            xm: "员工4",
            rq: "2025/6/10",
            dw: "清河中医院",
            bm: "心内科",
            kqsc: 8,
            zysc: 7,
            kxsc: 1,
        },
        {
            ygh: "A00005",
            xm: "员工5",
            rq: "2025/6/10",
            dw: "清河中医院",
            bm: "心外科",
            kqsc: 8,
            zysc: 6,
            kxsc: 2,
        },
        {
            ygh: "A00006",
            xm: "员工6",
            rq: "2025/6/10",
            dw: "清河中医院",
            bm: "康复科",
            kqsc: 8,
            zysc: 8,
            kxsc: 0,
        },
        {
            ygh: "A00007",
            xm: "员工7",
            rq: "2025/6/10",
            dw: "清河中医院",
            bm: "心内科",
            kqsc: 8,
            zysc: 7,
            kxsc: 1,
        },
        {
            ygh: "A00008",
            xm: "员工8",
            rq: "2025/6/10",
            dw: "清河中医院",
            bm: "心外科",
            kqsc: 8,
            zysc: 6,
            kxsc: 2,
        },
        {
            ygh: "A00009",
            xm: "员工9",
            rq: "2025/6/10",
            dw: "清河中医院",
            bm: "康复科",
            kqsc: 8,
            zysc: 8,
            kxsc: 0,
        },
        {
            ygh: "A000010",
            xm: "员工10",
            rq: "2025/6/10",
            dw: "清河中医院",
            bm: "心内科",
            kqsc: 8,
            zysc: 7,
            kxsc: 1,
        },
        {
            ygh: "A000011",
            xm: "员工11",
            rq: "2025/6/10",
            dw: "清河中医院",
            bm: "心外科",
            kqsc: 8,
            zysc: 6,
            kxsc: 2,
        },
        {
            ygh: "A000012",
            xm: "员工12",
            rq: "2025/6/10",
            dw: "清河中医院",
            bm: "康复科",
            kqsc: 8,
            zysc: 8,
            kxsc: 0,
        },
        {
            ygh: "A000013",
            xm: "员工13",
            rq: "2025/6/10",
            dw: "清河中医院",
            bm: "心内科",
            kqsc: 8,
            zysc: 7,
            kxsc: 1,
        },
        {
            ygh: "A000014",
            xm: "员工14",
            rq: "2025/6/10",
            dw: "清河中医院",
            bm: "心外科",
            kqsc: 8,
            zysc: 6,
            kxsc: 2,
        },
        {
            ygh: "A000015",
            xm: "员工15",
            rq: "2025/6/10",
            dw: "清河中医院",
            bm: "康复科",
            kqsc: 8,
            zysc: 8,
            kxsc: 0,
        },
        {
            ygh: "A000016",
            xm: "员工16",
            rq: "2025/6/10",
            dw: "清河中医院",
            bm: "心内科",
            kqsc: 8,
            zysc: 7,
            kxsc: 1,
        },
        {
            ygh: "A000017",
            xm: "员工17",
            rq: "2025/6/10",
            dw: "清河中医院",
            bm: "心外科",
            kqsc: 8,
            zysc: 6,
            kxsc: 2,
        },
        {
            ygh: "A000018",
            xm: "员工18",
            rq: "2025/6/10",
            dw: "清河中医院",
            bm: "康复科",
            kqsc: 8,
            zysc: 8,
            kxsc: 0,
        },
        {
            ygh: "A000019",
            xm: "员工19",
            rq: "2025/6/10",
            dw: "清河中医院",
            bm: "心内科",
            kqsc: 8,
            zysc: 7,
            kxsc: 1,
        },
        {
            ygh: "A000020",
            xm: "员工20",
            rq: "2025/6/10",
            dw: "清河中医院",
            bm: "心外科",
            kqsc: 8,
            zysc: 6,
            kxsc: 2,
        }
    ],
    pagination: {},
}
@connect(({ timesheet, loading }) => ({
    timesheet,
    loading: loading.models.timesheet,
}))

class TimeSheetList extends PureComponent {
    state = {
        modalVisible: false,
        updateModalVisible: false,
        viewModalVisible: false,
        expandForm: false,
        selectedRows: [],
        formValues: {},
        updateFormValues: {},
        viewFormValues: {},
        toggleExpand: false,
        // 文档对照数据
        documentComparisonData: [
            {
                original: "根据公司规定所有员工必须遵守本制度",
                modified: "根据公司规定，所有员工必须遵守本制度。"
            },
            {
                original: "员工应按时上下班不迟到早退",
                modified: "员工应按时上下班，不迟到早退。"
            },
            {
                original: "工作时间应保持专注提高效率",
                modified: "工作时间应保持专注，提高效率。"
            },
            {
                original: "请假需提前申请获得批准",
                modified: "请假需提前申请，获得批准。"
            },
            {
                original: "公司提供培训机会帮助员工成长",
                modified: "公司提供培训机会帮助员工成长"
            },
            {
                original: "员工应尊重同事团结协作",
                modified: "员工应尊重同事，团结协作。"
            },
            {
                original: "保护公司机密信息不泄露",
                modified: "保护公司机密信息，不泄露。"
            },
            {
                original: "遵守安全操作规程确保工作安全",
                modified: "遵守安全操作规程，确保工作安全。"
            },
            {
                original: "积极参与公司活动提升团队凝聚力",
                modified: "积极参与公司活动，提升团队凝聚力。"
            },
            {
                original: "按时完成工作任务达到质量标准",
                modified: "按时完成工作任务，达到质量标准。"
            }
        ]
    }

    columns = [
        {
            title: '序号',
            dataIndex: 'index',
            key: 'index',
            width: 50,
            fixed: 'left',
            render: (_, record, index) => index + 1,
        },
        {
            title: '员工号',
            dataIndex: 'ygh',
            key: 'ygh',
            width: 100,
            fixed: 'left',
        }, {
            title: '姓名',
            dataIndex: 'xm',
            key: 'xm',
            width: 100,
            fixed: 'left',
        }, {
            title: '日期',
            dataIndex: 'rq',
            key: 'rq',
            width: 100,
        }, {
            title: '单位',
            dataIndex: 'dw',
            key: 'dw',
            width: 150,
        }, {
            title: '部门',
            dataIndex: 'bm',
            key: 'bm',
            width: 150,
        }, {
            title: '考勤时长',
            dataIndex: 'kqsc',
            key: 'kqsc',
            width: 100,
        }, {
            title: '作业时长',
            dataIndex: 'zysc',
            key: 'zysc',
            width: 100,
        },
        {
            title: '空闲时长',
            dataIndex: 'kxsc',
            key: 'kxsc',
            width: 100,
        },
        {
            title: '比例图',
            dataIndex: 'blt',
            key: 'blt',
            width: 150,
            render: (text, record) => {
                let workRatio = record.zysc / (record.zysc + record.kxsc) * 100
                return (
                    <Fragment>
                        <div style={{ display: 'flex' }}>
                            <div style={{ height: 30, width: workRatio + '%', background: "#8ddd15" }}></div>
                            <div style={{ height: 30, width: 100 - workRatio + '%', background: "#cccccc" }}></div>
                        </div>
                    </Fragment>
                )
            },
        },
    ]

    componentDidMount() {
        // const { dispatch, timesheet: { params } } = this.props

        // dispatch({
        //     type: 'timesheet/query_page_for_prouser',
        // })

        // this.setState({
        //     expandForm: params?.expandForm || false,
        // })
    }

    handleStandardTableChange = (pagination, sorter) => {
        const { dispatch } = this.props
        const { formValues } = this.state

        const params = {
            currentPage: pagination.current,
            pageSize: pagination.pageSize,
            ...formValues
        }

        sorter.field && (params.sorter = `${sorter.field}_${sorter.order}`)

        // dispatch({
        //     type: 'prouser/query_page_for_prouser',
        //     payload: params
        // })
    }

    handleFormReset = () => {
        const { dispatch } = this.props
        this.setState({
            formValues: {}
        })

        // dispatch({
        //     type: 'prouser/query_page_for_prouser',
        //     payload: {
        //         resetFlag: true
        //     }
        // })
    }

    toggleForm = () => {
        const { expandForm } = this.state
        this.setState({
            expandForm: !expandForm
        })
    }

    handleSelectRows = rows => {
        this.setState({
            selectedRows: rows
        })
    }

    handleSearch = values => {
        const { dispatch } = this.props
        const { expandForm } = this.state

        this.setState({
            formValues: values
        })

        // dispatch({
        //     type: 'prouser/query_page_for_prouser',
        //     payload: {
        //         ...values,
        //         resetFlag: true,
        //         expandForm
        //     }
        // })
    }

    handleModalVisible = flag => {
        this.setState({
            modalVisible: !!flag
        })
    }

    handleUpdateModalVisible = (flag, record) => {
        this.setState({
            updateModalVisible: !!flag,
            updateFormValues: record || {}
        })
    }

    handleViewModalVisible = (flag, record) => {
        this.setState({
            viewModalVisible: !!flag,
            viewFormValues: record || {}
        })
    }

    handleAdd = fields => {
        const { dispatch } = this.props

        dispatch({
            type: 'prouser/insert_for_prouser',
            payload: {
                user_id: fields.user_id,
                user_name: fields.user_name,
                user_name_cn: fields.user_name_cn,
                user_name_en: fields.user_name_en,
                password: fields.password,
                email: fields.email,
                phone: fields.phone,
                landline: fields.landline,
                sex: fields.sex,
                avatar: fields.avatar,
                sign: fields.sign,
                tags: fields.tags,
                id_card: fields.id_card,
                birthday: fields.birthday,
                job_status: fields.job_status,
                hiredate: fields.hiredate,
                departure_time: fields.departure_time,
                user_type: fields.user_type,
                emp_no: fields.emp_no,
                access_card_no: fields.access_card_no,
                country: fields.country,
                province: fields.province,
                city: fields.city,
                address: fields.address,
                work_addr: fields.work_addr,
                floor: fields.floor,
                inprovince: fields.inprovince,
                // dept_code: fields.dept_code,
                // dept_name: fields.dept_name,
                inner_dept_code: fields.inner_dept_code,
                org_code: fields.org_code,
                org_name: fields.org_name,
                inner_org_code: fields.inner_org_code,
                posts: fields.posts,
                wx_openid: fields.wx_openid,
                wx_mpopenid: fields.wx_mpopenid,
                wx_miniopenid: fields.wx_miniopenid,
                wx_unionid: fields.wx_unionid,
                mobile_imei: fields.mobile_imei,
                device_num: fields.device_num,
                al_taobao: fields.al_taobao,
                al_alipay: fields.al_alipay,
                al_dingding: fields.al_dingding,
                is_system_user: fields.is_system_user,
                mgr_type: fields.mgr_type,
                pwd_security_level: fields.pwd_security_level,
                pwd_update_date: fields.pwd_update_date,
                last_login_ip: fields.last_login_ip,
                last_login_date: fields.last_login_date,
                freeze_date: fields.freeze_date,
                freeze_cause: fields.freeze_cause,
                zindex: fields.zindex,
                wx_msg: fields.wx_msg,
                email_msg: fields.email_msg,
                system_msg: fields.system_msg,
                remarks: fields.remarks,
                status: fields.status,
                creator: fields.creator,
                create_date: fields.create_date,
                updater: fields.updater,
                update_date: fields.update_date
            },
            callback: (res) => {
                if (res.success == true) {
                    message.success('添加成功')
                    this.handleModalVisible()
                }
            }
        })
    }

    handleDeleteRecord = record => {
        const { dispatch } = this.props

        dispatch({
            type: 'prouser/delete_by_primarykey_for_prouser',
            payload: {
                recordid: record.user_id
            },
            callback: res => {
                if (res.success) {
                    message.success('删除成功')

                    this.setState({
                        selectedRows: []
                    })
                }
            }
        })
    }

    handleUpdate = fields => {
        const { dispatch } = this.props

        dispatch({
            type: 'prouser/update_for_prouser',
            payload: {
                user_id: fields.user_id,
                user_name: fields.user_name,
                user_name_cn: fields.user_name_cn,
                user_name_en: fields.user_name_en,
                password: fields.password,
                email: fields.email,
                phone: fields.phone,
                landline: fields.landline,
                sex: fields.sex,
                avatar: fields.avatar,
                sign: fields.sign,
                tags: fields.tags,
                id_card: fields.id_card,
                birthday: fields.birthday,
                job_status: fields.job_status,
                hiredate: fields.hiredate,
                departure_time: fields.departure_time,
                user_type: fields.user_type,
                emp_no: fields.emp_no,
                access_card_no: fields.access_card_no,
                country: fields.country,
                province: fields.province,
                city: fields.city,
                address: fields.address,
                work_addr: fields.work_addr,
                floor: fields.floor,
                inprovince: fields.inprovince,
                // dept_code: fields.dept_code,
                // dept_name: fields.dept_name,
                inner_dept_code: fields.inner_dept_code,
                org_code: fields.org_code,
                org_name: fields.org_name,
                inner_org_code: fields.inner_org_code,
                posts: fields.posts,
                wx_openid: fields.wx_openid,
                wx_mpopenid: fields.wx_mpopenid,
                wx_miniopenid: fields.wx_miniopenid,
                wx_unionid: fields.wx_unionid,
                mobile_imei: fields.mobile_imei,
                device_num: fields.device_num,
                al_taobao: fields.al_taobao,
                al_alipay: fields.al_alipay,
                al_dingding: fields.al_dingding,
                is_system_user: fields.is_system_user,
                mgr_type: fields.mgr_type,
                pwd_security_level: fields.pwd_security_level,
                pwd_update_date: fields.pwd_update_date,
                last_login_ip: fields.last_login_ip,
                last_login_date: fields.last_login_date,
                freeze_date: fields.freeze_date,
                freeze_cause: fields.freeze_cause,
                zindex: fields.zindex,
                wx_msg: fields.wx_msg,
                email_msg: fields.email_msg,
                system_msg: fields.system_msg,
                remarks: fields.remarks,
                status: fields.status,
                creator: fields.creator,
                create_date: fields.create_date,
                updater: fields.updater,
                update_date: fields.update_date
            },
            callback: (res) => {
                if (res.success === true) {
                    message.success('修改成功')
                    this.handleUpdateModalVisible()
                }
            }
        })
    }

    // 修改用户状态
    handleUpdateUserStatus = (fields, status, msg) => {
        const { dispatch } = this.props

        confirm({
            title: `确定要 ${msg} 当前用户的吗?`,
            icon: <ExclamationCircleFilled />,
            onOk() {
                dispatch({
                    type: 'prouser/update_for_prouser',
                    payload: {
                        user_id: fields.user_id,
                        status: status,
                    },
                    callback: (res) => {
                        if (res.success === true) {
                            message.success('修改成功')
                        }
                    }
                })
            }
        })
    }

    // 修改用户密码
    handleUpdateUserPassword = fields => {
        const { dispatch } = this.props
        confirm({
            title: '确定要重置当前用户的密码吗?',
            icon: <ExclamationCircleFilled />,
            onOk() {
                dispatch({
                    type: 'prouser/resetpwd_for_prouser',
                    payload: {
                        user_id: fields.user_id
                    },
                    callback: (res) => {
                        if (res.success === true) {
                            message.success('重置成功')
                        }
                    }
                })
            }
        })
    }

    renderSimpleForm() {
        const { timesheet: { params } } = this.props
        const parentMethods = {
            handleSearch: this.handleSearch,
            handleFormReset: this.handleFormReset,
            toggleForm: this.toggleForm,
            params
        }

        return <TimeSheetRenderSimpleForm {...parentMethods} />
    }

    renderAdvancedForm() {
        const { dispatch, prouser: { selectDeptTree, selectOrganTree, params } } = this.props
        const parentMethods = {
            handleSearch: this.handleSearch,
            handleFormReset: this.handleFormReset,
            toggleForm: this.toggleForm,
            dispatch: dispatch,
            selectDeptTree: selectDeptTree,
            selectOrganTree: selectOrganTree,
            params
        }

        return <TimeSheetRenderAdvancedForm {...parentMethods} />
    }

    renderForm() {
        const { expandForm } = this.state
        return expandForm ? this.renderAdvancedForm() : this.renderSimpleForm()
    }

    handleCollapse = () => {
        const { toggleExpand } = this.state
        this.setState({
            toggleExpand: !toggleExpand
        })
    }

    render() {
        const {
            timesheet: {
                data,
                selectDeptTree,
                selectOrganTree
            },
            loading,
            dispatch
        } = this.props
        const {
            selectedRows,
            modalVisible,
            updateModalVisible,
            viewModalVisible,
            updateFormValues,
            viewFormValues,
            toggleExpand
        } = this.state

        const parentMethods = {
            handleAdd: this.handleAdd,
            handleModalVisible: this.handleModalVisible,
            dispatch: dispatch,
            loading,
            selectDeptTree: selectDeptTree,
            selectOrganTree: selectOrganTree
        }

        const updateMethods = {
            handleUpdateModalVisible: this.handleUpdateModalVisible,
            handleUpdate: this.handleUpdate,
            dispatch: dispatch,
            loading,
            selectDeptTree: selectDeptTree,
            selectOrganTree: selectOrganTree
        }

        const viewMethods = {
            handleViewModalVisible: this.handleViewModalVisible
        }

        return (
            <>
                <Card bordered={false} style={{ height: '100vh',padding:'0px' }}>
                    {/* 对照文本框区域 */}
                    <div style={{
                        marginTop: '0px', border: '1px solid #ddd', borderRadius: 5,
                        padding: 15,
                        marginBottom: 15
                    }}>
                        <h2 style={{ marginBottom: '20px', fontWeight: 600 }}>后台管理</h2>

                        {/* 用户管理模块 */}
                        <div style={{ marginBottom: '30px' }}>
                            <h3 style={{ marginBottom: '15px', fontWeight: 600, color: '#1890ff' }}>用户管理</h3>
                            <div style={{ overflowX: 'auto' }}>
                                <table style={{ width: '100%', borderCollapse: 'collapse', marginBottom: '15px' }}>
                                    <thead>
                                        <tr style={{ backgroundColor: '#f5f5f5' }}>
                                            <th style={{ padding: '10px', border: '1px solid #ddd', textAlign: 'left' }}>用户ID</th>
                                            <th style={{ padding: '10px', border: '1px solid #ddd', textAlign: 'left' }}>用户名</th>
                                            <th style={{ padding: '10px', border: '1px solid #ddd', textAlign: 'left' }}>角色</th>
                                            <th style={{ padding: '10px', border: '1px solid #ddd', textAlign: 'left' }}>部门</th>
                                            <th style={{ padding: '10px', border: '1px solid #ddd', textAlign: 'left' }}>状态</th>
                                            <th style={{ padding: '10px', border: '1px solid #ddd', textAlign: 'left' }}>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <tr>
                                            <td style={{ padding: '10px', border: '1px solid #ddd' }}>001</td>
                                            <td style={{ padding: '10px', border: '1px solid #ddd' }}>张三</td>
                                            <td style={{ padding: '10px', border: '1px solid #ddd' }}>管理员</td>
                                            <td style={{ padding: '10px', border: '1px solid #ddd' }}>信息技术部</td>
                                            <td style={{ padding: '10px', border: '1px solid #ddd' }}>启用</td>
                                            <td style={{ padding: '10px', border: '1px solid #ddd' }}>
                                                <Button type="link" size="small">编辑</Button>
                                                <Button type="link" size="small" danger>禁用</Button>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style={{ padding: '10px', border: '1px solid #ddd' }}>002</td>
                                            <td style={{ padding: '10px', border: '1px solid #ddd' }}>李四</td>
                                            <td style={{ padding: '10px', border: '1px solid #ddd' }}>审阅员</td>
                                            <td style={{ padding: '10px', border: '1px solid #ddd' }}>技术部</td>
                                            <td style={{ padding: '10px', border: '1px solid #ddd' }}>启用</td>
                                            <td style={{ padding: '10px', border: '1px solid #ddd' }}>
                                                <Button type="link" size="small">编辑</Button>
                                                <Button type="link" size="small" danger>禁用</Button>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style={{ padding: '10px', border: '1px solid #ddd' }}>003</td>
                                            <td style={{ padding: '10px', border: '1px solid #ddd' }}>王五</td>
                                            <td style={{ padding: '10px', border: '1px solid #ddd' }}>审阅员</td>
                                            <td style={{ padding: '10px', border: '1px solid #ddd' }}>安全部</td>
                                            <td style={{ padding: '10px', border: '1px solid #ddd' }}>启用</td>
                                            <td style={{ padding: '10px', border: '1px solid #ddd' }}>
                                                <Button type="link" size="small">编辑</Button>
                                                <Button type="link" size="small" danger>禁用</Button>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </div>
                            <Button type="primary" icon={<PlusOutlined />}>添加新用户</Button>
                        </div>

                        {/* 系统配置模块 */}
                        <div style={{ marginBottom: '30px', padding: '20px', border: '1px solid #ddd', borderRadius: '5px', backgroundColor: '#f9f9f9' }}>
                            <h3 style={{ marginBottom: '15px', fontWeight: 600, color: '#1890ff' }}>系统配置</h3>
                            <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(300px, 1fr))', gap: '15px', marginBottom: '20px' }}>
                                <div>
                                    <label style={{ display: 'block', marginBottom: '5px' }}>系统名称</label>
                                    <Input defaultValue="中煤科工集团AI审阅系统" />
                                </div>
                                <div>
                                    <label style={{ display: 'block', marginBottom: '5px' }}>最大上传文件大小(MB)</label>
                                    <Input defaultValue="50" type="number" />
                                </div>
                                <div>
                                    <label style={{ display: 'block', marginBottom: '5px' }}>自动保存间隔(分钟)</label>
                                    <Input defaultValue="5" type="number" />
                                </div>
                                <div>
                                    <label style={{ display: 'block', marginBottom: '5px' }}>通知邮箱</label>
                                    <Input defaultValue="admin@company.com" />
                                </div>
                            </div>
                            <Button type="primary">保存配置</Button>
                        </div>

                        {/* 日志管理模块 */}
                        <div>
                            <h3 style={{ marginBottom: '15px', fontWeight: 600, color: '#1890ff' }}>日志管理</h3>
                            <div style={{ display: 'flex', flexWrap: 'wrap', gap: '15px', marginBottom: '15px' }}>
                                <div>
                                    <label style={{ display: 'block', marginBottom: '5px' }}>日志级别</label>
                                    <Select defaultValue="error" style={{ width: 150 }}>
                                        <Option value="error">错误</Option>
                                        <Option value="warning">警告</Option>
                                        <Option value="info">信息</Option>
                                        <Option value="debug">调试</Option>
                                    </Select>
                                </div>
                                <div>
                                    <label style={{ display: 'block', marginBottom: '5px' }}>日期范围</label>
                                    <div style={{ display: 'flex', gap: '5px', alignItems: 'center' }}>
                                        <Input placeholder="年 /月/日" style={{ width: 120 }} />
                                        <span>至</span>
                                        <Input placeholder="年 /月/日" style={{ width: 120 }} />
                                    </div>
                                </div>
                                <div style={{ alignSelf: 'end' }}>
                                    <Space>
                                        <Button type="primary" icon={<SearchOutlined />}>查询日志</Button>
                                        <Button>导出日志</Button>
                                    </Space>
                                </div>
                            </div>
                            <div style={{ backgroundColor: '#f5f5f5', padding: '15px', borderRadius: '5px', maxHeight: '300px', overflowY: 'auto' }}>
                                <div style={{ marginBottom: '10px', color: 'red' }}>[2025-01-15 10:30:45] ERROR: 文档审阅失败 - 文件格式不支持</div>
                                <div style={{ marginBottom: '10px', color: 'orange' }}>[2025-01-15 09:15:22] WARNING: 用户登录失败 - 密码错误</div>
                                <div style={{ marginBottom: '10px', color: 'blue' }}>[2025-01-14 16:45:10] INFO: 系统备份完成</div>
                                <div style={{ marginBottom: '10px', color: 'red' }}>[2025-01-14 14:20:33] ERROR: 知识库更新失败 - 数据库连接超时</div>
                            </div>
                        </div>
                    </div>

                    {/* <div className={styles.proUsertableList}>
                        <div className={styles.proUsertableListForm}>{this.renderForm()}</div>
                        <div style={{ fontWeight: 500 }}>汇总信息</div>
                        <Divider style={{ borderColor: '#cccccc', margin: 0 }}>
                            <div className={styles.summaryButton} onClick={() => this.handleCollapse()}>
                                {toggleExpand ? <><UpOutlined /> 收起</> : <><DownOutlined /> 展开</>}
                            </div>
                        </Divider>
                        <div style={{ display: toggleExpand ? 'block' : 'none' }}>
                            <Row gutter={{ md: 8, lg: 24, xl: 48 }} className={styles.summaryContent}>
                                <Col md={5} sm={24}>
                                    <div>
                                        <span>单位: </span>
                                        <span>清河中医院</span>
                                    </div>
                                </Col>

                                <Col md={5} sm={24}>
                                    <span>部门: </span>
                                    <span>心内科</span>
                                </Col>

                                <Col md={5} sm={24}>
                                    <div>
                                        <span>总人数: </span>
                                        <span>300</span>
                                    </div>
                                </Col>
                            </Row>
                            <Row gutter={{ md: 8, lg: 24, xl: 48 }} className={styles.summaryContent}>
                                <Col md={5} sm={24}>
                                    <span>总作业数量: </span>
                                    <span>600</span>
                                </Col>

                                <Col md={5} sm={24}>
                                    <span>总考勤工时: </span>
                                    <span>2300</span>
                                </Col>

                                <Col md={5} sm={24}>
                                    <span>总作业工时: </span>
                                    <span>2000</span>
                                </Col>
                                <Col md={5} sm={24}>
                                    <span>总空闲工时: </span>
                                    <span>200</span>
                                </Col>
                            </Row>
                            <Row gutter={{ md: 8, lg: 24, xl: 48 }} className={styles.summaryContent}>
                                <Col md={5} sm={24}>
                                    <span>直接作业占比: </span>
                                    <span>86.96%</span>
                                </Col>

                                <Col md={5} sm={24}>
                                    <span>空闲工时占比: </span>
                                    <span>13.04%</span>
                                </Col>
                            </Row>
                        </div>
                        <div style={{ display: 'flex', justifyContent: "space-between" }}>
                            <div>共20项</div>
                            <div style={{ marginRight: 30 }}>
                                图例：
                                <div style={{ display: 'inline-block', width: 65, height: 20, textAlign: 'center', background: '#8ddd15' }}>作业时长</div>
                                <div style={{ display: 'inline-block', width: 65, height: 20, textAlign: 'center', background: '#cccccc', }}>空闲时长</div>
                            </div>
                        </div>
                        <StandardTable
                            rowKey={'user_id'}
                            selectedRows={selectedRows}
                            loading={loading}
                            data={mockData}
                            columns={this.columns}
                            onSelectRow={this.handleSelectRows}
                            onChange={this.handleStandardTableChange}
                            scroll={{ x: 1000, y: 600 }}
                            showTotal={(total, range) => total}
                        />
                    </div> */}
                </Card >

                {modalVisible && <TimeSheetCreateForm {...parentMethods} modalVisible={modalVisible} />
                }

                {
                    updateFormValues && Object.keys(updateFormValues).length ? (
                        <TimeSheetUpdateForm
                            {...updateMethods}
                            updateModalVisible={updateModalVisible}
                            values={updateFormValues}
                        />
                    ) : null
                }

                {
                    viewFormValues && Object.keys(viewFormValues).length ? (
                        <TimeSheetViewForm
                            {...viewMethods}
                            viewModalVisible={viewModalVisible}
                            values={viewFormValues}
                        />
                    ) : null
                }
            </>
        )
    }
}

export default TimeSheetList
