岗位覆盖扩充至 26 个 + 图谱岗位子图模式
- 新增 8 岗位族(大数据/机器学习/机器人/数据治理/边缘计算/物联网安全/智能系统架构/隐私计算),词表 161→179 - 图谱详情面板新增'岗位子图'模式(只看该岗位及一跳邻居,徽标可退出) - 测试集扩至 176 条、匹配标注 52 对;real_jd_500 F1 99.82%;合成三项 100% 保持
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
filters: { types: { Job: true, Skill: true, Industry: true, Scenario: true }, category: "", level: "",
|
||||
edges: { required: true, preferred: true, applies: true, belongs: true } },
|
||||
selected: null, // 选中节点 id
|
||||
soloJob: null, // 岗位子图模式:只看该岗位及其一跳邻居
|
||||
hover: null,
|
||||
navStack: [], // 详情面板导航栈
|
||||
drag: null, // {mode:'pan'|'node', ...}
|
||||
@@ -161,6 +162,9 @@
|
||||
}
|
||||
function visible(n) {
|
||||
if (!G.filters.types[n.type]) return false;
|
||||
if (G.soloJob) { // 岗位子图:只保留该岗位与一跳邻居
|
||||
if (n.id !== G.soloJob && !neighborsOf(G.soloJob).has(n.id)) return false;
|
||||
}
|
||||
if (n.type === "Job") {
|
||||
if (G.filters.category && n.category !== G.filters.category) return false;
|
||||
if (G.filters.level && jobLevel(n) !== G.filters.level) return false;
|
||||
@@ -597,6 +601,18 @@
|
||||
}
|
||||
CN.gotoNode = locateNode;
|
||||
|
||||
function updateSoloBadge() {
|
||||
const badge = $("#solo-badge");
|
||||
if (!badge) return;
|
||||
badge.classList.toggle("hidden", !G.soloJob);
|
||||
if (G.soloJob) {
|
||||
const n = G.nodes[G.idx[G.soloJob]];
|
||||
$("#solo-badge-text").textContent = `岗位子图:${(n && (n.title || n.id)) || G.soloJob}`;
|
||||
}
|
||||
}
|
||||
const soloExit = $("#solo-exit");
|
||||
if (soloExit) soloExit.onclick = () => { G.soloJob = null; updateSoloBadge(); requestDraw(); };
|
||||
|
||||
/* ================= 备注(localStorage) ================= */
|
||||
const getNotes = () => JSON.parse(localStorage.getItem(NOTES_KEY) || "{}");
|
||||
function nodeNotes(id) { return getNotes()[id] || []; }
|
||||
@@ -720,6 +736,7 @@
|
||||
<button class="btn btn-secondary btn-sm" id="dt-sources">查看来源</button>`}
|
||||
<button class="btn btn-secondary btn-sm" id="dt-note">添加备注</button>
|
||||
${n.type === "Job" && !isPending ? `<button class="btn btn-secondary btn-sm" id="dt-evo">查看演化</button>
|
||||
<button class="btn btn-secondary btn-sm" id="dt-solo">岗位子图</button>
|
||||
<button class="btn btn-primary btn-sm full" id="dt-learn">生成学习路径</button>` : ""}
|
||||
</div>
|
||||
</div>
|
||||
@@ -765,6 +782,13 @@
|
||||
$("#evo-job-select").value = id;
|
||||
$("#evo-job-select").dispatchEvent(new Event("change"));
|
||||
};
|
||||
const soloBtn = $("#dt-solo");
|
||||
if (soloBtn) soloBtn.onclick = () => {
|
||||
G.soloJob = G.soloJob === id ? null : id;
|
||||
updateSoloBadge();
|
||||
requestDraw();
|
||||
if (G.soloJob) toast(`已进入「${n.title || id}」岗位子图(只看该岗位与一跳技能/场景/行业)`, "success");
|
||||
};
|
||||
const learnBtn = $("#dt-learn");
|
||||
if (learnBtn) learnBtn.onclick = () => {
|
||||
CN.switchView("path");
|
||||
|
||||
@@ -135,6 +135,12 @@
|
||||
<div class="graph-canvas-wrap card" id="graph-canvas-wrap">
|
||||
<canvas id="graph-canvas"></canvas>
|
||||
|
||||
<!-- 岗位子图状态徽标 -->
|
||||
<div class="solo-badge hidden" id="solo-badge">
|
||||
<span id="solo-badge-text">岗位子图</span>
|
||||
<button id="solo-exit" title="退出岗位子图">×</button>
|
||||
</div>
|
||||
|
||||
<!-- 左上浮动工具条 -->
|
||||
<div class="graph-toolbar">
|
||||
<button class="tool-btn" id="tool-zoom-in" title="放大"><svg viewBox="0 0 24 24"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.35-4.35M11 8v6M8 11h6"/></svg></button>
|
||||
|
||||
@@ -911,3 +911,16 @@ svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width:
|
||||
border-top: 1px solid var(--border);
|
||||
user-select: text;
|
||||
}
|
||||
|
||||
/* 岗位子图状态徽标 */
|
||||
.solo-badge {
|
||||
position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
|
||||
display: flex; align-items: center; gap: 8px; z-index: 30;
|
||||
background: var(--primary); color: #fff; font-size: 12px;
|
||||
border-radius: 999px; padding: 4px 8px 4px 14px; box-shadow: var(--shadow-pop);
|
||||
}
|
||||
.solo-badge button {
|
||||
border: none; background: rgba(255,255,255,.25); color: #fff;
|
||||
width: 18px; height: 18px; border-radius: 50%; cursor: pointer; line-height: 1;
|
||||
}
|
||||
.solo-badge button:hover { background: rgba(255,255,255,.45); }
|
||||
|
||||
Reference in New Issue
Block a user