import React, { useEffect, useState } from 'react' import { connect } from 'react-redux'; import moment from 'moment'; import { UploadLocal } from '$components'; import { Tabs, Form, Input, DatePicker, Button, Modal, Select, Tag } from 'antd'; function FileModal ({ loading, parent, user, actions, editData = {}, dispatch, close, success,remove }) { const { dataQuality } = actions const [tabsKey, setTabsKey] = useState("stay") const [query, setQuery] = useState({ page: 0, limit: 10 }); const [proTableList, setProTableList] = useState({ rows: [], count: 0 }); const [approve, setApprove] = useState() const [form] = Form.useForm(); const [editUrl, setEditUrl] = useState([]); useEffect(() => { }, []) const vsjunct = (params) => { if (params.length) { let appendix = [] for (let p of params) { appendix.push({ fName: p.name, size: p.size, fileSize: p.size, storageUrl: p.storageUrl,//必须有storageUrl }) } setEditUrl(appendix) } else { setEditUrl([]) } } return <> { form.validateFields().then(v => { dispatch(dataQuality.postStandardDocs({ ...v, path: v?.files[0]?.url, docName: v?.files[0]?.name, folder: parent || null, })).then(res => { if (res.success) { close() success() } }) }) }} onCancel={() => { if (form.getFieldValue('files') && form.getFieldValue('files').length) { remove(form.getFieldValue('files')[0]?.url) } close() }} >
{ }} autoComplete="off" labelCol={{ span: 4 }} wrapperCol={{ span: 20 }} > 文件大小不超过40MB,开放资源包含多个文件,建议将文件进行压缩,形成压缩包再上传 支持的文件格式:jpg,png,gif,txt,doc,docx,pdf,xsl,xlsx,zip,rar
} function mapStateToProps (state) { const { global, auth, resourceCatalog } = state; return { user: auth.user, actions: global.actions, clientHeight: global.clientHeight, // resourceCatalog: resourceCatalog?.data || [], // isRequesting: resourceCatalog.isRequesting }; } export default connect(mapStateToProps)(FileModal)