124 lines
3.2 KiB
JavaScript
124 lines
3.2 KiB
JavaScript
const URL = "/one-api/v1/masterdata/";
|
|
|
|
export async function search(token,search, id) {
|
|
try {
|
|
var resp = await axios.post(URL + 'autoverificationv2/searchtest', { token:token,search: search, 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 save(token, testid, differenceid, validinterval, timeid, minvalue, maxvalue) {
|
|
try {
|
|
var resp = await axios.post(URL + 'autoverificationv2/savedeltacheck', {
|
|
testid: testid,
|
|
differenceid: differenceid,
|
|
validinterval: validinterval,
|
|
timeid: timeid,
|
|
minvalue: minvalue,
|
|
maxvalue: maxvalue,
|
|
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 lookup(token,id) {
|
|
try {
|
|
var resp = await axios.post(URL + 'autoverificationv2/lookupdeltacheck', { id: id , 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 xdelete(token, id) {
|
|
try {
|
|
var resp = await axios.post(URL + 'autoverificationv2/deleteautoverificationtest', { id: id, 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 selecttime(token) {
|
|
try {
|
|
var resp = await axios.post(URL + 'autoverificationv2/selecttime',{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 selectdif(token) {
|
|
try {
|
|
var resp = await axios.post(URL + 'autoverificationv2/selectdif',{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
|
|
};
|
|
}
|
|
} |