import request from "@/api/Request";
import QS from 'qs'
// 获取图层列表
export const list = (params) => {
    return request({
        url: '/store/list',
        method: 'get',
        params:params
    })
}
// 创建树分类
export const createApplication = (data) => {
    return request({
        url: '/applicationMars/createMars',
        method: 'post',
        data: data
    })
}
// 获取树结构
export const getApplicationInfo = () => {
    return request({
        url: '/applicationMars/getApplicationInfo',
        method: 'get',
    })
}
//删除图层或项目组
export const applicationdelete = (id) => {
    return request({
        url: '/applicationMars/deleteIds/' + id,
        method: 'delete',
    })
}
//获取所有分类
export const getProjectName = (id) => {
    return request({
        url: '/applicationMars/getProjectName',
        method: 'get',
    })
}
//获取图层样式
export const getStyle = (id) => {
    return request({
        url: '/applicationMars/getStyle',
        method: 'get',
        params: {
            id
        }
    })
}
//修改样样式/修改分类
export const update = (data) => {
    return request({
        url: '/applicationMars/update',
        method: 'put',
        data: QS.stringify(data)
    })
}
//添加图层
export const addMarsServer = (data) => {
    return request({
        url: '/applicationMars/addMarsServer',
        method: 'post',
        data
    })
}
// 获取图标
export const getAllStyleImage = () => {
    return request({
        url: '/style/getAllStyleImage',
        method: 'get',
    })
}
//删除图标
export const deleteIds = (id) => {
    return request({
        url: '/style/deleteIds/' + id,
        method: 'delete',
    })
}
// 获取弹窗字典
export const listData = (params) => {
    return request({
        url: '/store/listData',
        method: 'get',
        params:params
    })
}
// 获取 图层列表名称
export const getTableName = (params) => {
    return request({
        url: '/applicationMars/getTableName',
        method: 'get',
        params:params
    })
}
// 获取地图中心点
export const getGeomData = (tableValue) => {
    return request({
        url: '/geoserver/getGeomData/'+ tableValue,
        method: 'get'
    })
}

