You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
105 lines
2.2 KiB
105 lines
2.2 KiB
import request from '@/utils/request';
|
|
|
|
function customParamsSerializer(params) {
|
|
let result = '';
|
|
for (let key in params) {
|
|
if (params.hasOwnProperty(key)) {
|
|
if (Array.isArray(params[key]) && params[key].length > 0) {
|
|
params[key].forEach((item,index) => {
|
|
if (item instanceof Array) {
|
|
item.forEach((item1, index1) => {
|
|
result += `${key}[${index}][${index1}]=${item1}&`
|
|
})
|
|
} else if (typeof item === 'object') {
|
|
for (let key1 in item) {
|
|
result += `${key}[${index}][${key1}]=${item[key1]}&`
|
|
}
|
|
}
|
|
// result += `${key}[${index}][key]=${item.key}&${key}[${index}][op]=${item.op}&${key}[${index}][value]=${item.value}&`;
|
|
});
|
|
} else {
|
|
result += `${key}=${params[key]}&`;
|
|
}
|
|
}
|
|
}
|
|
return result.slice(0, -1);
|
|
}
|
|
export function index(params,noloading=false) {
|
|
return request({
|
|
method: "get",
|
|
url: "/api/ht/away/index",
|
|
params,
|
|
noloading,
|
|
paramsSerializer: customParamsSerializer
|
|
})
|
|
}
|
|
|
|
export function show (params,noloading=false) {
|
|
return request({
|
|
method: "get",
|
|
url: "/api/ht/away/show",
|
|
params,
|
|
noloading
|
|
})
|
|
}
|
|
|
|
export function save (data,noloading=false) {
|
|
return request({
|
|
method: "post",
|
|
url: "/api/ht/away/save",
|
|
data,
|
|
noloading
|
|
})
|
|
}
|
|
|
|
export function destroy(params,noloading=false) {
|
|
return request({
|
|
method: "get",
|
|
url: "/api/ht/away/destroy",
|
|
params,
|
|
noloading
|
|
})
|
|
}
|
|
|
|
export function getAwayDetails(params,noloading=false) {
|
|
return request({
|
|
method: "get",
|
|
url: "/api/oa/flow/get-away-details",
|
|
params,
|
|
noloading
|
|
})
|
|
}
|
|
|
|
export function updateAwayDetails (data,noloading=false) {
|
|
return request({
|
|
method: "post",
|
|
url: "/api/oa/flow/update-away-details",
|
|
data,
|
|
noloading
|
|
})
|
|
}
|
|
|
|
export function planSave (data,noloading=false) {
|
|
return request({
|
|
method: "post",
|
|
url: "/api/ht/away-plan/save",
|
|
data,
|
|
noloading
|
|
})
|
|
}
|
|
|
|
export function awayIndex(params,noloading=false) {
|
|
return request({
|
|
method: "get",
|
|
url: "/api/oa/flow/get-away-list",
|
|
params,
|
|
noloading,
|
|
paramsSerializer: customParamsSerializer
|
|
})
|
|
}
|
|
|
|
|
|
|
|
|
|
|