feat: 业务化后台高级设置

This commit is contained in:
que01 committed 2026-09-27 19:16:33 +08:00
1 parent 07d3790aa8
commit f603719b2d
4 files changed
+63 -19

No files matched your search

@@ -249,17 +249,15 @@ export function WorkspacePage() {
) : (
<Space direction="vertical" style={{ width: "100%" }}>
<Space wrap>
<Tag color="blue">Schema {runtimeQuery.data?.schemaVersion ?? "-"}</Tag>
<Tag>能力 {runtimeQuery.data?.capabilities?.length ?? 0}</Tag>
<Tag>公开业务 {runtimeQuery.data?.offerings?.length ?? 0}</Tag>
<Tag>插件 {runtimeQuery.data?.plugins?.length ?? 0}</Tag>
<Tag color="green">小程序数据已同步</Tag>
<Tag>公开业务 {runtimeQuery.data?.offerings?.length ?? 0} 项</Tag>
<Tag>已启用能力 {runtimeQuery.data?.capabilities?.length ?? 0} 项</Tag>
</Space>
<Typography.Paragraph type="secondary" style={{ marginBottom: 0 }}>
小程序和后台预览消费同一份 Runtime Workspace;模板 key
只用于安装和版本管理,不作为客户端业务分支。
小程序和后台预览会使用同一份已发布内容。这里的能力由当前模板自动提供,通常不需要手动调整。
</Typography.Paragraph>
<Space direction="vertical" style={{ width: "100%" }}>
<Typography.Text strong>能力插件</Typography.Text>
<Typography.Text strong>已启用的服务能力</Typography.Text>
{(runtimeQuery.data?.plugins ?? []).map((plugin) => (
<Card key={plugin.key} size="small">
<Space wrap>
@@ -267,11 +265,9 @@ export function WorkspacePage() {
<Tag color={plugin.status === "enabled" ? "green" : "orange"}>
{plugin.status}
</Tag>
<Tag>v{plugin.version}</Tag>
<Typography.Text type="secondary">{plugin.apiContract}</Typography.Text>
</Space>
<Typography.Paragraph type="secondary" style={{ margin: "8px 0 0" }}>
依赖模块:{plugin.requiredModules.join("、")} · Schema:{plugin.configSchema}
这项能力已接入当前小程序流程,无需单独配置技术参数。
</Typography.Paragraph>
</Card>
))}
@@ -441,7 +437,14 @@ export function WorkspacePage() {
{industryTarget?.capabilities.join("、") || "无"}。
</Typography.Paragraph>
</Modal>
<Card title="模板组合预览" style={{ marginBottom: 24 }}>
<Card
title="模板组合预览"
style={{ marginBottom: 24 }}
extra={<Typography.Text type="secondary">高级预览</Typography.Text>}
>
<Typography.Paragraph type="secondary">
用于负责人确认行业表达和视觉风格是否匹配,日常内容配置通常不需要使用这里。
</Typography.Paragraph>
<Space wrap>
<Select
value={previewIndustry}
@@ -548,11 +551,14 @@ export function WorkspacePage() {
<MutationError error={updateForm.error} />
</Card>
<Card
title="自定义字段"
title="高级自定义字段"
extra={
<Button type="primary" onClick={() => setFieldOpen(true)}>
新增字段
</Button>
<Space>
<Typography.Text type="secondary">负责人设置</Typography.Text>
<Button type="primary" onClick={() => setFieldOpen(true)}>
新增字段
</Button>
</Space>
}
>
<Table
@@ -560,9 +566,20 @@ export function WorkspacePage() {
dataSource={fields.filter((item) => item.source === "custom")}
columns={[
{ title: "字段", dataIndex: "label" },
{ title: "Key", dataIndex: "key" },
{ title: "作用域", dataIndex: "scope" },
{ title: "类型", dataIndex: "type" },
{
title: "使用位置",
dataIndex: "scope",
render: (value) =>
({ profile: "品牌资料", service: "业务提供项", inquiry: "咨询表单" })[
String(value)
] ?? "其他",
},
{
title: "填写方式",
dataIndex: "type",
render: (value) =>
inquiryFieldTypes.find((item) => item.value === value)?.label ?? "自定义",
},
{
title: "操作",
render: (_: unknown, item: BrandFieldDefinition) => (
@@ -592,6 +609,10 @@ export function WorkspacePage() {
onFinish={(values) =>
createField.mutate({
...values,
key:
typeof values.key === "string" && values.key.trim()
? values.key.trim()
: `custom_${Date.now()}`,
required: Boolean(values.required),
isVisible: true,
sortOrder: 99,
@@ -607,7 +628,7 @@ export function WorkspacePage() {
]}
/>
</Form.Item>
<Form.Item name="key" label="字段 Key" rules={[{ required: true }]}>
<Form.Item name="key" hidden rules={[{ required: true }]}>
<Input />
</Form.Item>
<Form.Item name="label" label="显示名称" rules={[{ required: true }]}>