|
@@ -251,6 +251,7 @@ export default {
|
|
|
width: 120
|
|
|
},
|
|
|
{ headerName: this.$t('interaction.createDate'), field: 'create_date', sortable: true, valueFormatter: this.formatterDate, width: 150 },
|
|
|
+ { headerName: this.$t('interaction.responseTime'), sortable: true, valueFormatter: this.formatterResponseTime, width: 150 },
|
|
|
{ headerName: this.$t('interaction.fromDevice'), field: 'from_device_type', sortable: true, valueFormatter: this.formatterDeviceType, width: 120 },
|
|
|
{ headerName: this.$t('interaction.toDevice'), field: 'to_device_type', sortable: true, valueFormatter: this.formatterDeviceType, width: 120 },
|
|
|
]
|
|
@@ -443,6 +444,51 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ formatterResponseTime(params) {
|
|
|
+ console.log(params.data)
|
|
|
+ let responseTime = 0;
|
|
|
+ if (params.data.action_end !== null) {
|
|
|
+ if (params.data.action_type === TCP_TYPE.VOICE ||
|
|
|
+ params.data.action_type === TCP_TYPE.VIDEO ||
|
|
|
+ params.data.action_type === TCP_TYPE.PHONE
|
|
|
+ ) {
|
|
|
+ if (params.data.action_start !== null && params.data.action_accept !== null) {
|
|
|
+ console.log("params.data.action_accept : " + params.data.action_accept)
|
|
|
+ console.log("params.data.action_start : " + params.data.action_start)
|
|
|
+ responseTime = params.data.action_accept - params.data.action_start
|
|
|
+ return this.formateSeconds(responseTime)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ console.log("params.data.action_end : " + params.data.action_end)
|
|
|
+ console.log("params.data.action_start : " + params.data.action_start)
|
|
|
+ responseTime = params.data.action_end - params.data.action_start
|
|
|
+ return this.formateSeconds(responseTime)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ formateSeconds(endTime){
|
|
|
+ if (endTime === 0) {
|
|
|
+ return this.$t('action.oneSecond')
|
|
|
+ } else if (endTime === -1) {
|
|
|
+ return this.$t('action.null')
|
|
|
+ }
|
|
|
+ let secondTime = endTime//将传入的秒的值转化为Number
|
|
|
+ let min = 0// 初始化分
|
|
|
+ let h =0// 初始化小时
|
|
|
+ if(secondTime>60){//如果秒数大于60,将秒数转换成整数
|
|
|
+ min=parseInt(secondTime/60)//获取分钟,除以60取整数,得到整数分钟
|
|
|
+ secondTime=parseInt(secondTime%60)//获取秒数,秒数取佘,得到整数秒数
|
|
|
+ if(min>60){//如果分钟大于60,将分钟转换成小时
|
|
|
+ h=parseInt(min/60)//获取小时,获取分钟除以60,得到整数小时
|
|
|
+ min=parseInt(min%60) //获取小时后取佘的分,获取分钟除以60取佘的分
|
|
|
+ return h + this.$t('action.time2') + min + this.$t('action.minute2') + secondTime + this.$t('action.second')
|
|
|
+ } else {
|
|
|
+ return min +this.$t('action.minute2') + secondTime + this.$t('action.second')
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return secondTime + this.$t('action.second')
|
|
|
+ }
|
|
|
+ },
|
|
|
formatterDate(params) {
|
|
|
return unixToDate(params.value)
|
|
|
},
|