|
@@ -4,9 +4,10 @@ import { CloseOutlined } from '@ant-design/icons';
|
|
|
import { getViewIconUrl } from '@/API/bodyPosition';
|
|
|
import { Image } from 'antd';
|
|
|
import { FormattedMessage } from 'react-intl';
|
|
|
-import { useSelector } from 'react-redux';
|
|
|
+import { useSelector, useDispatch } from 'react-redux';
|
|
|
import type { RootState } from '@/states/store';
|
|
|
import type { View } from '@/states/patient/viewSelection';
|
|
|
+import { removeSelectedView } from '@/states/patient/viewSelection';
|
|
|
|
|
|
const { useBreakpoint } = Grid;
|
|
|
|
|
@@ -25,6 +26,7 @@ interface SelectedProtocolListProps {
|
|
|
className?: string;
|
|
|
}
|
|
|
const SelectedProtocolList: React.FC<SelectedProtocolListProps> = () => {
|
|
|
+ const dispatch = useDispatch();
|
|
|
const screens = useBreakpoint();
|
|
|
const cardSize = getCardSize(screens);
|
|
|
|
|
@@ -35,9 +37,7 @@ const SelectedProtocolList: React.FC<SelectedProtocolListProps> = () => {
|
|
|
|
|
|
// 移除操作(实际项目可用props传递onRemove)
|
|
|
const handleRemove = (id: string) => {
|
|
|
- // 这里仅做演示
|
|
|
- // 实际应通过props回调或状态管理移除
|
|
|
- alert(`移除体位ID: ${id}`);
|
|
|
+ dispatch(removeSelectedView(id));
|
|
|
};
|
|
|
|
|
|
return (
|
|
@@ -67,7 +67,7 @@ const SelectedProtocolList: React.FC<SelectedProtocolListProps> = () => {
|
|
|
type="text"
|
|
|
size="small"
|
|
|
icon={<CloseOutlined />}
|
|
|
- onClick={() => handleRemove(item.internal_id)}
|
|
|
+ onClick={() => handleRemove(item.view_id)}
|
|
|
style={{
|
|
|
position: 'absolute',
|
|
|
top: 2,
|