// 市场准入限制
import router from "@/router/index";

// 跳转232调查概览页
export const goToCase232 = () => {
  window.sessionStorage.setItem("curTabName", '232调查');
  const param = {
    id: 232,
  }
  const jsonStr = JSON.stringify(param);
  const base64 = btoa(encodeURIComponent(jsonStr));

  const route = router.resolve({
    path: "/marketAccessLayout/case",
    query: {
      data: base64
    }
  });
  window.open(route.href, "_blank");
}

// 跳转232调查详情页
export const goToCaseDetail232 = (searchId, tabName) => {
  window.sessionStorage.setItem("curTabName", tabName);
  const param = {
    id: 232,
    searchId: searchId
  }
  const jsonStr = JSON.stringify(param);
  const base64 = btoa(encodeURIComponent(jsonStr));

  const route = router.resolve({
    path: "/marketSingleCaseLayout/overview",
    query: {
      data: base64
    }
  });
  window.open(route.href, "_blank");
}

// 跳转301调查概览页
export const goToCase301 = () => {
  window.sessionStorage.setItem("curTabName", '301调查');
  const param = {
    id: 301,

  }
  const jsonStr = JSON.stringify(param);
  const base64 = btoa(encodeURIComponent(jsonStr));
  const route = router.resolve({
    path: "/marketAccessLayout/case",
    query: {
      data: base64
    }
  });
  window.open(route.href, "_blank");
}

// 跳转301调查详情页
export const goToCaseDetail301 = (searchId, tabName) => {
  window.sessionStorage.setItem("curTabName", tabName);
  const param = {
    id: 301,
    searchId: searchId
  }
  const jsonStr = JSON.stringify(param);
  const base64 = btoa(encodeURIComponent(jsonStr));
  const route = router.resolve({
    path: "/marketSingleCaseLayout/overview",
    query: {
      data: base64
    }
  });
  window.open(route.href, "_blank");
}

// 跳转337调查概览页
export const goToCase337 = () => {
  window.sessionStorage.setItem("curTabName", '337调查');
  const param = {
    id: 337,
  }
  const jsonStr = JSON.stringify(param);
  const base64 = btoa(encodeURIComponent(jsonStr));
  const route = router.resolve({
    path: "/marketAccessLayout/case",
    query: {
      data: base64
    }
  });
  window.open(route.href, "_blank");
}

// 跳转337调查详情页
export const goToCaseDetail337 = (searchId, tabName) => {
  window.sessionStorage.setItem("curTabName", tabName);
  const param = {
    id: 337,
    searchId: searchId
  }
  const jsonStr = JSON.stringify(param);
  const base64 = btoa(encodeURIComponent(jsonStr));
  const route = router.resolve({
    path: "/marketSingleCaseLayout/overview",
    query: {
      data: base64
    }
  });
  window.open(route.href, "_blank");
}