Commit c5a1a5e2 authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/viitto/madara

parents 536bdf24 1d7fc82c
...@@ -112,8 +112,11 @@ ...@@ -112,8 +112,11 @@
<div class="msgbase"> <div class="msgbase">
<div class="last"> <div class="last">
<span class="at-me" v-if="session.atId">[有人@我]</span> <span class="at-me" v-if="session.atId">[有人@我]</span>
<span v-if="session.isMute && session.unread>0">[{{session.unread}}]</span> <tenplate v-if="session.isMute && session.unread>0 && !session.historiMsg">
{{session.lastMsgShow}} <span>[{{session.unread}}]</span>
</tenplate>
<span v-if="!session.historiMsg">{{session.lastMsgShow}}</span>
<span v-if="session.historiMsg && currentSession.id !== session.id" style="color: red">[草稿]</span>{{session.historiMsg}}
</div> </div>
<div class="no-tip" v-if="session.isMute"> <div class="no-tip" v-if="session.isMute">
<i class="iconfont iconmiandarao-kai"></i> <i class="iconfont iconmiandarao-kai"></i>
...@@ -155,8 +158,11 @@ ...@@ -155,8 +158,11 @@
<div class="msgbase"> <div class="msgbase">
<div class="last"> <div class="last">
<span class="at-me" v-if="session.atId">[有人@我]</span> <span class="at-me" v-if="session.atId">[有人@我]</span>
<span v-if="session.isMute && session.unread>0">[{{session.unread}}]</span> <tenplate v-if="session.isMute && session.unread>0 && !session.historiMsg">
{{session.lastMsgShow}} <span>[{{session.unread}}]</span>
</tenplate>
<span v-if="!session.historiMsg">{{session.lastMsgShow}}</span>
<span v-if="session.historiMsg && currentSession.id !== session.id" style="color: red">[草稿]</span>{{session.historiMsg}}
</div> </div>
<div class="no-tip" v-if="session.isMute"> <div class="no-tip" v-if="session.isMute">
<i class="iconfont iconmiandarao-kai"></i> <i class="iconfont iconmiandarao-kai"></i>
...@@ -328,10 +334,7 @@ export default { ...@@ -328,10 +334,7 @@ export default {
this.$electron.ipcRenderer.send("close-team-box"); this.$electron.ipcRenderer.send("close-team-box");
this.$store.dispatch('resetNoMoreHistoryMsgs'); this.$store.dispatch('resetNoMoreHistoryMsgs');
this.currentSession.id = ''; this.currentSession.id = '';
let _this = this; this.currentSession = session;
// setTimeout(()=>{
_this.currentSession = session;
// }, 20)
if(session.atId){ if(session.atId){
this.clearAtMe() this.clearAtMe()
this.atIds=session.atId this.atIds=session.atId
...@@ -453,6 +456,9 @@ export default { ...@@ -453,6 +456,9 @@ export default {
} }
}, },
mounted() { mounted() {
this.MsgBus.$on('change-historic', function (){
console.log("asdasd 哈哈哈哈")
})
this.audio_base=this.$electron.remote.getGlobal("AUDIO_PATH")+'audio/' this.audio_base=this.$electron.remote.getGlobal("AUDIO_PATH")+'audio/'
if (window.localStorage.top) { if (window.localStorage.top) {
this.TOPSESSION = JSON.parse(window.localStorage.top); this.TOPSESSION = JSON.parse(window.localStorage.top);
...@@ -638,7 +644,6 @@ export default { ...@@ -638,7 +644,6 @@ export default {
} }
if (item.scene !== "team") { if (item.scene !== "team") {
item.isMute = false; item.isMute = false;
this.$store.state.mutelist.forEach(x => { this.$store.state.mutelist.forEach(x => {
if (x.account == item.to) { if (x.account == item.to) {
item.isMute = true; item.isMute = true;
...@@ -662,12 +667,16 @@ export default { ...@@ -662,12 +667,16 @@ export default {
} }
if (historicList && historicList.length > 0){ if (historicList && historicList.length > 0){
let sessionlist = this.sessionlistArr let sessionlist = this.sessionlistArr
historicList.map(y=>{ historicList.map((y, i)=>{
if (item.id == y.id) { if (item.id == y.id) {
item.historiMsg = y.innerHTML item.historiMsg = y.innerHTML
if (y.innerHTML.replace(/\s+/g,"") == '') {
historicList.splice(i, 1);
}
} }
}) })
} }
window.localStorage.historicList = JSON.stringify(historicList)
return item; return item;
}); });
if (!this.$electron.remote.getCurrentWindow().isVisible()) { if (!this.$electron.remote.getCurrentWindow().isVisible()) {
......
...@@ -267,10 +267,6 @@ export default { ...@@ -267,10 +267,6 @@ export default {
for(let i = 0; i < historicList.length; i++) { for(let i = 0; i < historicList.length; i++) {
if (this.chatId === historicList[i].id) { if (this.chatId === historicList[i].id) {
rp = true rp = true
if (sessionText.replace(/\s+/g,"") == '') {
historicList.splice(i, 1);
break;
}
historicList[i].innerHTML = sessionText historicList[i].innerHTML = sessionText
break; break;
} }
...@@ -378,6 +374,7 @@ export default { ...@@ -378,6 +374,7 @@ export default {
while (dom.hasChildNodes()) { while (dom.hasChildNodes()) {
dom.removeChild(dom.firstChild); dom.removeChild(dom.firstChild);
} }
this.changeTxt()
}, },
addContent(txt) { addContent(txt) {
var txtElement = document.createTextNode(txt); var txtElement = document.createTextNode(txt);
......
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