@yuku123/z-team-component 0.2.22 → 0.2.24
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/dist/DebugPlayground-cxffrMgF.js +15 -0
- package/dist/{InvitationManagementPage-C0FUV1TU.js → InvitationManagementPage-BnvfjueJ.js} +2 -2
- package/dist/{OnboardingPage-B030Arpo.js → OnboardingPage-B1uHZfRm.js} +2 -2
- package/dist/{ProjectApp-nq_XicIi.js → ProjectApp-C6GUGbAD.js} +3 -3
- package/dist/SmartWorkbench.module-DzQskKT0.js +85 -0
- package/dist/SystemShell-DSbSJWXv.js +602 -0
- package/dist/{admin-logs-96BMdLm3.js → admin-logs-C2V1ElH9.js} +34 -34
- package/dist/{api-DayyjL1e.js → api--Fg0hL9Y.js} +258 -258
- package/dist/{api-Cilf5gIj.js → api-BwXzkm3f.js} +1 -1
- package/dist/{createWorkspaceWsHandler-Dgpag_y3.js → createWorkspaceWsHandler-CqGqcTh_.js} +27 -27
- package/dist/echarts-B1OU1xr4.js +16 -0
- package/dist/{index-CW8ICCZX.js → index-3AXvDKQz.js} +3 -3
- package/dist/{index-BuGgpiDq.js → index-8V37FP9c.js} +4 -4
- package/dist/{index-gqKmHnTZ.js → index-B3ikipDf.js} +4 -4
- package/dist/{index-Cnw06MGB.js → index-BMRIUhOL.js} +3 -3
- package/dist/index-BaCiSbPR.js +956 -0
- package/dist/index-Bsh58cwF.js +975 -0
- package/dist/index-C01UUprh.js +41705 -0
- package/dist/index-C0EIMJI2.js +112 -0
- package/dist/{index-BX-3TBsz.js → index-CGDpGIZC.js} +6 -6
- package/dist/index-CUVdeb8y.js +638 -0
- package/dist/{index-DN6iuI7S.js → index-CkH1OY5_.js} +1616 -22092
- package/dist/{index-sGtg7MFg.js → index-D5u3BjCZ.js} +2 -2
- package/dist/{index-pJERGpTh.js → index-DK_aR-Vu.js} +5 -4
- package/dist/index-DPnfP7Cb.js +6879 -0
- package/dist/index-DkcpD37-.js +1171 -0
- package/dist/index-DvIHX7lZ.js +1657 -0
- package/dist/{index-Drj0OTv1.js → index-Jrz1Ho0h.js} +165 -163
- package/dist/{index-DHGvzWWQ.js → index-bbwTcNjB.js} +7 -7
- package/dist/index-hPzswwk2.js +5900 -0
- package/dist/index-mv7nvapp.js +1327 -0
- package/dist/index-pfzY68PH.js +1408 -0
- package/dist/index.js +1 -1
- package/dist/index.module-CAa-2T7m.js +72 -0
- package/dist/index.module-UI0iz8K0.js +42 -0
- package/dist/{instance-CNHJqTd1.js → instance-1QEDBRqA.js} +12 -12
- package/dist/pages.js +1 -1
- package/dist/schedule-C89oiqIR.js +239 -0
- package/dist/{send-default-agent-team-message-CRRwpv0q.js → send-default-agent-team-message-CxkWi3XC.js} +1 -1
- package/dist/{sso-user-D0JzsJeR.js → sso-user-BE1Ell5F.js} +1 -1
- package/dist/training-o-vSBkqP.js +450 -0
- package/dist/{useAppStore-BYXwTjW-.js → useAppStore-wgWaxcyc.js} +24 -24
- package/dist/webide-BxD6cYe-.js +8084 -0
- package/dist/z-team-component.css +2 -2
- package/package.json +1 -1
- package/dist/index-DvXzJh2b.js +0 -51507
|
@@ -0,0 +1,956 @@
|
|
|
1
|
+
import { jsxs as r, jsx as n, Fragment as H } from "react/jsx-runtime";
|
|
2
|
+
import { BookOutlined as V, ReloadOutlined as Ne, SearchOutlined as fe, CloseOutlined as ge, CaretDownOutlined as ve, CaretRightOutlined as Te } from "@ant-design/icons";
|
|
3
|
+
import { message as Se, Spin as F } from "antd";
|
|
4
|
+
import { useState as k, useRef as M, useEffect as G, useCallback as C } from "react";
|
|
5
|
+
import { a as A, B as R, u as E } from "./api--Fg0hL9Y.js";
|
|
6
|
+
function B(a) {
|
|
7
|
+
const l = new URLSearchParams();
|
|
8
|
+
Object.entries(a).forEach(([N, s]) => {
|
|
9
|
+
s !== void 0 && s !== "" && l.set(N, String(s));
|
|
10
|
+
});
|
|
11
|
+
const h = l.toString();
|
|
12
|
+
return h ? `?${h}` : "";
|
|
13
|
+
}
|
|
14
|
+
async function we(a = "") {
|
|
15
|
+
const l = await A(
|
|
16
|
+
`${R}/admin/biz-knowledge/graph/summary${B({ token: a })}`,
|
|
17
|
+
O
|
|
18
|
+
);
|
|
19
|
+
return E(l, "获取知识图谱概览失败");
|
|
20
|
+
}
|
|
21
|
+
async function Ce(a, l = "") {
|
|
22
|
+
const h = await A(
|
|
23
|
+
`${R}/admin/biz-knowledge/graph/entries${B({ type: a, token: l })}`,
|
|
24
|
+
O
|
|
25
|
+
);
|
|
26
|
+
return E(h, "获取入口清单失败");
|
|
27
|
+
}
|
|
28
|
+
async function Z(a, l = "") {
|
|
29
|
+
const h = await A(
|
|
30
|
+
`${R}/admin/biz-knowledge/graph/node-tree${B({ id: a, token: l })}`,
|
|
31
|
+
O
|
|
32
|
+
);
|
|
33
|
+
return E(h, "获取节点展开树失败");
|
|
34
|
+
}
|
|
35
|
+
async function $e(a, l = "", h = 60, N = "") {
|
|
36
|
+
const s = await A(
|
|
37
|
+
`${R}/admin/biz-knowledge/graph/search${B({
|
|
38
|
+
q: a,
|
|
39
|
+
type: l,
|
|
40
|
+
limit: h,
|
|
41
|
+
token: N
|
|
42
|
+
})}`,
|
|
43
|
+
O
|
|
44
|
+
);
|
|
45
|
+
return E(s, "知识图谱搜索失败");
|
|
46
|
+
}
|
|
47
|
+
async function Ie(a, l = "") {
|
|
48
|
+
const h = await A(
|
|
49
|
+
`${R}/admin/biz-knowledge/graph/node${B({ id: a, token: l })}`,
|
|
50
|
+
O
|
|
51
|
+
);
|
|
52
|
+
return E(h, "获取节点详情失败");
|
|
53
|
+
}
|
|
54
|
+
async function De(a = "") {
|
|
55
|
+
const l = await A(
|
|
56
|
+
`${R}/admin/biz-knowledge/graph/refresh${B({ token: a })}`,
|
|
57
|
+
{ ...O, method: "POST" }
|
|
58
|
+
);
|
|
59
|
+
return E(l, "刷新知识图谱失败");
|
|
60
|
+
}
|
|
61
|
+
const O = { credentials: "include" }, ke = "_wrap_hble5_1", Le = "_header_hble5_10", xe = "_headerTitle_hble5_21", Ge = "_headerIcon_hble5_31", Ae = "_headerSub_hble5_36", Re = "_headerStats_hble5_42", Ee = "_statChip_hble5_49", Be = "_statChipWarn_hble5_58", Oe = "_refreshBtn_hble5_63", Pe = "_body_hble5_82", He = "_sidebar_hble5_89", We = "_searchBox_hble5_99", Ke = "_searchIcon_hble5_105", ze = "_searchInput_hble5_115", je = "_sidebarHead_hble5_131", Ve = "_sidebarList_hble5_137", Me = "_listTip_hble5_144", Fe = "_hitItem_hble5_171", qe = "_pageItem_hble5_172", Xe = "_pageItemRow_hble5_180", Ye = "_itemCount_hble5_188", Ue = "_pageItemActive_hble5_203", Je = "_hitName_hble5_207", Qe = "_pageName_hble5_208", Ze = "_hitSub_hble5_215", et = "_pageSub_hble5_216", tt = "_dbGroup_hble5_226", at = "_dbGroupHead_hble5_230", nt = "_dbGroupHeadActive_hble5_247", it = "_dbGroupName_hble5_251", rt = "_dbGroupCount_hble5_259", st = "_entryBar_hble5_269", lt = "_entryTab_hble5_280", ct = "_entryTabActive_hble5_300", ot = "_entryTabCount_hble5_306", dt = "_entryBarHint_hble5_320", mt = "_midArea_hble5_329", ht = "_midTabs_hble5_337", pt = "_midTab_hble5_337", bt = "_midTabActive_hble5_367", ut = "_midTabName_hble5_373", _t = "_midTabClose_hble5_379", yt = "_main_hble5_395", Nt = "_colDragger_hble5_403", ft = "_detailWrap_hble5_419", gt = "_treeArea_hble5_425", vt = "_emptyState_hble5_433", Tt = "_emptyIcon_hble5_445", St = "_emptyTitle_hble5_450", wt = "_emptyDesc_hble5_456", Ct = "_legend_hble5_463", $t = "_legendItem_hble5_471", It = "_treeNode_hble5_480", Dt = "_nodeRow_hble5_484", kt = "_nodeRowGroup_hble5_498", Lt = "_caret_hble5_502", xt = "_dot_hble5_511", Gt = "_groupLabel_hble5_520", At = "_nodeCount_hble5_526", Rt = "_nodeName_hble5_536", Et = "_nodeSub_hble5_542", Bt = "_badge_hble5_551", Ot = "_detailPanel_hble5_564", Pt = "_detailEmpty_hble5_574", Ht = "_detailHead_hble5_581", Wt = "_detailName_hble5_587", Kt = "_detailVid_hble5_594", zt = "_detailSection_hble5_602", jt = "_propRow_hble5_611", Vt = "_propKey_hble5_618", Mt = "_propVal_hble5_627", Ft = "_propList_hble5_635", qt = "_propListItem_hble5_641", Xt = "_propObj_hble5_646", Yt = "_relGroup_hble5_656", Ut = "_relTitle_hble5_660", Jt = "_relNode_hble5_667", Qt = "_relName_hble5_681", Zt = "_relSub_hble5_686", t = {
|
|
62
|
+
wrap: ke,
|
|
63
|
+
header: Le,
|
|
64
|
+
headerTitle: xe,
|
|
65
|
+
headerIcon: Ge,
|
|
66
|
+
headerSub: Ae,
|
|
67
|
+
headerStats: Re,
|
|
68
|
+
statChip: Ee,
|
|
69
|
+
statChipWarn: Be,
|
|
70
|
+
refreshBtn: Oe,
|
|
71
|
+
body: Pe,
|
|
72
|
+
sidebar: He,
|
|
73
|
+
searchBox: We,
|
|
74
|
+
searchIcon: Ke,
|
|
75
|
+
searchInput: ze,
|
|
76
|
+
sidebarHead: je,
|
|
77
|
+
sidebarList: Ve,
|
|
78
|
+
listTip: Me,
|
|
79
|
+
hitItem: Fe,
|
|
80
|
+
pageItem: qe,
|
|
81
|
+
pageItemRow: Xe,
|
|
82
|
+
itemCount: Ye,
|
|
83
|
+
pageItemActive: Ue,
|
|
84
|
+
hitName: Je,
|
|
85
|
+
pageName: Qe,
|
|
86
|
+
hitSub: Ze,
|
|
87
|
+
pageSub: et,
|
|
88
|
+
dbGroup: tt,
|
|
89
|
+
dbGroupHead: at,
|
|
90
|
+
dbGroupHeadActive: nt,
|
|
91
|
+
dbGroupName: it,
|
|
92
|
+
dbGroupCount: rt,
|
|
93
|
+
entryBar: st,
|
|
94
|
+
entryTab: lt,
|
|
95
|
+
entryTabActive: ct,
|
|
96
|
+
entryTabCount: ot,
|
|
97
|
+
entryBarHint: dt,
|
|
98
|
+
midArea: mt,
|
|
99
|
+
midTabs: ht,
|
|
100
|
+
midTab: pt,
|
|
101
|
+
midTabActive: bt,
|
|
102
|
+
midTabName: ut,
|
|
103
|
+
midTabClose: _t,
|
|
104
|
+
main: yt,
|
|
105
|
+
colDragger: Nt,
|
|
106
|
+
detailWrap: ft,
|
|
107
|
+
treeArea: gt,
|
|
108
|
+
emptyState: vt,
|
|
109
|
+
emptyIcon: Tt,
|
|
110
|
+
emptyTitle: St,
|
|
111
|
+
emptyDesc: wt,
|
|
112
|
+
legend: Ct,
|
|
113
|
+
legendItem: $t,
|
|
114
|
+
treeNode: It,
|
|
115
|
+
nodeRow: Dt,
|
|
116
|
+
nodeRowGroup: kt,
|
|
117
|
+
caret: Lt,
|
|
118
|
+
dot: xt,
|
|
119
|
+
groupLabel: Gt,
|
|
120
|
+
nodeCount: At,
|
|
121
|
+
nodeName: Rt,
|
|
122
|
+
nodeSub: Et,
|
|
123
|
+
badge: Bt,
|
|
124
|
+
detailPanel: Ot,
|
|
125
|
+
detailEmpty: Pt,
|
|
126
|
+
detailHead: Ht,
|
|
127
|
+
detailName: Wt,
|
|
128
|
+
detailVid: Kt,
|
|
129
|
+
detailSection: zt,
|
|
130
|
+
propRow: jt,
|
|
131
|
+
propKey: Vt,
|
|
132
|
+
propVal: Mt,
|
|
133
|
+
propList: Ft,
|
|
134
|
+
propListItem: qt,
|
|
135
|
+
propObj: Xt,
|
|
136
|
+
relGroup: Yt,
|
|
137
|
+
relTitle: Ut,
|
|
138
|
+
relNode: Jt,
|
|
139
|
+
relName: Qt,
|
|
140
|
+
relSub: Zt
|
|
141
|
+
}, ea = {
|
|
142
|
+
Page: "#34a853",
|
|
143
|
+
Action: "#4285f4",
|
|
144
|
+
Chain: "#8b5cf6",
|
|
145
|
+
ChainStep: "#8c8c8c",
|
|
146
|
+
Symptom: "#eb2f96",
|
|
147
|
+
Fix: "#f5222d",
|
|
148
|
+
Rule: "#d48806",
|
|
149
|
+
Field: "#fa8c16",
|
|
150
|
+
Code: "#cf1322",
|
|
151
|
+
Vo: "13c2c2",
|
|
152
|
+
Db: "#0369a1",
|
|
153
|
+
DbTable: "#89620e",
|
|
154
|
+
DbColumn: "#89620e"
|
|
155
|
+
}, ae = {
|
|
156
|
+
Page: "页面",
|
|
157
|
+
Action: "操作",
|
|
158
|
+
Chain: "因果链",
|
|
159
|
+
ChainStep: "步骤",
|
|
160
|
+
Symptom: "症状",
|
|
161
|
+
Fix: "止血",
|
|
162
|
+
Rule: "规矩",
|
|
163
|
+
Field: "数据字段",
|
|
164
|
+
Code: "代码",
|
|
165
|
+
Vo: "页面组件",
|
|
166
|
+
Db: "库",
|
|
167
|
+
DbTable: "库表",
|
|
168
|
+
DbColumn: "字段"
|
|
169
|
+
}, ee = [
|
|
170
|
+
{ type: "Page", label: "页面" },
|
|
171
|
+
{ type: "Symptom", label: "症状" },
|
|
172
|
+
{ type: "Chain", label: "因果链" },
|
|
173
|
+
{ type: "DbTable", label: "库表" }
|
|
174
|
+
], ta = {
|
|
175
|
+
Page: "左侧选择一个业务页面,看懂它的因果链",
|
|
176
|
+
Symptom: "左侧选择一个症状,看它的止血案例与相关因果链",
|
|
177
|
+
Chain: "左侧选择一条因果链,看它的步骤、症状与处置",
|
|
178
|
+
DbTable: "按库浏览:点库名看库下全表,点表中钻看字段与读写引用"
|
|
179
|
+
}, pe = {
|
|
180
|
+
Page: "操作",
|
|
181
|
+
Symptom: "止血",
|
|
182
|
+
Chain: "步骤",
|
|
183
|
+
DbTable: "字段"
|
|
184
|
+
};
|
|
185
|
+
function X(a, l) {
|
|
186
|
+
return a.id ? `${l}::${a.id}` : `${l}::${a.label ?? ""}`;
|
|
187
|
+
}
|
|
188
|
+
function q(a, l, h, N) {
|
|
189
|
+
if (h > 2) return;
|
|
190
|
+
const s = X(a, l);
|
|
191
|
+
if (N.add(s), a.type === "Db" && h === 0) {
|
|
192
|
+
(a.children ?? []).forEach((f) => N.add(X(f, s)));
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
(a.children ?? []).forEach(
|
|
196
|
+
(f) => q(f, s, h + 1, N)
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
function aa(a) {
|
|
200
|
+
const l = a.indexOf(":");
|
|
201
|
+
return l > 0 ? a.slice(0, l) : a;
|
|
202
|
+
}
|
|
203
|
+
function na(a) {
|
|
204
|
+
return !a || !Number.isFinite(a) ? "已加载" : `${new Date(a).toLocaleTimeString()} 加载`;
|
|
205
|
+
}
|
|
206
|
+
function ia() {
|
|
207
|
+
return {
|
|
208
|
+
loaded: !1,
|
|
209
|
+
listLoading: !1,
|
|
210
|
+
list: [],
|
|
211
|
+
query: "",
|
|
212
|
+
hits: null,
|
|
213
|
+
searching: !1,
|
|
214
|
+
primary: null,
|
|
215
|
+
extra: [],
|
|
216
|
+
activeKey: null
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
const te = ia();
|
|
220
|
+
function pa() {
|
|
221
|
+
var oe, de, me;
|
|
222
|
+
const [a, l] = k(null), [h, N] = k({}), [s, f] = k("Page"), [b, T] = k(
|
|
223
|
+
null
|
|
224
|
+
), [_, L] = k(!1), x = M(0), w = M(h);
|
|
225
|
+
G(() => {
|
|
226
|
+
w.current = h;
|
|
227
|
+
}, [h]);
|
|
228
|
+
const P = M(s);
|
|
229
|
+
G(() => {
|
|
230
|
+
P.current = s;
|
|
231
|
+
}, [s]);
|
|
232
|
+
const [$, Y] = k(() => {
|
|
233
|
+
const e = Number(localStorage.getItem("ktab_left_w"));
|
|
234
|
+
return Number.isFinite(e) && e >= 220 && e <= 520 ? e : 300;
|
|
235
|
+
}), [ne, ue] = k(() => {
|
|
236
|
+
const e = Number(localStorage.getItem("ktab_right_w"));
|
|
237
|
+
return Number.isFinite(e) && e >= 260 && e <= 640 ? e : 360;
|
|
238
|
+
}), K = M(null), ie = (e) => (i) => {
|
|
239
|
+
i.preventDefault(), K.current = {
|
|
240
|
+
side: e,
|
|
241
|
+
startX: i.clientX,
|
|
242
|
+
startW: e === "left" ? $ : ne
|
|
243
|
+
}, document.body.style.userSelect = "none";
|
|
244
|
+
};
|
|
245
|
+
G(() => {
|
|
246
|
+
const e = (c) => {
|
|
247
|
+
const d = K.current;
|
|
248
|
+
if (d)
|
|
249
|
+
if (d.side === "left") {
|
|
250
|
+
const o = Math.min(
|
|
251
|
+
520,
|
|
252
|
+
Math.max(220, d.startW + (c.clientX - d.startX))
|
|
253
|
+
);
|
|
254
|
+
Y(o), localStorage.setItem("ktab_left_w", String(o));
|
|
255
|
+
} else {
|
|
256
|
+
const o = Math.min(
|
|
257
|
+
640,
|
|
258
|
+
Math.max(260, d.startW - (c.clientX - d.startX))
|
|
259
|
+
);
|
|
260
|
+
ue(o), localStorage.setItem("ktab_right_w", String(o));
|
|
261
|
+
}
|
|
262
|
+
}, i = () => {
|
|
263
|
+
K.current && (K.current = null, document.body.style.userSelect = "");
|
|
264
|
+
};
|
|
265
|
+
return window.addEventListener("mousemove", e), window.addEventListener("mouseup", i), () => {
|
|
266
|
+
window.removeEventListener("mousemove", e), window.removeEventListener("mouseup", i);
|
|
267
|
+
};
|
|
268
|
+
}, []);
|
|
269
|
+
const g = C(
|
|
270
|
+
(e, i) => {
|
|
271
|
+
N((c) => {
|
|
272
|
+
const d = c[e] ?? te, o = typeof i == "function" ? i(d) : i;
|
|
273
|
+
return { ...c, [e]: { ...d, ...o } };
|
|
274
|
+
});
|
|
275
|
+
},
|
|
276
|
+
[]
|
|
277
|
+
), I = C(async (e) => {
|
|
278
|
+
L(!0);
|
|
279
|
+
try {
|
|
280
|
+
const i = await Ie(e);
|
|
281
|
+
T(i);
|
|
282
|
+
} catch {
|
|
283
|
+
T(null);
|
|
284
|
+
} finally {
|
|
285
|
+
L(!1);
|
|
286
|
+
}
|
|
287
|
+
}, []), D = C(
|
|
288
|
+
async (e, i) => {
|
|
289
|
+
const c = i.id;
|
|
290
|
+
if (!c) return;
|
|
291
|
+
const d = {
|
|
292
|
+
key: c,
|
|
293
|
+
vid: c,
|
|
294
|
+
name: i.name ?? c,
|
|
295
|
+
type: i.type ?? e,
|
|
296
|
+
tree: null,
|
|
297
|
+
loading: !0,
|
|
298
|
+
failed: !1,
|
|
299
|
+
expanded: /* @__PURE__ */ new Set()
|
|
300
|
+
};
|
|
301
|
+
g(e, { primary: d, activeKey: d.key }), I(c);
|
|
302
|
+
try {
|
|
303
|
+
const o = await Z(c), m = /* @__PURE__ */ new Set();
|
|
304
|
+
q(o, "root", 0, m), N((u) => {
|
|
305
|
+
const y = u[e];
|
|
306
|
+
return !y || !y.primary || y.primary.key !== c ? u : {
|
|
307
|
+
...u,
|
|
308
|
+
[e]: {
|
|
309
|
+
...y,
|
|
310
|
+
primary: {
|
|
311
|
+
...y.primary,
|
|
312
|
+
tree: o,
|
|
313
|
+
loading: !1,
|
|
314
|
+
failed: !1,
|
|
315
|
+
expanded: m
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
});
|
|
320
|
+
} catch {
|
|
321
|
+
N((o) => {
|
|
322
|
+
const m = o[e];
|
|
323
|
+
return !m || !m.primary || m.primary.key !== c ? o : {
|
|
324
|
+
...o,
|
|
325
|
+
[e]: {
|
|
326
|
+
...m,
|
|
327
|
+
primary: { ...m.primary, loading: !1, failed: !0 }
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
},
|
|
333
|
+
[I, g]
|
|
334
|
+
), z = C(
|
|
335
|
+
async (e, i) => {
|
|
336
|
+
var c, d, o;
|
|
337
|
+
if (!((c = w.current[e]) != null && c.listLoading)) {
|
|
338
|
+
g(e, { listLoading: !0 });
|
|
339
|
+
try {
|
|
340
|
+
const m = await Ce(e);
|
|
341
|
+
if (g(e, { list: m, listLoading: !1, loaded: !0 }), i && m.length > 0 && !((d = w.current[e]) != null && d.primary)) {
|
|
342
|
+
const u = e === "DbTable" ? (o = m.find((y) => y.db)) == null ? void 0 : o.db : void 0;
|
|
343
|
+
u ? await D(e, {
|
|
344
|
+
id: `Db:${u}`,
|
|
345
|
+
type: "Db",
|
|
346
|
+
name: u,
|
|
347
|
+
subtitle: ""
|
|
348
|
+
}) : await D(e, m[0]);
|
|
349
|
+
}
|
|
350
|
+
} catch {
|
|
351
|
+
g(e, { listLoading: !1, loaded: !0 });
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
[D, g]
|
|
356
|
+
), j = C(async () => {
|
|
357
|
+
try {
|
|
358
|
+
l(await we());
|
|
359
|
+
} catch {
|
|
360
|
+
l({ space: "-", hosts: "-", ttl_minutes: 0, loaded: !1 });
|
|
361
|
+
}
|
|
362
|
+
}, []), re = C(async (e, i) => {
|
|
363
|
+
try {
|
|
364
|
+
const c = await Z(i), d = /* @__PURE__ */ new Set();
|
|
365
|
+
q(c, "root", 0, d), N((o) => {
|
|
366
|
+
const m = o[e];
|
|
367
|
+
if (!m) return o;
|
|
368
|
+
const u = (y) => y.vid === i ? { ...y, tree: c, loading: !1, failed: !1, expanded: d } : y;
|
|
369
|
+
return {
|
|
370
|
+
...o,
|
|
371
|
+
[e]: {
|
|
372
|
+
...m,
|
|
373
|
+
primary: m.primary ? u(m.primary) : null,
|
|
374
|
+
extra: m.extra.map(u)
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
});
|
|
378
|
+
} catch {
|
|
379
|
+
}
|
|
380
|
+
}, []), se = C(
|
|
381
|
+
async (e, i, c) => {
|
|
382
|
+
if (!e) return;
|
|
383
|
+
I(e);
|
|
384
|
+
const d = P.current, o = w.current[d] ?? te;
|
|
385
|
+
if (o.primary && o.primary.vid === e || o.extra.some((u) => u.vid === e)) {
|
|
386
|
+
g(d, { activeKey: e });
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
const m = {
|
|
390
|
+
key: e,
|
|
391
|
+
vid: e,
|
|
392
|
+
name: i ?? e,
|
|
393
|
+
type: c ?? aa(e),
|
|
394
|
+
tree: null,
|
|
395
|
+
loading: !0,
|
|
396
|
+
failed: !1,
|
|
397
|
+
expanded: /* @__PURE__ */ new Set()
|
|
398
|
+
};
|
|
399
|
+
g(d, (u) => ({ extra: [...u.extra, m], activeKey: m.key }));
|
|
400
|
+
try {
|
|
401
|
+
const u = await Z(e), y = /* @__PURE__ */ new Set();
|
|
402
|
+
q(u, "root", 0, y), N((v) => {
|
|
403
|
+
const J = v[d];
|
|
404
|
+
return J ? {
|
|
405
|
+
...v,
|
|
406
|
+
[d]: {
|
|
407
|
+
...J,
|
|
408
|
+
extra: J.extra.map(
|
|
409
|
+
(Q) => Q.key === e ? {
|
|
410
|
+
...Q,
|
|
411
|
+
tree: u,
|
|
412
|
+
loading: !1,
|
|
413
|
+
failed: !1,
|
|
414
|
+
expanded: y
|
|
415
|
+
} : Q
|
|
416
|
+
)
|
|
417
|
+
}
|
|
418
|
+
} : v;
|
|
419
|
+
});
|
|
420
|
+
} catch {
|
|
421
|
+
N((u) => {
|
|
422
|
+
const y = u[d];
|
|
423
|
+
return y ? {
|
|
424
|
+
...u,
|
|
425
|
+
[d]: {
|
|
426
|
+
...y,
|
|
427
|
+
extra: y.extra.map(
|
|
428
|
+
(v) => v.key === e ? { ...v, loading: !1, failed: !0 } : v
|
|
429
|
+
)
|
|
430
|
+
}
|
|
431
|
+
} : u;
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
},
|
|
435
|
+
[I, g]
|
|
436
|
+
), _e = C(
|
|
437
|
+
(e, i, c, d) => {
|
|
438
|
+
N((o) => {
|
|
439
|
+
const m = o[e];
|
|
440
|
+
if (!m) return o;
|
|
441
|
+
const u = (y) => {
|
|
442
|
+
if (y.key !== i) return y;
|
|
443
|
+
const v = new Set(y.expanded);
|
|
444
|
+
return v.has(c) ? v.delete(c) : v.add(c), { ...y, expanded: v };
|
|
445
|
+
};
|
|
446
|
+
return {
|
|
447
|
+
...o,
|
|
448
|
+
[e]: {
|
|
449
|
+
...m,
|
|
450
|
+
primary: m.primary ? u(m.primary) : null,
|
|
451
|
+
extra: m.extra.map(u)
|
|
452
|
+
}
|
|
453
|
+
};
|
|
454
|
+
}), d.id && I(d.id);
|
|
455
|
+
},
|
|
456
|
+
[I]
|
|
457
|
+
), le = C(
|
|
458
|
+
(e, i) => {
|
|
459
|
+
g(e, (c) => {
|
|
460
|
+
var y;
|
|
461
|
+
const o = ((y = c.primary) == null ? void 0 : y.key) === i ? null : c.primary, m = c.extra.filter((v) => v.key !== i);
|
|
462
|
+
let u = c.activeKey;
|
|
463
|
+
return u === i && (u = (o == null ? void 0 : o.key) ?? (m.length > 0 ? m[m.length - 1].key : null)), { primary: o, extra: m, activeKey: u };
|
|
464
|
+
});
|
|
465
|
+
},
|
|
466
|
+
[g]
|
|
467
|
+
), ye = C(async () => {
|
|
468
|
+
try {
|
|
469
|
+
const e = await De();
|
|
470
|
+
Se.success(
|
|
471
|
+
`图快照已刷新:${e.node_count ?? 0} 节点 / ${e.edge_count ?? 0} 边`
|
|
472
|
+
), j();
|
|
473
|
+
const i = w.current;
|
|
474
|
+
Object.entries(i).forEach(([c, d]) => {
|
|
475
|
+
d.loaded && z(c, !1), [...d.primary ? [d.primary] : [], ...d.extra].forEach(
|
|
476
|
+
(o) => void re(c, o.vid)
|
|
477
|
+
);
|
|
478
|
+
});
|
|
479
|
+
} catch {
|
|
480
|
+
}
|
|
481
|
+
}, [z, j, re]);
|
|
482
|
+
G(() => {
|
|
483
|
+
j();
|
|
484
|
+
}, [j]), G(() => {
|
|
485
|
+
const e = w.current[s];
|
|
486
|
+
!(e != null && e.loaded) && !(e != null && e.listLoading) && z(s, !0);
|
|
487
|
+
}, [s, z]);
|
|
488
|
+
const p = h[s] ?? te, S = p.primary && p.activeKey === p.primary.key ? p.primary : p.extra.find((e) => e.key === p.activeKey) ?? p.primary, U = ((oe = ee.find((e) => e.type === s)) == null ? void 0 : oe.label) ?? s, ce = p.query;
|
|
489
|
+
return G(() => {
|
|
490
|
+
const e = ce.trim(), i = s;
|
|
491
|
+
if (!e) {
|
|
492
|
+
g(i, { hits: null, searching: !1 });
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
g(i, { searching: !0 });
|
|
496
|
+
const c = ++x.current, d = setTimeout(async () => {
|
|
497
|
+
try {
|
|
498
|
+
const o = await $e(e, i);
|
|
499
|
+
x.current === c && g(i, { hits: o, searching: !1 });
|
|
500
|
+
} catch {
|
|
501
|
+
x.current === c && g(i, { hits: [], searching: !1 });
|
|
502
|
+
}
|
|
503
|
+
}, 300);
|
|
504
|
+
return () => clearTimeout(d);
|
|
505
|
+
}, [ce, s, g]), /* @__PURE__ */ r("div", { className: t.wrap, children: [
|
|
506
|
+
/* @__PURE__ */ r("header", { className: t.header, children: [
|
|
507
|
+
/* @__PURE__ */ r("div", { className: t.headerTitle, children: [
|
|
508
|
+
/* @__PURE__ */ n(V, { className: t.headerIcon }),
|
|
509
|
+
/* @__PURE__ */ n("span", { children: "业务知识图谱" }),
|
|
510
|
+
/* @__PURE__ */ n("span", { className: t.headerSub, children: "业务因果链 · 图数据库直查(面向会写代码的你,讲清业务为什么这样跑)" })
|
|
511
|
+
] }),
|
|
512
|
+
/* @__PURE__ */ r("div", { className: t.headerStats, children: [
|
|
513
|
+
a != null && a.loaded ? /* @__PURE__ */ r(H, { children: [
|
|
514
|
+
/* @__PURE__ */ r("span", { className: t.statChip, children: [
|
|
515
|
+
"节点 ",
|
|
516
|
+
a.node_count ?? 0
|
|
517
|
+
] }),
|
|
518
|
+
/* @__PURE__ */ r("span", { className: t.statChip, children: [
|
|
519
|
+
"边 ",
|
|
520
|
+
a.edge_count ?? 0
|
|
521
|
+
] }),
|
|
522
|
+
ee.map((e) => {
|
|
523
|
+
var i;
|
|
524
|
+
return /* @__PURE__ */ r("span", { className: t.statChip, children: [
|
|
525
|
+
e.label,
|
|
526
|
+
" ",
|
|
527
|
+
((i = a.nodes_by_type) == null ? void 0 : i[e.type]) ?? 0
|
|
528
|
+
] }, e.type);
|
|
529
|
+
}),
|
|
530
|
+
/* @__PURE__ */ n(
|
|
531
|
+
"span",
|
|
532
|
+
{
|
|
533
|
+
className: t.statChip,
|
|
534
|
+
title: `图空间 ${a.space} · ${a.hosts}`,
|
|
535
|
+
children: na(a.loaded_at)
|
|
536
|
+
}
|
|
537
|
+
)
|
|
538
|
+
] }) : /* @__PURE__ */ n("span", { className: t.statChipWarn, children: p.listLoading ? "图数据加载中…" : "图数据未就绪" }),
|
|
539
|
+
/* @__PURE__ */ n(
|
|
540
|
+
"button",
|
|
541
|
+
{
|
|
542
|
+
type: "button",
|
|
543
|
+
className: t.refreshBtn,
|
|
544
|
+
onClick: ye,
|
|
545
|
+
title: "重新从图数据库加载快照",
|
|
546
|
+
children: /* @__PURE__ */ n(Ne, {})
|
|
547
|
+
}
|
|
548
|
+
)
|
|
549
|
+
] })
|
|
550
|
+
] }),
|
|
551
|
+
/* @__PURE__ */ r("div", { className: t.entryBar, children: [
|
|
552
|
+
ee.map((e) => {
|
|
553
|
+
var i;
|
|
554
|
+
return /* @__PURE__ */ r(
|
|
555
|
+
"button",
|
|
556
|
+
{
|
|
557
|
+
type: "button",
|
|
558
|
+
className: `${t.entryTab} ${s === e.type ? t.entryTabActive : ""}`,
|
|
559
|
+
onClick: () => f(e.type),
|
|
560
|
+
title: `${e.label}入口(各入口的清单 / 展开视图相互隔离)`,
|
|
561
|
+
children: [
|
|
562
|
+
/* @__PURE__ */ n("span", { children: e.label }),
|
|
563
|
+
/* @__PURE__ */ n("span", { className: t.entryTabCount, children: ((i = a == null ? void 0 : a.nodes_by_type) == null ? void 0 : i[e.type]) ?? 0 })
|
|
564
|
+
]
|
|
565
|
+
},
|
|
566
|
+
e.type
|
|
567
|
+
);
|
|
568
|
+
}),
|
|
569
|
+
/* @__PURE__ */ n("span", { className: t.entryBarHint, children: "入口即查询起点:左侧清单点选换主视图,右侧「图上关联」点选在中部新开 Tab 下钻" })
|
|
570
|
+
] }),
|
|
571
|
+
/* @__PURE__ */ r("div", { className: t.body, children: [
|
|
572
|
+
/* @__PURE__ */ r("aside", { className: t.sidebar, style: { width: $ }, children: [
|
|
573
|
+
/* @__PURE__ */ r("div", { className: t.searchBox, children: [
|
|
574
|
+
/* @__PURE__ */ n(fe, { className: t.searchIcon }),
|
|
575
|
+
/* @__PURE__ */ n(
|
|
576
|
+
"input",
|
|
577
|
+
{
|
|
578
|
+
className: t.searchInput,
|
|
579
|
+
placeholder: `在本入口内搜索${U}…`,
|
|
580
|
+
value: p.query,
|
|
581
|
+
onChange: (e) => g(s, { query: e.target.value })
|
|
582
|
+
}
|
|
583
|
+
)
|
|
584
|
+
] }),
|
|
585
|
+
/* @__PURE__ */ n("div", { className: t.sidebarList, children: p.query.trim() ? p.searching ? /* @__PURE__ */ n("div", { className: t.listTip, children: "搜索中…" }) : p.hits && p.hits.length > 0 ? p.hits.map((e) => /* @__PURE__ */ r(
|
|
586
|
+
"div",
|
|
587
|
+
{
|
|
588
|
+
className: t.hitItem,
|
|
589
|
+
onClick: () => e.id && void D(s, {
|
|
590
|
+
id: e.id,
|
|
591
|
+
type: e.type ?? s,
|
|
592
|
+
name: e.name ?? e.id,
|
|
593
|
+
subtitle: e.subtitle ?? ""
|
|
594
|
+
}),
|
|
595
|
+
children: [
|
|
596
|
+
/* @__PURE__ */ n("div", { className: t.hitName, children: e.name }),
|
|
597
|
+
e.subtitle && /* @__PURE__ */ n("div", { className: t.hitSub, children: e.subtitle })
|
|
598
|
+
]
|
|
599
|
+
},
|
|
600
|
+
e.id
|
|
601
|
+
)) : /* @__PURE__ */ n("div", { className: t.listTip, children: "无匹配节点" }) : p.listLoading ? /* @__PURE__ */ r("div", { className: t.listTip, children: [
|
|
602
|
+
/* @__PURE__ */ n(F, { size: "small" }),
|
|
603
|
+
" 加载中…"
|
|
604
|
+
] }) : /* @__PURE__ */ r(H, { children: [
|
|
605
|
+
/* @__PURE__ */ r("div", { className: t.sidebarHead, children: [
|
|
606
|
+
U,
|
|
607
|
+
"清单(点击查看展开视图)"
|
|
608
|
+
] }),
|
|
609
|
+
s === "DbTable" ? /* @__PURE__ */ n(
|
|
610
|
+
ra,
|
|
611
|
+
{
|
|
612
|
+
list: p.list,
|
|
613
|
+
activeVid: ((de = p.primary) == null ? void 0 : de.vid) ?? null,
|
|
614
|
+
onOpenTable: (e) => void D("DbTable", e),
|
|
615
|
+
onOpenDb: (e, i) => void D("DbTable", {
|
|
616
|
+
id: `Db:${e}`,
|
|
617
|
+
type: "Db",
|
|
618
|
+
name: e,
|
|
619
|
+
subtitle: `${i} 张表`
|
|
620
|
+
})
|
|
621
|
+
}
|
|
622
|
+
) : p.list.map((e) => {
|
|
623
|
+
var i;
|
|
624
|
+
return /* @__PURE__ */ r(
|
|
625
|
+
"div",
|
|
626
|
+
{
|
|
627
|
+
className: `${t.pageItem} ${((i = p.primary) == null ? void 0 : i.vid) === e.id ? t.pageItemActive : ""}`,
|
|
628
|
+
onClick: () => void D(s, e),
|
|
629
|
+
title: `${e.name}(${e.id})`,
|
|
630
|
+
children: [
|
|
631
|
+
/* @__PURE__ */ r("div", { className: t.pageItemRow, children: [
|
|
632
|
+
/* @__PURE__ */ n("div", { className: t.pageName, children: e.name }),
|
|
633
|
+
e.count != null && /* @__PURE__ */ r("span", { className: t.itemCount, children: [
|
|
634
|
+
e.count,
|
|
635
|
+
" ",
|
|
636
|
+
pe[e.type] ?? "关联"
|
|
637
|
+
] })
|
|
638
|
+
] }),
|
|
639
|
+
e.subtitle && /* @__PURE__ */ n("div", { className: t.pageSub, children: e.subtitle })
|
|
640
|
+
]
|
|
641
|
+
},
|
|
642
|
+
e.id
|
|
643
|
+
);
|
|
644
|
+
})
|
|
645
|
+
] }) })
|
|
646
|
+
] }),
|
|
647
|
+
/* @__PURE__ */ n(
|
|
648
|
+
"div",
|
|
649
|
+
{
|
|
650
|
+
className: t.colDragger,
|
|
651
|
+
onMouseDown: ie("left"),
|
|
652
|
+
title: "拖动调整左栏宽度"
|
|
653
|
+
}
|
|
654
|
+
),
|
|
655
|
+
/* @__PURE__ */ r("main", { className: t.main, children: [
|
|
656
|
+
/* @__PURE__ */ r("div", { className: t.midArea, children: [
|
|
657
|
+
(p.primary || p.extra.length > 0) && /* @__PURE__ */ r("div", { className: t.midTabs, children: [
|
|
658
|
+
p.primary && /* @__PURE__ */ n(
|
|
659
|
+
he,
|
|
660
|
+
{
|
|
661
|
+
tab: p.primary,
|
|
662
|
+
active: p.activeKey === p.primary.key,
|
|
663
|
+
primary: !0,
|
|
664
|
+
onSelect: () => g(s, { activeKey: p.primary.key }),
|
|
665
|
+
onClose: () => le(s, p.primary.key)
|
|
666
|
+
}
|
|
667
|
+
),
|
|
668
|
+
p.extra.map((e) => /* @__PURE__ */ n(
|
|
669
|
+
he,
|
|
670
|
+
{
|
|
671
|
+
tab: e,
|
|
672
|
+
active: p.activeKey === e.key,
|
|
673
|
+
primary: !1,
|
|
674
|
+
onSelect: () => g(s, { activeKey: e.key }),
|
|
675
|
+
onClose: () => le(s, e.key)
|
|
676
|
+
},
|
|
677
|
+
e.key
|
|
678
|
+
))
|
|
679
|
+
] }),
|
|
680
|
+
/* @__PURE__ */ n("div", { className: t.treeArea, children: S ? S.loading ? /* @__PURE__ */ r("div", { className: t.emptyState, children: [
|
|
681
|
+
/* @__PURE__ */ n(F, {}),
|
|
682
|
+
/* @__PURE__ */ n("span", { children: "正在从图数据库派生展开视图…" })
|
|
683
|
+
] }) : S.failed ? /* @__PURE__ */ r("div", { className: t.emptyState, children: [
|
|
684
|
+
/* @__PURE__ */ n(V, { className: t.emptyIcon }),
|
|
685
|
+
/* @__PURE__ */ r("div", { className: t.emptyTitle, children: [
|
|
686
|
+
"「",
|
|
687
|
+
S.name,
|
|
688
|
+
"」展开视图加载失败"
|
|
689
|
+
] }),
|
|
690
|
+
/* @__PURE__ */ n("div", { className: t.emptyDesc, children: "该节点可能在最近一次图库更新中被删除。可点右上角刷新重载快照后重试, 或关闭此 Tab 返回主视图。" })
|
|
691
|
+
] }) : S.tree ? (me = S.tree.children) != null && me.length ? /* @__PURE__ */ n(
|
|
692
|
+
be,
|
|
693
|
+
{
|
|
694
|
+
node: S.tree,
|
|
695
|
+
path: "root",
|
|
696
|
+
depth: 0,
|
|
697
|
+
expanded: S.expanded,
|
|
698
|
+
drillLeaves: S.tree.type === "Db",
|
|
699
|
+
onToggle: (e, i) => _e(s, S.key, e, i),
|
|
700
|
+
onOpenDetail: (e) => void I(e),
|
|
701
|
+
onDrill: (e, i, c) => void se(e, i, c)
|
|
702
|
+
}
|
|
703
|
+
) : /* @__PURE__ */ r("div", { className: t.emptyState, children: [
|
|
704
|
+
/* @__PURE__ */ n(V, { className: t.emptyIcon }),
|
|
705
|
+
/* @__PURE__ */ r("div", { className: t.emptyTitle, children: [
|
|
706
|
+
"「",
|
|
707
|
+
S.tree.name,
|
|
708
|
+
"」在图库中暂无有效关联数据"
|
|
709
|
+
] }),
|
|
710
|
+
/* @__PURE__ */ n("div", { className: t.emptyDesc, children: "该节点的关联在当前图快照中缺失,多为历史蒸馏数据中被删除后的残留边已被过滤。 可点右上角刷新重载快照,或等下一次图谱补录后自动恢复。" })
|
|
711
|
+
] }) : /* @__PURE__ */ n("div", { className: t.emptyState, children: /* @__PURE__ */ n(F, {}) }) : /* @__PURE__ */ r("div", { className: t.emptyState, children: [
|
|
712
|
+
/* @__PURE__ */ n(V, { className: t.emptyIcon }),
|
|
713
|
+
/* @__PURE__ */ n("div", { className: t.emptyTitle, children: ta[s] ?? `左侧选择一个${U},看它的展开信息` }),
|
|
714
|
+
/* @__PURE__ */ r("div", { className: t.emptyDesc, children: [
|
|
715
|
+
"树的四层含义:页面上的",
|
|
716
|
+
/* @__PURE__ */ n("strong", { children: "操作" }),
|
|
717
|
+
"(点谁、调哪个接口) → 触发的",
|
|
718
|
+
/* @__PURE__ */ n("strong", { children: "因果链" }),
|
|
719
|
+
"(为什么会联动) → 链里的",
|
|
720
|
+
/* @__PURE__ */ n("strong", { children: "步骤" }),
|
|
721
|
+
"(数据与代码如何接力)→ 出问题时的",
|
|
722
|
+
/* @__PURE__ */ n("strong", { children: "症状与止血" }),
|
|
723
|
+
"(去哪处置)。右侧「图上关联」可点击,会在中部新开 Tab 下钻。"
|
|
724
|
+
] }),
|
|
725
|
+
/* @__PURE__ */ n("div", { className: t.legend, children: Object.keys(ae).map((e) => /* @__PURE__ */ r("span", { className: t.legendItem, children: [
|
|
726
|
+
/* @__PURE__ */ n(W, { type: e }),
|
|
727
|
+
ae[e]
|
|
728
|
+
] }, e)) })
|
|
729
|
+
] }) })
|
|
730
|
+
] }),
|
|
731
|
+
/* @__PURE__ */ n(
|
|
732
|
+
"div",
|
|
733
|
+
{
|
|
734
|
+
className: t.colDragger,
|
|
735
|
+
onMouseDown: ie("right"),
|
|
736
|
+
title: "拖动调整详情栏宽度"
|
|
737
|
+
}
|
|
738
|
+
),
|
|
739
|
+
/* @__PURE__ */ n("div", { className: t.detailWrap, style: { width: ne }, children: /* @__PURE__ */ n(
|
|
740
|
+
sa,
|
|
741
|
+
{
|
|
742
|
+
detail: b,
|
|
743
|
+
loading: _,
|
|
744
|
+
onOpenDetail: (e, i, c) => void se(e, i, c)
|
|
745
|
+
}
|
|
746
|
+
) })
|
|
747
|
+
] })
|
|
748
|
+
] })
|
|
749
|
+
] });
|
|
750
|
+
}
|
|
751
|
+
function W({ type: a }) {
|
|
752
|
+
const l = ea[a] ?? "#8c8c8c";
|
|
753
|
+
return /* @__PURE__ */ n(
|
|
754
|
+
"span",
|
|
755
|
+
{
|
|
756
|
+
className: t.badge,
|
|
757
|
+
style: { background: `${l}1a`, color: l, borderColor: `${l}55` },
|
|
758
|
+
children: ae[a] ?? a
|
|
759
|
+
}
|
|
760
|
+
);
|
|
761
|
+
}
|
|
762
|
+
function he({
|
|
763
|
+
tab: a,
|
|
764
|
+
active: l,
|
|
765
|
+
primary: h,
|
|
766
|
+
onSelect: N,
|
|
767
|
+
onClose: s
|
|
768
|
+
}) {
|
|
769
|
+
return /* @__PURE__ */ r(
|
|
770
|
+
"div",
|
|
771
|
+
{
|
|
772
|
+
className: `${t.midTab} ${l ? t.midTabActive : ""}`,
|
|
773
|
+
onClick: N,
|
|
774
|
+
title: `${a.name}(${a.vid})`,
|
|
775
|
+
children: [
|
|
776
|
+
/* @__PURE__ */ n(W, { type: a.type }),
|
|
777
|
+
/* @__PURE__ */ n("span", { className: t.midTabName, children: a.name }),
|
|
778
|
+
/* @__PURE__ */ n(
|
|
779
|
+
"span",
|
|
780
|
+
{
|
|
781
|
+
className: t.midTabClose,
|
|
782
|
+
onClick: (f) => {
|
|
783
|
+
f.stopPropagation(), s();
|
|
784
|
+
},
|
|
785
|
+
title: h ? "关闭并返回空态" : "关闭",
|
|
786
|
+
children: /* @__PURE__ */ n(ge, {})
|
|
787
|
+
}
|
|
788
|
+
)
|
|
789
|
+
]
|
|
790
|
+
}
|
|
791
|
+
);
|
|
792
|
+
}
|
|
793
|
+
function be({
|
|
794
|
+
node: a,
|
|
795
|
+
path: l,
|
|
796
|
+
depth: h,
|
|
797
|
+
expanded: N,
|
|
798
|
+
drillLeaves: s = !1,
|
|
799
|
+
onToggle: f,
|
|
800
|
+
onOpenDetail: b,
|
|
801
|
+
onDrill: T
|
|
802
|
+
}) {
|
|
803
|
+
var P;
|
|
804
|
+
const _ = X(a, l), L = !!((P = a.children) != null && P.length), x = N.has(_), w = !!a.label;
|
|
805
|
+
return /* @__PURE__ */ r("div", { className: t.treeNode, children: [
|
|
806
|
+
/* @__PURE__ */ r(
|
|
807
|
+
"div",
|
|
808
|
+
{
|
|
809
|
+
className: `${t.nodeRow} ${w ? t.nodeRowGroup : ""}`,
|
|
810
|
+
style: { paddingLeft: h * 18 + 6 },
|
|
811
|
+
onClick: () => L ? f(_, a) : a.id ? s ? T(a.id, a.name, a.type) : b(a.id) : void 0,
|
|
812
|
+
children: [
|
|
813
|
+
L ? /* @__PURE__ */ n("span", { className: t.caret, children: x ? /* @__PURE__ */ n(ve, {}) : /* @__PURE__ */ n(Te, {}) }) : /* @__PURE__ */ n("span", { className: t.dot }),
|
|
814
|
+
w ? /* @__PURE__ */ r("span", { className: t.groupLabel, children: [
|
|
815
|
+
a.label,
|
|
816
|
+
a.count != null && /* @__PURE__ */ n("span", { className: t.nodeCount, children: a.count })
|
|
817
|
+
] }) : /* @__PURE__ */ r(H, { children: [
|
|
818
|
+
a.type && /* @__PURE__ */ n(W, { type: a.type }),
|
|
819
|
+
/* @__PURE__ */ n("span", { className: t.nodeName, children: a.name })
|
|
820
|
+
] })
|
|
821
|
+
]
|
|
822
|
+
}
|
|
823
|
+
),
|
|
824
|
+
!w && a.subtitle && /* @__PURE__ */ n(
|
|
825
|
+
"div",
|
|
826
|
+
{
|
|
827
|
+
className: t.nodeSub,
|
|
828
|
+
style: { paddingLeft: h * 18 + 30 },
|
|
829
|
+
children: a.subtitle
|
|
830
|
+
}
|
|
831
|
+
),
|
|
832
|
+
L && x && /* @__PURE__ */ n("div", { children: a.children.filter(($) => !!$).map(($, Y) => /* @__PURE__ */ n(
|
|
833
|
+
be,
|
|
834
|
+
{
|
|
835
|
+
node: $,
|
|
836
|
+
path: `${_}#${Y}`,
|
|
837
|
+
depth: h + 1,
|
|
838
|
+
expanded: N,
|
|
839
|
+
drillLeaves: s,
|
|
840
|
+
onToggle: f,
|
|
841
|
+
onOpenDetail: b,
|
|
842
|
+
onDrill: T
|
|
843
|
+
},
|
|
844
|
+
X($, _)
|
|
845
|
+
)) })
|
|
846
|
+
] });
|
|
847
|
+
}
|
|
848
|
+
function ra({
|
|
849
|
+
list: a,
|
|
850
|
+
activeVid: l,
|
|
851
|
+
onOpenTable: h,
|
|
852
|
+
onOpenDb: N
|
|
853
|
+
}) {
|
|
854
|
+
const s = [], f = /* @__PURE__ */ new Map();
|
|
855
|
+
return a.forEach((b) => {
|
|
856
|
+
const T = b.db || "(未归库)";
|
|
857
|
+
let _ = f.get(T);
|
|
858
|
+
_ || (_ = [], f.set(T, _), s.push({ db: T, items: _ })), _.push(b);
|
|
859
|
+
}), /* @__PURE__ */ n(H, { children: s.map((b) => {
|
|
860
|
+
const T = `Db:${b.db}`;
|
|
861
|
+
return /* @__PURE__ */ r("div", { className: t.dbGroup, children: [
|
|
862
|
+
/* @__PURE__ */ r(
|
|
863
|
+
"div",
|
|
864
|
+
{
|
|
865
|
+
className: `${t.dbGroupHead} ${l === T ? t.dbGroupHeadActive : ""}`,
|
|
866
|
+
onClick: () => {
|
|
867
|
+
var _;
|
|
868
|
+
return ((_ = b.items[0]) == null ? void 0 : _.db) && N(b.db, b.items.length);
|
|
869
|
+
},
|
|
870
|
+
title: `打开 ${b.db} 库总览(库 → 表,点表中钻字段)`,
|
|
871
|
+
children: [
|
|
872
|
+
/* @__PURE__ */ n("span", { className: t.dbGroupName, children: b.db }),
|
|
873
|
+
/* @__PURE__ */ r("span", { className: t.dbGroupCount, children: [
|
|
874
|
+
b.items.length,
|
|
875
|
+
" 表"
|
|
876
|
+
] })
|
|
877
|
+
]
|
|
878
|
+
}
|
|
879
|
+
),
|
|
880
|
+
b.items.map((_) => /* @__PURE__ */ r(
|
|
881
|
+
"div",
|
|
882
|
+
{
|
|
883
|
+
className: `${t.pageItem} ${l === _.id ? t.pageItemActive : ""}`,
|
|
884
|
+
onClick: () => h(_),
|
|
885
|
+
title: `${_.name}(${_.id})`,
|
|
886
|
+
children: [
|
|
887
|
+
/* @__PURE__ */ r("div", { className: t.pageItemRow, children: [
|
|
888
|
+
/* @__PURE__ */ n("div", { className: t.pageName, children: _.name }),
|
|
889
|
+
_.count != null && /* @__PURE__ */ r("span", { className: t.itemCount, children: [
|
|
890
|
+
_.count,
|
|
891
|
+
" ",
|
|
892
|
+
pe[_.type] ?? "关联"
|
|
893
|
+
] })
|
|
894
|
+
] }),
|
|
895
|
+
_.subtitle && /* @__PURE__ */ n("div", { className: t.pageSub, children: _.subtitle })
|
|
896
|
+
]
|
|
897
|
+
},
|
|
898
|
+
_.id
|
|
899
|
+
))
|
|
900
|
+
] }, b.db);
|
|
901
|
+
}) });
|
|
902
|
+
}
|
|
903
|
+
function sa({
|
|
904
|
+
detail: a,
|
|
905
|
+
loading: l,
|
|
906
|
+
onOpenDetail: h
|
|
907
|
+
}) {
|
|
908
|
+
if (l)
|
|
909
|
+
return /* @__PURE__ */ n("div", { className: t.detailPanel, children: /* @__PURE__ */ r("div", { className: t.listTip, children: [
|
|
910
|
+
/* @__PURE__ */ n(F, { size: "small" }),
|
|
911
|
+
" 加载详情…"
|
|
912
|
+
] }) });
|
|
913
|
+
if (!a)
|
|
914
|
+
return /* @__PURE__ */ n("div", { className: t.detailPanel, children: /* @__PURE__ */ n("div", { className: t.detailEmpty, children: "点击任意节点查看全部属性与关联;点「图上关联」在中部新开 Tab 下钻" }) });
|
|
915
|
+
const N = a.props ?? {}, s = a.relations ?? [];
|
|
916
|
+
return /* @__PURE__ */ r("div", { className: t.detailPanel, children: [
|
|
917
|
+
/* @__PURE__ */ r("div", { className: t.detailHead, children: [
|
|
918
|
+
/* @__PURE__ */ n(W, { type: String(a.type ?? "") }),
|
|
919
|
+
/* @__PURE__ */ n("span", { className: t.detailName, children: String(a.name ?? "") })
|
|
920
|
+
] }),
|
|
921
|
+
/* @__PURE__ */ n("div", { className: t.detailVid, children: String(a.id ?? "") }),
|
|
922
|
+
/* @__PURE__ */ n("div", { className: t.detailSection, children: "属性" }),
|
|
923
|
+
Object.entries(N).length === 0 ? /* @__PURE__ */ n("div", { className: t.detailEmpty, children: "(无属性)" }) : Object.entries(N).map(([f, b]) => /* @__PURE__ */ r("div", { className: t.propRow, children: [
|
|
924
|
+
/* @__PURE__ */ n("div", { className: t.propKey, children: f }),
|
|
925
|
+
/* @__PURE__ */ n("div", { className: t.propVal, children: la(b) })
|
|
926
|
+
] }, f)),
|
|
927
|
+
s.length > 0 && /* @__PURE__ */ r(H, { children: [
|
|
928
|
+
/* @__PURE__ */ n("div", { className: t.detailSection, children: "图上关联(可点击下钻)" }),
|
|
929
|
+
s.map((f) => /* @__PURE__ */ r("div", { className: t.relGroup, children: [
|
|
930
|
+
/* @__PURE__ */ n("div", { className: t.relTitle, children: f.rel }),
|
|
931
|
+
f.nodes.map((b) => /* @__PURE__ */ r(
|
|
932
|
+
"div",
|
|
933
|
+
{
|
|
934
|
+
className: t.relNode,
|
|
935
|
+
onClick: () => h(b.id, b.name, b.type),
|
|
936
|
+
children: [
|
|
937
|
+
/* @__PURE__ */ n(W, { type: b.type }),
|
|
938
|
+
/* @__PURE__ */ n("span", { className: t.relName, children: b.name }),
|
|
939
|
+
b.subtitle && /* @__PURE__ */ n("span", { className: t.relSub, children: b.subtitle })
|
|
940
|
+
]
|
|
941
|
+
},
|
|
942
|
+
b.id
|
|
943
|
+
))
|
|
944
|
+
] }, f.rel))
|
|
945
|
+
] })
|
|
946
|
+
] });
|
|
947
|
+
}
|
|
948
|
+
function la(a) {
|
|
949
|
+
return a == null ? "—" : Array.isArray(a) ? a.length === 0 ? "—" : /* @__PURE__ */ n("div", { className: t.propList, children: a.map((l, h) => /* @__PURE__ */ r("div", { className: t.propListItem, children: [
|
|
950
|
+
"· ",
|
|
951
|
+
typeof l == "object" ? JSON.stringify(l) : String(l)
|
|
952
|
+
] }, h)) }) : typeof a == "object" ? /* @__PURE__ */ n("pre", { className: t.propObj, children: JSON.stringify(a, null, 2) }) : String(a);
|
|
953
|
+
}
|
|
954
|
+
export {
|
|
955
|
+
pa as default
|
|
956
|
+
};
|