From 2cadad7ea72c4adb25cc2c1d1263ea2069fc74b2 Mon Sep 17 00:00:00 2001 From: qiqi Date: Wed, 2 Dec 2026 12:51:08 +0800 Subject: [PATCH] =?UTF-8?q?feat(out):=20=E7=94=9F=E6=88=90=E4=B8=AD?= =?UTF-8?q?=E7=BB=99=E6=97=A7=E5=9B=BE=E5=8E=8B=E6=9A=97=20+=20=E3=80=8C?= =?UTF-8?q?=E7=94=9F=E6=88=90=E4=B8=AD=E3=80=8D=E8=A7=92=E6=A0=87=EF=BC=88?= =?UTF-8?q?=E4=B8=8D=E5=8A=A8=20data=EF=BC=8C=E5=A4=B1=E8=B4=A5=E5=8D=B3?= =?UTF-8?q?=E6=81=A2=E5=A4=8D=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui-node-bodies.js | 9 +++++++-- style.css | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ui-node-bodies.js b/src/ui-node-bodies.js index 7d1f9d4..f90a37d 100644 --- a/src/ui-node-bodies.js +++ b/src/ui-node-bodies.js @@ -887,6 +887,9 @@ try { if (wResolveOutSrc) src = (await wResolveOutSrc(r, true)) || r.url } catch (e) { /* 回退远端 */ } downloadUrl(src, 'image.png') } + // 生成中(2026-12-02,用户裁定「方案 1」):某一轮还在跑时,旧图压暗 + 角标「生成中」, + // 但不改 data.result —— 失败时旧图原样保留,不会出现「图没了」。 + const genBusy = !!(displayProgOut && (Number(displayProgOut.total) || 0) > (Number(displayProgOut.done) || 0)) const ingSt = (global.IWBImageIngestView && global.IWBImageIngestView.get(r.url)) || null const imgEl = el('img', { key: 'out-img-' + cur + '-' + String(r.url || '').slice(-48), className: 'iwb-out-cell-img', decoding: 'async', fetchPriority: 'low', referrerPolicy: 'no-referrer', src: (ingSt && ingSt.localUrl) || wPreviewUrlOf((typeof wImgSrcForNode === 'function' ? wImgSrcForNode : wDisplayThumbOf)(thumbOf(r), Math.max(120, Math.min(360, (node && node.w ? node.w - 40 : 240))))), draggable: true, style: { aspectRatio: (r.width && r.height) ? String(r.width) + ' / ' + String(r.height) : undefined }, title: r.idb && r.data ? '单击选中 · 双击查看原图 · 拖到画布作参考图' : '单击选中 · 双击放大(可左右切换)· 拖到画布作参考图', onError: (e) => { if (e.currentTarget && e.currentTarget.src !== r.url) e.currentTarget.src = r.url }, onPointerDown: (e) => { e.stopPropagation(); props.onSelect && props.onSelect(node.id) }, onDragStart: (e) => { try { const u = r.url || ''; e.dataTransfer.setData('application/x-iwb-output-ref', u); e.dataTransfer.setData('text/plain', u); e.dataTransfer.effectAllowed = 'copy' } catch (err) { /* 浏览器拒写自定义 MIME 时仍保留 text/plain */ } }, onDoubleClick: (e) => { e.stopPropagation(); openPreviewAt(cur) } }) // 下载浮层:与图库共用同一组 hover token;组件缺失时退回旧的双小按钮(单文件/旧加载顺序) @@ -894,10 +897,12 @@ const actions = DlOv ? null : el('div', { className: 'iwb-out-cell-actions' }, el('button', { className: 'iwb-btn iwb-btn-sm', title: '下载', onClick: doDownload, onPointerDown: stop }, I('download')), ) - const ingBadge = ingSt && (ingSt.status === 'queued' || ingSt.status === 'downloading') + const ingBadge = genBusy + ? el('span', { className: 'iwb-out-cell-flag iwb-out-cell-flag-busy', key: 'ing-flag' }, '生成中') + : ingSt && (ingSt.status === 'queued' || ingSt.status === 'downloading') ? el('span', { className: 'iwb-out-cell-flag', key: 'ing-flag' }, ingSt.status === 'queued' ? '排队中' : '下载中') : (ingSt && ingSt.status === 'failed' ? el('span', { className: 'iwb-out-cell-flag iwb-out-cell-flag-err', key: 'ing-flag' }, '未落地') : null) - return el('div', { key: String(r.url || '') + '|' + ri, className: 'iwb-out-cell' }, + return el('div', { key: String(r.url || '') + '|' + ri, className: 'iwb-out-cell' + (genBusy ? ' iwb-out-cell-busy' : '') }, ingBadge, DlOv ? el(DlOv, { key: 'ov', onDownload: doDownload, icon: I('download'), label: '下载' }, imgEl) : imgEl, el('div', { className: 'iwb-out-cell-meta' }, (r.width || '?') + '×' + (r.height || '?')), diff --git a/style.css b/style.css index 8002b5f..428a3e8 100644 --- a/style.css +++ b/style.css @@ -2575,3 +2575,7 @@ body .iwb-history-embedded .iwb-history-item.iwb-history-selected:hover img { .iwb-out-cell { position: relative; } .iwb-out-cell-flag { position: absolute; left: var(--iwb-space-4); top: var(--iwb-space-4); z-index: var(--iwb-z-anchor); padding: 0 var(--iwb-space-8); border-radius: var(--iwb-radius-full); font-size: var(--iwb-font-xs); line-height: 16px; color: var(--iwb-text); background: var(--iwb-panel); border: 1px solid var(--iwb-border2); opacity: .92; } .iwb-out-cell-flag-err { color: var(--iwb-err); border-color: var(--iwb-err-bd); background: var(--iwb-err-bg); } + +/* 生成中:旧图压暗 + 「生成中」角标(不动 data,失败即恢复) */ +.iwb-out-cell-busy .iwb-out-cell-img { opacity: .5; filter: saturate(.75); } +.iwb-out-cell-flag-busy { color: var(--iwb-warn); border-color: var(--iwb-warn-bd); background: var(--iwb-warn-bg); }