import InitForm from '../InitForm'; import { Drawer, Upload,message} from 'antd'; import React, { useState, memo } from 'react'; import DetailPro from '../DetailPro'; import { InboxOutlined } from "@ant-design/icons" function DrawerPro(props) { let token = localStorage.getItem('TOKENSTRING'); let newProps = { ...props }; delete newProps.children; const detailprops = { title: props.title, detailpath: props.detailpath, fields: props.fields, detailData: props.detailData, params: props.params, }; const fields = newProps?.fields?.filter?.((it, i) => { return it?.valueType != 'option'; }); const propes = { name: 'files', multiple: true, action: REACT_APP_URL + props?.importurl, onChange(info) { const { status } = info.file; if (status !== 'uploading') { console.log(info.file, info.fileList); } if (status === 'done') { message.success(`${info?.file?.response?.data?.length??0}条数据已导入成功!`); props?.refresh(); } else if (status === 'error') { message.error(`${info.file.name}导入失败`); } }, onDrop(e) { console.log('Dropped files', e.dataTransfer.files); }, }; return ( {props.val == 'only' && props.children} {props.val == 'only' ? null : props.val == 'detail' ? ( ) : props.val == 'import' ? (

拖拽文件到此处上传excel数据

仅支持上传Excel文件,否则无法解析数据

) : ( )}
); } export default DrawerPro;