Harley 6 lat temu
rodzic
commit
16d586886f

+ 1 - 0
service_exe/src/index.ejs

@@ -9,6 +9,7 @@
         require('module').globalPaths.push('<%= htmlWebpackPlugin.options.nodeModules.replace(/\\/g, '\\\\') %>')
       </script>
     <% } %>
+    <script src="./url_config.js"></script>
   </head>
   <body>
     <div id="app"></div>

+ 2 - 2
service_exe/src/renderer/App.vue

@@ -33,7 +33,7 @@
 			//初始化weosocket
 			initWebSocket(apiToken) {
 				// 书写接口信息
-				const wsuri = "wss://link.281570.com?apiToken=" + apiToken;//www.service.com 线上
+				const wsuri = "wss://"+window.url_https_wss+"?apiToken=" + apiToken;//www.service.com 线上
 				// 创建websocket实例
 				Vue.prototype.$websocket = new WebSocket(wsuri);
 				this.$websocket.onopen = this.websocketonopen; //连接成功
@@ -61,7 +61,7 @@
 				// console.log(this.$store.getters.get_user_info != "");
 				user_info=this.getCustomerUserInfo();
 
-				if(user_info){
+				if(user_info.token){
 					this.$websocket.send(JSON.stringify({
 						type: 'init',
 						data: {

+ 4 - 2
service_exe/src/renderer/api/http.js

@@ -4,9 +4,9 @@ import qs from 'qs'  // 序列化字符串
 // 请求超时时间
 axios.defaults.timeout = 10000
 // 线上
-let Base = 'https://manage.281570.com'
+let Base = window.url_https_ajax;
 // 开发
-//let Base = 'http://sports.5gogo.com'
+// let Base = 'https://manage.281570.com'
 function headerUrl (url) {
 	url = Base +  url
 	return url
@@ -48,6 +48,8 @@ export default {
 				})
 		})
 	},
+
+	/************************不加请求头post请求**************************/
 	uploadPost(url, params) {
 		return new Promise((resolve, reject) => {
 			axios.post(headerUrl(url), params)

+ 21 - 13
service_exe/src/renderer/components/hader.vue

@@ -161,7 +161,7 @@
 				user_info: '',//
 				userID:null,
 				unreadNum:null, // 未读数量
-				img_http:'https://manage.281570.com',//图片路径域
+				img_http:window.url_https_ajax,//图片路径域
 				innerDrawer:false,//会话总览抽屉开关
 				dataTree: [],
 				defaultProps: {
@@ -176,16 +176,17 @@
 				session_litle:'',//会话标题
 				newTime:'',//本次最新时间
 				isGetList:false,//点击获取会话信息
-
 				dialogVisible: false, //图片放大
 				dialogImageUrl: '', // 放大的图片
 
 				serverList:[],
 				get_num:'',
+				loadingobj:{},//
 			}
 		},
 
 		mounted() {
+        	// this.img_http = window.url_https_ajax;
 			if (this.$store.getters.get_stateValue) {
 				this.value = this.$store.getters.get_stateValue;
 			}
@@ -200,7 +201,7 @@
 			let _this = this;
 			this.get_num = setInterval(function(){
 				_this.unreadnotice();
-			},5000)
+			},1000*30)
 
 
 
@@ -293,7 +294,7 @@
 				},obj).then(res => {
 					if(res.data.code === 1){
 						// console.log(res.data.data)
-						 this.unreadNum =  res.data.data.length;
+						this.unreadNum =  res.data.data.length;
 					}
 				});
 			},
@@ -304,11 +305,15 @@
 					if(this.isGetList) return false
 					clearInterval(this.ession_int);
 					this.servicelog = data;
-					console.log(this.servicelog)
+					// console.log(this.servicelog)
 					this.init();
 					this.get_session_lise();
+					this.loadingobj = this.$loading({
+						lock: true,
+						text: '拼命加载中...',
+						spinner: 'el-icon-loading',
+					});
 					this.ession_int = setInterval(()=>{
-						Loading.service({text:'拼命加载中',background:'rgba(0, 0, 0, 0.8)'});
 						this.get_session_lise(this.newTime,10000);
 					},1000*5)
 				}
@@ -329,7 +334,12 @@
 				if(this.innerDrawer) return false;
 				this.innerDrawer = true;
 				setTimeout(()=>{
-					Loading.service({text:'拼命加载中',background:'rgba(0, 0, 0, 0.8)'});
+					// Loading.service({text:'拼命加载中',background:'rgba(0, 0, 0, 0.8)'});
+					this.loadingobj = this.$loading({
+						lock: true,
+						text: '拼命加载中...',
+						spinner: 'el-icon-loading',
+					});
 					let obj = {
 						headers: {
 							apiToken: this.$md5("allconversation" + "customer-service" + "history" + "service"),
@@ -337,6 +347,7 @@
 						}
 					};
 					this.$http.post(this.$ports.overview.allConversation,'',obj).then(res => {
+						this.loadingobj.close()
 						if(res.data.code === 1){
 							// console.log('会话',res.data)
 							this.dataTree = res.data.data;
@@ -358,11 +369,10 @@
 										if (step == true) {
 											this.init();
 										}
-
 									}
 								});
 							},1000*60);
-							Loading.service().close()
+							
 						}
 					});
 				},200)
