|
|
@@ -32,7 +32,7 @@
|
|
|
<template slot="title">
|
|
|
<span>已离线<span>({{offlineList.length }})</span></span>
|
|
|
</template>
|
|
|
- <div :class="{session_choose:dataIndex ==index && sessionType ==2}"
|
|
|
+ <div :class="{session_choose:dataIndex == index && sessionType ==2}"
|
|
|
class="user session_style" @click="chooseDialogue(2,index)"
|
|
|
v-for="(item,index) in offlineList">
|
|
|
<div class="row allAlignment item-center">
|
|
|
@@ -240,8 +240,8 @@
|
|
|
<div style="color:#666;font-weight:bold;font-size:14px;">访问信息</div>
|
|
|
<div style="margin-top:10px;color:#999;font-size:14px;" class="userData wrap">
|
|
|
<!-- <p>来源:{{session_user_info.website}}</p> -->
|
|
|
- <p @dblclick="get_ip_Info" class="get_ip" :data-clipboard-text="session_user_info.ip" >IP地址:{{session_user_info.ip}}</p>
|
|
|
- <p>来源终端:{{session_user_info.system}}-{{session_user_info.browse}}</p>
|
|
|
+ <p @dblclick="get_ip_Info" class="get_ip" :data-clipboard-text="terminal_IP.ip" >IP地址:{{terminal_IP.ip}}</p>
|
|
|
+ <p>来源终端:{{terminal_IP.system}}</p>
|
|
|
</div>
|
|
|
|
|
|
<div style="color:#666;font-weight:bold;font-size:14px; margin-top:30px;">用户信息</div>
|
|
|
@@ -330,20 +330,14 @@
|
|
|
inputValue: "", //输入框内容
|
|
|
isFrce: false, //表情包开关
|
|
|
frceArr: [], //表情包数组
|
|
|
- // data: [], //当前对话数据
|
|
|
- // dataIndex:0,//定位当前会话,默认是0
|
|
|
FastReply: "", //快捷回复
|
|
|
FastReplySwitch: "one", //快捷回复开关
|
|
|
user_info: '',//用户信息
|
|
|
token: "",
|
|
|
time: "",
|
|
|
- // sessionList: [],//会话列表
|
|
|
- // offlineList: [],//离线列表
|
|
|
transferList: [],//转接列表
|
|
|
- // sessionType:1,//选择列表状态默认未1(1是会话中,2是离线)
|
|
|
lineUp: [],//排队列表
|
|
|
conversationId: '',//会话工单
|
|
|
- // sessionName:'',//当前会话用户名字
|
|
|
session_user_info: {},//当前会话用户信息
|
|
|
img_http:'http://kfadmin.bocai186.com',//图片路径域
|
|
|
// img_http: 'http://192.168.2.187:8090',//图片路径域
|
|
|
@@ -364,7 +358,8 @@
|
|
|
dialogImageUrl: '', // 放大的图片
|
|
|
dialogUrl: false,
|
|
|
pasteUrl:'',//截屏图片
|
|
|
- // fit:'contain',//
|
|
|
+ userSwitching:true,//是否切换完成
|
|
|
+ terminal_IP:{},//访客设备信息
|
|
|
}
|
|
|
},
|
|
|
/**
|
|
|
@@ -408,47 +403,17 @@
|
|
|
//用户离线后会话窗口切换
|
|
|
if (redata.message_type == "userClose") {
|
|
|
console.log(redata)
|
|
|
- // let _this = this;
|
|
|
- // let arr = [
|
|
|
- // redata.data,
|
|
|
- // this.sessionList,
|
|
|
- // this.offlineList,
|
|
|
- // this.sessionType,
|
|
|
- // this.dataIndex,
|
|
|
- // this.sessionName,
|
|
|
- // this.data
|
|
|
- // ]
|
|
|
- // _this.$public.userOffline(arr, function (session, offline, type, index, name, list, userInfo) {
|
|
|
- // this.$store.dispatch("SET_CURRENT", list);//当前会话数据
|
|
|
- // _this.$store.dispatch("SET_NUM", index);
|
|
|
- // _this.$store.dispatch("SET_TYPE", type);
|
|
|
- // _this.$store.dispatch("SET_SESSION", session);
|
|
|
- // _this.$store.dispatch("SET_OFFLINE", offline);
|
|
|
- // _this.get_user_info(userInfo);
|
|
|
- // })
|
|
|
}
|
|
|
|
|
|
// //用户会话结束窗口切换
|
|
|
- // if (redata.message_type == "delUser") {
|
|
|
- // let _this = this;
|
|
|
- // let arr = [
|
|
|
- // redata.data,
|
|
|
- // this.sessionList,
|
|
|
- // this.offlineList,
|
|
|
- // this.sessionType,
|
|
|
- // this.dataIndex,
|
|
|
- // this.sessionName,
|
|
|
- // this.data
|
|
|
- // ]
|
|
|
- // _this.$public.sessionEnd(arr, function (session, offline, type, index, name, list, userInfo) {
|
|
|
- // _this.$store.dispatch("SET_CURRENT", list);//当前会话数据
|
|
|
- // _this.$store.dispatch("SET_NUM", index);
|
|
|
- // _this.$store.dispatch("SET_TYPE", type);
|
|
|
- // _this.$store.dispatch("SET_SESSION", session);
|
|
|
- // _this.$store.dispatch("SET_OFFLINE", offline);
|
|
|
- // _this.get_user_info(userInfo);
|
|
|
- // })
|
|
|
- // }
|
|
|
+ if (redata.message_type == "delUser") {
|
|
|
+ redata.data ;
|
|
|
+ console.log(redata.data,this.session_user_info)
|
|
|
+ if(redata.data.id == this.session_user_info.id){
|
|
|
+ this.session_user_info={};
|
|
|
+ this.value = '请选择';
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
//获取标签数据信息
|
|
|
@@ -456,7 +421,7 @@
|
|
|
if (Object.values(redata.data).length > 0) {
|
|
|
this.options = [];
|
|
|
this.options = Object.values(redata.data);
|
|
|
- this.value = this.options[0].name;
|
|
|
+ // this.value = this.options[0].name;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -615,23 +580,31 @@
|
|
|
|
|
|
/*****************切换用户会话对象******************/
|
|
|
chooseDialogue(type, index) {
|
|
|
- let data = [];
|
|
|
- this.$store.dispatch("SET_TYPE", type);
|
|
|
- this.$store.dispatch("SET_NUM", index);
|
|
|
- if (type == 1) {
|
|
|
- data = this.sessionList[index].data;
|
|
|
- this.session_user_info = this.sessionList[index];
|
|
|
- this.$set(this.sessionList[index], 'num', 0);
|
|
|
- this.$store.dispatch("SET_SESSION_NAME", this.sessionList[index].name);
|
|
|
- } else if (type == 2) {
|
|
|
- data = this.offlineList[index].data;
|
|
|
- this.$store.dispatch("SET_SESSION_NAME", this.offlineList[index].name);
|
|
|
- this.session_user_info = this.offlineList[index];
|
|
|
+ console.log(this.sessionList);
|
|
|
+ if(this.userSwitching){
|
|
|
+ let data = [];
|
|
|
+ let order_id = '';
|
|
|
+ this.$store.dispatch("SET_TYPE", type);
|
|
|
+ this.$store.dispatch("SET_NUM", index);
|
|
|
+ if (type == 1) {
|
|
|
+ data = this.sessionList[index].data;
|
|
|
+ order_id = this.sessionList[index].id;
|
|
|
+ this.$set(this.sessionList[index], 'num', 0);
|
|
|
+ this.$store.dispatch("SET_SESSION_NAME", this.sessionList[index].name);
|
|
|
+ } else if (type == 2) {
|
|
|
+ data = this.offlineList[index].data;
|
|
|
+ this.$store.dispatch("SET_SESSION_NAME", this.offlineList[index].name);
|
|
|
+ order_id = this.offlineList[index].id;
|
|
|
+ }
|
|
|
+ this.$store.dispatch("SET_CURRENT", data);//当前会话数据
|
|
|
+ this.userSwitching =false;
|
|
|
+ this.get_user(order_id)
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message: '警告!,操作太频繁',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
}
|
|
|
- this.$store.dispatch("SET_CURRENT", data);//当前会话数据
|
|
|
-
|
|
|
- // this.value = this.session_user_info.label;
|
|
|
- //console.log(this.session_user_info);
|
|
|
},
|
|
|
|
|
|
/***************关闭当前和用户聊天对话***************/
|
|
|
@@ -787,6 +760,8 @@
|
|
|
conversationId: this.sessionList[this.dataIndex].conversationId,
|
|
|
to_id: this.sessionList[this.dataIndex].id,
|
|
|
}
|
|
|
+ this.sessionList[this.dataIndex].isEva =10;
|
|
|
+ this.$store.dispatch("SET_SESSION",this.sessionList);
|
|
|
this.websocketsend(JSON.stringify({type, data}));
|
|
|
this.is_eva_btn = true;
|
|
|
} else if (this.sessionType == 2) {
|
|
|
@@ -829,44 +804,24 @@
|
|
|
|
|
|
},
|
|
|
|
|
|
- // /*****************获取当前聊天用户信息****************/
|
|
|
- // get_user_info(type) {
|
|
|
- // if (type.length > 0) {
|
|
|
- // this.session_user_info = {};
|
|
|
- // if (this.dataIndex <= type.length) {
|
|
|
-
|
|
|
- // let obj = {
|
|
|
- // headers: {
|
|
|
- // "apiToken": this.$md5('accountInfo' + "customer-service" + 'service' + this.time[0] + 'service'),
|
|
|
- // 'userToken': this.token
|
|
|
- // },
|
|
|
- // account_id: type[this.dataIndex].id
|
|
|
- // };
|
|
|
-
|
|
|
- // this.post('api' + this.$ports.userInfo.accountInfo, obj).then(res => {
|
|
|
- // if (res.data.code == 1) {
|
|
|
- // // console.log(res.data.data);
|
|
|
- // this.session_user_info = res.data.data;
|
|
|
- // // console.log(this.options);
|
|
|
- // for (let i = 0; this.options.length > i; i++) {
|
|
|
- // if (this.options[i].id == res.data.data.label_id) {
|
|
|
- // this.value = this.options[i].name;
|
|
|
- // }
|
|
|
- // break;
|
|
|
- // }
|
|
|
- // //this.value = res.data.data.label_id
|
|
|
- // }
|
|
|
- // })
|
|
|
-
|
|
|
-
|
|
|
- // //this.session_user_info = type[this.dataIndex].id;
|
|
|
- // // console.log(type[this.dataIndex].id);
|
|
|
- // // this.value = this.session_user_info.label;
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // this.session_user_info = {};
|
|
|
- // }
|
|
|
- // },
|
|
|
+ /*****************获取当前聊天用户信息****************/
|
|
|
+ get_user(id) {
|
|
|
+ let obj = {
|
|
|
+ headers: {
|
|
|
+ "apiToken": this.$md5('accountInfo' + "customer-service" + 'service' + this.time[0] + 'service'),
|
|
|
+ 'userToken': this.token
|
|
|
+ },
|
|
|
+ account_id: id
|
|
|
+ };
|
|
|
+
|
|
|
+ this.post('api' + this.$ports.userInfo.accountInfo, obj).then(res => {
|
|
|
+ if (res.data.code == 1) {
|
|
|
+ this.session_user_info = res.data.data;
|
|
|
+ this.value = res.data.data.label
|
|
|
+ this.userSwitching = true;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
/********************获取配置信息********************/
|
|
|
get_config_info() {
|
|
|
@@ -1033,7 +988,55 @@
|
|
|
// 释放内存
|
|
|
clipboard.destroy()
|
|
|
})
|
|
|
+ },
|
|
|
+ /****************访问信息和评价状态***************/
|
|
|
+ accessTerminal(data){
|
|
|
+ if(this.sessionType == 1){
|
|
|
+ let List = this.sessionList[this.dataIndex];
|
|
|
+ if(data == 'eva'){
|
|
|
+ if(!List) return false
|
|
|
+ console.log(List);
|
|
|
+ if(List.isEva == 10 ){
|
|
|
+ this.is_eva_btn = true;
|
|
|
+ }else if(List.isEva != 10){
|
|
|
+ if (this.data.length > this.trigger_condition){
|
|
|
+ List.isEva = 100;
|
|
|
+ this.is_eva_btn = false;
|
|
|
+ }else{
|
|
|
+ this.is_eva_btn = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.sessionList[this.dataIndex] = List
|
|
|
+ this.$store.dispatch("SET_SESSION",this.sessionList)
|
|
|
+ }else{
|
|
|
+ if(List){
|
|
|
+ this.terminal_IP = {
|
|
|
+ system:List.system+'-'+List.browse,
|
|
|
+ ip:List.ip
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.terminal_IP ={}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }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,
|
|
|
+ ip:List.ip
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.terminal_IP ={}
|
|
|
+ }
|
|
|
+ // }
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
},
|
|
|
/**
|
|
|
* 挂载前执行
|
|
|
@@ -1067,6 +1070,15 @@
|
|
|
this.frceArr = this.$frce;
|
|
|
//调用截图粘贴捆绑方法
|
|
|
this.paste();
|
|
|
+ //
|
|
|
+ this.accessTerminal();
|
|
|
+
|
|
|
+ //
|
|
|
+ if(this.sessionList.length > 0){
|
|
|
+ if(this.sessionList[this.dataIndex].isEva == 100 && this.sessionList[this.dataIndex]){
|
|
|
+ this.is_eva_btn = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
},
|
|
|
beforeDestroy(){
|
|
|
@@ -1081,33 +1093,18 @@
|
|
|
this.chatMessage(e)
|
|
|
},
|
|
|
|
|
|
- get_session_user(e){
|
|
|
- console.log(e)
|
|
|
+ sessionList(e){
|
|
|
+ this.accessTerminal(e)
|
|
|
+ },
|
|
|
+ offlineList(e){
|
|
|
+ this.accessTerminal(e)
|
|
|
},
|
|
|
|
|
|
/*****************评价按钮显示隐藏处理*****************/
|
|
|
get_is_eva_btn(data) {
|
|
|
- if (this.sessionType != 2) {
|
|
|
- if (this.data.length > this.trigger_condition) {
|
|
|
- if (!this.data[this.dataIndex].isEva) {
|
|
|
- // this.is_eva_btn = true;
|
|
|
- // }else{
|
|
|
- this.data[this.dataIndex].isEva = true;
|
|
|
- this.is_eva_btn = false;
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.is_eva_btn = true;
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.is_eva_btn = true;
|
|
|
- }
|
|
|
+ this.accessTerminal('eva')
|
|
|
}
|
|
|
},
|
|
|
- // _this.$store.dispatch("SET_SESSION", list);
|
|
|
- // _this.$store.dispatch("SET_OFFLINE", offline);
|
|
|
- // _this.$store.dispatch("SET_TYPE", type);//选择类型(会话/离线)
|
|
|
- // _this.$store.dispatch("SET_NUM", num);//列表下标
|
|
|
- // _this.$store.dispatch("SET_CURRENT", dataList);//当前会话数
|
|
|
/**
|
|
|
* 计算属性
|
|
|
*/
|
|
|
@@ -1120,6 +1117,7 @@
|
|
|
dataIndex:'get_num',
|
|
|
sessionType:'get_type',
|
|
|
get_user_info:'get_session_user',
|
|
|
+ // is_eva_btn:'get_is_eva_btn',
|
|
|
}),
|
|
|
|
|
|
get_session_message() {
|