import request from "@/utils/request";
import axios from "axios";
const api = "/mosty-api";
const egisSpace = "/egis-space";

// 选择站口名称
export function egisSpaceGet(fun,coords){
  let params = {
    pageNum: 1,
    pageSize: 1000,
    keyword: "",
    geometry: `{"type":"Polygon","coordinates":${JSON.stringify(coords)}}`,
  };
  params.geometry =  encodeURIComponent(params.geometry)

  let url = egisSpace + '/space/search/custom/ms-dy-intersections'
  axios.get(url,{params}).then((res) => {
    fun(res.data)
  });
}


//get 请求
export const qcckFlvGet = (params = {}, url) => {
  return request({
    url: url,
    method: "get",
    params
  });
};



//get 请求
export const qcckGet = (params = {}, url) => {
  return request({
    url: api + url,
    method: "get",
    params
  });
};
//post 请求
export const qcckPost = (data = {}, url) => {
  return request({
    url: api + url,
    method: "post",
    data
  });
};
//put 请求
export const qcckPut = (data = {}, url) => {
  return request({
    url: api + url,
    method: "put",
    data
  });
};
//put 请求
export const qcckDelete = (data = {}, url) => {
  return request({
    url: api + url,
    method: "delete",
    data
  });
};

