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

弹出窗口函数

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