feat: 完善后台动态咨询详情
This commit is contained in:
1 parent
ba0069ae6d
commit
9bbb748114
1 file changed
+44
-1
@@ -46,6 +46,7 @@ export function InquiriesPage() {
|
||||
const queryClient = useQueryClient();
|
||||
const [status, setStatus] = useState<string>();
|
||||
const [selectedId, setSelectedId] = useState<string>();
|
||||
const [selectedSubmission, setSelectedSubmission] = useState<InquirySubmission>();
|
||||
const query = useQuery({
|
||||
queryKey: ["admin-bookings", status],
|
||||
queryFn: () => client.listAdminBookings(status ? { status: status as never } : {}),
|
||||
@@ -219,12 +220,20 @@ export function InquiriesPage() {
|
||||
{
|
||||
title: "内容",
|
||||
dataIndex: "values",
|
||||
render: (value: Record<string, unknown>) => JSON.stringify(value),
|
||||
render: (value: Record<string, unknown>) => {
|
||||
const entries = Object.entries(value ?? {});
|
||||
return entries.length
|
||||
? entries.map(([key, item]) => `${key}: ${String(item)}`).join(";")
|
||||
: "暂无内容";
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "跟进",
|
||||
render: (_: unknown, item: InquirySubmission) => (
|
||||
<Space>
|
||||
<Button size="small" onClick={() => setSelectedSubmission(item)}>
|
||||
查看
|
||||
</Button>
|
||||
<Select
|
||||
size="small"
|
||||
value={item.status}
|
||||
@@ -251,6 +260,40 @@ export function InquiriesPage() {
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<Drawer
|
||||
title="动态咨询详情"
|
||||
open={Boolean(selectedSubmission)}
|
||||
onClose={() => setSelectedSubmission(undefined)}
|
||||
width={520}
|
||||
>
|
||||
{selectedSubmission && (
|
||||
<Descriptions column={1} bordered size="small">
|
||||
<Descriptions.Item label="表单">
|
||||
{selectedSubmission.inquiryForm?.name || "品牌咨询"}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="来源业务">
|
||||
{selectedSubmission.offering?.name || "品牌咨询"}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="状态">
|
||||
{inquiryLabels[selectedSubmission.status] ?? selectedSubmission.status}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="表单版本">
|
||||
v{selectedSubmission.formVersion}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="提交时间">
|
||||
{new Date(selectedSubmission.createdAt).toLocaleString("zh-CN")}
|
||||
</Descriptions.Item>
|
||||
{Object.entries(selectedSubmission.values ?? {}).map(([key, value]) => (
|
||||
<Descriptions.Item label={key} key={key}>
|
||||
{String(value)}
|
||||
</Descriptions.Item>
|
||||
))}
|
||||
<Descriptions.Item label="管理员备注">
|
||||
{selectedSubmission.adminNote || "暂无"}
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
)}
|
||||
</Drawer>
|
||||
</Card>
|
||||
</Card>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user