设置单图上传控件

This commit is contained in:
RuoYi 2021-01-05 16:19:37 +08:00
parent 7d5c77a98e
commit 16e1198aea
4 changed files with 15 additions and 15 deletions

View File

@ -77,7 +77,7 @@ public class GenConstants
public static final String HTML_DATETIME = "datetime"; public static final String HTML_DATETIME = "datetime";
/** 上传控件 */ /** 上传控件 */
public static final String HTML_UPLOAD_IMAGE = "uploadImage"; public static final String HTML_IMAGE_UPLOAD = "imageUpload";
/** 富文本控件 */ /** 富文本控件 */
public static final String HTML_EDITOR = "editor"; public static final String HTML_EDITOR = "editor";

View File

@ -112,10 +112,10 @@ public class GenUtils
{ {
column.setHtmlType(GenConstants.HTML_SELECT); column.setHtmlType(GenConstants.HTML_SELECT);
} }
// 文件字段设置上传控件 // 图片字段设置单图控件
else if (StringUtils.endsWithIgnoreCase(columnName, "image")) else if (StringUtils.endsWithIgnoreCase(columnName, "image"))
{ {
column.setHtmlType(GenConstants.HTML_UPLOAD_IMAGE); column.setHtmlType(GenConstants.HTML_IMAGE_UPLOAD);
} }
// 内容字段设置富文本控件 // 内容字段设置富文本控件
else if (StringUtils.endsWithIgnoreCase(columnName, "content")) else if (StringUtils.endsWithIgnoreCase(columnName, "content"))

View File

@ -153,9 +153,9 @@
<el-form-item label="${comment}" prop="${field}"> <el-form-item label="${comment}" prop="${field}">
<el-input v-model="form.${field}" placeholder="请输入${comment}" /> <el-input v-model="form.${field}" placeholder="请输入${comment}" />
</el-form-item> </el-form-item>
#elseif($column.htmlType == "uploadImage") #elseif($column.htmlType == "imageUpload")
<el-form-item label="${comment}"> <el-form-item label="${comment}">
<uploadImage v-model="form.${field}"/> <imageUpload v-model="form.${field}"/>
</el-form-item> </el-form-item>
#elseif($column.htmlType == "editor") #elseif($column.htmlType == "editor")
<el-form-item label="${comment}"> <el-form-item label="${comment}">
@ -244,8 +244,8 @@ import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${Busin
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
#foreach($column in $columns) #foreach($column in $columns)
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "uploadImage") #if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "imageUpload")
import UploadImage from '@/components/UploadImage'; import ImageUpload from '@/components/ImageUpload';
#break #break
#end #end
#end #end
@ -260,8 +260,8 @@ export default {
name: "${BusinessName}", name: "${BusinessName}",
components: { components: {
#foreach($column in $columns) #foreach($column in $columns)
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "uploadImage") #if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "imageUpload")
UploadImage, ImageUpload,
#break #break
#end #end
#end #end

View File

@ -185,9 +185,9 @@
<el-form-item label="${comment}" prop="${field}"> <el-form-item label="${comment}" prop="${field}">
<el-input v-model="form.${field}" placeholder="请输入${comment}" /> <el-input v-model="form.${field}" placeholder="请输入${comment}" />
</el-form-item> </el-form-item>
#elseif($column.htmlType == "uploadImage") #elseif($column.htmlType == "imageUpload")
<el-form-item label="${comment}"> <el-form-item label="${comment}">
<uploadImage v-model="form.${field}"/> <imageUpload v-model="form.${field}"/>
</el-form-item> </el-form-item>
#elseif($column.htmlType == "editor") #elseif($column.htmlType == "editor")
<el-form-item label="${comment}"> <el-form-item label="${comment}">
@ -274,8 +274,8 @@
<script> <script>
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName}, export${BusinessName} } from "@/api/${moduleName}/${businessName}"; import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName}, export${BusinessName} } from "@/api/${moduleName}/${businessName}";
#foreach($column in $columns) #foreach($column in $columns)
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "uploadImage") #if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "imageUpload")
import UploadImage from '@/components/UploadImage'; import ImageUpload from '@/components/ImageUpload';
#break #break
#end #end
#end #end
@ -290,8 +290,8 @@ export default {
name: "${BusinessName}", name: "${BusinessName}",
components: { components: {
#foreach($column in $columns) #foreach($column in $columns)
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "uploadImage") #if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "imageUpload")
UploadImage, ImageUpload,
#break #break
#end #end
#end #end