feat: add party-size queueing and call modes

This commit is contained in:
wangxuming
2026-07-16 11:40:34 +08:00
parent 7f751bebae
commit 66951b4dc3
53 changed files with 3348 additions and 533 deletions

View File

@@ -14,6 +14,7 @@ const batch = {
last_name: "张",
honorific: "先生",
status: "CALLED",
party_size: 3,
}],
};
@@ -26,6 +27,8 @@ describe("BatchCard contact details", () => {
expect(screen.queryByText("第 3 批")).not.toBeInTheDocument();
expect(screen.getByText("13800138000")).toBeVisible();
expect(screen.getByText("张先生")).toBeVisible();
expect(screen.getByText("1 个号码 · 3 人")).toBeVisible();
expect(screen.getByText("3 人")).toBeVisible();
expect(screen.getByText("您的号码已叫到")).toBeVisible();
});

View File

@@ -9,6 +9,8 @@ export function BatchCard({
batch: CallBatchDto;
showContactDetails?: boolean;
}) {
const peopleCount = batch.people_count ?? batch.tickets.reduce((total, ticket) => total + ticket.party_size, 0);
return (
<section className="batch-card" aria-labelledby={`batch-${batch.id}`}>
<div className="batch-card__header">
@@ -18,7 +20,7 @@ export function BatchCard({
<StatusBadge status={batch.status} />
</div>
<p className="batch-card__summary">
<strong>{batchTicketCount(batch)} </strong>
<strong>{batchTicketCount(batch)} · {peopleCount} </strong>
<span>{formatDateTime(batch.called_at)}</span>
</p>
<ul className="batch-ticket-list">
@@ -26,6 +28,7 @@ export function BatchCard({
<li key={ticket.id} className="batch-ticket-row">
<div className="batch-ticket-identity">
<strong className="ticket-number">{ticket.ticket_number}</strong>
<span className="batch-ticket-party">{ticket.party_size} </span>
{showContactDetails ? (
<span className="ticket-contact-line">
<span><span className="ticket-contact-label"></span> <strong className="phone-value">{ticket.phone || "未返回"}</strong></span>