SearchAndUpload.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <div class="search-upload">
  3. <!-- <a-input :style="{ width: '320px' }" placeholder="搜索" allow-clear>
  4. <template #prefix>
  5. <icon-search />
  6. </template>
  7. </a-input> -->
  8. <a-button class="download-btn" type="text" :disabled="disabled" @click="downloadSummaryFun">
  9. <icon-download />
  10. 下载
  11. </a-button>
  12. </div>
  13. </template>
  14. <script setup>
  15. import { computed } from 'vue';
  16. import { downloadSummary } from '../../../apis/meeting';
  17. import { useMeetingStore } from '../../../base/store/use-meeting';
  18. const useMeeting = useMeetingStore();
  19. const disabled = computed(() => {
  20. return useMeeting.disabledInputOrBtn;
  21. });
  22. const downloadSummaryFun = async () => {
  23. try {
  24. const res = await downloadSummary({ meeting_id: useMeeting.meet_id });
  25. const link = document.createElement('a');
  26. link.href = window.URL.createObjectURL(res);
  27. link.click();
  28. } catch (e) {
  29. console.log(e);
  30. }
  31. };
  32. </script>
  33. <style scoped lang="css">
  34. .search-upload {
  35. display: flex;
  36. align-items: center;
  37. height: 100%;
  38. }
  39. .download-btn {
  40. color: var(--text-download-color);
  41. }
  42. </style>