修复代码生成树表异常

dep_wangsr
RuoYi 5 years ago committed by Limy
parent c80eb8fd11
commit 5def610df8

@ -75,6 +75,10 @@ public class VelocityUtils
{
context.put("tree_parent_code", paramsObj.getString(GenConstants.TREE_PARENT_CODE));
}
if (paramsObj.containsKey(GenConstants.TREE_NAME))
{
context.put("tree_name", paramsObj.getString(GenConstants.TREE_NAME));
}
}
/**

@ -28,10 +28,9 @@
<div class="col-sm-8">
<div class="input-group">
#set($BusinessName=$businessName.substring(0,1).toUpperCase() + ${businessName.substring(1)})
#set($deptId = "${className}?.deptId")
#set($deptName = "${className}?.deptName")
<input id="treeId" name="${treeParentCode}" type="hidden" th:value="${${deptId}}"/>
<input class="form-control" type="text" onclick="select${BusinessName}Tree()" id="treeName" readonly="true" th:value="${${deptName}}"#if($column.required) required#end>
#set($treeId = "${className}?.${treeCode}")
<input id="treeId" name="${treeParentCode}" type="hidden" th:value="${${treeId}}"/>
<input class="form-control" type="text" onclick="select${BusinessName}Tree()" id="treeName" readonly="true" th:value="${${treeName}}"#if($column.required) required#end>
<span class="input-group-addon"><i class="fa fa-search"></i></span>
</div>
</div>

@ -29,8 +29,6 @@
<div class="col-sm-8">
<div class="input-group">
#set($BusinessName=$businessName.substring(0,1).toUpperCase() + ${businessName.substring(1)})
#set($deptId = "${className}?.deptId")
#set($deptName = "${className}?.deptName")
<input id="treeId" name="${treeParentCode}" type="hidden" th:field="*{${treeParentCode}}" />
<input class="form-control" type="text" onclick="select${BusinessName}Tree()" id="treeName" readonly="true" th:field="*{parentName}"#if($column.required) required#end>
<span class="input-group-addon"><i class="fa fa-search"></i></span>

@ -31,7 +31,7 @@
<th:block th:include="include :: ztree-js" />
<script th:inline="javascript">
$(function() {
var url = ctx + "system/${businessName}/treeData";
var url = ctx + "${moduleName}/${businessName}/treeData";
var options = {
url: url,
expandLevel: 2,

@ -57,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="select${ClassName}Vo"/>
where ${pkColumn.columnName} = #{${pkColumn.javaField}}
#elseif($table.tree)
select#foreach($column in $columns) t.$column.columnName,#end p.dept_name as parent_name
select#foreach($column in $columns) t.$column.columnName,#end p.${tree_name} as parent_name
from ${tableName} t
left join ${tableName} p on p.${pkColumn.columnName} = t.${tree_parent_code}
where t.${pkColumn.columnName} = #{${pkColumn.javaField}}

Loading…
Cancel
Save