import request from "@/request/index";
import { useNow, useDateFormat } from '@vueuse/core'

const today = useDateFormat(useNow(), 'YYYY-MM-DD').value
const yesday = useDateFormat((new Date).getTime() - 24 * 60 * 60 * 1000, 'YYYY-MM-DD').value


export function GetYlzy() {
  return request({
    url: '/DigitalTwain/PassengerTraffic/GetVisitRes',
    method: "post",
  })
}

export function GetMtkll() {
  return request({
    url: '/DigitalTwain/PassengerTraffic/GetPierFlux',
    method: "post",
  })
}

// UE游览资源列表
// export function GetLdzy() {
//   return request({
//     url: '/DigitalTwain/PassengerTraffic/getdjld',
//     method: "post",
//   })
// }
//新做游览资源列表
export function GetLdzy() {
  return request({
    url: '/DigitalTwain/PassengerTraffic/getdjld',
    method: "post",
  })
}

export function GetLdkll() {
  return request({
    url: '/DigitalTwain/PassengerTraffic/getFerryFlux',
    method: "post",
    data: {
      dataTime: today
    },
  })
}

export function GetThxx(index,size) {
  return request({
    url: '/DigitalTwain/PassengerTraffic/getDelayLine',
    method: "post",
    data: {
      index, //分页页码
      size //分页大小
    }
  })
}

export function GetHbxx() {
  return request({
    url: '/DigitalTwain/PassengerTraffic/waterFlight',
    method: "post",
  })
}

export function GetLshb(mmsi) {
  return request({
    url: '/DigitalTwain/PassengerTraffic/getShipHistory',
    method: "post",
    data: { mmsi },
  })
}

export function GetLshbBoatPath(data) {
  return request({
    url: '/DigitalTwain/PassengerTraffic/getHistoryPoints',
    method: "post",
    data: data,
  })
}

export function GetPjylLinePaths() {
  return request({
    url: '/DigitalTwin/GetPjylLinePaths',
    method: "post"
  })
}

export function GetShipRout(data) {
  return request({
    url: '/dataShare/GetShipRout',
    method: "post",
    data:data
  })
}

export function GetWaterFlightPoints(data) {
  return request({
    url: '/DigitalTwain/PassengerTraffic/getWaterFlightPoints',
    method: "post",
    data:data
  })
}