96 lines
2.4 KiB
JavaScript
96 lines
2.4 KiB
JavaScript
const URL = "/one-api/mockup/masterdata/";
|
|
|
|
export async function list(token) {
|
|
try {
|
|
var resp = await axios.post(URL + 'schedulev2/list_test', { token: token});
|
|
if (resp.status != 200) {
|
|
return {
|
|
status: "ERR",
|
|
message: resp.statusText
|
|
};
|
|
}
|
|
let data = resp.data;
|
|
return data;
|
|
} catch (e) {
|
|
return {
|
|
status: "ERR",
|
|
message: e.message
|
|
};
|
|
}
|
|
}
|
|
|
|
export async function selected(token,id) {
|
|
try {
|
|
var resp = await axios.post(URL + 'schedulev2/selected_test', { token: token, id: id});
|
|
if (resp.status != 200) {
|
|
return {
|
|
status: "ERR",
|
|
message: resp.statusText
|
|
};
|
|
}
|
|
let data = resp.data;
|
|
return data;
|
|
} catch (e) {
|
|
return {
|
|
status: "ERR",
|
|
message: e.message
|
|
};
|
|
}
|
|
}
|
|
|
|
|
|
export async function xdelete(token,id,name,scheduleid) {
|
|
try {
|
|
var resp = await axios.post(URL + 'schedulev2/delete_test', { token: token, id: id,name: name, scheduleid: scheduleid});
|
|
if (resp.status != 200) {
|
|
return {
|
|
status: "ERR",
|
|
message: resp.statusText
|
|
};
|
|
}
|
|
let data = resp.data;
|
|
return data;
|
|
} catch (e) {
|
|
return {
|
|
status: "ERR",
|
|
message: e.message
|
|
};
|
|
}
|
|
}
|
|
export async function save(prm) {
|
|
try {
|
|
var resp = await axios.post(URL + 'schedulev2/addnewschedulenewtest', prm);
|
|
if (resp.status != 200) {
|
|
return {
|
|
status: "ERR",
|
|
message: resp.statusText
|
|
};
|
|
}
|
|
let data = resp.data;
|
|
return data;
|
|
} catch (e) {
|
|
return {
|
|
status: "ERR",
|
|
message: e.message
|
|
};
|
|
}
|
|
}
|
|
export async function searchtest(token,prm) {
|
|
try {
|
|
var resp = await axios.post(URL + 'schedulev2/searchtest',{token:token,search:prm.search,schedulegroup_id:prm.schedulegroup_id});
|
|
if (resp.status != 200) {
|
|
return {
|
|
status: "ERR",
|
|
message: resp.statusText
|
|
};
|
|
}
|
|
let data = resp.data;
|
|
return data;
|
|
} catch(e) {
|
|
return {
|
|
status: "ERR",
|
|
message: e.message
|
|
};
|
|
}
|
|
}
|