From 2646433c86f6ca21839d12b6e43e3b6380438d3d Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期日, 26 四月 2020 23:09:49 +0800
Subject: [PATCH] 日志级别

---
 java110-code-generator/src/main/resources/web/add/add.js |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/java110-code-generator/src/main/resources/web/add/add.js b/java110-code-generator/src/main/resources/web/add/add.js
index f6e0c6e..5c33a9d 100644
--- a/java110-code-generator/src/main/resources/web/add/add.js
+++ b/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

--
Gitblit v1.8.0