diff --git a/CHANGELOG.md b/CHANGELOG.md index cbfe728..85d2f12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.0.2] - 2026-05-25 + +### 改进 +- 添加 /release 本地发版 slash command,一键完成构建、测试、打 tag 和推送 + +### 修复 +- Web 版打印弹窗被浏览器拦截时,由静默失败改为给出明确提示,并自动上报错误 + ## [1.0.1] - 2026-05-25 ### 改进 diff --git a/client/.metadata b/client/.metadata index 9114285..a8104ff 100644 --- a/client/.metadata +++ b/client/.metadata @@ -15,7 +15,7 @@ migration: - platform: root create_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a base_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a - - platform: web + - platform: android create_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a base_revision: db50e20168db8fee486b9abf32fc912de3bc5b6a diff --git a/client/lib/core/utils/print_util_web.dart b/client/lib/core/utils/print_util_web.dart index 2918be7..5ea2955 100644 --- a/client/lib/core/utils/print_util_web.dart +++ b/client/lib/core/utils/print_util_web.dart @@ -4,13 +4,15 @@ import 'dart:typed_data'; import 'package:web/web.dart' as web; import '../../models/stock_in.dart'; import '../../models/stock_out.dart'; +import '../errors/error_reporter.dart'; void _openPrintWindow(String html) { final win = web.window.open('', '_blank'); - if (win != null) { - win.document.write(html.toJS); - win.document.close(); + if (win == null) { + throw Exception('浏览器已拦截弹窗,请在地址栏允许弹窗后重试'); } + win.document.write(html.toJS); + win.document.close(); } Future printProductLabelImpl({ @@ -187,7 +189,12 @@ body { width: 4in; height: 2in; overflow: hidden; background: #fff; } '''; - _openPrintWindow(html); + try { + _openPrintWindow(html); + } catch (e, st) { + reportError(e, st); + rethrow; + } } // ── 入库单 ────────────────────────────────────────────────────────────────── @@ -293,7 +300,12 @@ Future printStockInOrderImpl(StockInOrder order) async { '''; - _openPrintWindow(html); + try { + _openPrintWindow(html); + } catch (e, st) { + reportError(e, st); + rethrow; + } } // ── 出库单 ────────────────────────────────────────────────────────────────── @@ -396,5 +408,10 @@ Future printStockOutOrderImpl(StockOutOrder order) async { '''; - _openPrintWindow(html); + try { + _openPrintWindow(html); + } catch (e, st) { + reportError(e, st); + rethrow; + } }