1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
| /*访问后台的代码*/
| layui.define([], function(exports) {
| var api={
| update${upperFirst(entity.code)}:function(form,callback){
| Lib.submitForm("/${target.urlBase}/${entity.code}/edit.json",form,{},callback)
| },
| add${upperFirst(entity.code)}:function(form,callback){
| Lib.submitForm("/${target.urlBase}/${entity.code}/add.json",form,{},callback)
| },
| del:function(ids,callback){
| Common.post("/${target.urlBase}/${entity.code}/delete.json",{"ids":ids},function(){
| callback();
| })
| }
| @if(entity.includeExcel){
| ,
| exportExcel:function(form,callback){
| var formPara = form.serializeJson();
| Common.post("/${target.urlBase}/${entity.code}/excel/export.json", formPara, function(fileId) {
| callback(fileId);
| })
| }
| @}
|
| };
| exports('${entity.code}Api',api);
| });
|
|