新增打印模板绑定功能,支持业务与打印模板的映射配置。实现打印模板的增删改查操作,优化打印数据的生成逻辑,提升打印模板的灵活性和用户体验。同时,新增打印机查询接口,增强打印服务的可用性和实时性。

This commit is contained in:
geht
2026-05-13 15:49:51 +08:00
parent 210f3614ea
commit c3f8190537
32 changed files with 2323 additions and 229 deletions

View File

@@ -23,7 +23,8 @@ public partial class PrintPreviewWindow : HandyControl.Controls.Window
}
public PrintPreviewWindow(PrintTemplate template, string? templateJson,
IPrintDotService? printDotService, string? selectedPrinterName)
IPrintDotService? printDotService, string? selectedPrinterName,
string? initialParamJson = null)
{
InitializeComponent();
_template = template;
@@ -36,7 +37,9 @@ public partial class PrintPreviewWindow : HandyControl.Controls.Window
$"尺寸:{template.PaperWidthMm ?? 210}×{template.PaperHeightMm ?? 297} mm " +
$"方向:{template.PaperOrientation ?? ""}";
TbParamJson.Text = BuildMockParamJson(_templateJson);
TbParamJson.Text = !string.IsNullOrWhiteSpace(initialParamJson)
? initialParamJson!
: BuildMockParamJson(_templateJson);
// 没有 PrintDot 服务时禁用打印相关按钮
if (_printDotService == null)