Explorar o código

Merge branch 'languages/1.3.7-es' into languages/1.3.7-ru

# Conflicts:
#	src/router/index.js
vothin %!s(int64=2) %!d(string=hai) anos
pai
achega
0202f8bf43
Modificáronse 2 ficheiros con 24 adicións e 3 borrados
  1. 1 1
      src/router/index.js
  2. 23 2
      src/views/ncs-interaction/index.vue

+ 1 - 1
src/router/index.js

@@ -224,7 +224,7 @@ export const partRoutes = [
         name: 'user_watch',
         meta: { title: i18n.t('tab.userLocationManage'), icon: 'el-icon-watch', noCache: true }
       }
-    ],
+    ]
   },
   {
     path: '/ncs-sos-device',

+ 23 - 2
src/views/ncs-interaction/index.vue

@@ -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]
         }