<template>
  <a-tabs
    @change="changeTab"
    v-model:activeKey="activeKey"
  >
    <a-tab-pane
      key="1"
      tab="基本信息"
    >
      <BasicInformation
        v-if="show"
        :orderParams="orderParams"
      ></BasicInformation>
    </a-tab-pane>
    <a-tab-pane
      key="2"
      tab="骑行轨迹"
    >
      <CyclingTrajectory
        v-if="show"
        :orderParams="orderParams"
      ></CyclingTrajectory>
    </a-tab-pane>
    <a-tab-pane
      key="3"
      tab="故障上报记录"
    >
      <ReportRecord
        v-if="show"
        :orderParams="orderParams"
      ></ReportRecord>
    </a-tab-pane>
  </a-tabs>
</template>

<script setup>
import { ref, defineProps } from 'vue'
import BasicInformation from './BasicInformation.vue';
import CyclingTrajectory from './CyclingTrajectory.vue';
import ReportRecord from './ReportRecord.vue';

const props = defineProps({
  onCallBack: {
    type: Function,
    required: true
  },
});
const show = ref(false)
const orderParams = ref({})

const openForm = (params = {}) => {
  if (params['ebikeCode']) {
    orderParams.value['ebikeCode'] = params['ebikeCode'];
    orderParams.value['startTime'] = params['startTime'];
    orderParams.value['endTime'] = params['endTime'];
    orderParams.value['ridePoint'] = params['ridePoint'];
    orderParams.value['returnPoint'] = params['returnPoint'];
    orderParams.value['orderNumber'] = params['orderNumber'];
  }
  show.value = true;
};

const changeTab = (key) => {
}


defineExpose({ openForm });
</script>