提交 40073b03 authored 作者: 钟是志's avatar 钟是志

uploadZipConfig 增加参数

上级 03541547
......@@ -20,15 +20,22 @@ export default class UploadZipCom extends Component{
if (info.file.status === 'done') {
message.success(`${info.file.name} 上传压缩包成功,正在保存数据,请稍后`);
this.setState({ file: info.file.response, confirmLoading: true });
uaaRequest('/DataObjApi/importZip', {
let params = {
dataObjId: this.props.dataObjId,
isExchange: this.config.isExchange,
nameKey: this.config.nameKey,
valueKey: this.config.valueKey,
zipPath: info.file.response,
}).then(() => {
};
if(this.config.otherParams){
params = {
...params,
...this.config.otherParams,
}
}
uaaRequest('/DataObjApi/importZip', params).then(() => {
this.setState({ confirmLoading: false });
message.success(`数据保存成功`);
message.success('数据保存成功');
});
} else if (info.file.status === 'error') {
message.error(`${info.file.name} 上传失败`);
......@@ -44,7 +51,6 @@ export default class UploadZipCom extends Component{
render() {
const { confirmLoading, showModal } = this.state;
const { modalMessageHtml, modalTitle = '上传zip压缩包文件' } = this.config;
const { file } = this.state;
const props = {
name: 'file',
multiple: false,
......@@ -76,7 +82,7 @@ export default class UploadZipCom extends Component{
flexDirection: 'column',
}}>
<div style={{ margin: '10px 0' }}>
<div dangerouslySetInnerHTML={{ __html: modalMessageHtml }}></div>
<div dangerouslySetInnerHTML={{ __html: modalMessageHtml }} />
</div>
<Upload {...props}>
<Button {...btn} type='danger' loading={confirmLoading}>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论