import request from '@/config/axios'

// 矢量图层表单 VO
export interface FormVectorVO {
  id: number // 编号
  layername: number // 图层名
  parentId: number // 父级编号
  seq: number // 排序
  rgb: number // 图层颜色
  geom: object // 几何形状数据
  description: string // 数据描述或摘要
}

// 矢量图层表单 API
export const FormVectorApi = {
  // 查询矢量图层表单分页
  getFormVectorPage: async (params: any) => {
    return await request.get({ url: `/layer/form-vector/page`, params })
  },

  // 查询矢量图层表单详情
  getFormVector: async (id: number) => {
    return await request.get({ url: `/layer/form-vector/get?id=` + id })
  },

  // 新增矢量图层表单
  createFormVector: async (data: FormVectorVO) => {
    return await request.post({ url: `/layer/form-vector/create`, data })
  },

  // 修改矢量图层表单
  updateFormVector: async (data: FormVectorVO) => {
    return await request.put({ url: `/layer/form-vector/update`, data })
  },

  // 删除矢量图层表单
  deleteFormVector: async (id: number) => {
    return await request.delete({ url: `/layer/form-vector/delete?id=` + id })
  },

  // 导出矢量图层表单 Excel
  exportFormVector: async (params) => {
    return await request.download({ url: `/layer/form-vector/export-excel`, params })
  },
}
