代码生成新增字典回显样式、新增CheckBox回显
This commit is contained in:
@@ -42,26 +42,6 @@ namespace ZR.CodeGenerator
|
||||
|
||||
#region vue 模板
|
||||
|
||||
///// <summary>
|
||||
///// Vue rules
|
||||
///// </summary>
|
||||
///// <param name="dbFieldInfo"></param>
|
||||
///// <returns></returns>
|
||||
//public static string TplFormRules(GenTableColumn dbFieldInfo)
|
||||
//{
|
||||
// StringBuilder sbRule = new StringBuilder();
|
||||
// //Rule 规则验证
|
||||
// if (!dbFieldInfo.IsPk && !dbFieldInfo.IsIncrement && dbFieldInfo.IsRequired)
|
||||
// {
|
||||
// sbRule.AppendLine($" {dbFieldInfo.ColumnName}: [{{ required: true, message: '请输入{dbFieldInfo.ColumnComment}', trigger: \"blur\"}}],");
|
||||
// }
|
||||
// else if (CodeGeneratorTool.IsNumber(dbFieldInfo.ColumnType) && dbFieldInfo.IsRequired)
|
||||
// {
|
||||
// sbRule.AppendLine($" {dbFieldInfo.ColumnName}: [{{ type: 'number', message: '{dbFieldInfo.ColumnName}必须为数字值', trigger: \"blur\"}}],");
|
||||
// }
|
||||
// return sbRule.ToString();
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Vue 添加修改表单
|
||||
/// </summary>
|
||||
@@ -256,6 +236,21 @@ namespace ZR.CodeGenerator
|
||||
sb.AppendLine(" </template>");
|
||||
sb.AppendLine(" </el-table-column>");
|
||||
}
|
||||
else if (dbFieldInfo.IsList && !string.IsNullOrEmpty(dbFieldInfo.DictType))
|
||||
{
|
||||
sb.AppendLine($@" <el-table-column label=""{label}"" align=""center"" prop=""{columnName}"">");
|
||||
sb.AppendLine(@" <template slot-scope=""scope"">");
|
||||
if (dbFieldInfo.HtmlType == "checkbox")
|
||||
{
|
||||
sb.AppendLine($@" <dict-tag :options=""{dbFieldInfo.ColumnName}Options"" :value=""scope.row.{dbFieldInfo.ColumnName} ? scope.row.{dbFieldInfo.ColumnName}.split(',') : []""/>");
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.AppendLine($@" <dict-tag :options=""{dbFieldInfo.ColumnName}Options"" :value=""scope.row.{dbFieldInfo.ColumnName}""/>");
|
||||
}
|
||||
sb.AppendLine(@" </template>");
|
||||
sb.AppendLine(@" </el-table-column>");
|
||||
}
|
||||
else if (dbFieldInfo.IsList)
|
||||
{
|
||||
sb.AppendLine($" <el-table-column prop=\"{columnName}\" label=\"{label}\" align=\"center\" {showToolTip}{formatter}/>");
|
||||
|
||||
Reference in New Issue
Block a user