fix(client): 修复标签打印预览三个问题
- 打印完成后自动关闭预览弹窗 - 打印机列表改为仅显示热敏打印机,无热敏打印机时显示"无打印机可用"并禁用打印按钮 - 库存列表表格行"打标签"按钮改为调用预览弹窗(之前仍走旧直接打印逻辑) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user