From 8b2ca9083d72b8408f7035a2774af918ea85b5dc Mon Sep 17 00:00:00 2001 From: ZLY Date: Wed, 12 Nov 2025 14:26:22 +0800 Subject: [PATCH] =?UTF-8?q?fix(component):=E4=BF=AE=E5=A4=8D=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E7=8A=B6=E6=80=81=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 统一使用小写比较组件状态 - 调整发布组件按钮的显示条件 - 移除接口设计按钮相关代码 - 修改查看源码按钮的显示状态条件 - 优化组件编码页面信息获取逻辑 --- .../componentCoding/index.tsx | 2 +- .../componentList/handleButtonGroup.tsx | 24 +++++++------------ 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/src/pages/componentDevelopment/componentCoding/index.tsx b/src/pages/componentDevelopment/componentCoding/index.tsx index 2aa73b6..b618264 100644 --- a/src/pages/componentDevelopment/componentCoding/index.tsx +++ b/src/pages/componentDevelopment/componentCoding/index.tsx @@ -44,7 +44,7 @@ const ComponentCoding = () => { }, []); useEffect(() => { - getComponentInfo(); + componentCoding.id && getComponentInfo(); const uri = process.env.NEXT_PUBLIC_DEV_CODE_SERVER_HOST; const codeServerFolderPre = '/app/data'; diff --git a/src/pages/componentDevelopment/componentList/handleButtonGroup.tsx b/src/pages/componentDevelopment/componentList/handleButtonGroup.tsx index e9f9473..e8d17d3 100644 --- a/src/pages/componentDevelopment/componentList/handleButtonGroup.tsx +++ b/src/pages/componentDevelopment/componentList/handleButtonGroup.tsx @@ -41,7 +41,7 @@ const HandleButtonGroup: React.FC = ({ // 检查组件状态是否符合条件 const isEligible = (eligibleStatuses: string[], currentStatus: string) => { - return eligibleStatuses.includes(currentStatus); + return eligibleStatuses.includes(currentStatus.toLowerCase()); }; // 构建更多操作菜单 @@ -96,15 +96,17 @@ const HandleButtonGroup: React.FC = ({ return ( <> - {/* 发布组件/更新版本/查看审核 */} - {row.publicStatus !== publicStatus.REVIEW ? ( + {/* 发布组件/更新版本*/} + {row.publicStatus !== publicStatus.REVIEW && isEligible([componentStatusConstant.CODING, componentStatusConstant.DEPLOYED, componentStatusConstant.PUBLISHED], row.componentStatus) && ( - ) : ( + )} + + {(row.publicStatus === publicStatus.REVIEW || row.publicStatus === publicStatus.REJECTED) && ( )} - {/* 接口设计/查看接口 */} - {isEligible([componentStatusConstant.DESIGN, componentStatusConstant.DEFAULT], row.componentStatus) ? ( - - ) : null} - {/* 组件编码 */} {isEligible([componentStatusConstant.CODING], row.componentStatus) ? (