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

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

// 修改
const updateRoadNoiseBill = function (data) {
    return axios.put("/sound/road/noise/bill",data)
}
// 审核
const verifyRoadNoiseBill = function (data) {
    return axios.put("/sound/road/noise/bill/verify",data);
}
const getRoadNoiseBill = function (id) {
    return axios.get(`/sound/road/noise/bill/${id}`)
}
// -------------------------数据---------------------
const pageRoadNoiseUrl = '/sound/road/noise/page';

const listAll = function(data){
    return axios.get("/sound/road/noise",{params:data})
}
// 添加
const saveRoadNoise = function (data) {
    return axios.post("/sound/road/noise",data)
}

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

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



// -------------------------统计---------------------
const pageRoadNoiseStatisticUrl = '/sound/road/noise/statistic';
const pageRoadNoiseCompare = '/sound/road/noise/statistic/compare';
const roadNoiseYearEnd = '/sound/road/noise/statistic/yearEnd';
const getHistoryyears = function () {
    return axios.get("/sound/road/noise/history-year")
}
const getColumnOptions = function(column){
    return axios.get("/sound/road/noise/options",{params:{column}})
}

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

const getGisArea = function(data){
    return axios.get("/sound/road/noise/gis/area",{params:data})
}

const getTrendChart = function(data){
    return axios.post("/sound/road/noise/trend/chart",data)
}
const getPlaceByRegionLevel = function(column){
    return axios.get("/sound/road/noise/place/region",{params:{column}})
}
export {
    pageBillUrl,
    saveRoadNoiseBill,
    removeRoadNoiseBill,
    updateRoadNoiseBill,
    removeBatchRoadNoiseBill,
    verifyRoadNoiseBill,
    getRoadNoiseBill,
    pageRoadNoiseUrl,
    saveRoadNoise,
    removeRoadNoise,
    updateRoadNoise,
    removeBatchRoadNoise,
    pageRoadNoiseStatisticUrl,
    getHistoryyears,
    pageRoadNoiseCompare,
    getColumnOptions,
    listAll,
    getGisBase,
    getGisArea,
    roadNoiseYearEnd,
    getTrendChart,
    getPlaceByRegionLevel
}
