Commit 7399d889 authored by xiandafu's avatar xiandafu
Browse files

刷新bug修复

parent adc12f7b
...@@ -37,6 +37,10 @@ public class CoreCodeGenService { ...@@ -37,6 +37,10 @@ public class CoreCodeGenService {
Log log = LogFactory.getLog(CoreCodeGenService.class); Log log = LogFactory.getLog(CoreCodeGenService.class);
public void refresh() {
sqlManager.refresh();
}
public List<Entity> getAllEntityInfo(){ public List<Entity> getAllEntityInfo(){
MetadataManager meta = sqlManager.getMetaDataManager(); MetadataManager meta = sqlManager.getMetaDataManager();
Set<String> set = meta.allTable(); Set<String> set = meta.allTable();
......
...@@ -53,6 +53,14 @@ public class CoreCodeGenController { ...@@ -53,6 +53,14 @@ public class CoreCodeGenController {
return view; return view;
} }
@PostMapping(MODEL + "/refresh.json")
@ResponseBody
public JsonResult<Boolean> refresh() {
codeGenService.refresh();
return JsonResult.success();
}
@GetMapping(MODEL + "/tableDetail.do") @GetMapping(MODEL + "/tableDetail.do")
public ModelAndView tableDetail(String table) { public ModelAndView tableDetail(String table) {
......
/*访问后台的代码*/ /*访问后台的代码*/
layui.define([], function(exports) { layui.define([], function(exports) {
var api={ var api={
refresh:function(callback){
Common.post("/core/codeGen/refresh.json", {}, function(path){
callback();
});
},
gen:function(callback){ gen:function(callback){
Common.post("/core/codeGen/getPath.json", {}, function(path){ Common.post("/core/codeGen/getPath.json", {}, function(path){
Common.openPrompt("代码保存路径?",path,function(newPath){ Common.openPrompt("代码保存路径?",path,function(newPath){
......
layui.define([ 'form', 'laydate', 'table' ], function(exports) { layui.define([ 'form', 'laydate', 'table','codeApi' ], function(exports) {
var form = layui.form; var form = layui.form;
var laydate = layui.laydate; var laydate = layui.laydate;
var table = layui.table; var table = layui.table;
var codeApi = layui.codeApi;
var codeTable = null; var codeTable = null;
var view ={ var view ={
...@@ -10,7 +11,7 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) { ...@@ -10,7 +11,7 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
this.initToolBar(); this.initToolBar();
}, },
initTable:function(){ initTable:function(){
blogTable = table.render({ codeTable = table.render({
elem : '#codeTable', elem : '#codeTable',
height : Lib.getTableHeight(1), height : Lib.getTableHeight(1),
method : 'post', method : 'post',
...@@ -52,7 +53,10 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) { ...@@ -52,7 +53,10 @@ layui.define([ 'form', 'laydate', 'table' ], function(exports) {
}, },
refresh:function(){ refresh:function(){
codeTable.reload(); codeApi.refresh(function(){
codeTable.reload();
})
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment