|
@@ -450,28 +450,33 @@ export default {
|
|
|
async handleExport() {
|
|
|
if (this.tabsCurrent === 0) {
|
|
|
// 导出今日数据
|
|
|
- const url = process.env.VUE_APP_BASE_API + '/user/behavior/exportToday'
|
|
|
- downloadWithUrl(url, '用户行为记录')
|
|
|
+ const url = process.env.VUE_APP_BASE_API + '/user/behavior/exportToday?todayType=0'
|
|
|
+ downloadWithUrl(url, '用户行为记录今日数据')
|
|
|
} else {
|
|
|
+ const url = process.env.VUE_APP_BASE_API + '/user/behavior/exportToday?todayType=1'
|
|
|
+ downloadWithUrl(url, '用户行为记录以往数据')
|
|
|
// 导出以往当前数据
|
|
|
- try {
|
|
|
- await this.$confirm('确定将用户行为记录导出为xlsx?', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- // 导出数据格式化
|
|
|
- const filterVal = ['ip', 'region', 'accessClient', 'companyType', 'corporateName', 'contacts', 'phoneNumber', 'spName', 'relevanceShop', 'label', 'addTime', 'numbers', 'accessDuration', 'accessDate']
|
|
|
- const data = this.formatJson(filterVal, this.list.slice(0))
|
|
|
- export_json_to_excel({
|
|
|
- header: ['IP', '地区', '访问客户端', '公司类型', '公司名称', '联系人', '手机号', '所属协销', '关联供应商', '供应商标签', '注册时间', '访问页面数量', '总时长', '访问日期'],
|
|
|
- data,
|
|
|
- filename: '用户行为记录'
|
|
|
- })
|
|
|
- } catch (error) {
|
|
|
- console.log(error)
|
|
|
- this.$message.info('已取消导出操作')
|
|
|
- }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async export_json_to_excel() {
|
|
|
+ // 前端导出
|
|
|
+ try {
|
|
|
+ await this.$confirm('确定将用户行为记录导出为xlsx?', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ // 导出数据格式化
|
|
|
+ const filterVal = ['ip', 'region', 'accessClient', 'companyType', 'corporateName', 'contacts', 'phoneNumber', 'spName', 'relevanceShop', 'label', 'addTime', 'numbers', 'accessDuration', 'accessDate']
|
|
|
+ const data = this.formatJson(filterVal, this.list.slice(0))
|
|
|
+ export_json_to_excel({
|
|
|
+ header: ['IP', '地区', '访问客户端', '公司类型', '公司名称', '联系人', '手机号', '所属协销', '关联供应商', '供应商标签', '注册时间', '访问页面数量', '总时长', '访问日期'],
|
|
|
+ data,
|
|
|
+ filename: '用户行为记录'
|
|
|
+ })
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error)
|
|
|
+ this.$message.info('已取消导出操作')
|
|
|
}
|
|
|
},
|
|
|
formatJson(filterVal, jsonData) {
|