const URL = "/one-api/mockup/masterdata/etl-report/etlreport/"; const dUrl = "/one-api/mockup/masterdata/etl-report/lookup/dropdown/"; const aUrl = "/one-api/mockup/masterdata/etl-report/lookup/ac/"; export async function listdropdown(sp) { try { var resp = await axios.post(dUrl + sp); 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 listautocomplete(prm) { try { var sp = prm.sp var search = prm.search var resp = await axios.post(aUrl + sp , {search: prm.search, dep: prm.dep , value: prm.value} ); if (resp.status != 200) { return { status: "ERR", message: resp.statusText }; } let data = resp; return data; } catch(e) { return { status: "ERR", message: e.message }; } } export async function search(prm) { try { var resp = await axios.post(URL + 'search', 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 searchreport(prm) { try { var resp = await axios.post(URL + 'searchreport', 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 getparam(prm) { try { var resp = await axios.post(URL + 'getparam', 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 searchetl(token, prm) { try { var resp = await axios.post(URL + 'searchetl', { token: token, search: 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 add(prm) { try { var resp = await axios.post(URL + 'add', 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 edit(prm) { try { var resp = await axios.post(URL + 'edit', 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 deleterow(prm) { try { var resp = await axios.post(URL + 'deleterow', 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 newData(prm) { try { var resp = await axios.post(URL + 'newData', 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 editData(prm) { try { var resp = await axios.post(URL + 'editData', 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 }; } }