Просмотр исходного кода

fix 1.63.4 : 人医第一个,注册时有默认值

dengdx 6 дней назад
Родитель
Сommit
97159fac0f

+ 0 - 11
CHANGELOG.md

@@ -2,17 +2,6 @@
 
 
 本项目的所有重要变更都将记录在此文件中.
 本项目的所有重要变更都将记录在此文件中.
 
 
-## [1.64.0] - 2026-01-09 17:14
-
-### 新增 (Added)
-
-- **添加浏览器环境下底部栏直接退出登录功能** - 优化退出登录流程,在浏览器环境下直接执行应用级注销,包括清除用户信息、重置系统模式、重置业务流程、清理工单缓存和体位列表,避免弹出确认对话框,提升用户体验
-
-**改动文件:**
-
-- src/layouts/BottomBar.tsx
-
-
 ## [1.63.3] - 2026-01-09 12:50
 ## [1.63.3] - 2026-01-09 12:50
 
 
 ### 修复 (Fixed)
 ### 修复 (Fixed)

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "zsis",
   "name": "zsis",
-  "version": "1.64.0",
+  "version": "1.63.3",
   "private": true,
   "private": true,
   "description": "医学成像系统",
   "description": "医学成像系统",
   "main": "main.js",
   "main": "main.js",

+ 4 - 31
src/layouts/BottomBar.tsx

@@ -1,8 +1,8 @@
 import React, { useState } from 'react';
 import React, { useState } from 'react';
-import { Row, Col, message } from 'antd';
-import { useDispatch, useSelector } from 'react-redux';
+import { Row, Col } from 'antd';
+import { useSelector } from 'react-redux';
 import { RootState } from '@/states/store';
 import { RootState } from '@/states/store';
-import { clearUserInfo, isLoggedIn } from '../states/user_info';
+import { isLoggedIn } from '../states/user_info';
 import Icon from '@/components/Icon';
 import Icon from '@/components/Icon';
 import { IconButton } from '@/components/IconButton';
 import { IconButton } from '@/components/IconButton';
 import ExitModal from '@/components/ExitModal';
 import ExitModal from '@/components/ExitModal';
@@ -11,11 +11,6 @@ import { FormattedMessage } from 'react-intl';
 import logo from '@/assets/imgs/bzylogo.png';
 import logo from '@/assets/imgs/bzylogo.png';
 import logo_human from '@/assets/imgs/human-logo.png';
 import logo_human from '@/assets/imgs/human-logo.png';
 import { useAppSelector } from '@/states/store';
 import { useAppSelector } from '@/states/store';
-import { getPlatformInfo } from '@/utils/platform';
-import { setSystemMode, SystemMode } from '@/states/systemModeSlice';
-import { setBusinessFlow } from '@/states/BusinessFlowSlice';
-import { clearWorks } from '@/states/exam/examWorksCacheSlice';
-import { setBodyPositions, setSelectedBodyPosition } from '@/states/exam/bodyPositionListSlice';
 
 
 const BottomBar: React.FC = () => {
 const BottomBar: React.FC = () => {
     const { themeType, currentTheme } = useAppSelector((state) => state.theme);
     const { themeType, currentTheme } = useAppSelector((state) => state.theme);
@@ -23,29 +18,11 @@ const BottomBar: React.FC = () => {
     const username = useSelector((state: RootState) => state.userInfo.name);
     const username = useSelector((state: RootState) => state.userInfo.name);
     const avatarUrl = useSelector((state: RootState) => state.userInfo.avatar);
     const avatarUrl = useSelector((state: RootState) => state.userInfo.avatar);
     const productName = useAppSelector((state) => state.product.productName);
     const productName = useAppSelector((state) => state.product.productName);
-    const dispatch = useDispatch();
+
     // 退出弹框状态管理
     // 退出弹框状态管理
     const [exitModalVisible, setExitModalVisible] = useState(false);
     const [exitModalVisible, setExitModalVisible] = useState(false);
 
 
     const handleExitClick = (): void => {
     const handleExitClick = (): void => {
-        const platformInfo = getPlatformInfo();
-        if (platformInfo.isBrowser) {
-            // 浏览器环境下,直接退出登录            
-            // 应用级注销:清除所有用户相关状态
-            // 1. 清除用户信息
-            dispatch(clearUserInfo());
-            // 2. 重置系统模式,避免急诊模式注销后黑屏
-            dispatch(setSystemMode(SystemMode.Normal));
-            // 3. 重置业务流程到注册页面,避免直接进入检查页面
-            dispatch(setBusinessFlow('register'));
-            // 4. 清理工单缓存,避免患者数据泄露
-            dispatch(clearWorks());
-            // 5. 清理体位列表,避免患者数据泄露
-            dispatch(setBodyPositions([]));
-            dispatch(setSelectedBodyPosition(null));
-            message.success('已退出登录');
-            return;
-        }
         setExitModalVisible(true);
         setExitModalVisible(true);
     };
     };
 
 
@@ -160,7 +137,3 @@ const BottomBar: React.FC = () => {
 };
 };
 
 
 export default BottomBar;
 export default BottomBar;
-function dispatch(arg0: any) {
-    throw new Error('Function not implemented.');
-}
-

+ 43 - 43
src/layouts/BusinessZone.tsx

@@ -63,51 +63,51 @@ function useItems(btnAvailability: Record<string, boolean>, productName: 'DROS'
           ),
           ),
           //icon: 'Registration',
           //icon: 'Registration',
         },
         },
-        ...(isAnimalProduct ? [] : [{
-          key: 'archivelist',
-          disabled: !btnAvailability['archivelist'],
-          label: (
-            <FormattedMessage
-              id="archivelist"
-              defaultMessage={'语言包中没有定义patient的翻译文本'}
-            />
-          ),
-          //icon: 'Registration',
-        }]),
-        ...(isAnimalProduct ? [] : [{
-          key: 'bin',
-          disabled: !btnAvailability['bin'],
-          label: (
-            <FormattedMessage
-              id="bin"
-              defaultMessage={'语言包中没有定义patient的翻译文本'}
-            />
-          ),
-        }]),
-        {
-          key: 'outputlist',
-          disabled: !btnAvailability['outputlist'],
-          label: (
-            <FormattedMessage
-              id="outputlist"
-              defaultMessage={'语言包中没有定义patient的翻译文本'}
-            />
-          ),
-          //icon: 'Registration',
-        },
+        // ...(isAnimalProduct ? [] : [{
+        //   key: 'archivelist',
+        //   disabled: !btnAvailability['archivelist'],
+        //   label: (
+        //     <FormattedMessage
+        //       id="archivelist"
+        //       defaultMessage={'语言包中没有定义patient的翻译文本'}
+        //     />
+        //   ),
+        //   //icon: 'Registration',
+        // }]),
+        // ...(isAnimalProduct ? [] : [{
+        //   key: 'bin',
+        //   disabled: !btnAvailability['bin'],
+        //   label: (
+        //     <FormattedMessage
+        //       id="bin"
+        //       defaultMessage={'语言包中没有定义patient的翻译文本'}
+        //     />
+        //   ),
+        // }]),
+        // {
+        //   key: 'outputlist',
+        //   disabled: !btnAvailability['outputlist'],
+        //   label: (
+        //     <FormattedMessage
+        //       id="outputlist"
+        //       defaultMessage={'语言包中没有定义patient的翻译文本'}
+        //     />
+        //   ),
+        //   //icon: 'Registration',
+        // },
       ],
       ],
     },
     },
-    {
-      key: 'emergency',
-      //icon: 'Emergency',
-      label: (
-            <FormattedMessage
-              id="login.emergency"
-              defaultMessage={'语言包中没有定义patient的翻译文本'}
-            />
-          ),
-      disabled: !btnAvailability['emergency'],
-    },
+    // {
+    //   key: 'emergency',
+    //   //icon: 'Emergency',
+    //   label: (
+    //         <FormattedMessage
+    //           id="login.emergency"
+    //           defaultMessage={'语言包中没有定义patient的翻译文本'}
+    //         />
+    //       ),
+    //   disabled: !btnAvailability['emergency'],
+    // },
     {
     {
       key: 'exam',
       key: 'exam',
       disabled:
       disabled:

+ 25 - 9
src/pages/patient/components/RegisterAvailableFilterBar.tsx

@@ -1,5 +1,5 @@
-import React from 'react';
-import { Row, Col, Segmented, Select } from 'antd';
+import React, { useEffect } from 'react';
+import { Row, Col, Segmented } from 'antd';
 import { useSelector, useDispatch } from 'react-redux';
 import { useSelector, useDispatch } from 'react-redux';
 import { AppDispatch } from '@/states/store';
 import { AppDispatch } from '@/states/store';
 import { setCurrentPatientType } from '@/states/patientTypeSlice';
 import { setCurrentPatientType } from '@/states/patientTypeSlice';
@@ -61,13 +61,31 @@ const RegisterAvailableFilterBar: React.FC<Props> = ({
     id: productName === 'VETDROS' ? 'animal.register.patientType' : 'register.patientType',
     id: productName === 'VETDROS' ? 'animal.register.patientType' : 'register.patientType',
     defaultMessage: productName === 'VETDROS' ? '宠物类型' : '患者类型',
     defaultMessage: productName === 'VETDROS' ? '宠物类型' : '患者类型',
   });
   });
