diff --git a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js index b61baa16c..e8136c82b 100644 --- a/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js +++ b/ruoyi-admin/src/main/resources/static/ruoyi/js/ry-ui.js @@ -1228,7 +1228,27 @@ var table = { $.modal.alertError(result.msg); } $.modal.closeLoading(); - } + }, + // 显示富文本详细内容 + seeSummernoteDetail: function(index,fild) { + table.set(); + var row = $("#" + table.options.id).bootstrapTable('getData')[index]; + console.log(row) + var content =window.atob(row[fild]); + var htmlcontent = [ + "
", + content, + "
" + ].join(''); + layer.open({ + title: false, + type: 1, + closeBtn: true, + shadeClose: true, + area: ['800px', ($(window).height() - 50)+ 'px'], + content: htmlcontent + }); + } }, // 校验封装处理 validate: { diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTableColumn.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTableColumn.java index a9ca64f4f..8b5ef70dd 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTableColumn.java +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTableColumn.java @@ -59,7 +59,7 @@ public class GenTableColumn extends BaseEntity /** 查询方式(EQ等于、NE不等于、GT大于、LT小于、LIKE模糊、BETWEEN范围) */ private String queryType; - /** 显示类型(input文本框、textarea文本域、select下拉框、checkbox复选框、radio单选框、datetime日期控件) */ + /** 显示类型(input文本框、textarea文本域、select下拉框、checkbox复选框、radio单选框、datetime日期控件、upload附件上传、summernote 富文本) */ private String htmlType; /** 字典类型 */ diff --git a/ruoyi-generator/src/main/resources/templates/tool/gen/edit.html b/ruoyi-generator/src/main/resources/templates/tool/gen/edit.html index 8d46839da..b0b4241ef 100644 --- a/ruoyi-generator/src/main/resources/templates/tool/gen/edit.html +++ b/ruoyi-generator/src/main/resources/templates/tool/gen/edit.html @@ -520,6 +520,8 @@ + + diff --git a/ruoyi-generator/src/main/resources/vm/html/add.html.vm b/ruoyi-generator/src/main/resources/vm/html/add.html.vm index 0d32c3655..400cc6443 100644 --- a/ruoyi-generator/src/main/resources/vm/html/add.html.vm +++ b/ruoyi-generator/src/main/resources/vm/html/add.html.vm @@ -1,19 +1,37 @@ - + - + +#set($isUpload = false) +#set($isSummernote = false) +#set($isDateTime = false) #foreach($column in $columns) #if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "datetime") - +#set($isDateTime = true) + +#break +#end +#end +#foreach($column in $columns) +#if($column.edit && !$column.superColumn && !$column.pk && $column.htmlType == "upload" ) +#set($isUpload = true) + +#break +#end +#end +#foreach($column in $columns) +#if($column.edit && !$column.superColumn && !$column.pk && $column.htmlType == "summernote") +#set($isSummernote = true) + #break #end #end -
-
+
+ #if($table.sub) -

${functionName}信息

+

${functionName}信息

#end #foreach($column in $columns) #set($field=$column.javaField) @@ -27,184 +45,259 @@ #end #set($dictType=$column.dictType) #if("" != $treeParentCode && $column.javaField == $treeParentCode) -
- -
-
+
+ +
+
#set($BusinessName=$businessName.substring(0,1).toUpperCase() + ${businessName.substring(1)}) #set($treeId = "${className}?.${treeCode}") - - - -
+ + +
+
#elseif($column.htmlType == "input") -
- -
- -
+
+ +
+
+
#elseif($column.htmlType == "select" && "" != $dictType) -
- -
- -
+
+ +
+
+
#elseif($column.htmlType == "select" && $dictType) -
- -
- - 代码生成请选择字典属性 -
+
+ +
+ + 代码生成请选择字典属性
+
#elseif($column.htmlType == "checkbox" && "" != $dictType) -
- -
- -
+
+ +
+
+
#elseif($column.htmlType == "checkbox" && $dictType) -
- -
- - 代码生成请选择字典属性 -
+
+ +
+ + 代码生成请选择字典属性
+
#elseif($column.htmlType == "radio" && "" != $dictType) -
- -
-
- - -
+
+ +
+
+ +
+
#elseif($column.htmlType == "radio" && $dictType) -
- -
-
- - -
- 代码生成请选择字典属性 +
+ +
+
+ +
+ 代码生成请选择字典属性
+
#elseif($column.htmlType == "datetime") -
- -
-
- - -
+
+ +
+
+ +
+
#elseif($column.htmlType == "textarea") -
- -
- +
+ +
+ +
+
+#elseif($column.htmlType == "upload") +
+ +
+
+ +
+
+#elseif($column.htmlType == "summernote" ) +
+ +
+ +
+
+
#end #end #end #end #if($table.sub) -

${subTable.functionName}信息

-
-
- - -
-
-
+

${subTable.functionName}信息

+
+
+ + +
+
+
#end - -
- -#foreach($column in $columns) -#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "datetime") - -#break + +
+ +#if($isDateTime) + #end +#if($isUpload) + #end - +#end + } + }); + } +#end + \ No newline at end of file diff --git a/ruoyi-generator/src/main/resources/vm/html/edit.html.vm b/ruoyi-generator/src/main/resources/vm/html/edit.html.vm index 5d2ea8cb7..4eb1ef1a1 100644 --- a/ruoyi-generator/src/main/resources/vm/html/edit.html.vm +++ b/ruoyi-generator/src/main/resources/vm/html/edit.html.vm @@ -1,21 +1,39 @@ - + - +#set($isUpload = false) +#set($isSummernote = false) +#set($isDateTime = false) + #foreach($column in $columns) #if($column.edit && !$column.superColumn && !$column.pk && $column.htmlType == "datetime") - +#set($isDateTime = true) + +#break +#end +#end +#foreach($column in $columns) +#if($column.edit && !$column.superColumn && !$column.pk && $column.htmlType == "upload") +#set($isUpload = true) + +#break +#end +#end +#foreach($column in $columns) +#if($column.edit && !$column.superColumn && !$column.pk && $column.htmlType == "summernote") +#set($isSummernote = true) + #break #end #end -
-
+
+ #if($table.sub) -

