오류 수정

main
이범준 9 months ago
parent 0bd6077d24
commit 2676268ee6

@ -546,51 +546,18 @@ const Apply = {
},
fromDatasetControl : {
load : async function(control, pageNum){
control.query.pageNum = pageNum;
if (!control.query.pageNum){
control.query.pageNum = 1;
}
ajax.get({
url:control.urls.load,
data:control.query,
success:(resp) => {
resolve(resp);
}
});
},
save : async function(control, info){
if (!info) {
return;
}
var item = control.getCurrent("item");
var create = "added" == item.state;
ajax.post({
url:!create ? control.urls.update : control.urls.create,
data:info,
success:(resp) => {
resolve(resp);
}
});
},
remove : async function(control, params){
var selected = control.dataset.getKeys("selected");
if(selected.length < 1) {
return;
}
if(!params) {
params = {};
params[control.prefixed("IDs")] = selected.join(",");
}
ajax.post({
url:control.urls.remove,
data:params,
success:(resp) => {
resolve(resp);
return new Promise((resolve, reject) => {
control.query.pageNum = pageNum;
if (!control.query.pageNum){
control.query.pageNum = 1;
}
ajax.get({
url:control.urls.load,
data:control.query,
success:(resp) => {
resolve(resp);
}
});
});
}
}

Loading…
Cancel
Save