From 6b135eaf7a3e94336283f6d4f2fc197fc9e8328f Mon Sep 17 00:00:00 2001 From: 24kycj <1637269896@qq.com> Date: Wed, 3 Jun 2026 16:07:58 +0800 Subject: [PATCH] =?UTF-8?q?Header=20=E7=8A=B6=E6=80=81=E6=94=B9=E7=94=A8?= =?UTF-8?q?=20Checkstatus=20=E6=9F=A5=E8=AF=A2=E5=B9=B6=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E5=B7=B2=E5=8F=91=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 状态与 GetPrinterInfo 分离:启动仅拉色带/序列号,操作后通过 SAPI_PrinterCheckstatus 刷新状态文案。 --- app/src/main/ipc/register-handlers.ts | 3 +- app/src/renderer/src/components/AppHeader.vue | 7 +- .../src/composables/useAppBootstrap.ts | 6 +- .../src/composables/usePrinterStatus.ts | 75 ++++++------------- app/src/renderer/src/types/printer.ts | 4 +- .../src/views/DistributeRunningView.vue | 6 ++ app/src/renderer/src/views/HomeView.vue | 10 ++- app/src/shared/printer-info.ts | 26 +------ 8 files changed, 48 insertions(+), 89 deletions(-) diff --git a/app/src/main/ipc/register-handlers.ts b/app/src/main/ipc/register-handlers.ts index 0b6d8b9..9145dc3 100644 --- a/app/src/main/ipc/register-handlers.ts +++ b/app/src/main/ipc/register-handlers.ts @@ -104,8 +104,7 @@ export function registerIpcHandlers(): void { const snapshot: PrinterStatusSnapshot = { ribbonType: cached?.ribbonType ?? '—', statusText: parsed.statusText, - serialNo: cached?.serialNo ?? '—', - printedCount: cached?.printedCount ?? 0 + serialNo: cached?.serialNo ?? '—' } configStore.set('lastPrinterStatus', snapshot) return ok({ statusText: parsed.statusText, statusCode: code }) diff --git a/app/src/renderer/src/components/AppHeader.vue b/app/src/renderer/src/components/AppHeader.vue index ba55641..23bd153 100644 --- a/app/src/renderer/src/components/AppHeader.vue +++ b/app/src/renderer/src/components/AppHeader.vue @@ -10,7 +10,6 @@ >状态: {{ status.statusText }} 序列号: {{ status.serialNo }} - 已发行: {{ status.printedCount }}