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, Input as AntInput } from 'antd';
const { TextArea } = AntInput;
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";
import { globalPrompts } from "@/utils/globalPrompts";

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,
        // 审阅任务提示词
        reviewPrompt: globalPrompts.pdfReviewPrompt,
        // 文档对照数据
        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}`)
    }

    // 保存审阅任务提示词配置
    handleSavePrompt = () => {
        const { reviewPrompt } = this.state;
        try {
            // 将审阅提示词保存到localStorage，实现持久化存储
            localStorage.setItem('pdfReviewPrompt', reviewPrompt);
            
            // 显示保存成功提示
            message.success('配置保存成功！');
            console.log('保存的提示词:', reviewPrompt);
            
            // 实际项目中，这里还可以调用API保存配置到服务器
            // try {
            //     await api.savePromptConfig({ prompt: reviewPrompt });
            // } catch (error) {
            //     console.error('保存到服务器失败:', error);
            // }
        } catch (error) {
            message.error('保存失败：' + error.message);
            console.error('保存配置失败:', error);
        }
    }

    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: '15px', fontWeight: 600 }}>智能体配置</h2>
                        <div style={{
                            backgroundColor: '#e8f4fd',
                            borderLeft: '4px solid #2196F3',
                            padding: '15px',
                            marginBottom: '20px',
                            borderRadius: '0 4px 4px 0'
                        }}>
                            <p style={{ marginBottom: '10px'}}><span style={{ fontWeight:600,color: '#0c5460' }}>说明：</span>标准格式文档用于定义文档的结构和格式规范，审阅任务Prompt用于明确定义审阅的内容和标准。</p>
                            {/* <p style={{ marginBottom: '5px' }}>标准格式文档：上传该类型文件的标准格式模板，系统将根据此模板检查文档的结构和格式</p>
                            <p>审阅任务Prompt：编辑针对该类型文件的审阅任务提示词，明确定义审阅的内容和标准</p> */}
                            <ul style={{paddingLeft:'20px'}}>
                                <li><span style={{ fontWeight:600,color: '#0c5460' }}>标准格式文档：</span>上传该类型文件的标准格式模板，系统将根据此模板检查文档的结构和格式</li>
                                <li><span style={{ fontWeight:600,color: '#0c5460' }}>审阅任务Prompt：</span>编辑针对该类型文件的审阅任务提示词，明确定义审阅的内容和标准</li>
                            </ul>
                        </div>

                        {/* 文件类型选择 */}
                        <div style={{ marginBottom: '20px' }}>
                            <span style={{ marginRight: '10px' }}>选择文件类型:</span>
                            <Select defaultValue="pdf" style={{ width: 200 }}>
                                <Option value="docx">DOCX文档</Option>
                                <Option value="pdf">PDF文档</Option>
                                <Option value="ppt">PPT演示文档</Option>
                            </Select>
                        </div>

                        {/* PDF文档智能体配置区域 */}
                        <div style={{
                            padding: '20px',
                            border: '1px solid #ddd',
                            borderRadius: '5px',
                            backgroundColor: '#f9f9f9',
                            marginBottom: '20px'
                        }}>
                            <h3 style={{ marginBottom: '15px', fontWeight: 600 }}>PDF文档智能体配置</h3>
                            
                            {/* 标准格式文档上传 */}
                            <div style={{ marginBottom: '20px' }}>
                                <h4 style={{ marginBottom: '10px', fontWeight: 500 }}>标准格式文档上传</h4>
                                <p style={{ marginBottom: '10px', color: '#666' }}>上传该类型文件的标准格式模板，用于定义文档结构和格式规范</p>
                                <Button type="primary" style={{ marginBottom: '10px' }}>选择标准格式文档</Button>
                                <p style={{ color: '#999' }}>未选择文件</p>
                            </div>
                            
                            {/* 审阅任务Prompt编辑 */}
                            <div>
                                <h4 style={{ marginBottom: '10px', fontWeight: 500 }}>审阅任务Prompt编辑</h4>
                                <p style={{ marginBottom: '10px', color: '#666' }}>编辑针对PDF文档的审阅任务提示词，明确定义审阅的内容和标准</p>
                                
                                {/* 文本输入框 - 使用Ant Design的TextArea组件 */}
                                <TextArea
                                    value={this.state.reviewPrompt}
                                    onChange={(e) => this.setState({ reviewPrompt: e.target.value })}
                                    placeholder="请输入审阅任务提示词"
                                    style={{
                                        border: '1px solid #d9d9d9',
                                        borderRadius: '4px',
                                        padding: '10px',
                                        height: '200px',
                                        backgroundColor: '#fff',
                                        marginBottom: '15px'
                                    }}
                                    rows={8}
                                    showCount
                                    maxLength={1000}
                                    autoSize={{ minRows: 8, maxRows: 12 }}
                                />
                                
                                {/* 保存配置按钮 */}
                                <Button 
                                    type="primary" 
                                    size="large"
                                    onClick={this.handleSavePrompt}
                                >
                                    保存配置
                                </Button>
                            </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
