若依 4.0
This commit is contained in:
@ -1,61 +1,159 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增${tableComment}')" />
|
||||
<th:block th:include="include :: header('新增${functionName}')" />
|
||||
#foreach($column in $columns)
|
||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "datetime")
|
||||
<th:block th:include="include :: datetimepicker-css" />
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-${classname}-add">
|
||||
<form class="form-horizontal m" id="form-${businessName}-add">
|
||||
#foreach($column in $columns)
|
||||
#if($column.columnName != $primaryKey.columnName)
|
||||
#if(!${column.configInfo})
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${column.columnComment}:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="${column.attrname}" name="${column.attrname}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
#set($field=$column.javaField)
|
||||
#if($column.insert && !$column.superColumn && !$column.pk)
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||||
#else
|
||||
#if(${column.configInfo.type} == "dict")
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${column.columnComment}:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="${column.attrname}" class="form-control m-b" th:with="type=${@dict.getType('${column.configInfo.value}')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
#elseif(${column.configInfo.type} == "date")
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${column.columnComment}:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="${column.attrname}" name="${column.attrname}" class="form-control time-input" type="text">
|
||||
</div>
|
||||
</div>
|
||||
#elseif(${column.configInfo.type} == "fk")
|
||||
#set($comment=$column.columnComment)
|
||||
#end
|
||||
#set($dictType=$column.dictType)
|
||||
#if("" != $treeParentCode && $column.javaField == $treeParentCode)
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${comment}:</label>
|
||||
<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>
|
||||
<span class="input-group-addon"><i class="fa fa-search"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
#elseif($column.htmlType == "input")
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${comment}:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="${field}" class="form-control" type="text"#if($column.required) required#end>
|
||||
</div>
|
||||
</div>
|
||||
#elseif($column.htmlType == "select" && "" != $dictType)
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${comment}:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="${field}" class="form-control m-b" th:with="type=${@dict.getType('${dictType}')}"#if($column.required) required#end>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
#elseif($column.htmlType == "select" && $dictType)
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${comment}:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="${field}" class="form-control m-b"#if($column.required) required#end>
|
||||
<option value="">所有</option>
|
||||
</select>
|
||||
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
|
||||
</div>
|
||||
</div>
|
||||
#elseif($column.htmlType == "radio" && "" != $dictType)
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${comment}:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio-box" th:each="dict : ${@dict.getType('${dictType}')}">
|
||||
<input type="radio" th:id="${dict.dictCode}" name="${field}" th:value="${dict.dictValue}" th:checked="${dict.default}"#if($column.required) required#end>
|
||||
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
#elseif($column.htmlType == "radio" && $dictType)
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${comment}:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio-box">
|
||||
<input type="radio" name="${field}" value=""#if($column.required) required#end>
|
||||
<label th:for="${field}" th:text="未知"></label>
|
||||
</div>
|
||||
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
|
||||
</div>
|
||||
</div>
|
||||
#elseif($column.htmlType == "datetime")
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${comment}:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group date">
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||
<input name="${field}" class="form-control" placeholder="yyyy-MM-dd" type="text"#if($column.required) required#end>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
#elseif($column.htmlType == "textarea")
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${comment}:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="${field}" class="form-control"#if($column.required) required#end></textarea>
|
||||
</div>
|
||||
</div>
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
#foreach($column in $columns)
|
||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "datetime")
|
||||
<th:block th:include="include :: datetimepicker-js" />
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
</form>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script type="text/javascript">
|
||||
var prefix = ctx + "${moduleName}/${classname}"
|
||||
$("#form-${classname}-add").validate({
|
||||
rules:{
|
||||
xxxx:{
|
||||
required:true,
|
||||
},
|
||||
},
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-${classname}-add').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
var prefix = ctx + "${moduleName}/${businessName}"
|
||||
$("#form-${businessName}-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-${businessName}-add').serialize());
|
||||
}
|
||||
}
|
||||
#foreach($column in $columns)
|
||||
#if($column.insert && !$column.superColumn && !$column.pk && $column.htmlType == "datetime")
|
||||
|
||||
$("input[name='$column.javaField']").datetimepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
minView: "month",
|
||||
autoclose: true
|
||||
});
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
#if($table.tree)
|
||||
|
||||
/*${functionName}-新增-选择父部门树*/
|
||||
function select${BusinessName}Tree() {
|
||||
var options = {
|
||||
title: '${functionName}选择',
|
||||
width: "380",
|
||||
url: prefix + "/select${BusinessName}Tree/" + $("#treeId").val(),
|
||||
callBack: doSubmit
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
|
||||
function doSubmit(index, layero){
|
||||
var body = layer.getChildFrame('body', index);
|
||||
$("#treeId").val(body.find('#treeId').val());
|
||||
$("#treeName").val(body.find('#treeName').val());
|
||||
layer.close(index);
|
||||
}
|
||||
#end
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
@ -1,62 +1,160 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改${tableComment}')" />
|
||||
<th:block th:include="include :: header('修改${functionName}')" />
|
||||
#foreach($column in $columns)
|
||||
#if($column.edit && !$column.superColumn && !$column.pk && $column.htmlType == "datetime")
|
||||
<th:block th:include="include :: datetimepicker-css" />
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-${classname}-edit" th:object="${${classname}}">
|
||||
<input id="${primaryKey.attrname}" name="${primaryKey.attrname}" th:field="*{${primaryKey.attrname}}" type="hidden">
|
||||
<form class="form-horizontal m" id="form-${businessName}-edit" th:object="${${className}}">
|
||||
<input name="${pkColumn.javaField}" th:field="*{${pkColumn.javaField}}" type="hidden">
|
||||
#foreach($column in $columns)
|
||||
#if($column.columnName != $primaryKey.columnName)
|
||||
#if(!${column.configInfo})
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${column.columnComment}:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="${column.attrname}" name="${column.attrname}" th:field="*{${column.attrname}}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
#if($column.edit && !$column.superColumn && !$column.pk)
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||||
#else
|
||||
#if(${column.configInfo.type} == "dict")
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${column.columnComment}:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="${column.attrname}" class="form-control m-b" th:with="type=${@dict.getType('${column.configInfo.value}')}">
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{${column.attrname}}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
#elseif(${column.configInfo.type} == "date")
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${column.columnComment}:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="${column.attrname}" name="${column.attrname}" th:field="*{${column.attrname}}" class="form-control time-input" type="text">
|
||||
</div>
|
||||
</div>
|
||||
#elseif(${column.configInfo.type} == "fk")
|
||||
#set($comment=$column.columnComment)
|
||||
#end
|
||||
#set($field=$column.javaField)
|
||||
#set($dictType=$column.dictType)
|
||||
#if("" != $treeParentCode && $column.javaField == $treeParentCode)
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${comment}:</label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
#elseif($column.htmlType == "input")
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${comment}:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="${field}" th:field="*{${field}}" class="form-control" type="text"#if($column.required) required#end>
|
||||
</div>
|
||||
</div>
|
||||
#elseif($column.htmlType == "select" && "" != $dictType)
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${comment}:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="${field}" class="form-control m-b" th:with="type=${@dict.getType('${dictType}')}"#if($column.required) required#end>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{${field}}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
#elseif($column.htmlType == "select" && $dictType)
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${comment}:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="${field}" class="form-control m-b"#if($column.required) required#end>
|
||||
<option value="">所有</option>
|
||||
</select>
|
||||
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
|
||||
</div>
|
||||
</div>
|
||||
#elseif($column.htmlType == "radio" && "" != $dictType)
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${comment}:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio-box" th:each="dict : ${@dict.getType('${dictType}')}">
|
||||
<input type="radio" th:id="${dict.dictCode}" name="${field}" th:value="${dict.dictValue}" th:field="*{${field}}"#if($column.required) required#end>
|
||||
<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
#elseif($column.htmlType == "radio" && $dictType)
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${comment}:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio-box">
|
||||
<input type="radio" name="${field}" value=""#if($column.required) required#end>
|
||||
<label th:for="${field}" th:text="未知"></label>
|
||||
</div>
|
||||
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
|
||||
</div>
|
||||
</div>
|
||||
#elseif($column.htmlType == "datetime")
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${comment}:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="input-group date">
|
||||
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||
<input name="${field}" th:value="${#dates.format(${className}.${field}, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text"#if($column.required) required#end>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
#elseif($column.htmlType == "textarea")
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">${comment}:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="${field}" class="form-control"#if($column.required) required#end>[[*{${field}}]]</textarea>
|
||||
</div>
|
||||
</div>
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
</form>
|
||||
</form>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<th:block th:include="include :: footer" />
|
||||
#foreach($column in $columns)
|
||||
#if($column.edit && !$column.superColumn && !$column.pk && $column.htmlType == "datetime")
|
||||
<th:block th:include="include :: datetimepicker-js" />
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
<script type="text/javascript">
|
||||
var prefix = ctx + "${moduleName}/${classname}";
|
||||
$("#form-${classname}-edit").validate({
|
||||
rules:{
|
||||
xxxx:{
|
||||
required:true,
|
||||
},
|
||||
},
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-${classname}-edit').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
var prefix = ctx + "${moduleName}/${businessName}";
|
||||
$("#form-${businessName}-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-${businessName}-edit').serialize());
|
||||
}
|
||||
}
|
||||
#foreach($column in $columns)
|
||||
#if($column.edit && !$column.superColumn && !$column.pk && $column.htmlType == "datetime")
|
||||
|
||||
$("input[name='$column.javaField']").datetimepicker({
|
||||
format: "yyyy-mm-dd",
|
||||
minView: "month",
|
||||
autoclose: true
|
||||
});
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
#if($table.tree)
|
||||
|
||||
/*${functionName}-新增-选择父部门树*/
|
||||
function select${BusinessName}Tree() {
|
||||
var options = {
|
||||
title: '${functionName}选择',
|
||||
width: "380",
|
||||
url: prefix + "/select${BusinessName}Tree/" + $("#treeId").val(),
|
||||
callBack: doSubmit
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
|
||||
function doSubmit(index, layero){
|
||||
var body = layer.getChildFrame('body', index);
|
||||
$("#treeId").val(body.find('#treeId').val());
|
||||
$("#treeName").val(body.find('#treeName').val());
|
||||
layer.close(index);
|
||||
}
|
||||
#end
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
150
ruoyi-generator/src/main/resources/vm/html/list-tree.html.vm
Normal file
150
ruoyi-generator/src/main/resources/vm/html/list-tree.html.vm
Normal file
@ -0,0 +1,150 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('${functionName}列表')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
#foreach($column in $columns)
|
||||
#if($column.query)
|
||||
#set($dictType=$column.dictType)
|
||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||||
#else
|
||||
#set($comment=$column.columnComment)
|
||||
#end
|
||||
#if($column.htmlType == "input")
|
||||
<li>
|
||||
<p>${comment}:</p>
|
||||
<input type="text" name="${column.javaField}"/>
|
||||
</li>
|
||||
#elseif($column.htmlType == "select" || $column.htmlType == "radio" && "" != $dictType)
|
||||
<li>
|
||||
<p>${comment}:</p>
|
||||
<select name="${column.javaField}" th:with="type=${@dict.getType('${dictType}')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
#elseif($column.htmlType == "select" || $column.htmlType == "radio" && $dictType)
|
||||
<li>
|
||||
<p>${comment}:</p>
|
||||
<select name="${column.javaField}">
|
||||
<option value="">所有</option>
|
||||
</select>
|
||||
</li>
|
||||
#elseif($column.htmlType == "datetime")
|
||||
<li class="select-time">
|
||||
<p>${comment}:</p>
|
||||
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[begin${AttrName}]"/>
|
||||
<span>-</span>
|
||||
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[end${AttrName}]"/>
|
||||
</li>
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="${permissionPrefix}:add">
|
||||
<i class="fa fa-plus"></i> 新增
|
||||
</a>
|
||||
<a class="btn btn-primary" onclick="$.operate.edit()" shiro:hasPermission="${permissionPrefix}:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-info" id="expandAllBtn">
|
||||
<i class="fa fa-exchange"></i> 展开/折叠
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-tree-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var addFlag = [[${@permission.hasPermi('${permissionPrefix}:add')}]];
|
||||
var editFlag = [[${@permission.hasPermi('${permissionPrefix}:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('${permissionPrefix}:remove')}]];
|
||||
#foreach($column in $columns)
|
||||
#if(${column.dictType} != '')
|
||||
var ${column.javaField}Datas = [[${@dict.getType('${column.dictType}')}]];
|
||||
#end
|
||||
#end
|
||||
var prefix = ctx + "${moduleName}/${businessName}";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
code: "${treeCode}",
|
||||
parentCode: "${treeParentCode}",
|
||||
expandColumn: "${expandColumn}",
|
||||
uniqueId: "${pkColumn.javaField}",
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add/{id}",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove/{id}",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "${functionName}",
|
||||
columns: [{
|
||||
field: 'selectItem',
|
||||
radio: true
|
||||
},
|
||||
#foreach($column in $columns)
|
||||
#set($dictType=$column.dictType)
|
||||
#set($javaField=$column.javaField)
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||||
#else
|
||||
#set($comment=$column.columnComment)
|
||||
#end
|
||||
#if($column.pk)
|
||||
#elseif($column.list && "" != $dictType)
|
||||
{
|
||||
field : '${javaField}',
|
||||
title : '${comment}',
|
||||
align: 'left',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(${javaField}Datas, value);
|
||||
}
|
||||
},
|
||||
#elseif($column.list && "" != $javaField)
|
||||
{
|
||||
field : '${javaField}',
|
||||
title : '${comment}',
|
||||
align: 'left'
|
||||
},
|
||||
#end
|
||||
#end
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
align: 'left',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.${pkColumn.javaField} + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-info btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="$.operate.add(\'' + row.${pkColumn.javaField} + '\')"><i class="fa fa-plus"></i>新增</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.${pkColumn.javaField} + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.treeTable.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,80 +1,93 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('${tableComment}列表')" />
|
||||
<th:block th:include="include :: header('${functionName}列表')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
#foreach($column in $columns)
|
||||
#if($column.columnName != $primaryKey.columnName)
|
||||
#if(!${column.configInfo})
|
||||
<li>
|
||||
${column.columnComment}:<input type="text" name="${column.attrname}"/>
|
||||
</li>
|
||||
#if($column.query)
|
||||
#set($dictType=$column.dictType)
|
||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||||
#else
|
||||
#set($comment=$column.columnComment)
|
||||
#end
|
||||
#if($column.htmlType == "input")
|
||||
<li>
|
||||
<p>${comment}:</p>
|
||||
<input type="text" name="${column.javaField}"/>
|
||||
</li>
|
||||
#elseif($column.htmlType == "select" || $column.htmlType == "radio" && "" != $dictType)
|
||||
<li>
|
||||
<p>${comment}:</p>
|
||||
<select name="${column.javaField}" th:with="type=${@dict.getType('${dictType}')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
#elseif($column.htmlType == "select" || $column.htmlType == "radio" && $dictType)
|
||||
<li>
|
||||
<p>${comment}:</p>
|
||||
<select name="${column.javaField}">
|
||||
<option value="">所有</option>
|
||||
</select>
|
||||
</li>
|
||||
#elseif($column.htmlType == "datetime")
|
||||
<li class="select-time">
|
||||
<p>${comment}:</p>
|
||||
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[begin${AttrName}]"/>
|
||||
<span>-</span>
|
||||
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[end${AttrName}]"/>
|
||||
</li>
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
#else
|
||||
#if(${column.configInfo.type} == "dict")
|
||||
<li>
|
||||
${column.columnComment}:<select name="${column.attrname}" th:with="type=${@dict.getType('${column.configInfo.value}')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
#elseif(${column.configInfo.type} == "date")
|
||||
<li class="select-time">
|
||||
<label>${column.columnComment}: </label>
|
||||
<input type="text" class="time-input" id="start${column.attrName}" placeholder="开始" name="params[begin${column.attrName}]"/>
|
||||
<span>-</span>
|
||||
<input type="text" class="time-input" id="end${column.attrName}" placeholder="结束" name="params[end${column.attrName}]"/>
|
||||
</li>
|
||||
#elseif(${column.configInfo.type} == "fk")
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="${moduleName}:${classname}:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="${moduleName}:${classname}:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="${moduleName}:${classname}:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="${moduleName}:${classname}:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table" data-mobile-responsive="true"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:include="include :: footer"></div>
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="${permissionPrefix}:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="${permissionPrefix}:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="${permissionPrefix}:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="${permissionPrefix}:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table" data-mobile-responsive="true"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('${moduleName}:${classname}:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('${moduleName}:${classname}:remove')}]];
|
||||
var prefix = ctx + "${moduleName}/${classname}";
|
||||
var editFlag = [[${@permission.hasPermi('${permissionPrefix}:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('${permissionPrefix}:remove')}]];
|
||||
#foreach($column in $columns)
|
||||
#if(${column.configInfo} && ${column.configInfo.type} == 'dict')
|
||||
var datas = [[${@dict.getType('${column.configInfo.value}')}]];
|
||||
#if(${column.dictType} != '')
|
||||
var ${column.javaField}Datas = [[${@dict.getType('${column.dictType}')}]];
|
||||
#end
|
||||
#end
|
||||
var prefix = ctx + "${moduleName}/${businessName}";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
@ -82,48 +95,51 @@
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "${tableComment}",
|
||||
showExport: true,
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "${functionName}",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
checkbox: true
|
||||
},
|
||||
#foreach($column in $columns)
|
||||
#if($column.columnName == $primaryKey.columnName)
|
||||
{
|
||||
field : '${column.attrname}',
|
||||
title : '${column.columnComment}',
|
||||
visible: false
|
||||
},
|
||||
#elseif($column.columnName != $primaryKey.columnName)
|
||||
#if(${column.configInfo} && ${column.configInfo.type} == 'dict')
|
||||
{
|
||||
field : '${column.attrname}',
|
||||
title : '${column.columnComment}',
|
||||
sortable: true,
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(datas, value);
|
||||
}
|
||||
},
|
||||
#set($dictType=$column.dictType)
|
||||
#set($javaField=$column.javaField)
|
||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||
#if($parentheseIndex != -1)
|
||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
||||
#else
|
||||
{
|
||||
field : '${column.attrname}',
|
||||
title : '${column.columnComment}',
|
||||
sortable: true
|
||||
},
|
||||
#set($comment=$column.columnComment)
|
||||
#end
|
||||
#end
|
||||
#if($column.pk)
|
||||
{
|
||||
field : '${javaField}',
|
||||
title : '${comment}',
|
||||
visible: false
|
||||
},
|
||||
#elseif($column.list && "" != $dictType)
|
||||
{
|
||||
field : '${javaField}',
|
||||
title : '${comment}',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(${javaField}Datas, value);
|
||||
}
|
||||
},
|
||||
#elseif($column.list && "" != $javaField)
|
||||
{
|
||||
field : '${javaField}',
|
||||
title : '${comment}'
|
||||
},
|
||||
#end
|
||||
#end
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.${primaryKey.attrname} + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.${primaryKey.attrname} + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.${pkColumn.javaField} + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.${pkColumn.javaField} + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
51
ruoyi-generator/src/main/resources/vm/html/tree.html.vm
Normal file
51
ruoyi-generator/src/main/resources/vm/html/tree.html.vm
Normal file
@ -0,0 +1,51 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('${functionName}树选择')" />
|
||||
<th:block th:include="include :: ztree-css" />
|
||||
</head>
|
||||
<style>
|
||||
body{height:auto;font-family: "Microsoft YaHei";}
|
||||
button{font-family: "SimSun","Helvetica Neue",Helvetica,Arial;}
|
||||
</style>
|
||||
<body class="hold-transition box box-main">
|
||||
#set($treeId = "${className}?." + $treeCode)
|
||||
#set($treeName = "${className}?." + $treeName)
|
||||
<input id="treeId" name="treeId" type="hidden" th:value="${${treeId}}"/>
|
||||
<input id="treeName" name="treeName" type="hidden" th:value="${${treeName}}"/>
|
||||
<div class="wrapper"><div class="treeShowHideButton" onclick="$.tree.toggleSearch();">
|
||||
<label id="btnShow" title="显示搜索" style="display:none;">︾</label>
|
||||
<label id="btnHide" title="隐藏搜索">︽</label>
|
||||
</div>
|
||||
<div class="treeSearchInput" id="search">
|
||||
<label for="keyword">关键字:</label><input type="text" class="empty" id="keyword" maxlength="50">
|
||||
<button class="btn" id="btn" onclick="$.tree.searchNode()"> 搜索 </button>
|
||||
</div>
|
||||
<div class="treeExpandCollapse">
|
||||
<a href="#" onclick="$.tree.expand()">展开</a> /
|
||||
<a href="#" onclick="$.tree.collapse()">折叠</a>
|
||||
</div>
|
||||
<div id="tree" class="ztree treeselect"></div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: ztree-js" />
|
||||
<script th:inline="javascript">
|
||||
$(function() {
|
||||
var url = ctx + "system/${businessName}/treeData";
|
||||
var options = {
|
||||
url: url,
|
||||
expandLevel: 2,
|
||||
onClick : zOnClick
|
||||
};
|
||||
$.tree.init(options);
|
||||
});
|
||||
|
||||
function zOnClick(event, treeId, treeNode) {
|
||||
var treeId = treeNode.id;
|
||||
var treeName = treeNode.name;
|
||||
$("#treeId").val(treeId);
|
||||
$("#treeName").val(treeName);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user