@@ -498,13 +498,13 @@ func (autoCodeService *AutoCodeService) addAutoMoveFile(data *tplData) {
498
498
} else if strings .Contains (fileSlice [1 ], "web" ) {
499
499
if strings .Contains (fileSlice [n - 1 ], "js" ) {
500
500
data .autoMoveFilePath = filepath .Join (global .GVA_CONFIG .AutoCode .Root ,
501
- global .GVA_CONFIG .AutoCode .Web , global .GVA_CONFIG .AutoCode .WApi , base )
501
+ global .GVA_CONFIG .AutoCode .Web , global .GVA_CONFIG .AutoCode .WApi , data . autoPackage , base )
502
502
} else if strings .Contains (fileSlice [n - 2 ], "form" ) {
503
503
data .autoMoveFilePath = filepath .Join (global .GVA_CONFIG .AutoCode .Root ,
504
- global .GVA_CONFIG .AutoCode .Web , global .GVA_CONFIG .AutoCode .WForm , filepath .Base (filepath .Dir (filepath .Dir (data .autoCodePath ))), strings .TrimSuffix (base , filepath .Ext (base ))+ "Form.vue" )
504
+ global .GVA_CONFIG .AutoCode .Web , global .GVA_CONFIG .AutoCode .WForm , data . autoPackage , filepath .Base (filepath .Dir (filepath .Dir (data .autoCodePath ))), strings .TrimSuffix (base , filepath .Ext (base ))+ "Form.vue" )
505
505
} else if strings .Contains (fileSlice [n - 2 ], "table" ) {
506
506
data .autoMoveFilePath = filepath .Join (global .GVA_CONFIG .AutoCode .Root ,
507
- global .GVA_CONFIG .AutoCode .Web , global .GVA_CONFIG .AutoCode .WTable , filepath .Base (filepath .Dir (filepath .Dir (data .autoCodePath ))), base )
507
+ global .GVA_CONFIG .AutoCode .Web , global .GVA_CONFIG .AutoCode .WTable , data . autoPackage , filepath .Base (filepath .Dir (filepath .Dir (data .autoCodePath ))), base )
508
508
}
509
509
}
510
510
}
@@ -581,7 +581,7 @@ func (autoCodeService *AutoCodeService) AutoCreateMenu(a *system.AutoCodeStruct)
581
581
menu .Name = a .Abbreviation
582
582
menu .Path = a .Abbreviation
583
583
menu .Meta .Title = a .Description
584
- menu .Component = fmt .Sprintf ("view/%s/%s.vue" , a .PackageName , a .PackageName )
584
+ menu .Component = fmt .Sprintf ("view/%s/%s/%s .vue" , a . Package , a .PackageName , a .PackageName )
585
585
err = global .GVA_DB .Create (& menu ).Error
586
586
return menu .ID , err
587
587
}
@@ -694,6 +694,19 @@ func (autoCodeService *AutoCodeService) CreatePackageTemp(packageName string) er
694
694
name : packageAPIName ,
695
695
temp : string (subcontract .API ),
696
696
}}
697
+
698
+ webTemp := []string {
699
+ filepath .Join (global .GVA_CONFIG .AutoCode .Root , global .GVA_CONFIG .AutoCode .Web , global .GVA_CONFIG .AutoCode .WApi ),
700
+ filepath .Join (global .GVA_CONFIG .AutoCode .Root , global .GVA_CONFIG .AutoCode .Web , global .GVA_CONFIG .AutoCode .WForm ),
701
+ }
702
+
703
+ for _ , s := range webTemp {
704
+ err := os .MkdirAll (filepath .Join (s , packageName ), 0755 )
705
+ if err != nil {
706
+ return err
707
+ }
708
+ }
709
+
697
710
for i , s := range pendingTemp {
698
711
pendingTemp [i ].path = filepath .Join (global .GVA_CONFIG .AutoCode .Root , global .GVA_CONFIG .AutoCode .Server , filepath .Clean (fmt .Sprintf (s .path , packageName )))
699
712
}
0 commit comments