dsh-task-board-tapd 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/client.js +46 -9
- package/package.json +1 -1
- package/src/host/service.js +2 -1
package/README.md
CHANGED
|
@@ -7,6 +7,7 @@ DeepSeek Harness(DSH)内的 **TAPD 任务看板** 插件:在客户端侧
|
|
|
7
7
|
## 功能
|
|
8
8
|
|
|
9
9
|
- 侧栏面板行 + 主栏看板页(shell 官方座位,非 DOM 接管)
|
|
10
|
+
- 泳道排序:按状态显示名的业务阶段排列(待受理 → 已受理 → 方案 → 实施/处理 → 验改/验收 → 完成 → 取消/阻塞),不依赖 TAPD 的物理值字典序,因此各空间自定义状态也能得到合理顺序;设置页可关闭「显示空泳道」只看有任务的列
|
|
10
11
|
- 类型页签:需求 / 任务 / 缺陷,泳道**完全来自 TAPD 字段配置**(get_fields_info 返回的状态集合与标签),空状态也保留;切换空间后即使状态命名不同也能正确显示全部泳道,不再依赖任何硬编码状态值
|
|
11
12
|
- 泳道拖拽:把卡片拖到目标状态列即调用 TAPD 更新状态,拖拽中目标列高亮、原卡片半透明;改状态失败时卡片回到原列并在顶部显示错误
|
|
12
13
|
- 默认只显示当前用户在配置工作区内负责的工作项(需求/任务按 `owner`,缺陷按 `current_owner`),不会展示其他人的任务
|
package/client.js
CHANGED
|
@@ -34,7 +34,7 @@ window.__ModuleLoader__.load({
|
|
|
34
34
|
detail: '详情', close: '关闭', move: '改状态', save: '保存', commentPlaceholder: '输入评论…', comment: '评论', comments: '评论', empty: '暂无数据', noResult: '没有匹配的工作项',
|
|
35
35
|
create: { title: '新建工作项', name: '标题', description: '描述', owner: '处理人', priority: '优先级', create: '创建', cancel: '取消', template: '创建模板', templateNone: '(不使用模板)', type: '类型' },
|
|
36
36
|
priorityLabel: { '1': '高', '2': '中', '3': '低' },
|
|
37
|
-
loading: '正在刷新 TAPD…', updated: '已更新于', settings: '设置', setupTitle: 'TAPD / AI 设置', saveSettings: '保存设置', tokenReady: 'Token 已配置', tokenMissing: '缺少 Token', setupDocs: '首次使用:请在系统环境变量中配置 TAPD_TOKEN、TAPD_WORKSPACE_ID(或 TAPD_WORKSPACE_IDS)、TAPD_API_ENDPOINT,保存后点击刷新。', scheduleHint: '定时执行:在工作项详情中直接选择执行时间;到点会自动创建独立会话并由 Agent 使用 TAPD 工具处理。', aiSection: 'AI 执行(DeepSeek)', chatHint: '复制下方的执行提示,粘贴到任意 DeepSeek 对话中即可让客户端直接处理这条任务(Agent 具备 tapd_board_* 工具,可读详情、改状态、评论、建需求)。', copyPrompt: '复制执行提示', copied: '已复制,可粘贴到对话中直接执行', scheduleSection: '定时执行', scheduleViaChat: '选择时间后,插件会创建独立会话;到点自动唤醒 Agent 执行 TAPD 任务。', scheduleAtLabel: '执行时间', scheduleCreate: '创建自动任务', scheduleCreated: '已创建自动执行任务', scheduleUnavailable: '当前 DSH 未启用定时服务', workspacePathsLabel: 'TAPD 工作区 → DSH 执行工作区', workspacePathPlaceholder: '选择本地目录(如项目根目录)', workspacePathPick: '选择目录', workspacePathNone: '未选择执行工作区,将在默认空间执行', workspaceRegisterHint: '执行空间是当前任务的独立设置;可选择已登记的 DSH 工作区,或登记新的代码工程工作区。', workspacePathHint: '为每个 TAPD 工作区(任务登记的空间)绑定一个 DSH 工作区(任务执行的空间,绑定代码工程目录)。绑定后,该工作区的定时任务到点会自动在该 DSH 工作区打开会话,Agent 可直接读写对应代码工程;未绑定的工作区使用默认空间。可点「登记新工作区」用系统目录选择器把本地项目目录登记为 DSH 工作区。', workspacePathOverride: '执行空间目录(可选)', runInSpace: '执行空间', workspaceBindDefault: '(默认空间)', workspaceRegisterNew: '登记新工作区', workspaceRegistered: '已登记并绑定', workspaceNoRegistry: '当前 DSH 无已登记的工作区', endpointLabel: 'API 端点', workspaceIdsLabel: '工作区 ID(逗号分隔)', refreshSecondsLabel: '自动刷新间隔(秒)', listLimitLabel: '每类型条数上限', modelLabel: '默认模型(provider/model)', announceLabel: '向 Agent 声明本插件工具(对话可操作 TAPD)', tpl: { title: '本地创建模板', add: '新增模板', edit: '编辑', remove: '删除', empty: '还没有本地模板,点「新增模板」创建(保存在本机,AI 也能用)', name: '模板名称', prefix: '标题前缀(可选,如 [运维] )', desc: '描述骨架(创建时填入描述)', owner: '默认处理人(可选)', priorityNone: '默认优先级(不设置)', setDefault: '设为默认:', defaultTag: '默认', localTemplates: '本地模板', tapdTemplates: 'TAPD 模板', localHint: '本地模板由你在设置页维护,AI 可通过 tapd_board_templates 读取并使用' }, error: '出错了', retry: '重试', deleting: '', unknown: '其他', templateUnavailable: '当前类型无可用创建模板(TAPD 该接口可能未授权)', templateLoading: '加载模板…', welcomeTitle: '欢迎使用 TAPD 看板', welcomeSubtitle: '第一次使用请先完成 TAPD 配置;已配置可跳过。', welcomeConfigTitle: '1. TAPD 配置', welcomeConfigStep1: '在系统环境变量中配置 TAPD_TOKEN(个人 Token,必填)', welcomeConfigStep2: '配置 TAPD_WORKSPACE_ID(单个)或 TAPD_WORKSPACE_IDS(多个,逗号分隔)', welcomeConfigStep3: '可选配置 TAPD_API_ENDPOINT,默认 https://api.tapd.cn;完成后完全退出并重开 DSH', welcomeGuideTitle: '2. 快速上手', welcomeGuideDrag: '拖拽卡片到其他泳道即可修改任务状态', welcomeGuideDetail: '点击卡片查看详情、评论、改状态', welcomeGuideSchedule: '在详情中选择执行时间与工作区,可创建到点自动执行的会话', welcomeGuideAgent: '对话中可用 tapd_board_* 工具读取和操作 TAPD', welcomeOpenSettings: '打开设置', welcomeGotIt: '知道了', help: '帮助',
|
|
37
|
+
loading: '正在刷新 TAPD…', updated: '已更新于', settings: '设置', setupTitle: 'TAPD / AI 设置', saveSettings: '保存设置', tokenReady: 'Token 已配置', tokenMissing: '缺少 Token', setupDocs: '首次使用:请在系统环境变量中配置 TAPD_TOKEN、TAPD_WORKSPACE_ID(或 TAPD_WORKSPACE_IDS)、TAPD_API_ENDPOINT,保存后点击刷新。', scheduleHint: '定时执行:在工作项详情中直接选择执行时间;到点会自动创建独立会话并由 Agent 使用 TAPD 工具处理。', aiSection: 'AI 执行(DeepSeek)', chatHint: '复制下方的执行提示,粘贴到任意 DeepSeek 对话中即可让客户端直接处理这条任务(Agent 具备 tapd_board_* 工具,可读详情、改状态、评论、建需求)。', copyPrompt: '复制执行提示', copied: '已复制,可粘贴到对话中直接执行', scheduleSection: '定时执行', scheduleViaChat: '选择时间后,插件会创建独立会话;到点自动唤醒 Agent 执行 TAPD 任务。', scheduleAtLabel: '执行时间', scheduleCreate: '创建自动任务', scheduleCreated: '已创建自动执行任务', scheduleUnavailable: '当前 DSH 未启用定时服务', workspacePathsLabel: 'TAPD 工作区 → DSH 执行工作区', workspacePathPlaceholder: '选择本地目录(如项目根目录)', workspacePathPick: '选择目录', workspacePathNone: '未选择执行工作区,将在默认空间执行', workspaceRegisterHint: '执行空间是当前任务的独立设置;可选择已登记的 DSH 工作区,或登记新的代码工程工作区。', workspacePathHint: '为每个 TAPD 工作区(任务登记的空间)绑定一个 DSH 工作区(任务执行的空间,绑定代码工程目录)。绑定后,该工作区的定时任务到点会自动在该 DSH 工作区打开会话,Agent 可直接读写对应代码工程;未绑定的工作区使用默认空间。可点「登记新工作区」用系统目录选择器把本地项目目录登记为 DSH 工作区。', workspacePathOverride: '执行空间目录(可选)', runInSpace: '执行空间', workspaceBindDefault: '(默认空间)', workspaceRegisterNew: '登记新工作区', workspaceRegistered: '已登记并绑定', workspaceNoRegistry: '当前 DSH 无已登记的工作区', endpointLabel: 'API 端点', workspaceIdsLabel: '工作区 ID(逗号分隔)', refreshSecondsLabel: '自动刷新间隔(秒)', listLimitLabel: '每类型条数上限', modelLabel: '默认模型(provider/model)', announceLabel: '向 Agent 声明本插件工具(对话可操作 TAPD)', showEmptyLabel: '显示没有任务的空泳道(关闭后只显示有任务的列)', tpl: { title: '本地创建模板', add: '新增模板', edit: '编辑', remove: '删除', empty: '还没有本地模板,点「新增模板」创建(保存在本机,AI 也能用)', name: '模板名称', prefix: '标题前缀(可选,如 [运维] )', desc: '描述骨架(创建时填入描述)', owner: '默认处理人(可选)', priorityNone: '默认优先级(不设置)', setDefault: '设为默认:', defaultTag: '默认', localTemplates: '本地模板', tapdTemplates: 'TAPD 模板', localHint: '本地模板由你在设置页维护,AI 可通过 tapd_board_templates 读取并使用' }, error: '出错了', retry: '重试', deleting: '', unknown: '其他', templateUnavailable: '当前类型无可用创建模板(TAPD 该接口可能未授权)', templateLoading: '加载模板…', welcomeTitle: '欢迎使用 TAPD 看板', welcomeSubtitle: '第一次使用请先完成 TAPD 配置;已配置可跳过。', welcomeConfigTitle: '1. TAPD 配置', welcomeConfigStep1: '在系统环境变量中配置 TAPD_TOKEN(个人 Token,必填)', welcomeConfigStep2: '配置 TAPD_WORKSPACE_ID(单个)或 TAPD_WORKSPACE_IDS(多个,逗号分隔)', welcomeConfigStep3: '可选配置 TAPD_API_ENDPOINT,默认 https://api.tapd.cn;完成后完全退出并重开 DSH', welcomeGuideTitle: '2. 快速上手', welcomeGuideDrag: '拖拽卡片到其他泳道即可修改任务状态', welcomeGuideDetail: '点击卡片查看详情、评论、改状态', welcomeGuideSchedule: '在详情中选择执行时间与工作区,可创建到点自动执行的会话', welcomeGuideAgent: '对话中可用 tapd_board_* 工具读取和操作 TAPD', welcomeOpenSettings: '打开设置', welcomeGotIt: '知道了', help: '帮助',
|
|
38
38
|
},
|
|
39
39
|
en: {
|
|
40
40
|
entry: 'TAPD Board',
|
|
@@ -46,13 +46,41 @@ window.__ModuleLoader__.load({
|
|
|
46
46
|
detail: 'Detail', close: 'Close', move: 'Status', save: 'Save', commentPlaceholder: 'Write a comment…', comment: 'Comment', comments: 'Comments', empty: 'No data', noResult: 'No matching items',
|
|
47
47
|
create: { title: 'New Item', name: 'Title', description: 'Description', owner: 'Owner', priority: 'Priority', create: 'Create', cancel: 'Cancel', template: 'Template', templateNone: '(no template)', type: 'Type' },
|
|
48
48
|
priorityLabel: { '1': 'High', '2': 'Medium', '3': 'Low' },
|
|
49
|
-
loading: 'Refreshing TAPD…', updated: 'Updated', settings: 'Settings', setupTitle: 'TAPD / AI Settings', saveSettings: 'Save', tokenReady: 'Token configured', tokenMissing: 'Token missing', setupDocs: 'First run: configure TAPD_TOKEN, TAPD_WORKSPACE_ID (or TAPD_WORKSPACE_IDS) and TAPD_API_ENDPOINT as env vars, then refresh.', scheduleHint: 'Schedule runs from a story/task/bug detail: pick an execution time, and the plugin creates a dedicated Session that the Agent wakes to process the TAPD item.', aiSection: 'AI execution (DeepSeek)', chatHint: 'Copy the execution prompt and paste it into any DeepSeek chat. The Agent has tapd_board_* tools to read, update, comment, and create TAPD items.', copyPrompt: 'Copy prompt', copied: 'Copied. Paste it into a chat to run', scheduleSection: 'Scheduled execution', scheduleViaChat: 'Pick a time. The plugin creates a dedicated Session and wakes an Agent to execute the TAPD task automatically.', scheduleAtLabel: 'Execution time', scheduleCreate: 'Create automatic task', scheduleCreated: 'Automatic task scheduled', scheduleUnavailable: 'DSH scheduling service is not enabled', workspacePathsLabel: 'TAPD workspace → DSH execution workspace', workspacePathPlaceholder: 'Pick a local directory (e.g. project root)', workspacePathPick: 'Pick directory', workspacePathNone: 'No execution workspace chosen; will run in the default space', workspaceRegisterHint: 'The execution workspace is a per-task setting: pick a registered DSH workspace or register a new code project workspace.', workspacePathHint: 'Bind each TAPD workspace (where tasks are registered) to a DSH workspace (where tasks execute; bound to a code project directory). Scheduled tasks from a bound TAPD workspace then open their Session in that DSH workspace so the Agent can read/write the project; unmapped workspaces run in the default space. Use "Register new space" to register a project directory as a DSH workspace via the native picker.', workspacePathOverride: 'Run directory (optional)', runInSpace: 'Runs in space', workspaceBindDefault: '(default space)', workspaceRegisterNew: 'Register new space', workspaceRegistered: 'Registered and bound', workspaceNoRegistry: 'No DSH workspace registered', endpointLabel: 'API endpoint', workspaceIdsLabel: 'Workspace IDs (comma separated)', refreshSecondsLabel: 'Auto-refresh seconds', listLimitLabel: 'Items per type', modelLabel: 'Default model (provider/model)', announceLabel: 'Announce TAPD tools to the Agent', error: 'Error', retry: 'Retry', deleting: '', unknown: 'Other', templateUnavailable: 'No create template available for this type (TAPD API may be unauthorized)', templateLoading: 'Loading templates…', welcomeTitle: 'Welcome to TAPD Board', welcomeSubtitle: 'On first use, complete the TAPD configuration below. Skip it if already configured.', welcomeConfigTitle: '1. TAPD configuration', welcomeConfigStep1: 'Set env var TAPD_TOKEN (personal token, required)', welcomeConfigStep2: 'Set TAPD_WORKSPACE_ID (single) or TAPD_WORKSPACE_IDS (comma separated)', welcomeConfigStep3: 'Optionally set TAPD_API_ENDPOINT (default https://api.tapd.cn); then fully quit and reopen DSH', welcomeGuideTitle: '2. Quick start', welcomeGuideDrag: 'Drag a card to another lane to change its status', welcomeGuideDetail: 'Click a card to view details, comment, or change status', welcomeGuideSchedule: 'Pick an execution time and workspace in the detail drawer to schedule an auto-run session', welcomeGuideAgent: 'Use tapd_board_* tools in chat to read and operate TAPD', welcomeOpenSettings: 'Open settings', welcomeGotIt: 'Got it', help: 'Help', tpl: { title: 'Local create templates', add: 'New template', edit: 'Edit', remove: 'Delete', empty: 'No local template yet. Click New template (stored locally, also usable by AI)', name: 'Template name', prefix: 'Title prefix (optional, e.g. [Ops] )', desc: 'Description skeleton (filled on create)', owner: 'Default owner (optional)', priorityNone: 'Default priority (none)', setDefault: 'Default for: ', defaultTag: 'Default', localTemplates: 'Local templates', tapdTemplates: 'TAPD templates', localHint: 'Local templates are maintained in settings and readable by AI via tapd_board_templates' },
|
|
49
|
+
loading: 'Refreshing TAPD…', updated: 'Updated', settings: 'Settings', setupTitle: 'TAPD / AI Settings', saveSettings: 'Save', tokenReady: 'Token configured', tokenMissing: 'Token missing', setupDocs: 'First run: configure TAPD_TOKEN, TAPD_WORKSPACE_ID (or TAPD_WORKSPACE_IDS) and TAPD_API_ENDPOINT as env vars, then refresh.', scheduleHint: 'Schedule runs from a story/task/bug detail: pick an execution time, and the plugin creates a dedicated Session that the Agent wakes to process the TAPD item.', aiSection: 'AI execution (DeepSeek)', chatHint: 'Copy the execution prompt and paste it into any DeepSeek chat. The Agent has tapd_board_* tools to read, update, comment, and create TAPD items.', copyPrompt: 'Copy prompt', copied: 'Copied. Paste it into a chat to run', scheduleSection: 'Scheduled execution', scheduleViaChat: 'Pick a time. The plugin creates a dedicated Session and wakes an Agent to execute the TAPD task automatically.', scheduleAtLabel: 'Execution time', scheduleCreate: 'Create automatic task', scheduleCreated: 'Automatic task scheduled', scheduleUnavailable: 'DSH scheduling service is not enabled', workspacePathsLabel: 'TAPD workspace → DSH execution workspace', workspacePathPlaceholder: 'Pick a local directory (e.g. project root)', workspacePathPick: 'Pick directory', workspacePathNone: 'No execution workspace chosen; will run in the default space', workspaceRegisterHint: 'The execution workspace is a per-task setting: pick a registered DSH workspace or register a new code project workspace.', workspacePathHint: 'Bind each TAPD workspace (where tasks are registered) to a DSH workspace (where tasks execute; bound to a code project directory). Scheduled tasks from a bound TAPD workspace then open their Session in that DSH workspace so the Agent can read/write the project; unmapped workspaces run in the default space. Use "Register new space" to register a project directory as a DSH workspace via the native picker.', workspacePathOverride: 'Run directory (optional)', runInSpace: 'Runs in space', workspaceBindDefault: '(default space)', workspaceRegisterNew: 'Register new space', workspaceRegistered: 'Registered and bound', workspaceNoRegistry: 'No DSH workspace registered', endpointLabel: 'API endpoint', workspaceIdsLabel: 'Workspace IDs (comma separated)', refreshSecondsLabel: 'Auto-refresh seconds', listLimitLabel: 'Items per type', modelLabel: 'Default model (provider/model)', announceLabel: 'Announce TAPD tools to the Agent', error: 'Error', retry: 'Retry', deleting: '', unknown: 'Other', templateUnavailable: 'No create template available for this type (TAPD API may be unauthorized)', templateLoading: 'Loading templates…', welcomeTitle: 'Welcome to TAPD Board', welcomeSubtitle: 'On first use, complete the TAPD configuration below. Skip it if already configured.', welcomeConfigTitle: '1. TAPD configuration', welcomeConfigStep1: 'Set env var TAPD_TOKEN (personal token, required)', welcomeConfigStep2: 'Set TAPD_WORKSPACE_ID (single) or TAPD_WORKSPACE_IDS (comma separated)', welcomeConfigStep3: 'Optionally set TAPD_API_ENDPOINT (default https://api.tapd.cn); then fully quit and reopen DSH', welcomeGuideTitle: '2. Quick start', welcomeGuideDrag: 'Drag a card to another lane to change its status', welcomeGuideDetail: 'Click a card to view details, comment, or change status', welcomeGuideSchedule: 'Pick an execution time and workspace in the detail drawer to schedule an auto-run session', welcomeGuideAgent: 'Use tapd_board_* tools in chat to read and operate TAPD', welcomeOpenSettings: 'Open settings', welcomeGotIt: 'Got it', help: 'Help', showEmptyLabel: 'Show empty lanes (turn off to show only lanes with items)', tpl: { title: 'Local create templates', add: 'New template', edit: 'Edit', remove: 'Delete', empty: 'No local template yet. Click New template (stored locally, also usable by AI)', name: 'Template name', prefix: 'Title prefix (optional, e.g. [Ops] )', desc: 'Description skeleton (filled on create)', owner: 'Default owner (optional)', priorityNone: 'Default priority (none)', setDefault: 'Default for: ', defaultTag: 'Default', localTemplates: 'Local templates', tapdTemplates: 'TAPD templates', localHint: 'Local templates are maintained in settings and readable by AI via tapd_board_templates' },
|
|
50
50
|
},
|
|
51
51
|
}
|
|
52
52
|
const fallback = dicts.zh
|
|
53
53
|
let translate = key => fallback[key]
|
|
54
54
|
let pickDirectory = null
|
|
55
55
|
const TYPE_KEYS = ['story', 'task', 'bug']
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* 泳道排序:TAPD 返回的状态 options 是按物理值字典序(done < status_10 < status_2),
|
|
59
|
+
* 直接渲染会出现「已完成排最左、待受理挤中间」的错乱。这里按**状态显示名的语义**
|
|
60
|
+
* 归入业务阶段,不写死任何物理状态值,因此对各空间自定义状态同样生效。
|
|
61
|
+
*/
|
|
62
|
+
const STATUS_STAGE_HINTS = [
|
|
63
|
+
/待受理|未开始|未处理|待处理|新建|待办|待启动|草稿|申请|提出|待提交/,
|
|
64
|
+
/已受理|已确认|已规划|待规划|待排期|已排期|已立项/,
|
|
65
|
+
/方案|设计|分析|调研|规划中|评估/,
|
|
66
|
+
/实施|开发|进行中|处理中|执行|编码|施工|修复中|推进/,
|
|
67
|
+
/测试|验证|验收|评审|联调|待发布|待上线|回归/,
|
|
68
|
+
/完成|已上线|已发布|已交付|已归档|已实现|已修复|已解决|关闭|结项|通过|成功/,
|
|
69
|
+
/取消|作废|驳回|拒绝|终止|阻塞|挂起|暂停|失败|搁置/,
|
|
70
|
+
]
|
|
71
|
+
/** 返回状态所处业务阶段序号(越小越靠前);无法识别时排到最后。 */
|
|
72
|
+
function statusStage(label, key) {
|
|
73
|
+
const text = String(label || '') || String(key || '')
|
|
74
|
+
for (let index = 0; index < STATUS_STAGE_HINTS.length; index += 1) {
|
|
75
|
+
if (STATUS_STAGE_HINTS[index].test(text)) return index
|
|
76
|
+
}
|
|
77
|
+
return STATUS_STAGE_HINTS.length
|
|
78
|
+
}
|
|
79
|
+
/** 同阶段内用状态值里的数字做稳定次序(status_16 -> 16)。 */
|
|
80
|
+
function statusSeq(key) {
|
|
81
|
+
const matched = String(key || '').match(/(\d+)/)
|
|
82
|
+
return matched ? Number(matched[1]) : Number.MAX_SAFE_INTEGER
|
|
83
|
+
}
|
|
56
84
|
const TYPE_GLYPHS = { story: '📋', task: '✅', bug: '🐛' }
|
|
57
85
|
const STATUS_GLYPHS = { open: '○', done: '●', in_progress: '◐', status_11: '◐', status_4: '●' }
|
|
58
86
|
function typeGlyph(type) { return TYPE_GLYPHS[type] || '•' }
|
|
@@ -259,16 +287,23 @@ window.__ModuleLoader__.load({
|
|
|
259
287
|
if (!buckets.has(key)) buckets.set(key, [])
|
|
260
288
|
buckets.get(key).push(item)
|
|
261
289
|
}
|
|
262
|
-
//
|
|
263
|
-
// 避免切换到状态命名不同的空间时只剩有数据的列、看不到其他泳道。
|
|
290
|
+
// 泳道来自 TAPD 字段配置(支持各空间自定义状态),并追加数据里出现但配置缺失的状态
|
|
264
291
|
const keys = Object.keys(labels || {})
|
|
265
292
|
for (const key of buckets.keys()) if (!keys.includes(key)) keys.push(key)
|
|
266
|
-
|
|
293
|
+
// 按业务阶段排序:待受理 → 已受理 → 方案 → 实施/处理 → 验证/验收 → 完成 → 异常
|
|
294
|
+
const ordered = keys.slice().sort((a, b) => {
|
|
295
|
+
const stageDiff = statusStage(labels[a], a) - statusStage(labels[b], b)
|
|
296
|
+
if (stageDiff !== 0) return stageDiff
|
|
297
|
+
return statusSeq(a) - statusSeq(b)
|
|
298
|
+
})
|
|
299
|
+
const showEmpty = state?.config?.showEmptyColumns !== false
|
|
300
|
+
const visible = showEmpty ? ordered : ordered.filter(key => buckets.has(key))
|
|
301
|
+
return visible.map(key => ({
|
|
267
302
|
key,
|
|
268
303
|
label: key === 'unknown' ? translate('unknown') : (labels[key] || key),
|
|
269
304
|
items: buckets.get(key) || [],
|
|
270
305
|
}))
|
|
271
|
-
}, [filtered, labels])
|
|
306
|
+
}, [filtered, labels, state?.config?.showEmptyColumns])
|
|
272
307
|
|
|
273
308
|
// —— 泳道拖拽改状态(HTML5 DnD)——
|
|
274
309
|
const [draggingItem, setDraggingItem] = useState(null)
|
|
@@ -764,7 +799,8 @@ window.__ModuleLoader__.load({
|
|
|
764
799
|
const [refreshSeconds, setRefreshSeconds] = useState(String(config?.refreshSeconds ?? 300))
|
|
765
800
|
const [listLimit, setListLimit] = useState(String(config?.listLimit ?? 200))
|
|
766
801
|
const [model, setModel] = useState(config?.model || '')
|
|
767
|
-
const [announce, setAnnounce] = useState(Boolean(config?.announceToAgent))
|
|
802
|
+
const [announce, setAnnounce] = useState(Boolean(config?.announceToAgent))
|
|
803
|
+
const [showEmpty, setShowEmpty] = useState(config?.showEmptyColumns !== false)
|
|
768
804
|
const ready = settings?.tokenConfigured
|
|
769
805
|
const statusText = ready === undefined ? translate('loading') : ready ? '✅ ' + translate('tokenReady') : '⚠️ ' + translate('tokenMissing')
|
|
770
806
|
const statusClass = ready === undefined ? '' : ready ? ' ok' : ' err'
|
|
@@ -779,13 +815,14 @@ window.__ModuleLoader__.load({
|
|
|
779
815
|
h('label', { className: 'tbx-field tbx-grow' }, h('span', { className: 'tbx-field-k' }, translate('refreshSecondsLabel')), h('input', { className: 'tbx-input', type: 'number', min: 30, value: refreshSeconds, onChange: event => setRefreshSeconds(event.target.value) })),
|
|
780
816
|
h('label', { className: 'tbx-field tbx-grow' }, h('span', { className: 'tbx-field-k' }, translate('listLimitLabel')), h('input', { className: 'tbx-input', type: 'number', min: 20, max: 200, value: listLimit, onChange: event => setListLimit(event.target.value) }))),
|
|
781
817
|
h('label', { className: 'tbx-field' }, h('span', { className: 'tbx-field-k' }, translate('modelLabel')), h('input', { className: 'tbx-input', value: model, onChange: event => setModel(event.target.value), placeholder: 'deepseek/deepseek-chat' })),
|
|
782
|
-
h('label', { className: 'tbx-field tbx-check' }, h('input', { type: 'checkbox', checked: announce, onChange: event => setAnnounce(event.target.checked) }), h('span', {}, translate('announceLabel'))),
|
|
818
|
+
h('label', { className: 'tbx-field tbx-check' }, h('input', { type: 'checkbox', checked: announce, onChange: event => setAnnounce(event.target.checked) }), h('span', {}, translate('announceLabel'))),
|
|
819
|
+
h('label', { className: 'tbx-field tbx-check' }, h('input', { type: 'checkbox', checked: showEmpty, onChange: event => setShowEmpty(event.target.checked) }), h('span', {}, translate('showEmptyLabel'))),
|
|
783
820
|
h('span', { className: 'tbx-note' }, translate('scheduleHint')),
|
|
784
821
|
h('div', { style: { borderTop: '1px solid var(--dsw-alias-border-l1)', paddingTop: 12 } },
|
|
785
822
|
h(TemplateManager, { templates, onSave: onSaveTemplate, onDelete: onDeleteTemplate })),
|
|
786
823
|
h('div', { className: 'tbx-row', style: { justifyContent: 'flex-end' } },
|
|
787
824
|
h('button', { className: 'tbx-btn', onClick: onClose, type: 'button' }, translate('close')),
|
|
788
|
-
h('button', { className: 'tbx-btn primary', onClick: () => onSave({ endpoint: endpoint.trim(), workspaceIds, refreshSeconds: Number(refreshSeconds) || 300, listLimit: Number(listLimit) || 200, model: model.trim(), announceToAgent: announce }), type: 'button' }, translate('saveSettings')))))
|
|
825
|
+
h('button', { className: 'tbx-btn primary', onClick: () => onSave({ endpoint: endpoint.trim(), workspaceIds, refreshSeconds: Number(refreshSeconds) || 300, listLimit: Number(listLimit) || 200, model: model.trim(), announceToAgent: announce, showEmptyColumns: showEmpty }), type: 'button' }, translate('saveSettings')))))
|
|
789
826
|
}
|
|
790
827
|
|
|
791
828
|
return {
|
package/package.json
CHANGED
package/src/host/service.js
CHANGED
|
@@ -113,7 +113,7 @@ export class TapdBoardService {
|
|
|
113
113
|
return registry.list().map(ws => ({ id: String(ws.id || ''), title: String(ws.title || ''), path: String(ws.path || '') }))
|
|
114
114
|
} catch { return [] }
|
|
115
115
|
}
|
|
116
|
-
viewConfig() { return { refreshSeconds: Number(this.config.refreshSeconds || 300), listLimit: Number(this.config.listLimit || 200), endpoint: this.client.endpoint, mineOnly: this.mineOnly, allowShowAll: this.allowShowAll, owner: this.owner || (this.mineOnly && this.user ? this.user.name : ''), workspaceId: this.client.workspaceId, workspaceIds: this.client.workspaceIds, workspacePaths: this.config.workspacePaths || {}, workspaceBindings: this.config.workspaceBindings || {}, dshWorkspaces: this.dshWorkspaces(), model: String(this.config.model || ''), allowAiHandoff: this.config.allowAiHandoff !== false, announceToAgent: this.config.announceToAgent === true, scheduleAvailable: Boolean(this.ctx.get?.('schedule')) } }
|
|
116
|
+
viewConfig() { return { refreshSeconds: Number(this.config.refreshSeconds || 300), listLimit: Number(this.config.listLimit || 200), endpoint: this.client.endpoint, mineOnly: this.mineOnly, allowShowAll: this.allowShowAll, owner: this.owner || (this.mineOnly && this.user ? this.user.name : ''), workspaceId: this.client.workspaceId, workspaceIds: this.client.workspaceIds, workspacePaths: this.config.workspacePaths || {}, workspaceBindings: this.config.workspaceBindings || {}, dshWorkspaces: this.dshWorkspaces(), model: String(this.config.model || ''), allowAiHandoff: this.config.allowAiHandoff !== false, announceToAgent: this.config.announceToAgent === true, showEmptyColumns: this.config.showEmptyColumns !== false, scheduleAvailable: Boolean(this.ctx.get?.('schedule')) } }
|
|
117
117
|
settingsSnapshot() {
|
|
118
118
|
let tokenConfigured = false
|
|
119
119
|
try { tokenConfigured = Boolean(this.client.token()) } catch { tokenConfigured = false }
|
|
@@ -196,6 +196,7 @@ export class TapdBoardService {
|
|
|
196
196
|
if (payload.listLimit !== undefined) patch.listLimit = Math.min(200, Math.max(20, Number(payload.listLimit) || 200))
|
|
197
197
|
if (payload.model !== undefined) patch.model = String(payload.model || '').trim()
|
|
198
198
|
if (payload.announceToAgent !== undefined) patch.announceToAgent = Boolean(payload.announceToAgent)
|
|
199
|
+
if (payload.showEmptyColumns !== undefined) patch.showEmptyColumns = Boolean(payload.showEmptyColumns)
|
|
199
200
|
if (payload.workspacePaths !== undefined) {
|
|
200
201
|
const raw = payload.workspacePaths && typeof payload.workspacePaths === 'object' ? payload.workspacePaths : {}
|
|
201
202
|
patch.workspacePaths = Object.fromEntries(Object.entries(raw).map(([key, value]) => [String(key).trim(), String(value || '').trim()]).filter(([, value]) => value))
|