96 lines
2.4 KiB
JavaScript
96 lines
2.4 KiB
JavaScript
import {
|
|
WeaNewScroll,
|
|
WeaSearchGroup,
|
|
WeaMoreButton,
|
|
WeaDialog
|
|
} from 'ecCom'
|
|
import {
|
|
inject,
|
|
observer,
|
|
} from 'mobx-react'
|
|
import {
|
|
Spin,
|
|
Button,
|
|
Pagination,
|
|
Steps
|
|
} from 'antd'
|
|
|
|
import {
|
|
WeaSwitch,
|
|
WeaTableNew
|
|
} from 'comsMobx'
|
|
|
|
import {
|
|
i18n
|
|
} from '../../public/i18n';
|
|
|
|
const Step = Steps.Step;
|
|
import StepContent from './stepContent';
|
|
|
|
@inject("newImport")
|
|
@observer
|
|
export default class StepDialog extends React.Component {
|
|
constructor(props) {
|
|
super(props);
|
|
this.state = {
|
|
width: 800,
|
|
height: 600,
|
|
title: '数据导入',
|
|
}
|
|
}
|
|
|
|
next() {
|
|
const {newImport} = this.props;
|
|
let {current,steps} = newImport;
|
|
current = current + 1;
|
|
if (current === steps.length) {
|
|
current = 0;
|
|
newImport.init();
|
|
}
|
|
newImport.current = current;
|
|
current === 1 && newImport.getImportForm();
|
|
current === steps.length - 1 && newImport.getImportResult();
|
|
}
|
|
|
|
render() {
|
|
const {
|
|
newImport
|
|
} = this.props, {
|
|
current,
|
|
visible,
|
|
steps
|
|
} = newImport,{
|
|
width,
|
|
height,
|
|
title
|
|
} = this.state;
|
|
|
|
const buttons = [
|
|
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@jd6baw`} type="primary" onClick={() => this.next()}>{current === steps.length - 1 ? '导入完成' : i18n.button.nextStep()}</Button>),
|
|
];
|
|
|
|
return (
|
|
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@1txk5f`}
|
|
title={title}
|
|
icon="icon-coms-upload"
|
|
iconBgcolor="#217346"
|
|
visible={visible}
|
|
closable={true}
|
|
hasScroll={true}
|
|
onCancel={() => newImport.init()}
|
|
buttons={buttons}
|
|
style={{ width: width, height: height }}
|
|
>
|
|
<div style={{ marginTop: 24 }}>
|
|
<Steps current={current}>
|
|
{steps.map((s, i) => <Step key={i} title={s.title} description={s.description} />)}
|
|
</Steps>
|
|
</div>
|
|
<div style={{ padding: 24 }}>
|
|
<StepContent ecId={`${this && this.props && this.props.ecId || ''}_StepContent@633i8k`}/>
|
|
</div>
|
|
|
|
</WeaDialog>
|
|
)
|
|
}
|
|
} |