refactor: 迁移 Ant Design 6 弃用的 Alert 与 Space 属性
This commit is contained in:
1 parent
ca1b873a50
commit
3a0099e674
18 files changed
+38
-43
No files matched your search
@@ -74,7 +74,7 @@ export function ImageUrlField({ id, value, onChange, placeholder, scope }: Image
|
|||||||
<Alert
|
<Alert
|
||||||
type={storageStatus === "loading" ? "info" : "warning"}
|
type={storageStatus === "loading" ? "info" : "warning"}
|
||||||
showIcon
|
showIcon
|
||||||
message={
|
title={
|
||||||
storageStatus === "loading"
|
storageStatus === "loading"
|
||||||
? "正在检查媒体存储..."
|
? "正在检查媒体存储..."
|
||||||
: storageStatus === "unconfigured"
|
: storageStatus === "unconfigured"
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ export function RecordContentEditor({
|
|||||||
<Alert
|
<Alert
|
||||||
type="info"
|
type="info"
|
||||||
showIcon
|
showIcon
|
||||||
message={
|
title={
|
||||||
source === "offering"
|
source === "offering"
|
||||||
? `正在编辑业务提供项:${recordName}`
|
? `正在编辑业务提供项:${recordName}`
|
||||||
: `正在编辑信任内容:${recordName}`
|
: `正在编辑信任内容:${recordName}`
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ export function BrandPage() {
|
|||||||
className="brand-page__template-note"
|
className="brand-page__template-note"
|
||||||
type="info"
|
type="info"
|
||||||
showIcon
|
showIcon
|
||||||
message={`当前页面方案:${workspace.data?.templateContent?.displayName ?? template.data.name}`}
|
title={`当前页面方案:${workspace.data?.templateContent?.displayName ?? template.data.name}`}
|
||||||
description={`适用场景:${template.data.serviceCategories.join("、") || "通用品牌展示"}`}
|
description={`适用场景:${template.data.serviceCategories.join("、") || "通用品牌展示"}`}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ export function ComponentTemplatePreview({
|
|||||||
return () => window.removeEventListener("keydown", clear);
|
return () => window.removeEventListener("keydown", clear);
|
||||||
}, [onTargetSelected]);
|
}, [onTargetSelected]);
|
||||||
if (!Renderer)
|
if (!Renderer)
|
||||||
return <Alert type="warning" showIcon message="此模板尚无组件预览,请使用页面预览" />;
|
return <Alert type="warning" showIcon title="此模板尚无组件预览,请使用页面预览" />;
|
||||||
return (
|
return (
|
||||||
<div className="component-template-preview-shell">
|
<div className="component-template-preview-shell">
|
||||||
<div
|
<div
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ export function InquiryPreviewEditor({
|
|||||||
return (
|
return (
|
||||||
<Alert
|
<Alert
|
||||||
type="error"
|
type="error"
|
||||||
message="表单读取失败"
|
title="表单读取失败"
|
||||||
action={<Button onClick={() => void query.refetch()}>重试</Button>}
|
action={<Button onClick={() => void query.refetch()}>重试</Button>}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
@@ -67,10 +67,10 @@ export function InquiryPreviewEditor({
|
|||||||
return (
|
return (
|
||||||
<Alert
|
<Alert
|
||||||
type="info"
|
type="info"
|
||||||
message={query.isPending ? "正在读取表单" : "未找到对应表单,请刷新后重试"}
|
title={query.isPending ? "正在读取表单" : "未找到对应表单,请刷新后重试"}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
if (!field) return <Alert type="warning" message="字段已不存在" />;
|
if (!field) return <Alert type="warning" title="字段已不存在" />;
|
||||||
return (
|
return (
|
||||||
<Form<Record<string, unknown>>
|
<Form<Record<string, unknown>>
|
||||||
form={form}
|
form={form}
|
||||||
|
|||||||
@@ -311,12 +311,12 @@ export function PresentationEditor({
|
|||||||
</div>
|
</div>
|
||||||
{templateContent ? <StatusTag tone="info" label={templateContent.displayName} /> : null}
|
{templateContent ? <StatusTag tone="info" label={templateContent.displayName} /> : null}
|
||||||
</div>
|
</div>
|
||||||
{loading ? <Alert type="info" showIcon message="正在读取当前页面方案的编辑项目" /> : null}
|
{loading ? <Alert type="info" showIcon title="正在读取当前页面方案的编辑项目" /> : null}
|
||||||
{error ? (
|
{error ? (
|
||||||
<Alert type="warning" showIcon message="页面方案编辑项目读取失败,请刷新后重试。" />
|
<Alert type="warning" showIcon title="页面方案编辑项目读取失败,请刷新后重试。" />
|
||||||
) : null}
|
) : null}
|
||||||
{!loading && !error && !templateContent ? (
|
{!loading && !error && !templateContent ? (
|
||||||
<Alert type="warning" showIcon message="当前页面方案暂未提供可编辑的页面内容。" />
|
<Alert type="warning" showIcon title="当前页面方案暂未提供可编辑的页面内容。" />
|
||||||
) : null}
|
) : null}
|
||||||
{templateContent ? (
|
{templateContent ? (
|
||||||
<>
|
<>
|
||||||
@@ -454,7 +454,7 @@ export function PresentationEditor({
|
|||||||
<Alert
|
<Alert
|
||||||
type="info"
|
type="info"
|
||||||
showIcon
|
showIcon
|
||||||
message="详情页由所选业务内容动态生成"
|
title="详情页由所选业务内容动态生成"
|
||||||
description="选择业务内容预览详情,记录内容在业务提供项中维护;公共标题和按钮文案可从左侧区域列表配置,对全部详情生效。"
|
description="选择业务内容预览详情,记录内容在业务提供项中维护;公共标题和按钮文案可从左侧区域列表配置,对全部详情生效。"
|
||||||
action={
|
action={
|
||||||
<Button
|
<Button
|
||||||
@@ -480,7 +480,7 @@ export function PresentationEditor({
|
|||||||
<Alert
|
<Alert
|
||||||
type="info"
|
type="info"
|
||||||
showIcon
|
showIcon
|
||||||
message="这是一个组合区域"
|
title="这是一个组合区域"
|
||||||
description={
|
description={
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
{(selectedTarget.children ?? []).map((childKey) => {
|
{(selectedTarget.children ?? []).map((childKey) => {
|
||||||
@@ -542,7 +542,7 @@ export function PresentationEditor({
|
|||||||
? "error"
|
? "error"
|
||||||
: "info"
|
: "info"
|
||||||
}
|
}
|
||||||
message={
|
title={
|
||||||
(
|
(
|
||||||
selectedRecordSource === "offering"
|
selectedRecordSource === "offering"
|
||||||
? offeringsQuery.isError
|
? offeringsQuery.isError
|
||||||
@@ -583,7 +583,7 @@ export function PresentationEditor({
|
|||||||
<Alert
|
<Alert
|
||||||
type="info"
|
type="info"
|
||||||
showIcon
|
showIcon
|
||||||
message="此区域尚未配置内容"
|
title="此区域尚未配置内容"
|
||||||
description="创建并启用对应内容后,即可在预览中点选编辑。"
|
description="创建并启用对应内容后,即可在预览中点选编辑。"
|
||||||
action={
|
action={
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ export function PresentationFormPanel({
|
|||||||
type="info"
|
type="info"
|
||||||
showIcon
|
showIcon
|
||||||
className="admin-offset-bottom-lg"
|
className="admin-offset-bottom-lg"
|
||||||
message="这个页面还有关联内容"
|
title="这个页面还有关联内容"
|
||||||
description={
|
description={
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
{relevantPageLinks.map((item) => (
|
{relevantPageLinks.map((item) => (
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ export function TemplatePreview({
|
|||||||
<Alert
|
<Alert
|
||||||
type="warning"
|
type="warning"
|
||||||
showIcon
|
showIcon
|
||||||
message="页面预览暂不可用"
|
title="页面预览暂不可用"
|
||||||
description="请确认模板预览资源已构建并发布,或本地预览服务正在运行。"
|
description="请确认模板预览资源已构建并发布,或本地预览服务正在运行。"
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
@@ -150,7 +150,7 @@ export function TemplatePreview({
|
|||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
{error ? (
|
{error ? (
|
||||||
<Alert type="error" showIcon message="页面预览加载失败" description={error} />
|
<Alert type="error" showIcon title="页面预览加载失败" description={error} />
|
||||||
) : null}
|
) : null}
|
||||||
<iframe
|
<iframe
|
||||||
key={url}
|
key={url}
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export function BrandsPage({ canCreate }: { canCreate: boolean }) {
|
|||||||
className="admin-offset-bottom"
|
className="admin-offset-bottom"
|
||||||
type="info"
|
type="info"
|
||||||
showIcon
|
showIcon
|
||||||
message="切换品牌会进入对应品牌的工作区"
|
title="切换品牌会进入对应品牌的工作区"
|
||||||
description="品牌之间的业务内容、成员、发布记录和页面方案相互隔离。"
|
description="品牌之间的业务内容、成员、发布记录和页面方案相互隔离。"
|
||||||
/>
|
/>
|
||||||
{brands.data?.length ? (
|
{brands.data?.length ? (
|
||||||
@@ -88,7 +88,7 @@ export function BrandsPage({ canCreate }: { canCreate: boolean }) {
|
|||||||
</Button>,
|
</Button>,
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<Space direction="vertical" size={8}>
|
<Space orientation="vertical" size={8}>
|
||||||
<span className="admin-section-description">
|
<span className="admin-section-description">
|
||||||
小程序地址标识:{membership.brand.slug}
|
小程序地址标识:{membership.brand.slug}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -122,12 +122,12 @@ export function CreateBrandPage() {
|
|||||||
<Alert
|
<Alert
|
||||||
type="warning"
|
type="warning"
|
||||||
showIcon
|
showIcon
|
||||||
message="当前业务类型还没有可用的页面方案"
|
title="当前业务类型还没有可用的页面方案"
|
||||||
description="请先联系平台管理员发布兼容的页面方案。"
|
description="请先联系平台管理员发布兼容的页面方案。"
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
) : (
|
) : (
|
||||||
<Alert type="info" showIcon message="选择业务类型后,将只显示兼容的页面方案" />
|
<Alert type="info" showIcon title="选择业务类型后,将只显示兼容的页面方案" />
|
||||||
)}
|
)}
|
||||||
</AdminSection>
|
</AdminSection>
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ export function CreateBrandPage() {
|
|||||||
rules={[{ required: true, message: "请选择页面方案" }]}
|
rules={[{ required: true, message: "请选择页面方案" }]}
|
||||||
>
|
>
|
||||||
<Radio.Group className="admin-stack">
|
<Radio.Group className="admin-stack">
|
||||||
<Space direction="vertical" size={12} className="admin-full-width">
|
<Space orientation="vertical" size={12} className="admin-full-width">
|
||||||
{schemes.map((scheme) => (
|
{schemes.map((scheme) => (
|
||||||
<Radio.Button
|
<Radio.Button
|
||||||
key={scheme.templatePackageVersionId}
|
key={scheme.templatePackageVersionId}
|
||||||
@@ -180,7 +180,7 @@ export function CreateBrandPage() {
|
|||||||
<Alert
|
<Alert
|
||||||
type="info"
|
type="info"
|
||||||
showIcon
|
showIcon
|
||||||
message="创建品牌不会自动导入示例内容"
|
title="创建品牌不会自动导入示例内容"
|
||||||
description="新品牌会从空白内容开始,避免把示例品牌、案例或联系方式误当成真实信息发布。"
|
description="新品牌会从空白内容开始,避免把示例品牌、案例或联系方式误当成真实信息发布。"
|
||||||
/>
|
/>
|
||||||
<MutationError error={create.error} />
|
<MutationError error={create.error} />
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ export function PageSchemePage() {
|
|||||||
>
|
>
|
||||||
<Card>
|
<Card>
|
||||||
{upgradePreview.data?.canUpgrade ? (
|
{upgradePreview.data?.canUpgrade ? (
|
||||||
<Space direction="vertical" size={12} className="admin-full-width">
|
<Space orientation="vertical" size={12} className="admin-full-width">
|
||||||
<div className="admin-row-line">
|
<div className="admin-row-line">
|
||||||
<strong>可升级到版本 {upgradePreview.data.latestVersion}</strong>
|
<strong>可升级到版本 {upgradePreview.data.latestVersion}</strong>
|
||||||
<Tag color="blue">建议先预览</Tag>
|
<Tag color="blue">建议先预览</Tag>
|
||||||
@@ -235,11 +235,11 @@ export function PageSchemePage() {
|
|||||||
<Alert
|
<Alert
|
||||||
type="warning"
|
type="warning"
|
||||||
showIcon
|
showIcon
|
||||||
message={`发现 ${upgradePreview.data.conflicts.length} 项自定义内容与新版布局存在差异`}
|
title={`发现 ${upgradePreview.data.conflicts.length} 项自定义内容与新版布局存在差异`}
|
||||||
description="升级时会全部保留现有内容,不会逐项覆盖。请确认后再执行升级。"
|
description="升级时会全部保留现有内容,不会逐项覆盖。请确认后再执行升级。"
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Alert type="success" showIcon message="未发现内容绑定冲突" />
|
<Alert type="success" showIcon title="未发现内容绑定冲突" />
|
||||||
)}
|
)}
|
||||||
<Button type="primary" onClick={confirmUpgrade} loading={upgrade.isPending}>
|
<Button type="primary" onClick={confirmUpgrade} loading={upgrade.isPending}>
|
||||||
升级到 {upgradePreview.data.latestVersion}
|
升级到 {upgradePreview.data.latestVersion}
|
||||||
@@ -318,11 +318,11 @@ export function PageSchemePage() {
|
|||||||
key: "sample-content",
|
key: "sample-content",
|
||||||
label: "高级:导入示例内容",
|
label: "高级:导入示例内容",
|
||||||
children: (
|
children: (
|
||||||
<Space direction="vertical" size={12} className="admin-full-width">
|
<Space orientation="vertical" size={12} className="admin-full-width">
|
||||||
<Alert
|
<Alert
|
||||||
type="warning"
|
type="warning"
|
||||||
showIcon
|
showIcon
|
||||||
message="此操作会写入当前品牌内容"
|
title="此操作会写入当前品牌内容"
|
||||||
description="仅导入当前缺失的内容,不会覆盖已有品牌资料。创建品牌时不会自动执行。"
|
description="仅导入当前缺失的内容,不会覆盖已有品牌资料。创建品牌时不会自动执行。"
|
||||||
/>
|
/>
|
||||||
<Space>
|
<Space>
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ export function MiniAppReleaseCard({
|
|||||||
return (
|
return (
|
||||||
<Card size="small" styles={{ body: { padding: 16 } }}>
|
<Card size="small" styles={{ body: { padding: 16 } }}>
|
||||||
<Flex justify="space-between" align="flex-start" gap={12} wrap>
|
<Flex justify="space-between" align="flex-start" gap={12} wrap>
|
||||||
<Space direction="vertical" size={4}>
|
<Space orientation="vertical" size={4}>
|
||||||
<Space wrap size={8} align="center">
|
<Space wrap size={8} align="center">
|
||||||
<Typography.Text strong>品牌内容 v{task.version}</Typography.Text>
|
<Typography.Text strong>品牌内容 v{task.version}</Typography.Text>
|
||||||
<StatusTag label={status.label} tone={status.tone} />
|
<StatusTag label={status.label} tone={status.tone} />
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export function MiniAppSettingsTab({
|
|||||||
type="warning"
|
type="warning"
|
||||||
showIcon
|
showIcon
|
||||||
className="admin-offset-bottom"
|
className="admin-offset-bottom"
|
||||||
message="小程序构建参数未就绪"
|
title="小程序构建参数未就绪"
|
||||||
description={settings.buildError}
|
description={settings.buildError}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
@@ -45,7 +45,7 @@ export function MiniAppSettingsTab({
|
|||||||
type="info"
|
type="info"
|
||||||
showIcon
|
showIcon
|
||||||
className="admin-offset-bottom"
|
className="admin-offset-bottom"
|
||||||
message={`请求域名 ${settings?.requestDomain ?? "未确认"}`}
|
title={`请求域名 ${settings?.requestDomain ?? "未确认"}`}
|
||||||
description="该域名在构建时写入小程序包,必须与微信后台“开发设置 → 服务器域名 → request 合法域名”一致;不一致会导致小程序打开即加载失败。"
|
description="该域名在构建时写入小程序包,必须与微信后台“开发设置 → 服务器域名 → request 合法域名”一致;不一致会导致小程序打开即加载失败。"
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ export function PublicationPage() {
|
|||||||
{confirmAction === "revoke" ? (
|
{confirmAction === "revoke" ? (
|
||||||
<Alert
|
<Alert
|
||||||
type="warning"
|
type="warning"
|
||||||
message="撤回后,小程序将显示品牌尚未发布,新的咨询和预约会停止受理。"
|
title="撤回后,小程序将显示品牌尚未发布,新的咨询和预约会停止受理。"
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div className="admin-stack">
|
<div className="admin-stack">
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ export function OfferingEditorModal({
|
|||||||
<Alert
|
<Alert
|
||||||
type="info"
|
type="info"
|
||||||
showIcon
|
showIcon
|
||||||
message={previewPage === "offerings" ? "正在核对列表展示" : "正在核对详情展示"}
|
title={previewPage === "offerings" ? "正在核对列表展示" : "正在核对详情展示"}
|
||||||
description={
|
description={
|
||||||
previewPage === "offerings"
|
previewPage === "offerings"
|
||||||
? "右侧「列表展示」字段修改后,会实时反映在当前卡片。"
|
? "右侧「列表展示」字段修改后,会实时反映在当前卡片。"
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export function MembersPage() {
|
|||||||
type="info"
|
type="info"
|
||||||
showIcon
|
showIcon
|
||||||
className="admin-offset-bottom"
|
className="admin-offset-bottom"
|
||||||
message="请将初始账号和密码安全地交给成员"
|
title="请将初始账号和密码安全地交给成员"
|
||||||
description="当前采用负责人手动添加方式;系统不会再次显示成员初始密码。"
|
description="当前采用负责人手动添加方式;系统不会再次显示成员初始密码。"
|
||||||
/>
|
/>
|
||||||
<Table
|
<Table
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ export function TemplateManagementPage() {
|
|||||||
<Alert
|
<Alert
|
||||||
type="info"
|
type="info"
|
||||||
showIcon
|
showIcon
|
||||||
message="导入规则"
|
title="导入规则"
|
||||||
description="系统会校验文件路径、链接、文件数量、解压体积、template.json、package.json 和 checksums.json;包内脚本不会被执行。"
|
description="系统会校验文件路径、链接、文件数量、解压体积、template.json、package.json 和 checksums.json;包内脚本不会被执行。"
|
||||||
/>
|
/>
|
||||||
{importing.isError ? <ErrorNote error={importing.error} /> : null}
|
{importing.isError ? <ErrorNote error={importing.error} /> : null}
|
||||||
@@ -118,7 +118,7 @@ export function TemplateManagementPage() {
|
|||||||
<Alert
|
<Alert
|
||||||
type="success"
|
type="success"
|
||||||
showIcon
|
showIcon
|
||||||
message={importing.data.idempotent ? "模板版本已存在,未重复写入" : "模板版本导入成功"}
|
title={importing.data.idempotent ? "模板版本已存在,未重复写入" : "模板版本导入成功"}
|
||||||
description={`${importing.data.version.packageKey}@${importing.data.version.version}`}
|
description={`${importing.data.version.packageKey}@${importing.data.version.version}`}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ export function TemplatePackagePreviewModal({
|
|||||||
<Alert
|
<Alert
|
||||||
type="info"
|
type="info"
|
||||||
showIcon
|
showIcon
|
||||||
message="模板演示预览"
|
title="模板演示预览"
|
||||||
description="演示内容不属于真实品牌,咨询提交和客户记录读取已禁用。"
|
description="演示内容不属于真实品牌,咨询提交和客户记录读取已禁用。"
|
||||||
/>
|
/>
|
||||||
{!industry ? (
|
{!industry ? (
|
||||||
@@ -92,12 +92,7 @@ export function TemplatePackagePreviewModal({
|
|||||||
{data ? (
|
{data ? (
|
||||||
<>
|
<>
|
||||||
{data.preview.diagnostics.map((diagnostic) => (
|
{data.preview.diagnostics.map((diagnostic) => (
|
||||||
<Alert
|
<Alert key={diagnostic.code} type="warning" showIcon title={diagnostic.message} />
|
||||||
key={diagnostic.code}
|
|
||||||
type="warning"
|
|
||||||
showIcon
|
|
||||||
message={diagnostic.message}
|
|
||||||
/>
|
|
||||||
))}
|
))}
|
||||||
<Typography.Text type="secondary">
|
<Typography.Text type="secondary">
|
||||||
演示数据:
|
演示数据:
|
||||||
|
|||||||
Reference in new issue
Block a user