perf: 分享文件列表界面可以直接跳转到该文件位置
This commit is contained in:
parent
d3a01062ae
commit
6f2b93bec9
@ -10,7 +10,8 @@
|
||||
:audio-cover-url="audioCoverUrl"></icon-file>
|
||||
</div>
|
||||
<div class="share-filename">
|
||||
<span>{{ file.name }}</span>
|
||||
<a v-if="this.file.shareId" :href="'/?path=' + filenamePath + '&highlight=' + file.name">{{ filename }}</a>
|
||||
<span v-else>{{ filename }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<el-form ref="form" class="share-option" :model="shareOption" label-width="82px" size="mini">
|
||||
@ -187,14 +188,27 @@ export default {
|
||||
shareOptionConfig: {
|
||||
shared: false,
|
||||
linkLabel: "选择有效期",
|
||||
}
|
||||
},
|
||||
filename: '',// 文件名
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
filenamePath() {
|
||||
return this.filename.slice(0, this.filename.lastIndexOf('/'))
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
status(visible) {
|
||||
if (visible) {
|
||||
this.filename = this.file.name
|
||||
this.shareDialogVisible = true
|
||||
if (this.file.shareId) {
|
||||
api.getFileInfoById({
|
||||
id: this.file.fileId
|
||||
}).then(res => {
|
||||
this.filename = res.data.path + this.file.name
|
||||
})
|
||||
|
||||
this.shareOptionConfig.shared = true
|
||||
this.shareOptionConfig.linkLabel = '分享链接'
|
||||
this.setShareLink(this.getShareLink(this.file.shareId))
|
||||
@ -391,7 +405,7 @@ export default {
|
||||
.shared-expires-text {
|
||||
text-align: right;
|
||||
line-height: 32px;
|
||||
padding-right: 5px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1285,6 +1285,10 @@ export default {
|
||||
}
|
||||
});
|
||||
}
|
||||
if (this.$route.query.highlight) {
|
||||
this.onCreateFilename = this.$route.query.highlight
|
||||
this.clearOnCreateFilename()
|
||||
}
|
||||
let that = this;
|
||||
window.onresize = function() {
|
||||
that.clientHeight =
|
||||
@ -1444,11 +1448,15 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
setTimeout(() => {
|
||||
this.onCreateFilename = "";
|
||||
}, 5000)
|
||||
this.clearOnCreateFilename()
|
||||
}
|
||||
},
|
||||
// 延时清空onCreateFilename
|
||||
clearOnCreateFilename() {
|
||||
setTimeout(() => {
|
||||
this.onCreateFilename = "";
|
||||
}, 3000);
|
||||
},
|
||||
load() {
|
||||
this.getFileList(true);
|
||||
},
|
||||
@ -2500,6 +2508,13 @@ export default {
|
||||
// 画矩形选取
|
||||
this.darwRectangle();
|
||||
this.loadContextMenus();
|
||||
// 使列表滑到顶部
|
||||
if (!this.grid) {
|
||||
if (this.fileListScrollTop > 0) {
|
||||
this.$refs.fileListTable.pagingScrollTopLeft()
|
||||
}
|
||||
}
|
||||
this.fileListScrollTop = 0
|
||||
},
|
||||
// 加载菜单查看状态
|
||||
loadContextMenus() {
|
||||
@ -2594,19 +2609,15 @@ export default {
|
||||
});
|
||||
// 加载菜单状态
|
||||
this.loadContextMenus();
|
||||
// 使列表滑到顶部
|
||||
// if (!onLoad && !this.grid) {
|
||||
// if (this.fileListScrollTop > 0) {
|
||||
// this.$refs.fileListTable.pagingScrollTopLeft()
|
||||
// }
|
||||
// }
|
||||
// this.fileListScrollTop = 0
|
||||
// 高亮新增的文件
|
||||
if (this.onCreateFilename) {
|
||||
let index = this.fileList.findIndex(item => item.name === this.onCreateFilename);
|
||||
if (index > -1) {
|
||||
let row = this.fileList[index];
|
||||
this.selectRowData.push(row);
|
||||
setTimeout(() => {
|
||||
this.$refs.fileListTable.clearSelection()
|
||||
this.$refs.fileListTable.toggleRowSelection([{ row: row ,selected: true}])
|
||||
}, 0)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -205,13 +205,6 @@
|
||||
audioCoverUrl: `${process.env.VUE_APP_BASE_API}/view/cover?jmal-token=${this.$store.state.user.token}&name=${this.$store.state.user.name}&id=`,
|
||||
fileMenuActive: '',
|
||||
path: this.$route.query.path,
|
||||
showNewFolder: false,
|
||||
isShowNewFolder: false,
|
||||
listModeSearch: false,
|
||||
listModeSearchOpenDir: false,
|
||||
newFolderName: '新建文件夹',
|
||||
renameFileName: '',
|
||||
searchFileName: '',
|
||||
pathList: [
|
||||
{ 'folder': '', index: 0 },
|
||||
{ 'folder': '+', index: 1 }
|
||||
@ -252,7 +245,6 @@
|
||||
name: 'expireDate', label: '过期时间', sortable: 'custom', index: 7
|
||||
}
|
||||
],
|
||||
rowContextData: {},
|
||||
selectRowData: [],
|
||||
tableLoading: false,
|
||||
finished: false,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user