fix: 无法点击图片预览的问题

This commit is contained in:
kuaifan 2022-06-21 17:30:39 +08:00
parent c1d27399d9
commit 5f98cc93c7
3 changed files with 15 additions and 12 deletions

View File

@ -79,12 +79,12 @@ export default {
this.dispatch("on-view-reply", data)
},
onViewText(e) {
this.dispatch("on-view-text", e)
onViewText(el) {
this.dispatch("on-view-text", el)
},
onViewFile(e) {
this.dispatch("on-view-file", e)
onViewFile(data) {
this.dispatch("on-view-file", data)
},
onEmoji(data) {

View File

@ -378,12 +378,12 @@ export default {
})
},
viewText(e) {
this.$emit("on-view-text", e)
viewText(el) {
this.$emit("on-view-text", el)
},
viewFile(e) {
this.$emit("on-view-file", e)
viewFile() {
this.$emit("on-view-file", this.msgData)
},
onEmoji(symbol) {

View File

@ -1201,19 +1201,22 @@ export default {
}
},
onViewFile() {
onViewFile(data) {
if (this.operateVisible) {
return
}
const {msg} = this.operateItem;
if (!$A.isJson(data)) {
data = this.operateItem
}
const {msg} = data;
if (['jpg', 'jpeg', 'gif', 'png'].includes(msg.ext)) {
this.onViewPicture(msg.path);
return
}
const path = `/single/file/msg/${this.operateItem.id}`;
const path = `/single/file/msg/${data.id}`;
if (this.$Electron) {
this.$Electron.sendMessage('windowRouter', {
name: `file-msg-${this.operateItem.id}`,
name: `file-msg-${data.id}`,
path: path,
userAgent: "/hideenOfficeTitle/",
force: false,