fix(client): 修复标签打印预览三个问题

- 打印完成后自动关闭预览弹窗
- 打印机列表改为仅显示热敏打印机,无热敏打印机时显示"无打印机可用"并禁用打印按钮
- 库存列表表格行"打标签"按钮改为调用预览弹窗(之前仍走旧直接打印逻辑)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-06-15 12:04:03 +08:00
parent d26a64f149
commit 0779bf57e3
3 changed files with 15 additions and 26 deletions
+5 -2
View File
@@ -501,7 +501,7 @@ Future<List<String>> listLabelPrintersImpl() async {
return (r.stdout as String)
.split('\n')
.map((s) => s.trim())
.where((s) => s.isNotEmpty)
.where((s) => s.isNotEmpty && _isThermalName(s))
.toList();
}
} catch (e) {
@@ -511,7 +511,10 @@ Future<List<String>> listLabelPrintersImpl() async {
}
if (Platform.isWindows) {
try {
return (await Printing.listPrinters()).map((p) => p.name).toList();
return (await Printing.listPrinters())
.map((p) => p.name)
.where((n) => _isThermalName(n))
.toList();
} catch (e) {
debugPrint('[label] listPrinters 失败: $e');
}