@@ -405,10 +415,8 @@
 							e.content.text = this.$public.turnFace(e.content.text,this.$frce);
 							this.dataList.push(e)
 						});
-						if( type ==10000){
-							Loading.service().close()
-						}
 					}
+					this.loadingobj.close()
 				});
 			},
 
@@ -569,4 +577,4 @@
 		top: 8px !important;
 		right: 20px !important;
 	}
-</style>
+</style>

+ 2 - 1
service_exe/src/renderer/components/historicalRecord.vue

@@ -132,7 +132,7 @@ export default {
             dataList:[],//会话记录
             alarm:'',//评价谢谢
             account:'',//用户信息
-            imgsrc:'https://manage.281570.com',//图片路径域 
+            imgsrc:window.url_https_ajax,//图片路径域 
             isShowBt:false,//显示加载按钮
             currentPage:'',//当前页数
         }
@@ -166,6 +166,7 @@ export default {
         getRecordList(page,size = 10){
             Loading.service({text:'拼命加载中',background:'rgba(0, 0, 0, 0.8)'});
             let str ="historyinfo" + "customer-service" + "history" + "service";
+            
             this.$http.get(this.$ports.history.historyInfo,{
             params:{
                 servicelog_id:this.uid,

+ 3 - 2
service_exe/src/renderer/components/leftNav.vue

@@ -32,7 +32,7 @@
 				megnum: 0,
 				showMeg: false,
 				logo: '',
-				img_http: 'https://manage.281570.com',//图片路径域
+				img_http: window.url_https_ajax,//图片路径域
 				titleActive: "TheCurrentSession",
 				data: [
 					{
@@ -101,6 +101,7 @@
 			}
 		},
 		mounted() {
+        	// this.img_http = window.url_https_ajax;
 			this.titleActive = this.$store.getters.get_navState;
 			this.logo = sessionStorage.getItem('logo');
 			this.showMeg = this.$store.getters.get_meg;
@@ -143,4 +144,4 @@
 	.nav p {
 		cursor: pointer;
 	}
-</style>
+</style>

+ 4 - 2
service_exe/src/renderer/components/messageCenter.vue

@@ -1,4 +1,4 @@
-<template>
+   <template>
 	<!-- 消息中心 -->
 	<el-drawer
 			:close-on-press-escape="true"
@@ -141,6 +141,7 @@
 			},
 			// 已读信息
 			readnotice(){
+			
 				let str = "readnotice" + "customer-service" + "index" + this.time + "service";
 				let obj = {
 					headers: {
@@ -177,6 +178,7 @@
 					user_id: this.userID
 				},obj).then(res => {
 					// console.log(res)
+					this.unreadListOne = {}
 					if(res.data.code === 1){
 						// console.log("未读",res.data.data);
 						this.unreadList = res.data.data;
@@ -351,4 +353,4 @@
 		margin-bottom: 0 !important;
 	}
 
-</style>
+</style>

+ 14 - 8
service_exe/src/renderer/css/index.css

@@ -2,18 +2,24 @@
 * {
   padding: 0;
   margin: 0;
-  -o-user-select: none;
-  -moz-user-select: none;
+  /* -o-user-select: none;
+  -moz-user-select: none; */
   /*火狐 firefox*/
-  -webkit-user-select: none;
+  /* -webkit-user-select: none; */
   /*webkit浏览器*/
-  -ms-user-select: none;
+  /* -ms-user-select: none; */
   /*IE10+*/
-  -khtml-user-select: none;
+  /* -khtml-user-select: none; */
   /*早期的浏览器*/
-  user-select: none;
+  /* user-select: none; */
   /*  */
-  box-sizing: border-box;
+  box-sizing: border-box; 
+
+
+  /* -webkit-user-select:none;
+	-moz-user-select:none;
+	-o-user-select:none;
+	user-select:none;*/
 }
 body,img{
   padding: 0;
@@ -284,4 +290,4 @@ body {
 }
 #huihua .el-drawer__header{
   padding: 25px 20px !important;
-}
+}

+ 13 - 15
service_exe/src/renderer/pages/FastReply.vue

@@ -38,7 +38,7 @@
 
 							<!-- 私有库列表 -->
 							<div class="list row" v-for="(item) in ReplyArr" :key="item.id">
-								<div style="width:100%;" class="row item-center allAlignment">
+								<div  class="row item-center allAlignment">
 									<div class="row">
 										<span class="ellipsis"
 											  style="display:block;max-width:100px;">#{{item.title}}</span>
@@ -48,8 +48,7 @@
 										>{{item.content}}</span>
 									</div>
 									<div class="fnc">
-										<i class="el-icon-edit-outline hover" style="margin-right:15px;"
-										   @click="popUpChange(item)"></i>
+										<i class="el-icon-edit-outline hover" @click="popUpChange(item)"></i>
 										<i class="el-icon-delete hover" @click="clickDel(item.id)"></i>
 									</div>
 								</div>
@@ -94,14 +93,13 @@
 											</div>
 										</el-checkbox>
 
-										<el-checkbox name="type" :label="item.id" v-for="(item,index) in ReplyArr"
-													 :key="index">
+										<el-checkbox name="type" :label="item.id" v-for="(item,index) in ReplyArr" :key="index">
 											<div class="row" style="width:100%;height:100%;">
-												<div style="color:#666;color:#666;width:100%; position: relative;">
+												<div class="row" style="color:#666;color: position: relative;">
 													<!-- style="width:50px;" -->
-													<p class="ellipsis">{{item.title}}</p>
-													<p class="row item-center ellipsis addContent"
-													>{{item.content}}</p>
+													<span  style="display:block;max-width:100px; " class="ellipsis">{{item.title}}</span>
+													<span  style="margin-left: 20px; display:block;max-width:400px;" class="ellipsis "
+													>{{item.content}}</span>
 												</div>
 											</div>
 										</el-checkbox>
@@ -650,7 +648,7 @@
 	}
 
 	.el-checkbox__label {
-		padding-left: 50px;
+		padding-left: 40px;
 		display: block;
 		width: 100%;
 	}
@@ -666,13 +664,13 @@
 	.addContent {
 		color: #666;
 		font-size: 14px;
-		position: absolute;
-		left: 16%;
+		/* position: absolute;
+		left: 20%;
 		top: 0;
-		width: 70%;
+		width: 60%;
 		overflow: hidden;
 		text-overflow: ellipsis;
-		white-space: nowrap;
+		white-space: nowrap; */
 	}
 
 	.popUp {
@@ -818,4 +816,4 @@
 
 		color: #666;
 	}
-</style>
+</style>

+ 45 - 25
service_exe/src/renderer/pages/LeaveMessage.vue

@@ -31,7 +31,7 @@
 							</div>
 						</div>
 					</div>
-					<div style="margin:0 20px;">
+					<div style="margin:0 20px; height: 77vh;overflow-y: scroll;">
 						<el-table
 							:header-cell-style="{background:'#eef1f6',color:'#606266'}"
 							:row-style="{background:'#ffffff',color:'#606266'}"
@@ -118,7 +118,7 @@
 										</el-col>
 										<el-col>
 											<el-upload style="margin:10px;"
-													action="https://manage.281570.com/index/upload/uploadImg"
+													:action='uploadImg'
 													:before-upload="beforeAvatarUpload"
 													:on-change='uploadChange'
 													:on-success='uploadSuccess'
@@ -238,7 +238,7 @@
 				dialogImageUrl: '',
 				userInfo: [], //用户信息
 				getUserItem: [],
-				img_http: 'https://manage.281570.com',//图片路径域
+				img_http: window.url_https_ajax,//图片路径域
 				fileList:[],
 				imgUrl:'',
 				users:[],
@@ -246,6 +246,9 @@
 				isSendMessage:false,//是否提交
 				size:'small',//表单大小
 				isUpImg:false,//是否提交图片片
+				img_number:'',//图片数量
+				uploadImg:'',//
+
 			};
 		},
 		components: {
@@ -255,6 +258,8 @@
 			messageCenter
 		},
 		mounted() {
+			// this.img_http = window.url_https_ajax;
+			this.uploadImg = this.img_http+"/index/upload/uploadImg"
 			this.frceArr = frce.frce;
 			this.value = this.options[2].value;
 			if(typeof this.$store.getters.get_user_info  != 'string'){
@@ -303,7 +308,13 @@
 			},
 			// 上传成功时的回调
 			uploadSuccess(res, file, fileList) {
+				console.log();
+				this.img_number ++;
 				this.imgUrl = this.imgUrl ? this.imgUrl + "," + res.data.src :res.data.src;
+				if(this.fileList.length == this.img_number){
+					console.log(this.imgUrl);
+					this.sendData();
+				}
 			},
 			// 发送中
 			onProgress() {
@@ -337,7 +348,6 @@
 				}
 				this.$refs.upload.clearFiles();
 				if(!this.isUpImg){
-			
 					this.fileList.push(file)
 				}else{
 					this.fileList = fileList
@@ -346,29 +356,39 @@
 			handleExceed(files, fileList) {
 				this.$message.error(`图片上传数量最多4张`);
 			},
+
+			//提交留你数据
+			sendData(){
+				let parmas = {
+					"user_id":this.users.id,
+					"message_id":this.uid,
+					"reply_content":this.leaveInfor,
+					"images":this.imgUrl,
+				}
+				this.$http.post(this.$ports.Message.dealmessage, parmas).then(res => {
+					this.$message.success(res.data.msg);
+					this.leaveInfor = '';
+					this.drawer = false;
+					this.getSessionList(1)
+					this.$refs.upload.clearFiles();
+					this.fileList =[];
+				})
+			},
+
 			//提交留言
 			sendMessage() {
-				if(this.leaveInfor){
-					this.isUpImg = true;
-					this.$refs.upload.submit();
-	
-					this.isSendMessage  = false;
-					setTimeout(()=>{
-						let parmas = {
-							"user_id":this.users.id,
-							"message_id":this.uid,
-							"reply_content":this.leaveInfor,
-							"images":this.imgUrl,
-						}
-						this.$http.post(this.$ports.Message.dealmessage, parmas).then(res => {
-							this.$message.success(res.data.msg);
-							this.leaveInfor = '';
-							this.drawer = false;
-							this.getSessionList(1)
-							this.$refs.upload.clearFiles();
-							this.fileList =[];
-						})
-					},1500)
+				if(this.leaveInfor && this.isSendMessage){
+					if(this.fileList.length <1){
+						this.sendData();
+					}else{
+						this.isUpImg = true;
+						this.$refs.upload.submit();
+						this.img_number = 0;
+						this.isSendMessage  = false;
+					}
+					// setTimeout(()=>{
+			
+					// },1500)
 				}else{
 					this.$message.error(`请输入留言信息`);
 				}

+ 3 - 8
service_exe/src/renderer/pages/SessionHistory.vue

@@ -22,7 +22,7 @@
 							</el-select>
 							<div style="font-size: 0;padding-right: 20px;">
 								<el-input
-										placeholder="请输入访客名称"
+										placeholder="请输入账号"
 										size="mini"
 										v-model="input3"
 										class="input-with-select"
@@ -32,7 +32,7 @@
 							</div>
 						</div>
 					</div>
-					<div style="margin:0 20px;">
+					<div style="margin:0 20px; height: 77vh;overflow-y: scroll;">
 						<el-table
 								v-loading="loading"
 								element-loading-text="拼命加载中"
@@ -295,11 +295,6 @@
 	.el-table::before {
 		z-index: 0 !important;
 	}
-
-	/* .el-table td{
-			padding: 12px 0;
-		} */
-
 	.input-with-select {
 		width: 100%;
 	}
@@ -324,4 +319,4 @@
 			  background: red; */
 		/* //background: rgba(255, 255, 255, 0.315); */
 	}
-</style>
+</style>

+ 47 - 11
service_exe/src/renderer/pages/TheCurrentSession.vue

@@ -210,7 +210,7 @@
 							 v-for="item in FastReply.sysWords" :key="item.id" v-if="FastReplySwitch == 'one'">
 							<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>
+								<span class="title_span ellipsis" style=" width: 100%">#{{item.title}}</span>
 							</el-tooltip>
 
 							<!-- <div class="ellipsis" style=" width: 70%">
@@ -225,7 +225,7 @@
 							 v-for="item in FastReply.userWords" :key="item.id" v-if="FastReplySwitch == 'tow'">
 							<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>
+								<span class="title_span ellipsis" style=" width: 100%">#{{item.title}}</span>
 							</el-tooltip>
 							<!-- <div class="ellipsis" style=" width: 70%">
 
@@ -256,7 +256,6 @@
 						<p>来源终端:{{terminal_IP.system}}</p>
 						<p>来源地区:{{terminal_IP.source}}</p>
 					</div>
-
 					<div style="color:#666;font-weight:bold;font-size:14px; margin-top:30px;">用户信息</div>
 					<div id="user_info_box" style="margin-top:10px;color:#999;font-size:14px;" class="userData wrap">
 						<div class="user_info_box">
@@ -355,8 +354,7 @@
 				lineUp: [],//排队列表
 				conversationId: '',//会话工单
 				session_user_info: {},//当前会话用户信息
-				img_http: 'https://manage.281570.com',//图片路径域
-				// img_http: 'http://192.168.2.187:8090',//图片路径域
+				img_http: window.url_https_ajax,//图片路径域
 				fit: 'scale-down',//图片渲染样式
 				is_eva_btn: true,//
 				trigger_condition: 0,//评价触发条件
@@ -537,6 +535,21 @@
 			/*********************图片发送*********************/
 			uploadIMG(e) {
 				//console.log(e);
+				if (this.sessionType == 2) {
+					this.$message({
+						message: '只能给在线用户发送消息哦...',
+						type: 'warning'
+					});
+					return false;
+				}else if(this.sessionType == 1 && this.sessionList.length <= 0){
+					this.$message({
+						message: '只能给在线用户发送消息哦...',
+						type: 'warning'
+					});
+					return false;
+				}
+
+
 				let self = this;
 				let files = e.target.files || e.dataTransfer.files;
 				if (!files.length) return;
@@ -570,6 +583,12 @@
 			upImg(formData) {
 				let self = this;
 				// 数据结构请求
+				let loading = this.$loading({
+					lock: true,
+					text: '图片发送中...',
+					spinner: 'el-icon-loading',
+					background:'rgba(0, 0, 0, 0.8)',
+				});
 				self.$http.uploadPost('/index/upload/uploadImg', formData).then(res => {
 					//console.log(res.data.data.src)
 
@@ -610,8 +629,7 @@
 							sensitiveNumber: 0,//敏感词次数
 						}
 						self.websocketsend(JSON.stringify({type, data}))
-
-
+						loading.close()
 					}
 				})
 			},
@@ -656,7 +674,6 @@
 			},
 			getPlatformCN(name){
 				let platforms={'android':'安卓','ios':'苹果','pc':'电脑'};
-				
 				return platforms[name];
 			},
 
@@ -938,10 +955,12 @@
 							if(this.session_user_info.nick_name){
 								if(this.sessionList[index]){
 									this.sessionList[index].name = this.session_user_info.nick_name;
+								}else{
+									
 								}
-
 							}
 							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){
@@ -1108,6 +1127,19 @@
 
 			/**********************qq截图粘贴---发送截图*****************/
 			handleClose(done) {
+				if (this.sessionType == 2) {
+					this.$message({
+						message: '只能给在线用户发送消息哦...',
+						type: 'warning'
+					});
+					return false;
+				}else if(this.sessionType == 1 && this.sessionList.length <= 0){
+					this.$message({
+						message: '只能给在线用户发送消息哦...',
+						type: 'warning'
+					});
+					return false;
+				}
 				this.dialogPaste = false;
 				let blob = this.$public.dataURItoBlob(this.pasteUrl)
 				let self = this;
@@ -1159,6 +1191,8 @@
 					// 释放内存
 					clipboard.destroy()
 				})
+				
+				
 			},
 
 			/****************访问信息和评价状态***************/
@@ -1195,6 +1229,7 @@
 							}
 						} else {
 							this.terminal_IP = {}
+
 						}
 					}
 				} else if (this.sessionType == 2) {
@@ -1297,6 +1332,8 @@
 		 * 挂载前执行
 		 */
 		mounted() {
+			// console.log('来了',window.url_https_ajax);
+			// this.img_http = window.url_https_ajax;
 			//获取vuex里面数据
 			this.get_vuex_info();
 			let _this = this;
@@ -1332,7 +1369,6 @@
 			get_session_message(e) {
 				this.chatMessage(e)
 			},
-
 			// sessionList(e) {
 			// 	this.accessTerminal(e)
 			// },
@@ -1819,4 +1855,4 @@
 		text-align: center;
 		margin-top: 5px;
 	}
-</style>
+</style>

+ 4 - 2
service_exe/src/renderer/pages/login.vue

@@ -71,7 +71,7 @@ export default {
       logo: "",
       verifySystem: "",
       verifySystemId: "",
-      img_http: "https://manage.281570.com" //图片路径域
+      img_http:  window.url_https_ajax //图片路径域
     };
   },
   methods: {
@@ -173,6 +173,7 @@ export default {
     }
   },
   mounted() {
+		// this.img_http = window.url_https_ajax;
     // 判断验证码参数
     let SystemId = this.$public.getQueryString("id");
     let System = this.$public.getQueryString("code");
@@ -191,6 +192,7 @@ export default {
       
     }
     this.$comm.checkValidCodeEnabled((data)=> {
+   
       if (data == 0) {
         this.showSecurityCode = false;
       } else {
@@ -294,4 +296,4 @@ p {
 .btn:active {
   background: #1d57dd;
 }
-</style>
+</style>

+ 2 - 0
service_exe/src/url_config.js

@@ -0,0 +1,2 @@
+var url_https_ajax = 'https://manage.281570.com';
+var url_https_wss= 'link.281570.com';