Commit 07c00112 authored by 华国豪's avatar 华国豪 🙄

修复 重复粘贴图片bug

parent 49ef067a
...@@ -180,6 +180,7 @@ export default { ...@@ -180,6 +180,7 @@ export default {
}, },
methods: { methods: {
atMsg(){ atMsg(){
console.log(11111111111111)
this.MsgBus.$emit('send-at-name', this.atInfo.atName) this.MsgBus.$emit('send-at-name', this.atInfo.atName)
}, },
showCard(e){ showCard(e){
......
...@@ -274,7 +274,7 @@ export default { ...@@ -274,7 +274,7 @@ export default {
}, },
mounted() { mounted() {
let user = this.$electron.remote.getGlobal("LOGINUSER"); let user = this.$electron.remote.getGlobal("LOGINUSER");
this.ImAccount = this.user.ImAccount this.ImAccount = user.ImAccount
//获取记录的操作区域高度 //获取记录的操作区域高度
if (localStorage.consoleh && localStorage.consoleh != "") { if (localStorage.consoleh && localStorage.consoleh != "") {
this.consoleinfo.currenth = parseInt(localStorage.consoleh); this.consoleinfo.currenth = parseInt(localStorage.consoleh);
......
...@@ -312,6 +312,7 @@ export default { ...@@ -312,6 +312,7 @@ export default {
this.TOPSESSION = topSession; this.TOPSESSION = topSession;
}, },
enterChat(session) { enterChat(session) {
console.log(session)
if(session.id!=this.currentSession.id){ if(session.id!=this.currentSession.id){
this.atIds=null this.atIds=null
pageUtil.openDown=true pageUtil.openDown=true
......
...@@ -81,9 +81,15 @@ export default { ...@@ -81,9 +81,15 @@ export default {
deep: true deep: true
} }
}, },
beforeDestroy() {
// 重复图片问题解决方案
// 事件处理中心msgBus,vue页面销毁后,原先的监听事件并没有销毁,导致组件再次载入的时候会重复相同的事件监听,所以当组件销毁时同时需要在 beforeDestroy 钩子中销毁对应的事件监听!!!
this.offMsgBusListener()
},
mounted() { mounted() {
let that = this; let that = this;
this.MsgBus.$on("send-at-name", function(name) { this.MsgBus.$on("send-at-name", function(name) {
console.log(name)
document.querySelector('#msgEditorBox').innerText = document.querySelector('#msgEditorBox').innerText + `@${name} ` document.querySelector('#msgEditorBox').innerText = document.querySelector('#msgEditorBox').innerText + `@${name} `
}) })
this.MsgBus.$on("close-copy", function() { this.MsgBus.$on("close-copy", function() {
...@@ -207,6 +213,10 @@ export default { ...@@ -207,6 +213,10 @@ export default {
let myInterval = window.setInterval(this.updateClipboard, 500); let myInterval = window.setInterval(this.updateClipboard, 500);
}, },
methods: { methods: {
offMsgBusListener(){
this.MsgBus.$off("send-at-name");
this.MsgBus.$off("new-screen-hot");
},
toolPaste: function (e) { toolPaste: function (e) {
let clipboardData = 1; let clipboardData = 1;
document.getElementById('msgEditorBox').focus(); document.getElementById('msgEditorBox').focus();
...@@ -391,17 +401,16 @@ export default { ...@@ -391,17 +401,16 @@ export default {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
z-index: 5;
} }
.tool-copy li{ .tool-copy li{
font-size: 12px;
z-index: 5; font-family: Microsoft YaHei;
padding: 10px;
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
box-shadow: 0px 2px 5px 0px rgba(170, 170, 170, 0.75); box-shadow: 0px 2px 5px 0px rgba(170, 170, 170, 0.75);
border: 1px solid rgb(170, 170, 170, 0.65); border: 1px solid rgb(170, 170, 170, 0.65);
cursor: pointer; cursor: pointer;
font-size: 14px; padding: 5px 20px;
padding: 5px 10px;
list-style: none; list-style: none;
} }
.tool-copy li:hover{ .tool-copy li:hover{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment