oss 优化分片上传
This commit is contained in:
parent
497c76743b
commit
9b921836da
@ -20,6 +20,16 @@
|
|||||||
<svg-icon v-if="grid" class="mobile grid icon-share" icon-class="share"/>
|
<svg-icon v-if="grid" class="mobile grid icon-share" icon-class="share"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="item.ossFolder && !public">
|
||||||
|
<div v-if="pc">
|
||||||
|
<el-tag v-if="!grid" size="small" class="pc list oss-folder">{{ item.ossPlatform }}</el-tag>
|
||||||
|
<el-tag v-if="grid" size="small" class="pc grid oss-folder">{{ item.ossPlatform }}</el-tag>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<el-tag v-if="!grid" size="small" class="mobile list oss-folder">{{ item.ossPlatform }}</el-tag>
|
||||||
|
<el-tag v-if="grid" size="small" class="mobile grid oss-folder">{{ item.ossPlatform }}</el-tag>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<svg-icon v-if="item.isFolder" icon-class="folder"/>
|
<svg-icon v-if="item.isFolder" icon-class="folder"/>
|
||||||
<svg-icon v-else-if="item.contentType.indexOf('video') > -1" icon-class="video"/>
|
<svg-icon v-else-if="item.contentType.indexOf('video') > -1" icon-class="video"/>
|
||||||
<div v-else-if="item.contentType.indexOf('audio') > -1" v-on:mousedown="noDrag($event)">
|
<div v-else-if="item.contentType.indexOf('audio') > -1" v-on:mousedown="noDrag($event)">
|
||||||
@ -185,4 +195,34 @@ export default {
|
|||||||
font-size: 0.5rem;
|
font-size: 0.5rem;
|
||||||
margin-left: 0.5rem;
|
margin-left: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.oss-folder {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.oss-folder {
|
||||||
|
left: 50%;
|
||||||
|
top: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pc.grid.oss-folder {
|
||||||
|
height: 12px;
|
||||||
|
padding: 0 2px;
|
||||||
|
line-height: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mobile.list.oss-folder {
|
||||||
|
left: 85%;
|
||||||
|
top: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.mobile.grid.oss-folder {
|
||||||
|
top: 40%;
|
||||||
|
height: 12px;
|
||||||
|
padding: 0 2px;
|
||||||
|
line-height: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -146,6 +146,7 @@ export default {
|
|||||||
shareId: this.shareId,
|
shareId: this.shareId,
|
||||||
fileId: this.file.id,
|
fileId: this.file.id,
|
||||||
id: this.file.id,
|
id: this.file.id,
|
||||||
|
fileName: this.file.name,
|
||||||
path: encodeURI(this.file.path),
|
path: encodeURI(this.file.path),
|
||||||
username: this.$store.state.user.name
|
username: this.$store.state.user.name
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
|
|||||||
@ -2095,6 +2095,7 @@ export default {
|
|||||||
this.beforeLoadData(onLoad)
|
this.beforeLoadData(onLoad)
|
||||||
api.fileList({
|
api.fileList({
|
||||||
userId: this.$store.state.user.userId,
|
userId: this.$store.state.user.userId,
|
||||||
|
username: this.$store.state.user.name,
|
||||||
currentDirectory: encodeURI(this.$route.query.path),
|
currentDirectory: encodeURI(this.$route.query.path),
|
||||||
pageIndex: this.pagination.pageIndex,
|
pageIndex: this.pagination.pageIndex,
|
||||||
pageSize: this.pagination.pageSize
|
pageSize: this.pagination.pageSize
|
||||||
|
|||||||
@ -99,7 +99,7 @@ export default {
|
|||||||
username: this.$store.state.user.name,
|
username: this.$store.state.user.name,
|
||||||
options: {
|
options: {
|
||||||
target: api.simpleUploadURL,
|
target: api.simpleUploadURL,
|
||||||
chunkSize: 3 * 1024 * 1024,
|
chunkSize: 2 * 1024 * 1024,
|
||||||
// speedSmoothingFactor: 0.1,
|
// speedSmoothingFactor: 0.1,
|
||||||
// progressCallbacksInterval: 500,
|
// progressCallbacksInterval: 500,
|
||||||
maxChunkRetries: 3, // 最大重试次数
|
maxChunkRetries: 3, // 最大重试次数
|
||||||
|
|||||||
@ -77,6 +77,7 @@ export default {
|
|||||||
shareId: this.shareId,
|
shareId: this.shareId,
|
||||||
fileId: this.file.id,
|
fileId: this.file.id,
|
||||||
id: this.file.id,
|
id: this.file.id,
|
||||||
|
fileName: this.file.name,
|
||||||
path: encodeURI(this.file.path),
|
path: encodeURI(this.file.path),
|
||||||
username: this.$store.state.user.name
|
username: this.$store.state.user.name
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
|
|||||||
@ -883,8 +883,10 @@ export default {
|
|||||||
this.getFileList();
|
this.getFileList();
|
||||||
},
|
},
|
||||||
getFileList(onLoad) {
|
getFileList(onLoad) {
|
||||||
|
console.log("getFileList", onLoad)
|
||||||
this.beforeLoadData(onLoad)
|
this.beforeLoadData(onLoad)
|
||||||
api.fileList({
|
api.fileList({
|
||||||
|
username: this.$store.state.user.name,
|
||||||
userId: this.$store.state.user.userId,
|
userId: this.$store.state.user.userId,
|
||||||
currentDirectory: encodeURI(this.$route.query.path),
|
currentDirectory: encodeURI(this.$route.query.path),
|
||||||
queryFileType: this.queryFileType,
|
queryFileType: this.queryFileType,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user