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

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

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