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

3504 【严重bug】弹框渲染问题。

上级 ec2b27c6
...@@ -2,8 +2,15 @@ import React from 'react'; ...@@ -2,8 +2,15 @@ import React from 'react';
import { Button } from 'antd'; import { Button } from 'antd';
import { getModal } from '@/webPublic/one_stop_public/utils/utils'; import { getModal } from '@/webPublic/one_stop_public/utils/utils';
import styles from './style.less' import styles from './style.less'
import { connect } from "dva";
const Modal = getModal(); const Modal = getModal();
// 解决新增和编辑冲突的bug http://scjoyedu.eicp.net:57400/zentao/bug-view-3504.html
@connect(({ DataColumn }) => ({
DataColumn,
}))
export default class FormModal extends React.Component { export default class FormModal extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -16,7 +23,8 @@ export default class FormModal extends React.Component { ...@@ -16,7 +23,8 @@ export default class FormModal extends React.Component {
} }
render() { render() {
console.log(this.props.title); const { DataColumn, modalCode,title = '' } = this.props;
const { isShowModal } = DataColumn;
return ( return (
<Modal <Modal
bodyStyle={{ bodyStyle={{
...@@ -25,11 +33,11 @@ export default class FormModal extends React.Component { ...@@ -25,11 +33,11 @@ export default class FormModal extends React.Component {
}} }}
{...this.props} {...this.props}
destroyOnClose destroyOnClose
title={this.props.title} visible={isShowModal[modalCode + title] || false}
title={title}
maskClosable={false} maskClosable={false}
width={this.props.width} width={this.props.width}
height={this.props.height} height={this.props.height}
visible={this.props.visible}
footer={null} footer={null}
onCancel={this.props.handleCancel}> onCancel={this.props.handleCancel}>
{this.props.showFullScreen && ( {this.props.showFullScreen && (
......
...@@ -163,7 +163,11 @@ export default class TableCom extends Component { ...@@ -163,7 +163,11 @@ export default class TableCom extends Component {
closeModal = (fk, callback) => { closeModal = (fk, callback) => {
const { dispatch } = this.props; const { dispatch } = this.props;
const x = this.props.DataColumn.isShowModal; const x = this.props.DataColumn.isShowModal;
x[fk] = false; for(let k in x){
if(k.includes(fk)){
x[k] = false;
}
}
dispatch({ dispatch({
type: 'DataColumn/showModal', type: 'DataColumn/showModal',
payload: { isShowModal: x }, payload: { isShowModal: x },
...@@ -181,14 +185,13 @@ export default class TableCom extends Component { ...@@ -181,14 +185,13 @@ export default class TableCom extends Component {
const { dispatch } = this.props; const { dispatch } = this.props;
const x = this.props.DataColumn.isShowModal; const x = this.props.DataColumn.isShowModal;
console.log(x); x[fk + title] = true;
x[fk] = true;
this.setState( this.setState(
{ {
modalInit: data, modalInit: data,
}, },
() => { () => {
let a = setTimeout(() => { // let a = setTimeout(() => {
// 解决禅道 31435 勤工助学(新)/工作情况考核,20219001028 批次设置的时间没有受控制 看下 // 解决禅道 31435 勤工助学(新)/工作情况考核,20219001028 批次设置的时间没有受控制 看下
dispatch({ dispatch({
type: 'DataColumn/showModal', type: 'DataColumn/showModal',
...@@ -201,8 +204,8 @@ export default class TableCom extends Component { ...@@ -201,8 +204,8 @@ export default class TableCom extends Component {
}); });
}, },
}); });
clearTimeout(a); // clearTimeout(a);
}, 300); // }, 300);
}, },
); );
...@@ -4027,7 +4030,8 @@ ${obj[dataColumn.base52]} ...@@ -4027,7 +4030,8 @@ ${obj[dataColumn.base52]}
{modalCode ? ( {modalCode ? (
<FormModal <FormModal
{...modalProps} {...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]} // visible={this.props.DataColumn.isShowModal[modalCode + modalTitle]}
modalCode={modalCode}
handleCancel={this.closeModal.bind(this, modalCode)} handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle} title={modalTitle}
> >
...@@ -4113,7 +4117,8 @@ ${obj[dataColumn.base52]} ...@@ -4113,7 +4117,8 @@ ${obj[dataColumn.base52]}
{modalCode ? ( {modalCode ? (
<FormModal <FormModal
{...modalProps} {...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]} // visible={this.props.DataColumn.isShowModal[modalCode + modalTitle]}
modalCode={modalCode}
handleCancel={this.closeModal.bind(this, modalCode)} handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle} title={modalTitle}
> >
...@@ -4151,7 +4156,8 @@ ${obj[dataColumn.base52]} ...@@ -4151,7 +4156,8 @@ ${obj[dataColumn.base52]}
{modalCode ? ( {modalCode ? (
<FormModal <FormModal
{...modalProps} {...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]} // visible={this.props.DataColumn.isShowModal[modalCode + modalTitle]}
modalCode={modalCode}
handleCancel={this.closeModal.bind(this, modalCode)} handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle} title={modalTitle}
> >
...@@ -4198,7 +4204,8 @@ ${obj[dataColumn.base52]} ...@@ -4198,7 +4204,8 @@ ${obj[dataColumn.base52]}
{modalCode ? ( {modalCode ? (
<FormModal <FormModal
{...modalProps} {...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]} // visible={this.props.DataColumn.isShowModal[modalCode + modalTitle]}
modalCode={modalCode}
handleCancel={this.closeModal.bind(this, modalCode)} handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle} title={modalTitle}
> >
...@@ -4238,7 +4245,8 @@ ${obj[dataColumn.base52]} ...@@ -4238,7 +4245,8 @@ ${obj[dataColumn.base52]}
{modalCode ? ( {modalCode ? (
<FormModal <FormModal
{...modalProps} {...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]} // visible={this.props.DataColumn.isShowModal[modalCode + modalTitle]}
modalCode={modalCode}
handleCancel={this.closeModal.bind(this, modalCode)} handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle} title={modalTitle}
> >
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论