whx 4 mesiacov pred
rodič
commit
5edaa97b5c

+ 18 - 4
virgo.wzfrontend/console/src/layout/components/chat.vue

@@ -31,7 +31,10 @@
 
 <script>
 	import uniDateformat from '@/components/common/uniDateformat'
-	import chatBox from './chatBox.vue';
+	import chatBox from './chatBox.vue';
+	import {
+		mapGetters
+	} from 'vuex';
 	export default {
 		data() {
 			return {
@@ -40,10 +43,13 @@
 			}
 		},
 		created() {
-			this.chatData = this.$store.getters.chatList;
-			if (this.chatData.length > 0) this.nowChat = this.chatData[0];
+			this.init();
 		},
 		methods: {
+			init() {
+				this.chatData = this.$store.getters.chatList.filter(node => node.conversationId !== 'system');
+				if (this.chatData.length > 0) this.nowChat = this.chatData[0];
+			},
 			linkTo(item) {
 				this.nowChat = item;
 			}
@@ -51,7 +57,15 @@
 		components: {
 			uniDateformat,
 			chatBox
-		}
+		},
+		computed: {
+			...mapGetters(['chatList'])
+		},
+		watch: {
+			chatList() {
+				this.chatData = this.$store.getters.chatList.filter(node => node.conversationId !== 'system');
+			}
+		},
 	}
 </script>
 

+ 5 - 1
virgo.wzfrontend/console/src/layout/components/chatBox.vue

@@ -56,11 +56,15 @@
 				sendMessage: '',
 				sendLoading: false
 			}
+		},
+		beforeDestroy() {
+			YeIMUniSDK.getInstance().removeEventListener(YeIMUniSDKDefines.EVENT.MESSAGE_RECEIVED, this.onMessage);
 		},
 		created() {
 			this.$nextTick(() => {
 				// 设置onscroll事件处理函数
-				this.$refs.chatList.onscroll = this.chatScroll;
+				this.$refs.chatList.onscroll = this.chatScroll;
+				this.$chat.clearConversationUnread(this.body.conversationId);
 				this.mescrollUpFunc('init');
 				YeIMUniSDK.getInstance().addEventListener(YeIMUniSDKDefines.EVENT.MESSAGE_RECEIVED, this
 					.onMessage);

+ 1 - 2
virgo.wzfrontend/console/src/layout/work.vue

@@ -65,9 +65,8 @@
 				});
 			},
 			countNumber(data) {
-				this.chatData = data.filter(node => node.conversationId !== 'system');
 				let badge = 0;
-				let list = this.chatList;
+				let list = data.filter(node => node.conversationId !== 'system');
 				for (let i = 0; i < list.length; i++) {
 					badge += list[i].unread
 				}

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
virgo.wzfrontend/src/main/resources/static/console/index.html


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 0
virgo.wzfrontend/src/main/resources/static/console/static/js/app-legacy.7231273c.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 1
virgo.wzfrontend/src/main/resources/static/console/static/js/app-legacy.d208cfbf.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 1
virgo.wzfrontend/src/main/resources/static/console/static/js/app.07f70de3.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 0
virgo.wzfrontend/src/main/resources/static/console/static/js/app.9eee3441.js