style(order-service): 优化配置工作台布局

This commit is contained in:
yml2213
2026-11-04 13:52:06 +08:00
parent 7b75c27c85
commit 209fa657ed
2 changed files with 325 additions and 95 deletions
@@ -117,10 +117,10 @@ const STATUS_STEP_OPTIONS: Array<{
key: keyof OrderServiceStatusSteps
label: string
}> = [
{ key: 'submitted', label: '第 1 步 · 提交资料' },
{ key: 'scheduled', label: '第 2 步 · 客服安排' },
{ key: 'processing', label: '第 3 步 · 订单处理' },
{ key: 'completed', label: '第 4 步 · 交付完成' },
{ key: 'submitted', label: '提交资料' },
{ key: 'scheduled', label: '客服安排' },
{ key: 'processing', label: '订单处理' },
{ key: 'completed', label: '交付完成' },
]
type FieldPreset = Omit<OrderServiceField, 'sortOrder'>
@@ -285,6 +285,8 @@ export default function OrderServicePanel() {
)
const materialConfirmationPreview =
Form.useWatch('materialConfirmation', form) || DEFAULT_MATERIAL_CONFIRMATION
const confirmationEnabledValue = Form.useWatch(['materialConfirmation', 'enabled'], form)
const confirmationEnabled = confirmationEnabledValue !== false
useEffect(() => {
if (selectedCategoryId !== null || categories.length === 0) return
@@ -582,14 +584,16 @@ export default function OrderServicePanel() {
>
<span className="order-service-category-main">
<span className="order-service-category-name">{category.name}</span>
</span>
<span className="order-service-category-meta">
<span className="order-service-category-key">
{category.categoryKey}
{category.status === 'active' ? '' : ' · 已停用'}
</span>
<span className={`order-service-status-pill is-${status.tone}`}>
{status.label}
</span>
</span>
<span className="order-service-category-meta">
{category.categoryKey}
{category.status === 'active' ? '' : ' · 已停用'}
</span>
</button>
)
})}
@@ -641,10 +645,11 @@ export default function OrderServicePanel() {
<Form form={form} layout="vertical" onFinish={handleSave}>
<section className="order-service-section">
<div className="order-service-section-head">
<div>
<Text strong>基础信息</Text>
<Text type="secondary">客户打开 `/o` 后看到的标题与提示。</Text>
</div>
<OrderServiceSectionTitle
index="01"
title="基础信息"
description="客户打开 /o 后看到的标题、说明与提交反馈"
/>
</div>
<div className="order-service-basic-grid">
<div>
@@ -710,17 +715,22 @@ export default function OrderServicePanel() {
<section className="order-service-section">
<div className="order-service-section-head">
<div>
<Text strong>客户状态进度文案</Text>
<Text type="secondary">
四个节点独立展示;标题保持简短,补充说明可填写引导文案。
</Text>
</div>
<OrderServiceSectionTitle
index="02"
title="客户状态进度"
description="四个节点独立展示,标题保持简短,补充说明用于安抚和引导客户"
/>
</div>
<div className="order-service-status-step-grid">
{STATUS_STEP_OPTIONS.map((step) => (
{STATUS_STEP_OPTIONS.map((step, index) => (
<div className="order-service-status-step-card" key={step.key}>
<Text strong>{step.label}</Text>
<div className="order-service-status-step-head">
<span className="order-service-status-step-index">{index + 1}</span>
<div>
<Text strong>{step.label}</Text>
<Text type="secondary">客户页第 {index + 1} 个节点</Text>
</div>
</div>
<Form.Item
label="节点标题"
name={['statusSteps', step.key, 'title']}
@@ -743,14 +753,18 @@ export default function OrderServicePanel() {
<section className="order-service-section">
<div className="order-service-section-head">
<div>
<Text strong>提交资料确认</Text>
<Text type="secondary">
客户点击提交时弹窗确认,可自定义提示内容和按钮文字。
</Text>
</div>
<Space size={8}>
<Text type="secondary">启用确认</Text>
<OrderServiceSectionTitle
index="03"
title="提交资料确认"
description="客户点击提交时二次确认,降低资料填写错误导致的售后风险"
/>
<div className="order-service-confirmation-switch">
<span>
<Text strong>{confirmationEnabled ? '已启用' : '已关闭'}</Text>
<Text type="secondary">
{confirmationEnabled ? '提交前弹窗确认' : '客户将直接提交资料'}
</Text>
</span>
<Form.Item
name={['materialConfirmation', 'enabled']}
valuePropName="checked"
@@ -758,46 +772,79 @@ export default function OrderServicePanel() {
>
<Switch />
</Form.Item>
</Space>
</div>
</div>
<div className="order-service-confirmation-grid">
<div className="order-service-confirmation-editor">
<Row gutter={[12, 0]}>
<Col span={24}>
<Form.Item label="确认标题" name={['materialConfirmation', 'title']}>
<Input
disabled={!confirmationEnabled}
maxLength={40}
placeholder="例如:提交资料确认"
/>
</Form.Item>
</Col>
<Col xs={12}>
<Form.Item
label="确认按钮"
name={['materialConfirmation', 'confirmText']}
>
<Input
disabled={!confirmationEnabled}
maxLength={12}
placeholder="确认提交"
/>
</Form.Item>
</Col>
<Col xs={12}>
<Form.Item
label="取消按钮"
name={['materialConfirmation', 'cancelText']}
>
<Input
disabled={!confirmationEnabled}
maxLength={12}
placeholder="返回检查"
/>
</Form.Item>
</Col>
<Col span={24}>
<Form.Item label="确认内容" name={['materialConfirmation', 'content']}>
<Input.TextArea
autoSize={{ minRows: 4, maxRows: 7 }}
disabled={!confirmationEnabled}
maxLength={500}
showCount
placeholder="请输入客户提交资料前需要确认的内容"
/>
</Form.Item>
</Col>
</Row>
</div>
<div className="order-service-confirmation-preview-panel">
<div className="order-service-confirmation-preview-head">
<span>
<Text strong>客户端预览</Text>
<Text type="secondary">实际弹窗会按客户资料生成摘要</Text>
</span>
<Tag color={confirmationEnabled ? 'green' : 'default'}>
{confirmationEnabled ? '生效中' : '未启用'}
</Tag>
</div>
<MaterialConfirmationPreview confirmation={materialConfirmationPreview} />
</div>
</div>
<Row gutter={[12, 0]}>
<Col xs={24} md={12}>
<Form.Item label="确认标题" name={['materialConfirmation', 'title']}>
<Input maxLength={40} placeholder="例如:提交资料确认" />
</Form.Item>
</Col>
<Col xs={12} md={6}>
<Form.Item label="确认按钮" name={['materialConfirmation', 'confirmText']}>
<Input maxLength={12} placeholder="确认提交" />
</Form.Item>
</Col>
<Col xs={12} md={6}>
<Form.Item label="取消按钮" name={['materialConfirmation', 'cancelText']}>
<Input maxLength={12} placeholder="返回检查" />
</Form.Item>
</Col>
<Col span={24}>
<Form.Item label="确认内容" name={['materialConfirmation', 'content']}>
<Input.TextArea
autoSize={{ minRows: 3, maxRows: 6 }}
maxLength={500}
showCount
placeholder="请输入客户提交资料前需要确认的内容"
/>
</Form.Item>
</Col>
</Row>
<MaterialConfirmationPreview confirmation={materialConfirmationPreview} />
</section>
<section className="order-service-section">
<div className="order-service-section-head">
<div>
<Text strong>资料字段</Text>
<Text type="secondary">
优先添加常用字段;标准字段会自动支持搜索、复制和资料匹配。
</Text>
</div>
<OrderServiceSectionTitle
index="04"
title="资料字段"
description="标准字段自动支持搜索、复制与资料匹配;自定义字段仅用于展示"
/>
<Space wrap>
<Dropdown
menu={{
@@ -946,10 +993,11 @@ export default function OrderServicePanel() {
<Col xs={24} xl={12}>
<section className="order-service-section order-service-section-fill">
<div className="order-service-section-head">
<div>
<Text strong>截图规则</Text>
<Text type="secondary">控制客户上传买家主页截图的限制。</Text>
</div>
<OrderServiceSectionTitle
index="05"
title="截图规则"
description="控制客户上传买家主页截图的限制"
/>
</div>
<Row gutter={[12, 0]}>
<Col xs={24} md={12}>
@@ -990,10 +1038,11 @@ export default function OrderServicePanel() {
<Col xs={24} xl={12}>
<section className="order-service-section order-service-section-fill">
<div className="order-service-section-head">
<div>
<Text strong>自动发布并核销</Text>
<Text type="secondary">客户提交后按工单快照自动处理。</Text>
</div>
<OrderServiceSectionTitle
index="06"
title="自动发布并核销"
description="客户提交后按工单快照自动处理"
/>
</div>
<div className="order-service-switch-grid is-auto-publish">
<Form.Item
@@ -1121,6 +1170,26 @@ function resolveProfileStatus(profile: AdminOrderServiceProfile | undefined) {
return { label: '已归档', tone: 'muted' }
}
function OrderServiceSectionTitle({
index,
title,
description,
}: {
index: string
title: string
description: string
}) {
return (
<div className="order-service-section-title">
<span className="order-service-section-index">{index}</span>
<span className="order-service-section-title-copy">
<Text strong>{title}</Text>
<Text type="secondary">{description}</Text>
</span>
</div>
)
}
function MaterialConfirmationPreview({
confirmation,
}: {