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