import { reactive, onBeforeMount } from 'vue'
import { awaitGet } from '@/utils/tunnel'

const model = {
  mode: 'online', // 车流模式
  direction: 0, // 行车向
  flows: [], // 回溯车流，有值表示已生成
}

const params = reactive({
  ...model
})

const traffic = ref<any>(null) // 车流引擎实例

const pmsClean = () => {
  Object.assign(params, { ...model })
}

// sets
const setMode = (e) => {
  params.mode = e
}

const setDirection = (e) => {
  params.direction = e
}

// gets

const getMode = () => {
  return params.mode
}

const getDirection = () => {
  return params.direction
}

export {
  pmsClean,

  setMode,
  setFlows,
  setDirection,
  
  getMode,
  getDirection,
  getFlows
}
