Browse Source

添加工作位信息,并多语言化资源;在检查界面上显示

dengdx 2 months ago
parent
commit
51077bb75d

+ 4 - 0
src/assets/i18n/messages/en.js

@@ -129,4 +129,8 @@ export default {
   'Small': 'Small',
   'Medium': 'Medium',
   'Large': 'Large',
+  'workstation.free': 'Free',
+  'workstation.direct': 'Direct',
+  'workstation.table': 'Table',
+  'workstation.wall': 'Wall',
 };

+ 4 - 0
src/assets/i18n/messages/zh.js

@@ -129,4 +129,8 @@ export default {
   'Small': '小',
   'Medium': '中',
   'Large': '大',
+  'workstation.free': '自由位',
+  'workstation.direct': '传统位',
+  'workstation.table': '卧位',
+  'workstation.wall': '立位',
 };

+ 10 - 2
src/pages/exam/ContentAreaLarge.tsx

@@ -17,6 +17,7 @@ import {
   CloseOutlined,
 } from '@ant-design/icons';
 import { patientSizes } from '../../states/patientSize';
+import { WorkstationTypeLabels } from '../../states/workstation';
 import { FormattedMessage } from 'react-intl';
 
 const ContentAreaLarge = () => {
@@ -56,8 +57,15 @@ const ContentAreaLarge = () => {
                 placeholder="选择工作位"
                 style={{ width: '100%', marginBottom: 8 }}
               >
-                <Select.Option value="工作位1">工作位1</Select.Option>
-                <Select.Option value="工作位2">工作位2</Select.Option>
+                {Object.entries(WorkstationTypeLabels).map(
+                  ([key, value]: [string, string]) => (
+                    <Select.Option key={key} value={value}>
+                      <FormattedMessage
+                        id={`workstation.${key.toLowerCase()}`}
+                      />
+                    </Select.Option>
+                  )
+                )}
               </Select>
             </Col>
           </Row>

+ 11 - 2
src/pages/exam/ContentAreaMedium.tsx

@@ -17,6 +17,8 @@ import {
   CloseOutlined,
 } from '@ant-design/icons';
 import { patientSizes } from '@/states/patientSize';
+import { WorkstationTypeLabels } from '@/states/workstation';
+import { FormattedMessage } from 'react-intl';
 
 const ContentAreaMedium = () => {
   return (
@@ -55,8 +57,15 @@ const ContentAreaMedium = () => {
                 placeholder="选择工作位"
                 style={{ width: '100%', marginBottom: 8 }}
               >
-                <Select.Option value="工作位1">工作位1</Select.Option>
-                <Select.Option value="工作位2">工作位2</Select.Option>
+                {Object.entries(WorkstationTypeLabels).map(
+                  ([key, value]: [string, string]) => (
+                    <Select.Option key={key} value={value}>
+                      <FormattedMessage
+                        id={`workstation.${key.toLowerCase()}`}
+                      />
+                    </Select.Option>
+                  )
+                )}
               </Select>
             </Col>
           </Row>

+ 9 - 2
src/pages/exam/ContentAreaSmall.tsx

@@ -18,6 +18,8 @@ import {
   CloseOutlined,
 } from '@ant-design/icons';
 import { patientSizes } from '@/states/patientSize';
+import { WorkstationTypeLabels } from '@/states/workstation';
+import { FormattedMessage } from 'react-intl';
 
 const ContentAreaSmall = ({ className }: { className?: string }) => {
   console.log('ContentAreaSmall component rendered');
@@ -56,8 +58,13 @@ const ContentAreaSmall = ({ className }: { className?: string }) => {
               placeholder="选择工作位"
               style={{ width: '100%', marginBottom: 8 }}
             >
-              <Select.Option value="工作位1">工作位1</Select.Option>
-              <Select.Option value="工作位2">工作位2</Select.Option>
+              {Object.entries(WorkstationTypeLabels).map(
+                ([key, value]: [string, string]) => (
+                  <Select.Option key={key} value={value}>
+                    <FormattedMessage id={`workstation.${key.toLowerCase()}`} />
+                  </Select.Option>
+                )
+              )}
             </Select>
           </Col>
         </Row>

+ 13 - 0
src/states/workstation.ts

@@ -0,0 +1,13 @@
+export enum WorkstationType {
+  Free = 'Free',
+  Direct = 'Direct',
+  Table = 'Table',
+  Wall = 'Wall',
+}
+
+export const WorkstationTypeLabels: Record<WorkstationType, string> = {
+  [WorkstationType.Free]: 'Free',
+  [WorkstationType.Direct]: 'Direct',
+  [WorkstationType.Table]: 'Table',
+  [WorkstationType.Wall]: 'Wall',
+};