提交 c1e00acf 编写于 作者: doc_wei's avatar doc_wei

新增调用次数,去除已使用模板删除操作

上级 23bb26ec
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
a.group_num groupNum, a.group_num groupNum,
a.group_desc groupDesc, a.group_desc groupDesc,
CONVERT(a.create_time, char) createTime, CONVERT(a.create_time, char) createTime,
(SELECT COUNT(*) FROM code_model b WHERE b.group_id = a.id) modelNum (SELECT COUNT(*) FROM code_model b WHERE b.group_id = a.id) modelNum,
(SELECT COUNT(*) FROM (SELECT COUNT(*), c.group_id FROM code_model_history c GROUP BY c.file_path) d WHERE d.group_id = a.id) useNum
FROM FROM
code_model_group a code_model_group a
WHERE 1 = 1 WHERE 1 = 1
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
a.model_content modelContent, a.model_content modelContent,
a.model_text modelText, a.model_text modelText,
a.model_type modelType, a.model_type modelType,
CONVERT(a.create_time, char) createTime CONVERT(a.create_time, char) createTime,
(SELECT COUNT(*) FROM code_model_history b WHERE b.model_id = a.id) useNum
FROM FROM
code_model a code_model a
WHERE a.group_id = #{groupId} WHERE a.group_id = #{groupId}
......
...@@ -30,6 +30,7 @@ layui.config({ ...@@ -30,6 +30,7 @@ layui.config({
{ field: 'id', title: '模板内容', width: 120, templet: function(d){ { field: 'id', title: '模板内容', width: 120, templet: function(d){
return '<i class="fa fa-fw fa-html5 cursor" lay-event="modelContent"></i>'; return '<i class="fa fa-fw fa-html5 cursor" lay-event="modelContent"></i>';
}}, }},
{ field: 'useNum', title: '调用次数', width: 120 },
{ field: 'createTime', title: '创建时间', width: 180 }, { field: 'createTime', title: '创建时间', width: 180 },
{ title: '操作', fixed: 'right', align: 'center', width: 240, toolbar: '#tableBar'} { title: '操作', fixed: 'right', align: 'center', width: 240, toolbar: '#tableBar'}
]] ]]
......
...@@ -29,6 +29,7 @@ layui.config({ ...@@ -29,6 +29,7 @@ layui.config({
return '<i class="fa fa-fw fa-html5 cursor" lay-event="groupDesc"></i>'; return '<i class="fa fa-fw fa-html5 cursor" lay-event="groupDesc"></i>';
}}, }},
{ field: 'modelNum', title: '模板数量', width: 120 }, { field: 'modelNum', title: '模板数量', width: 120 },
{ field: 'useNum', title: '调用次数', width: 120 },
{ field: 'createTime', title: '创建时间', width: 180 }, { field: 'createTime', title: '创建时间', width: 180 },
{ title: '操作', fixed: 'right', align: 'center', width: 240, toolbar: '#tableBar'} { title: '操作', fixed: 'right', align: 'center', width: 240, toolbar: '#tableBar'}
]] ]]
......
...@@ -34,18 +34,22 @@ layui.config({ ...@@ -34,18 +34,22 @@ layui.config({
//表单验证 //表单验证
if (winui.verifyForm(data.elem)) { if (winui.verifyForm(data.elem)) {
var subData = list; var subData = list;
for(var i = 0; i < subData.length; i++){ if(subData.length == 0){
subData[i].modelContent = ""; top.winui.window.msg('请先生成转换结果', {icon: 2,time: 2000});
}else{
for(var i = 0; i < subData.length; i++){
subData[i].modelContent = "";
}
AjaxPostUtil.request({url:reqBasePath + "codemodel014", params:{jsonData: JSON.stringify(subData)}, type:'json', callback:function(json){
if(json.returnCode == 0){
top.winui.window.msg('保存成功,请前往生成历史下载。', {icon: 1,time: 2000});
parent.layer.close(index);
parent.refreshCode = '0';
}else{
top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000});
}
}});
} }
AjaxPostUtil.request({url:reqBasePath + "codemodel014", params:{jsonData: JSON.stringify(subData)}, type:'json', callback:function(json){
if(json.returnCode == 0){
top.winui.window.msg('保存成功,请前往生成历史下载。', {icon: 1,time: 2000});
parent.layer.close(index);
parent.refreshCode = '0';
}else{
top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000});
}
}});
} }
return false; return false;
}); });
......
...@@ -24,7 +24,9 @@ ...@@ -24,7 +24,9 @@
<table id="messageTable" lay-filter="messageTable"></table> <table id="messageTable" lay-filter="messageTable"></table>
<script type="text/html" id="tableBar"> <script type="text/html" id="tableBar">
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a> <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
{{# if(d.useNum == 0){ }}
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a> <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
{{# } }}
</script> </script>
</div> </div>
<script src="../../assets/lib/layui/layui.js"></script> <script src="../../assets/lib/layui/layui.js"></script>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册