react-kggraph 0.0.22 → 0.0.23
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/index.es10.js +20 -19
- package/lib/index.es14.js +39 -41
- package/lib/index.es16.js +19 -18
- package/lib/index.es22.js +2 -2
- package/lib/index.es3.js +80 -79
- package/lib/index.es35.js +64 -4
- package/lib/index.es36.js +4 -2
- package/lib/index.es37.js +4 -0
- package/lib/index.es4.js +1 -1
- package/lib/index.es41.js +21 -0
- package/lib/index.es42.js +43 -0
- package/lib/index.es43.js +42 -0
- package/lib/index.es44.js +91 -0
- package/lib/index.es45.js +58 -0
- package/lib/index.es46.js +33 -0
- package/lib/index.es48.js +72 -0
- package/lib/index.es7.js +125 -125
- package/lib/src/components/Graph/components/KnowledgeCard/components/AudioSection.d.ts +12 -0
- package/lib/src/components/Graph/components/KnowledgeCard/components/DocumentSection.d.ts +12 -0
- package/lib/src/components/Graph/components/KnowledgeCard/components/ImageSection.d.ts +12 -0
- package/lib/src/components/Graph/components/KnowledgeCard/components/ListCard.d.ts +14 -0
- package/lib/src/components/Graph/components/KnowledgeCard/components/PropertySection.d.ts +11 -0
- package/lib/src/components/Graph/components/KnowledgeCard/components/RelationSection.d.ts +13 -0
- package/lib/src/components/Graph/components/KnowledgeCard/components/SourceCard.d.ts +6 -0
- package/lib/src/components/Graph/components/KnowledgeCard/components/VideoSection.d.ts +12 -0
- package/lib/src/components/Graph/components/KnowledgeCard/data.d.ts +84 -0
- package/lib/src/components/Graph/utils/edge_node_styles.d.ts +1 -0
- package/lib/style.css +1 -1
- package/package.json +1 -1
package/lib/index.es35.js
CHANGED
|
@@ -1,6 +1,66 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { jsxs as c, jsx as e, Fragment as o } from "react/jsx-runtime";
|
|
2
|
+
import h from "./index.es41.js";
|
|
3
|
+
import u from "./index.es42.js";
|
|
4
|
+
import g from "./index.es43.js";
|
|
5
|
+
import w from "./index.es44.js";
|
|
6
|
+
import f from "./index.es45.js";
|
|
7
|
+
import N from "./index.es46.js";
|
|
8
|
+
import { Row as k, Col as p, Empty as y } from "antd";
|
|
9
|
+
/* empty css */
|
|
10
|
+
const i = (r) => {
|
|
11
|
+
const n = document.getElementById(r);
|
|
12
|
+
if (n) {
|
|
13
|
+
const d = n.closest(".knowledge-card-content");
|
|
14
|
+
d && d.scrollTo({
|
|
15
|
+
top: n.offsetTop - 20,
|
|
16
|
+
behavior: "smooth"
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}, R = ({ detailData: r = {}, drawerInfo: n = {}, loading: d }) => {
|
|
20
|
+
var t, l, s, a, m;
|
|
21
|
+
return /* @__PURE__ */ c(k, { className: "knowledge-card-click", wrap: !1, children: [
|
|
22
|
+
/* @__PURE__ */ c(p, { flex: "80px", className: "card-item-click", children: [
|
|
23
|
+
/* @__PURE__ */ e("p", { className: "drawer-card-title2", onClick: () => i("section-property"), children: "知识详情" }),
|
|
24
|
+
/* @__PURE__ */ e("p", { className: "drawer-card-title2", onClick: () => i("section-document"), children: "关联文档" }),
|
|
25
|
+
/* @__PURE__ */ e("p", { className: "drawer-card-title2", onClick: () => i("section-image"), children: "关联图片" }),
|
|
26
|
+
/* @__PURE__ */ e("p", { className: "drawer-card-title2", onClick: () => i("section-video"), children: "关联视频" }),
|
|
27
|
+
/* @__PURE__ */ e("p", { className: "drawer-card-title2", onClick: () => i("section-audio"), children: "关联音频" }),
|
|
28
|
+
/* @__PURE__ */ e("p", { className: "drawer-card-title2", onClick: () => i("section-relation"), children: "关联知识" })
|
|
29
|
+
] }),
|
|
30
|
+
/* @__PURE__ */ c(p, { flex: "auto", className: "knowledge-card-content", children: [
|
|
31
|
+
r.property ? /* @__PURE__ */ c(o, { children: [
|
|
32
|
+
/* @__PURE__ */ e("p", { className: "drawer-card-title", id: "section-property", children: "知识详情" }),
|
|
33
|
+
/* @__PURE__ */ e(
|
|
34
|
+
h,
|
|
35
|
+
{
|
|
36
|
+
properties: r.property || [],
|
|
37
|
+
excludedKeys: ["id"]
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
] }) : !d && /* @__PURE__ */ e(y, {}),
|
|
41
|
+
((t = r.document) == null ? void 0 : t.length) > 0 && /* @__PURE__ */ c(o, { children: [
|
|
42
|
+
/* @__PURE__ */ e("p", { className: "drawer-card-title", id: "section-document", children: "关联文档" }),
|
|
43
|
+
/* @__PURE__ */ e(u, { documents: r.document, source: "qa-card" })
|
|
44
|
+
] }),
|
|
45
|
+
((l = r.image) == null ? void 0 : l.length) > 0 && /* @__PURE__ */ c(o, { children: [
|
|
46
|
+
/* @__PURE__ */ e("p", { className: "drawer-card-title", id: "section-image", children: "关联图片" }),
|
|
47
|
+
/* @__PURE__ */ e(g, { images: r.image, source: "qa-card" })
|
|
48
|
+
] }),
|
|
49
|
+
((s = r.video) == null ? void 0 : s.length) > 0 && /* @__PURE__ */ c(o, { children: [
|
|
50
|
+
/* @__PURE__ */ e("p", { className: "drawer-card-title", id: "section-video", children: "关联视频" }),
|
|
51
|
+
/* @__PURE__ */ e(w, { videos: r.video, source: "qa-card" })
|
|
52
|
+
] }),
|
|
53
|
+
((a = r.audio) == null ? void 0 : a.length) > 0 && /* @__PURE__ */ c(o, { children: [
|
|
54
|
+
/* @__PURE__ */ e("p", { className: "drawer-card-title", id: "section-audio", children: "关联音频" }),
|
|
55
|
+
/* @__PURE__ */ e(f, { audios: r.audio, source: "qa-card" })
|
|
56
|
+
] }),
|
|
57
|
+
((m = r.relation) == null ? void 0 : m.length) > 0 && /* @__PURE__ */ c(o, { children: [
|
|
58
|
+
/* @__PURE__ */ e("p", { className: "drawer-card-title", id: "section-relation", children: "关联知识" }),
|
|
59
|
+
/* @__PURE__ */ e(N, { relations: r.relation, kgIds: n.kgId, source: "qa-card" })
|
|
60
|
+
] })
|
|
61
|
+
] })
|
|
62
|
+
] });
|
|
63
|
+
};
|
|
4
64
|
export {
|
|
5
|
-
|
|
65
|
+
R as default
|
|
6
66
|
};
|
package/lib/index.es36.js
CHANGED
package/lib/index.es4.js
CHANGED
|
@@ -3,7 +3,7 @@ import { AppstoreOutlined as t, TableOutlined as e, RobotOutlined as n, LineChar
|
|
|
3
3
|
const m = [
|
|
4
4
|
{ key: "queryStatistics", title: "查询统计", icon: [/* @__PURE__ */ i(t, {}, "icon")] },
|
|
5
5
|
{ key: "layout", title: "布局", icon: [/* @__PURE__ */ i(e, {}, "icon")] },
|
|
6
|
-
{ key: "graphDisplaySettings", title: "
|
|
6
|
+
{ key: "graphDisplaySettings", title: "图设置", icon: [/* @__PURE__ */ i(n, {}, "icon")] },
|
|
7
7
|
{ key: "analysis", title: "分析", icon: [/* @__PURE__ */ i(o, {}, "icon")] },
|
|
8
8
|
{ key: "select", title: "选择", icon: [/* @__PURE__ */ i(l, {}, "icon")] },
|
|
9
9
|
{ key: "downloadData", title: "下载数据", icon: [/* @__PURE__ */ i(c, {}, "icon")] },
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as o, jsxs as r } from "react/jsx-runtime";
|
|
2
|
+
import { Row as i, Col as p } from "antd";
|
|
3
|
+
const d = ({ properties: t, excludedKeys: l = [] }) => {
|
|
4
|
+
const s = t.filter(
|
|
5
|
+
(e) => !l.includes(e.propertyKey)
|
|
6
|
+
);
|
|
7
|
+
return /* @__PURE__ */ o(i, { className: "property-section-wraper", children: s.map((e, a) => /* @__PURE__ */ r(p, { span: 24, className: "section-item", children: [
|
|
8
|
+
/* @__PURE__ */ r("div", { className: "detail-label", children: [
|
|
9
|
+
e.propertyKey,
|
|
10
|
+
":"
|
|
11
|
+
] }),
|
|
12
|
+
/* @__PURE__ */ r("div", { className: "detail-value", children: [
|
|
13
|
+
" ",
|
|
14
|
+
e.propertyValue,
|
|
15
|
+
" "
|
|
16
|
+
] })
|
|
17
|
+
] }, a)) });
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
d as default
|
|
21
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as s, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { Space as d, Button as i } from "antd";
|
|
3
|
+
import { downloadFile as x } from "./index.es12.js";
|
|
4
|
+
const w = ({ documents: l, forceSingleColumn: c = !1, source: r }) => {
|
|
5
|
+
const a = (e) => e.toLowerCase().endsWith(".pdf") ? /* @__PURE__ */ s("span", { className: "w-24px h-30px i-custom-pdf-doc inline-block" }) : e.toLowerCase().endsWith(".docx") || e.toLowerCase().endsWith(".doc") ? /* @__PURE__ */ s("span", { className: "w-24px h-30px i-custom-doc-doc inline-block" }) : e.toLowerCase().endsWith(".pptx") || e.toLowerCase().endsWith(".ppt") ? /* @__PURE__ */ s("span", { className: "w-24px h-30px i-custom-ppt-doc inline-block" }) : e.toLowerCase().endsWith(".txt") ? /* @__PURE__ */ s("span", { className: "w-24px h-30px i-custom-txt-doc inline-block" }) : e.toLowerCase().endsWith(".csv") ? /* @__PURE__ */ s("span", { className: "w-24px h-30px i-custom-csv-doc inline-block" }) : e.toLowerCase().endsWith(".xls") || e.toLowerCase().endsWith(".xlsx") ? /* @__PURE__ */ s("span", { className: "w-24px h-30px i-custom-xls-doc inline-block" }) : /* @__PURE__ */ s("span", { className: "w-24px h-30px i-custom-else-doc inline-block" }), p = (e) => {
|
|
6
|
+
const n = e.split("/");
|
|
7
|
+
return n[n.length - 1];
|
|
8
|
+
};
|
|
9
|
+
return /* @__PURE__ */ s("div", { className: r === "qa-card" ? "grid grid-cols-1" : `grid ${c ? "grid-cols-1 gap-y-5" : "grid-cols-1 md:grid-cols-2 gap-x-100px gap-y-10px"}`, children: l.map((e, n) => {
|
|
10
|
+
const t = p(e.propertyValue);
|
|
11
|
+
return /* @__PURE__ */ o("div", { className: "flex items-center justify-between transition-all", children: [
|
|
12
|
+
/* @__PURE__ */ o("div", { className: "flex items-center min-w-0 flex-1", children: [
|
|
13
|
+
/* @__PURE__ */ s("div", { className: "mr-3 text-xl flex-shrink-0", children: a(t) }),
|
|
14
|
+
/* @__PURE__ */ s("div", { className: "min-w-0", children: /* @__PURE__ */ s("div", { className: "truncate", title: decodeURIComponent(t), children: decodeURIComponent(t) }) })
|
|
15
|
+
] }),
|
|
16
|
+
/* @__PURE__ */ o(d, { className: "flex-shrink-0", children: [
|
|
17
|
+
/* @__PURE__ */ s(
|
|
18
|
+
i,
|
|
19
|
+
{
|
|
20
|
+
className: "px-0px",
|
|
21
|
+
type: "link",
|
|
22
|
+
onClick: () => window.open(e.propertyValue, "_blank"),
|
|
23
|
+
children: "查看"
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ s(
|
|
27
|
+
i,
|
|
28
|
+
{
|
|
29
|
+
type: "link",
|
|
30
|
+
className: "px-0px",
|
|
31
|
+
onClick: () => {
|
|
32
|
+
x(e.propertyValue, t);
|
|
33
|
+
},
|
|
34
|
+
children: "下载"
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
] })
|
|
38
|
+
] }, n);
|
|
39
|
+
}) });
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
w as default
|
|
43
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as s } from "react";
|
|
3
|
+
import { Image as t } from "antd";
|
|
4
|
+
const m = ({ images: o, forceSingleColumn: i = !1, source: d = "" }) => (s(0), /* @__PURE__ */ e("div", { className: d === "qa-card" ? "grid grid-cols-1" : `grid ${i ? "grid-cols-1 gap-y-3" : "grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-20px"}`, children: /* @__PURE__ */ e(
|
|
5
|
+
t.PreviewGroup,
|
|
6
|
+
{
|
|
7
|
+
preview: {
|
|
8
|
+
// onVisibleChange: (visible) => {
|
|
9
|
+
// if (visible) {
|
|
10
|
+
// handlePreviewOpen();
|
|
11
|
+
// } else {
|
|
12
|
+
// handlePreviewClose();
|
|
13
|
+
// }
|
|
14
|
+
// },
|
|
15
|
+
mask: !0,
|
|
16
|
+
zIndex: 9999,
|
|
17
|
+
getContainer: () => document.getElementById("root") || document.body
|
|
18
|
+
},
|
|
19
|
+
children: o.map((r, a) => /* @__PURE__ */ e("div", { className: "group rounded-lg overflow-hidden transition-shadow", children: /* @__PURE__ */ e("div", { className: "h-185px relative overflow-hidden", children: /* @__PURE__ */ e(
|
|
20
|
+
t,
|
|
21
|
+
{
|
|
22
|
+
src: r.propertyValue,
|
|
23
|
+
alt: r.propertyKey,
|
|
24
|
+
style: {
|
|
25
|
+
width: "100%",
|
|
26
|
+
height: "185px",
|
|
27
|
+
objectFit: "cover"
|
|
28
|
+
// cover 保证图片充满容器,可能会裁剪
|
|
29
|
+
// 或者使用 'contain' 保证图片完整显示,可能会有留白
|
|
30
|
+
// objectFit: 'contain',
|
|
31
|
+
},
|
|
32
|
+
className: "transition-transform duration-300 group-hover:scale-105 rounded-6px",
|
|
33
|
+
preview: {
|
|
34
|
+
cover: /* @__PURE__ */ e("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ e("div", { className: "text-white text-14px", children: "点击查看" }) })
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
) }) }, a))
|
|
38
|
+
}
|
|
39
|
+
) }));
|
|
40
|
+
export {
|
|
41
|
+
m as default
|
|
42
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsxs as m, Fragment as x, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as u, useRef as p, useEffect as f } from "react";
|
|
3
|
+
import { Modal as C } from "antd";
|
|
4
|
+
const R = ({ videos: c, forceSingleColumn: V = !1, source: j = "" }) => {
|
|
5
|
+
const [n, l] = u(null), [i, h] = u({}), v = p({}), s = p(null), g = () => {
|
|
6
|
+
s.current && (s.current.pause(), s.current.currentTime = 0), l(null);
|
|
7
|
+
};
|
|
8
|
+
f(() => {
|
|
9
|
+
n && s.current && s.current.play().catch(() => {
|
|
10
|
+
});
|
|
11
|
+
}, [n]);
|
|
12
|
+
const y = (t, r) => {
|
|
13
|
+
if (i[r]) return;
|
|
14
|
+
const e = document.createElement("video");
|
|
15
|
+
e.src = t, e.crossOrigin = "anonymous", e.muted = !0, e.preload = "metadata", e.onloadeddata = () => {
|
|
16
|
+
e.currentTime = 0.1;
|
|
17
|
+
}, e.onseeked = () => {
|
|
18
|
+
const o = document.createElement("canvas");
|
|
19
|
+
o.width = e.videoWidth, o.height = e.videoHeight;
|
|
20
|
+
const d = o.getContext("2d");
|
|
21
|
+
if (d) {
|
|
22
|
+
d.drawImage(e, 0, 0, o.width, o.height);
|
|
23
|
+
const w = o.toDataURL("image/jpeg", 0.8);
|
|
24
|
+
h((N) => ({ ...N, [r]: w }));
|
|
25
|
+
}
|
|
26
|
+
e.src = "";
|
|
27
|
+
}, e.onerror = () => {
|
|
28
|
+
e.src = "";
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
return f(() => {
|
|
32
|
+
c.forEach((t, r) => {
|
|
33
|
+
y(t.propertyValue, r);
|
|
34
|
+
});
|
|
35
|
+
}, [c]), /* @__PURE__ */ m(x, { children: [
|
|
36
|
+
/* @__PURE__ */ a("div", { className: "video-wraper", children: c.map((t, r) => {
|
|
37
|
+
t.propertyValue.split("/").pop();
|
|
38
|
+
const e = i[r];
|
|
39
|
+
return /* @__PURE__ */ a("div", { className: "rounded-lg overflow-hidden transition-shadow", children: /* @__PURE__ */ m("div", { className: "video-item", children: [
|
|
40
|
+
/* @__PURE__ */ a(
|
|
41
|
+
"video",
|
|
42
|
+
{
|
|
43
|
+
ref: (o) => {
|
|
44
|
+
v.current[r] = o;
|
|
45
|
+
},
|
|
46
|
+
src: t.propertyValue,
|
|
47
|
+
poster: e,
|
|
48
|
+
className: "video-item-video",
|
|
49
|
+
muted: !0,
|
|
50
|
+
playsInline: !0,
|
|
51
|
+
preload: "metadata",
|
|
52
|
+
onClick: () => l(t.propertyValue)
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
!n && /* @__PURE__ */ a("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ a(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
className: "w-8 h-8 rounded-full flex items-center justify-center cursor-pointer hover:scale-110 transition-transform",
|
|
59
|
+
onClick: () => l(t.propertyValue),
|
|
60
|
+
children: /* @__PURE__ */ a("span", { className: "w-24px h-24px i-custom-video-play inline-block" })
|
|
61
|
+
}
|
|
62
|
+
) })
|
|
63
|
+
] }) }, r);
|
|
64
|
+
}) }),
|
|
65
|
+
/* @__PURE__ */ a(
|
|
66
|
+
C,
|
|
67
|
+
{
|
|
68
|
+
open: !!n,
|
|
69
|
+
footer: null,
|
|
70
|
+
onCancel: g,
|
|
71
|
+
width: "auto",
|
|
72
|
+
centered: !0,
|
|
73
|
+
className: "video-modal",
|
|
74
|
+
wrapClassName: "modal-wrapClassName",
|
|
75
|
+
getContainer: () => document.getElementById("root"),
|
|
76
|
+
children: n && /* @__PURE__ */ a(
|
|
77
|
+
"video",
|
|
78
|
+
{
|
|
79
|
+
ref: s,
|
|
80
|
+
src: n,
|
|
81
|
+
controls: !0,
|
|
82
|
+
className: "max-w-[80vw] max-h-[80vh] mt-10px"
|
|
83
|
+
}
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
] });
|
|
88
|
+
};
|
|
89
|
+
export {
|
|
90
|
+
R as default
|
|
91
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as l, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { useState as g, useRef as y } from "react";
|
|
3
|
+
import { Row as d, Flex as h, Button as p } from "antd";
|
|
4
|
+
const j = ({ audios: m, forceSingleColumn: u = !1, source: f = "" }) => {
|
|
5
|
+
const [s, a] = g(null), n = y({}), x = (e) => {
|
|
6
|
+
var t, i;
|
|
7
|
+
if (s === e)
|
|
8
|
+
(t = n.current[e]) == null || t.pause(), a(null);
|
|
9
|
+
else {
|
|
10
|
+
if (s && ((i = n.current[s]) == null || i.pause()), a(e), !n.current[e]) {
|
|
11
|
+
const c = new Audio(e);
|
|
12
|
+
n.current[e] = c;
|
|
13
|
+
}
|
|
14
|
+
n.current[e].play(), n.current[e].onended = () => a(null);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
return /* @__PURE__ */ l(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
className: f === "qa-card" ? "grid grid-cols-1" : `grid ${u ? "grid-cols-1 gap-y-3" : "grid-cols-2 gap-x-100px gap-y-20px"}`,
|
|
21
|
+
children: m.map((e, t) => {
|
|
22
|
+
const i = e.propertyValue.split("/").pop() || "未命名音频", c = s === e.propertyValue;
|
|
23
|
+
return /* @__PURE__ */ o(d, { className: "flex items-center justify-between transition-all", justify: "space-between", align: "middle", children: [
|
|
24
|
+
/* @__PURE__ */ o(d, { className: "flex items-center min-w-0 flex-1", align: "middle", children: [
|
|
25
|
+
/* @__PURE__ */ l("div", { className: "mr-3 text-xl flex-shrink-0", children: /* @__PURE__ */ l("span", { className: "w-24px h-30px i-custom-audio inline-block" }) }),
|
|
26
|
+
/* @__PURE__ */ l("div", { className: "min-w-0", children: /* @__PURE__ */ l("div", { className: "truncate", title: i, children: i }) })
|
|
27
|
+
] }),
|
|
28
|
+
/* @__PURE__ */ o(h, { className: "flex-shrink-0 ml-3", children: [
|
|
29
|
+
/* @__PURE__ */ l(
|
|
30
|
+
p,
|
|
31
|
+
{
|
|
32
|
+
className: "px-0",
|
|
33
|
+
type: "link",
|
|
34
|
+
onClick: () => x(e.propertyValue),
|
|
35
|
+
children: c ? "暂停" : "播放"
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
/* @__PURE__ */ l(
|
|
39
|
+
p,
|
|
40
|
+
{
|
|
41
|
+
className: "px-0",
|
|
42
|
+
type: "link",
|
|
43
|
+
onClick: () => {
|
|
44
|
+
const r = document.createElement("a");
|
|
45
|
+
r.href = e.propertyValue, r.download = i, r.click();
|
|
46
|
+
},
|
|
47
|
+
children: "下载"
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
] })
|
|
51
|
+
] }, t);
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
export {
|
|
57
|
+
j as default
|
|
58
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m, useEffect as w } from "react";
|
|
3
|
+
import h from "./index.es48.js";
|
|
4
|
+
const k = ({ relations: t, kgIds: s, viewMode: a = "list", source: c = "" }) => {
|
|
5
|
+
const [d, l] = m(t);
|
|
6
|
+
w(() => {
|
|
7
|
+
t && t && l(p(t || []));
|
|
8
|
+
}, [t]);
|
|
9
|
+
const p = (e) => e.map((o) => {
|
|
10
|
+
var r;
|
|
11
|
+
const n = (r = o.content) == null ? void 0 : r.filter((f) => f.propertyKey !== "id");
|
|
12
|
+
return {
|
|
13
|
+
...o,
|
|
14
|
+
showContent: n.slice(0, 8)
|
|
15
|
+
};
|
|
16
|
+
});
|
|
17
|
+
return /* @__PURE__ */ i("div", { className: "relation-section-wraper", children: d.map((e, u) => /* @__PURE__ */ i(
|
|
18
|
+
h,
|
|
19
|
+
{
|
|
20
|
+
entity: e,
|
|
21
|
+
viewMode: a,
|
|
22
|
+
className: "shadow-none",
|
|
23
|
+
source: c,
|
|
24
|
+
onViewDetails: (o) => {
|
|
25
|
+
const n = encodeURIComponent(e.uri);
|
|
26
|
+
window.open(`#/ai-search/fulltext-detail?uri=${n}&kgId=${s}&keyword=${o.showValue}`, "_blank");
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
)) });
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
k as default
|
|
33
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsx as t, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import w from "react";
|
|
3
|
+
import { Card as f, Row as n, Button as x, Col as g, Tooltip as C } from "antd";
|
|
4
|
+
const E = ({
|
|
5
|
+
entity: l,
|
|
6
|
+
viewMode: N,
|
|
7
|
+
keyword: d = "",
|
|
8
|
+
className: v = "",
|
|
9
|
+
contentClass: b = "",
|
|
10
|
+
onViewDetails: p,
|
|
11
|
+
source: k = ""
|
|
12
|
+
}) => {
|
|
13
|
+
const h = (e, a) => {
|
|
14
|
+
if (!a || !e) return e;
|
|
15
|
+
const i = new RegExp(`(${a.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})`, "gi");
|
|
16
|
+
return e.split(i).map(
|
|
17
|
+
(r, c) => i.test(r) ? /* @__PURE__ */ t("span", { style: { color: "#E1211C", fontWeight: "bold" }, children: r }, c) : r
|
|
18
|
+
);
|
|
19
|
+
}, m = w.useMemo(() => {
|
|
20
|
+
if (!l.showContent) return [];
|
|
21
|
+
const e = (s) => (s == null ? void 0 : s.includes("简介")) || s.startsWith("http://") || s.startsWith("https://"), a = l.showContent.filter((s) => e(s.propertyKey));
|
|
22
|
+
return [...l.showContent.filter((s) => !e(s.propertyKey)), ...a];
|
|
23
|
+
}, [l.showContent]), u = (e, a) => {
|
|
24
|
+
var c;
|
|
25
|
+
const i = ((c = e.propertyValue) == null ? void 0 : c.length) > 20, s = h(e.propertyValue, d), r = /* @__PURE__ */ t(g, { span: 24, className: "detail-item-list", children: /* @__PURE__ */ o(n, { children: [
|
|
26
|
+
/* @__PURE__ */ o("span", { className: "detail-label text-#676A6C flex-shrink-0 whitespace-nowrap font-size-14px max-w-[80%] overflow-hidden text-ellipsis whitespace-nowrap", children: [
|
|
27
|
+
e.propertyKey,
|
|
28
|
+
":"
|
|
29
|
+
] }),
|
|
30
|
+
/* @__PURE__ */ t("span", { className: "detail-value text-#676A6C truncate block overflow-hidden text-ellipsis whitespace-nowrap flex-1 min-w-0 font-size-14px", children: s })
|
|
31
|
+
] }) }, a);
|
|
32
|
+
return i ? /* @__PURE__ */ t(
|
|
33
|
+
C,
|
|
34
|
+
{
|
|
35
|
+
title: e.propertyValue,
|
|
36
|
+
placement: "topLeft",
|
|
37
|
+
mouseEnterDelay: 0.3,
|
|
38
|
+
overlayClassName: "max-w-[500px] break-words",
|
|
39
|
+
children: r
|
|
40
|
+
},
|
|
41
|
+
a
|
|
42
|
+
) : r;
|
|
43
|
+
};
|
|
44
|
+
return /* @__PURE__ */ t("div", { className: "relative group", children: /* @__PURE__ */ t(
|
|
45
|
+
f,
|
|
46
|
+
{
|
|
47
|
+
className: "section-card",
|
|
48
|
+
bodyStyle: { padding: "20px 20px 4px 20px" },
|
|
49
|
+
onClick: () => p(l),
|
|
50
|
+
children: /* @__PURE__ */ o("div", { className: "flex flex-col h-full", children: [
|
|
51
|
+
/* @__PURE__ */ o(n, { className: "section-title", justify: "space-between", align: "middle", children: [
|
|
52
|
+
/* @__PURE__ */ t("div", { className: "entity-name-list", children: h(l.showValue, d) }),
|
|
53
|
+
/* @__PURE__ */ t(
|
|
54
|
+
x,
|
|
55
|
+
{
|
|
56
|
+
className: "view-details-btn",
|
|
57
|
+
children: "查看详情"
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
] }),
|
|
61
|
+
/* @__PURE__ */ o(n, { className: "flex mb-18px", children: [
|
|
62
|
+
l.showType && /* @__PURE__ */ t(n, { className: "detail-item-tag", justify: "center", align: "middle", children: l.showType }),
|
|
63
|
+
l.kg && /* @__PURE__ */ t("div", { className: "detail-item-tag1", children: l.kg })
|
|
64
|
+
] }),
|
|
65
|
+
/* @__PURE__ */ t(n, { wrap: !0, children: m.map((e, a) => u(e, a)) })
|
|
66
|
+
] })
|
|
67
|
+
}
|
|
68
|
+
) });
|
|
69
|
+
};
|
|
70
|
+
export {
|
|
71
|
+
E as default
|
|
72
|
+
};
|