diff --git a/frontend/src/pages/Dashboard/components/ApplicationCard.tsx b/frontend/src/pages/Dashboard/components/ApplicationCard.tsx index 72308358..03528b23 100644 --- a/frontend/src/pages/Dashboard/components/ApplicationCard.tsx +++ b/frontend/src/pages/Dashboard/components/ApplicationCard.tsx @@ -80,7 +80,7 @@ export const ApplicationCard: React.FC = ({ {app.branch ? ( {app.branch} ) : ( - + 未配置分支 )} diff --git a/frontend/src/pages/Dashboard/components/DeploymentFormModal.tsx b/frontend/src/pages/Dashboard/components/DeploymentFormModal.tsx index 4a07b2e1..f8a456c4 100644 --- a/frontend/src/pages/Dashboard/components/DeploymentFormModal.tsx +++ b/frontend/src/pages/Dashboard/components/DeploymentFormModal.tsx @@ -59,7 +59,7 @@ const DeploymentFormModal: React.FC = ({ environmentCode: environment.environmentCode || '', environmentName: environment.environmentName || '', // 任务编号(自动生成) - taskNo: '', + deployRemark: '', // 审批信息 approval: { required: environment.requiresApproval ? 'true' : 'false', diff --git a/frontend/src/pages/Dashboard/components/EnvironmentTabs.tsx b/frontend/src/pages/Dashboard/components/EnvironmentTabs.tsx index 8ea716ea..44de46f4 100644 --- a/frontend/src/pages/Dashboard/components/EnvironmentTabs.tsx +++ b/frontend/src/pages/Dashboard/components/EnvironmentTabs.tsx @@ -104,7 +104,7 @@ export const EnvironmentTabs: React.FC = React.memo(({ ) : ( -
+
{env.applications.map((app) => ( { - if (!code || code.length < 1) return; - - try { - const isUnique = await checkTemplateCodeUnique(code, editId); - if (!isUnique) { - setError('code', { message: '模板编码已存在' }); - } else { - clearErrors('code'); - } - } catch (error) { - console.error('Failed to check code uniqueness:', error); - } - }; + // 验证编码唯一性 - 暂时注释掉,后端没有这个接口 + // const validateCodeUnique = async (code: string) => { + // if (!code || code.length < 1) return; + // + // try { + // const isUnique = await checkTemplateCodeUnique(code, editId); + // if (!isUnique) { + // setError('code', { message: '模板编码已存在' }); + // } else { + // clearErrors('code'); + // } + // } catch (error) { + // console.error('Failed to check code uniqueness:', error); + // } + // }; - // 监听编码变化进行唯一性验证 - useEffect(() => { - if (watchedCode && mode === 'create') { - const timer = setTimeout(() => { - validateCodeUnique(watchedCode); - }, 500); - return () => clearTimeout(timer); - } - }, [watchedCode, mode]); + // 监听编码变化进行唯一性验证 - 暂时注释掉,后端没有这个接口 + // useEffect(() => { + // if (watchedCode && mode === 'create') { + // const timer = setTimeout(() => { + // validateCodeUnique(watchedCode); + // }, 500); + // return () => clearTimeout(timer); + // } + // }, [watchedCode, mode]); // 加载编辑数据 useEffect(() => { diff --git a/frontend/src/pages/Deploy/NotificationTemplate/List/service.ts b/frontend/src/pages/Deploy/NotificationTemplate/List/service.ts index b48a796a..a91ed0a2 100644 --- a/frontend/src/pages/Deploy/NotificationTemplate/List/service.ts +++ b/frontend/src/pages/Deploy/NotificationTemplate/List/service.ts @@ -126,15 +126,16 @@ export const batchDisableTemplates = async (ids: number[]): Promise => { /** * 检查模板编码是否唯一 + * 注:后端暂无此接口,临时注释掉 */ -export const checkTemplateCodeUnique = async ( - code: string, - excludeId?: number -): Promise => { - return request.get(`${API_PREFIX}/check-code`, { - params: { code, excludeId }, - }); -}; +// export const checkTemplateCodeUnique = async ( +// code: string, +// excludeId?: number +// ): Promise => { +// return request.get(`${API_PREFIX}/check-code`, { +// params: { code, excludeId }, +// }); +// }; /** * 渲染模板(根据模板内容)