add customerCount for list event record
This commit is contained in:
@@ -73,7 +73,8 @@
|
||||
/>
|
||||
<t-cell title="事件" :note="eventFilterLabel" />
|
||||
<t-cell v-if="optionFilterLabel !== '全部选项'" title="选项" :note="optionFilterLabel" />
|
||||
<t-cell title="数据量" :note="`共 ${pageResult.total} 条记录`" />
|
||||
<t-cell title="记录数" :note="Text.display(pageResult.total)" />
|
||||
<t-cell title="客户数" :note="Text.display(pageResult.customerCount)" />
|
||||
<t-cell v-if="summaryNumberValueText" title="数值合计" :note="summaryNumberValueText" />
|
||||
</t-cell-group>
|
||||
<t-cell-group v-if="hasSelectedOption && optionStatList.length" title="选项统计" class="option-stat" theme="card">
|
||||
@@ -136,7 +137,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { DropdownValue } from "tdesign-mobile-vue";
|
||||
import { Time, WebToolkit } from "timi-web";
|
||||
import { Time, Text, WebToolkit } from "timi-web";
|
||||
import { useUserStore } from "timi-web-api";
|
||||
import EventAPI from "@/api/EventAPI";
|
||||
import EventRecordAPI from "@/api/EventRecordAPI";
|
||||
@@ -365,7 +366,8 @@ const page = reactive<EventRecordPage>({
|
||||
const pageResult = reactive<EventRecordPageResult>({
|
||||
total: 0,
|
||||
list: [],
|
||||
numberValueTotal: null
|
||||
numberValueTotal: null,
|
||||
customerCount: 0
|
||||
});
|
||||
const optionStatList = ref<EventOptionStat[]>([]);
|
||||
let loadToken = 0;
|
||||
@@ -390,6 +392,7 @@ async function reloadRecords(): Promise<void> {
|
||||
pageResult.total = 0;
|
||||
pageResult.list = [];
|
||||
pageResult.numberValueTotal = null;
|
||||
pageResult.customerCount = 0;
|
||||
optionStatList.value = [];
|
||||
isNoMore.value = false;
|
||||
await Promise.all([loadRecords(), loadOptionStats()]);
|
||||
@@ -421,6 +424,7 @@ async function loadRecords(): Promise<void> {
|
||||
pageResult.list = pageResult.list.concat(result.list || []);
|
||||
pageResult.total = result.total || 0;
|
||||
pageResult.numberValueTotal = result.numberValueTotal ?? null;
|
||||
pageResult.customerCount = result.customerCount ?? 0;
|
||||
page.index += 1;
|
||||
isNoMore.value = pageResult.list.length >= pageResult.total || (result.list || []).length < page.size;
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user