|
31 | 31 | <el-table-column :show-overflow-tooltip="true" label="文件 URL" align="center" min-width="400" prop="url" />
|
32 | 32 | <el-table-column label="文件大小" align="center" prop="size" width="120" :formatter="sizeFormat" />
|
33 | 33 | <el-table-column label="文件类型" align="center" prop="type" width="210" />
|
34 |
| -<!-- <el-table-column label="文件内容" align="center" prop="content">--> |
35 |
| -<!-- <template slot-scope="scope">--> |
36 |
| -<!-- <img v-if="scope.row.type&&scope.row.type.indexOf('image/') === 0"--> |
37 |
| -<!-- width="200px" :src="getFileUrl + scope.row.id">--> |
38 |
| -<!-- <i v-else>非图片,无法预览</i>--> |
39 |
| -<!-- </template>--> |
40 |
| -<!-- </el-table-column>--> |
| 34 | + <el-table-column label="文件内容" align="center" prop="content" min-width="150px"> |
| 35 | + <template slot-scope="scope"> |
| 36 | + <image-preview v-if="scope.row.type&&scope.row.type.indexOf('image/') === 0" :src="scope.row.url" |
| 37 | + :width="'100px'"></image-preview> |
| 38 | + <i v-else>无法预览,点击 |
| 39 | + <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" |
| 40 | + :href="getFileUrl+scope.row.configId+'/get/' + scope.row.path">下载 |
| 41 | + </el-link> |
| 42 | + </i> |
| 43 | + </template> |
| 44 | + </el-table-column> |
41 | 45 | <el-table-column label="上传时间" align="center" prop="createTime" width="180">
|
42 | 46 | <template slot-scope="scope">
|
43 | 47 | <span>{{ parseTime(scope.row.createTime) }}</span>
|
|
79 | 83 | <script>
|
80 | 84 | import { deleteFile, getFilePage } from "@/api/infra/file";
|
81 | 85 | import {getAccessToken} from "@/utils/auth";
|
| 86 | +import ImagePreview from "@/components/ImagePreview"; |
82 | 87 |
|
83 | 88 | export default {
|
84 | 89 | name: "File",
|
| 90 | + components: { |
| 91 | + ImagePreview |
| 92 | + }, |
85 | 93 | data() {
|
86 | 94 | return {
|
87 |
| - getFileUrl: process.env.VUE_APP_BASE_API + '/admin-api/infra/file/get/', |
| 95 | + getFileUrl: process.env.VUE_APP_BASE_API + '/admin-api/infra/file/', |
88 | 96 | // 遮罩层
|
89 | 97 | loading: true,
|
90 | 98 | // 显示搜索条件
|
|
0 commit comments