import axios from 'axios';
// ----------------------列表-----------------------
const pageBillUrl = '/sound/function/noise/bill/page';
// 添加
const saveFunctionNoiseBill = function (data) {
    return axios.post("/sound/function/noise/bill",data)
}

// 删除
const removeFunctionNoiseBill = function (id) {
    return axios.delete(`/sound/function/noise/bill/${id}`,)
}
// 批量删除
const removeBatchFunctionNoiseBill = function (ids) {
    return axios.delete("/sound/function/noise/bill/batch",{data:ids})
}

// 修改
const updateFunctionNoiseBill = function (data) {
    return axios.put("/sound/function/noise/bill",data)
}
// 审核
const verifyFunctionNoiseBill = function (data) {
    return axios.put("/sound/function/noise/bill/verify",data);
}
const getFunctionNoiseBill = function (id) {
    return axios.get(`/sound/function/noise/bill/${id}`)
}
// -------------------------数据---------------------
const pageFunctionNoiseUrl = '/sound/function/noise/page';
const listAllFunctionNoiseUrl = '/sound/function/noise';
const listAllFunctionNoise = function (params){
    return axios.get(listAllFunctionNoiseUrl, {params})
}
// 添加
const saveFunctionNoise = function (data) {
    return axios.post("/sound/function/noise",data)
}

// 删除
const removeFunctionNoise = function (id) {
    return axios.delete(`/sound/function/noise/${id}`,)
}
// 批量删除
const removeBatchFunctionNoise = function (ids) {
    return axios.delete("/sound/function/noise/batch",{data:ids})
}

// 修改
const updateFunctionNoise = function (data) {
        return axios.put("/sound/function/noise",data)
}

// -------------------------统计---------------------
const pageFunctionNoiseStatisticUrl = '/sound/function/noise/statistic';
const pageFunctionNoiseStatisticAvgUrl = '/sound/function/noise/statistic/avg';
const getHistoryyears = function () {
    return axios.get("/sound/function/noise/history-year")
}
const getColumnOptions = function(column){
    return axios.get("/sound/function/noise/options",{params:{column}})
}

// ---gis--
const getPlaceGis = function(data){
    return axios.get("/sound/function/noise/gis/place",{params:data})
}

const getPlaceByRegionLevel = function(column){
    return axios.get("/sound/function/noise/place/region",{params:{column}})
}

const getTrendChart = function(data){
    return axios.post("/sound/function/noise/trend/chart",data)
}

export {
    pageBillUrl,
    saveFunctionNoiseBill,
    removeFunctionNoiseBill,
    updateFunctionNoiseBill,
    removeBatchFunctionNoiseBill,
    verifyFunctionNoiseBill,
    getFunctionNoiseBill,
    pageFunctionNoiseUrl,
    saveFunctionNoise,
    removeFunctionNoise,
    updateFunctionNoise,
    removeBatchFunctionNoise,
    pageFunctionNoiseStatisticUrl,
    getHistoryyears,
    getColumnOptions,
    getPlaceGis,
    listAllFunctionNoiseUrl,
    listAllFunctionNoise,
    pageFunctionNoiseStatisticAvgUrl,
    getPlaceByRegionLevel,
    getTrendChart

}
