refactor: extract common tab functionality to BaseTab and add decorators

- Add BaseTab base class for common tab initialization and logging
- Add constants module for shared GUI constants
- Move CheckboxTreeview to separate widget file
- Add admin_only and require_session decorators to utils.py
- Refactor DataExtractionTab and MaterialValidationTab to inherit BaseTab
- Remove duplicate _update_log method from tab classes

Co-Authored-By: Claude (glm-5) <noreply@anthropic.com>
This commit is contained in:
Misaka
2026-02-26 21:17:37 +08:00
parent 3a9c6f0978
commit 18f784f067
8 changed files with 648 additions and 294 deletions

View File

@@ -5,3 +5,27 @@ ERP 自动化工具 - GUI 模块
"""
__version__ = "1.0.0"
# 导出常用模块
from .base_tab import BaseTab
from .constants import (
WINDOW_SIZE,
MIN_WINDOW_SIZE,
POLL_INTERVAL_MS,
LOG_COLORS,
DEFAULT_FONT_FAMILY,
DEFAULT_FONT_SIZE,
)
from .utils import admin_only, require_session
__all__ = [
'BaseTab',
'WINDOW_SIZE',
'MIN_WINDOW_SIZE',
'POLL_INTERVAL_MS',
'LOG_COLORS',
'DEFAULT_FONT_FAMILY',
'DEFAULT_FONT_SIZE',
'admin_only',
'require_session',
]