perf: 优化查看文件历史

This commit is contained in:
Pang 2024-04-22 09:39:19 +08:00
parent dbdb805269
commit 71f48a4f7c
3 changed files with 10 additions and 18 deletions

View File

@ -178,7 +178,8 @@ export default {
break; break;
case 'preview': case 'preview':
const path = `/single/file/${this.fileId}?history_id=${row.id}&history_at=${row.created_at}`; const title = $A.getFileName(this.file) + ` [${row.created_at}]`;
const path = `/single/file/${this.fileId}?history_id=${row.id}&history_title=${title}`;
if (this.$Electron) { if (this.$Electron) {
this.$store.dispatch('openChildWindow', { this.$store.dispatch('openChildWindow', {
name: `file-${this.fileId}-${row.id}`, name: `file-${this.fileId}-${row.id}`,
@ -186,7 +187,7 @@ export default {
userAgent: "/hideenOfficeTitle/", userAgent: "/hideenOfficeTitle/",
force: false, force: false,
config: { config: {
title: $A.getFileName(this.file) + ` [${row.created_at}]`, title,
titleFixed: true, titleFixed: true,
parent: null, parent: null,
width: Math.min(window.screen.availWidth, 1440), width: Math.min(window.screen.availWidth, 1440),
@ -199,7 +200,7 @@ export default {
} else if (this.$isEEUiApp) { } else if (this.$isEEUiApp) {
this.$store.dispatch('openAppChildPage', { this.$store.dispatch('openAppChildPage', {
pageType: 'app', pageType: 'app',
pageTitle: $A.getFileName(this.file) + ` [${row.created_at}]`, pageTitle: title,
url: 'web.js', url: 'web.js',
params: { params: {
titleFixed: true, titleFixed: true,

View File

@ -11,17 +11,6 @@
<Icon v-else type="ios-refresh" @click="getContent" /> <Icon v-else type="ios-refresh" @click="getContent" />
</div> </div>
</div> </div>
<!-- <Dropdown
v-if="file.type=='mind'"
trigger="click"
class="header-hint"
@on-click="exportMenu">
<a href="javascript:void(0)">{{$L('导出')}}<Icon type="ios-arrow-down"></Icon></a>
<DropdownMenu slot="list">
<DropdownItem name="png">{{$L('导出PNG图片')}}</DropdownItem>
<DropdownItem name="pdf">{{$L('导出PDF文件')}}</DropdownItem>
</DropdownMenu>
</Dropdown> -->
</div> </div>
<div class="content-body"> <div class="content-body">
<template v-if="file.type=='document'"> <template v-if="file.type=='document'">

View File

@ -46,11 +46,13 @@ export default {
return this.windowPortrait || this.code || this.historyId > 0 || (this.fileInfo && this.fileInfo.permission === 0) return this.windowPortrait || this.code || this.historyId > 0 || (this.fileInfo && this.fileInfo.permission === 0)
}, },
pageName() { pageName() {
let name = this.fileInfo ? this.fileInfo.name : ''; if (this.$route.query && this.$route.query.history_title) {
if (this.$route.query && this.$route.query.history_at) { return this.$route.query.history_title
name += ` [${this.$route.query.history_at}]`
} }
return name; if (this.fileInfo) {
return `${this.fileInfo.name} [${this.fileInfo.created_at}]`;
}
return '';
} }
}, },
watch: { watch: {