Browse Source

修复代码生成复选框字典遗漏问题

tags/v3.3.0
Ricky 3 years ago
parent
commit
4d4123243c
  1. 3
      ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/util/VelocityUtils.java
  2. 4
      ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm
  3. 4
      ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm

3
ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/util/VelocityUtils.java

@ -274,7 +274,8 @@ public class VelocityUtils @@ -274,7 +274,8 @@ public class VelocityUtils
for (GenTableColumn column : columns)
{
if (!column.isSuperColumn() && StringUtils.isNotEmpty(column.getDictType()) && StringUtils.equalsAny(
column.getHtmlType(), new String[] { GenConstants.HTML_SELECT, GenConstants.HTML_RADIO }))
column.getHtmlType(),
new String[] { GenConstants.HTML_SELECT, GenConstants.HTML_RADIO, GenConstants.HTML_CHECKBOX }))
{
dicts.add("'" + column.getDictType() + "'");
}

4
ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index-tree.vue.vm

@ -108,7 +108,11 @@ @@ -108,7 +108,11 @@
#elseif($column.list && "" != $column.dictType)
<el-table-column label="${comment}" align="center" prop="${javaField}">
<template slot-scope="scope">
#if($column.htmlType == "checkbox")
<dict-tag :options="dict.type.${column.dictType}" :value="scope.row.${javaField} ? scope.row.${javaField}.split(',') : []"/>
#else
<dict-tag :options="dict.type.${column.dictType}" :value="scope.row.${javaField}"/>
#end
</template>
</el-table-column>
#elseif($column.list && "" != $javaField)

4
ruoyi-modules/ruoyi-gen/src/main/resources/vm/vue/index.vue.vm

@ -136,7 +136,11 @@ @@ -136,7 +136,11 @@
#elseif($column.list && "" != $column.dictType)
<el-table-column label="${comment}" align="center" prop="${javaField}">
<template slot-scope="scope">
#if($column.htmlType == "checkbox")
<dict-tag :options="dict.type.${column.dictType}" :value="scope.row.${javaField} ? scope.row.${javaField}.split(',') : []"/>
#else
<dict-tag :options="dict.type.${column.dictType}" :value="scope.row.${javaField}"/>
#end
</template>
</el-table-column>
#elseif($column.list && "" != $javaField)

Loading…
Cancel
Save