|
|
|
|
@ -12,7 +12,7 @@ interface HandleButtonGroupProps {
|
|
|
|
|
index: number;
|
|
|
|
|
permission?: string; // 协作权限:admin, write, read
|
|
|
|
|
isCollaborator?: boolean; // 是否为协作组件
|
|
|
|
|
onHandlePublishComponent: (row: ComponentItem) => void;
|
|
|
|
|
onHandlePublishComponent: (row: ComponentItem, type: 'publish' | 'upload') => void;
|
|
|
|
|
onGoToReview: (row: ComponentItem) => void;
|
|
|
|
|
onPublishOrRevokeComponent: (action: 'publish' | 'revoke', identifier: string, version: string) => void;
|
|
|
|
|
onSourceCodeView: (row: ComponentItem) => void;
|
|
|
|
|
@ -72,6 +72,25 @@ const HandleButtonGroup: React.FC<HandleButtonGroupProps> = ({
|
|
|
|
|
}
|
|
|
|
|
// 以下操作只在"我的组件"tab显示
|
|
|
|
|
if (!isCollaborator) {
|
|
|
|
|
// 上传组件
|
|
|
|
|
//
|
|
|
|
|
if (row.publicStatus !== publicStatus.REVIEW && isEligible([componentStatusConstant.CODING, componentStatusConstant.DEPLOYED, componentStatusConstant.PUBLISHED], row.componentStatus)) {
|
|
|
|
|
items.push(
|
|
|
|
|
<Menu.Item key="upload">
|
|
|
|
|
<Button type="text" onClick={() => onHandlePublishComponent(row, 'upload')}>上传组件</Button>
|
|
|
|
|
</Menu.Item>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 下载组件
|
|
|
|
|
items.push(
|
|
|
|
|
<Menu.Item key="export">
|
|
|
|
|
<Button type="text" onClick={() => onExportComponent(row)}>下载组件</Button>
|
|
|
|
|
</Menu.Item>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 组件复制 - 所有权限都可以复制
|
|
|
|
|
if (!isEligible([componentStatusConstant.DEFAULT, componentStatusConstant.DESIGN], row.componentStatus)) {
|
|
|
|
|
items.push(
|
|
|
|
|
@ -128,7 +147,7 @@ const HandleButtonGroup: React.FC<HandleButtonGroupProps> = ({
|
|
|
|
|
{row.publicStatus !== publicStatus.REVIEW && isEligible([componentStatusConstant.CODING, componentStatusConstant.DEPLOYED, componentStatusConstant.PUBLISHED], row.componentStatus) && (
|
|
|
|
|
<Button
|
|
|
|
|
type="text"
|
|
|
|
|
onClick={() => onHandlePublishComponent(row)}
|
|
|
|
|
onClick={() => onHandlePublishComponent(row, 'publish')}
|
|
|
|
|
>
|
|
|
|
|
{row.publicStatus === publicStatus.PUBLISHED ? '更新版本' : '发布组件'}
|
|
|
|
|
</Button>
|
|
|
|
|
|