Harley 6 years ago
parent
commit
a19c0e5a2e

+ 5 - 9
service/src/App.vue

@@ -44,7 +44,7 @@
 			//连接成功
 			websocketonopen() {
 				console.log('已经链接');
-				Vue.prototype.$socket_open = true;
+				this.$store.dispatch("SET_SOCKET_OPEN",true);//列表下标  
 				this.heatBeat();
 			},
 
@@ -158,28 +158,23 @@
 
 				//接收用户消息数据
 				if(redata.message_type == "chatMessage"){
-
 					this.receiveAudio();
 					let _this =this;
 					this.$public.receivesMessage(redata.data,session,this.$frce,function(data,chatList,index){
 						//判断是否是当前对话信息
 						if(dataIndex == index){
-							// _this.data =[];
-							// _this.data = chatList.data;
 							_this.$store.dispatch("SET_CURRENT",chatList.data);//当前会话数据
 						}else{
 							let num = Number.isInteger(chatList.num) ? chatList.num : 0;
-							// _this.$set(chatList,'num',num+1)
-							session[index].num = num+1
+							session[index].num = num+1;
 						}
 						//更新会话时间
-						// _this.$set(chatList,'intime',data.time);
-						session[index].intime =data.time
+						session[index].intime =data.time;
 
 						//更新会话列表中最新回复消息
 						if(data.content.text){
 							// _this.$set(chatList,'text',data.content.text)
-							session[index].text =data.content.text
+							session[index].text =data.content.text;
 						}
 						_this.$store.dispatch("SET_SESSION",session);
 					})
@@ -261,6 +256,7 @@
 
 		},
 		mounted() {
+			Vue.prototype.$socket_open = false;
 			// 获取系统时间
 			let t = new Date().getTime();
 			//this.get('api'+this.$ports.TIME+'?t='+t).then(res => {

+ 0 - 1
service/src/api/http.js

@@ -9,7 +9,6 @@ let Base = 'http://kfadmin.bocai186.com'
 //let Base = 'http://sports.5gogo.com'
 function headerUrl (url) {
   url = Base +  url
-  console.log(url)
   return url
 }
 // post请求头

+ 13 - 3
service/src/components/hader.vue

@@ -103,9 +103,12 @@
 				this.$store.dispatch("SET_NUM",0);//列表下标
 				this.$store.dispatch("SET_CURRENT",[]);//当前会话数据
       			this.$store.dispatch("SET_SESSION_NAME",'');//当前会话对象名
-      			this.$store.dispatch("SET_SESSION_MESSAGE",{});
+				this.$store.dispatch("SET_SESSION_MESSAGE",{});
+				this.$store.dispatch("SET_SOCKET_OPEN",false);//列表下标  
 				this.$websocket.close();
-				this.$socket_open = false;
+				// this.$socket_open = false;
+				
+				// console.log(this.$socket_open)
 				this.$token = '';
 				this.$router.push({path:'/login',query: { pid:escape("~!@#¥%……&*()——+,./;'[]") }})
 			},
@@ -128,7 +131,7 @@
 				};
 				this.post("api/service/index/unreadnotice", obj).then(res => {
 					if(res.data.code === 1){
-						console.log(res.data.data)
+						// console.log(res.data.data)
 						 this.unreadNum =  res.data.data.length;
 					}
 				});
@@ -142,6 +145,13 @@
 			this.user_info = this.$store.getters.get_user_info;
 			this.userID = this.$store.getters.get_user_info.id;
 			this.unreadnotice();
+			let _this = this;
+			let get = setTimeout(function(){
+				_this.unreadnotice();
+			},1000*60)
+
+
+
 		}
 	}
 </script>

+ 20 - 16
service/src/components/historicalRecord.vue

@@ -89,14 +89,22 @@
         <!-- 用户信息展示框 -->
         <div class="user_info">
             <div style=" padding: 20px;">
+                <ul style="padding-inline-start:0px; margin-block-start:0; margin-top:40px;">
+                    <li style="font-weight:bold;font-weight:bold; color:#666666;">访问信息</li>
+                    <li>IP地址:{{account.user_ip}}</li>
+                    <li>来源终端:{{account.system}}-{{account.browse}}</li>
+                </ul>
                 <ul style="padding-inline-start:0px; margin-block-start: 0;">
                     <li style="font-weight:bold;font-weight:bold; color:#666666;">用户信息</li>
