attachment.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <div>
  3. <!-- <el-tabs>
  4. <el-tab-pane v-for="item of tableData" :key="item.id" :label="item.title">
  5. <vue-office-docx :src="item.url" />
  6. </el-tab-pane>
  7. </el-tabs> -->
  8. <el-table v-loading="loading" :data="tableData" :stripe="true">
  9. <el-table-column label="附件名称" align="center" prop="title" />
  10. <el-table-column label="操作" align="center">
  11. <template #default="scope">
  12. <el-link type="primary" download :href="scope.row.url" :underline="false" target="_blank">下载</el-link>
  13. </template>
  14. </el-table-column>
  15. </el-table>
  16. </div>
  17. </template>
  18. <script setup>
  19. defineOptions({ name: 'PersonAttachment' })
  20. import { PersonInfoApi } from '@/api/menduner/system/person'
  21. const props = defineProps({
  22. userId: String
  23. })
  24. const loading = ref(false)
  25. const tableData = ref([
  26. {
  27. id: "1854433786213732353",
  28. title: "沈和威-13229740092",
  29. url: "https://minio.menduner.com/test/person/1/attachment/7cde29dc69c1403649be55d4c2bfd3d8304c088dc79ab25afe9c4bf55d3b382f.docx",
  30. createTime: 1730966443004,
  31. updateTime: 1730966443004
  32. },
  33. {
  34. id: "1854351450755395585",
  35. title: "沈和威",
  36. url: "https://minio.menduner.com/test/957f8916b9f8e624d9dbe26dd35b31ee44961514e464d413c71419277cbaa38a.pdf",
  37. createTime: 1730946812702,
  38. updateTime: 1730946812702
  39. },
  40. {
  41. id: "1833835593730252802",
  42. title: "沈和威2",
  43. url: "http://menduner.citupro.com:6868/admin-api/infra/file/24/get/7f3b59ce754d452ced40091a63d6db2e08ea8a22a26b7e81f03f133c947aff52.docx",
  44. createTime: 1726055451223,
  45. updateTime: 1726055451223
  46. }
  47. ])
  48. const total = ref(0)
  49. const queryParams = reactive({
  50. pageNo: 1,
  51. pageSize: 5,
  52. userId: props.userId
  53. })
  54. const getList = async () => {
  55. loading.value = true
  56. try {
  57. const data = await PersonInfoApi.getPersonAttachmentList(queryParams)
  58. tableData.value = data.list
  59. total.value = data.total
  60. } finally {
  61. loading.value = false
  62. }
  63. }
  64. // getList()
  65. </script>