From b4c1d05d2ec03c8dda383189bf64cc24e879fc1f Mon Sep 17 00:00:00 2001 From: kuaifan Date: Thu, 9 Jun 2022 16:29:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=96=87=E4=BB=B6md=E3=80=81text?= =?UTF-8?q?=E4=BA=92=E8=BD=AC=E6=97=B6=E6=96=87=E4=BB=B6=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=8F=98=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/manage/components/FileContent.vue | 31 ++++++++++++++++--- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/resources/assets/js/pages/manage/components/FileContent.vue b/resources/assets/js/pages/manage/components/FileContent.vue index 71b9e7ecf..ddd10d6a9 100644 --- a/resources/assets/js/pages/manage/components/FileContent.vue +++ b/resources/assets/js/pages/manage/components/FileContent.vue @@ -25,7 +25,7 @@ [{{$L('未保存')}}*] - {{$A.getFileName(file)}} + {{fileName}}
- - + +
@@ -150,6 +150,7 @@ export default { unsaveTip: false, + fileExt: null, contentDetail: null, contentBak: {}, @@ -203,6 +204,7 @@ export default { this.linkShow = false; this.historyShow = false; this.officeReady = false; + this.fileExt = null; } }, immediate: true, @@ -250,6 +252,15 @@ export default { return this.file.id || 0 }, + fileName() { + if (this.fileExt) { + return $A.getFileName(Object.assign(this.file, { + ext: this.fileExt + })) + } + return $A.getFileName(this.file) + }, + equalContent() { return this.contentBak == $A.jsonStringify(this.contentDetail); }, @@ -360,10 +371,15 @@ export default { }, }).then(({data, msg}) => { $A.messageSuccess(msg); - this.$store.dispatch("saveFile", { + const newData = { id: this.fileId, size: data.size, - }); + }; + if (this.fileExt) { + newData.ext = this.fileExt; + this.fileExt = null; + } + this.$store.dispatch("saveFile", newData); }).catch(({msg}) => { $A.modalError(msg); this.getContent(); @@ -459,6 +475,11 @@ export default { this.unsaveTip = false; }, + setTextType(type) { + this.fileExt = type + this.$set(this.contentDetail, 'type', type) + }, + documentKey() { return new Promise(resolve => { this.$store.dispatch("call", {