-                    <li> 姓名:麦丽素</li>
-                    <li>手机:1982720473</li>
-                    <li>邮箱:3ds47287@qq.com</li>
-                    <li>地址:地球</li>
+                    <li>账号:{{account.account_name}}</li>
+                    <li>标签:{{account.label}}</li>
+                    <li>昵称:{{account.nick_name}}</li>
+                    <li>手机:{{account.account_phone}}</li>
+                    <li>邮箱:{{account.account_email}}</li>
+                    <li>地址:{{account.address}}</li>
+                    <li>备注:{{account.remark}}</li>
                 </ul>
-                <div>
+                <!-- <div>
                     <span>访客备注:</span>
                     <div class="margin_t">
                         <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="textarea">
@@ -105,13 +113,8 @@
                     <div class="bt_save margin_t">
                         <span>保存</span>
                     </div>
-                </div>
-                <ul style="padding-inline-start:0px; margin-block-start:0; margin-top:40px;">
-                    <li style="font-weight:bold;font-weight:bold; color:#666666;">访问信息</li>
-                    <li>来源渠道:直接访问</li>
-                    <li>IP地址:118.2.3.45</li>
-                    <li>来源终端:windows10 - chrome</li>
-                </ul>
+                </div> -->
+            
             </div>
         </div>
         </div>
@@ -130,7 +133,7 @@ export default {
             inputValse:'',
             dataList:'',//会话记录
             alarm:'',//评价谢谢
-
+            account:'',//用户信息
             // imgsrc:'http://192.168.2.186:8090'
             imgsrc:'http://kfadmin.bocai186.com',//图片路径域 
         }
