<template>
  <h2>扫码记录导出</h2>
  <hr>
  <div>
    <p>
    导出时间长度 (小时)
    </p>
    <input class="form-control my-3" type="number" v-model="hours" id="export-hour-span"/>
    <button class="btn btn-primary" @click="do_export" id="export-submit-btn">导出</button>
  </div>
  <JobModal ref="jobmodal" />
</template>
<script>
import JobModal from '../components/job-modal';
export default {
  name: 'ScanDataExport',
    props: [],
    components: {
      JobModal,
  },
  data: function () {
    return {
      hours: 24,
    };
  },
  computed: {
  },
  methods: {
    async do_export() {
      var data = {
        hours: this.hours,
      };
      var r = await this.$root.api_post("/api/v1/export-scan-data/", data);
      var job = r.data.job;
      this.$refs.jobmodal.show(job);
    },
  },
  mounted() {
  },
}
</script>

<style scoped>
</style>
