增加动态表单自动排版配置界面的保存回显逻辑

This commit is contained in:
cuibaocheng 2021-08-11 10:17:00 +08:00
parent 3a721854b4
commit d84dc92055
6 changed files with 88 additions and 5 deletions

View File

@ -14,6 +14,7 @@
<result column="template_all_generate" property="templateAllGenerate"/>
<result column="template_file_type" property="templateFileType"/>
<result column="template_mode" property="templateMode"/>
<result column="template_project" property="templateProject"/>
</resultMap>
<insert id="saveTemplateConfig" parameterType="map">
@ -29,6 +30,7 @@
template_all_generate,
template_file_type,
template_mode,
template_project,
creator,
gmt_create,
modifier,
@ -46,6 +48,7 @@
#{templateAllGenerate},
#{templateFileType},
#{templateMode},
#{templateProject},
#{creator},
#{gmtCreate},
#{modifier},
@ -114,6 +117,9 @@
</if>
<if test="templateMode != null and templateMode != ''">
template_mode = #{templateMode},
</if>
<if test="templateProject != null and templateProject != ''">
template_project = #{templateProject},
</if>
modifier = #{modifier},
gmt_modified = #{gmtModified}
@ -133,7 +139,8 @@
t1.template_file,
t1.template_all_generate,
t1.template_file_type,
t1.template_mode
t1.template_mode,
t1.template_project
FROM
m_template_config t1
WHERE
@ -152,7 +159,8 @@
t1.template_file,
t1.template_all_generate,
t1.template_file_type,
t1.template_mode
t1.template_mode,
t1.template_project
FROM
m_template_config t1
WHERE
@ -175,7 +183,8 @@
t1.template_file,
t1.template_all_generate,
t1.template_file_type,
t1.template_mode
t1.template_mode,
t1.template_project
FROM
m_template_config t1
WHERE
@ -186,6 +195,9 @@
t1.template_name LIKE CONCAT('%', #{keywords}, '%')
)
</if>
<if test="templateProject != null and templateProject != ''">
AND t1.template_project = #{templateProject}
</if>
<if test="startTime != null and startTime != ''">
AND
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}

View File

@ -153,6 +153,9 @@
t1.template_record_id LIKE CONCAT('%', #{keywords}, '%')
)
</if>
<if test="templateProject != null and templateProject != ''">
AND t2.template_project = #{templateProject}
</if>
<if test="startTime != null and startTime != ''">
AND
LEFT(t1.gmt_create, 10) <![CDATA[ >= ]]> #{startTime}

View File

@ -26,6 +26,7 @@
<div class="layui-inline">
<input type="text" id="endTime" class="layui-input search-item" placeholder="结束时间" readonly>
</div>
<div class="layui-inline layui-form search-item-200px" id="templateProjectSelectTemplateBox" lay-filter="templateProjectSelectTemplateBox"></div>
<button type="button" id="search" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-search"></i> 搜索
</button>
@ -50,6 +51,14 @@
</div>
</div>
</div>
<script id="templateProjectSelectTemplate" type="text/html">
<select id="templateProject" name="templateProject">
<option value="">请选择所属项目</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dataId}}">{{item.dataName}}</option>
{{# } }}
</select>
</script>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
<script>
@ -67,6 +76,19 @@
var resizeTimeout = null;
var tableUrl = 'api/templateconfig/listpagetemplateconfig';
// 初始化项目
function initTemplateProject(templateProject) {
top.restAjax.get(top.restAjax.path('api/data/listbyparentid/8b321dfb-3bb3-4ec4-8d42-fa764c0a086f', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('templateProjectSelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('templateProjectSelectTemplateBox').innerHTML = html;
});
form.render('select', 'templateProjectSelectTemplateBox');
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
initTemplateProject();
// 初始化表格
function initTable() {
table.render({
@ -166,7 +188,8 @@
where: {
keywords: $('#keywords').val(),
startTime: $('#startTime').val(),
endTime: $('#endTime').val()
endTime: $('#endTime').val(),
templateProject: $('#templateProject').val()
},
page: {
curr: currentPage

View File

@ -26,6 +26,7 @@
<div class="layui-inline">
<input type="text" id="endTime" class="layui-input search-item" placeholder="结束时间" readonly>
</div>
<div class="layui-inline layui-form search-item-200px" id="templateProjectSelectTemplateBox" lay-filter="templateProjectSelectTemplateBox"></div>
<button type="button" id="search" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-search"></i> 搜索
</button>
@ -50,6 +51,14 @@
</div>
</div>
</div>
<script id="templateProjectSelectTemplate" type="text/html">
<select id="templateProject" name="templateProject">
<option value="">请选择所属项目</option>
{{# for(var i = 0, item; item = d[i++];) { }}
<option value="{{item.dataId}}">{{item.dataName}}</option>
{{# } }}
</select>
</script>
<script src="assets/layuiadmin/layui/layui.js"></script>
<script src="assets/js/vendor/viewer/viewer.min.js"></script>
<script>
@ -67,6 +76,19 @@
var resizeTimeout = null;
var tableUrl = 'api/templaterecord/listpagetemplaterecord';
// 初始化项目
function initTemplateProject(templateProject) {
top.restAjax.get(top.restAjax.path('api/data/listbyparentid/8b321dfb-3bb3-4ec4-8d42-fa764c0a086f', []), {}, null, function(code, data, args) {
laytpl(document.getElementById('templateProjectSelectTemplate').innerHTML).render(data, function(html) {
document.getElementById('templateProjectSelectTemplateBox').innerHTML = html;
});
form.render('select', 'templateProjectSelectTemplateBox');
}, function(code, data) {
top.dialog.msg(data.msg);
});
}
initTemplateProject();
// 初始化表格
function initTable() {
table.render({
@ -175,7 +197,8 @@
where: {
keywords: $('#keywords').val(),
startTime: $('#startTime').val(),
endTime: $('#endTime').val()
endTime: $('#endTime').val(),
templateProject: $('#templateProject').val()
},
page: {
curr: currentPage

View File

@ -39,6 +39,16 @@ public class TemplateConfigDTO {
private String templateFileType;
@ApiModelProperty(name = "templateMode", value = "访问方式1:Nginx静态访问,2:系统接口访问")
private String templateMode;
@ApiModelProperty(name = "templateProject", value = "模板项目")
private String templateProject;
public String getTemplateProject() {
return templateProject == null ? "" : templateProject;
}
public void setTemplateProject(String templateProject) {
this.templateProject = templateProject;
}
public String getTemplateMode() {
return templateMode == null ? "" : templateMode;

View File

@ -41,7 +41,19 @@ public class TemplateConfigVO {
@CheckEmptyAnnotation(name = "生成文件类型")
private String templateFileType;
@ApiModelProperty(name = "templateMode", value = "访问方式1:Nginx静态访问,2:系统接口访问")
@CheckEmptyAnnotation(name = "访问方式")
private String templateMode;
@ApiModelProperty(name = "templateMode", value = "模板项目")
@CheckEmptyAnnotation(name = "模板类型")
private String templateProject;
public String getTemplateProject() {
return templateProject == null ? "" : templateProject;
}
public void setTemplateProject(String templateProject) {
this.templateProject = templateProject;
}
public String getTemplateMode() {
return templateMode == null ? "" : templateMode;