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