From a2ab21b39faab2803be56832067fcbf34ab5a856 Mon Sep 17 00:00:00 2001 From: qyh15 Date: Tue, 17 Nov 2026 22:53:05 +0800 Subject: [PATCH] release: dsh-sansheng-liubu v0.3.3 (package at repo root) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 单击只选中部门;开新部门自动打开工作台。 --- client.js | 27 ++++++++++++++++++--------- package.json | 2 +- src/client/index.js | 28 +++++++++++++++++++--------- 3 files changed, 38 insertions(+), 19 deletions(-) diff --git a/client.js b/client.js index 02e6271..5cf8305 100644 --- a/client.js +++ b/client.js @@ -1292,16 +1292,21 @@ function apply(ctx) { setConfigOpen(false); } const seat = seatById[id]; - if (seat && seat.status === "bound") { - const rec = seatRecordOf(view, id); - if (rec && rec.sessionId) { - navigateToSession(rec.sessionId); - setNotice("已切换到" + seat.name + "会话"); - return; - } - } if (seat && seat.status !== "bound" && seat.status !== "creating") setNotice("「" + seat.name + "」还没开启,点下面的按钮开启这个部门"); } + function openSelectedSeat() { + const seat = seatById[wb.selected.id]; + if (!seat) return; + if (seat.status !== "bound") { + setNotice("「" + seat.name + "」还没开启,先点「开启『" + seat.name + "』」"); + return; + } + const rec = seatRecordOf(view, seat.id); + if (rec && rec.sessionId) { + navigateToSession(rec.sessionId); + setNotice("已切换到" + seat.name + "会话"); + } + } function setModelValue(value) { setDraft((prev) => updateDraft(prev, selectedSeatId, { modelValue: value })); } @@ -1320,6 +1325,10 @@ function apply(ctx) { if (!alive.current) return; setView(next); setNotice("已开启「" + wb.selected.name + "」的独立会话"); + try { + tryOpenRightTab(); + } catch { + } } catch (enableError) { if (alive.current) setError(enableError && enableError.message ? enableError.message : "开启失败"); } finally { @@ -1513,7 +1522,7 @@ function apply(ctx) { type: "button", className: "ssw-primary", disabled: busy, - onClick: () => pickSeat(wb.selected.id) + onClick: openSelectedSeat }, "开始对话") : (0, import_react.createElement)("button", { type: "button", className: "ssw-primary", diff --git a/package.json b/package.json index 445933b..f63a93b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dsh-sansheng-liubu", - "version": "0.3.2", + "version": "0.3.3", "description": "三省六部:每个项目固定十席角色与独立会话的 DSH 插件(第一版)。", "keywords": [ "dsh-plugin", diff --git a/src/client/index.js b/src/client/index.js index 420e510..c56cab7 100644 --- a/src/client/index.js +++ b/src/client/index.js @@ -390,6 +390,7 @@ export function apply(ctx) { return map }, [wb.seats]) + // 单击只负责“选中部门”,不切换宿主会话;切换会话会让工作台重挂载、选中项回到丞相。 function pickSeat(id) { if (!id) return if (id !== selectedSeatId) { @@ -397,17 +398,24 @@ export function apply(ctx) { setConfigOpen(false) } const seat = seatById[id] - if (seat && seat.status === 'bound') { - const rec = seatRecordOf(view, id) - if (rec && rec.sessionId) { - navigateToSession(rec.sessionId) - setNotice('已切换到' + seat.name + '会话') - return - } - } if (seat && seat.status !== 'bound' && seat.status !== 'creating') setNotice('「' + seat.name + '」还没开启,点下面的按钮开启这个部门') } + // 只有明确点“开始对话”时才进入该部门的宿主会话。 + function openSelectedSeat() { + const seat = seatById[wb.selected.id] + if (!seat) return + if (seat.status !== 'bound') { + setNotice('「' + seat.name + '」还没开启,先点「开启『' + seat.name + '』」') + return + } + const rec = seatRecordOf(view, seat.id) + if (rec && rec.sessionId) { + navigateToSession(rec.sessionId) + setNotice('已切换到' + seat.name + '会话') + } + } + function setModelValue(value) { setDraft(prev => updateDraft(prev, selectedSeatId, { modelValue: value })) } @@ -425,6 +433,8 @@ export function apply(ctx) { if (!alive.current) return setView(next) setNotice('已开启「' + wb.selected.name + '」的独立会话') + // 开新部门时自动把三省六部工作台面板打开/置前,避免用户以为没反应。 + try { tryOpenRightTab() } catch { /* 打开失败不影响开启结果 */ } } catch (enableError) { if (alive.current) setError(enableError && enableError.message ? enableError.message : '开启失败') } finally { @@ -590,7 +600,7 @@ export function apply(ctx) { selectedStatus === 'bound' ? h('button', { type: 'button', className: 'ssw-primary', disabled: busy, - onClick: () => pickSeat(wb.selected.id), + onClick: openSelectedSeat, }, '开始对话') : h('button', { type: 'button', className: 'ssw-primary', disabled: busy || selectedStatus === 'creating',