feat: add delete execution feature with progress tracking and dryrun mode
- Add ExecutionConfig for dryrun settings in config schema - Create DeleteProgressWindow widget for real-time progress display - Integrate delete execution flow in MaterialValidationTab with threading - Add dryrun checkbox for admin users in settings - Add progress callback support to DiscreteMaterialPlanCleaner - Add markdown report generation with statistics - Include tkinterweb and markdown2 dependencies for report rendering Co-Authored-By: Claude (glm-5) <noreply@anthropic.com>
This commit is contained in:
@@ -297,6 +297,26 @@ class UIConfig:
|
||||
return errors
|
||||
|
||||
|
||||
@dataclass
|
||||
class ExecutionConfig:
|
||||
"""执行配置(用于删除操作等)"""
|
||||
|
||||
dryrun: bool = False # 预览模式,不保存更改
|
||||
|
||||
@classmethod
|
||||
def from_env(cls) -> "ExecutionConfig":
|
||||
"""从环境变量创建配置"""
|
||||
from config.env_loader import get_env_bool
|
||||
|
||||
return cls(
|
||||
dryrun=get_env_bool("EXECUTION_DRYRUN", False),
|
||||
)
|
||||
|
||||
def validate(self) -> list[str]:
|
||||
"""验证配置,返回错误列表"""
|
||||
return [] # dryrun 是布尔值,无需验证
|
||||
|
||||
|
||||
@dataclass
|
||||
class AppConfig:
|
||||
"""应用总配置"""
|
||||
@@ -307,6 +327,7 @@ class AppConfig:
|
||||
extraction: ExtractionConfig
|
||||
validation: ValidationConfig
|
||||
ui: UIConfig
|
||||
execution: ExecutionConfig
|
||||
|
||||
@classmethod
|
||||
def from_env(cls) -> "AppConfig":
|
||||
@@ -318,6 +339,7 @@ class AppConfig:
|
||||
extraction=ExtractionConfig.from_env(),
|
||||
validation=ValidationConfig.from_env(),
|
||||
ui=UIConfig.from_env(),
|
||||
execution=ExecutionConfig.from_env(),
|
||||
)
|
||||
|
||||
def validate(self) -> list[str]:
|
||||
@@ -329,6 +351,7 @@ class AppConfig:
|
||||
errors.extend(self.extraction.validate())
|
||||
errors.extend(self.validation.validate())
|
||||
errors.extend(self.ui.validate())
|
||||
errors.extend(self.execution.validate())
|
||||
return errors
|
||||
|
||||
def to_dict(self) -> dict:
|
||||
@@ -384,4 +407,7 @@ class AppConfig:
|
||||
"font_size": self.ui.font_size,
|
||||
"production_id_input_width": self.ui.production_id_input_width,
|
||||
},
|
||||
"execution": {
|
||||
"dryrun": self.execution.dryrun,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user