syncTableList.js 1.4 KB

1
  1. var id=null,root="";function doSubmit(e){for(var t={},a=$("#update").bootstrapTable("getData"),n={},o=$("#delete").bootstrapTable("getData"),i=0;i<o.length;i++)n.deletes=0===i?o[i].id:o[i].id+","+n.deletes;var r=$("#insert").bootstrapTable("getData");t.ids=n,t.insertData=r,t.updateData=a,$.ajax({url:root+"/codegen/genSyncData/save?id="+id,contentType:"application/json",success:function(t){e(t)},error:function(t){}})}jQuery(function(){id=GetQueryString("id");var t=window.__CODEGEN_CONFIG__,e=t.gatewayRoute+t.direwolfAdmin;root=commonConfig.proxyPath+e,checkPagePermission(e+"/codegen/checkSyncTablePermission");var o,a=root+"/codegen/genTableDict",n=root+"/codegen/genSyncData?id="+id,i={};$.ajax({url:a,contentType:"application/json",async:!1,success:function(t){i=t},error:function(t){},type:"get"}),o=[{field:"id",title:"列名",visible:!1},{field:"name",title:"列名"},{field:"jdbcType",title:"物理类型"},{field:"isPk",title:"是否为主键",formatter:function(t,e,a){return i.y_n[t]}},{field:"isNull",title:"是否可空",formatter:function(t,e,a){return i.y_n[t]}}],$.ajax({url:n,contentType:"application/json",success:function(t){var e={data:t.updates};e.columns=o,e.pagination=!1;var a={data:t.deletes};a.columns=o,a.pagination=!1;var n={data:t.inserts};n.columns=o,n.pagination=!1,$("#update").bootstrapTable(e),$("#delete").bootstrapTable(a),$("#insert").bootstrapTable(n)},error:function(t){},type:"get"})});