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;
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) {
this.$store.dispatch('openChildWindow', {
name: `file-${this.fileId}-${row.id}`,
@ -186,7 +187,7 @@ export default {
userAgent: "/hideenOfficeTitle/",
force: false,
config: {
title: $A.getFileName(this.file) + ` [${row.created_at}]`,
title,
titleFixed: true,
parent: null,
width: Math.min(window.screen.availWidth, 1440),
@ -199,7 +200,7 @@ export default {
} else if (this.$isEEUiApp) {
this.$store.dispatch('openAppChildPage', {
pageType: 'app',
pageTitle: $A.getFileName(this.file) + ` [${row.created_at}]`,
pageTitle: title,
url: 'web.js',
params: {
titleFixed: true,

View File

@ -11,17 +11,6 @@
<Icon v-else type="ios-refresh" @click="getContent" />
</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 class="content-body">
<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)
},
pageName() {
let name = this.fileInfo ? this.fileInfo.name : '';
if (this.$route.query && this.$route.query.history_at) {
name += ` [${this.$route.query.history_at}]`
if (this.$route.query && this.$route.query.history_title) {
return this.$route.query.history_title
}
return name;
if (this.fileInfo) {
return `${this.fileInfo.name} [${this.fileInfo.created_at}]`;
}
return '';
}
},
watch: {