${functionName}信息

+

${functionName}信息

#end - + #foreach($column in $columns) #if($column.edit && !$column.pk) #if(($column.usableColumn) || (!$column.superColumn)) @@ -28,100 +46,137 @@ #set($field=$column.javaField) #set($dictType=$column.dictType) #if("" != $treeParentCode && $column.javaField == $treeParentCode) -
- -
-
+
+ +
+
#set($BusinessName=$businessName.substring(0,1).toUpperCase() + ${businessName.substring(1)}) - - - -
+ + +
+
#elseif($column.htmlType == "input") -
- -
- -
+
+ +
+
+
#elseif($column.htmlType == "select" && "" != $dictType) -
- -
- -
+
+ +
+
+
#elseif($column.htmlType == "select" && $dictType) -
- -
- - 代码生成请选择字典属性 -
+
+ +
+ + 代码生成请选择字典属性
+
#elseif($column.htmlType == "checkbox" && "" != $dictType) -
- -
- -
+
+ +
+
+
#elseif($column.htmlType == "checkbox" && $dictType) -
- -
- - 代码生成请选择字典属性 -
+
+ +
+ + 代码生成请选择字典属性
+
#elseif($column.htmlType == "radio" && "" != $dictType) -
- -
-
- - -
+
+ +
+
+ +
+
#elseif($column.htmlType == "radio" && $dictType) -
- -
-
- - -
- 代码生成请选择字典属性 +
+ +
+
+ +
+ 代码生成请选择字典属性
+
#elseif($column.htmlType == "datetime") -
- -
-
- - -
+
+ +
+
+ +
+
#elseif($column.htmlType == "textarea") -
- -
- +
+ +
+ +
+
+#elseif($column.htmlType == "upload" || $column.htmlType == "uploads") +
+ +
+
+ +
+
+#elseif($column.htmlType == "summernote" ) +
+ +
+ +
+
+
#end #end #end @@ -130,82 +185,133 @@

${subTable.functionName}信息

- - + +
#end - -
- -#foreach($column in $columns) -#if($column.edit && !$column.superColumn && !$column.pk && $column.htmlType == "datetime") - -#break + +
+ +#if($isDateTime) + #end +#if($isUpload) + #end - + } + }); + } + #end + \ No newline at end of file diff --git a/ruoyi-generator/src/main/resources/vm/html/list-tree.html.vm b/ruoyi-generator/src/main/resources/vm/html/list-tree.html.vm index 59510d3d0..2129daf70 100644 --- a/ruoyi-generator/src/main/resources/vm/html/list-tree.html.vm +++ b/ruoyi-generator/src/main/resources/vm/html/list-tree.html.vm @@ -107,6 +107,8 @@ #foreach($column in $columns) #set($dictType=$column.dictType) #set($javaField=$column.javaField) +#set($isUpload = $column.htmlType == 'upload') +#set($isSummernote = $column.htmlType == 'summernote') #set($parentheseIndex=$column.columnComment.indexOf("(")) #if($parentheseIndex != -1) #set($comment=$column.columnComment.substring(0, $parentheseIndex)) @@ -124,11 +126,34 @@ } }, #elseif($column.list && "" != $javaField) + #if($isUpload) + { + field: '${javaField}', + title: '${comment}', + formatter: function(value, row, index) { + if(row.${column.javaField}){ + return ' ' + // 如果是图片,把下面注释取消 + // return $.table.imageView(row.${column.javaField}); + } + return '' + } + }, + #elseif($isSummernote) + { + field: '${javaField}', + title: '${comment}', + formatter: function(value, row, index) { + return '' + } + }, + #else { field: '${javaField}', title: '${comment}', align: 'left' }, + #end #end #end { diff --git a/ruoyi-generator/src/main/resources/vm/html/list.html.vm b/ruoyi-generator/src/main/resources/vm/html/list.html.vm index 16b0ce511..d070350f6 100644 --- a/ruoyi-generator/src/main/resources/vm/html/list.html.vm +++ b/ruoyi-generator/src/main/resources/vm/html/list.html.vm @@ -103,6 +103,8 @@ }, #foreach($column in $columns) #set($dictType=$column.dictType) +#set($isUpload = $column.htmlType == 'upload') +#set($isSummernote = $column.htmlType == 'summernote') #set($javaField=$column.javaField) #set($parentheseIndex=$column.columnComment.indexOf("(")) #if($parentheseIndex != -1) @@ -125,10 +127,36 @@ } }, #elseif($column.list && "" != $javaField) + #if($isUpload) + { + field: '${javaField}', + title: '${comment}', + formatter: function(value, row, index) { + if(row.${column.javaField}){ + return ' ' + // 如果是图片,把下面注释取消 + // return $.table.imageView(row.${column.javaField}); + } + return '' + } + }, + #elseif($isSummernote) + { + field: '${javaField}', + title: '${comment}', + formatter: function(value, row, index) { + var actions = []; + actions.push('查看 '); + return actions.join(''); + } + }, + #else { field: '${javaField}', title: '${comment}' }, + #end + #end #end {