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.

54 lines
1.4 KiB

4 months ago
import request from '@/utils/request'
function customParamsSerializer(params) {
4 months ago
let result = ''
for (const key in params) {
if (params.hasOwnProperty(key)) {
if (Array.isArray(params[key])) {
params[key].forEach((item, index) => {
if (item instanceof Array) {
item.forEach((item1, index1) => {
result += `${key}[${index}][${index1}]=${item1}&`
})
} else if (typeof item === 'object') {
4 months ago
for (const 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}&`;
4 months ago
})
} else {
4 months ago
result += `${key}=${params[key]}&`
}
}
}
4 months ago
return result.slice(0, -1)
}
export function endIndex(params, noloading = false) {
return request({
method: 'get',
url: '/api/ht/contract/end-index',
params,
noloading,
paramsSerializer: customParamsSerializer
})
}
export function partIndex(params, noloading = false) {
return request({
method: 'get',
url: '/api/ht/contract/part-index',
params,
noloading,
paramsSerializer: customParamsSerializer
})
}
export function statisticDepartment(params) {
return request({
method: 'get',
url: '/api/ht/notice/statistic-department-v2',
params
})
}