From e317fabe7ac690e4b1cc9244f2a5bffc08d2b68d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Thu, 26 May 2022 13:32:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=B2=A1=E7=94=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.CodeGenerator/CodeGenerateTemplate.cs | 155 ----------------------- ZR.Service/System/GenTableService.cs | 34 ----- 2 files changed, 189 deletions(-) diff --git a/ZR.CodeGenerator/CodeGenerateTemplate.cs b/ZR.CodeGenerator/CodeGenerateTemplate.cs index 2a551be..a0cc978 100644 --- a/ZR.CodeGenerator/CodeGenerateTemplate.cs +++ b/ZR.CodeGenerator/CodeGenerateTemplate.cs @@ -10,161 +10,6 @@ namespace ZR.CodeGenerator /// public class CodeGenerateTemplate { - #region vue 模板 - - ///// - ///// Vue 添加修改表单 - ///// - ///// - ///// - //public static string TplVueFormContent(GenTableColumn dbFieldInfo, GenTable genTable) - //{ - // string columnName = dbFieldInfo.CsharpFieldFl; - // string labelName = CodeGeneratorTool.GetLabelName(dbFieldInfo.ColumnComment, columnName); - // string labelDisabled = dbFieldInfo.IsPk ? ":disabled=\"true\"" : ""; - // StringBuilder sb = new(); - // string value = CodeGeneratorTool.IsNumber(dbFieldInfo.CsharpType) ? "parseInt(item.dictValue)" : "item.dictValue"; - - // if (GenConstants.inputDtoNoField.Any(f => f.Contains(dbFieldInfo.CsharpField, StringComparison.OrdinalIgnoreCase))) - // { - // } - // else if (!dbFieldInfo.IsInsert && !dbFieldInfo.IsEdit) - // { - // sb.AppendLine(" "); - // sb.AppendLine($" {{{{form.{columnName}}}}}"); - // sb.AppendLine(" "); - // } - // else if (genTable.TplCategory.Equals("tree", StringComparison.OrdinalIgnoreCase) && genTable.TreeParentCode != null && dbFieldInfo.CsharpField.Equals(genTable.TreeParentCode)) - // { - // //树 - // sb.AppendLine(@" "); - // sb.AppendLine($@" "); - // sb.AppendLine($@" "); - // sb.AppendLine(@" "); - // sb.AppendLine(@" "); - // } - // //主键、非自增要插入,不能编辑 - // else if (dbFieldInfo.IsPk || dbFieldInfo.IsIncrement) - // { - // sb.AppendLine(" "); - // sb.AppendLine($" "); - // //主键非自增 显示input - // if (!dbFieldInfo.IsIncrement) - // { - // sb.AppendLine($" "); - // } - // else if (dbFieldInfo.IsIncrement) //只有是 自增 就显示label - // { - // sb.AppendLine($" "); - // } - - // sb.AppendLine(" "); - // sb.AppendLine(" "); - // } - // else - // { - // if (dbFieldInfo.HtmlType == GenConstants.HTML_INPUT_NUMBER) - // { - // //数字框 - // sb.AppendLine(" "); - // sb.AppendLine($" "); - // sb.AppendLine($" "); - // sb.AppendLine(" "); - // sb.AppendLine(" "); - // } - // else if (dbFieldInfo.HtmlType == GenConstants.HTML_DATETIME) - // { - // //时间 - // sb.AppendLine(" "); - // sb.AppendLine($" "); - // sb.AppendLine($" "); - // sb.AppendLine(" "); - // sb.AppendLine(" "); - // } - // else if (dbFieldInfo.HtmlType == GenConstants.HTML_IMAGE_UPLOAD) - // { - // //图片 - // sb.AppendLine(" "); - // sb.AppendLine($" "); - // sb.AppendLine($@" "); - // sb.AppendLine(" "); - // sb.AppendLine(" "); - // } - // else if (dbFieldInfo.HtmlType == GenConstants.HTML_FILE_UPLOAD) - // { - // //文件 - // sb.AppendLine(" "); - // sb.AppendLine($" "); - // sb.AppendLine($@" "); - // sb.AppendLine(" "); - // sb.AppendLine(" "); - // } - // else if (dbFieldInfo.HtmlType == GenConstants.HTML_RADIO) - // { - // //单选按钮 - // sb.AppendLine(" "); - // sb.AppendLine($" "); - // sb.AppendLine($" "); - // sb.AppendLine($" {{{{item.dictLabel}}}}"); - // sb.AppendLine(" "); - // sb.AppendLine(" "); - // sb.AppendLine(" "); - // } - // else if (dbFieldInfo.HtmlType == GenConstants.HTML_TEXTAREA) - // { - // //文本域 - // sb.AppendLine(" "); - // sb.AppendLine($" "); - // sb.AppendLine($" "); - // sb.AppendLine(" "); - // sb.AppendLine(" "); - // } - // else if (dbFieldInfo.HtmlType == GenConstants.HTML_EDITOR) - // { - // //编辑器 - // sb.AppendLine(" "); - // sb.AppendLine($" "); - // sb.AppendLine($" "); - // sb.AppendLine(" "); - // sb.AppendLine(" "); - // } - // else if (dbFieldInfo.HtmlType == GenConstants.HTML_SELECT) - // { - // //下拉框 - // sb.AppendLine(" "); - // sb.AppendLine($" "); - // sb.AppendLine($" "); - // sb.AppendLine($" "); - // sb.AppendLine(" "); - // sb.AppendLine(" "); - // sb.AppendLine(" "); - // } - // else if (dbFieldInfo.HtmlType == GenConstants.HTML_CHECKBOX) - // { - // //多选框 - // sb.AppendLine(" "); - // sb.AppendLine($" "); - // sb.AppendLine($" "); - // sb.AppendLine($" {{{{item.dictLabel}}}}"); - // sb.AppendLine(" "); - // sb.AppendLine(" "); - // sb.AppendLine(" "); - // } - // else - // { - // string inputNumTxt = CodeGeneratorTool.IsNumber(dbFieldInfo.CsharpType) ? ".number" : ""; - // sb.AppendLine(" "); - // sb.AppendLine($" "); - // sb.AppendLine($" "); - // sb.AppendLine(" "); - // sb.AppendLine(" "); - // } - // } - // return sb.ToString(); - //} - - #endregion - //模板调用 public static string QueryExp(string propertyName, string queryType) { diff --git a/ZR.Service/System/GenTableService.cs b/ZR.Service/System/GenTableService.cs index f416b4b..b847696 100644 --- a/ZR.Service/System/GenTableService.cs +++ b/ZR.Service/System/GenTableService.cs @@ -72,40 +72,6 @@ namespace ZR.Service.System return GenTableRepository.GetAll(); } - /// - /// 设置代码生成其他参数 - /// - /// - private void SetTableFromOptions(GenTable genTable) - { - //附加参数,key,value格式 - //if (!string.IsNullOrEmpty(genTable?.Options)) - //{ - // Dictionary options = JsonConvert.DeserializeObject>(genTable.Options); - // if (options == null) return; - - // genTable.ParentMenuId = options.GetValueOrDefault("parentMenuId") ?? null; - - // genTable.SortType = options.GetValueOrDefault("sortType") ?? "asc"; - // genTable.SortField = options.GetValueOrDefault("sortField") ?? ""; - - // genTable.TreeParentCode = options.GetValueOrDefault("treeParentCode") ?? ""; - // genTable.TreeName = options.GetValueOrDefault("treeName") ?? ""; - // genTable.TreeCode = options.GetValueOrDefault("treeCode") ?? ""; - - // var checkdBtn = options.GetValueOrDefault("checkedBtn") ?? ""; - // genTable.CheckedBtn = Tools.SpitIntArrary(checkdBtn.ToString()); - - // var permPrefix = options.GetValueOrDefault("permissionPrefix", ""); - - // genTable.PermissionPrefix = permPrefix?.ToString(); - //} - //if (genTable?.Options?.PermissionPrefix.IsEmpty()) - //{ - // genTable?.Options?.PermissionPrefix = $"{genTable.ModuleName.ToLower()}:{genTable.ClassName.ToLower()}";//权限 - //} - } - /// /// 查询代码生成表信息 ///