Weben_CMS专用代码生成器/Code/Generate/Web/Index_Generate.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Weben_CMS专用代码生成器/Code/Generate/Web/enum_Generate.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Weben_CMS专用代码生成器/Code/GenerateCode_WeiBen_CMS.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Weben_CMS专用代码生成器/Code/MainForm.Designer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Weben_CMS专用代码生成器/Code/MainForm.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Weben_CMS专用代码生成器/Code/Model/GenerateCodeParam.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Weben_CMS专用代码生成器/Code/Templete/Web/enum模板.txt | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Weben_CMS专用代码生成器/Code/Templete/Web/index模板.txt | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Weben_CMS专用代码生成器/Code/Utility/CommonHelper.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Weben_CMS专用代码生成器/Code/常用.txt | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/Generate/Web/Index_Generate.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,27 @@  using GenerateCode_WeiBen_WMS.Model; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace GenerateCode_GEBrilliantFactory { /// <summary> /// çææ¥è¯¢å®ä½ç±» /// </summary> public class Index_Generate : BaseGenerate { public static string CreateText(GenerateCodeParam param) { var str = TextHelper.ReadText(@"Templete\Web\index模æ¿.txt"); CommonReplace(ref str); CommonHelper.CommonReplaceStr(param, ref str); return str; } } } Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/Generate/Web/enum_Generate.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,27 @@  using GenerateCode_WeiBen_WMS.Model; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace GenerateCode_GEBrilliantFactory { /// <summary> /// çææ¥è¯¢å®ä½ç±» /// </summary> public class enum_Generate : BaseGenerate { public static string CreateText(GenerateCodeParam param) { var str = TextHelper.ReadText(@"Templete\Web\enum模æ¿.txt"); CommonReplace(ref str); CommonHelper.CommonReplaceStr(param, ref str); return str; } } } Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/GenerateCode_WeiBen_CMS.csproj
@@ -128,6 +128,8 @@ <Compile Include="Generate\BLL_Generate.cs" /> <Compile Include="Generate\DAL_Generate.cs" /> <Compile Include="Generate\Procedure_Generate.cs" /> <Compile Include="Generate\Web\enum_Generate.cs" /> <Compile Include="Generate\Web\Index_Generate.cs" /> <Compile Include="Model\GenerateCodeParam.cs" /> <Compile Include="Model\Enum\DataBaseEnum.cs" /> <Compile Include="Model\Enum\DataTypeEnum.cs" /> @@ -278,6 +280,12 @@ <Content Include="Templete\InitSQL模æ¿.txt"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> <Content Include="Templete\Web\enum模æ¿.txt"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> <Content Include="Templete\Web\index模æ¿.txt"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> <Content Include="常ç¨.txt" /> </ItemGroup> <ItemGroup /> Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/MainForm.Designer.cs
@@ -64,6 +64,9 @@ this.lbl_DataSource = new System.Windows.Forms.Label(); this.cmb_DataSource = new System.Windows.Forms.ComboBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.label19 = new System.Windows.Forms.Label(); this.label18 = new System.Windows.Forms.Label(); this.tb_EnumList = new System.Windows.Forms.TextBox(); this.tb_GroupName = new System.Windows.Forms.TextBox(); this.label16 = new System.Windows.Forms.Label(); this.label15 = new System.Windows.Forms.Label(); @@ -74,9 +77,10 @@ this.label12 = new System.Windows.Forms.Label(); this.tb_templeteFileDownName = new System.Windows.Forms.TextBox(); this.label14 = new System.Windows.Forms.Label(); this.tb_EnumList = new System.Windows.Forms.TextBox(); this.label18 = new System.Windows.Forms.Label(); this.label19 = new System.Windows.Forms.Label(); this.label20 = new System.Windows.Forms.Label(); this.tb_MenuName = new System.Windows.Forms.TextBox(); this.label21 = new System.Windows.Forms.Label(); this.tb_PageMenuInstanceName = new System.Windows.Forms.TextBox(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.groupBox3.SuspendLayout(); @@ -163,7 +167,7 @@ // // tb_WCF_NameSpacePath // this.tb_WCF_NameSpacePath.Location = new System.Drawing.Point(751, 309); this.tb_WCF_NameSpacePath.Location = new System.Drawing.Point(983, 358); this.tb_WCF_NameSpacePath.Margin = new System.Windows.Forms.Padding(4); this.tb_WCF_NameSpacePath.Name = "tb_WCF_NameSpacePath"; this.tb_WCF_NameSpacePath.Size = new System.Drawing.Size(261, 25); @@ -172,7 +176,7 @@ // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(607, 311); this.label2.Location = new System.Drawing.Point(862, 368); this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(105, 15); @@ -273,7 +277,7 @@ // label9 // this.label9.AutoSize = true; this.label9.Location = new System.Drawing.Point(617, 262); this.label9.Location = new System.Drawing.Point(682, 47); this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(45, 15); @@ -282,7 +286,7 @@ // // tb_OrderBy // this.tb_OrderBy.Location = new System.Drawing.Point(671, 259); this.tb_OrderBy.Location = new System.Drawing.Point(736, 44); this.tb_OrderBy.Margin = new System.Windows.Forms.Padding(4); this.tb_OrderBy.Name = "tb_OrderBy"; this.tb_OrderBy.Size = new System.Drawing.Size(192, 25); @@ -291,7 +295,7 @@ // label10 // this.label10.AutoSize = true; this.label10.Location = new System.Drawing.Point(891, 262); this.label10.Location = new System.Drawing.Point(956, 47); this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(83, 15); @@ -348,7 +352,7 @@ // // tb_RoutePrefix // this.tb_RoutePrefix.Location = new System.Drawing.Point(717, 345); this.tb_RoutePrefix.Location = new System.Drawing.Point(983, 395); this.tb_RoutePrefix.Margin = new System.Windows.Forms.Padding(4); this.tb_RoutePrefix.Name = "tb_RoutePrefix"; this.tb_RoutePrefix.Size = new System.Drawing.Size(192, 25); @@ -358,7 +362,7 @@ // label13 // this.label13.AutoSize = true; this.label13.Location = new System.Drawing.Point(617, 352); this.label13.Location = new System.Drawing.Point(862, 398); this.label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(99, 15); @@ -423,6 +427,10 @@ // // groupBox2 // this.groupBox2.Controls.Add(this.tb_PageMenuInstanceName); this.groupBox2.Controls.Add(this.label21); this.groupBox2.Controls.Add(this.tb_MenuName); this.groupBox2.Controls.Add(this.label20); this.groupBox2.Controls.Add(this.label19); this.groupBox2.Controls.Add(this.label18); this.groupBox2.Controls.Add(this.tb_EnumList); @@ -464,6 +472,36 @@ this.groupBox2.TabIndex = 46; this.groupBox2.TabStop = false; this.groupBox2.Text = "èªå®ä¹é ç½®"; // // label19 // this.label19.AutoSize = true; this.label19.Location = new System.Drawing.Point(424, 432); this.label19.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label19.Name = "label19"; this.label19.Size = new System.Drawing.Size(751, 15); this.label19.TabIndex = 53; this.label19.Text = "PurchaseType|PurchaseTypeEnum|PurchaseTypeDesc,MaterialType|MaterialTypeEnum|Mate" + "rialTypeDesc"; // // label18 // this.label18.AutoSize = true; this.label18.Location = new System.Drawing.Point(424, 488); this.label18.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label18.Name = "label18"; this.label18.Size = new System.Drawing.Size(135, 15); this.label18.TabIndex = 52; this.label18.Text = "æä¸¾ç±»ååæ®µéå:"; // // tb_EnumList // this.tb_EnumList.Location = new System.Drawing.Point(557, 451); this.tb_EnumList.Margin = new System.Windows.Forms.Padding(4); this.tb_EnumList.Multiline = true; this.tb_EnumList.Name = "tb_EnumList"; this.tb_EnumList.Size = new System.Drawing.Size(491, 129); this.tb_EnumList.TabIndex = 51; // // tb_GroupName // @@ -566,35 +604,41 @@ this.label14.TabIndex = 47; this.label14.Text = "æä»¶ä¸è½½åå:"; // // tb_EnumList // label20 // this.tb_EnumList.Location = new System.Drawing.Point(557, 451); this.tb_EnumList.Margin = new System.Windows.Forms.Padding(4); this.tb_EnumList.Multiline = true; this.tb_EnumList.Name = "tb_EnumList"; this.tb_EnumList.Size = new System.Drawing.Size(491, 129); this.tb_EnumList.TabIndex = 51; this.label20.AutoSize = true; this.label20.Location = new System.Drawing.Point(600, 239); this.label20.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label20.Name = "label20"; this.label20.Size = new System.Drawing.Size(90, 15); this.label20.TabIndex = 54; this.label20.Text = "页é¢èåå:"; // // label18 // tb_MenuName // this.label18.AutoSize = true; this.label18.Location = new System.Drawing.Point(424, 488); this.label18.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label18.Name = "label18"; this.label18.Size = new System.Drawing.Size(135, 15); this.label18.TabIndex = 52; this.label18.Text = "æä¸¾ç±»ååæ®µéå:"; this.tb_MenuName.Location = new System.Drawing.Point(700, 229); this.tb_MenuName.Margin = new System.Windows.Forms.Padding(4); this.tb_MenuName.Name = "tb_MenuName"; this.tb_MenuName.Size = new System.Drawing.Size(261, 25); this.tb_MenuName.TabIndex = 55; // // label19 // label21 // this.label19.AutoSize = true; this.label19.Location = new System.Drawing.Point(424, 432); this.label19.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label19.Name = "label19"; this.label19.Size = new System.Drawing.Size(751, 15); this.label19.TabIndex = 53; this.label19.Text = "PurchaseType|PurchaseTypeEnum|PurchaseTypeDesc,MaterialType|MaterialTypeEnum|Mate" + "rialTypeDesc"; this.label21.AutoSize = true; this.label21.Location = new System.Drawing.Point(600, 275); this.label21.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label21.Name = "label21"; this.label21.Size = new System.Drawing.Size(135, 15); this.label21.TabIndex = 56; this.label21.Text = "页é¢èå对象缩å:"; // // tb_PageMenuInstanceName // this.tb_PageMenuInstanceName.Location = new System.Drawing.Point(736, 265); this.tb_PageMenuInstanceName.Margin = new System.Windows.Forms.Padding(4); this.tb_PageMenuInstanceName.Name = "tb_PageMenuInstanceName"; this.tb_PageMenuInstanceName.Size = new System.Drawing.Size(261, 25); this.tb_PageMenuInstanceName.TabIndex = 57; // // MainForm // @@ -675,6 +719,10 @@ private System.Windows.Forms.Label label18; private System.Windows.Forms.TextBox tb_EnumList; private System.Windows.Forms.Label label19; private System.Windows.Forms.Label label20; private System.Windows.Forms.TextBox tb_MenuName; private System.Windows.Forms.TextBox tb_PageMenuInstanceName; private System.Windows.Forms.Label label21; } } Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/MainForm.cs
@@ -31,6 +31,8 @@ this.tb_WCF_NameSpacePath.Text = "HIAWms";//WCF项ç®å½åç©ºé´ this.tb_FileName.Text = "Xiangzi";//æä»¶åç¼å this.tb_ChinaComment.Text = "ç©æåºç¡ä¿¡æ¯è¡¨";//ä¸ææ³¨é this.tb_MenuName.Text = "ç©æä¿¡æ¯";//ä¸ææ³¨é this.tb_PageMenuInstanceName.Text = "wmsMaterial"; this.tb_CreatePerson.Text = "shaocx";//å建人 this.tb_EntityName.Text = "WmsMaterial";//å®ä½ç±»å //this.tb_EntityProName.Text = "wmsMaterial";//å®ä½ç±»å¯¹è±¡å @@ -98,6 +100,26 @@ string filePrefixName = this.tb_FileName.Text.Trim();//æä»¶åç¼å string modulelogo = this.tb_Modulelogo.Text.Trim();//模åç®å string chinaComment = this.tb_ChinaComment.Text.Trim();//ä¸ææ³¨é if (chinaComment == "") { MessageBox.Show("请è¾å ¥ 表çä¸ææ³¨è§£ï¼"); this.tb_ChinaComment.Focus(); return; } string menuName = this.tb_MenuName.Text.Trim();//ä¸ææ³¨é if (menuName == "") { MessageBox.Show("请è¾å ¥ 页é¢èååï¼"); this.tb_MenuName.Focus(); return; } string _tb_PageMenuInstanceName = this.tb_PageMenuInstanceName.Text.Trim();//ä¸ææ³¨é if (_tb_PageMenuInstanceName == "") { MessageBox.Show("请è¾å ¥ 页é¢èå对象缩åï¼"); this.tb_PageMenuInstanceName.Focus(); return; } string createPerson = this.tb_CreatePerson.Text.Trim();//å建人 string entityName = this.tb_EntityName.Text.Trim();//å®ä½ç±»å string tableAlias = this.tb_EntityProName.Text.Trim();//å®ä½ç±»å¯¹è±¡å/表å«å @@ -160,6 +182,8 @@ { Modulelogo = modulelogo, ChinaComment = chinaComment, PageMenuName = menuName, PageMenuInstanceName = _tb_PageMenuInstanceName, NameSpacePath = wcf_NameSpacePath, ColumnNameList = columnList, EntityName = entityName, @@ -265,6 +289,20 @@ #endregion #region Web var webRootPath = tbPath.Text + @"\web\src\widgets\" + tb_EntityName.Text.Trim(); //13ãçæ Index æä»¶ str_generate = Index_Generate.CreateText(param); tf = TextHelper.Export2File_V2(webRootPath, $"index.ts", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo); //14ãçæ enum æä»¶ str_generate = enum_Generate.CreateText(param); tf = TextHelper.Export2File_V2(webRootPath, $"enum.ts", tableName, str_generate, FileType.InputModel, filePrefixName, entityName, modulelogo); #endregion ////çæ OutputModel æä»¶ Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/Model/GenerateCodeParam.cs
@@ -23,6 +23,16 @@ public string ChinaComment { get; set; } /// <summary> /// 页é¢èåå /// </summary> public string PageMenuName { get; set; } /// <summary> /// 页é¢èå对象缩å /// </summary> public string PageMenuInstanceName { get; set; } /// <summary> /// ååå表 /// </summary> public List<ColumnModel> ColumnNameList { get; set; } = new List<ColumnModel>(); Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/Templete/Web/enumÄ£°å.txt
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,15 @@ export interface TabType { label: string name: string columns?: any[] data?: any[] isFooter: boolean [key: string]: any } export const permissionCodes = { '$PageMenuInstanceName$-list': 'å表-å表', '$PageMenuInstanceName$-add': 'å表-æ·»å ', '$PageMenuInstanceName$-import': 'å表-å¯¼å ¥', '$PageMenuInstanceName$-output': 'å表-è¾åº', } Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/Templete/Web/indexÄ£°å.txt
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,14 @@ import $NameSpacePath$ from './Views/$NameSpacePath$' import Setting from '@/components/Setting/Setting' import { provider } from '@/provider/index' import p from '../../assets/svg/p.svg' export default { is: '$NameSpacePath$', name: '$PageMenuName$', category: 'run', icon: p, authorizationRequired: false, canvasView: provider($NameSpacePath$), settingsView: Setting, } Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/Utility/CommonHelper.cs
@@ -41,6 +41,8 @@ { str = str.Replace("$NameSpacePath$", param.NameSpacePath);//å½åç©ºé´ str = str.Replace("$ChinaComment$", param.ChinaComment);//ä¸ææ³¨é str = str.Replace("$PageMenuName$", param.PageMenuName);//ä¸ææ³¨é str = str.Replace("$PageMenuInstanceName$", param.PageMenuInstanceName);//ä¸ææ³¨é str = str.Replace("$EntityName$", param.EntityName);//å®ä½ç±»å str = str.Replace("$Modulelogo$", param.Modulelogo);//模åç®å str = str.Replace("$EntityInstanceName$", param.EntityInstanceName);//å®ä¾å Weben_CMSרÓôúÂëÉú³ÉÆ÷/Code/³£ÓÃ.txt
@@ -1,6 +1,8 @@  $ChinaComment$ $PageMenuName$ $EntityName$ $NameSpacePath$