新增打印模板管理功能,包含免密接口和实时通知机制,支持桌面端打印模板的查询和列表展示。更新相关控制器、服务和视图,优化用户体验并增强系统的实时数据同步能力。

This commit is contained in:
geht
2026-05-12 18:29:03 +08:00
parent f5ba828eff
commit fcedc66f7a
32 changed files with 2788 additions and 2 deletions

View File

@@ -0,0 +1,11 @@
using Prism.Events;
namespace YY.Admin.Core.Events;
public class PrintTemplateChangedPayload
{
public string Action { get; set; } = string.Empty; // add/edit/delete/reconnect/pull
public string? TemplateId { get; set; }
}
public class PrintTemplateChangedEvent : PubSubEvent<PrintTemplateChangedPayload> { }

View File

@@ -0,0 +1,12 @@
namespace YY.Admin.Core.Services;
public record PrintDotPrinter(string Name, bool IsDefault);
public interface IPrintDotService
{
/// <summary>获取 PrintDot 打印机列表,同时验证连通性。</summary>
Task<IReadOnlyList<PrintDotPrinter>> GetPrintersAsync(CancellationToken ct = default);
/// <summary>发送 PDF base64 打印任务content 可含或不含 data:application/pdf;base64, 前缀)。</summary>
Task PrintAsync(string printerName, string pdfBase64, string jobName = "QH-MES", int copies = 1, CancellationToken ct = default);
}

View File

@@ -0,0 +1,11 @@
using YY.Admin.Core.Entity;
namespace YY.Admin.Core.Services;
public interface IPrintTemplateService
{
Task<PrintTemplate?> GetByCodeAsync(string templateCode, CancellationToken ct = default);
Task<IReadOnlyList<PrintTemplate>> ListAsync(CancellationToken ct = default);
Task<IReadOnlyList<PrintTemplate>> RefreshCacheAsync(CancellationToken ct = default);
IReadOnlyList<PrintTemplate> GetCached();
}