1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
| (function(vc){
|
| vc.extends({
| data:{
| add@@TemplateCode@@Info:{
| @@templateCodeColumns@@
| }
| },
| _initMethod:function(){
|
| },
| _initEvent:function(){
| vc.on('add@@TemplateCode@@','openAdd@@TemplateCode@@Modal',function(){
| $('#add@@TemplateCode@@Model').modal('show');
| });
| },
| methods:{
| add@@TemplateCode@@Validate(){
| return vc.validate.validate({
| add@@TemplateCode@@Info:vc.component.add@@TemplateCode@@Info
| },{
| @@addTemplateCodeValidate@@
|
|
|
| });
| },
| save@@TemplateCode@@Info:function(){
| if(!vc.component.add@@TemplateCode@@Validate()){
| vc.message(vc.validate.errInfo);
|
| return ;
| }
|
| vc.component.add@@TemplateCode@@Info.communityId = vc.getCurrentCommunity().communityId;
|
| vc.http.post(
| 'add@@TemplateCode@@',
| 'save',
| JSON.stringify(vc.component.add@@TemplateCode@@Info),
| {
| emulateJSON:true
| },
| function(json,res){
| //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
| if(res.status == 200){
| //关闭model
| $('#add@@TemplateCode@@Model').modal('hide');
| vc.component.clearAdd@@TemplateCode@@Info();
| vc.emit('@@templateCode@@Manage','list@@TemplateCode@@',{});
|
| return ;
| }
| vc.message(json);
|
| },
| function(errInfo,error){
| console.log('请求失败处理');
|
| vc.message(errInfo);
|
| });
| },
| clearAdd@@TemplateCode@@Info:function(){
| vc.component.add@@TemplateCode@@Info = {
| @@templateCodeColumns@@
| };
| }
| }
| });
|
| })(window.vc);
|
|