dev_aliyun_beta
hjm 6 years ago
parent ac747d3b9d
commit 8ed3137615

@ -68,6 +68,9 @@ class NewWork extends Component{
console.log(error); console.log(error);
}); });
} }
onCancel = () => {
this.props.toListPage(this.props.match.params, category.category_id)
}
doEdit = (params) => { doEdit = (params) => {
const workId = this.props.match.params.workId const workId = this.props.match.params.workId
@ -140,7 +143,7 @@ class NewWork extends Component{
<div> <div>
<NewWorkForm wrappedComponentRef={(ref) => {this.newWorkFormRef = ref}} <NewWorkForm wrappedComponentRef={(ref) => {this.newWorkFormRef = ref}}
{...this.props} {...this.props}
onSave={this.onSave} onCancel={this.onCancel}
doNew={this.doNew} doNew={this.doNew}
doEdit={this.doEdit} doEdit={this.doEdit}
></NewWorkForm> ></NewWorkForm>

@ -10,6 +10,11 @@ import CBreadcrumb from '../common/CBreadcrumb'
const confirm = Modal.confirm; const confirm = Modal.confirm;
const $ = window.$ const $ = window.$
const MAX_TITLE_LENGTH = 60; const MAX_TITLE_LENGTH = 60;
/**
需要注意的props
isGroup
*/
class NewWorkForm extends Component{ class NewWorkForm extends Component{
constructor(props){ constructor(props){
super(props); super(props);
@ -453,7 +458,7 @@ class NewWorkForm extends Component{
<div className="clearfix mt30 mb30"> <div className="clearfix mt30 mb30">
{/* htmlType="submit" */} {/* htmlType="submit" */}
<Button type="primary" onClick={this.handleSubmit} className="defalutSubmitbtn fl mr20">提交</Button> <Button type="primary" onClick={this.handleSubmit} className="defalutSubmitbtn fl mr20">提交</Button>
<a className="defalutCancelbtn fl" onClick={() => this.props.toListPage(this.props.match.params, category.category_id)}>取消</ a> <a className="defalutCancelbtn fl" onClick={() => this.props.onCancel()}>取消</ a>
</div> </div>
</Form.Item> </Form.Item>
</Form> </Form>

Loading…
Cancel
Save