|
@@ -17,13 +17,18 @@
|
|
|
>
|
|
|
<!--工具栏-->
|
|
|
<div slot="toolbar" class="inner-toolbar">
|
|
|
-<!-- <div class="toolbar-search">-->
|
|
|
-<!-- <en-table-search :placeholder="this.$t('interaction.interactionKeywords')" @search="handlerSearch" />-->
|
|
|
-<!-- </div>-->
|
|
|
+ <div class="toolbar-search">
|
|
|
+ <en-table-search :placeholder="this.$t('interaction.interactionKeywords')" @search="handlerSearch" />
|
|
|
+ </div>
|
|
|
<div class="toolbar-search"></div>
|
|
|
<div class="toolbar-btns">
|
|
|
<el-form label-width="120px">
|
|
|
- <el-form-item :label="this.$t('action.searchDateRange')">
|
|
|
+ <el-form-item>
|
|
|
+ <el-select v-model="queryResult" style="width: 90px" @change="changeResult">
|
|
|
+ <el-option :label="this.$t('interaction.all')" value="-1"></el-option>
|
|
|
+ <el-option :label="this.$t('interaction.success')" value="1"></el-option>
|
|
|
+ <el-option :label="this.$t('interaction.notOperated')" value="2"></el-option>
|
|
|
+ </el-select>
|
|
|
<el-date-picker
|
|
|
v-model="searchDateRange"
|
|
|
type="daterange"
|
|
@@ -38,6 +43,7 @@
|
|
|
@change="dateRangeChange"
|
|
|
/>
|
|
|
<el-button type="danger" @click="batchDelete">{{ this.$t('action.delete') }}</el-button>
|
|
|
+ <el-button type="primary" @click="daochu">{{ this.$t('action.export') }}</el-button>
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
|
@@ -121,7 +127,8 @@ export default {
|
|
|
showViewer: false,
|
|
|
tcpActionTransfer: [
|
|
|
{ key: 'TCP反馈', value: 'CALLBACK' }
|
|
|
- ]
|
|
|
+ ],
|
|
|
+ queryResult: '-1'
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -253,6 +260,7 @@ export default {
|
|
|
},
|
|
|
/** 处理搜索 */
|
|
|
handlerSearch(value) {
|
|
|
+ this.params.page_no = 1
|
|
|
this.params.filerStr = value
|
|
|
this.getList()
|
|
|
},
|
|
@@ -278,7 +286,7 @@ export default {
|
|
|
delete this.params.start_date
|
|
|
delete this.params.end_date
|
|
|
}
|
|
|
-
|
|
|
+ this.params.page_no = 1
|
|
|
this.getList()
|
|
|
},
|
|
|
formatterFromName(row) {
|
|
@@ -319,6 +327,13 @@ export default {
|
|
|
return '<span style="color:red">' + this.$t('interaction.notOperated') + '</span>'
|
|
|
}
|
|
|
},
|
|
|
+ formatterResult2(param) {
|
|
|
+ if (param) {
|
|
|
+ return this.$t('interaction.success')
|
|
|
+ } else if (!param) {
|
|
|
+ return this.$t('interaction.notOperated')
|
|
|
+ }
|
|
|
+ },
|
|
|
formatterDeviceType(param) {
|
|
|
if (param.data.outerior_action) {
|
|
|
// return returnDeviceType(param.value)
|
|
@@ -371,6 +386,59 @@ export default {
|
|
|
delete this.params.dir
|
|
|
}
|
|
|
this.getList()
|
|
|
+ },
|
|
|
+ changeResult() {
|
|
|
+ this.params.query_result = this.queryResult
|
|
|
+ this.params.page_no = 1
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ daochu() {
|
|
|
+ const _this = this
|
|
|
+ this.$confirm('将导出交互信息Excel文件,是否继续?', '提示', {
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ _this.loading = true
|
|
|
+ const params = _this.MixinClone(_this.params)
|
|
|
+ if (!params.start_date || !params.end_date) {
|
|
|
+ _this.$message.info('请选择时间范围!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ params.page_size = 1000
|
|
|
+ params.page_no = 1
|
|
|
+ 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'),
|
|
|
+ this.$t('interaction.createDate')] // 表头
|
|
|
+ const filterVal = ['fromMemberName', 'toMemberName', 'action_type', 'action_end', 'data', 'create_date']
|
|
|
+ const tit = params.start_date + '至' + params.end_date + '交互记录'
|
|
|
+ const data = _this.formatJson(filterVal, res.data)
|
|
|
+ excel.export_json_to_excel({
|
|
|
+ header: tHeader,
|
|
|
+ data,
|
|
|
+ filename: tit,
|
|
|
+ autoWidth: true
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ formatJson(filterVal, jsonData) {
|
|
|
+ return jsonData.map(v => filterVal.map(j => {
|
|
|
+ if (j === 'fromMemberName') {
|
|
|
+ return this.formatterFromName({data: v})
|
|
|
+ } else if (j === 'toMemberName') {
|
|
|
+ return this.formatterToName({data: v})
|
|
|
+ }else if (j === 'action_type') {
|
|
|
+ return this.formatterType({value: v[j]})
|
|
|
+ }else if (j === 'action_end') {
|
|
|
+ return this.formatterResult2(v[j])
|
|
|
+ }else if (j === 'create_date') {
|
|
|
+ return this.formatterDate({value: v[j]})
|
|
|
+ } else {
|
|
|
+ return v[j]
|
|
|
+ }
|
|
|
+ }))
|
|
|
}
|
|
|
}
|
|
|
}
|