java110
2020-04-25 2646433c86f6ca21839d12b6e43e3b6380438d3d
java110-code-generator/src/main/resources/web/add/add.js
@@ -1,8 +1,13 @@
(function(vc){
    vc.extends({
        propTypes: {
               callBackListener:vc.propTypes.string, //父组件名称
               callBackFunction:vc.propTypes.string //父组件监听方法
        },
        data:{
            add@@TemplateCode@@Info:{
                @@templateKey@@:'',
                @@templateCodeColumns@@
            }
        },
@@ -27,16 +32,21 @@
            },
            save@@TemplateCode@@Info:function(){
                if(!vc.component.add@@TemplateCode@@Validate()){
                    vc.message(vc.validate.errInfo);
                    vc.toast(vc.validate.errInfo);
                    return ;
                }
                vc.component.add@@TemplateCode@@Info.communityId = vc.getCurrentCommunity().communityId;
                //不提交数据将数据 回调给侦听处理
                if(vc.notNull($props.callBackListener)){
                    vc.emit($props.callBackListener,$props.callBackFunction,vc.component.add@@TemplateCode@@Info);
                    $('#add@@TemplateCode@@Model').modal('hide');
                    return ;
                }
                vc.http.post(
                    'add@@TemplateCode@@',
                    'save',
                vc.http.apiPost(
                    '@@templateCode@@.save@@TemplateCode@@',
                    JSON.stringify(vc.component.add@@TemplateCode@@Info),
                    {
                        emulateJSON:true