attachment.vue 1011 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <el-table v-loading="loading" :data="tableData" :stripe="true">
  3. <el-table-column label="附件名称" align="center" prop="title" />
  4. <el-table-column label="操作" align="center">
  5. <template #default="scope">
  6. <el-link type="primary" download :href="scope.row.url" :underline="false" target="_blank">下载</el-link>
  7. </template>
  8. </el-table-column>
  9. </el-table>
  10. </template>
  11. <script setup>
  12. defineOptions({ name: 'PersonAttachment' })
  13. import { PersonInfoApi } from '@/api/menduner/system/person'
  14. const props = defineProps({
  15. userId: String
  16. })
  17. const loading = ref(false)
  18. const tableData = ref([])
  19. const total = ref(0)
  20. const queryParams = reactive({
  21. pageNo: 1,
  22. pageSize: 5,
  23. userId: props.userId
  24. })
  25. const getList = async () => {
  26. loading.value = true
  27. try {
  28. const data = await PersonInfoApi.getPersonAttachmentList(queryParams)
  29. tableData.value = data.list
  30. total.value = data.total
  31. } finally {
  32. loading.value = false
  33. }
  34. }
  35. getList()
  36. </script>