收敛审批动作面板并清理层叠遗留 [approval-action-panel-kiss-layering]
这个提交包含在:
@@ -83,6 +83,7 @@ function hasVisibleNode(node: ReactNode): boolean {
|
||||
export function BusinessDetailActionPanel({
|
||||
title = "操作",
|
||||
status,
|
||||
beforeActions,
|
||||
primaryAction,
|
||||
secondaryActions,
|
||||
moreActions,
|
||||
@@ -93,6 +94,7 @@ export function BusinessDetailActionPanel({
|
||||
}: {
|
||||
title?: string;
|
||||
status?: ReactNode;
|
||||
beforeActions?: ReactNode;
|
||||
primaryAction?: ReactNode;
|
||||
secondaryActions?: ReactNode;
|
||||
moreActions?: ReactNode;
|
||||
@@ -102,21 +104,23 @@ export function BusinessDetailActionPanel({
|
||||
testId?: string;
|
||||
}) {
|
||||
const hasStatus = hasVisibleNode(status);
|
||||
const hasBeforeActions = hasVisibleNode(beforeActions);
|
||||
const hasPrimaryAction = hasVisibleNode(primaryAction);
|
||||
const hasSecondaryActions = hasVisibleNode(secondaryActions);
|
||||
const hasMoreActions = hasVisibleNode(moreActions);
|
||||
const hasSummary = hasVisibleNode(summary);
|
||||
const hasChildren = hasVisibleNode(children);
|
||||
const hasActionContent = hasPrimaryAction || hasSecondaryActions || hasMoreActions;
|
||||
const hasContentBeforeSummary = hasActionContent || hasChildren;
|
||||
const hasContentBeforeSummary = hasBeforeActions || hasActionContent || hasChildren;
|
||||
|
||||
if (!hasStatus && !hasActionContent && !hasSummary && !hasChildren) {
|
||||
if (!hasStatus && !hasBeforeActions && !hasActionContent && !hasSummary && !hasChildren) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<SectionPanel title={title} actions={status} className={cn("detail-action-panel lg:sticky lg:top-24", className)}>
|
||||
<div className="detail-action-stack" data-testid={testId}>
|
||||
{hasBeforeActions ? <div>{beforeActions}</div> : null}
|
||||
{hasPrimaryAction ? <div className="grid gap-2">{primaryAction}</div> : null}
|
||||
{hasSecondaryActions ? <div className="workflow-action-bar">{secondaryActions}</div> : null}
|
||||
{hasMoreActions ? <div className="border-t border-zinc-200 pt-3">{moreActions}</div> : null}
|
||||
|
||||
在新工单中引用
屏蔽一个用户