diff --git a/backend/Log/OrbbecSDK.log.txt b/backend/Log/OrbbecSDK.log.txt
index afc10490..1d9670cf 100644
Binary files a/backend/Log/OrbbecSDK.log.txt and b/backend/Log/OrbbecSDK.log.txt differ
diff --git a/backend/config.ini b/backend/config.ini
index 18761e2a..51d49d83 100644
--- a/backend/config.ini
+++ b/backend/config.ini
@@ -1,6 +1,6 @@
[APP]
name = Body Balance Evaluation System
-version = 1.0.0
+version = 1.5.0
debug = True
log_level = INFO
diff --git a/backend/devices/__init__.py b/backend/devices/__init__.py
index 2f75acf8..4f1ddb4e 100644
--- a/backend/devices/__init__.py
+++ b/backend/devices/__init__.py
@@ -21,5 +21,5 @@ __all__ = [
'DeviceCoordinator'
]
-__version__ = '1.0.0'
+__version__ = '1.5.0'
__author__ = 'Body Balance Detection System'
\ No newline at end of file
diff --git a/backend/devices/utils/license_manager.py b/backend/devices/utils/license_manager.py
index 99dd8c2e..d1156622 100644
--- a/backend/devices/utils/license_manager.py
+++ b/backend/devices/utils/license_manager.py
@@ -398,7 +398,7 @@ class LicenseManager:
request_data = {
"product": "BodyBalanceEvaluation",
- "version": "1.0.0",
+ "version": "1.5.0",
"machine_id": machine_id,
"platform": platform.system(),
"request_time": datetime.now(timezone.utc).isoformat(),
diff --git a/backend/main.py b/backend/main.py
index 3a3ebc39..6b9fc593 100644
--- a/backend/main.py
+++ b/backend/main.py
@@ -351,7 +351,7 @@ class AppServer:
return jsonify({
'status': 'healthy',
'timestamp': datetime.now().isoformat(),
- 'version': '1.0.0'
+ 'version': '1.5.0'
})
# ==================== 授权API ====================
@@ -381,7 +381,80 @@ class AppServer:
except Exception as e:
self.logger.error(f'获取授权信息失败: {e}')
return jsonify({'success': False, 'error': str(e)}), 500
+
+ @self.app.route('/api/common-items', methods=['GET'])
+ def get_common_items():
+ try:
+ base_dir = os.path.dirname(sys.executable) if getattr(sys, 'frozen', False) else os.path.dirname(os.path.abspath(__file__))
+ data_dir = os.path.join(base_dir, 'data')
+ os.makedirs(data_dir, exist_ok=True)
+ fpath = os.path.join(data_dir, 'common_items.json')
+ if not os.path.exists(fpath):
+ with open(fpath, 'w', encoding='utf-8') as f:
+ json.dump({'treatment': [], 'suggestion': []}, f, ensure_ascii=False)
+ with open(fpath, 'r', encoding='utf-8') as f:
+ data = json.load(f)
+ return jsonify({'success': True, 'data': data})
+ except Exception as e:
+ return jsonify({'success': False, 'error': str(e)}), 500
+
+ @self.app.route('/api/common-items', methods=['POST'])
+ def add_common_item():
+ try:
+ payload = flask_request.get_json(force=True) or {}
+ itype = str(payload.get('type', '')).lower()
+ label = str(payload.get('label', '')).strip()
+ if itype not in ['treatment', 'suggestion'] or not label:
+ return jsonify({'success': False, 'error': '参数无效'}), 400
+ base_dir = os.path.dirname(sys.executable) if getattr(sys, 'frozen', False) else os.path.dirname(os.path.abspath(__file__))
+ data_dir = os.path.join(base_dir, 'data')
+ os.makedirs(data_dir, exist_ok=True)
+ fpath = os.path.join(data_dir, 'common_items.json')
+ data = {'treatment': [], 'suggestion': []}
+ if os.path.exists(fpath):
+ try:
+ with open(fpath, 'r', encoding='utf-8') as f:
+ data = json.load(f)
+ except Exception:
+ pass
+ items = list(data.get(itype, []))
+ if label not in items:
+ items.append(label)
+ data[itype] = items
+ with open(fpath, 'w', encoding='utf-8') as f:
+ json.dump(data, f, ensure_ascii=False, indent=2)
+ return jsonify({'success': True, 'data': {itype: items}})
+ except Exception as e:
+ return jsonify({'success': False, 'error': str(e)}), 500
+
+ @self.app.route('/api/common-items', methods=['DELETE'])
+ def delete_common_item():
+ try:
+ payload = flask_request.get_json(force=True) or {}
+ itype = str(payload.get('type', '')).lower()
+ label = str(payload.get('label', '')).strip()
+ if itype not in ['treatment', 'suggestion'] or not label:
+ return jsonify({'success': False, 'error': '参数无效'}), 400
+ base_dir = os.path.dirname(sys.executable) if getattr(sys, 'frozen', False) else os.path.dirname(os.path.abspath(__file__))
+ data_dir = os.path.join(base_dir, 'data')
+ os.makedirs(data_dir, exist_ok=True)
+ fpath = os.path.join(data_dir, 'common_items.json')
+ data = {'treatment': [], 'suggestion': []}
+ if os.path.exists(fpath):
+ try:
+ with open(fpath, 'r', encoding='utf-8') as f:
+ data = json.load(f)
+ except Exception:
+ pass
+ items = [x for x in list(data.get(itype, [])) if x != label]
+ data[itype] = items
+ with open(fpath, 'w', encoding='utf-8') as f:
+ json.dump(data, f, ensure_ascii=False, indent=2)
+ return jsonify({'success': True, 'data': {itype: items}})
+ except Exception as e:
+ return jsonify({'success': False, 'error': str(e)}), 500
+
@self.app.route('/api/license/activation-request', methods=['POST'])
def generate_activation_request():
"""生成离线激活请求文件"""
diff --git a/backend/utils.py b/backend/utils.py
index c81b7ce0..c0b584a0 100644
--- a/backend/utils.py
+++ b/backend/utils.py
@@ -46,7 +46,7 @@ class Config:
# 应用配置
self.config['APP'] = {
'name': 'Body Balance Evaluation System',
- 'version': '1.0.0',
+ 'version': '1.5.0',
'debug': 'false',
'log_level': 'INFO'
}
diff --git a/config.ini b/config.ini
index 5556d887..8bbec20d 100644
--- a/config.ini
+++ b/config.ini
@@ -1,6 +1,6 @@
[APP]
name = Body Balance Evaluation System
-version = 1.0.0
+version = 1.5.0
debug = false
log_level = INFO
diff --git a/document/Web接口调用说明.md b/document/Web接口调用说明.md
index ffed68d4..ce35ee9d 100644
--- a/document/Web接口调用说明.md
+++ b/document/Web接口调用说明.md
@@ -61,7 +61,7 @@
- 功能:健康检查与服务存活状态。
- 示例响应:
```json
-{ "status": "healthy", "timestamp": "2024-01-01T12:00:00", "version": "1.0.0" }
+{ "status": "healthy", "timestamp": "2024-01-01T12:00:00", "version": "1.5.0" }
```
### GET /api/license/info
diff --git a/frontend/src/renderer/src/services/api.js b/frontend/src/renderer/src/services/api.js
index fdf6151b..e7c7b0dc 100644
--- a/frontend/src/renderer/src/services/api.js
+++ b/frontend/src/renderer/src/services/api.js
@@ -278,6 +278,18 @@ export const licenseAPI = {
}
}
+export const commonItemsAPI = {
+ list() {
+ return api.get('/api/common-items')
+ },
+ add(type, label) {
+ return api.post('/api/common-items', { type, label })
+ },
+ remove(type, label) {
+ return api.delete('/api/common-items', { data: { type, label } })
+ }
+}
+
// 录制API
export const recordingAPI = {
// 创建录制
@@ -673,4 +685,4 @@ export const getBackendUrl = () => {
}
}
-export default api
\ No newline at end of file
+export default api
diff --git a/frontend/src/renderer/src/views/DiagnosticMessage.vue b/frontend/src/renderer/src/views/DiagnosticMessage.vue
index e3c9c144..187afecb 100644
--- a/frontend/src/renderer/src/views/DiagnosticMessage.vue
+++ b/frontend/src/renderer/src/views/DiagnosticMessage.vue
@@ -11,14 +11,27 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -33,6 +46,45 @@
+
+
+
+
+
+
{{opt}}
+
+
+
+
+
+
+
+
+
+
+
+ 关闭
+
+
+
+
+
+
+
{{opt}}
+
+
+
+
+
+
+
+
+
+
+
+ 关闭
+
+