Skip to content

Commit 373669d

Browse files
committed
Merge remote-tracking branch 'origin/master' into dev
2 parents 874695a + d9cd6fa commit 373669d

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "yudao-ui-admin",
3-
"version": "1.6.5-snapshot",
3+
"version": "1.6.6-snapshot",
44
"description": "芋道管理系统",
55
"author": "芋道",
66
"license": "MIT",

src/views/infra/file/index.vue

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
<template>
22
<div class="app-container">
3-
<doc-alert title="上传下载" url="https://doc.iocoder.cn/file/" />
3+
<doc-alert title="上传下载" url="https://doc.iocoder.cn/file/"/>
44
<!-- 搜索工作栏 -->
55
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
66
<el-form-item label="文件路径" prop="path">
77
<el-input v-model="queryParams.path" placeholder="请输入文件路径" clearable @keyup.enter.native="handleQuery"/>
88
</el-form-item>
99
<el-form-item label="创建时间" prop="createTime">
10-
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
11-
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
10+
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss"
11+
type="daterange"
12+
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
13+
:default-time="['00:00:00', '23:59:59']"/>
1214
</el-form-item>
1315
<el-form-item>
1416
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
@@ -35,6 +37,9 @@
3537
<template v-slot="scope">
3638
<image-preview v-if="scope.row.type&&scope.row.type.indexOf('image/') === 0" :src="scope.row.url"
3739
:width="'100px'"></image-preview>
40+
<video v-else-if="scope.row.type&&scope.row.type.indexOf('video/') === 0" :width="'100px'">
41+
<source :src="scope.row.url"/>
42+
</video>
3843
<i v-else>无法预览,点击
3944
<el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" target="_blank"
4045
:href="getFileUrl + scope.row.configId + '/get/' + scope.row.path">下载
@@ -118,7 +123,7 @@ export default {
118123
title: "", // 弹出层标题
119124
isUploading: false, // 是否禁用上传
120125
url: process.env.VUE_APP_BASE_API + "/admin-api/infra/file/upload", // 请求地址
121-
headers: { Authorization: "Bearer " + getAccessToken() }, // 设置上传的请求头部
126+
headers: {Authorization: "Bearer " + getAccessToken()}, // 设置上传的请求头部
122127
data: {} // 上传的额外数据,用于文件名
123128
},
124129
};
@@ -189,19 +194,20 @@ export default {
189194
/** 删除按钮操作 */
190195
handleDelete(row) {
191196
const id = row.id;
192-
this.$modal.confirm('是否确认删除文件编号为"' + id + '"的数据项?').then(function() {
197+
this.$modal.confirm('是否确认删除文件编号为"' + id + '"的数据项?').then(function () {
193198
return deleteFile(id);
194199
}).then(() => {
195200
this.getList();
196201
this.$modal.msgSuccess("删除成功");
197-
}).catch(() => {});
202+
}).catch(() => {
203+
});
198204
},
199205
// 用户昵称展示
200206
sizeFormat(row, column) {
201-
const unitArr = ["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"];
207+
const unitArr = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
202208
const srcSize = parseFloat(row.size);
203209
const index = Math.floor(Math.log(srcSize) / Math.log(1024));
204-
let size =srcSize/Math.pow(1024,index);
210+
let size = srcSize / Math.pow(1024, index);
205211
size = size.toFixed(2);//保留的小数位数
206212
return size + ' ' + unitArr[index];
207213
},

0 commit comments

Comments
 (0)