<script setup lang="ts">
import { useFilterList } from '../composables/useFilterList'

const { experiments } = useFilterList()
const form = reactive<any>({
  experiment_id: ''
})
const exportUrl = computed(() => {
  return `/api/lab/v1/teacher/record/download?experiment_id=${form.experiment_id}`
})
</script>

<template>
  <el-dialog title="批量导出" :close-on-click-modal="false" width="400px">
    <el-form label-width="70px">
      <el-form-item label="实验名称">
        <el-select v-model="form.experiment_id">
          <el-option v-for="item in experiments" :key="item.id" :label="item.name" :value="item.id"></el-option>
        </el-select>
        &nbsp;&nbsp;
        <a :href="exportUrl" target="_blank">
          <el-button type="primary" :disabled="!form.experiment_id">导出</el-button>
        </a>
      </el-form-item>
    </el-form>
  </el-dialog>
</template>
