release: dsh-sansheng-liubu v0.3.3 (package at repo root)
单击只选中部门;开新部门自动打开工作台。
This commit is contained in:
parent
b0e111e3f3
commit
a2ab21b39f
27
client.js
27
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",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "dsh-sansheng-liubu",
|
||||
"version": "0.3.2",
|
||||
"version": "0.3.3",
|
||||
"description": "三省六部:每个项目固定十席角色与独立会话的 DSH 插件(第一版)。",
|
||||
"keywords": [
|
||||
"dsh-plugin",
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Reference in New Issue