|
|
@@ -19,10 +19,13 @@ import MeButton from '@/pages/security/components/MeButton';
|
|
|
import Profile from '@/pages/security/Profile';
|
|
|
import ExamPage from '@/pages/exam/ExamPage';
|
|
|
import { RootState } from '@/states/store';
|
|
|
+import store from '@/states/store';
|
|
|
import { setBusinessFlow } from '@/states/BusinessFlowSlice';
|
|
|
import ImageProcessingPage from '@/pages/view/ImageProcessingPage';
|
|
|
import PrintPage from '@/pages/output/print/PrintPage';
|
|
|
import { pageLayoutConfig } from '@/config/pageLayout';
|
|
|
+import historyToPrint from '@/domain/patient/historyToPrint';
|
|
|
+import { message } from 'antd';
|
|
|
|
|
|
// import { Link } from 'react-router-dom';
|
|
|
// import { MenuOutlined } from '@ant-design/icons';
|
|
|
@@ -69,8 +72,34 @@ const BasicLayout: React.FC<BasicLayoutProps> = () => {
|
|
|
print: <PrintPage />,
|
|
|
};
|
|
|
//感知菜单项点击
|
|
|
- const handleMenuClick = (key: string) => {
|
|
|
- dispatch(setBusinessFlow(key));
|
|
|
+ const handleMenuClick = async (key: string) => {
|
|
|
+ // 特殊处理打印按钮
|
|
|
+ if (key === 'print') {
|
|
|
+ // 获取当前选中的记录
|
|
|
+ const state = store.getState();
|
|
|
+ const selectedIds =
|
|
|
+ currentKey === 'historylist'
|
|
|
+ ? state.historySelection.selectedIds
|
|
|
+ : currentKey === 'worklist'
|
|
|
+ ? state.workSelection.selectedIds
|
|
|
+ : [];
|
|
|
+
|
|
|
+ if (selectedIds.length === 0) {
|
|
|
+ message.warning('请先选择要打印的项目');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ try {
|
|
|
+ // 调用 historyToPrint 加载数据并跳转
|
|
|
+ await historyToPrint(selectedIds);
|
|
|
+ } catch (error) {
|
|
|
+ console.error('[BusinessZone] Print error:', error);
|
|
|
+ message.error('加载打印数据失败,请重试');
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 其他按钮直接切换页面
|
|
|
+ dispatch(setBusinessFlow(key));
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
return (
|