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) this.dispatch("on-view-reply", data)
}, },
onViewText(e) { onViewText(el) {
this.dispatch("on-view-text", e) this.dispatch("on-view-text", el)
}, },
onViewFile(e) { onViewFile(data) {
this.dispatch("on-view-file", e) this.dispatch("on-view-file", data)
}, },
onEmoji(data) { onEmoji(data) {

View File

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

View File

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