2 Комити b7092ec61b ... e42c2ebb26

Аутор SHA1 Порука Датум
  szy e42c2ebb26 Merge branch 'master' of http://code.pacsonline.cn/ddx/dros пре 4 дана
  szy 9e75b2b703 feat (1.61.3 -> 1.61.4): 实现报告配置功能,支持主标题和副标题的动态配置 пре 4 дана

+ 15 - 0
CHANGELOG.md

@@ -2,6 +2,21 @@
 
 
 本项目的所有重要变更都将记录在此文件中.
 本项目的所有重要变更都将记录在此文件中.
 
 
+## [1.63.0] - 2026-01-08 12:46
+
+### 新增 (Added)
+
+- **实现报告配置功能,支持主标题和副标题的动态配置** - 新增报告配置页面,支持通过表单动态设置报告的主标题和副标题,并提供保存功能
+  - 在 options.ts 中添加 getConfig 和 modifyConfig API接口,支持配置项的获取和修改
+  - 新增 report/index.tsx 报告配置组件,实现主标题和副标题的表单配置
+  - 在 Preferences/index.tsx 中导出 Report 组件,替换原有的占位符实现
+
+**改动文件:**
+
+- src/API/system/options.ts
+- src/pages/system/SettingsModal/sections/Preferences/index.tsx
+- src/pages/system/SettingsModal/sections/Preferences/report/index.tsx
+
 ## [1.62.1] - 2026-01-08 10:59
 ## [1.62.1] - 2026-01-08 10:59
 
 
 ### 修复 (Fixed)
 ### 修复 (Fixed)

+ 1 - 1
package.json

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

+ 37 - 0
src/API/system/options.ts

@@ -1,3 +1,4 @@
+import qs from 'qs';
 import axiosInstance from '../interceptor';
 import axiosInstance from '../interceptor';
 export interface OptionsItem {
 export interface OptionsItem {
   text: string;
   text: string;
@@ -13,6 +14,24 @@ export interface OptionsResponse {
   };
   };
 }
 }
 
 
+export interface configItem {
+  category: string;
+  config_key: string;
+  config_value: string;
+  option_key: string;
+  value_type: string;
+  uri: string;
+}
+export interface configResponse {
+  code: string;
+  description: string;
+  solution: string;
+  data: {
+    '@type': string;
+    configs: configItem[];
+  };
+}
+
 // 获取配置的可选项
 // 获取配置的可选项
 export const getOption = async (params: {
 export const getOption = async (params: {
   group: string;
   group: string;
@@ -23,3 +42,21 @@ export const getOption = async (params: {
   });
   });
   return response.data;
   return response.data;
 };
 };
+
+// 获取指定配置项
+export const getConfig = async (params: {
+  uri: string[];
+}): Promise<configResponse> => {
+  const response = await axiosInstance.get(
+    `/auth/resource/config?${qs.stringify(params, { arrayFormat: 'repeat' })}`
+  );
+  return response.data;
+};
+
+// 修改配置项
+export const modifyConfig = async (
+  data: Record<string, string>
+): Promise<configResponse> => {
+  const response = await axiosInstance.post('/auth/resource/config', data);
+  return response.data;
+};

+ 3 - 7
src/pages/system/SettingsModal/sections/Preferences/index.tsx

@@ -6,7 +6,7 @@ import PlaceholderSection from '../PlaceholderSection';
 import NewInspection from './NewInspection';
 import NewInspection from './NewInspection';
 import WorkflowComponent from './Workflow';
 import WorkflowComponent from './Workflow';
 import LanguageSettings from './LanguageSettings';
 import LanguageSettings from './LanguageSettings';
-
+export { default as Report } from './report/index';
 // 通用设置
 // 通用设置
 export const GeneralSettings: React.FC = () => (
 export const GeneralSettings: React.FC = () => (
   <PlaceholderSection title="通用设置" />
   <PlaceholderSection title="通用设置" />
@@ -19,9 +19,7 @@ export const WorkflowInspection: React.FC = () => <NewInspection />;
 export const Workflow: React.FC = () => <WorkflowComponent />;
 export const Workflow: React.FC = () => <WorkflowComponent />;
 
 
 // 用户信息
 // 用户信息
-export const UserInfo: React.FC = () => (
-  <PlaceholderSection title="用户信息" />
-);
+export const UserInfo: React.FC = () => <PlaceholderSection title="用户信息" />;
 
 
 // 添加备注
 // 添加备注
 export const AddRemarks: React.FC = () => (
 export const AddRemarks: React.FC = () => (
@@ -34,9 +32,7 @@ export const ViewAndProcess: React.FC = () => (
 );
 );
 
 
 // 报告
 // 报告
-export const Report: React.FC = () => (
-  <PlaceholderSection title="报告" />
-);
+// export const Report: React.FC = () => <PlaceholderSection title="报告" />;
 
 
 // 语言设置
 // 语言设置
 export const LanguageSettingsComponent: React.FC = () => <LanguageSettings />;
 export const LanguageSettingsComponent: React.FC = () => <LanguageSettings />;

+ 64 - 0
src/pages/system/SettingsModal/sections/Preferences/report/index.tsx

@@ -0,0 +1,64 @@
+import React, { useEffect } from 'react';
+import { Card, Button, Space, Form, Input, message } from 'antd';
+import { SPACING } from '../../../constants';
+import { getConfig, modifyConfig, configItem } from '@/API/system/options';
+
+const ReportTitle: React.FC = () => {
+  const [form] = Form.useForm();
+  const onFinish = async (values: Record<string, string>) => {
+    const res = await modifyConfig(values);
+    if (res?.code === '0x000000') {
+      message.success('修改成功');
+      // form.resetFields();
+    }
+  };
+
+  const getReportTitle = async () => {
+    const res = await getConfig({
+      uri: ['Report/MainTitle', 'Report/SubTitle'],
+    });
+    if (res?.code === '0x000000') {
+      const formValues = (res?.data?.configs || []).reduce((acc, cur) => {
+        acc[cur.uri] = cur.config_value;
+        return acc;
+      }, {});
+      form.setFieldsValue(formValues);
+    }
+  };
+
+  useEffect(() => {
+    getReportTitle();
+  }, [form]);
+
+  return (
+    <div style={{ padding: SPACING.LG }}>
+      <Card title="报告配置" variant="borderless">
+        <Form layout="vertical" form={form} onFinish={onFinish}>
+          <Form.Item
+            name="Report/MainTitle"
+            label="主标题"
+            rules={[{ required: true }]}
+          >
+            <Input allowClear />
+          </Form.Item>
+          <Form.Item
+            name="Report/SubTitle"
+            label="副标题"
+            rules={[{ required: true }]}
+          >
+            <Input allowClear />
+          </Form.Item>
+          <Form.Item>
+            <Space>
+              <Button type="primary" htmlType="submit">
+                保存
+              </Button>
+            </Space>
+          </Form.Item>
+        </Form>
+      </Card>
+    </div>
+  );
+};
+
+export default ReportTitle;