@@ -172,8 +175,9 @@ export default {
             }).then(res => {
                 if(res.data.code == 1){
                     res.data.data.list = res.data.data.list.reverse();
-                    //console.log(res.data.data);
+                    // console.log(res.data.data);
                     this.alarm = res.data.data.alarm;
+                    this.account = res.data.data.account;
                     res.data.data.list.forEach(e => {
                         //reverse()
                         e.time_line = this.$public.customFormatDateTime(e.time_line);
@@ -317,7 +321,7 @@ ul li {
     max-width: 100%;
     min-height: 20px;
     padding: 6px;
-    background:rgba(223,240,255,1);
+    background:rgba(245,245,245,1);
     border-radius:0px 10px 10px 10px;
     margin-top:6px;
 }
@@ -328,7 +332,7 @@ ul li {
     max-width: 100%;
     min-height: 20px;
     padding: 6px;
-    background:rgba(245,245,245,1);
+    background:rgba(223,240,255,1);
     justify-content: flex-end;
     border-radius:10px 0px 10px 10px;
 }

+ 2 - 3
service/src/components/leftNav.vue

@@ -89,11 +89,10 @@
 		//   }
 		// },
 		mounted() {
-
 			this.titleActive = this.$store.getters.get_navState;
 			this.logo = sessionStorage.getItem('logo');
-			console.log(this.logo, '========logo')
-			// // 获取系统时间
+			// console.log(this.logo, '========logo')
+			// // // 获取系统时间
 			// this.get('api'+this.$ports.TIME).then(res => {
 			//   if (res.data.data.time) {
 			//     sessionStorage.setItem("time", res.data.data.time);

+ 4 - 2
service/src/components/messageCenter.vue

@@ -46,7 +46,9 @@
 
 			<el-col :span="18">
 				<el-row class="title">
-					<strong>客服满意度调查!</strong>
+					<strong v-if="switchMessageType == 'unread'">{{unreadListOne.title}}</strong>
+					<!-- title -->
+					<strong v-if="switchMessageType == 'read'">{{messageBox.title}}</strong>
 					<i @click="handleClose" class="el-icon-close"></i>
 				</el-row>
 				<el-row class="messageBox" v-if="switchMessageType == 'unread'">
@@ -167,7 +169,7 @@
 					user_id: this.userID
 				};
 				this.post("api/service/index/unreadnotice", obj).then(res => {
-					console.log(res)
+					// console.log(res)
 					if(res.data.code === 1){
 						console.log("未读",res.data.data)
 						this.unreadList = res.data.data;

+ 46 - 4
service/src/pages/LeaveMessage.vue

@@ -2,6 +2,31 @@
 	<div>
 		<div class="row allAlignment">
 			<leftNav />
+			
+			<!-- 详情抽屉-->
+			<el-drawer 
+			:close-on-press-escape="true"
+			:show-close="false"
+			style="margin-top:7vh;height: 86vh; "
+			:visible.sync="drawer" 
+			size="720px">
+				<el-row class="content_box">
+					<el-row>
+						<el-col :span="23"><div class="">留言详情</div></el-col>
+						<el-col :span="1"><div class="" style="text-align: center;" >X</div></el-col>
+					</el-row>
+					<el-row class="chat_user">
+						<el-col :span="17">
+							<div class="chat_box">聊天消息</div>
+							
+						</el-col>
+						<el-col :span="7">
+							<div class="user_box" style="text-align: center;" >用户信息</div>
+						</el-col>
+					</el-row>
+				</el-row>
+			</el-drawer>
+			
 			<div>
 				<hader />
 				<messageCenter></messageCenter>
@@ -122,7 +147,8 @@
 				value: "",
 				input3: "",
 				startTime: "", // 请求结果开始时间
-				endTime: "" // 请求结果结束时间
+				endTime: "", // 请求结果结束时间
+				drawer:false
 			};
 		},
 		components: {
@@ -198,11 +224,13 @@
 				// console.log(this.value);
 				// console.log(row.uid)
 				this.uid = row.uid;
-				this.isShow = true;
+				// this.drawer =true;
+				// this.isShow = true;
 			},
 			childValue(e) {
 				//console.log(e);
-				this.isShow = e;
+				//this.drawer =true;
+				// this.isShow = e;
 			},
 
 			// resetDateFilter() {
@@ -221,7 +249,21 @@
 	};
 </script>
 
-<style >
+<style  lang="less" scoped>
+	.content_box{
+		margin: 0 10px;
+		.chat_user{
+		border-top: 1px solid #D5E5FF;åå
+			// height: 80vh;
+			.chat_box{
+				height: 80vh;
+			}
+			.user_box{
+				height: 80vh;
+			}
+		}
+	}
+
 	.el-pagination .btn-next .el-icon{
 		display: none;
 	}

+ 6 - 4
service/src/pages/PersonalInformation.vue

@@ -49,17 +49,19 @@
                 <div>
                   <div>
                     <p class="title_text">分组</p>
-                    <p>{{user_info.group}}</p>
+                    <!-- <p>{{user_info.group}}</p> -->
+                    <input class="text_input" readonly v-model="user_info.group" type="text" />
                   </div>
 
                   <div>
                     <p class="title_text">工号</p>
-                    <p>{{user_info.user_job_number}}</p>
+                    <!-- <p>{{user_info.user_job_number}}</p> -->
+                    <input class="text_input" readonly v-model="user_info.user_job_number" type="text" />
                   </div>
 
                   <div>
                     <p class="title_text">姓名</p>
-                    <input class="text_input" v-model="user_info.fullname" type="text" />
+                    <input class="text_input" readonly v-model="user_info.fullname" type="text" />
                   </div>
                 </div>
 
@@ -235,7 +237,7 @@ export default {
   },
   mounted() {
     this.user_info = this.$store.getters.get_user_info;
-    console.log(this.user_info);
+    // console.log(this.user_info);
     this.token = this.user_info.token;
     this.time = sessionStorage.getItem("time");
   },

+ 30 - 29
service/src/pages/SessionHistory.vue

@@ -167,40 +167,41 @@
 				var currentdate = year + seperator1 + month + seperator1 + strDate;
 
 				if (value == 1) {
-					this.startTime = currentdate;
-					this.getNewData(currentdate, 0);
-					this.getSessionHistory();
+					this.startTime = this.getNewData(1);
 				} else if (value == 3) {
-					this.startTime = currentdate;
-					this.getNewData(currentdate, 2);
-					this.getSessionHistory();
+					this.startTime = this.getNewData(3);
 				} else if(value == 7){
-					this.startTime = currentdate;
-					this.getNewData(currentdate, 6);
-					this.getSessionHistory();
+					this.startTime = this.getNewData(7);
 				} else if (value == 15){
-					this.startTime = currentdate;
-					this.getNewData(currentdate, 14);
-					this.getSessionHistory();
+					this.startTime = this.getNewData( 15);					
 				}else {
-					this.startTime = currentdate;
-					this.getNewData(currentdate, 29);
-					this.getSessionHistory();
+					this.startTime = this.getNewData(30);
 				}
+				this.endTime = currentdate;
+				this.getSessionHistory();
+
 			},
-			// 获取结束时间
-			getNewData(currentdate, days) {
-				var dateTemp = currentdate.split("-");
-				var nDate = new Date(dateTemp[1] + '-' + dateTemp[2] + '-' + dateTemp[0]);
-				var millSeconds = Math.abs(nDate) + (days * 24 * 60 * 60 * 1000);
-				var rDate = new Date(millSeconds);
-				var year = rDate.getFullYear();
-				var month = rDate.getMonth() + 1;
-				if (month < 10) month = "0" + month;
-				var date = rDate.getDate();
-				if (date < 10) date = "0" + date;
-				this.endTime = (year + "-" + month + "-" + date);
-				console.log(this.endTime);
+			// 获取结束时间 -改成开始时间
+			getNewData(days) {
+				//设置一周赛事
+				let date = new Date();
+				//获取上一个月天数
+				let lastMonth = new Date(date.getFullYear(),date.getMonth(),0).getDate();
+				for (let i = 0; i < days; i++) {
+					let years = date.getFullYear();//年
+					let month = date.getMonth()+1;//月
+					let day = date.getDate()-i < 10 ? "0" +(date.getDate()-i)  : date.getDate()-i; //日
+					// 判断是否进入上一个月
+					if( date.getDate() -i <= 0){
+						let dayTime = lastMonth + (date.getDate() -i)*1 ;
+						month =  date.getMonth();
+						day = dayTime < 10 ? "0" + dayTime : dayTime ;
+					}					
+					if(i == days-1){
+						return years + "-" + month + "-" + day;
+					}
+				}
+
 			},
 
 			// 获取会话记录
@@ -221,7 +222,7 @@
 					user_name: this.keyText,
 				}, obj).then(res => {
 					if (res.data.code == 1) {
-						console.log(res.data.data.list);
+						// console.log(res.data.data.list);
 						this.tableData = res.data.data.list;
 						this.tableData.forEach(e => {
 							e.end_time = this.$public.customFormatDateTime(e.end_time);

+ 25 - 4
service/src/pages/TheCurrentSession.vue

@@ -204,7 +204,11 @@
 						<!-- <li @click="getLanguage(item.content)" class="row cursor_text" v-for="item in FastReply.sysWords" :key="item.id"> -->
 						<div @click="getLanguage(item.content)" class="row cursor_text item-center"
 							 v-for="item in FastReply.sysWords" :key="item.id" v-if="FastReplySwitch == 'one'">
-							<span class="title_span" style=" width: 100%">#{{item.title}}</span>
+								<el-tooltip class="title_span" effect="light" placement="bottom-start">
+									<div slot="content">{{item.content}}</div>
+									<span class="title_span" style=" width: 100%">#{{item.title}}</span>
+								</el-tooltip>
+							
 							<!-- <div class="ellipsis" style=" width: 70%">
 
 								<span class="content_span">{{item.content}}</span>
@@ -215,7 +219,10 @@
 
 						<div @click="getLanguage(item.content)" class="row cursor_text item-center"
 							 v-for="item in FastReply.userWords" :key="item.id" v-if="FastReplySwitch == 'tow'">
-							<span class="title_span" style=" width: 100%">#{{item.title}}</span>
+								<el-tooltip class="title_span" effect="light" placement="bottom-start">
+									<div slot="content">{{item.content}}</div>
+									<span class="title_span" style=" width: 100%">#{{item.title}}</span>
+								</el-tooltip>
 							<!-- <div class="ellipsis" style=" width: 70%">
 
 								<span class="content_span">{{item.content}}</span>
@@ -293,6 +300,7 @@
 					</div>
 				</div>
 			</div>
+			<!-- 截图粘贴 -->
 			<el-dialog
 			:close-on-click-modal="true"
 			:close-on-press-escape ="true"
@@ -400,6 +408,9 @@
 
 			/******************消息数据接收********************/
 			chatMessage(redata) {
+				//console.log(this.sessionList,'sessionList');
+				//console.log(this.data,'data');
+
 				//用户离线后会话窗口切换
 				if (redata.message_type == "userClose") {
 					console.log(redata)
@@ -515,6 +526,7 @@
 							type: false,
 						};
 						let chatList = self.sessionList[self.dataIndex];
+						//本地存储
 						chatList.data.push({type: 'service', content: obj, time:self.webTime});
 						// self.data = [];
 						// self.data = chatList.data;
@@ -1237,12 +1249,14 @@
 	.chatTop {
 		height: 50px;
 		border-bottom: 1px solid #d5e5ff;
+		
 	}
 
 	.chat-box {
 		height: 62vh;
 		/* background: red; */
 		/* padding: 40px 0; */
+		padding-bottom: 10px;
 		border-bottom: 1px solid #d5e5ff;
 		overflow-x: hidden;
 		overflow-y: auto;
@@ -1289,9 +1303,12 @@
 	}
 
 	.title_span {
+		/* width: 100%; */
+		margin: 4px 2px;
 		color: #666;
 		font-size: 14px;
 		font-weight: bold;
+		
 	}
 
 	.content_span {
@@ -1458,12 +1475,12 @@
 	}
 
 	.message_box {
-		background: #F5F5F5;
+		background: #DFF0FF;
 		border-radius: 10px 0 10px 10px;
 	}
 
 	.user_box {
-		background: #DFF0FF;
+		background: #F5F5F5;
 		border-radius: 0 10px 10px 10px;
 	}
 
@@ -1531,4 +1548,8 @@
 		font-size: 12px;
 		font-weight: 400;
 	}
+	.el-tooltip__popper {
+   		max-width:15vw;
+    /* line-height: 180%; */
+	}
 </style>

+ 2 - 2
service/src/pages/login.vue

@@ -53,7 +53,7 @@
 		methods:{
 			loginBtn(){
 				this.time = sessionStorage.getItem('time');
-				if(this.$socket_open){
+				if(this.$store.getters.get_socket_open){
 					let apiToken = this.$md5('customer-service'+this.time[0]+window.location.origin)
 					if(this.account && this.password){
 
@@ -64,7 +64,7 @@
 							spinner: 'el-icon-loading',
 							background: 'rgba(0, 0, 0, 0.7)'
 						});
-						console.log(this.$ports.login)
+						// if(1) return false
 						this.$http.post(this.$ports.login,{
 							username:this.account,
 							password:this.password

+ 12 - 1
service/src/store/index.js

@@ -21,6 +21,7 @@ const state = {
 	is_init: false,//初始化,
 	new_drawer: false, //显示消息中心
 	session_user_info:{},//当前会话用户信息
+	socket_open:false,// socket链接状态
 }
 
 /**
@@ -65,6 +66,9 @@ const getters = {
 	},
 	get_session_user(state){
 		return state.session_user_info;
+	},
+	get_socket_open(state){
+		return state.socket_open;
 	}
 }
 /**
@@ -111,6 +115,10 @@ const mutations = {
 	new_session_user(state, val) {
 		state.session_user_info = val;
 	},
+	new_socket_open(state, val) {
+		state.socket_open = val;
+	},
+
 }
 
 /**
@@ -155,7 +163,10 @@ const actions = {
 	},
 	SET_SESSSION_USER(context, val) {
 		context.commit('new_session_user', val);
-	}
+	},
+	SET_SOCKET_OPEN(context, val) {
+		context.commit('new_socket_open', val);
+	},
 }
 const store = new Vuex.Store({
 	state,