|
|
@@ -2196,6 +2196,7 @@
|
|
|
>
|
|
|
批量解构
|
|
|
</button>
|
|
|
+ <button class="btn sm" id="btn-extract-adopted" hidden>解构全部已采纳</button>
|
|
|
</span>
|
|
|
</div>
|
|
|
<div
|
|
|
@@ -2924,8 +2925,20 @@
|
|
|
const b = $("#btn-batch");
|
|
|
b.disabled = !state.selected.size;
|
|
|
b.textContent = state.selected.size ? `批量解构(${state.selected.size})` : "批量解构";
|
|
|
+ // 解构全部已采纳:有采纳帖才显示,带数量(口径同帖列表的 采纳 标记)
|
|
|
+ const adoptedN = (state.posts || []).filter((p) => p.adopted).length;
|
|
|
+ const ea = $("#btn-extract-adopted");
|
|
|
+ ea.hidden = !adoptedN;
|
|
|
+ ea.textContent = `解构全部已采纳(${adoptedN})`;
|
|
|
}
|
|
|
$("#btn-batch").onclick = () => state.selected.size && startExtract([...state.selected]);
|
|
|
+ $("#btn-extract-adopted").onclick = () => {
|
|
|
+ const cids = (state.posts || []).filter((p) => p.adopted).map((p) => p.case_id);
|
|
|
+ if (!cids.length) return toast("当前 query 下没有已采纳的帖子", "warn");
|
|
|
+ const dir = state.mode === "process" ? "工序" : "工具";
|
|
|
+ if (!confirm(`对该 query 下全部 ${cids.length} 个已采纳帖做${dir}解构?\n已解构过的会自动跳过/复用,不重复花钱。`)) return;
|
|
|
+ startExtract(cids); // 复用:认领锁 + 解构去重 + showTask 轮询
|
|
|
+ };
|
|
|
|
|
|
/* ════ 帖子详情弹层 ════ */
|
|
|
/* 得分可能是字符串("1")或数字(10),统一解析;非数值返回 null */
|