import { useRef, useState, useEffect } from 'react';
import { connect, request } from '@umijs/max';
import { baseUrl } from '@/constants/index'
import type { UploadProps } from 'antd';
import { InboxOutlined } from '@ant-design/icons';
import type { ActionType, ProFormInstance } from '@ant-design/pro-components';
import {
    EditableProTable,
    ProDescriptions
} from '@ant-design/pro-components';
import { ConfigProvider, Upload, Descriptions, Radio, Modal, message, Image, Button, Row, Col, Input, Checkbox, Segmented, DatePicker } from 'antd';
import { GetJobseekerDetail, PostJobapplicantUpdate, PostJobapplicantUpdatecontact, GetJobapplicantContactdetail, PostJobapplicantUpdatedesirebase , PostJobapplicantDesirebasedetail} from '@/apis/api';
import { Imageprefix } from '@/constants';
import { verifyPhone, verifyIdCard } from '@/utils/VerifyHelper';
import { disAfterData } from '@/utils/format'
import UploadModel from '@/components/Common/upload';
import DragUpload from '@/components/Common/dragupload';
import RichComponent from '@/components/Common/rich';
import dayjs from 'dayjs';

const selectfieldNames = { label: 'name', value: 'id' };
const cascaderfieldNames = { label: 'name', value: 'id', children: 'children' };



