若依开源1.1.1发布
This commit is contained in:
58
src/main/resources/static/ruoyi/tool/gen/gen.js
Normal file
58
src/main/resources/static/ruoyi/tool/gen/gen.js
Normal file
@ -0,0 +1,58 @@
|
||||
var prefix = "/tool/gen"
|
||||
|
||||
$(function() {
|
||||
var columns = [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'tableName',
|
||||
title: '表名称'
|
||||
},
|
||||
{
|
||||
field: 'tableComment',
|
||||
title: '表描述'
|
||||
},
|
||||
{
|
||||
field: 'createTime',
|
||||
title: '创建时间'
|
||||
},
|
||||
{
|
||||
field: 'updateTime',
|
||||
title: '更新时间'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var msg = '<a class="btn btn-primary btn-sm" href="#" title="生成" onclick="genCode(\'' + row.tableName + '\')"><i class="fa fa-bug"></i></a> ';
|
||||
return msg;
|
||||
}
|
||||
}];
|
||||
var url = prefix + "/list";
|
||||
$.initTable(columns, url);
|
||||
});
|
||||
|
||||
// 生成代码
|
||||
function genCode(tableName) {
|
||||
$.modalConfirm("确定要生成" + tableName + "表代码吗?", function(r) {
|
||||
if (!r) {
|
||||
return;
|
||||
}
|
||||
location.href = prefix + "/genCode/" + tableName;
|
||||
})
|
||||
}
|
||||
|
||||
//批量生成代码
|
||||
function batchGenCode() {
|
||||
var rows = $.getSelections("tableName");
|
||||
if (rows.length == 0) {
|
||||
$.modalMsg("请选择要生成的数据", "warning");
|
||||
return;
|
||||
}
|
||||
$.modalConfirm("确认要生成选中的" + rows.length + "条数据吗?", function(r) {
|
||||
if (!r) {
|
||||
return;
|
||||
}
|
||||
location.href = prefix + "/batchGenCode?tables=" + JSON.stringify(rows);
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user