|
@@ -2,12 +2,15 @@
|
2
|
2
|
<div v-loading="loading" class="table_container">
|
3
|
3
|
<div class="tableTop">
|
4
|
4
|
<div class="title">详细数据</div>
|
5
|
|
- <el-button type="primary" plain @click="exportEvent">导出数据</el-button>
|
|
5
|
+ <div>
|
|
6
|
+ <Indicators :type="mainPageInfo.data_group == 'account' ? 'account_report_1' : ( mainPageInfo.data_group == 'user' ? 'account_report_2' : (mainPageInfo.data_group == 'team' ? 'account_report_3' : ''))" @refresh="init(1)"></Indicators>
|
|
7
|
+ <el-button class="lMar10" type="primary" plain @click="exportEvent">导出数据</el-button>
|
|
8
|
+ </div>
|
6
|
9
|
</div>
|
7
|
10
|
<div>
|
8
|
|
- <el-table ref="tableAccountRef" :data="tableInfo.tableList"
|
9
|
|
- :header-cell-style="tableHeaderStyle" style="width: 100%;" border empty-text="暂无数据" :summary-method="getSummaries"
|
10
|
|
- show-summary max-height="calc(100vh - 280px)">
|
|
11
|
+ <el-table ref="tableAccountRef" :data="tableInfo.tableList" :header-cell-style="tableHeaderStyle"
|
|
12
|
+ style="width: 100%;" :key="tableInfo.updateKey" border empty-text="暂无数据" :summary-method="getSummaries" show-summary
|
|
13
|
+ max-height="calc(100vh - 280px)">
|
11
|
14
|
<template v-for="item in tableInfo.descol">
|
12
|
15
|
<el-table-column :fixed="item.disabled == 1" :prop="item.key_value"
|
13
|
16
|
:min-width="item.key_value != 'advertiser_status' && item.key_value != 'advertiser_nick' && item.label.length <= 4 ? '120px' : item.label.length <= 8 ? '150px' : '200px'">
|
|
@@ -58,12 +61,13 @@ import { Api } from "@/api/api";
|
58
|
61
|
import { ElMessage } from "element-plus";
|
59
|
62
|
import { getDay, hasDot } from "@/common/common";
|
60
|
63
|
import http from "@/http/http";
|
61
|
|
-import downLoadTable from "@/components/capsulationMoudle/downLoadTable.vue";
|
62
|
64
|
import { exportOrder } from "@/common/export/index.js";
|
|
65
|
+import Indicators from '@/components/businessMoudle/gdtList/indicators/index.vue'
|
|
66
|
+
|
63
|
67
|
const props = defineProps({
|
64
|
68
|
mainPageInfo: {
|
65
|
69
|
type: Object,
|
66
|
|
- default: ()=>{}
|
|
70
|
+ default: () => { }
|
67
|
71
|
}
|
68
|
72
|
})
|
69
|
73
|
|
|
@@ -79,7 +83,8 @@ const tableInfo = reactive<any>({
|
79
|
83
|
pageSize: 20,
|
80
|
84
|
total: 0,
|
81
|
85
|
totalPages: 0,//共多少页
|
82
|
|
- sortType: 'desc'
|
|
86
|
+ sortType: 'desc',
|
|
87
|
+ updateKey: 1,
|
83
|
88
|
})
|
84
|
89
|
|
85
|
90
|
|
|
@@ -119,21 +124,29 @@ const exportEvent = async () => {
|
119
|
124
|
loading.value = false;
|
120
|
125
|
if (res && res.errNo == '0') {
|
121
|
126
|
let list = res.rst.data.list;
|
122
|
|
- let tHeader = res.rst.data?.explain?.map((v) => {
|
123
|
|
- return v.label;
|
124
|
|
- })
|
125
|
|
- let filterVal = res.rst.data?.explain.map((v) => {
|
126
|
|
- return v.key_value
|
127
|
|
- })
|
128
|
|
- let excelDatas = [
|
129
|
|
- {
|
130
|
|
- tHeader: tHeader, // sheet表一头部
|
131
|
|
- filterVal: filterVal, // 表一的数据字段
|
132
|
|
- tableDatas: list, // 表一的整体json数据
|
133
|
|
- sheetName: ''// 表一的sheet名字
|
134
|
|
- }
|
135
|
|
- ]
|
136
|
|
- exportOrder({ excelDatas, name: `数据报表(导出时间:${getDay(0)})` })
|
|
127
|
+ let descol = [{
|
|
128
|
+ disabled: 1,
|
|
129
|
+ if_sort: 1,
|
|
130
|
+ key_value: "time",
|
|
131
|
+ label: "时间",
|
|
132
|
+ tooltip: ""
|
|
133
|
+ }].concat(res.rst.data?.explain)
|
|
134
|
+
|
|
135
|
+ let tHeader = descol.map((v) => {
|
|
136
|
+ return v.label;
|
|
137
|
+ })
|
|
138
|
+ let filterVal = descol.map((v) => {
|
|
139
|
+ return v.key_value
|
|
140
|
+ })
|
|
141
|
+ let excelDatas = [
|
|
142
|
+ {
|
|
143
|
+ tHeader: tHeader, // sheet表一头部
|
|
144
|
+ filterVal: filterVal, // 表一的数据字段
|
|
145
|
+ tableDatas: list, // 表一的整体json数据
|
|
146
|
+ sheetName: ''// 表一的sheet名字
|
|
147
|
+ }
|
|
148
|
+ ]
|
|
149
|
+ exportOrder({ excelDatas, name: `数据报表(导出时间:${getDay(0)})` })
|
137
|
150
|
} else {
|
138
|
151
|
ElMessage.error(res.errMsg)
|
139
|
152
|
}
|
|
@@ -161,13 +174,20 @@ const init = async (page?: any, pageSize?: any) => {
|
161
|
174
|
let res: any = await http.get(Api.report_accountReportList, params)
|
162
|
175
|
loading.value = false;
|
163
|
176
|
if (res && res.errNo == '0') {
|
164
|
|
- if(res.rst?.data?.summary?.length > 0){
|
|
177
|
+ if (res.rst?.data?.summary?.length > 0) {
|
165
|
178
|
tableInfo.summary = res.rst?.data?.summary[0];
|
166
|
179
|
}
|
167
|
|
- tableInfo.descol = res.rst?.data?.explain;
|
|
180
|
+ tableInfo.descol = [{
|
|
181
|
+ disabled: 1,
|
|
182
|
+ if_sort: 1,
|
|
183
|
+ key_value: "time",
|
|
184
|
+ label: "时间",
|
|
185
|
+ tooltip: ""
|
|
186
|
+ }].concat(res.rst?.data?.explain);
|
168
|
187
|
tableInfo.tableList = res.rst?.data?.list;
|
169
|
188
|
tableInfo.total = res.rst?.pageInfo.total
|
170
|
189
|
tableInfo.totalPages = res.rst?.pageInfo.total
|
|
190
|
+ tableInfo.updateKey ++;
|
171
|
191
|
} else {
|
172
|
192
|
ElMessage.error(res.errMsg)
|
173
|
193
|
}
|
|
@@ -232,16 +252,19 @@ defineExpose({
|
232
|
252
|
max-width: 600px;
|
233
|
253
|
/* 设置最大宽度,根据需要调整 */
|
234
|
254
|
}
|
235
|
|
-.table_container{
|
|
255
|
+
|
|
256
|
+.table_container {
|
236
|
257
|
background-color: #fff;
|
237
|
258
|
margin-top: 10px;
|
238
|
259
|
padding: 20px;
|
239
|
260
|
}
|
240
|
|
-.sortBox{
|
|
261
|
+
|
|
262
|
+.sortBox {
|
241
|
263
|
height: 16px;
|
242
|
264
|
margin-left: 2px;
|
243
|
265
|
margin-top: -4px;
|
244
|
|
- .sortItem{
|
|
266
|
+
|
|
267
|
+ .sortItem {
|
245
|
268
|
width: 8px;
|
246
|
269
|
height: 8px;
|
247
|
270
|
line-height: 8px;
|
|
@@ -249,15 +272,16 @@ defineExpose({
|
249
|
272
|
color: #999;
|
250
|
273
|
}
|
251
|
274
|
}
|
252
|
|
-.tableTop{
|
|
275
|
+
|
|
276
|
+.tableTop {
|
253
|
277
|
display: flex;
|
254
|
278
|
align-items: center;
|
255
|
279
|
justify-content: space-between;
|
256
|
280
|
padding-bottom: 20px;
|
257
|
|
- .title{
|
|
281
|
+
|
|
282
|
+ .title {
|
258
|
283
|
font-size: 14px;
|
259
|
284
|
color: #333;
|
260
|
285
|
font-weight: bold;
|
261
|
286
|
}
|
262
|
|
-}
|
263
|
|
-</style>
|
|
287
|
+}</style>
|