+
+  // 设置默认患者类型
+  useEffect(() => {
+    // 如果没有当前选中的患者类型,且患者类型列表不为空,则设置第一个为默认值
+    if (!currentPatientType && patientTypes.length > 0) {
+      const defaultPatientType = patientTypes[0];
+      dispatch(setCurrentPatientType(defaultPatientType));
+      setPatientType(defaultPatientType.patient_type_id);
+      dispatch(
+        fetchViewsOrProtocols({
+          selection: selected,
+          patientType: defaultPatientType.patient_type_id,
+          bodyPart: currentBodyPart?.body_part_id ?? null,
+        })
+      );
+    }
+  }, [patientTypes, currentPatientType, dispatch, selected, currentBodyPart, setPatientType]);
+
   return (
   return (
     <div
     <div
       className="z-10"
       className="z-10"
       style={{ padding: 16, borderBottom: '1px solid #f0f0f0' }}
       style={{ padding: 16, borderBottom: '1px solid #f0f0f0' }}
     >
     >
       <Row gutter={[16, 16]}>
       <Row gutter={[16, 16]}>
-        <Col xs={24} sm={12} md={12} lg={12} xl={12}>
+        <Col xs={24} sm={12} md={12} lg={24} xl={24}>
           <Segmented
           <Segmented
             options={[
             options={[
               { label: protocolText, value: 'protocol' },
               { label: protocolText, value: 'protocol' },
@@ -87,11 +105,9 @@ const RegisterAvailableFilterBar: React.FC<Props> = ({
             block
             block
           />
           />
         </Col>
         </Col>
-        <Col xs={24} sm={12} md={12} lg={12} xl={12}>
-          <Select
-            allowClear
-            style={{ width: '100%' }}
-            placeholder={patientTypePlaceholder}
+        <Col xs={24} sm={12} md={12} lg={24} xl={24}>
+          <Segmented
+            block
             options={patientTypes.map((item: PatientType) => ({
             options={patientTypes.map((item: PatientType) => ({
               label: intl.formatMessage({
               label: intl.formatMessage({
                 id: `register.${item.patient_type_name.toLowerCase()}`,
                 id: `register.${item.patient_type_name.toLowerCase()}`,
@@ -101,7 +117,7 @@ const RegisterAvailableFilterBar: React.FC<Props> = ({
             }))}
             }))}
             value={currentPatientType?.patient_type_id}
             value={currentPatientType?.patient_type_id}
             onChange={(val) => {
             onChange={(val) => {
-              setPatientType(val);
+              setPatientType(val as string);
               const selectedPatientType = patientTypes.find(
               const selectedPatientType = patientTypes.find(
                 (item) => item.patient_type_id === val
                 (item) => item.patient_type_id === val
               );
               );

+ 2 - 2
src/pages/security/Login.tsx

@@ -174,14 +174,14 @@ const Login: React.FC = () => {
                   </Button>
                   </Button>
                 </Col>
                 </Col>
                 <Col span={12}>
                 <Col span={12}>
-                  <Button
+                  {/* <Button
                     type="primary"
                     type="primary"
                     size="large"
                     size="large"
                     className="w-full"
                     className="w-full"
                     onClick={handleEmergencyClick}
                     onClick={handleEmergencyClick}
                   >
                   >
                     <FormattedMessage id="login.emergency" />
                     <FormattedMessage id="login.emergency" />
-                  </Button>
+                  </Button> */}
                 </Col>
                 </Col>
               </Row>
               </Row>
             </Form.Item>
             </Form.Item>