luke před 6 roky
rodič
revize
ab72118b36

+ 28 - 14
service_exe/src/renderer/components/leftNav.vue

@@ -14,6 +14,10 @@
 				>
 					<img style="margin-right:10px;" :src="titleActive == item.type?item.imgsrcA:item.imgsrc"/>
 					{{item.title}}
+					<el-badge :value="megnum" class="item" v-if="index == 0 && showMeg">
+						<i style="font-size:14px; color:#5399F5;   margin-left: 10px;"
+						   class="el-icon-chat-dot-square"> </i>
+					</el-badge>
 				</p>
 			</div>
 		</div>
@@ -25,8 +29,10 @@
 		name: "leftNav",
 		data() {
 			return {
+				megnum: 0,
+				showMeg: false,
 				logo: '',
-				img_http:'http://kfadmin.bocai186.com',//图片路径域
+				img_http: 'http://kfadmin.bocai186.com',//图片路径域
 				// img_http: 'http://192.168.2.187:8090',//图片路径域
 				titleActive: "TheCurrentSession",
 				data: [
@@ -34,7 +40,7 @@
 						title: "当前会话",
 						type: "TheCurrentSession",
 						imgsrc: require("@/assets/img/left1.png"),
-						imgsrcA: require("@/assets/img/left1a.png")
+						imgsrcA: require("@/assets/img/left1a.png"),
 					},
 					{
 						title: "留言",
@@ -71,26 +77,33 @@
 				if (str != 'TheCurrentSession') {
 					path = "/" + str
 				}
+				if(str == 'TheCurrentSession'){
+					this.megnum = 0;
+					this.$store.dispatch("SET_MEG", false);
+				}else {
+					this.$store.dispatch("SET_MEG", true);
+				}
 
 				this.$store.dispatch("SET_NAVSTATE", str);
 				// this.$store.dispatch("SET_DRAWER",false);
-				this.$router.push({path,query: { pid:escape("这就是一个编码没有什么用啊") }});
+				this.$router.push({path, query: {pid: escape("这就是一个编码没有什么用啊")}});
+			}
+		},
+
+		computed: {
+			getTitleActive() {
+				return this.$store.getters.get_megnum
+			}
+		},
+		watch: {
+			getTitleActive(val){
+				this.megnum = val;
 			}
 		},
-		// computed: {
-		//   getTitleActive() {
-		//     return this.titleActive;
-		//   }
-		// },
-		// watch: {
-		//   getTitleActive(val) {
-		//     console.log(this.titleActive =='TheCurrentSession'? '' : val)
-		//     this.$router.push("/" + this.titleActive =='TheCurrentSession'? '' : val);
-		//   }
-		// },
 		mounted() {
 			this.titleActive = this.$store.getters.get_navState;
 			this.logo = sessionStorage.getItem('logo');
+			this.showMeg = this.$store.getters.get_meg
 		},
 	};
 </script>
@@ -125,6 +138,7 @@
 		color: #eaf3ff;
 		background: #0d1f47;
 	}
+
 	.nav p {
 		cursor: pointer;
 	}

+ 1 - 2
service_exe/src/renderer/pages/SessionHistory.vue

@@ -183,8 +183,8 @@
 					this.startTime = this.getNewData(30);
 				}
 				this.endTime = currentdate;
+				this.getSessionHistory();
 
