#pragma once #include #include #include #include class QComboBox; class QLineEdit; class QSpinBox; class QTableWidget; class QPushButton; class QVBoxLayout; namespace geopro::data { class IDatasetCommandRepository; } namespace geopro::app { // 自动标注对话框(I13,复刻原版 AutoAnnotationDialog): // 左:规则列表(阈值模式 数值/百分位、min/max、最小点数、异常类型)。 // 执行 → executeExceptionMark(预演) → 预览表;确定保存 → batchCreateException → reloadGrid。 // 异常类型仅支持面/polygon(原版同),故 listExceptionTypes 取 remarkSourceType="3"。 class AutoAnnotationDialog : public QDialog { Q_OBJECT public: AutoAnnotationDialog(geopro::data::IDatasetCommandRepository* repo, QString dsObjectId, QString projectId, QWidget* parent = nullptr); private: struct RuleRow { QComboBox* mode = nullptr; // 1 数值 / 2 百分位 QLineEdit* min = nullptr; QLineEdit* max = nullptr; QSpinBox* minPoints = nullptr; QComboBox* type = nullptr; // userData = 异常类型 id }; void loadExceptionTypes(); // 拉面异常类型(填充所有规则行下拉) void addRule(); // 加一条规则卡片 QJsonArray buildRuleList() const; // 组装 exceptionMarkRuleList void onExecute(); // executeExceptionMark → 预览 void onSave(); // batchCreateException geopro::data::IDatasetCommandRepository* repo_ = nullptr; QString dsObjectId_; QString projectId_; QVBoxLayout* ruleHost_ = nullptr; std::vector rules_; QJsonArray exceptionTypeOptions_; // 缓存的类型列表({id,name}),新增规则行复用 QTableWidget* previewTable_ = nullptr; QJsonArray previewExceptions_; // execute 返回的预览异常(confirm 时批量存) QPushButton* saveBtn_ = nullptr; }; } // namespace geopro::app