perf: 该文件版本已经改变了。该页面将被重新加载

This commit is contained in:
kuaifan 2022-02-09 17:27:59 +08:00
parent d49790ba78
commit 9ad85e01de
3 changed files with 12 additions and 6 deletions

View File

@ -90,6 +90,10 @@ export default {
fileName() {
return this.value.name;
},
fileUpdatedAt() {
return this.value.updated_at ? $A.Date(this.value.updated_at, true) : '';
}
},
@ -148,9 +152,9 @@ export default {
const config = {
"document": {
"fileType": this.fileType,
"key": this.fileType + '-' + fileKey,
"key": `${this.fileType}-${fileKey}-${this.fileUpdatedAt}`,
"title": fileName,
"url": 'http://nginx/api/file/content/?id=' + fileKey + '&token=' + this.userToken,
"url": `http://nginx/api/file/content/?id=${fileKey}&token=${this.userToken}`,
},
"editorConfig": {
"mode": "edit",
@ -162,16 +166,16 @@ export default {
"customization": {
"uiTheme": this.themeIsDark ? "theme-dark" : "theme-classic-light",
},
"callbackUrl": 'http://nginx/api/file/content/office?id=' + fileKey + '&token=' + this.userToken,
"callbackUrl": `http://nginx/api/file/content/office?id=${fileKey}&token=${this.userToken}`,
}
};
if (/\/hideenOfficeTitle\//.test(window.navigator.userAgent)) {
config.document.title = " ";
}
if ($A.leftExists(fileKey, "msgFile_")) {
config.document.url = 'http://nginx/api/dialog/msg/download/?msg_id=' + $A.leftDelete(fileKey, "msgFile_") + '&token=' + this.userToken;
config.document.url = `http://nginx/api/dialog/msg/download/?msg_id=${$A.leftDelete(fileKey, "msgFile_")}&token=${this.userToken}`;
} else if ($A.leftExists(fileKey, "taskFile_")) {
config.document.url = 'http://nginx/api/project/task/filedown/?file_id=' + $A.leftDelete(fileKey, "taskFile_") + '&token=' + this.userToken;
config.document.url = `http://nginx/api/project/task/filedown/?file_id=${$A.leftDelete(fileKey, "taskFile_")}&token=${this.userToken}`;
}
if (this.readOnly) {
config.editorConfig.mode = "view";

View File

@ -99,7 +99,8 @@ export default {
return {
id: this.isOffice ? this.msgDetail.id : 0,
type: this.msgDetail.msg.ext,
name: this.title
updated_at: this.msgDetail.created_at,
name: this.title,
}
},
officeCode() {

View File

@ -99,6 +99,7 @@ export default {
return {
id: this.isOffice ? this.fileDetail.id : 0,
type: this.fileDetail.ext,
updated_at: this.fileDetail.created_at,
name: this.title
}
},