diff --git a/src/page/Order/AuditResult/index.tsx b/src/page/Order/AuditResult/index.tsx index f6832bba..8b673baf 100644 --- a/src/page/Order/AuditResult/index.tsx +++ b/src/page/Order/AuditResult/index.tsx @@ -159,7 +159,7 @@ const AuditResult: React.FC = (props) => { }, [pagination, filterInfo, duplicate, props.taskId, getAuditTaskSql]); return ( - + { currentTabKey: string ) => { if (values.isSameSqlOrder) { - auditOrderWithSameSql(values); + return auditOrderWithSameSql(values); } else { - auditOrderWthDifferenceSql(values, currentTabIndex, currentTabKey); + return auditOrderWthDifferenceSql( + values, + currentTabIndex, + currentTabKey + ); } }, [auditOrderWithSameSql, auditOrderWthDifferenceSql] diff --git a/src/page/SqlAuditRecord/Create/index.tsx b/src/page/SqlAuditRecord/Create/index.tsx index 521fcbe1..50744977 100644 --- a/src/page/SqlAuditRecord/Create/index.tsx +++ b/src/page/SqlAuditRecord/Create/index.tsx @@ -33,6 +33,16 @@ const SQLAuditCreate: React.FC = () => { const baseRef = useRef(null); const sqlInfoRef = useRef(null); + const scrollToAuditResult = () => { + const auditResultCardElement = document.getElementById( + 'audit-result-task-card' + ); + auditResultCardElement?.scrollIntoView({ + behavior: 'smooth', + block: 'end', + }); + }; + const auditSQL: SQLInfoFormProps['submit'] = async (values) => { const baseValues = await baseForm.validateFields(); const params: ICreateSQLAuditRecordV1Params = { @@ -56,6 +66,7 @@ const SQLAuditCreate: React.FC = () => { } else { setTask(res.data.data.task); message.success(t('sqlAudit.create.SQLInfo.successTips')); + scrollToAuditResult(); } } }); @@ -75,6 +86,7 @@ const SQLAuditCreate: React.FC = () => { if (res.data.code === ResponseCode.SUCCESS) { setTask(record.task); message.success(t('sqlAudit.create.SQLInfo.successTips')); + scrollToAuditResult(); } }); }; @@ -82,6 +94,7 @@ const SQLAuditCreate: React.FC = () => { const resetForm = () => { baseRef.current?.reset(); sqlInfoRef.current?.reset(); + setTask(undefined); }; return (