react-kggraph 0.0.4 → 0.0.5

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/lib/index27.es.js CHANGED
@@ -1,828 +1,32 @@
1
- import { __toESM as e } from "./index2.es.js";
2
- /* empty css */
3
- import { utils as t, writeFileSync as n } from "./index4.es.js";
4
- import { downloadFile as r } from "./index16.es.js";
5
- import { choiceConfig as i, donwnGraphData as a, downloadData as o, getCyData as s, handleCalcPath as c, layoutCongig as l, linkAnalysis as ee, textLayout as te, textPositionConfig as u } from "./index17.es.js";
6
- import { GraphContext as ne } from "./index18.es.js";
7
- import { fixNodesToEdges as re, layout as ie } from "./index19.es.js";
8
- import d from "./index21.es.js";
9
- import f from "./index23.es.js";
10
- import p from "./index25.es.js";
11
- import { require_classnames as m } from "./index26.es.js";
12
- import { forwardRef as h, useContext as g, useEffect as _, useImperativeHandle as ae, useRef as oe, useState as v } from "react";
13
- import { AppstoreOutlined as se, BorderOuterOutlined as ce, ClearOutlined as le, LineChartOutlined as ue, LineHeightOutlined as y, MinusCircleOutlined as b, MinusSquareOutlined as x, PlusCircleOutlined as de, PlusSquareOutlined as fe, RobotOutlined as pe, SaveOutlined as me, SelectOutlined as he, TableOutlined as ge } from "@ant-design/icons";
14
- import { Button as S, Drawer as _e, Dropdown as C, Flex as w, Form as T, Input as E, Modal as ve, Select as D, Tabs as O, message as k } from "antd";
15
- import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
16
- //#region src/components/Graph/components/ActionBar/index.tsx
17
- var N = /* @__PURE__ */ e(m(), 1), P = (e, t) => (n) => {
18
- n.stopPropagation(), e?.(t || "");
19
- }, F = h(({ graphInfo: e, cyRef: m, initNodeScale: h, typeObj: S, relationObj: T }, E) => {
20
- let { layoutType: D, setLayoutType: F } = g(ne), [I, xe] = v(""), [Se, L] = v(!1), [R, Ce] = v(h), [we, z] = v(!1), [Te, B] = v(!1), [V, Ee] = v(null), [De, H] = v(!1), [Oe, U] = v(!1), [ke, Ae] = v("node"), W = oe(null), [G, je] = v(!0), [K, Me] = v(/* @__PURE__ */ new Set()), [q, Ne] = v(/* @__PURE__ */ new Set());
21
- ae(E, () => ({ onPathAnalysis: () => {
22
- X();
23
- } })), _(() => {
24
- J(I);
25
- }, [I]);
26
- let J = async (e) => {
27
- let t = m.current;
28
- if (!t || !I) {
29
- t?.nodes().removeClass("highlight"), t?.fit();
30
- return;
31
- }
32
- let n = t.nodes().filter((e) => {
33
- let t = (e.data("name") || "").toLowerCase(), n = (e.data("role") || "").toLowerCase(), r = (e.data("dept") || "").toLowerCase(), i = String(e.data("id") || "").toLowerCase();
34
- return t.includes(I.toLowerCase()) || n.includes(I.toLowerCase()) || r.includes(I.toLowerCase()) || i.includes(I.toLowerCase());
35
- });
36
- t.nodes().removeClass("highlight"), n.addClass("highlight"), n.length === 1 ? (console.log("matchedNodes:::", n), t.animate({
37
- center: { eles: n },
38
- duration: 500
39
- })) : alert("未找到对应节点");
40
- }, Y = (e) => {
41
- let t = m.current;
42
- if (!t) return;
43
- let n = t.zoom();
44
- console.log(999, n);
45
- let r = 0;
46
- switch (e) {
47
- case "out":
48
- r = Math.max(n * .8, .1);
49
- break;
50
- case "in":
51
- r = Math.min(n * 1.2, 3);
52
- break;
53
- }
54
- t.zoom(r), t.center();
55
- }, Pe = () => {
56
- console.log("查询节点"), z(!0), B(!1), W.current.close();
57
- }, X = () => {
58
- console.log("路径分析"), z(!1), B(!0), W.current.close();
59
- }, Fe = (t) => {
60
- F(t);
61
- let n = m.current;
62
- n && (n.nodes().unlock(), ie(m, t), t === "cose-bilkent" && e?.searchNodes?.length === 2 && re(n, e.searchNodes[0], e.searchNodes[1]));
63
- }, Ie = () => {
64
- let e = m.current;
65
- e && a(e);
66
- }, Le = () => {
67
- let e = m.current;
68
- e && (Ee(s(e)), H(!0));
69
- }, Z = (e, t) => {
70
- let n = e.current;
71
- n && (t === "downloadPng" ? r(n.png({
72
- scale: 2,
73
- bg: "transparent",
74
- full: !0,
75
- quality: 1
76
- }), `graph_${Date.now()}.png`) : t === "downloadJpg" && r(n.jpg({
77
- scale: 2,
78
- bg: "#ffffff",
79
- full: !0,
80
- quality: 1
81
- }), `graph_${Date.now()}.jpg`));
82
- }, Re = () => {
83
- let e = m.current;
84
- if (!e) return;
85
- let { nodes: r = [], edges: i = [] } = s(e), a = r.map((e) => {
86
- let t = e.data || {}, n = t.properties || {};
87
- return {
88
- 节点名称: t.name || t.label || "",
89
- 节点ID: t.id || "",
90
- 节点类型: t.types || "",
91
- URI: t.label || "",
92
- X坐标: e.position?.x || "",
93
- Y坐标: e.position?.y || "",
94
- 层级: t.level || "",
95
- 宽度: t.baseWidth || "",
96
- 高度: t.baseHeight || "",
97
- 图片: t.image || "",
98
- 属性ID: n.id || "",
99
- 属性值: n.value || ""
100
- };
101
- }), o = i.map((e) => {
102
- let t = e.data || {};
103
- return {
104
- 源节点: t.source?.split("/#")[0]?.split("/").pop() || t.source,
105
- 目标节点: t.target?.split("/#")[0]?.split("/").pop() || t.target,
106
- 源URI: t.source || "",
107
- 目标URI: t.target || "",
108
- 关系名称: t.name || t.label || "",
109
- 关系ID: t.id || ""
110
- };
111
- }), c = t.book_new();
112
- if (a.length > 0) {
113
- let e = t.json_to_sheet(a);
114
- e["!cols"] = [
115
- { wch: 30 },
116
- { wch: 60 },
117
- { wch: 15 },
118
- { wch: 50 },
119
- { wch: 12 },
120
- { wch: 12 },
121
- { wch: 8 },
122
- { wch: 8 },
123
- { wch: 8 },
124
- { wch: 40 },
125
- { wch: 50 },
126
- { wch: 40 }
127
- ], t.book_append_sheet(c, e, "节点");
128
- }
129
- if (o.length > 0) {
130
- let e = t.json_to_sheet(o);
131
- e["!cols"] = [
132
- { wch: 30 },
133
- { wch: 30 },
134
- { wch: 60 },
135
- { wch: 60 },
136
- { wch: 15 },
137
- { wch: 40 }
138
- ], t.book_append_sheet(c, e, "关系");
139
- }
140
- n(c, `graph_${Date.now()}.xlsx`);
141
- }, ze = (e, t) => {
142
- switch (e.stopPropagation(), t) {
143
- case "downloadJson":
144
- Ie();
145
- break;
146
- case "previewJsonList":
147
- Le();
148
- break;
149
- case "downloadExcel":
150
- Re();
151
- break;
152
- case "previewDataList": break;
153
- case "downloadJpg":
154
- Z(m, t);
155
- break;
156
- case "downloadPng":
157
- Z(m, t);
158
- break;
1
+ import { __commonJSMin as e } from "./index2.es.js";
2
+ //#region node_modules/classnames/index.js
3
+ var t = /* @__PURE__ */ e(((e, t) => {
4
+ (function() {
5
+ var e = {}.hasOwnProperty;
6
+ function n() {
7
+ for (var e = "", t = 0; t < arguments.length; t++) {
8
+ var n = arguments[t];
9
+ n && (e = i(e, r(n)));
10
+ }
11
+ return e;
159
12
  }
160
- }, Be = () => {
161
- z(!1), B(!1), W.current.open();
162
- }, Ve = (e) => {
163
- let t = m.current;
164
- if (t) if (t.panningEnabled(!0), e === "all") t.nodes().addClass("selected"), t.nodes().select(), t.elements().select();
165
- else if (e === "reverse") {
166
- let e = t.elements().filter(":selected"), n = t.elements().not(":selected");
167
- e.length > 0 ? (e.unselect(), n.select(), e.removeClass("selected"), n.addClass("selected")) : (t.elements().select(), t.elements().addClass("selected"));
168
- } else e === "click" ? (t.off("click", "node"), t.on("click", "node", (e) => {
169
- let n = e.target;
170
- t.nodes().removeClass("selected grayed highlighted"), t.edges().removeClass("selected grayed highlighted"), n.addClass("selected");
171
- let r = n.neighborhood().nodes().add(n), i = r.edgesWith(r);
172
- console.log("cy.nodes().not(relatedNodes):::", r), t.nodes().not(r).addClass("grayed"), t.edges().not(i).addClass("grayed"), r.addClass("highlighted"), i.addClass("highlighted");
173
- })) : e === "box" && (console.log("进入框选模式"), t.nodes().removeClass("selected"), t.nodes().unselect(), t.elements().unselect(), t.boxSelectionEnabled(!0), t.panningEnabled(!1), t.on("boxselectstart", () => {
174
- console.log("开始框选...");
175
- }), t.on("boxselect", (e) => {
176
- let n = t.elements(":selected");
177
- console.log("框选完成,选中元素数:", n.length), t.elements().removeClass("selected"), n.addClass("selected");
178
- }), t.on("boxselectend", () => {
179
- console.log("框选结束"), t.zoomingEnabled(!0), t.panningEnabled(!0);
180
- }));
181
- }, Q = () => {
182
- let e = m.current;
183
- if (console.log("isShow::::"), Se) L(!1), e.nodes("[types=\"typed-literal\" ]").style("visibility", "visible"), e.edges().style("visibility", "visible");
184
- else {
185
- L(!0);
186
- let t = e.nodes("[types=\"typed-literal\" ]");
187
- t.style("visibility", "hidden"), t.connectedEdges().style("visibility", "hidden");
13
+ function r(t) {
14
+ if (typeof t == "string" || typeof t == "number") return t;
15
+ if (typeof t != "object") return "";
16
+ if (Array.isArray(t)) return n.apply(null, t);
17
+ if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]")) return t.toString();
18
+ var r = "";
19
+ for (var a in t) e.call(t, a) && t[a] && (r = i(r, a));
20
+ return r;
188
21
  }
189
- }, $ = (e) => {
190
- let t = m.current;
191
- if (!t) return;
192
- let n = e === "out" ? Math.max(R * .8, .1) : Math.min(R * 1.2, 5);
193
- Ce(n);
194
- let r = t.nodes();
195
- r.style("width", (e) => (e.data("baseWidth") || 80) * n), r.style("height", (e) => (e.data("baseHeight") || 80) * n);
196
- }, He = (e) => {
197
- xe(e.content), J(e.content);
198
- }, Ue = (e = "刘强东", t = "1") => {
199
- let n = m.current;
200
- if (!n) return;
201
- n.elements().removeClass("level-highlight level-selected level-grayed level-highlightedge");
202
- let r = n.nodes().filter((t) => (t.data("name") || t.data("id") || "").toString().includes(e));
203
- if (r.length === 0) {
204
- k.warning(`未找到节点: ${e}`);
205
- return;
22
+ function i(e, t) {
23
+ return t ? e ? e + " " + t : e + t : e;
206
24
  }
207
- let i = parseInt(t) || 1, a = n.collection(), o = [];
208
- r.forEach((e) => {
209
- e.addClass("level-selected"), a.merge(e);
210
- let t = n.collection(), r = /* @__PURE__ */ new Set();
211
- r.add(e.id()), i >= 1 && (t = e.neighborhood().nodes(), t.forEach((e) => {
212
- r.add(e.id()), a.merge(e);
213
- }), o.push(t));
214
- for (let e = 2; e <= i; e++) {
215
- let e = n.collection();
216
- t.forEach((t) => {
217
- t.neighborhood().nodes().forEach((t) => {
218
- r.has(t.id()) || (r.add(t.id()), e.merge(t));
219
- });
220
- }), e.forEach((e) => a.merge(e)), o.push(e), t = e;
221
- }
222
- }), o.forEach((e) => {
223
- e.addClass("level-highlight");
224
- }), n.edges().filter((e) => {
225
- let t = e.source(), n = e.target();
226
- return a.contains(t) && a.contains(n);
227
- }).addClass("level-highlightedge");
228
- let s = n.elements().filter(".level-selected, .level-highlight, .level-highlightedge");
229
- n.elements().not(s).addClass("level-grayed"), k.success(`已高亮 "${e}" 及其 ${i} 度关联节点和连线`);
230
- }, We = (e) => {
231
- let t = m.current;
232
- if (!t) return;
233
- let n = new Set(K);
234
- n.has(e) ? (n.delete(e), t.nodes().filter((t) => t.data("type") === e).show()) : (n.add(e), t.nodes().filter((t) => t.data("type") === e).hide()), Me(n);
235
- }, Ge = (e) => {
236
- let t = m.current;
237
- if (!t) return;
238
- let n = new Set(q);
239
- n.has(e) ? (n.delete(e), t.edges().filter((t) => t.data("name") === e).show()) : (n.add(e), t.edges().filter((t) => t.data("name") === e).hide()), Ne(n);
240
- }, Ke = () => {
241
- let e = m.current;
242
- e.remove(e.elements());
243
- }, qe = () => {
244
- U(!0);
245
- };
246
- return /* @__PURE__ */ M(A, { children: [
247
- /* @__PURE__ */ j("div", {
248
- className: "graph-bar",
249
- children: /* @__PURE__ */ M("div", {
250
- className: "graph-bar-min",
251
- children: [
252
- /* @__PURE__ */ M(w, {
253
- wrap: !0,
254
- align: "center",
255
- justify: "center",
256
- className: "hover:text-[#145afd] cursor",
257
- onClick: () => je(!G),
258
- children: [/* @__PURE__ */ j(se, {}), /* @__PURE__ */ j(w, {
259
- className: "w-100% ",
260
- justify: "center",
261
- children: "查询统计"
262
- })]
263
- }),
264
- /* @__PURE__ */ j(C, {
265
- menu: { items: l?.map((e) => ({
266
- ...e,
267
- label: /* @__PURE__ */ j("div", {
268
- className: (0, N.default)({ "text-[#145afd]": D === e.key }),
269
- onClick: P(Fe, e.key),
270
- children: e.label
271
- })
272
- })) },
273
- children: /* @__PURE__ */ M(w, {
274
- wrap: !0,
275
- align: "center",
276
- justify: "center",
277
- className: "hover:text-[#145afd] cursor",
278
- children: [/* @__PURE__ */ j(ge, {}), /* @__PURE__ */ j(w, {
279
- className: "w-100% ",
280
- justify: "center",
281
- children: "布局"
282
- })]
283
- })
284
- }),
285
- /* @__PURE__ */ M(w, {
286
- wrap: !0,
287
- align: "center",
288
- justify: "center",
289
- className: "hover:text-[#145afd] cursor",
290
- onClick: () => qe(),
291
- children: [/* @__PURE__ */ j(pe, {}), /* @__PURE__ */ j(w, {
292
- className: "w-100% ",
293
- justify: "center",
294
- children: "图显示设置"
295
- })]
296
- }),
297
- /* @__PURE__ */ j(C, {
298
- menu: { items: ee.map((e) => ({
299
- ...e,
300
- label: /* @__PURE__ */ j("div", {
301
- onClick: (t) => {
302
- switch (t.stopPropagation(), e.key) {
303
- case "query":
304
- Pe();
305
- break;
306
- case "link":
307
- Be();
308
- break;
309
- case "path":
310
- X();
311
- break;
312
- }
313
- },
314
- children: e.label
315
- })
316
- })) },
317
- children: /* @__PURE__ */ M(w, {
318
- wrap: !0,
319
- align: "center",
320
- justify: "center",
321
- className: "hover:text-[#145afd] cursor",
322
- children: [/* @__PURE__ */ j(ue, {}), /* @__PURE__ */ j(w, {
323
- className: "w-100% ",
324
- justify: "center",
325
- children: "分析"
326
- })]
327
- })
328
- }),
329
- /* @__PURE__ */ j(C, {
330
- menu: { items: i?.map((e) => ({
331
- ...e,
332
- label: /* @__PURE__ */ j("div", {
333
- onClick: P(Ve, e.key),
334
- children: e.label
335
- })
336
- })) },
337
- children: /* @__PURE__ */ M(w, {
338
- wrap: !0,
339
- align: "center",
340
- justify: "center",
341
- className: "hover:text-[#145afd] cursor",
342
- children: [/* @__PURE__ */ j(he, {}), /* @__PURE__ */ j(w, {
343
- className: "w-100% ",
344
- justify: "center",
345
- children: "选择"
346
- })]
347
- })
348
- }),
349
- /* @__PURE__ */ j(C, {
350
- menu: { items: o?.map((e) => ({
351
- ...e,
352
- label: /* @__PURE__ */ j("div", {
353
- onClick: (t) => ze(t, e.key),
354
- children: e.label
355
- })
356
- })) },
357
- children: /* @__PURE__ */ M(w, {
358
- wrap: !0,
359
- align: "center",
360
- justify: "center",
361
- className: "hover:text-[#145afd] cursor",
362
- children: [/* @__PURE__ */ j(me, {}), /* @__PURE__ */ j(w, {
363
- className: "w-100% ",
364
- justify: "center",
365
- children: "下载数据"
366
- })]
367
- })
368
- }),
369
- /* @__PURE__ */ M(w, {
370
- wrap: !0,
371
- align: "center",
372
- justify: "center",
373
- className: "hover:text-[#145afd] cursor",
374
- onClick: () => Q(),
375
- children: [/* @__PURE__ */ j(ce, {}), /* @__PURE__ */ j(w, {
376
- className: "w-100% ",
377
- justify: "center",
378
- children: "隐藏属性"
379
- })]
380
- }),
381
- /* @__PURE__ */ j(C, {
382
- menu: { items: u?.map((e) => ({
383
- ...e,
384
- label: /* @__PURE__ */ j("div", {
385
- onClick: P(() => te(m, e.key), e.key),
386
- children: e.label
387
- })
388
- })) },
389
- children: /* @__PURE__ */ M(w, {
390
- wrap: !0,
391
- align: "center",
392
- justify: "center",
393
- className: "hover:text-[#145afd] cursor",
394
- children: [/* @__PURE__ */ j(y, {}), /* @__PURE__ */ j(w, {
395
- className: "w-100% ",
396
- justify: "center",
397
- children: "文字位置"
398
- })]
399
- })
400
- }),
401
- /* @__PURE__ */ M(w, {
402
- wrap: !0,
403
- align: "center",
404
- justify: "center",
405
- className: "hover:text-[#145afd] cursor",
406
- onClick: () => Ke(),
407
- children: [/* @__PURE__ */ j(le, {}), /* @__PURE__ */ j(w, {
408
- className: "w-100% ",
409
- justify: "center",
410
- children: "清空画布"
411
- })]
412
- }),
413
- /* @__PURE__ */ M(w, {
414
- wrap: !0,
415
- align: "center",
416
- justify: "center",
417
- className: "hover:text-[#145afd] cursor",
418
- children: [/* @__PURE__ */ M(w, {
419
- gap: "5px",
420
- children: [/* @__PURE__ */ j(de, { onClick: () => $("in") }), /* @__PURE__ */ j(b, { onClick: () => $("out") })]
421
- }), /* @__PURE__ */ j(w, {
422
- className: "w-100% ",
423
- justify: "center",
424
- children: "节点缩放"
425
- })]
426
- }),
427
- /* @__PURE__ */ M(w, {
428
- wrap: !0,
429
- align: "center",
430
- justify: "center",
431
- className: "hover:text-[#145afd] cursor",
432
- children: [/* @__PURE__ */ M(w, {
433
- gap: "5px",
434
- children: [/* @__PURE__ */ j(fe, { onClick: () => Y("in") }), /* @__PURE__ */ j(x, { onClick: () => Y("out") })]
435
- }), /* @__PURE__ */ j(w, {
436
- className: "w-100% ",
437
- justify: "center",
438
- children: "画布缩放"
439
- })]
440
- })
441
- ]
442
- })
443
- }),
444
- /* @__PURE__ */ j(d, {
445
- isVisible: we,
446
- searchChange: (e) => He(e),
447
- closeQuery: () => z(!1)
448
- }),
449
- /* @__PURE__ */ j(f, {
450
- isVisible: Te,
451
- analysis: (e) => c(m, { pathNodes: e }),
452
- closePath: () => B(!1)
453
- }),
454
- /* @__PURE__ */ j(p, {
455
- ref: W,
456
- onLevelClick: Ue
457
- }),
458
- /* @__PURE__ */ j(ve, {
459
- title: "JSON预览",
460
- open: De,
461
- onCancel: () => H(!1),
462
- footer: null,
463
- width: 800,
464
- children: /* @__PURE__ */ j("pre", {
465
- style: {
466
- maxHeight: "60vh",
467
- overflow: "auto",
468
- background: "#f5f5f5",
469
- padding: "16px",
470
- borderRadius: "4px"
471
- },
472
- children: V ? JSON.stringify(V, null, 2) : "暂无数据"
473
- })
474
- }),
475
- /* @__PURE__ */ j(_e, {
476
- title: "图显示设置",
477
- placement: "right",
478
- open: Oe,
479
- onClose: () => U(!1),
480
- mask: !1,
481
- width: 350,
482
- getContainer: !1,
483
- children: /* @__PURE__ */ j(O, {
484
- activeKey: ke,
485
- onChange: Ae,
486
- items: [{
487
- label: "节点设置",
488
- key: "node",
489
- children: /* @__PURE__ */ j(ye, { onSave: (e) => {
490
- let t = m.current;
491
- t && (t.nodes().forEach((t) => {
492
- t.style({
493
- width: e.nodeSize,
494
- height: e.nodeSize,
495
- "font-size": e.fontSize,
496
- color: e.fontColor,
497
- "font-weight": e.fontWeight,
498
- "font-style": e.fontStyle,
499
- "text-valign": e.textPosition,
500
- "text-halign": "center",
501
- "text-margin-y": e.textOffset,
502
- label: e.showLabel === "show" ? t.data("name") || t.data("label") : ""
503
- });
504
- }), k.success("节点配置保存成功"));
505
- } })
506
- }, {
507
- label: "连线设置",
508
- key: "edge",
509
- children: /* @__PURE__ */ j(be, { onSave: (e) => {
510
- let t = m.current;
511
- t && (t.edges().forEach((t) => {
512
- t.style({
513
- width: e.edgeWidth,
514
- "line-color": e.edgeColorType === "custom" ? e.customColor : "#a29e9e",
515
- "target-arrow-color": e.edgeColorType === "custom" ? e.customColor : "#a29e9e",
516
- "target-arrow-shape": e.showArrow === "show" ? "triangle" : "none",
517
- "font-size": e.fontSize,
518
- color: e.fontColor,
519
- "font-weight": e.fontWeight,
520
- "font-style": e.fontStyle,
521
- label: e.showLabel === "show" ? t.data("label") || t.data("name") : "",
522
- "text-background-color": e.labelBgColor || "transparent",
523
- "text-background-opacity": +!!e.labelBgColor,
524
- "text-background-padding": "2px"
525
- });
526
- }), k.success("连线配置保存成功"));
527
- } })
528
- }]
529
- })
530
- }),
531
- /* @__PURE__ */ j("div", {
532
- className: (0, N.default)("absolute right-0px z-1 bg-#fff p-10px rounded-10px shadow-[0_4px_20px_0px_rgba(12,95,218,0.33)] w-200px", { hidden: !G }),
533
- children: /* @__PURE__ */ j(O, { items: [{
534
- label: "实体",
535
- key: "entity",
536
- children: /* @__PURE__ */ j(A, { children: Object.keys(S).length > 0 ? /* @__PURE__ */ M("div", { children: [
537
- /* @__PURE__ */ M("p", { children: ["实体数量:", Object.values(S).reduce((e, t) => e + t.count, 0)] }),
538
- /* @__PURE__ */ M("p", {
539
- className: "my-4px",
540
- children: ["实体类型:", Object.keys(S).length]
541
- }),
542
- /* @__PURE__ */ j(w, {
543
- gap: "5px",
544
- justify: "start",
545
- className: "w-100%",
546
- wrap: !0,
547
- children: Object.keys(S).map((e) => /* @__PURE__ */ M(w, {
548
- gap: "4px",
549
- justify: "start",
550
- className: `w-100% cursor ${K.has(e) ? "opacity-30" : ""}`,
551
- onClick: () => We(e),
552
- children: [
553
- /* @__PURE__ */ j("img", {
554
- className: "w-20px rounded-50%",
555
- src: S[e].img,
556
- alt: ""
557
- }),
558
- e,
559
- ":",
560
- S[e].count
561
- ]
562
- }, e))
563
- })
564
- ] }) : /* @__PURE__ */ j("span", {
565
- className: "text-[#666]",
566
- children: "暂无实体统计!"
567
- }) })
568
- }, {
569
- label: "关系",
570
- key: "relation",
571
- children: /* @__PURE__ */ j(A, { children: Object.keys(T)?.length > 0 ? /* @__PURE__ */ M("div", { children: [
572
- /* @__PURE__ */ M("div", { children: ["关系数量:", Object.keys(T)?.length] }),
573
- /* @__PURE__ */ M("div", {
574
- className: "my-4px",
575
- children: ["关系类型:", Object.values(T)?.reduce((e, t) => e + t, 0)]
576
- }),
577
- /* @__PURE__ */ j(w, {
578
- gap: "5px",
579
- justify: "start",
580
- className: "w-100%",
581
- wrap: !0,
582
- children: Object.keys(T).map((e) => /* @__PURE__ */ M(w, {
583
- gap: "4px",
584
- className: `w-100% cursor ${q.has(e) ? "opacity-30" : ""}`,
585
- onClick: () => Ge(e),
586
- children: [
587
- e,
588
- ":",
589
- T[e]
590
- ]
591
- }, e))
592
- })
593
- ] }) : /* @__PURE__ */ j("span", {
594
- className: "text-[#666]",
595
- children: "暂无关系统计!"
596
- }) })
597
- }] })
598
- })
599
- ] });
600
- }), ye = ({ onSave: e }) => {
601
- let [t] = T.useForm();
602
- return /* @__PURE__ */ M(T, {
603
- form: t,
604
- layout: "vertical",
605
- onFinish: e,
606
- children: [
607
- /* @__PURE__ */ j(T.Item, {
608
- label: "节点大小",
609
- name: "nodeSize",
610
- initialValue: 80,
611
- children: /* @__PURE__ */ j(E, {
612
- type: "number",
613
- placeholder: "请输入节点大小"
614
- })
615
- }),
616
- /* @__PURE__ */ j(T.Item, {
617
- label: "显示标签",
618
- name: "showLabel",
619
- initialValue: "show",
620
- children: /* @__PURE__ */ M(D, { children: [/* @__PURE__ */ j(D.Option, {
621
- value: "show",
622
- children: "显示"
623
- }), /* @__PURE__ */ j(D.Option, {
624
- value: "hide",
625
- children: "隐藏"
626
- })] })
627
- }),
628
- /* @__PURE__ */ j(T.Item, {
629
- label: "字体位置",
630
- name: "textPosition",
631
- initialValue: "bottom",
632
- children: /* @__PURE__ */ j(D, { children: u.map((e) => /* @__PURE__ */ j(D.Option, {
633
- value: e.key,
634
- children: e.label
635
- }, e.item)) })
636
- }),
637
- /* @__PURE__ */ j(T.Item, {
638
- label: "字体偏移",
639
- name: "textOffset",
640
- initialValue: 5,
641
- children: /* @__PURE__ */ j(E, {
642
- type: "number",
643
- placeholder: "请输入字体偏移量"
644
- })
645
- }),
646
- /* @__PURE__ */ j(T.Item, {
647
- label: "字体颜色",
648
- name: "fontColor",
649
- initialValue: "rgb(50,50,50)",
650
- children: /* @__PURE__ */ j(E, { placeholder: "请输入字体颜色" })
651
- }),
652
- /* @__PURE__ */ j(T.Item, {
653
- label: "字体大小",
654
- name: "fontSize",
655
- initialValue: 18,
656
- children: /* @__PURE__ */ j(E, {
657
- type: "number",
658
- placeholder: "请输入字体大小"
659
- })
660
- }),
661
- /* @__PURE__ */ j(T.Item, {
662
- label: "字体粗细",
663
- name: "fontWeight",
664
- initialValue: "normal",
665
- children: /* @__PURE__ */ M(D, { children: [
666
- /* @__PURE__ */ j(D.Option, {
667
- value: "normal",
668
- children: "常规"
669
- }),
670
- /* @__PURE__ */ j(D.Option, {
671
- value: "bold",
672
- children: "粗体"
673
- }),
674
- /* @__PURE__ */ j(D.Option, {
675
- value: "lighter",
676
- children: "细体"
677
- })
678
- ] })
679
- }),
680
- /* @__PURE__ */ j(T.Item, {
681
- label: "字体样式",
682
- name: "fontStyle",
683
- initialValue: "normal",
684
- children: /* @__PURE__ */ M(D, { children: [/* @__PURE__ */ j(D.Option, {
685
- value: "normal",
686
- children: "默认"
687
- }), /* @__PURE__ */ j(D.Option, {
688
- value: "italic",
689
- children: "斜体"
690
- })] })
691
- }),
692
- /* @__PURE__ */ j(T.Item, { children: /* @__PURE__ */ j(S, {
693
- type: "primary",
694
- htmlType: "submit",
695
- block: !0,
696
- children: "保存节点配置"
697
- }) })
698
- ]
699
- });
700
- }, be = ({ onSave: e }) => {
701
- let [t] = T.useForm(), [n, r] = v("default");
702
- return /* @__PURE__ */ M(T, {
703
- form: t,
704
- layout: "vertical",
705
- onFinish: e,
706
- children: [
707
- /* @__PURE__ */ j(T.Item, {
708
- label: "类型",
709
- name: "edgeType",
710
- initialValue: "straight",
711
- children: /* @__PURE__ */ M(D, { children: [/* @__PURE__ */ j(D.Option, {
712
- value: "straight",
713
- children: "直线"
714
- }), /* @__PURE__ */ j(D.Option, {
715
- value: "curve",
716
- children: "曲线"
717
- })] })
718
- }),
719
- /* @__PURE__ */ j(T.Item, {
720
- label: "连线宽度",
721
- name: "edgeWidth",
722
- initialValue: 2,
723
- children: /* @__PURE__ */ j(E, {
724
- type: "number",
725
- placeholder: "请输入连线宽度"
726
- })
727
- }),
728
- /* @__PURE__ */ j(T.Item, {
729
- label: "连线箭头",
730
- name: "showArrow",
731
- initialValue: "show",
732
- children: /* @__PURE__ */ M(D, { children: [/* @__PURE__ */ j(D.Option, {
733
- value: "show",
734
- children: "显示"
735
- }), /* @__PURE__ */ j(D.Option, {
736
- value: "hide",
737
- children: "隐藏"
738
- })] })
739
- }),
740
- /* @__PURE__ */ j(T.Item, {
741
- label: "连线颜色",
742
- name: "edgeColorType",
743
- initialValue: "default",
744
- children: /* @__PURE__ */ M(D, {
745
- onChange: r,
746
- children: [/* @__PURE__ */ j(D.Option, {
747
- value: "default",
748
- children: "默认"
749
- }), /* @__PURE__ */ j(D.Option, {
750
- value: "custom",
751
- children: "自定义色"
752
- })]
753
- })
754
- }),
755
- n === "custom" && /* @__PURE__ */ j(T.Item, {
756
- label: "自定义颜色",
757
- name: "customColor",
758
- initialValue: "rgb(20,20,20)",
759
- children: /* @__PURE__ */ j(E, { placeholder: "请输入自定义颜色" })
760
- }),
761
- /* @__PURE__ */ j(T.Item, {
762
- label: "显示标签",
763
- name: "showLabel",
764
- initialValue: "show",
765
- children: /* @__PURE__ */ M(D, { children: [/* @__PURE__ */ j(D.Option, {
766
- value: "show",
767
- children: "显示"
768
- }), /* @__PURE__ */ j(D.Option, {
769
- value: "hide",
770
- children: "隐藏"
771
- })] })
772
- }),
773
- /* @__PURE__ */ j(T.Item, {
774
- label: "字体大小",
775
- name: "fontSize",
776
- initialValue: 14,
777
- children: /* @__PURE__ */ j(E, {
778
- type: "number",
779
- placeholder: "请输入字体大小"
780
- })
781
- }),
782
- /* @__PURE__ */ j(T.Item, {
783
- label: "字体粗细",
784
- name: "fontWeight",
785
- initialValue: "normal",
786
- children: /* @__PURE__ */ M(D, { children: [/* @__PURE__ */ j(D.Option, {
787
- value: "normal",
788
- children: "常规"
789
- }), /* @__PURE__ */ j(D.Option, {
790
- value: "bold",
791
- children: "粗体"
792
- })] })
793
- }),
794
- /* @__PURE__ */ j(T.Item, {
795
- label: "字体样式",
796
- name: "fontStyle",
797
- initialValue: "normal",
798
- children: /* @__PURE__ */ M(D, { children: [/* @__PURE__ */ j(D.Option, {
799
- value: "normal",
800
- children: "默认"
801
- }), /* @__PURE__ */ j(D.Option, {
802
- value: "italic",
803
- children: "斜体"
804
- })] })
805
- }),
806
- /* @__PURE__ */ j(T.Item, {
807
- label: "字体颜色",
808
- name: "fontColor",
809
- initialValue: "rgb(50,50,50)",
810
- children: /* @__PURE__ */ j(E, { placeholder: "请输入字体颜色" })
811
- }),
812
- /* @__PURE__ */ j(T.Item, {
813
- label: "标签背色",
814
- name: "labelBgColor",
815
- initialValue: "",
816
- children: /* @__PURE__ */ j(E, { placeholder: "请选择颜色" })
817
- }),
818
- /* @__PURE__ */ j(T.Item, { children: /* @__PURE__ */ j(S, {
819
- type: "primary",
820
- htmlType: "submit",
821
- block: !0,
822
- children: "保存连线配置"
823
- }) })
824
- ]
825
- });
826
- };
25
+ t !== void 0 && t.exports ? (n.default = n, t.exports = n) : typeof define == "function" && typeof define.amd == "object" && define.amd ? define("classnames", [], function() {
26
+ return n;
27
+ }) : window.classNames = n;
28
+ })();
29
+ }));
827
30
  //#endregion
828
- export { F as default };
31
+ export default t();
32
+ export { t as require_classnames };