|
|
|
@ -41,7 +41,7 @@ const HandleButtonGroup: React.FC<HandleButtonGroupProps> = ({
|
|
|
|
|
|
|
|
|
|
|
|
// 检查组件状态是否符合条件
|
|
|
|
// 检查组件状态是否符合条件
|
|
|
|
const isEligible = (eligibleStatuses: string[], currentStatus: string) => {
|
|
|
|
const isEligible = (eligibleStatuses: string[], currentStatus: string) => {
|
|
|
|
return eligibleStatuses.includes(currentStatus);
|
|
|
|
return eligibleStatuses.includes(currentStatus.toLowerCase());
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 构建更多操作菜单
|
|
|
|
// 构建更多操作菜单
|
|
|
|
@ -96,15 +96,17 @@ const HandleButtonGroup: React.FC<HandleButtonGroupProps> = ({
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<>
|
|
|
|
{/* 发布组件/更新版本/查看审核 */}
|
|
|
|
{/* 发布组件/更新版本*/}
|
|
|
|
{row.publicStatus !== publicStatus.REVIEW ? (
|
|
|
|
{row.publicStatus !== publicStatus.REVIEW && isEligible([componentStatusConstant.CODING, componentStatusConstant.DEPLOYED, componentStatusConstant.PUBLISHED], row.componentStatus) && (
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
type="text"
|
|
|
|
type="text"
|
|
|
|
onClick={() => onHandlePublishComponent(row)}
|
|
|
|
onClick={() => onHandlePublishComponent(row)}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{row.publicStatus === publicStatus.PUBLISHED ? '更新版本' : '发布组件'}
|
|
|
|
{row.publicStatus === publicStatus.PUBLISHED ? '更新版本' : '发布组件'}
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
) : (
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{(row.publicStatus === publicStatus.REVIEW || row.publicStatus === publicStatus.REJECTED) && (
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
type="text"
|
|
|
|
type="text"
|
|
|
|
onClick={() => onGoToReview(row)}
|
|
|
|
onClick={() => onGoToReview(row)}
|
|
|
|
@ -130,16 +132,6 @@ const HandleButtonGroup: React.FC<HandleButtonGroupProps> = ({
|
|
|
|
</Button>
|
|
|
|
</Button>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
|
|
{/* 接口设计/查看接口 */}
|
|
|
|
|
|
|
|
{isEligible([componentStatusConstant.DESIGN, componentStatusConstant.DEFAULT], row.componentStatus) ? (
|
|
|
|
|
|
|
|
<Button
|
|
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
|
|
onClick={() => onNavTo(row.id, '接口设计')}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
接口设计
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
) : null}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{/* 组件编码 */}
|
|
|
|
{/* 组件编码 */}
|
|
|
|
{isEligible([componentStatusConstant.CODING], row.componentStatus) ? (
|
|
|
|
{isEligible([componentStatusConstant.CODING], row.componentStatus) ? (
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
@ -151,8 +143,8 @@ const HandleButtonGroup: React.FC<HandleButtonGroupProps> = ({
|
|
|
|
) : null}
|
|
|
|
) : null}
|
|
|
|
|
|
|
|
|
|
|
|
{/* 查看源码 */}
|
|
|
|
{/* 查看源码 */}
|
|
|
|
{!isEligible(
|
|
|
|
{isEligible(
|
|
|
|
[componentStatusConstant.CODING, componentStatusConstant.DESIGN, componentStatusConstant.DEFAULT],
|
|
|
|
[componentStatusConstant.CODING, componentStatusConstant.DEPLOYED, componentStatusConstant.PUBLISHED],
|
|
|
|
row.componentStatus
|
|
|
|
row.componentStatus
|
|
|
|
) ? (
|
|
|
|
) ? (
|
|
|
|
<Button
|
|
|
|
<Button
|
|
|
|
|