|
@@ -1,7 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<div>
|
|
- <el-table :data="props.fileList" style="width: 100%">
|
|
|
|
- <el-table-column prop="fileName" label="文件名称" />
|
|
|
|
|
|
+ <el-table :data="downloadsUrlList" style="width: 100%">
|
|
|
|
+ <el-table-column prop="file_name" label="文件名称" />
|
|
<el-table-column label="操作" width="150">
|
|
<el-table-column label="操作" width="150">
|
|
<template #default="{ row }">
|
|
<template #default="{ row }">
|
|
<el-button @click="downloadFile(row.url)" type="primary"
|
|
<el-button @click="downloadFile(row.url)" type="primary"
|
|
@@ -14,13 +14,15 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
-import { defineProps } from "vue";
|
|
|
|
|
|
+import { computed, defineProps } from "vue";
|
|
|
|
|
|
// 接收文件列表作为 props
|
|
// 接收文件列表作为 props
|
|
const props = defineProps<{
|
|
const props = defineProps<{
|
|
- fileList: Array<{ fileName: string; url: string }>;
|
|
|
|
|
|
+ data: Record<string, any>; // 接收完整的数据
|
|
}>();
|
|
}>();
|
|
|
|
|
|
|
|
+const downloadsUrlList = computed(() => props.data.downloadsUrlList);
|
|
|
|
+
|
|
// 下载文件的方法
|
|
// 下载文件的方法
|
|
const downloadFile = (url: string) => {
|
|
const downloadFile = (url: string) => {
|
|
// 创建一个链接元素
|
|
// 创建一个链接元素
|