const PagesMainJobseekerListRegister: React.FC = ({ dispatch, dictModel, openModel, id }: any) => {
    const actionRef = useRef();
    const [editableKeys, setEditableRowKeys] = useState<React.Key[]>([]);
    const [openPreview, setOpenPreview] = useState(false);
    const [detail, setDetail] = useState(null)
    const [needPrint, setNeedPrint] = useState<boolean>(false) // 要打印的时候隐藏操作

    useEffect(() => {
        setOpenPreview(openModel.openRegisterModal)
    }, [openModel.openRegisterModal])

    const [uploadedFilephotoName, setUploadedFilephotoName] = useState<string>('');
    const handleFileUploadedphoto = (filename: string) => {
        setUploadedFilephotoName(filename);
    };

    const [showUplaod, setShowUplaod] = useState<boolean>(false);
    const [uploadedFileDocName, setUploadedFileDocName] = useState<string>('');
    const handleFileUploadedDoc = (filename: string) => {
        setUploadedFileDocName(filename);
    };

    const [richTxt, setRichTxt] = useState<string | number>(''); // 文章内容

    useEffect(() => {
        dispatch({ type: 'dictModel/getList', payload: { code: 2011, type: 'setMaritalList' } })
        dispatch({ type: 'dictModel/getList', payload: { code: 2006, type: 'setEducationList' } })
        dispatch({ type: 'dictModel/getList', payload: { code: 2012, type: 'setEthnicityList' } })
        dispatch({ type: 'dictModel/getList', payload: { code: 2020, type: 'setTalentTypeList' } })
        dispatch({ type: 'dictModel/getList', payload: { code: 2008, type: 'setDegreeList' } })
        dispatch({ type: 'dictModel/getList', payload: { code: 2023, type: 'setVehicleList' } })
        dispatch({ type: 'dictModel/getList', payload: { code: 2024, type: 'setOvertimeList' } })
        dispatch({ type: 'dictModel/getList', payload: { code: 2009, type: 'setAreaList' } })
    }, [])

    const [aaaa, setAaaa] = useState('');


    return (
        <>
            <ConfigProvider
                theme={{

                }}
            >
                <Modal
                    open={openPreview}
                    centered
                    footer={null}
                    maskClosable={false}
                    destroyOnClose
                    width={1200}
                    onCancel={() => {
                        dispatch({ type: 'openModel/getOpenRegisterModal', payload: false })
                    }}
                    afterOpenChange={async (open) => {
                        if (open) {
                            let res = await GetJobseekerDetail({ customer_id: id.customer_id, application_id: id.id })
                            setDetail(res.data)
                        }
                    }}
                >
                    {
                        detail && <>
                            <div id="export-container">
                                <h1 style={{
                                    fontWeight: 'bold',
                                    textAlign: 'center',
                                    marginBottom: '20px'
                                }}>就业服务登记表</h1>
                                {aaaa}
                                <ProDescriptions
                                    labelStyle={{
                                        width: '120px'
                                    }}
                                    bordered={true}
                                    actionRef={actionRef}
                                    column={24}
                                    request={async () => {
                                        console.log(detail)
                                        return Promise.resolve({
                                            success: true,
                                            data: detail
                                        });
                                    }}
                                    editable={{
                                        onSave: async (key, row) => {
                                            setAaaa(key)
                                            console.log(key)
                                            console.log(row, dayjs(row.dob).format("YYYY-MM-DD"))
                                            let res: any = null;
                                            let resDetail: any = null;
                                            switch (key) {
                                                case 'seekername':
                                                    res = await PostJobapplicantUpdate({ id: detail.id, customer_id: detail.customer_id, name: row.seekername })
                                                    resDetail = await GetJobseekerDetail({ customer_id: id.customer_id, application_id: id.id })
                                                    setDetail((prevState: any) => ({
                                                        ...prevState,
                                                        seekername: resDetail.data.seekername
                                                    }));
                                                    break;
                                                case 'gender':
                                                    res = await PostJobapplicantUpdate({ id: detail.id, customer_id: detail.customer_id, gender: row.gender })
                                                    resDetail = await GetJobseekerDetail({ customer_id: id.customer_id, application_id: id.id })
                                                    setDetail((prevState: any) => ({
                                                        ...prevState,
                                                        gender: resDetail.data.gender
                                                    }));
                                                    break;
                                                case 'dob':
                                                    res = await PostJobapplicantUpdate({ id: detail.id, customer_id: detail.customer_id, dob: dayjs(row.dob).format("YYYY-MM-DD") })
                                                    resDetail = await GetJobseekerDetail({ customer_id: id.customer_id, application_id: id.id })

                                                    setDetail((prevState: any) => ({
                                                        ...prevState,
                                                        dob: resDetail.data.dob
                                                    }));
                                                    break;
                                                case 'marital_status_txt':
                                                    res = await PostJobapplicantUpdate({ id: detail.id, customer_id: detail.customer_id, marital_status: row.marital_status_txt })
                                                    resDetail = await GetJobseekerDetail({ customer_id: id.customer_id, application_id: id.id })
                                                    setDetail((prevState: any) => ({
                                                        ...prevState,
                                                        marital_status_txt: resDetail.data.marital_status_txt
                                                    }));
                                                    break;
                                                case 'education_txt':
                                                    res = await PostJobapplicantUpdate({ id: detail.id, customer_id: detail.customer_id, education: row.education_txt })
                                                    resDetail = await GetJobseekerDetail({ customer_id: id.customer_id, application_id: id.id })
                                                    setDetail((prevState: any) => ({
                                                        ...prevState,
                                                        education_txt: resDetail.data.education_txt
                                                    }));
                                                    break;
                                                case 'ethnicity_txt':
                                                    res = await PostJobapplicantUpdate({ id: detail.id, customer_id: detail.customer_id, ethnicity: row.ethnicity_txt })
                                                    resDetail = await GetJobseekerDetail({ customer_id: id.customer_id, application_id: id.id })

                                                    setDetail((prevState: any) => ({
                                                        ...prevState,
                                                        ethnicity_txt: resDetail.data.ethnicity_txt
                                                    }));
                                                    break;
                                                case 'mobile':
                                                    if (verifyPhone(row.mobile)) {
                                                        let rescontact = await GetJobapplicantContactdetail({ id: detail.id, customer_id: detail.customer_id });
                                                        res = await PostJobapplicantUpdatecontact({ id: rescontact.data.id, customer_id: detail.customer_id, mobile: row.mobile })
                                                        resDetail = await GetJobseekerDetail({ customer_id: id.customer_id, application_id: id.id })
                                                        setDetail((prevState: any) => ({
                                                            ...prevState,
                                                            mobile: resDetail.data.mobile
                                                        }));
                                                    } else {
                                                        return false;
                                                    }
                                                    break;

                                                case 'id_number':
                                                    if (verifyIdCard(row.id_number)) {
                                                        res = await PostJobapplicantUpdate({ id: detail.id, customer_id: detail.customer_id, id_number: row.id_number })
                                                        resDetail = await GetJobseekerDetail({ customer_id: id.customer_id, application_id: id.id })

                                                        setDetail((prevState: any) => ({
                                                            ...prevState,
                                                            id_number: resDetail.data.id_number
                                                        }));
                                                    } else {
                                                        return false;
                                                    }
                                                    break;
                                                case 'now_level':
                                                    res = await PostJobapplicantUpdate({
                                                        id: detail.id,
                                                        customer_id: detail.customer_id,
                                                        now_level1: row.now_level.length > 0 && row.now_level[0] ? row.now_level[0] : 0,
                                                        now_level2: row.now_level.length > 0 && row.now_level[1] ? row.now_level[1] : 0,
                                                        now_level3: row.now_level.length > 0 && row.now_level[2] ? row.now_level[2] : 0,
                                                        now_level4: row.now_level.length > 0 && row.now_level[3] ? row.now_level[3] : 0,
                                                    })
                                                    resDetail = await GetJobseekerDetail({ customer_id: id.customer_id, application_id: id.id })
                                                    console.log(resDetail.data);
                                                    setDetail((prevState: any) => ({
                                                        ...prevState,
                                                        now_level1_txt: '111',
                                                        now_level2_txt: resDetail.data.now_level2_txt,
                                                        now_level3_txt: resDetail.data.now_level3_txt,
                                                        now_level4_txt: resDetail.data.now_level4_txt
                                                    }));
                                                    break;
                                                case 'reg_level':
                                                    res = await PostJobapplicantUpdate({
                                                        id: detail.id,
                                                        customer_id: detail.customer_id,
                                                        reg_level1: row.reg_level.length > 0 && row.reg_level[0] ? row.reg_level[0] : 0,
                                                        reg_level2: row.reg_level.length > 0 && row.reg_level[1] ? row.reg_level[1] : 0,
                                                        reg_level3: row.reg_level.length > 0 && row.reg_level[2] ? row.reg_level[2] : 0,
                                                        reg_level4: row.reg_level.length > 0 && row.reg_level[3] ? row.reg_level[3] : 0,
                                                    })
                                                    resDetail = await GetJobseekerDetail({ customer_id: id.customer_id, application_id: id.id })
                                                    setDetail((prevState: any) => ({
                                                        ...prevState,
                                                        reg_level1_txt: resDetail.data.reg_level1_txt,
                                                        reg_level2_txt: resDetail.data.reg_level2_txt,
                                                        reg_level3_txt: resDetail.data.reg_level3_txt,
                                                        reg_level4_txt: resDetail.data.reg_level4_txt
                                                    }));
                                                    break;
                                                case 'talent_type_txt':
                                                    res = await PostJobapplicantUpdatedesirebase({
                                                        id: detail.id,
                                                        customer_id: detail.customer_id,
                                                        talent_type: row.talent_type
                                                    })
                                                    resDetail = await GetJobseekerDetail({ customer_id: id.customer_id, application_id: id.id })
                                                    setDetail((prevState: any) => ({
                                                        ...prevState,
                                                        talent_type_txt: resDetail.data.talent_type_txt
                                                    }));
                                                    break;

                                            }
                                        }
                                    }}
                                    columns={[
                                        {
                                            span: 8,
                                            title: '姓名',
                                            key: 'seekername',
                                            dataIndex: 'seekername',
                                        },
                                        {
                                            span: 4,
                                            title: '性别',
                                            key: 'gender',
                                            dataIndex: 'gender',
                                            valueType: 'select',
                                            valueEnum: {
                                                '男': {
                                                    text: '男',
                                                },
                                                '女': {
                                                    text: '女',
                                                },
                                            },
                                        },
                                        {
                                            span: 8,
                                            title: '出生日期',
                                            key: 'dob',
                                            dataIndex: 'dob',
                                            valueType: 'date',
                                        },
                                        {
                                            span: 4,
                                            title: '婚姻状况',
                                            key: 'marital_status_txt',
                                            dataIndex: 'marital_status_txt',
                                            valueType: 'select',
                                            fieldProps: {
                                                fieldNames: selectfieldNames,
                                            },
                                            request: () => {
                                                return dictModel.maritalList
                                            },
                                        },
                                        {
                                            span: 6,
                                            title: '文化程度',
                                            key: 'education',
                                            dataIndex: 'education_txt',
                                            valueType: 'select',
                                            fieldProps: {
                                                fieldNames: selectfieldNames,
                                            },
                                            request: () => {
                                                return dictModel.educationList
                                            },
                                        },
                                        {
                                            span: 6,
                                            title: '毕业学校',
                                            key: 'school_name',
                                            dataIndex: 'school_name',
                                            editable: false,
                                            render: (dom, entity, index, action) => {
                                                return (
                                                    <>
                                                        {
                                                            detail.trainings && detail.trainings.length > 0 && (
                                                                <span>
                                                                    {detail.trainings[0].school_or_institution}
                                                                </span>
                                                            )
                                                        }
                                                    </>
                                                )
                                            },
                                        }, {
                                            span: 6,
                                            title: '专业',
                                            key: 'major',
                                            dataIndex: 'major',
                                            editable: false,
                                            render: (dom, entity, index, action) => {
                                                return (
                                                    <>
                                                        {
                                                            detail.trainings && detail.trainings.length > 0 && (
                                                                <span>
                                                                    {detail.trainings[0].major}
                                                                </span>
                                                            )
                                                        }
                                                    </>
                                                )
                                            },

                                        },
                                        {
                                            span: 6,
                                            title: '民族',
                                            key: 'ethnicity',
                                            dataIndex: 'ethnicity_txt',
                                            valueType: 'select',
                                            fieldProps: {
                                                fieldNames: selectfieldNames,
                                                children: (
                                                    <>
                                                        ddd
                                                    </>
                                                )
                                            },
                                            request: () => {
                                                return dictModel.ethnicityList
                                            },
                                        },
                                        {
                                            span: 12,
                                            title: '联系方式',
                                            key: 'mobile',
                                            dataIndex: 'mobile',
                                        },
                                        {
                                            span: 12,
                                            title: '身份证号',
                                            key: 'id_number',
                                            dataIndex: 'id_number',
                                        },
                                        {
                                            span: 12,
                                            title: '现居住地',
                                            key: 'now_level',
                                            dataIndex: 'now_level',
                                            valueType: 'cascader',
                                            fieldProps: {
                                                fieldNames: cascaderfieldNames,
                                            },
                                            request: () => {
                                                return dictModel.areaList
                                            },
                                            render: (dom, entity, index, action) => {
                                                return (
                                                    <>
                                                        <span>
                                                            {entity.now_level1_txt ? entity.now_level1_txt : ''}
                                                            {entity.now_level2_txt ? entity.now_level2_txt : ''}
                                                            {entity.now_level3_txt ? entity.now_level3_txt : ''}
                                                            {entity.now_level4_txt ? entity.now_level4_txt : ''}
                                                        </span>
                                                    </>
                                                )
                                            },
                                        },
                                        {
                                            span: 12,
                                            title: '户口所在地',
                                            key: 'reg_level',
                                            dataIndex: 'reg_level',
                                            valueType: 'cascader',
                                            fieldProps: {
                                                fieldNames: cascaderfieldNames,
                                            },
                                            request: () => {
                                                return dictModel.areaList
                                            },
                                            render: (dom, entity, index, action) => {
                                                return (
                                                    <>
                                                        <span>
                                                            {entity.reg_level1_txt ? entity.reg_level1_txt : ''}
                                                            {entity.reg_level2_txt ? entity.reg_level2_txt : ''}
                                                            {entity.reg_level3_txt ? entity.reg_level3_txt : ''}
                                                            {entity.reg_level4_txt ? entity.reg_level4_txt : ''}
                                                        </span>
                                                    </>
                                                )
                                            },
                                        },
                                        {
                                            span: 24,
                                            title: '人员类别',
                                            key: 'talent_type',
                                            dataIndex: 'talent_type_txt',
                                            editable: false,
                                            render: (dom, entity, index, action) => {
                                                return (
                                                    <>
                                                        {
                                                            dictModel.talentTypeList.filter(item => [1001091, 1001092, 1001093, 1001028].includes(item.id)).map(item => (
                                                                <Radio key={item.id} value={item.id} checked={entity.talent_type == item.id} onChange={async (e) => {
                                                                    if (e.target.checked) {
                                                                        let resIntentionBase = await PostJobapplicantDesirebasedetail({ id: detail.id, customer_id: detail.customer_id });
                                                                        if(resIntentionBase.code == 404) {
                                                                            let res = await PostJobapplicantUpdatedesirebase({
                                                                                id: resIntentionBase.data.id,
                                                                                customer_id: detail.customer_id,
                                                                                talent_type: e.target.value
                                                                            })
                                                                            let resDetail = await GetJobseekerDetail({ customer_id: id.customer_id, application_id: id.id })
                                                                            setDetail((prevState: any) => ({
                                                                                ...prevState,
                                                                                talent_type_txt: resDetail.data.talent_type_txt
                                                                            }));
                                                                        } else {
                                                                            
                                                                        }
                                                                        
                                                                    }
                                                                }}>{item.name}</Radio>
                                                            ))
                                                        }
                                                    </>
                                                )
                                            },
                                        },
                                        {
                                            span: 10,
                                            title: '电脑水平',
                                            key: 'talent_type',
                                            dataIndex: 'talent_type_txt',
                                            editable: false,
                                            render: (dom, entity, index, action) => {
                                                return (
                                                    <>
                                                        {
                                                            dictModel.degreeList.filter(item => [100103, 100101, 1001096].includes(item.id)).map(item => (
                                                                <Radio key={item.id} value={item.id} checked={entity.talent_type == item.name}>{item.name}</Radio>
                                                            ))
                                                        }
                                                    </>
                                                )
                                            },

                                        },
                                        {
                                            span: 8,
                                            title: '普通话水平',
                                            key: 'mandarin',
                                            dataIndex: 'mandarin_txt',
                                            editable: false,
                                            render: (dom, entity, index, action) => {
                                                return (
                                                    <>
                                                        {
                                                            dictModel.degreeList.filter(item => [1001095, 100101, 1001096].includes(item.id)).map(item => (
                                                                <Radio key={item.id} value={item.id} checked={entity.mandarin == item.id}>{item.name}</Radio>
                                                            ))
                                                        }
                                                    </>
                                                )
                                            },

                                        },
                                        {
                                            span: 6,
                                            title: '外语水平',
                                            key: 'marital_status',
                                            dataIndex: 'marital_status_txt',
                                            valueType: 'select',
                                            fieldProps: {
                                                fieldNames: selectfieldNames,
                                            },
                                            request: (key, number) => {
                                                return dictModel.degreeList
                                            },
                                        },
                                        {
                                            span: 10,
                                            title: '交通工具',
                                            key: 'talent_type',
                                            dataIndex: 'talent_type_txt',
                                            editable: false,
                                            render: (dom, entity, index, action) => {
                                                return (
                                                    <>
                                                        {
                                                            dictModel.vehicleList.filter(item => [1001098, 1001099, 1001100, 1001101].includes(item.id)).map(item => (
                                                                <Radio key={item.id} value={item.id}>{item.name}</Radio>
                                                            ))
                                                        }
                                                    </>
                                                )
                                            },
                                        },
                                        {
                                            span: 4,
                                            title: '驾照类型',
                                            key: 'seekername',
                                            dataIndex: 'seekername',
                                        },
                                        {
                                            span: 10,
                                            title: '可否加夜班',
                                            key: 'talent_type',
                                            dataIndex: 'talent_type_txt',
                                            editable: false,
                                            render: (dom, entity, index, action) => {
                                                return (
                                                    <>
                                                        {
                                                            dictModel.overtimeList.filter(item => [1001103, 1001104, 1001105].includes(item.id)).map(item => (
                                                                <Radio key={item.id} value={item.id}>{item.name}</Radio>
                                                            ))
                                                        }
                                                    </>
                                                )
                                            },
                                        },
                                        {
                                            span: 24,
                                            title: '学习或工作经历',
                                            key: 'seekername',
                                            dataIndex: 'seekername',
                                            editable: false,
                                            render: (text: any, record: any) => (
                                                <>
                                                    <EditableProTable
                                                        rowKey="id"
                                                        loading={false}
                                                        value={[
                                                            {
                                                                id: '1',
                                                                date: '2020-12-12',
                                                                danwei: 'kgkjgk',
                                                                gangwei: 'dsfsfsdf'
                                                            },
                                                            {
                                                                id: '2',
                                                                date: '2020-12-12',
                                                                danwei: 'kgkjgk',
                                                                gangwei: 'dsfsfsdf'
                                                            },
                                                            {
                                                                id: '3',
                                                                date: '2020-12-12',
                                                                danwei: 'kgkjgk',
                                                                gangwei: 'dsfsfsdf'
                                                            }
                                                        ]}
                                                        columns={[
                                                            {
                                                                title: '起止时间',
                                                                dataIndex: 'date',
                                                                valueType: 'dateRange',
                                                                fieldProps: {
                                                                    format: 'YYYY-MM'
                                                                },
                                                            },
                                                            {
                                                                title: '学校/工作单位',
                                                                dataIndex: 'danwei',
                                                            },
                                                            {
                                                                title: '职务/工作岗位',
                                                                dataIndex: 'gangwei',
                                                            },
                                                            {
                                                                title: '操作',
                                                                valueType: 'option',
                                                                width: 200,
                                                                render: (text, record, _, action) => [
                                                                    <a
                                                                        key="editable"
                                                                        onClick={() => {
                                                                            action?.startEditable?.(record.id);
                                                                        }}
                                                                    >
                                                                        编辑
                                                                    </a>,
                                                                    <a
                                                                        key="delete"
                                                                        onClick={() => {
                                                                        }}
                                                                    >
                                                                        删除
                                                                    </a>,
                                                                ],
                                                            },
                                                        ]}
                                                        editable={{
                                                            type: 'multiple',
                                                            editableKeys,
                                                            onSave: async (rowKey, data, row) => {
                                                                console.log(rowKey, data, row);
                                                            },
                                                            onChange: setEditableRowKeys,
                                                        }}
                                                        recordCreatorProps={
                                                            {
                                                                position: 'bottom',
                                                                record: () => ({ id: (Math.random() * 1000000).toFixed(0) }),
                                                            }
                                                        }
                                                    />
                                                </>
                                            ),
                                        },
                                        {
                                            span: 24,
                                            title: '求职意向',
                                            editable: false,
                                            render: (dom, entity, index, action) => {
                                                return (
                                                    <>
                                                        <Row gutter={[16, 16]}>
                                                            <Col span={4} style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>想从事职位</Col>
                                                            <Col span={20} >
                                                                <Row gutter={[16, 16]} style={{ padding: '8px' }}>
                                                                    <Col span={8} style={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-start' }}><div>1、</div> <Input style={{ width: '80%' }}></Input></Col>
                                                                    <Col span={8} style={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-start' }}><div>2、</div><Input style={{ width: '80%' }}></Input></Col>
                                                                    <Col span={8} style={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-start' }}><div>3、</div><Input style={{ width: '80%' }}></Input></Col>
                                                                </Row>
                                                                <Row gutter={[16, 16]} style={{ padding: '8px' }}>
                                                                    <Col span={14}>4、是否接收其他职位的推荐（<Checkbox></Checkbox>） </Col>
                                                                    <Col span={10} style={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-start' }}>薪酬要求：<Input style={{ width: '40%' }}></Input>  元/月</Col>
                                                                </Row>
                                                            </Col>
                                                        </Row>
                                                    </>
                                                )
                                            },
                                        },

                                        {
                                            span: 24,
                                            title: '介绍工作情况',
                                            editable: false,
                                            render: (dom, entity, index, action) => {
                                                return (
                                                    <>
                                                        <Row gutter={[16, 16]}>
                                                            <Col span={14} style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
                                                                <Row gutter={[16, 16]} style={{ padding: '8px' }}>
                                                                    <EditableProTable
                                                                        showHeader={false}
                                                                        scroll={{
                                                                            x: '100%'
                                                                        }}
                                                                        rowKey="id"
                                                                        loading={false}
                                                                        value={[
                                                                            {
                                                                                id: '1',
                                                                                date: '2020-12-12',
                                                                                danwei: 'kgkjgk',
                                                                                gangwei: 'dsfsfsdf'
                                                                            },
                                                                            {
                                                                                id: '2',
                                                                                date: '2020-12-12',
                                                                                danwei: 'kgkjgk',
                                                                                gangwei: 'dsfsfsdf'
                                                                            },

                                                                        ]}
                                                                        columns={[
                                                                            {
                                                                                dataIndex: 'date',
                                                                            },
                                                                            {
                                                                                valueType: 'option',
                                                                                width: 200,
                                                                                render: (text, record, _, action) => [
                                                                                    <a
                                                                                        key="editable"
                                                                                        onClick={() => {
                                                                                            action?.startEditable?.(record.id);
                                                                                        }}
                                                                                    >
                                                                                        编辑
                                                                                    </a>,
                                                                                    <a
                                                                                        key="delete"
                                                                                        onClick={() => {
                                                                                        }}
                                                                                    >
                                                                                        删除
                                                                                    </a>,
                                                                                ],
                                                                            },
                                                                        ]}
                                                                        editable={{
                                                                            type: 'multiple',
                                                                            editableKeys,
                                                                            onSave: async (rowKey, data, row) => {
                                                                                console.log(rowKey, data, row);
                                                                            },
                                                                            onChange: setEditableRowKeys,
                                                                        }}
                                                                        recordCreatorProps={
                                                                            {
                                                                                position: 'bottom',
                                                                                record: () => ({ id: (Math.random() * 1000000).toFixed(0) }),
                                                                            }
                                                                        }
                                                                    />
                                                                </Row>
                                                            </Col>
                                                            <Col span={10} >
                                                                <Row gutter={[16, 16]} style={{ padding: '8px' }}>
                                                                    <Upload.Dragger
                                                                        name='file'
                                                                        customRequest={
                                                                            (e) => {
                                                                                let formdata = new FormData();
                                                                                formdata.append('image', e.file);
                                                                                console.log(formdata)
                                                                                request(baseUrl + '/common/image/upload?imgtype=3', {
                                                                                    method: 'post',
                                                                                    data: formdata,
                                                                                    Headers: {
                                                                                        Authorization: sessionStorage.getItem('token'),
                                                                                        'X-Requested-With': null
                                                                                    }
                                                                                }).then(res => {

                                                                                }).catch(err => {
                                                                                    console.log(err)
                                                                                    message.error('上传失败')
                                                                                })
                                                                            }
                                                                        } style={{ width: '100%', padding: '0 100px' }}
                                                                    >
                                                                        <p className="ant-upload-drag-icon">
                                                                            <InboxOutlined />
                                                                        </p>
                                                                        <p className="ant-upload-text">相片或身份证复印处</p>
                                                                        <p className="ant-upload-hint">
                                                                            可拖拽上传或者点击选择上传
                                                                        </p>
                                                                    </Upload.Dragger>
                                                                </Row>
                                                            </Col >
                                                        </Row>
                                                    </>
                                                )
                                            },
                                        },
                                        {
                                            span: 24,
                                            title: '帮扶情况',
                                            editable: false,
                                            render: (dom, entity, index, action) => {
                                                return (
                                                    <>
                                                        <EditableProTable
                                                            showHeader={false}
                                                            scroll={{
                                                                x: '100%'
                                                            }}
                                                            rowKey="id"
                                                            loading={false}
                                                            value={[
                                                                {
                                                                    id: '1',
                                                                    date: '2020-12-12',
                                                                    danwei: 'kgkjgk',
                                                                    gangwei: 'dsfsfsdf'
                                                                },
                                                                {
                                                                    id: '2',
                                                                    date: '2020-12-12',
                                                                    danwei: 'kgkjgk',
                                                                    gangwei: 'dsfsfsdf'
                                                                },

                                                            ]}
                                                            columns={[
                                                                {
                                                                    dataIndex: 'date',
                                                                },
                                                                {
                                                                    valueType: 'option',
                                                                    width: 200,
                                                                    render: (text, record, _, action) => [
                                                                        <a
                                                                            key="editable"
                                                                            onClick={() => {
                                                                                action?.startEditable?.(record.id);
                                                                            }}
                                                                        >
                                                                            编辑
                                                                        </a>,
                                                                        <a
                                                                            key="delete"
                                                                            onClick={() => {
                                                                            }}
                                                                        >
                                                                            删除
                                                                        </a>,
                                                                    ],
                                                                },
                                                            ]}
                                                            editable={{
                                                                type: 'multiple',
                                                                editableKeys,
                                                                onSave: async (rowKey, data, row) => {
                                                                    console.log(rowKey, data, row);
                                                                },
                                                                onChange: setEditableRowKeys,
                                                            }}
                                                            recordCreatorProps={
                                                                {
                                                                    position: 'bottom',
                                                                    record: () => ({ id: (Math.random() * 1000000).toFixed(0) }),
                                                                }
                                                            }
                                                        />
                                                    </>
                                                )
                                            },
                                        },
                                    ]}
                                >

                                </ProDescriptions>
                            </div>
                        </>
                    }


                </Modal >
            </ConfigProvider >
        </>
    );
};



export default connect(({ dictModel, openModel }: any) => ({
    dictModel, openModel
}))(PagesMainJobseekerListRegister);