-				this.getSessionHistory(1);
 			},
 			// 获取结束时间 -改成开始时间
 			getNewData(days) {
@@ -228,7 +228,6 @@
 				}, obj).then(res => {
 					if (res.data.code == 1) {
 						this.tableData = res.data.data.list;
-						console.log(this.tableData)
 						this.tableData.forEach(e => {
 							if(e.end_time != '0'){
 								e.end_time = this.$public.customFormatDateTime(e.end_time);

+ 7 - 4
service_exe/src/renderer/pages/TheCurrentSession.vue

@@ -172,8 +172,8 @@
 							<div @click="sendMessage()" class="msgInputBtn row center">发送</div>
 						</div>
 					</div>
-
-					 <audio id="send" src="@/assets/audio/send.wav"></audio>
+					<!-- 发送消息音频提示 -->
+					<!-- <audio id="send" src="@/assets/audio/send.wav"></audio> -->
 				</div>
 
 				<!-- 快捷回复模块 -->
@@ -743,7 +743,8 @@
 
 			// 消息发送声音提示
 			sendAudio() {
-				let send = document.getElementById('send')
+				let send = new Audio()
+				send.src = "../../static/audio/send.wav"
 				send.play()
 			},
 
@@ -903,10 +904,12 @@
 								this.sessionList[index].name = this.session_user_info.nick_name;
 							}
 							this.$store.dispatch("SET_SESSION",this.sessionList);
+							this.$store.dispatch("SET_SESSION_NAME",this.sessionList[index].name);
 						}else if(type == 2){
 							if(this.session_user_info.nick_name){
-								this.offlineList[index].name = this.session_user_info.nick_name; 
+								this.offlineList[index].name = this.session_user_info.nick_name;
 							}
+							this.$store.dispatch("SET_SESSION_NAME",this.offlineList[index].name);
 							//this.$store.dispatch("SET_SESSION", this.offlineList);
 						}
 					}

+ 34 - 15
service_exe/src/renderer/store/index.js

@@ -11,18 +11,20 @@ const state = {
 	user_info: localStorage.getItem('user'), //用户信息
 	sessionList: [],//会话列表
 	offlineList: [],//离线列表
-	current_session:[],//当前会话详情信息
+	current_session: [],//当前会话详情信息
 	sessionType: 1,//选择列表状态默认未1(1是会话中,2是离线)
 	data_num: 0,//定位当前会话,默认是0
 	navState: localStorage.getItem('titleActive'),//导航状态
 	session_name: '',//当前会话用户名
-	session_message:'',//接收会话信息
+	session_message: '',//接收会话信息
 	stateValue: '',//状态值
 	is_init: false,//初始化,
 	new_drawer: false, //显示消息中心
-	session_user_info:{},//当前会话用户信息
-	socket_open:false,// socket链接状态
-	evaluate_id:0,//访客接入是否评价状态
+	session_user_info: {},//当前会话用户信息
+	socket_open: false,// socket链接状态
+	evaluate_id: 0,//访客接入是否评价状态
+	megnum: 0,
+	meg: false,
 }
 
 /**
@@ -63,18 +65,24 @@ const getters = {
 	get_is_init(state) {
 		return state.is_init;
 	},
-    get_drawer(state) {
-        return state.new_drawer;
+	get_drawer(state) {
+		return state.new_drawer;
 	},
-	get_session_user(state){
+	get_session_user(state) {
 		return state.session_user_info;
 	},
-	get_socket_open(state){
+	get_socket_open(state) {
 		return state.socket_open;
 	},
-	get_evaluate_id(state){
+	get_evaluate_id(state) {
 		return state.evaluate_id;
-	}
+	},
+	get_megnum(state) {
+		return state.megnum;
+	},
+	get_meg(state, val) {
+		return state.meg;
+	},
 }
 /**
  * 设置对外可调用的方法
@@ -82,7 +90,7 @@ const getters = {
 const mutations = {
 	new_user_info(state, val) {
 		state.user_info = val;
-		localStorage.setItem('user',JSON.stringify(val));
+		localStorage.setItem('user', JSON.stringify(val));
 	},
 	new_session(state, val) {
 		state.sessionList = val;
@@ -101,7 +109,7 @@ const mutations = {
 	},
 	new_navState(state, val) {
 		state.navState = val;
-		localStorage.setItem('titleActive',val);
+		localStorage.setItem('titleActive', val);
 	},
 	new_session_name(state, val) {
 		state.session_name = val;
@@ -127,7 +135,12 @@ const mutations = {
 	new_evaluate_id(state, val) {
 		state.evaluate_id = val;
 	},
-
+	new_megnum(state, val) {
+		state.megnum = val;
+	},
+	new_meg(state, val) {
+		state.meg = val;
+	},
 }
 
 /**
@@ -135,7 +148,7 @@ const mutations = {
  */
 const actions = {
 	SET_USER(context, val) {
-		context.commit('new_user_info',val)
+		context.commit('new_user_info', val)
 	},
 	SET_SESSION(context, val) {
 		context.commit('new_session', val);
@@ -179,6 +192,12 @@ const actions = {
 	SET_EVALUATE_ID(context, val) {
 		context.commit('new_evaluate_id', val);
 	},
+	SET_MEGNNUM(context, val) {
+		context.commit('new_megnum', val);
+	},
+	SET_MEG(context, val) {
+		context.commit('new_meg', val);
+	}
 }
 const store = new Vuex.Store({
 	state,