private void ExecuteTemplateVueIndex(TableInfo tableInfo, Context configContext, UniqueListInfo infos) { if (tableInfo.CodeCustomImplemented) { return; } if (!tableInfo.MakeFront) { return; } var pathOutput = PathOutputVue.PathOutputVueIndexViewComponent(tableInfo, configContext); if (File.Exists(pathOutput)) { return; } var pathTemplate = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, this._defineTemplateFolder.Define(tableInfo), DefineTemplateNameVue.VueIndexComponent(tableInfo)); var textTemplate = Read.AllText(tableInfo, pathTemplate, this._defineTemplateFolder); var classBuilder = GenericTagsTransformer(tableInfo, configContext, textTemplate); classBuilder = this.MakeGridClassBuilder(tableInfo, configContext, infos, classBuilder); using (var stream = new HelperStream(pathOutput).GetInstance()) { stream.Write(classBuilder); } }
private void ExecuteTemplateVueRouter(TableInfo tableInfo, Context configContext) { if (tableInfo.CodeCustomImplemented) { return; } if (!tableInfo.MakeFront) { return; } var pathOutput = PathOutputVue.PathOutputVueRouterViewComponent(tableInfo, configContext); var pathTemplate = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, this._defineTemplateFolder.Define(tableInfo), DefineTemplateNameVue.VueRouterComponent(tableInfo)); var textTemplate = Read.AllText(tableInfo, pathTemplate, this._defineTemplateFolder); var classBuilder = GenericTagsTransformer(tableInfo, configContext, textTemplate); var itens = string.Empty; foreach (var item in configContext.TableInfo) { var str = @" { path: '" + item.ClassName.ToLower() + "', name: '" + (item.ClassNameFormated ?? item.ClassName) + "', component: function (resolve) { require(['@/views/" + item.ClassName.ToLower() + "'], resolve) } },"; itens += string.Format("{0}{1}", str, System.Environment.NewLine); } classBuilder = classBuilder.Replace("<#pathsRoute#>", itens); using (var stream = new HelperStream(pathOutput).GetInstance()) { stream.Write(classBuilder); } }
private void ExecuteTemplateVueEditComponent(TableInfo tableInfo, Context configContext) { if (!tableInfo.MakeFront) { return; } var pathOutput = PathOutputVue.PathOutputVueViewComponent(tableInfo, configContext, "edit"); if (File.Exists(pathOutput)) { return; } var pathTemplate = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, this._defineTemplateFolder.Define(tableInfo), DefineTemplateNameVue.VueEditComponent(tableInfo)); var textTemplate = Read.AllText(tableInfo, pathTemplate, this._defineTemplateFolder); var classBuilder = GenericTagsTransformer(tableInfo, configContext, textTemplate); using (var stream = new StreamWriter(pathOutput)) { stream.Write(classBuilder); } }
private void ExecuteTemplateVueFormCreateComponent(TableInfo tableInfo, Context configContext, UniqueListInfo infos) { if (tableInfo.CodeCustomImplemented) { return; } if (!tableInfo.MakeFront) { return; } var pathOutput = PathOutputVue.PathOutputVueViewComponent(tableInfo, configContext, "form-create"); if (File.Exists(pathOutput)) { return; } var pathTemplate = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, this._defineTemplateFolder.Define(tableInfo), DefineTemplateNameVue.VueCreateFormComponent(tableInfo)); var textTemplate = Read.AllText(tableInfo, pathTemplate, this._defineTemplateFolder); var classBuilder = this.MakeFormClassBuilder(tableInfo, configContext, infos, textTemplate, "model"); using (var stream = new StreamWriter(pathOutput)) { stream.Write(classBuilder); } }