|
@@ -20,8 +20,32 @@ import {
|
|
|
import { patientSizes } from '@/states/patientSize';
|
|
|
import { WorkstationTypeLabels } from '@/states/workstation';
|
|
|
import { FormattedMessage } from 'react-intl';
|
|
|
+import { useSelector, useDispatch } from 'react-redux';
|
|
|
+import { RootState } from '@/states/store';
|
|
|
+import {
|
|
|
+ setAprConfig,
|
|
|
+ setCurrentExposureMode,
|
|
|
+ setIsAECEnabled,
|
|
|
+} from '@/states/exam/aprSlice';
|
|
|
|
|
|
const ContentAreaSmall = ({ className }: { className?: string }) => {
|
|
|
+ const dispatch = useDispatch();
|
|
|
+ const aprConfig = useSelector((state: RootState) => state.apr.aprConfig);
|
|
|
+ const currentExposureMode = useSelector(
|
|
|
+ (state: RootState) => state.apr.currentExposureMode
|
|
|
+ );
|
|
|
+ const isAECEnabled = useSelector(
|
|
|
+ (state: RootState) => state.apr.isAECEnabled
|
|
|
+ );
|
|
|
+
|
|
|
+ const handleExposureModeChange = (value: string) => {
|
|
|
+ dispatch(setCurrentExposureMode(value));
|
|
|
+ };
|
|
|
+
|
|
|
+ const handleAECChange = (checked: boolean) => {
|
|
|
+ dispatch(setIsAECEnabled(checked));
|
|
|
+ };
|
|
|
+
|
|
|
console.log('ContentAreaSmall component rendered');
|
|
|
console.log('ContentAreaSmall component rendered');
|
|
|
return (
|
|
@@ -69,18 +93,69 @@ const ContentAreaSmall = ({ className }: { className?: string }) => {
|
|
|
</Col>
|
|
|
</Row>
|
|
|
<div>
|
|
|
- <InputNumber
|
|
|
- placeholder="mA"
|
|
|
- style={{ width: '100%', marginBottom: 8 }}
|
|
|
- />
|
|
|
- <InputNumber
|
|
|
- placeholder="ms"
|
|
|
- style={{ width: '100%', marginBottom: 8 }}
|
|
|
- />
|
|
|
- <InputNumber
|
|
|
- placeholder="mAs"
|
|
|
- style={{ width: '100%', marginBottom: 8 }}
|
|
|
- />
|
|
|
+ <Tooltip
|
|
|
+ title={
|
|
|
+ currentExposureMode === 'mAs'
|
|
|
+ ? '当前为 mAs 模式,mA 和 ms 不可调整'
|
|
|
+ : ''
|
|
|
+ }
|
|
|
+ >
|
|
|
+ <InputNumber
|
|
|
+ disabled={currentExposureMode === 'mAs'}
|
|
|
+ placeholder={currentExposureMode === 'mAs' ? '--' : 'mA'}
|
|
|
+ style={{ width: '100%', marginBottom: 8 }}
|
|
|
+ value={
|
|
|
+ currentExposureMode === 'mAs'
|
|
|
+ ? null
|
|
|
+ : (aprConfig.mA ?? undefined)
|
|
|
+ }
|
|
|
+ onChange={(value) =>
|
|
|
+ dispatch(setAprConfig({ ...aprConfig, mA: value ?? 0 }))
|
|
|
+ }
|
|
|
+ />
|
|
|
+ </Tooltip>
|
|
|
+ <Tooltip
|
|
|
+ title={
|
|
|
+ currentExposureMode === 'mAs'
|
|
|
+ ? '当前为 mAs 模式,mA 和 ms 不可调整'
|
|
|
+ : ''
|
|
|
+ }
|
|
|
+ >
|
|
|
+ <InputNumber
|
|
|
+ disabled={currentExposureMode === 'mAs'}
|
|
|
+ placeholder={currentExposureMode === 'mAs' ? '--' : 'ms'}
|
|
|
+ style={{ width: '100%', marginBottom: 8 }}
|
|
|
+ value={
|
|
|
+ currentExposureMode === 'mAs'
|
|
|
+ ? null
|
|
|
+ : (aprConfig.ms ?? undefined)
|
|
|
+ }
|
|
|
+ onChange={(value) =>
|
|
|
+ dispatch(setAprConfig({ ...aprConfig, ms: value ?? 0 }))
|
|
|
+ }
|
|
|
+ />
|
|
|
+ </Tooltip>
|
|
|
+ <Tooltip
|
|
|
+ title={
|
|
|
+ currentExposureMode === 'time'
|
|
|
+ ? '当前为 time 模式,mAs 不可调整'
|
|
|
+ : ''
|
|
|
+ }
|
|
|
+ >
|
|
|
+ <InputNumber
|
|
|
+ disabled={currentExposureMode === 'time'}
|
|
|
+ placeholder={currentExposureMode === 'time' ? '--' : 'mAs'}
|
|
|
+ style={{ width: '100%', marginBottom: 8 }}
|
|
|
+ value={
|
|
|
+ currentExposureMode === 'time'
|
|
|
+ ? null
|
|
|
+ : (aprConfig.mAs ?? undefined)
|
|
|
+ }
|
|
|
+ onChange={(value) =>
|
|
|
+ dispatch(setAprConfig({ ...aprConfig, mAs: value ?? 0 }))
|
|
|
+ }
|
|
|
+ />
|
|
|
+ </Tooltip>
|
|
|
<InputNumber
|
|
|
placeholder="KV"
|
|
|
style={{ width: '100%', marginBottom: 8 }}
|
|
@@ -92,7 +167,12 @@ const ContentAreaSmall = ({ className }: { className?: string }) => {
|
|
|
</div>
|
|
|
<Row gutter={16} align="middle">
|
|
|
<Col span={12}>
|
|
|
- <Select placeholder="选择曝光模式" style={{ width: '100%' }}>
|
|
|
+ <Select
|
|
|
+ placeholder="选择曝光模式"
|
|
|
+ style={{ width: '100%' }}
|
|
|
+ value={currentExposureMode}
|
|
|
+ onChange={handleExposureModeChange}
|
|
|
+ >
|
|
|
<Select.Option value="mAs">mAs</Select.Option>
|
|
|
<Select.Option value="time">time</Select.Option>
|
|
|
</Select>
|
|
@@ -101,7 +181,8 @@ const ContentAreaSmall = ({ className }: { className?: string }) => {
|
|
|
<Switch
|
|
|
checkedChildren="开启AEC"
|
|
|
unCheckedChildren="关闭AEC"
|
|
|
- defaultChecked
|
|
|
+ checked={isAECEnabled}
|
|
|
+ onChange={handleAECChange}
|
|
|
/>
|
|
|
</Col>
|
|
|
<Col span={3}>
|