提交 50463c9a authored 作者: chscls@163.com's avatar chscls@163.com

弹出窗口函数

上级 e8546f96
......@@ -37,11 +37,12 @@ export default class ZdyTable extends Component {
isEdit: true,
isReady: false,
formConfig: {},
modalCode:null
modalCode:null,
modalTitle:"",
}
}
showModal=(modalCode)=>{
this.setState({modalCode})
showModal=(modalCode,modalTitle)=>{
this.setState({modalCode,modalTitle,isShowModal:true})
}
componentDidMount() {
let {
......@@ -362,7 +363,9 @@ export default class ZdyTable extends Component {
})
return max
}
handleCancel=()=>{
this.setState({isShowModal:false})
}
render() {
let { width,
isBorder,
......@@ -372,6 +375,7 @@ export default class ZdyTable extends Component {
defaultValues,
items,
init,
modalTitle,
currentFormKey,
isEdit,
datas,
......@@ -379,6 +383,7 @@ export default class ZdyTable extends Component {
formConfig,
formCode,
formId,
isShowModal,
modalCode,
} = this.state
let { border,
......@@ -468,7 +473,7 @@ export default class ZdyTable extends Component {
})(<Input type="hidden" />);
}) : ""}
{modalCode?<FormModal>ddddddddddddd</FormModal>:""}
<FormModal visible={isShowModal} handleCancel={this.handleCancel} title={modalTitle}>{modalCode}</FormModal>
<Row>
<Col span={24}>
<div
......@@ -600,7 +605,7 @@ export default class ZdyTable extends Component {
})(<Input type="hidden" />);
}) : ""}
{modalCode?<FormModal>ddddddddddddd</FormModal>:""}
<FormModal visible={isShowModal} handleCancel={this.handleCancel} title={modalTitle}>{modalCode}</FormModal>
{
items.map((item, i) => {
const allhidden = this.checkAllHidden(items)
......
......@@ -4,20 +4,19 @@ import {Button, Form, Input, InputNumber, Modal, Select} from "antd";
export default class FormModal extends React.Component {
state = {visible: true};
handleCancel = e => this.setState({visible: false});
render() {
const {visible} = this.state;
const contentProps = {onCancel: this.handleCancel};
return (
<Modal
destroyOnClose
title="设置拷贝后的后缀名"
visible={visible}
title={this.props.title}
visible={this.props.visible}
footer={null}
onCancel={this.handleCancel}
onCancel={this.props.handleCancel}
>
{this.props.children}
</Modal>
......
......@@ -147,7 +147,11 @@ export default class tableCom extends Component {
};
excludeKeys = ["defaultValues", ""]
showModal=(fk,title)=>{
const {datas,get,isEdit,obj,init,mapData,sqlData,defaultValues}=this.props
const child =<ZdyTable key={fk} datas={datas} get={get} isChild={true} currentFormKey={fk} isEdit={isEdit} obj={obj} init={init} form={this.props.form} mapData={mapData} sqlData={sqlData} {...datas[fk]} defaultValues={defaultValues} />
this.props.showModal(child,title)
}
equal = (obj1, obj2, json, sqlContent, depth) => {
......@@ -1146,7 +1150,7 @@ export default class tableCom extends Component {
message: message, router: router,
setValues: this.setValues.bind(this, base52, json),
req: this.reqUtil.bind(this, base52, json, callback),
md5: md5, showModal:this.props.showModal,
md5: md5, showModal:this.showModal,
render:this.getRender,base64:getBase64,
},
functionObj,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论