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",
  })
}

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() {
  return request({
    url: '/DigitalTwain/PassengerTraffic/getDelayLine',
    method: "post",
  })
}

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 },
  })
}
