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