代码生成添加修改新增加CheckBox

This commit is contained in:
不做码农
2021-12-14 15:40:39 +08:00
parent 7352c2fea5
commit d1fc87bcc3
5 changed files with 37 additions and 4 deletions

View File

@@ -118,6 +118,21 @@ namespace ZR.CodeGenerator
sb.AppendLine(" </el-form-item>");
sb.AppendLine(" </el-col>");
}
else if( dbFieldInfo.HtmlType == GenConstants.HTML_CHECKBOX)
{
//多选框
sb.AppendLine(" <el-col :span=\"12\">");
sb.AppendLine($" <el-form-item label=\"{labelName}\" prop=\"{columnName}\">");
sb.AppendLine($" <el-checkbox-group v-model=\"form.{columnName}Checked\"> ");
if (string.IsNullOrEmpty(dbFieldInfo.DictType))
{
sb.AppendLine($" <el-checkbox>请选择字典生成</el-checkbox>");
}
sb.AppendLine($" <el-checkbox v-for=\"item in {columnName}Options\" :key=\"item.dictValue\" :label=\"item.dictValue\">{{{{item.dictLabel}}}}</el-checkbox>");
sb.AppendLine(" </el-checkbox-group>");
sb.AppendLine(" </el-form-item>");
sb.AppendLine(" </el-col>");
}
else
{
string inputNumTxt = CodeGeneratorTool.IsNumber(dbFieldInfo.CsharpType) ? ".number" : "";