| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160 |
- <nz-card nzTitle="消息推送统计概览" [nzBordered]="false">
- <div class="filter-controls">
- <nz-range-picker
- [(ngModel)]="dateRange"
- (ngModelChange)="refreshData()"
- style="width: 300px; margin-right: 16px"
- ></nz-range-picker>
- <!-- 新增策略筛选下拉框 -->
- <nz-select
- [(ngModel)]="selectedStrategy"
- (ngModelChange)="refreshData()"
- style="width: 300px; margin-right: 16px"
- nzPlaceHolder="选择策略"
- >
- <nz-option nzValue="" nzLabel="全部策略"></nz-option>
- <nz-option
- *ngFor="let strategy of strategies"
- [nzValue]="strategy"
- [nzLabel]="strategy"
- ></nz-option>
- </nz-select>
- <button
- nz-button
- nzType="primary"
- (click)="refreshData()"
- [nzLoading]="isLoading"
- >
- <span nz-icon nzType="sync"></span>刷新数据
- </button>
- </div>
- <nz-spin [nzSpinning]="isLoading">
- <!-- 整体统计卡片 -->
- <nz-card nzTitle="整体统计" style="margin-top: 16px">
- <div nz-row [nzGutter]="16" *ngIf="overallStats">
- <div nz-col [nzSpan]="4">
- <nz-statistic
- nzTitle="总发送量"
- [nzValue]="overallStats.totalRecords || 0"
- ></nz-statistic>
- </div>
- <div nz-col [nzSpan]="4">
- <nz-statistic
- nzTitle="发送成功率"
- [nzValue]="formatPercentage(overallStats.sentSuccessRate || 0)"
- ></nz-statistic>
- <div class="statistic-subtext">
- 成功数: {{ overallStats.sent || 0 }}
- </div>
- </div>
- <div nz-col [nzSpan]="4">
- <nz-statistic
- nzTitle="送达率"
- [nzValue]="formatPercentage(overallStats.deliveredRate || 0)"
- ></nz-statistic>
- <div class="statistic-subtext">
- 送达数: {{ overallStats.delivered || 0 }}
- </div>
- </div>
- <div nz-col [nzSpan]="4">
- <nz-statistic
- nzTitle="展示率"
- [nzValue]="formatPercentage(overallStats.displayRate || 0)"
- ></nz-statistic>
- <div class="statistic-subtext">
- 展示数: {{ overallStats.displayCount || 0 }}
- </div>
- </div>
- <div nz-col [nzSpan]="4">
- <nz-statistic
- nzTitle="点击率"
- [nzValue]="formatPercentage(overallStats.clickThroughRate || 0)"
- ></nz-statistic>
- </div>
- <div nz-col [nzSpan]="4">
- <nz-statistic
- nzTitle="失败率"
- [nzValue]="
- formatPercentage(overallStats.tokenInvalidationRate || 0)
- "
- ></nz-statistic>
- <div class="statistic-subtext">
- 失败数: {{ overallStats.failed || 0 }}
- </div>
- </div>
- </div>
- </nz-card>
- <!-- 图表区域 -->
- <div nz-row [nzGutter]="16" style="margin-top: 16px">
- <div nz-col [nzSpan]="24">
- <nz-card nzTitle="每日消息量与转化率">
- <div class="chart-container">
- <canvas
- baseChart
- [type]="'bar'"
- [data]="combinedChartData"
- [options]="combinedChartOptions"
- ></canvas>
- </div>
- <div class="chart-legend">
- <div>
- <span
- class="legend-color"
- style="background-color: #1890ff"
- ></span>
- 总发送量
- </div>
- <div>
- <span
- class="legend-color"
- style="background-color: #52c41a"
- ></span>
- 成功发送
- </div>
- <div>
- <span
- class="legend-color"
- style="background-color: #13c2c2"
- ></span>
- 已送达
- </div>
- <div>
- <span
- class="legend-color"
- style="background-color: #722ed1"
- ></span>
- 已打开
- </div>
- <div>
- <span
- class="legend-color"
- style="background-color: #faad14"
- ></span>
- 展示数
- </div>
- <div>
- <span
- class="legend-color"
- style="background-color: #f5222d"
- ></span>
- 失败数
- </div>
- <div>
- <span class="legend-line" style="border-color: #13c2c2"></span>
- 送达率
- </div>
- <div>
- <span class="legend-line" style="border-color: #faad14"></span>
- 展示率
- </div>
- <div>
- <span class="legend-line" style="border-color: #722ed1"></span>
- 点击率
- </div>
- </div>
- </nz-card>
- </div>
- </div>
- <!-- 统计表格标签页 -->
- <nz-tabset [(nzSelectedIndex)]="activeTab" style="margin-top: 16px">
- <!-- 按策略统计表格 -->
- <nz-tab nzTitle="按策略统计">
- <nz-table
- #strategyTable
- [nzData]="strategyStats"
- [nzFrontPagination]="false"
- [nzShowPagination]="false"
- [nzBordered]="true"
- [nzSize]="'small'"
- nzTableLayout="fixed"
- >
- <thead>
- <tr>
- <th nzWidth="50px"></th>
- <th (click)="sortStrategyTable('strategyName')">
- 策略名称
- <span *ngIf="strategySortField === 'strategyName'">
- <i
- nz-icon
- [nzType]="
- strategySortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortStrategyTable('totalRecords')">
- 总发送量
- <span *ngIf="strategySortField === 'totalRecords'">
- <i
- nz-icon
- [nzType]="
- strategySortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortStrategyTable('sent')">
- 成功数
- <span *ngIf="strategySortField === 'sent'">
- <i
- nz-icon
- [nzType]="
- strategySortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortStrategyTable('delivered')">
- 送达数
- <span *ngIf="strategySortField === 'delivered'">
- <i
- nz-icon
- [nzType]="
- strategySortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortStrategyTable('displayCount')">
- 展示数
- <span *ngIf="strategySortField === 'displayCount'">
- <i
- nz-icon
- [nzType]="
- strategySortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortStrategyTable('opened')">
- 打开数
- <span *ngIf="strategySortField === 'opened'">
- <i
- nz-icon
- [nzType]="
- strategySortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortStrategyTable('failed')">
- 失败数
- <span *ngIf="strategySortField === 'failed'">
- <i
- nz-icon
- [nzType]="
- strategySortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortStrategyTable('deliveredRate')">
- 送达率
- <span *ngIf="strategySortField === 'deliveredRate'">
- <i
- nz-icon
- [nzType]="
- strategySortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortStrategyTable('displayRate')">
- 展示率
- <span *ngIf="strategySortField === 'displayRate'">
- <i
- nz-icon
- [nzType]="
- strategySortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortStrategyTable('clickThroughRate')">
- 点击率
- <span *ngIf="strategySortField === 'clickThroughRate'">
- <i
- nz-icon
- [nzType]="
- strategySortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortStrategyTable('tokenInvalidationRate')">
- 失败率
- <span *ngIf="strategySortField === 'tokenInvalidationRate'">
- <i
- nz-icon
- [nzType]="
- strategySortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- </tr>
- </thead>
- <tbody>
- <ng-template ngFor let-item [ngForOf]="strategyTable.data">
- <tr>
- <td
- (click)="toggleExpand(item, 'strategy')"
- class="expand-icon-cell"
- >
- <i
- nz-icon
- [nzType]="item.expanded ? 'down' : 'right'"
- class="expand-icon"
- ></i>
- </td>
- <td class="strategy-name-col">
- <a
- (click)="navigateToStrategy(item.strategyName)"
- *ngIf="item.strategyName"
- >
- {{ item.strategyName || "-" }}
- </a>
- <span *ngIf="!item.strategyName">-</span>
- </td>
- <td>{{ item.totalRecords || 0 }}</td>
- <td>{{ item.sent || 0 }}</td>
- <td>{{ item.delivered || 0 }}</td>
- <td>{{ item.displayCount || 0 }}</td>
- <td>{{ item.opened || 0 }}</td>
- <td>{{ item.failed || 0 }}</td>
- <td>{{ formatPercentage(item.deliveredRate || 0) }}</td>
- <td>{{ formatPercentage(item.displayRate || 0) }}</td>
- <td>{{ formatPercentage(item.clickThroughRate || 0) }}</td>
- <td>{{ formatPercentage(item.tokenInvalidationRate || 0) }}</td>
- </tr>
- <tr [nzExpand]="item.expanded">
- <td colspan="12" *ngIf="item.expanded" class="expanded-row">
- <div *ngIf="item.loading" class="loading-container">
- <nz-spin></nz-spin>
- </div>
- <div
- *ngIf="item.dailyData && !item.loading"
- class="expanded-content"
- >
- <nz-table
- class="expanded-table"
- [nzData]="item.dailyData"
- [nzShowPagination]="false"
- [nzSize]="'small'"
- nzBordered
- >
- <thead>
- <tr>
- <th>日期</th>
- <th>总发送量</th>
- <th>成功数</th>
- <th>送达数</th>
- <th>展示数</th>
- <th>打开数</th>
- <th>失败数</th>
- <th>送达率</th>
- <th>展示率</th>
- <th>点击率</th>
- <th>失败率</th>
- </tr>
- </thead>
- <tbody>
- <tr *ngFor="let daily of item.dailyData">
- <td>{{ formatDate(daily.date) }}</td>
- <td>{{ daily.totalRecords || 0 }}</td>
- <td>{{ daily.sent || 0 }}</td>
- <td>{{ daily.delivered || 0 }}</td>
- <td>{{ daily.displayCount || 0 }}</td>
- <td>{{ daily.opened || 0 }}</td>
- <td>{{ daily.failed || 0 }}</td>
- <td>
- {{ formatPercentage(daily.deliveredRate || 0) }}
- </td>
- <td>
- {{ formatPercentage(daily.displayRate || 0) }}
- </td>
- <td>
- {{ formatPercentage(daily.clickThroughRate || 0) }}
- </td>
- <td>
- {{
- formatPercentage(daily.tokenInvalidationRate || 0)
- }}
- </td>
- </tr>
- </tbody>
- </nz-table>
- </div>
- </td>
- </tr>
- </ng-template>
- </tbody>
- </nz-table>
- <nz-empty *ngIf="strategyStats.length === 0 && !isLoading"></nz-empty>
- </nz-tab>
- <!-- 按模板统计表格 -->
- <nz-tab nzTitle="按模板统计">
- <nz-table
- #templateTable
- [nzData]="templateStats"
- [nzFrontPagination]="false"
- [nzShowPagination]="false"
- [nzBordered]="true"
- [nzSize]="'small'"
- nzTableLayout="fixed"
- >
- <thead>
- <tr>
- <th nzWidth="50px"></th>
- <th (click)="sortTemplateTable('templateName')">
- 模板名称
- <span *ngIf="templateSortField === 'templateName'">
- <i
- nz-icon
- [nzType]="
- templateSortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortTemplateTable('totalRecords')">
- 总发送量
- <span *ngIf="templateSortField === 'totalRecords'">
- <i
- nz-icon
- [nzType]="
- templateSortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortTemplateTable('sent')">
- 成功数
- <span *ngIf="templateSortField === 'sent'">
- <i
- nz-icon
- [nzType]="
- templateSortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortTemplateTable('delivered')">
- 送达数
- <span *ngIf="templateSortField === 'delivered'">
- <i
- nz-icon
- [nzType]="
- templateSortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortTemplateTable('displayCount')">
- 展示数
- <span *ngIf="templateSortField === 'displayCount'">
- <i
- nz-icon
- [nzType]="
- templateSortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortTemplateTable('opened')">
- 打开数
- <span *ngIf="templateSortField === 'opened'">
- <i
- nz-icon
- [nzType]="
- templateSortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortTemplateTable('failed')">
- 失败数
- <span *ngIf="templateSortField === 'failed'">
- <i
- nz-icon
- [nzType]="
- templateSortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortTemplateTable('deliveredRate')">
- 送达率
- <span *ngIf="templateSortField === 'deliveredRate'">
- <i
- nz-icon
- [nzType]="
- templateSortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortTemplateTable('displayRate')">
- 展示率
- <span *ngIf="templateSortField === 'displayRate'">
- <i
- nz-icon
- [nzType]="
- templateSortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortTemplateTable('clickThroughRate')">
- 点击率
- <span *ngIf="templateSortField === 'clickThroughRate'">
- <i
- nz-icon
- [nzType]="
- templateSortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortTemplateTable('tokenInvalidationRate')">
- 失败率
- <span *ngIf="templateSortField === 'tokenInvalidationRate'">
- <i
- nz-icon
- [nzType]="
- templateSortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- </tr>
- </thead>
- <tbody>
- <ng-template ngFor let-item [ngForOf]="templateTable.data">
- <tr>
- <td
- (click)="toggleExpand(item, 'template')"
- class="expand-icon-cell"
- >
- <i
- nz-icon
- [nzType]="item.expanded ? 'down' : 'right'"
- class="expand-icon"
- ></i>
- </td>
- <td class="template-name-col">
- <a
- (click)="navigateToTemplate(item.templateName)"
- *ngIf="item.templateName"
- >
- {{ item.templateName || "-" }}
- </a>
- <span *ngIf="!item.templateName">-</span>
- </td>
- <td>{{ item.totalRecords || 0 }}</td>
- <td>{{ item.sent || 0 }}</td>
- <td>{{ item.delivered || 0 }}</td>
- <td>{{ item.displayCount || 0 }}</td>
- <td>{{ item.opened || 0 }}</td>
- <td>{{ item.failed || 0 }}</td>
- <td>{{ formatPercentage(item.deliveredRate || 0) }}</td>
- <td>{{ formatPercentage(item.displayRate || 0) }}</td>
- <td>{{ formatPercentage(item.clickThroughRate || 0) }}</td>
- <td>{{ formatPercentage(item.tokenInvalidationRate || 0) }}</td>
- </tr>
- <tr [nzExpand]="item.expanded">
- <td colspan="12" *ngIf="item.expanded" class="expanded-row">
- <div *ngIf="item.loading" class="loading-container">
- <nz-spin></nz-spin>
- </div>
- <div
- *ngIf="item.dailyData && !item.loading"
- class="expanded-content"
- >
- <nz-table
- class="expanded-table"
- [nzData]="item.dailyData"
- [nzShowPagination]="false"
- [nzSize]="'small'"
- nzBordered
- >
- <thead>
- <tr>
- <th>日期</th>
- <th>总发送量</th>
- <th>成功数</th>
- <th>送达数</th>
- <th>展示数</th>
- <th>打开数</th>
- <th>失败数</th>
- <th>送达率</th>
- <th>展示率</th>
- <th>点击率</th>
- <th>失败率</th>
- </tr>
- </thead>
- <tbody>
- <tr *ngFor="let daily of item.dailyData">
- <td>{{ formatDate(daily.date) }}</td>
- <td>{{ daily.totalRecords || 0 }}</td>
- <td>{{ daily.sent || 0 }}</td>
- <td>{{ daily.delivered || 0 }}</td>
- <td>{{ daily.displayCount || 0 }}</td>
- <td>{{ daily.opened || 0 }}</td>
- <td>{{ daily.failed || 0 }}</td>
- <td>
- {{ formatPercentage(daily.deliveredRate || 0) }}
- </td>
- <td>
- {{ formatPercentage(daily.displayRate || 0) }}
- </td>
- <td>
- {{ formatPercentage(daily.clickThroughRate || 0) }}
- </td>
- <td>
- {{
- formatPercentage(daily.tokenInvalidationRate || 0)
- }}
- </td>
- </tr>
- </tbody>
- </nz-table>
- </div>
- </td>
- </tr>
- </ng-template>
- </tbody>
- </nz-table>
- <nz-empty *ngIf="templateStats.length === 0 && !isLoading"></nz-empty>
- </nz-tab>
- <!-- 按国家统计表格 -->
- <nz-tab nzTitle="按国家统计">
- <nz-table
- #ccTable
- [nzData]="ccStats"
- [nzFrontPagination]="false"
- [nzShowPagination]="false"
- [nzBordered]="true"
- [nzSize]="'small'"
- nzTableLayout="fixed"
- >
- <thead>
- <tr>
- <th nzWidth="50px"></th>
- <th (click)="sortCcTable('cc')">
- 国家/地区
- <span *ngIf="ccSortField === 'cc'">
- <i
- nz-icon
- [nzType]="
- ccSortDirection === 'ascend' ? 'caret-up' : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortCcTable('totalRecords')">
- 总发送量
- <span *ngIf="ccSortField === 'totalRecords'">
- <i
- nz-icon
- [nzType]="
- ccSortDirection === 'ascend' ? 'caret-up' : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortCcTable('sent')">
- 成功数
- <span *ngIf="ccSortField === 'sent'">
- <i
- nz-icon
- [nzType]="
- ccSortDirection === 'ascend' ? 'caret-up' : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortCcTable('delivered')">
- 送达数
- <span *ngIf="ccSortField === 'delivered'">
- <i
- nz-icon
- [nzType]="
- ccSortDirection === 'ascend' ? 'caret-up' : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortCcTable('displayCount')">
- 展示数
- <span *ngIf="ccSortField === 'displayCount'">
- <i
- nz-icon
- [nzType]="
- ccSortDirection === 'ascend' ? 'caret-up' : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortCcTable('opened')">
- 打开数
- <span *ngIf="ccSortField === 'opened'">
- <i
- nz-icon
- [nzType]="
- ccSortDirection === 'ascend' ? 'caret-up' : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortCcTable('failed')">
- 失败数
- <span *ngIf="ccSortField === 'failed'">
- <i
- nz-icon
- [nzType]="
- ccSortDirection === 'ascend' ? 'caret-up' : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortCcTable('deliveredRate')">
- 送达率
- <span *ngIf="ccSortField === 'deliveredRate'">
- <i
- nz-icon
- [nzType]="
- ccSortDirection === 'ascend' ? 'caret-up' : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortCcTable('displayRate')">
- 展示率
- <span *ngIf="ccSortField === 'displayRate'">
- <i
- nz-icon
- [nzType]="
- ccSortDirection === 'ascend' ? 'caret-up' : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortCcTable('clickThroughRate')">
- 点击率
- <span *ngIf="ccSortField === 'clickThroughRate'">
- <i
- nz-icon
- [nzType]="
- ccSortDirection === 'ascend' ? 'caret-up' : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortCcTable('tokenInvalidationRate')">
- 失败率
- <span *ngIf="ccSortField === 'tokenInvalidationRate'">
- <i
- nz-icon
- [nzType]="
- ccSortDirection === 'ascend' ? 'caret-up' : 'caret-down'
- "
- ></i>
- </span>
- </th>
- </tr>
- </thead>
- <tbody>
- <ng-template ngFor let-item [ngForOf]="ccTable.data">
- <tr>
- <td (click)="toggleExpand(item, 'cc')" class="expand-icon-cell">
- <i
- nz-icon
- [nzType]="item.expanded ? 'down' : 'right'"
- class="expand-icon"
- ></i>
- </td>
- <td>
- {{ formatCountry(item.cc) }}
- </td>
- <td>{{ item.totalRecords || 0 }}</td>
- <td>{{ item.sent || 0 }}</td>
- <td>{{ item.delivered || 0 }}</td>
- <td>{{ item.displayCount || 0 }}</td>
- <td>{{ item.opened || 0 }}</td>
- <td>{{ item.failed || 0 }}</td>
- <td>{{ formatPercentage(item.deliveredRate || 0) }}</td>
- <td>{{ formatPercentage(item.displayRate || 0) }}</td>
- <td>{{ formatPercentage(item.clickThroughRate || 0) }}</td>
- <td>{{ formatPercentage(item.tokenInvalidationRate || 0) }}</td>
- </tr>
- <tr [nzExpand]="item.expanded">
- <td colspan="12" *ngIf="item.expanded" class="expanded-row">
- <div *ngIf="item.loading" class="loading-container">
- <nz-spin></nz-spin>
- </div>
- <div
- *ngIf="item.dailyData && !item.loading"
- class="expanded-content"
- >
- <nz-table
- class="expanded-table"
- [nzData]="item.dailyData"
- [nzShowPagination]="false"
- [nzSize]="'small'"
- nzBordered
- >
- <thead>
- <tr>
- <th>日期</th>
- <th>总发送量</th>
- <th>成功数</th>
- <th>送达数</th>
- <th>展示数</th>
- <th>打开数</th>
- <th>失败数</th>
- <th>送达率</th>
- <th>展示率</th>
- <th>点击率</th>
- <th>失败率</th>
- </tr>
- </thead>
- <tbody>
- <tr *ngFor="let daily of item.dailyData">
- <td>{{ formatDate(daily.date) }}</td>
- <td>{{ daily.totalRecords || 0 }}</td>
- <td>{{ daily.sent || 0 }}</td>
- <td>{{ daily.delivered || 0 }}</td>
- <td>{{ daily.displayCount || 0 }}</td>
- <td>{{ daily.opened || 0 }}</td>
- <td>{{ daily.failed || 0 }}</td>
- <td>
- {{ formatPercentage(daily.deliveredRate || 0) }}
- </td>
- <td>
- {{ formatPercentage(daily.displayRate || 0) }}
- </td>
- <td>
- {{ formatPercentage(daily.clickThroughRate || 0) }}
- </td>
- <td>
- {{
- formatPercentage(daily.tokenInvalidationRate || 0)
- }}
- </td>
- </tr>
- </tbody>
- </nz-table>
- </div>
- </td>
- </tr>
- </ng-template>
- </tbody>
- </nz-table>
- <nz-empty *ngIf="ccStats.length === 0 && !isLoading"></nz-empty>
- </nz-tab>
- <!-- 按图片统计表格 -->
- <nz-tab nzTitle="按图片统计">
- <nz-table
- #imageTable
- [nzData]="imageStats"
- [nzFrontPagination]="false"
- [nzShowPagination]="false"
- [nzBordered]="true"
- [nzSize]="'small'"
- nzTableLayout="fixed"
- >
- <thead>
- <tr>
- <th nzWidth="50px"></th>
- <th>图片</th>
- <th (click)="sortImageTable('totalRecords')">
- 总发送量
- <span *ngIf="imageSortField === 'totalRecords'">
- <i
- nz-icon
- [nzType]="
- imageSortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortImageTable('sent')">
- 成功数
- <span *ngIf="imageSortField === 'sent'">
- <i
- nz-icon
- [nzType]="
- imageSortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortImageTable('delivered')">
- 送达数
- <span *ngIf="imageSortField === 'delivered'">
- <i
- nz-icon
- [nzType]="
- imageSortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortImageTable('displayCount')">
- 展示数
- <span *ngIf="imageSortField === 'displayCount'">
- <i
- nz-icon
- [nzType]="
- imageSortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortImageTable('opened')">
- 打开数
- <span *ngIf="imageSortField === 'opened'">
- <i
- nz-icon
- [nzType]="
- imageSortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortImageTable('failed')">
- 失败数
- <span *ngIf="imageSortField === 'failed'">
- <i
- nz-icon
- [nzType]="
- imageSortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortImageTable('deliveredRate')">
- 送达率
- <span *ngIf="imageSortField === 'deliveredRate'">
- <i
- nz-icon
- [nzType]="
- imageSortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortImageTable('displayRate')">
- 展示率
- <span *ngIf="imageSortField === 'displayRate'">
- <i
- nz-icon
- [nzType]="
- imageSortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortImageTable('clickThroughRate')">
- 点击率
- <span *ngIf="imageSortField === 'clickThroughRate'">
- <i
- nz-icon
- [nzType]="
- imageSortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- <th (click)="sortImageTable('tokenInvalidationRate')">
- 失败率
- <span *ngIf="imageSortField === 'tokenInvalidationRate'">
- <i
- nz-icon
- [nzType]="
- imageSortDirection === 'ascend'
- ? 'caret-up'
- : 'caret-down'
- "
- ></i>
- </span>
- </th>
- </tr>
- </thead>
- <tbody>
- <ng-template ngFor let-item [ngForOf]="imageTable.data">
- <tr>
- <td
- (click)="toggleExpand(item, 'image')"
- class="expand-icon-cell"
- >
- <i
- nz-icon
- [nzType]="item.expanded ? 'down' : 'right'"
- class="expand-icon"
- ></i>
- </td>
- <td>
- <img
- nz-image
- width="80px"
- height="80px"
- *ngIf="item.image"
- nzSrc="{{ item.image }}"
- alt="统计图片"
- />
- <span *ngIf="!item.image">-</span>
- </td>
- <td>{{ item.totalRecords || 0 }}</td>
- <td>{{ item.sent || 0 }}</td>
- <td>{{ item.delivered || 0 }}</td>
- <td>{{ item.displayCount || 0 }}</td>
- <td>{{ item.opened || 0 }}</td>
- <td>{{ item.failed || 0 }}</td>
- <td>{{ formatPercentage(item.deliveredRate || 0) }}</td>
- <td>{{ formatPercentage(item.displayRate || 0) }}</td>
- <td>{{ formatPercentage(item.clickThroughRate || 0) }}</td>
- <td>{{ formatPercentage(item.tokenInvalidationRate || 0) }}</td>
- </tr>
- <tr [nzExpand]="item.expanded">
- <td colspan="12" *ngIf="item.expanded" class="expanded-row">
- <div *ngIf="item.loading" class="loading-container">
- <nz-spin></nz-spin>
- </div>
- <div
- *ngIf="item.dailyData && !item.loading"
- class="expanded-content"
- >
- <nz-table
- class="expanded-table"
- [nzData]="item.dailyData"
- [nzShowPagination]="false"
- [nzSize]="'small'"
- nzBordered
- >
- <thead>
- <tr>
- <th>日期</th>
- <th>总发送量</th>
- <th>成功数</th>
- <th>送达数</th>
- <th>展示数</th>
- <th>打开数</th>
- <th>失败数</th>
- <th>送达率</th>
- <th>展示率</th>
- <th>点击率</th>
- <th>失败率</th>
- </tr>
- </thead>
- <tbody>
- <tr *ngFor="let daily of item.dailyData">
- <td>{{ formatDate(daily.date) }}</td>
- <td>{{ daily.totalRecords || 0 }}</td>
- <td>{{ daily.sent || 0 }}</td>
- <td>{{ daily.delivered || 0 }}</td>
- <td>{{ daily.displayCount || 0 }}</td>
- <td>{{ daily.opened || 0 }}</td>
- <td>{{ daily.failed || 0 }}</td>
- <td>
- {{ formatPercentage(daily.deliveredRate || 0) }}
- </td>
- <td>
- {{ formatPercentage(daily.displayRate || 0) }}
- </td>
- <td>
- {{ formatPercentage(daily.clickThroughRate || 0) }}
- </td>
- <td>
- {{
- formatPercentage(daily.tokenInvalidationRate || 0)
- }}
- </td>
- </tr>
- </tbody>
- </nz-table>
- </div>
- </td>
- </tr>
- </ng-template>
- </tbody>
- </nz-table>
- <nz-empty *ngIf="imageStats.length === 0 && !isLoading"></nz-empty>
- </nz-tab>
- </nz-tabset>
- </nz-spin>
- </nz-card>
|