<template>
  <!-- 中转行李因素分析统计 -->
  <div class="statstics-wrapper">
    <StatisticsHeader
      title="中转行李因素分析统计"
      :items="formItems"
      :data="formData"
      with-setting
      :withSetting="false"
      @export="exportup"
      @getFormData="getFormData"
    />
    <!-- <Tableformcp
      :isloadings="isloadings"
      :rows="12"
      label-width="140px"
      :min-height="70"
      width="800px"
      tableHeight="750"
    /> -->
    <Tableformbrs
      :data-id="dataId"
      upid="6"
      :isloadings="isloadings"
      :data-content="dataContent"
      :rows="12"
      label-width="140px"
      :min-height="70"
      width="800px"
      tableHeight="750"
    />
  </div>
</template>
<script>
import StatisticsHeader from '../../components/statisticsHeader.vue'
// import Tableformcp from "../../components/tableformcp";
import Tableformbrs from '../../components/tableformbrs'
import { Format } from '@/utils/validate'
export default {
  name: 'ReportStatistics',
  data() {
    return {
      formData: {
        airport: '',
        dateTime: '',
      },
      isloadings: 1,
      dataContent: [],
      dataId: '1843',
      formItems: [
        {
          prop: 'airport',
          inputType: 'select',
          placeholder: 'PEK',
          filterable: true,
          clearable: true,
          // multiple: true,
          // disabled: true,
          queryId: SERVICE_ID.nodeAirport,
          setKey: 'a2',
          options: [],
        },
        {
          prop: 'company',
          inputType: 'select',
          placeholder: '航班分类',
          requiredWarning: '请先选择航班分类',
          clearable: true,
          options: [
            {
              value: '国航',
              label: '国航',
            },
            {
              value: '代理国内',
              label: '代理国内',
            },
            {
              value: '代理国际',
              label: '代理国际',
            },
            {
              value: '非代理',
              label: '非代理',
            },
          ],
        },
        {
          prop: 'timedim',
          inputType: 'select',
          placeholder: '时间维度',
          requiredWarning: '请先选择统计时间维度',
          clearable: true,
          options: [
            {
              value: '日',
              label: '按日统计',
            },
            {
              value: '月',
              label: '按月统计',
            },
            {
              value: '年',
              label: '按年统计',
            },
          ],
        },
        {
          prop: 'dateTime',
          inputType: 'datePicker',
          clearable: true,
          width: '240px',
          options: [],
        },
      ],
    }
  },
  components: {
    StatisticsHeader,
    // Tableformcp,
    Tableformbrs,
  },
  mounted() {
    this.dataContent = [
      '日',
      '日',
      '日',
      '国航',
      '国航',
      '国航',
      '国航',
      Format('yyyy-MM-dd', new Date()),
      Format('yyyy-MM-dd', new Date()),
      'PEK',
      Format('yyyy-MM-dd', new Date()),
      Format('yyyy-MM-dd', new Date()),
      'PEK',
    ]
  },
  methods: {
    getFormData(data) {
      this.dataContent = [
        data.timedim,
        data.timedim,
        data.timedim,
        data.company,
        data.company,
        data.company,
        data.company,
        data.dateTime[0],
        data.dateTime[1],
        data.airport ? data.airport : 'PEK',
        data.dateTime[0],
        data.dateTime[1],
        data.airport ? data.airport : 'PEK',
      ]
    },
    exportup() {
      this.isloadings = this.isloadings += 1
    },
  },
}
</script>
<style lang="scss" scoped></style>
