|
|
@@ -374,46 +374,11 @@
|
|
|
pasteUrl: '',//截屏图片
|
|
|
userSwitching: true,//是否切换完成
|
|
|
terminal_IP: {},//访客设备信息
|
|
|
-
|
|
|
showHistoryList: false,
|
|
|
historyList: [],
|
|
|
historyTime:'',
|
|
|
}
|
|
|
},
|
|
|
- // filters: {
|
|
|
- // /**
|
|
|
- // * 时间戳转日期自定义时间格式
|
|
|
- // * timeStamp:时间戳
|
|
|
- // * custom:转换日期时定义年月日用是什么符号隔开
|
|
|
- // * isDtae:0=月份、1=日期、3=时间
|
|
|
- // */
|
|
|
-
|
|
|
- // formatDate: function (value, custom = '', isDtae = 3) {
|
|
|
- // let timeStamp = value;
|
|
|
- // var date = new Date();
|
|
|
- // date.setTime(timeStamp * 1000);
|
|
|
- // var y = date.getFullYear();
|
|
|
- // var m = date.getMonth() + 1;
|
|
|
- // m = m < 10 ? ('0' + m) : m;
|
|
|
- // var d = date.getDate();
|
|
|
- // d = d < 10 ? ('0' + d) : d;
|
|
|
- // var h = date.getHours();
|
|
|
- // h = h < 10 ? ('0' + h) : h;
|
|
|
- // var minute = date.getMinutes();
|
|
|
- // var second = date.getSeconds();
|
|
|
- // minute = minute < 10 ? ('0' + minute) : minute;
|
|
|
- // second = second < 10 ? ('0' + second) : second;
|
|
|
- // if (isDtae == 0) {
|
|
|
- // return y + custom + m //+'student';
|
|
|
- // } else if (isDtae == 1) {
|
|
|
- // return y + custom + m + custom + d;
|
|
|
- // } else if (isDtae == 3) {
|
|
|
- // return h + ':' + minute;
|
|
|
- // } else {
|
|
|
- // return y + '-' + m + '-' + d + ' ' + h + ':' + minute //+ ':' + second;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // },
|
|
|
methods: {
|
|
|
/****************************/
|
|
|
validation_user_info(type) {
|
|
|
@@ -443,7 +408,6 @@
|
|
|
this.dialogVisible = true;
|
|
|
},
|
|
|
|
|
|
-
|
|
|
/************回车提交************/
|
|
|
listenEnter(event) {
|
|
|
if (event.keyCode === 13) {
|
|
|
@@ -476,14 +440,14 @@
|
|
|
|
|
|
//用户离线后会话窗口切换
|
|
|
if (redata.message_type == "userClose") {
|
|
|
- console.log(redata)
|
|
|
+ // console.log(redata)
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
// //用户会话结束窗口切换
|
|
|
if (redata.message_type == "delUser") {
|
|
|
redata.data;
|
|
|
- console.log(redata.data, this.session_user_info)
|
|
|
+ // console.log(redata.data, this.session_user_info)
|
|
|
if (redata.data.id == this.session_user_info.id) {
|
|
|
this.session_user_info = {};
|
|
|
this.value = '请选择';
|
|
|
@@ -685,7 +649,6 @@
|
|
|
|
|
|
/*****************切换用户会话对象******************/
|
|
|
chooseDialogue(type, index) {
|
|
|
- //console.log(this.sessionList);
|
|
|
if (this.userSwitching) {
|
|
|
let data = [];
|
|
|
let order_id = '';
|
|
|
@@ -695,13 +658,21 @@
|
|
|
data = this.sessionList[index].data;
|
|
|
order_id = this.sessionList[index].id;
|
|
|
this.$set(this.sessionList[index], 'num', 0);
|
|
|
+ this.terminal_IP = {
|
|
|
+ system: this.sessionList[index].system + '-' + this.sessionList[index].browse,
|
|
|
+ ip: this.sessionList[index].ip
|
|
|
+ }
|
|
|
} else if (type == 2) {
|
|
|
data = this.offlineList[index].data;
|
|
|
order_id = this.offlineList[index].id;
|
|
|
+ this.terminal_IP = {
|
|
|
+ system: this.offlineList[index].system + '-' + this.offlineList[index].browse,
|
|
|
+ ip: this.offlineList[index].ip
|
|
|
+ }
|
|
|
}
|
|
|
this.$store.dispatch("SET_CURRENT", data);//当前会话数据
|
|
|
this.userSwitching = false;
|
|
|
- this.get_user(order_id,type,index)
|
|
|
+ this.get_user(order_id,type,index);
|
|
|
} else {
|
|
|
// this.$message({
|
|
|
// message: '警告!,操作太频繁',
|
|
|
@@ -777,6 +748,8 @@
|
|
|
|
|
|
/*********************发送消息*********************/
|
|
|
sendMessage() {
|
|
|
+ console.log(this.sessionList);
|
|
|
+
|
|
|
if (!this.inputValue) return;
|
|
|
if (this.sessionType == 2) {
|
|
|
this.$message({
|
|
|
@@ -911,6 +884,7 @@
|
|
|
|
|
|
/*****************获取当前聊天用户信息****************/
|
|
|
get_user(id,type,index) {
|
|
|
+ // console.log(id,type,index)
|
|
|
let obj = {
|
|
|
headers: {
|
|
|
"apiToken": this.$md5('accountInfo' + "customer-service" + 'service' + 'service'),
|
|
|
@@ -925,12 +899,16 @@
|
|
|
if(this.session_user_info.nick_name){
|
|
|
this.$store.dispatch("SET_SESSION_NAME", this.session_user_info.nick_name);
|
|
|
}
|
|
|
- if(type ==1){
|
|
|
- this.sessionList[index].name = this.session_user_info.nick_name
|
|
|
- this.$store.dispatch("SET_SESSION",this.sessionList)
|
|
|
+ if(type == 1){
|
|
|
+ if(this.session_user_info.nick_name){
|
|
|
+ this.sessionList[index].name = this.session_user_info.nick_name;
|
|
|
+ }
|
|
|
+ this.$store.dispatch("SET_SESSION",this.sessionList);
|
|
|
}else if(type == 2){
|
|
|
- this.offlineList[index].name = this.session_user_info.nick_name
|
|
|
- this.$store.dispatch("SET_SESSION", this.offlineList);
|
|
|
+ if(this.session_user_info.nick_name){
|
|
|
+ this.offlineList[index].name = this.session_user_info.nick_name;
|
|
|
+ }
|
|
|
+ //this.$store.dispatch("SET_SESSION", this.offlineList);
|
|
|
}
|
|
|
}
|
|
|
this.userSwitching = true;
|
|
|
@@ -983,9 +961,14 @@
|
|
|
|
|
|
/********************获取vuex数据***********************/
|
|
|
get_vuex_info() {
|
|
|
- let getters = this.$store.getters
|
|
|
- this.token = getters.get_user_info.token;//token
|
|
|
- this.user_info = getters.get_user_info;//用户消息
|
|
|
+ let getters = this.$store.getters;
|
|
|
+ if(typeof getters.get_user_info != 'string' ){
|
|
|
+ this.user_info = getters.get_user_info;//用户消息
|
|
|
+ }else{
|
|
|
+ // console.log('vule',JSON.parse(getters.get_user_info));
|
|
|
+ this.user_info = JSON.parse(getters.get_user_info);
|
|
|
+ }
|
|
|
+ this.token = this.user_info.token;//token
|
|
|
this.time = JSON.parse(sessionStorage.getItem("time"));
|
|
|
},
|
|
|
|
|
|
@@ -1135,11 +1118,6 @@
|
|
|
}
|
|
|
} else if (this.sessionType == 2) {
|
|
|
let List = this.offlineList[this.dataIndex];
|
|
|
- // if(data == 'eva'){
|
|
|
- // if (this.data.length > this.trigger_condition){
|
|
|
- // List.isEva = 100;
|
|
|
- // }
|
|
|
- // }else{
|
|
|
if (List) {
|
|
|
this.terminal_IP = {
|
|
|
system: List.system + '-' + List.browse,
|
|
|
@@ -1151,7 +1129,6 @@
|
|
|
// }
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
/**
|
|
|
* 挂载前执行
|
|
|
@@ -1162,21 +1139,6 @@
|
|
|
let _this = this;
|
|
|
this.get_config_info();
|
|
|
|
|
|
- //客服人员登陆会话
|
|
|
- if (this.$store.getters.get_is_init) {
|
|
|
- // this.$websocket.onmessage = this.;
|
|
|
- _this.websocketsend(JSON.stringify({
|
|
|
- type: 'init',
|
|
|
- data: {
|
|
|
- uid: 'KF' + _this.user_info.id,
|
|
|
- group: _this.user_info.group_id,
|
|
|
- token: this.token,
|
|
|
- name: _this.user_info.user_name,
|
|
|
- avatar: _this.user_info.user_avatar,
|
|
|
- }
|
|
|
- }));
|
|
|
- this.$store.dispatch("SET_IS_INIT", false);
|
|
|
- }
|
|
|
//获取客服快捷语
|
|
|
this.quickReplyInfo();
|
|
|
//获取敏感词
|