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

表单设计器导入组件 修改

上级 5b9097e7
...@@ -11,6 +11,8 @@ const Step = Steps.Step; ...@@ -11,6 +11,8 @@ const Step = Steps.Step;
const TabPane = Tabs.TabPane; const TabPane = Tabs.TabPane;
const exportExcel = CLIENT_TYPE == 'mobile' ? null : require('xlsx-oc').exportExcel; const exportExcel = CLIENT_TYPE == 'mobile' ? null : require('xlsx-oc').exportExcel;
let tempCallback = () => {};
@connect(({ DataObj, loading }) => ({ @connect(({ DataObj, loading }) => ({
DataObj, DataObj,
...@@ -19,7 +21,9 @@ const exportExcel = CLIENT_TYPE == 'mobile' ? null : require('xlsx-oc').exportEx ...@@ -19,7 +21,9 @@ const exportExcel = CLIENT_TYPE == 'mobile' ? null : require('xlsx-oc').exportEx
export default class ImportUtil extends React.PureComponent { export default class ImportUtil extends React.PureComponent {
constructor(props) { constructor(props) {
super(props); super(props);
const exportTemplateUrl = encodeURI( tempCallback = this.props.callback;
const exportTemplateUrl = encodeURI(
`${config.httpServer}/DataObjApi/importTemplateDownload?objId=${this.props.objId}&name=${ `${config.httpServer}/DataObjApi/importTemplateDownload?objId=${this.props.objId}&name=${
props.fileName props.fileName
}`, }`,
...@@ -73,13 +77,16 @@ export default class ImportUtil extends React.PureComponent { ...@@ -73,13 +77,16 @@ export default class ImportUtil extends React.PureComponent {
} }
} }
if (current === 3) { if (current === 3) {
console.log('current === 3');
this.setState({ this.setState({
current: current, current: current,
isShow: true, isShow: true,
}); },()=>{
if (this.props.callback) { if (tempCallback && typeof tempCallback === 'function') {
this.props.callback(); tempCallback();
} tempCallback = null;
}
});
} }
} }
...@@ -106,9 +113,10 @@ export default class ImportUtil extends React.PureComponent { ...@@ -106,9 +113,10 @@ export default class ImportUtil extends React.PureComponent {
isShow: true, isShow: true,
visible: false, visible: false,
}); });
if (this.props.callback) { // if (typeof tempCallback === 'function') {
this.props.callback(); // tempCallback();
} // tempCallback = null;
// }
}, },
}); });
} }
......
...@@ -643,6 +643,8 @@ class FormList extends React.Component { ...@@ -643,6 +643,8 @@ class FormList extends React.Component {
} }
}; };
sqlBs16 = Base16Encode(this.props.sql); sqlBs16 = Base16Encode(this.props.sql);
getPage = (params, values, callPage, pageNo) => { getPage = (params, values, callPage, pageNo) => {
if (this.columns == null || this.columns.length == 0) { if (this.columns == null || this.columns.length == 0) {
return; return;
...@@ -880,7 +882,7 @@ class FormList extends React.Component { ...@@ -880,7 +882,7 @@ class FormList extends React.Component {
//如果隐藏的话 就用隐藏域放置 //如果隐藏的话 就用隐藏域放置
if (item.isHidden) { if (item.isHidden) {
return ( return (
<FormItem className={styles.hidden}> <FormItem className={styles.hidden} key={item.id}>
{form.getFieldDecorator(item.name, { {form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name], initialValue: formData == null ? '' : formData[item.name],
})(<Input type="hidden" placeholder="请输入" />)} })(<Input type="hidden" placeholder="请输入" />)}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论