新增加文件上传

This commit is contained in:
不做码农
2021-12-09 22:21:44 +08:00
parent 6f11bae15c
commit 944967afa3
6 changed files with 214 additions and 6 deletions

View File

@@ -89,6 +89,15 @@ namespace ZR.CodeGenerator
sb.AppendLine(" </el-form-item>");
sb.AppendLine(" </el-col>");
}
else if (dbFieldInfo.HtmlType == GenConstants.HTML_FILE_UPLOAD)
{
//文件
sb.AppendLine(" <el-col :span=\"24\">");
sb.AppendLine($" <el-form-item label=\"{labelName}\" :label-width=\"labelWidth\" prop=\"{columnName}\">");
sb.AppendLine($@" <UploadFile v-model=""form.{columnName}"" column=""{columnName}"" @input=""handleUploadSuccess"" />");
sb.AppendLine(" </el-form-item>");
sb.AppendLine(" </el-col>");
}
else if (dbFieldInfo.HtmlType == GenConstants.HTML_RADIO && !string.IsNullOrEmpty(dbFieldInfo.DictType))
{
sb.AppendLine(" <el-col :span=\"12\">");

View File

@@ -61,7 +61,7 @@ namespace ZR.CodeGenerator
PKName = dbFieldInfo.CsharpField;
PKType = dbFieldInfo.CsharpType;
}
if (dbFieldInfo.HtmlType.Equals(GenConstants.HTML_IMAGE_UPLOAD))
if (dbFieldInfo.HtmlType.Equals(GenConstants.HTML_IMAGE_UPLOAD) || dbFieldInfo.HtmlType.Equals(GenConstants.HTML_FILE_UPLOAD))
{
replaceDto.UploadFile = 1;
}
@@ -69,7 +69,6 @@ namespace ZR.CodeGenerator
replaceDto.VueViewFormHtml += CodeGenerateTemplate.TplVueFormContent(dbFieldInfo);
replaceDto.VueViewListHtml += CodeGenerateTemplate.TplTableColumn(dbFieldInfo, dto.GenTable);
//replaceDto.VueViewEditFormRuleContent += CodeGenerateTemplate.TplFormRules(dbFieldInfo);
replaceDto.VueQueryFormHtml += CodeGenerateTemplate.TplQueryFormHtml(dbFieldInfo);
}