import { get, post } from "@/utils/request";

// 联动下拉
export function getProModular() {
  return get({
    url: "/api/v1/field/get-project-modular-drop",
  });
}

// 视图列表
export function getViewList({ modularId, page = 1, perPage = 20 }) {
  return get({
    url: "/api/v1/preview/list",
    params: {
      modular_id: modularId,
      page,
      perPage: perPage,
    },
  });
}

// 查看视图
export function getViewInfo({
  previewId,
  page = 1,
  perPage = 20,
  filter = [],
}) {
  return post({
    url: "/api/v1/preview/info",
    data: {
      preview_id: previewId,
      page,
      per_page: perPage,
      filter,
    },
  });
}

// 删除视图
export function deleteView({ previewId }) {
  return post({
    url: "/api/v1/preview/del",
    data: {
      preview_id: previewId,
    },
  });
}
