|
@@ -64,6 +64,21 @@ const Login: React.FC = () => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ // 急诊操作处理流程
|
|
|
+ const handleEmergencyClick = async (e: React.MouseEvent<HTMLElement>) => {
|
|
|
+ e.preventDefault(); // 阻止表单提交
|
|
|
+ try {
|
|
|
+ await handleEmergencyOperation();
|
|
|
+ message.success('急诊模式启动成功');
|
|
|
+ } catch (e) {
|
|
|
+ dispatch(setSystemMode(SystemMode.Normal));
|
|
|
+ message.error(
|
|
|
+ `急诊操作失败: ${e instanceof Error ? e.message : '未知错误'}`
|
|
|
+ );
|
|
|
+ console.error('Emergency operation failed:', e);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
return (
|
|
|
<Row
|
|
|
className="fixed inset-0 z-50 bg-white bg-opacity-100 w-full h-full flex items-center justify-center"
|
|
@@ -126,7 +141,7 @@ const Login: React.FC = () => {
|
|
|
type="primary"
|
|
|
size="large"
|
|
|
className="w-full"
|
|
|
- onClick={handleEmergencyOperation}
|
|
|
+ onClick={handleEmergencyClick}
|
|
|
>
|
|
|
急诊
|
|
|
</Button>
|