/*
 * @Author: Z 1518051043@qq.com
 * @Date: 2025-12-08 17:37:05
 * @LastEditors: zwy 1518051043@qq.com
 * @LastEditTime: 2026-01-04 09:56:36
 * @FilePath: \yuanxinPro\src\api\Zodiac.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%A
 */

import request from "@/utils/request";
// 左侧菜单-星座构型信息
export function stellationInfoApi() {
  return request({
    url: "/constellationInfo/list",
    method: "get",
  });
}
// 左侧菜单-卫星列表信息
export function stellateListInfoApi() {
  return request({
    url: "/SatelliteBasicInfo/list",
    method: "get",
  });
}
// 左侧菜单-地面系统信息
export function siteDataInfoListApi() {
  return request({
    url: "/SiteData/list",
    method: "get",
  });
}

export function siteDataPageErrorInfoApi(data) {
  return request({
    url: "/SiteData/pageError",
    method: "post",
    params: data,
  });
}

export function groundSystemStatisticsInfoApi() {
  return request({
    url: "/GroundSystem/statistics",
    method: "get",
  });
}

export function subSystemStatisticsInfoApi() {
  return request({
    url: "/GroundSystem/statistics",
    method: "get",
    // data: data
  });
}

export function getSubSystemOpitionListApi(data) {
  return request({
    url: "/subSystem/getSubSystem?subSystemType=" + data.subSystemType,
    method: "get",
  });
}

//  //console.log("propsDate-min--3333333333--------",{
//     endTime: historyTimeDateRange.value[1],
//     satelliteId: useAppStoreInstance.globalSatelliteSearchID==='0'? "4097": (useAppStoreInstance.globalSatelliteSearchID),
//     startTime: historyTimeDateRange.value[0],
//     subSystemType: arcHistorySubSystemOptions[arcHistoryActiveIndex.value],
//     code: historyCode.value,
//   });
export function getSubSystemCurveListApi(data) {
  return request({
    url:
      "/subSystem/getSubSystemCurve?satelliteId=" +
      data.satelliteId +
      "&startTime=" +
      data.startTime +
      "&endTime=" +
      data.endTime +
      "&code=" +
      data.code +
      "&subSystemType=" +
      data.subSystemType,
    method: "get",
  });
}

//配置模板中的区域数据
export function getRegionPanel() {
  return request({
    url: "/commPanel/getRegionPanel",
    method: "get",
  });
}

//配置模板中的信关站数据
export function getSignalSitePanel() {
  return request({
    url: "/commPanel/getSignalSitePanel",
    method: "get",
  });
}

//配置模板中的网格数据
export function getGridPanel() {
  return request({
    url: "/commPanel/getGridPanel",
    method: "get",
  });
}

// 容量/流量数据
export function getCapacityAndTraffic(data) {
  return request({
    url: "/commPanel/getCapacityAndTraffic",
    method: "get",
    params: {
      gridCodes: data.gridCodes || null,
      granularity: data.granularity,
      startTime: data.startTime,
      endTime: data.endTime,
      regionName: data.regionName || null,
      signalSiteCode: data.signalSiteCode || null,
    },
  });
}

//规划可用性
export function getAvailability(data) {
  return request({
    url: "/commPanel/getAvailability",
    method: "get",
    params: {
      gridCodes: data.gridCodes || null,
      granularity: data.granularity,
      startTime: data.startTime,
      endTime: data.endTime,
      regionName: data.regionName || null,
      signalSiteCode: data.signalSiteCode || null,
    },
  });
}

//接入时延(搜星)
export function getDelay(data) {
  return request({
    url: "/commPanel/getDelay",
    method: "get",
    params: {
      gridCodes: data.gridCodes || null,
      granularity: data.granularity,
      startTime: data.startTime,
      endTime: data.endTime,
      regionName: data.regionName || null,
      signalSiteCode: data.signalSiteCode || null,
    },
  });
}

//丢包率获取
export function getLossRate(data) {
  return request({
    url: "/commPanel/getLossRate",
    method: "get",
    params: {
      gridCodes: data.gridCodes || null,
      granularity: data.granularity,
      startTime: data.startTime,
      endTime: data.endTime,
      regionName: data.regionName || null,
      signalSiteCode: data.signalSiteCode || null,
    },
  });
}

//格网数据
export function getGridInfoList() {
  return request({
    url: "/GridInfo/list",
    method: "get",
  });
}

//模板配置列表
export function getTemplateList() {
  return request({
    url: "/templateApi/list",
    method: "get",
  });
}

//模板配置新增
export function templateAdd(data) {
  return request({
    url: "/templateApi/add",
    method: "post",
    data,
  });
}
//模板配置删除
export function templateDel(data) {
  return request({
    url: "/templateApi/delete",
    method: "get",
    params: {
      templateId: data.templateId,
    },
  });
}

//模板配置详情
export function templateDetail(data) {
  return request({
    url: "/templateApi/detail",
    method: "get",
    params: {
      templateId: data.templateId,
    },
  });
}

//模板配置修改
export function templateuUpdate(data) {
  return request({
    url: "/templateApi/update",
    method: "POST",
    data,
  });
}
