|
@@ -466,6 +466,23 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ formatterResponseTimeToExcel(params) {
|
|
|
+ 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) {
|
|
|
+ responseTime = params.data.action_accept - params.data.action_start
|
|
|
+ return this.formateSeconds(responseTime)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ responseTime = params.data.action_end - params.data.action_start
|
|
|
+ return this.formateSeconds(responseTime)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
formateSeconds(endTime){
|
|
|
if (endTime === 0) {
|
|
|
return this.$t('action.oneSecond')
|
|
@@ -550,9 +567,10 @@ export default {
|
|
|
API_interaction.getList(params).then(res => {
|
|
|
_this.loading = false
|
|
|
import('@/vendor/Export2Excel').then(excel => {
|
|
|
- const tHeader = [this.$t('interaction.fromMemberName'), this.$t('interaction.toMemberName'), this.$t('interaction.actionType'), this.$t('interaction.actionEnd'), this.$t('interaction.data'),
|
|
|
+ const tHeader = [this.$t('interaction.fromMemberName'), this.$t('interaction.toMemberName'), this.$t('interaction.actionType'),
|
|
|
+ this.$t('interaction.actionEnd'), this.$t('interaction.data'), this.$t('interaction.responseTime'),
|
|
|
this.$t('interaction.createDate')] // 表头
|
|
|
- const filterVal = ['fromMemberName', 'toMemberName', 'action_type', 'action_end', 'data', 'create_date']
|
|
|
+ const filterVal = ['fromMemberName', 'toMemberName', 'action_type', 'action_end', 'data', 'responseTime', 'create_date']
|
|
|
const tit = params.start_date + this.$t('action.to') + params.end_date + this.$t('interaction.interactionRecord')
|
|
|
const data = _this.formatJson(filterVal, res.data)
|
|
|
excel.export_json_to_excel({
|
|
@@ -577,6 +595,9 @@ export default {
|
|
|
return this.formatterResult2(v[j])
|
|
|
}else if (j === 'create_date') {
|
|
|
return this.formatterDate({value: v[j]})
|
|
|
+ } else if (j === 'responseTime') {
|
|
|
+ console.log(v)
|
|
|
+ return this.formatterResponseTimeToExcel({data: v})
|
|
|
} else {
|
|
|
return v[j]
|
|
|
}
|