@yuku123/z-cognition-component 1.0.2 → 1.0.4
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/{ConceptsPage-C8nsSzRc.js → ConceptsPage-CLEcHolu.js} +11 -10
- package/dist/{ConceptsPage-BH4lEiVn.cjs → ConceptsPage-DfloraCZ.cjs} +1 -1
- package/dist/OntologyDetailPage-BIZLIZ23.js +192 -0
- package/dist/OntologyDetailPage-CEGX8Ykd.cjs +1 -0
- package/dist/{OntologyInferPage-FoVA-toR.cjs → OntologyInferPage-Bzgd_iDk.cjs} +1 -1
- package/dist/{OntologyMaterializePage-CUPoItSa.cjs → OntologyMaterializePage-CjrmDG7j.cjs} +2 -2
- package/dist/OntologyNodesPage-CiGsZLSG.js +270 -0
- package/dist/OntologyNodesPage-Do8cnOwY.cjs +1 -0
- package/dist/{OntologyValidatePage-40ZvGGH4.cjs → OntologyValidatePage-Dqzp4hWg.cjs} +2 -2
- package/dist/{TermDetailPage-BiF5UVM5.js → TermDetailPage-CPPzVMdp.js} +20 -20
- package/dist/{TermDetailPage-DQcYkPdm.cjs → TermDetailPage-Dbl2_C80.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/ontology-graph.cjs +1 -0
- package/dist/ontology-graph.js +50 -0
- package/dist/pages.cjs +1 -1
- package/dist/pages.js +35 -35
- package/dist/use-g6-graph-2-Pr4oTs.js +1086 -0
- package/dist/use-g6-graph-B9K6IPJe.cjs +3 -0
- package/dist/z-cognition-component.css +1 -0
- package/package.json +9 -1
- package/dist/OntologyDetailPage-BnrMC9RD.cjs +0 -1
- package/dist/OntologyDetailPage-DIsWePGJ.js +0 -130
- package/dist/OntologyNodesPage-B93kbY3c.cjs +0 -1
- package/dist/OntologyNodesPage-C68cRXHu.js +0 -105
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),R=require("react-router-dom"),s=require("antd"),k=require("@ant-design/icons"),o=require("./api-D5Hgcud4.cjs"),{TextArea:O}=s.Input,A={ERROR:"red",WARNING:"orange",INFO:"blue"};function q(){const[u]=R.useSearchParams(),a=u.get("id")||"",[i,S]=n.useState("source"),[h,j]=n.useState("default"),[l,p]=n.useState(""),[g,w]=n.useState(`{
|
|
2
2
|
"individuals": [],
|
|
3
3
|
"statements": []
|
|
4
|
-
}`),[f,x]=n.useState([]),[r,d]=n.useState(null),[v,y]=n.useState(!1);n.useEffect(()=>{a&&o.ontologyApi.listSources().then(x).catch(()=>x([]))},[a]);const C=async()=>{y(!0),d(null);try{if(i==="source"){if(!l.trim()){s.message.warning("按来源校验需要指定 source");return}d(await o.ontologyApi.validateSource(a,l.trim(),h))}else d(await o.ontologyApi.validate(a,m(g)))}catch(t){s.message.error(t.message)}finally{y(!1)}},I=[{title:"级别",dataIndex:"severity",key:"severity",width:90,render:t=>e.jsx(s.Tag,{color:A[t]||"default",children:t})},{title:"编码",dataIndex:"code",key:"code",width:160},{title:"主体",dataIndex:"subject",key:"subject",width:160},{title:"谓词",dataIndex:"predicate",key:"predicate",width:140},{title:"说明",dataIndex:"message",key:"message"}];if(!a)return e.jsx(s.Alert,{type:"warning",message:"缺少本体 ID(?id=xxx)"});const c=(r==null?void 0:r.issues)||[];return e.jsxs(s.Spin,{spinning:v,children:[e.jsx(s.Card,{size:"small",style:{marginBottom:16},children:e.jsxs(s.Space,{direction:"vertical",style:{width:"100%"},size:12,children:[e.jsxs(s.Space,{wrap:!0,children:[e.jsx(s.Select,{style:{width:180},value:i,onChange:S,options:[{value:"source",label:"按来源校验"},{value:"inline",label:"内联快照校验"}]}),e.jsx(s.Input,{style:{width:220},placeholder:"工作空间",value:h,onChange:t=>j(t.target.value)}),i==="source"?e.jsx(s.Select,{style:{width:280},placeholder:"选择或输入数据源",value:l||void 0,onChange:p,showSearch:!0,options:f.map(t=>({value:t.id,label:t.description?`${t.id} — ${t.description}`:t.id})),notFoundContent:null}):null,e.jsx(s.Button,{type:"primary",icon:e.jsx(
|
|
4
|
+
}`),[f,x]=n.useState([]),[r,d]=n.useState(null),[v,y]=n.useState(!1);n.useEffect(()=>{a&&o.ontologyApi.listSources().then(x).catch(()=>x([]))},[a]);const C=async()=>{y(!0),d(null);try{if(i==="source"){if(!l.trim()){s.message.warning("按来源校验需要指定 source");return}d(await o.ontologyApi.validateSource(a,l.trim(),h))}else d(await o.ontologyApi.validate(a,m(g)))}catch(t){s.message.error(t.message)}finally{y(!1)}},I=[{title:"级别",dataIndex:"severity",key:"severity",width:90,render:t=>e.jsx(s.Tag,{color:A[t]||"default",children:t})},{title:"编码",dataIndex:"code",key:"code",width:160},{title:"主体",dataIndex:"subject",key:"subject",width:160},{title:"谓词",dataIndex:"predicate",key:"predicate",width:140},{title:"说明",dataIndex:"message",key:"message"}];if(!a)return e.jsx(s.Alert,{type:"warning",message:"缺少本体 ID(?id=xxx)"});const c=(r==null?void 0:r.issues)||[];return e.jsxs(s.Spin,{spinning:v,children:[e.jsx(s.Card,{size:"small",style:{marginBottom:16},children:e.jsxs(s.Space,{direction:"vertical",style:{width:"100%"},size:12,children:[e.jsxs(s.Space,{wrap:!0,children:[e.jsx(s.Select,{style:{width:180},value:i,onChange:S,options:[{value:"source",label:"按来源校验"},{value:"inline",label:"内联快照校验"}]}),e.jsx(s.Input,{style:{width:220},placeholder:"工作空间",value:h,onChange:t=>j(t.target.value)}),i==="source"?e.jsx(s.Select,{style:{width:280},placeholder:"选择或输入数据源",value:l||void 0,onChange:p,showSearch:!0,options:f.map(t=>({value:t.id,label:t.description?`${t.id} — ${t.description}`:t.id})),notFoundContent:null}):null,e.jsx(s.Button,{type:"primary",icon:e.jsx(k.CheckCircleOutlined,{}),onClick:C,children:"执行校验"})]}),i==="source"?e.jsx(s.Input,{style:{width:420},placeholder:"source ID(可直接输入)",value:l,onChange:t=>p(t.target.value)}):e.jsx(O,{rows:10,value:g,onChange:t=>w(t.target.value),placeholder:'{"individuals": [], "statements": []}'})]})}),r?e.jsxs(s.Card,{size:"small",title:`校验结果(${c.length} 条问题)`,children:[e.jsxs(s.Space,{size:"large",wrap:!0,style:{marginBottom:c.length?12:0},children:[e.jsxs("span",{children:["错误 ",e.jsx("b",{children:o.field(r,"errorCount","error_count")})]}),e.jsxs("span",{children:["警告 ",e.jsx("b",{children:o.field(r,"warningCount","warning_count")})]}),e.jsxs("span",{children:["提示 ",e.jsx("b",{children:o.field(r,"infoCount","info_count")})]})]}),c.length===0?e.jsx(s.Alert,{type:"success",message:"校验通过,未发现问题"}):e.jsx(s.Table,{rowKey:(t,b)=>`${t.code}-${b}`,size:"small",columns:I,dataSource:c,pagination:!1})]}):null]})}function m(u){try{return JSON.parse(u)}catch(a){throw new Error(`快照不是合法 JSON:${a.message}`)}}exports.default=q;exports.parseSnapshot=m;
|
|
@@ -2,15 +2,15 @@ import { jsx as e, jsxs as o, Fragment as te } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as a, useCallback as ie, useEffect as ne } from "react";
|
|
3
3
|
import { useSearchParams as le, useNavigate as re } from "react-router-dom";
|
|
4
4
|
import { Input as d, Form as l, Alert as D, Spin as ae, Space as F, Button as p, Select as g, Descriptions as s, Typography as f, Tag as z, Table as x, Popconfirm as se, Modal as L, message as m } from "antd";
|
|
5
|
-
import { ArrowLeftOutlined as oe, ReloadOutlined as de, EditOutlined as ce, DiffOutlined as me
|
|
5
|
+
import { ArrowLeftOutlined as oe, ReloadOutlined as de, EditOutlined as ce, DiffOutlined as me } from "@ant-design/icons";
|
|
6
6
|
import { cognitionApi as u } from "./api.js";
|
|
7
|
-
import { S as
|
|
8
|
-
const { TextArea:
|
|
9
|
-
function
|
|
10
|
-
const [P] = le(), q = re(), r = P.get("key") || "", [i, j] = a(null), [S, H] = a([]), [E, _] = a([]), [M, $] = a(!0), [
|
|
7
|
+
import { S as ue, T as he, a as pe, t as fe } from "./EvidenceFormList-097ICr7D.js";
|
|
8
|
+
const { TextArea: ge } = d;
|
|
9
|
+
function Se() {
|
|
10
|
+
const [P] = le(), q = re(), r = P.get("key") || "", [i, j] = a(null), [S, H] = a([]), [E, _] = a([]), [M, $] = a(!0), [k, O] = a(""), [U, y] = a(!1), [V, C] = a(!1), [w] = l.useForm(), [v, A] = a(null), [I, N] = a(null), [G, K] = a(!1), [c, J] = a(null), h = ie(async () => {
|
|
11
11
|
var t, n;
|
|
12
12
|
if (r) {
|
|
13
|
-
$(!0),
|
|
13
|
+
$(!0), O("");
|
|
14
14
|
try {
|
|
15
15
|
const [b, Z, T] = await Promise.all([
|
|
16
16
|
u.getTerm(r),
|
|
@@ -21,7 +21,7 @@ function Ee() {
|
|
|
21
21
|
const B = (t = (T || [])[0]) == null ? void 0 : t.revisionNo, ee = (n = (T || [])[1]) == null ? void 0 : n.revisionNo;
|
|
22
22
|
N(B ?? null), A(ee ?? B ?? null);
|
|
23
23
|
} catch (b) {
|
|
24
|
-
|
|
24
|
+
O(b.message);
|
|
25
25
|
} finally {
|
|
26
26
|
$(!1);
|
|
27
27
|
}
|
|
@@ -35,7 +35,7 @@ function Ee() {
|
|
|
35
35
|
w.setFieldsValue({
|
|
36
36
|
...i,
|
|
37
37
|
aliases: i.aliases || [],
|
|
38
|
-
evidences:
|
|
38
|
+
evidences: fe(S)
|
|
39
39
|
}), y(!0);
|
|
40
40
|
}, W = async () => {
|
|
41
41
|
const t = await w.validateFields();
|
|
@@ -64,11 +64,11 @@ function Ee() {
|
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
66
|
try {
|
|
67
|
-
J(await u.diffTerm(r, v, I)),
|
|
67
|
+
J(await u.diffTerm(r, v, I)), K(!0);
|
|
68
68
|
} catch (t) {
|
|
69
69
|
m.error(t.message);
|
|
70
70
|
}
|
|
71
|
-
},
|
|
71
|
+
}, R = E.map((t) => ({
|
|
72
72
|
value: t.revisionNo,
|
|
73
73
|
label: `r${t.revisionNo} · ${t.createdAt} · ${t.actor || "-"} · ${t.note || ""}`
|
|
74
74
|
}));
|
|
@@ -77,17 +77,17 @@ function Ee() {
|
|
|
77
77
|
/* @__PURE__ */ e(p, { icon: /* @__PURE__ */ e(oe, {}), onClick: () => q("/cognition/terms"), children: "返回列表" }),
|
|
78
78
|
/* @__PURE__ */ e(p, { icon: /* @__PURE__ */ e(de, {}), onClick: h, children: "刷新" }),
|
|
79
79
|
/* @__PURE__ */ e(p, { type: "primary", icon: /* @__PURE__ */ e(ce, {}), disabled: !i, onClick: Q, children: "编辑(生成新版本)" }),
|
|
80
|
-
/* @__PURE__ */ e(g, { style: { width: 300 }, placeholder: "left", value: v, onChange: A, options:
|
|
81
|
-
/* @__PURE__ */ e(g, { style: { width: 300 }, placeholder: "right", value: I, onChange: N, options:
|
|
80
|
+
/* @__PURE__ */ e(g, { style: { width: 300 }, placeholder: "left", value: v, onChange: A, options: R }),
|
|
81
|
+
/* @__PURE__ */ e(g, { style: { width: 300 }, placeholder: "right", value: I, onChange: N, options: R }),
|
|
82
82
|
/* @__PURE__ */ e(p, { icon: /* @__PURE__ */ e(me, {}), onClick: Y, children: "版本对比" })
|
|
83
83
|
] }),
|
|
84
|
-
|
|
84
|
+
k ? /* @__PURE__ */ e(D, { type: "error", showIcon: !0, message: k, style: { marginBottom: 16 } }) : null,
|
|
85
85
|
i ? /* @__PURE__ */ o(te, { children: [
|
|
86
86
|
/* @__PURE__ */ o(s, { bordered: !0, size: "small", column: 2, style: { marginBottom: 16 }, children: [
|
|
87
87
|
/* @__PURE__ */ e(s.Item, { label: "termKey", children: /* @__PURE__ */ e(f.Text, { code: !0, children: i.termKey }) }),
|
|
88
88
|
/* @__PURE__ */ e(s.Item, { label: "规范名", children: i.canonical }),
|
|
89
89
|
/* @__PURE__ */ o(s.Item, { label: "状态", children: [
|
|
90
|
-
/* @__PURE__ */ e(z, { color:
|
|
90
|
+
/* @__PURE__ */ e(z, { color: ue[i.status] || "blue", children: i.status }),
|
|
91
91
|
i.supersededBy ? /* @__PURE__ */ o("span", { children: [
|
|
92
92
|
"→ ",
|
|
93
93
|
i.supersededBy
|
|
@@ -148,7 +148,7 @@ function Ee() {
|
|
|
148
148
|
title: `回滚到 r${n.revisionNo}?`,
|
|
149
149
|
description: "会以该版本内容生成一条新的 revision",
|
|
150
150
|
onConfirm: () => X(n.revisionNo),
|
|
151
|
-
children: /* @__PURE__ */ e(p, {
|
|
151
|
+
children: /* @__PURE__ */ e(p, { type: "link", size: "small", children: "回滚" })
|
|
152
152
|
}
|
|
153
153
|
)
|
|
154
154
|
}
|
|
@@ -169,7 +169,7 @@ function Ee() {
|
|
|
169
169
|
children: /* @__PURE__ */ o(l, { form: w, layout: "vertical", children: [
|
|
170
170
|
/* @__PURE__ */ o(F, { size: "large", wrap: !0, children: [
|
|
171
171
|
/* @__PURE__ */ e(l.Item, { name: "canonical", label: "规范名", rules: [{ required: !0, message: "必填" }], children: /* @__PURE__ */ e(d, { style: { width: 240 } }) }),
|
|
172
|
-
/* @__PURE__ */ e(l.Item, { name: "status", label: "状态", rules: [{ required: !0 }], children: /* @__PURE__ */ e(g, { style: { width: 140 }, options:
|
|
172
|
+
/* @__PURE__ */ e(l.Item, { name: "status", label: "状态", rules: [{ required: !0 }], children: /* @__PURE__ */ e(g, { style: { width: 140 }, options: he.map((t) => ({ value: t, label: t })) }) }),
|
|
173
173
|
/* @__PURE__ */ e(l.Item, { name: "supersededBy", label: "替代项(DEPRECATED 必填)", children: /* @__PURE__ */ e(d, { style: { width: 180 } }) }),
|
|
174
174
|
/* @__PURE__ */ e(l.Item, { name: "domain", label: "域", children: /* @__PURE__ */ e(d, { style: { width: 140 } }) }),
|
|
175
175
|
/* @__PURE__ */ e(l.Item, { name: "owner", label: "owner", children: /* @__PURE__ */ e(d, { style: { width: 140 } }) })
|
|
@@ -182,11 +182,11 @@ function Ee() {
|
|
|
182
182
|
name: "definition",
|
|
183
183
|
label: "定义",
|
|
184
184
|
rules: [{ required: !0, message: "必填" }],
|
|
185
|
-
children: /* @__PURE__ */ e(
|
|
185
|
+
children: /* @__PURE__ */ e(ge, { rows: 3 })
|
|
186
186
|
}
|
|
187
187
|
),
|
|
188
188
|
/* @__PURE__ */ e(l.Item, { name: "note", label: "变更说明", children: /* @__PURE__ */ e(d, { placeholder: "console update" }) }),
|
|
189
|
-
/* @__PURE__ */ e(l.Item, { label: "证据(至少一条;本次提交即本版本证据)", required: !0, children: /* @__PURE__ */ e(
|
|
189
|
+
/* @__PURE__ */ e(l.Item, { label: "证据(至少一条;本次提交即本版本证据)", required: !0, children: /* @__PURE__ */ e(pe, {}) })
|
|
190
190
|
] })
|
|
191
191
|
}
|
|
192
192
|
),
|
|
@@ -195,7 +195,7 @@ function Ee() {
|
|
|
195
195
|
{
|
|
196
196
|
title: c ? `${c.subjectKey}: r${c.leftRevision} → r${c.rightRevision}` : "版本对比",
|
|
197
197
|
open: G,
|
|
198
|
-
onCancel: () =>
|
|
198
|
+
onCancel: () => K(!1),
|
|
199
199
|
footer: null,
|
|
200
200
|
width: 720,
|
|
201
201
|
children: /* @__PURE__ */ e(
|
|
@@ -217,5 +217,5 @@ function Ee() {
|
|
|
217
217
|
] });
|
|
218
218
|
}
|
|
219
219
|
export {
|
|
220
|
-
|
|
220
|
+
Se as default
|
|
221
221
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),E=require("react-router-dom"),t=require("antd"),d=require("@ant-design/icons"),o=require("./api.cjs"),u=require("./EvidenceFormList-CQNgMNCG.cjs"),{TextArea:V}=t.Input;function G(){const[
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),E=require("react-router-dom"),t=require("antd"),d=require("@ant-design/icons"),o=require("./api.cjs"),u=require("./EvidenceFormList-CQNgMNCG.cjs"),{TextArea:V}=t.Input;function G(){const[$]=E.useSearchParams(),O=E.useNavigate(),l=$.get("key")||"",[i,k]=n.useState(null),[y,B]=n.useState([]),[f,C]=n.useState([]),[R,I]=n.useState(!0),[v,w]=n.useState(""),[q,m]=n.useState(!1),[N,b]=n.useState(!1),[h]=t.Form.useForm(),[p,T]=n.useState(null),[x,S]=n.useState(null),[K,D]=n.useState(!1),[a,L]=n.useState(null),c=n.useCallback(async()=>{var s,r;if(l){I(!0),w("");try{const[j,_,g]=await Promise.all([o.cognitionApi.getTerm(l),o.cognitionApi.listTermEvidence(l),o.cognitionApi.listTermRevisions(l)]);k(j),B(_||[]),C(g||[]);const A=(s=(g||[])[0])==null?void 0:s.revisionNo,U=(r=(g||[])[1])==null?void 0:r.revisionNo;S(A??null),T(U??A??null)}catch(j){w(j.message)}finally{I(!1)}}},[l]);if(n.useEffect(()=>{c()},[c]),!l)return e.jsx(t.Alert,{type:"warning",showIcon:!0,message:"缺少 ?key= 参数"});const z=()=>{h.setFieldsValue({...i,aliases:i.aliases||[],evidences:u.toEvidenceFormValues(y)}),m(!0)},P=async()=>{const s=await h.validateFields();b(!0);try{await o.cognitionApi.updateTerm(l,{...s,termKey:l,actor:s.actor||"console",note:s.note||"console update"}),t.message.success("已生成新 revision"),m(!1),await c()}catch(r){t.message.error(r.field?`${r.field}: ${r.message}`:r.message)}finally{b(!1)}},M=async s=>{try{await o.cognitionApi.rollbackTerm(l,s,`console rollback to r${s}`),t.message.success(`已回滚到 r${s}(生成新 revision,历史不改写)`),await c()}catch(r){t.message.error(r.message)}},H=async()=>{if(p==null||x==null){t.message.warning("先选两个 revision");return}try{L(await o.cognitionApi.diffTerm(l,p,x)),D(!0)}catch(s){t.message.error(s.message)}},F=f.map(s=>({value:s.revisionNo,label:`r${s.revisionNo} · ${s.createdAt} · ${s.actor||"-"} · ${s.note||""}`}));return e.jsxs(t.Spin,{spinning:R,children:[e.jsxs(t.Space,{style:{marginBottom:16},wrap:!0,children:[e.jsx(t.Button,{icon:e.jsx(d.ArrowLeftOutlined,{}),onClick:()=>O("/cognition/terms"),children:"返回列表"}),e.jsx(t.Button,{icon:e.jsx(d.ReloadOutlined,{}),onClick:c,children:"刷新"}),e.jsx(t.Button,{type:"primary",icon:e.jsx(d.EditOutlined,{}),disabled:!i,onClick:z,children:"编辑(生成新版本)"}),e.jsx(t.Select,{style:{width:300},placeholder:"left",value:p,onChange:T,options:F}),e.jsx(t.Select,{style:{width:300},placeholder:"right",value:x,onChange:S,options:F}),e.jsx(t.Button,{icon:e.jsx(d.DiffOutlined,{}),onClick:H,children:"版本对比"})]}),v?e.jsx(t.Alert,{type:"error",showIcon:!0,message:v,style:{marginBottom:16}}):null,i?e.jsxs(e.Fragment,{children:[e.jsxs(t.Descriptions,{bordered:!0,size:"small",column:2,style:{marginBottom:16},children:[e.jsx(t.Descriptions.Item,{label:"termKey",children:e.jsx(t.Typography.Text,{code:!0,children:i.termKey})}),e.jsx(t.Descriptions.Item,{label:"规范名",children:i.canonical}),e.jsxs(t.Descriptions.Item,{label:"状态",children:[e.jsx(t.Tag,{color:u.STATUS_COLOR[i.status]||"blue",children:i.status}),i.supersededBy?e.jsxs("span",{children:["→ ",i.supersededBy]}):null]}),e.jsxs(t.Descriptions.Item,{label:"当前版本",children:["r",i.revisionNo]}),e.jsx(t.Descriptions.Item,{label:"域",children:i.domain||"—"}),e.jsx(t.Descriptions.Item,{label:"owner",children:i.owner||"—"}),e.jsx(t.Descriptions.Item,{label:"绑定概念",children:i.conceptKey||"—"}),e.jsx(t.Descriptions.Item,{label:"更新时间",children:i.updatedAt}),e.jsx(t.Descriptions.Item,{label:"别名",span:2,children:(i.aliases||[]).length?i.aliases.map(s=>e.jsx(t.Tag,{children:s},s)):"—"}),e.jsx(t.Descriptions.Item,{label:"定义",span:2,children:i.definition})]}),e.jsxs(t.Typography.Title,{level:5,children:["证据(当前版本 r",i.revisionNo,")"]}),e.jsx(t.Table,{rowKey:"id",size:"small",style:{marginBottom:24},dataSource:y,pagination:!1,columns:[{title:"类型",dataIndex:"evidenceType",width:140},{title:"refId",dataIndex:"refId"},{title:"snapshotHash",dataIndex:"snapshotHash",width:200},{title:"版本",dataIndex:"revisionNo",width:80,render:s=>`r${s}`},{title:"采集时间",dataIndex:"capturedAt",width:190}]}),e.jsx(t.Typography.Title,{level:5,children:"版本历史(回滚不改写历史,只追加新 revision)"}),e.jsx(t.Table,{rowKey:"revisionNo",size:"small",dataSource:f,pagination:!1,columns:[{title:"版本",dataIndex:"revisionNo",width:80,render:s=>`r${s}`},{title:"时间",dataIndex:"createdAt",width:190},{title:"操作人",dataIndex:"actor",width:140},{title:"说明",dataIndex:"note"},{title:"操作",width:120,render:(s,r)=>e.jsx(t.Popconfirm,{title:`回滚到 r${r.revisionNo}?`,description:"会以该版本内容生成一条新的 revision",onConfirm:()=>M(r.revisionNo),children:e.jsx(t.Button,{type:"link",size:"small",children:"回滚"})})}]})]}):null,e.jsx(t.Modal,{title:`编辑 ${l}`,open:q,onCancel:()=>m(!1),onOk:P,confirmLoading:N,width:820,destroyOnHidden:!0,children:e.jsxs(t.Form,{form:h,layout:"vertical",children:[e.jsxs(t.Space,{size:"large",wrap:!0,children:[e.jsx(t.Form.Item,{name:"canonical",label:"规范名",rules:[{required:!0,message:"必填"}],children:e.jsx(t.Input,{style:{width:240}})}),e.jsx(t.Form.Item,{name:"status",label:"状态",rules:[{required:!0}],children:e.jsx(t.Select,{style:{width:140},options:u.TERM_STATUSES.map(s=>({value:s,label:s}))})}),e.jsx(t.Form.Item,{name:"supersededBy",label:"替代项(DEPRECATED 必填)",children:e.jsx(t.Input,{style:{width:180}})}),e.jsx(t.Form.Item,{name:"domain",label:"域",children:e.jsx(t.Input,{style:{width:140}})}),e.jsx(t.Form.Item,{name:"owner",label:"owner",children:e.jsx(t.Input,{style:{width:140}})})]}),e.jsx(t.Form.Item,{name:"aliases",label:"别名",children:e.jsx(t.Select,{mode:"tags",tokenSeparators:[","]})}),e.jsx(t.Form.Item,{name:"conceptKey",label:"绑定概念",children:e.jsx(t.Input,{})}),e.jsx(t.Form.Item,{name:"definition",label:"定义",rules:[{required:!0,message:"必填"}],children:e.jsx(V,{rows:3})}),e.jsx(t.Form.Item,{name:"note",label:"变更说明",children:e.jsx(t.Input,{placeholder:"console update"})}),e.jsx(t.Form.Item,{label:"证据(至少一条;本次提交即本版本证据)",required:!0,children:e.jsx(u.EvidenceFormList,{})})]})}),e.jsx(t.Modal,{title:a?`${a.subjectKey}: r${a.leftRevision} → r${a.rightRevision}`:"版本对比",open:K,onCancel:()=>D(!1),footer:null,width:720,children:e.jsx(t.Table,{rowKey:s=>s.field,size:"small",pagination:!1,dataSource:a?a.changes:[],columns:[{title:"字段",dataIndex:"field",width:140},{title:"左",dataIndex:"left",render:s=>e.jsx(t.Typography.Text,{delete:s!=="",children:s??"—"})},{title:"右",dataIndex:"right",render:s=>e.jsx(t.Typography.Text,{strong:!0,children:s??"—"})}]})})]})}exports.default=G;
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./api.cjs"),t=require("./EvidenceFormList-CQNgMNCG.cjs"),r=require("./TermsPage-CE3E3fG-.cjs"),T=require("./TermDetailPage-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./api.cjs"),t=require("./EvidenceFormList-CQNgMNCG.cjs"),r=require("./TermsPage-CE3E3fG-.cjs"),T=require("./TermDetailPage-Dbl2_C80.cjs"),o=require("./ConceptsPage-DfloraCZ.cjs"),E=require("./ResolvePage-BDb56PdI.cjs"),a=require("./ImpactPage-BMvZUgTJ.cjs"),i=require("./DocsPage-CmGTg0A3.cjs");exports.ApiError=e.ApiError;exports.TOKEN_KEY=e.TOKEN_KEY;exports.cognitionApi=e.cognitionApi;exports.getToken=e.getToken;exports.setToken=e.setToken;exports.CONCEPT_TYPES=t.CONCEPT_TYPES;exports.EVIDENCE_TYPES=t.EVIDENCE_TYPES;exports.KEY_PATTERN=t.KEY_PATTERN;exports.STATUS_COLOR=t.STATUS_COLOR;exports.TERM_STATUSES=t.TERM_STATUSES;exports.TermsPage=r.default;exports.TermDetailPage=T.default;exports.ConceptsPage=o.default;exports.ResolvePage=E.default;exports.ImpactPage=a.default;exports.DocsPage=i.default;
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ApiError as o, TOKEN_KEY as r, cognitionApi as t, getToken as s, setToken as T } from "./api.js";
|
|
2
2
|
import { C as E, E as p, K as m, S as P, T as g } from "./EvidenceFormList-097ICr7D.js";
|
|
3
3
|
import { default as x } from "./TermsPage-BJWfX1hw.js";
|
|
4
|
-
import { default as d } from "./TermDetailPage-
|
|
5
|
-
import { default as C } from "./ConceptsPage-
|
|
4
|
+
import { default as d } from "./TermDetailPage-CPPzVMdp.js";
|
|
5
|
+
import { default as C } from "./ConceptsPage-CLEcHolu.js";
|
|
6
6
|
import { default as i } from "./ResolvePage-CmrRVFkA.js";
|
|
7
7
|
import { default as A } from "./ImpactPage-BiajQqHA.js";
|
|
8
8
|
import { default as K } from "./DocsPage-DNkkd9Sm.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./use-g6-graph-B9K6IPJe.cjs"),h=1,m=3;function E(o){return Number.isFinite(o)?Math.min(m,Math.max(h,Math.round(o))):h}function _(o,t,c){return`${t}|${o}|${c}`}function d({roots:o,hops:t,direction:c,edges:u}){if(!o.length)return{tags:[],edgeKeys:[]};const e=new Set(o),T=E(t);let s=new Set(o);for(let n=0;n<T;n+=1){const i=new Set;if(u.forEach(r=>{if(!r.srcTag||!r.dstTag)return;const O=(c==="out"||c==="both")&&s.has(r.srcTag),f=(c==="in"||c==="both")&&s.has(r.dstTag);!O&&!f||(O&&!e.has(r.dstTag)&&(e.add(r.dstTag),i.add(r.dstTag)),f&&!e.has(r.srcTag)&&(e.add(r.srcTag),i.add(r.srcTag)))}),!i.size)break;s=i}const S=new Set;return u.forEach(n=>{!n.srcTag||!n.dstTag||e.has(n.srcTag)&&e.has(n.dstTag)&&S.add(_(n.edgeName,n.srcTag,n.dstTag))}),{tags:[...e].sort(),edgeKeys:[...S].sort()}}function g(o,t){const c=Math.min(t.x1,t.x2),u=Math.max(t.x1,t.x2),e=Math.min(t.y1,t.y2),T=Math.max(t.y1,t.y2);return Object.entries(o).filter(([,s])=>s.x>=c&&s.x<=u&&s.y>=e&&s.y<=T).map(([s])=>s).sort()}exports.GRAPH_BEHAVIORS=a.GRAPH_BEHAVIORS;exports.NODE_FILL=a.NODE_FILL;exports.NODE_STROKE=a.NODE_STROKE;exports.STATE_STYLES=a.STATE_STYLES;exports.UNCATEGORIZED_CAT_CODE=a.UNCATEGORIZED_CAT_CODE;exports.buildCategoryColorMap=a.buildCategoryColorMap;exports.computeForceLayout=a.computeForceLayout;exports.createLiveSimulation=a.createLiveSimulation;exports.toG6Data=a.toG6Data;exports.toInstanceG6Data=a.toInstanceG6Data;exports.useG6Graph=a.useG6Graph;exports.FOCUS_HOPS_MAX=m;exports.FOCUS_HOPS_MIN=h;exports.clampHops=E;exports.computeFocusNeighborhood=d;exports.edgeKeyOf=_;exports.nodesInRect=g;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { G as b, N as M, a as _, S as l, U as p, b as N, c as C, d as G, t as w, e as A, u as D } from "./use-g6-graph-2-Pr4oTs.js";
|
|
2
|
+
const m = 1, S = 3;
|
|
3
|
+
function d(t) {
|
|
4
|
+
return Number.isFinite(t) ? Math.min(S, Math.max(m, Math.round(t))) : m;
|
|
5
|
+
}
|
|
6
|
+
function g(t, a, c) {
|
|
7
|
+
return `${a}|${t}|${c}`;
|
|
8
|
+
}
|
|
9
|
+
function x({ roots: t, hops: a, direction: c, edges: u }) {
|
|
10
|
+
if (!t.length)
|
|
11
|
+
return { tags: [], edgeKeys: [] };
|
|
12
|
+
const r = new Set(t), h = d(a);
|
|
13
|
+
let s = new Set(t);
|
|
14
|
+
for (let n = 0; n < h; n += 1) {
|
|
15
|
+
const f = /* @__PURE__ */ new Set();
|
|
16
|
+
if (u.forEach((o) => {
|
|
17
|
+
if (!o.srcTag || !o.dstTag) return;
|
|
18
|
+
const i = (c === "out" || c === "both") && s.has(o.srcTag), e = (c === "in" || c === "both") && s.has(o.dstTag);
|
|
19
|
+
!i && !e || (i && !r.has(o.dstTag) && (r.add(o.dstTag), f.add(o.dstTag)), e && !r.has(o.srcTag) && (r.add(o.srcTag), f.add(o.srcTag)));
|
|
20
|
+
}), !f.size) break;
|
|
21
|
+
s = f;
|
|
22
|
+
}
|
|
23
|
+
const T = /* @__PURE__ */ new Set();
|
|
24
|
+
return u.forEach((n) => {
|
|
25
|
+
!n.srcTag || !n.dstTag || r.has(n.srcTag) && r.has(n.dstTag) && T.add(g(n.edgeName, n.srcTag, n.dstTag));
|
|
26
|
+
}), { tags: [...r].sort(), edgeKeys: [...T].sort() };
|
|
27
|
+
}
|
|
28
|
+
function y(t, a) {
|
|
29
|
+
const c = Math.min(a.x1, a.x2), u = Math.max(a.x1, a.x2), r = Math.min(a.y1, a.y2), h = Math.max(a.y1, a.y2);
|
|
30
|
+
return Object.entries(t).filter(([, s]) => s.x >= c && s.x <= u && s.y >= r && s.y <= h).map(([s]) => s).sort();
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
S as FOCUS_HOPS_MAX,
|
|
34
|
+
m as FOCUS_HOPS_MIN,
|
|
35
|
+
b as GRAPH_BEHAVIORS,
|
|
36
|
+
M as NODE_FILL,
|
|
37
|
+
_ as NODE_STROKE,
|
|
38
|
+
l as STATE_STYLES,
|
|
39
|
+
p as UNCATEGORIZED_CAT_CODE,
|
|
40
|
+
N as buildCategoryColorMap,
|
|
41
|
+
d as clampHops,
|
|
42
|
+
x as computeFocusNeighborhood,
|
|
43
|
+
C as computeForceLayout,
|
|
44
|
+
G as createLiveSimulation,
|
|
45
|
+
g as edgeKeyOf,
|
|
46
|
+
y as nodesInRect,
|
|
47
|
+
w as toG6Data,
|
|
48
|
+
A as toInstanceG6Data,
|
|
49
|
+
D as useG6Graph
|
|
50
|
+
};
|
package/dist/pages.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),o=require("@ant-design/icons"),s=t.lazy(()=>Promise.resolve().then(()=>require("./TermsPage-CE3E3fG-.cjs"))),l=t.lazy(()=>Promise.resolve().then(()=>require("./TermDetailPage-Dbl2_C80.cjs"))),a=t.lazy(()=>Promise.resolve().then(()=>require("./ConceptsPage-DfloraCZ.cjs"))),r=t.lazy(()=>Promise.resolve().then(()=>require("./ResolvePage-BDb56PdI.cjs"))),c=t.lazy(()=>Promise.resolve().then(()=>require("./ImpactPage-BMvZUgTJ.cjs"))),m=t.lazy(()=>Promise.resolve().then(()=>require("./DocsPage-CmGTg0A3.cjs"))),g=t.lazy(()=>Promise.resolve().then(()=>require("./OntologyListPage-ClYfQsCI.cjs"))),y=t.lazy(()=>Promise.resolve().then(()=>require("./OntologyDetailPage-CEGX8Ykd.cjs"))),u=t.lazy(()=>Promise.resolve().then(()=>require("./OntologyNodesPage-Do8cnOwY.cjs"))),d=t.lazy(()=>Promise.resolve().then(()=>require("./OntologyValidatePage-Dqzp4hWg.cjs"))),p=t.lazy(()=>Promise.resolve().then(()=>require("./OntologyInferPage-Bzgd_iDk.cjs"))),h=t.lazy(()=>Promise.resolve().then(()=>require("./OntologyMaterializePage-CjrmDG7j.cjs"))),P={title:"z-cognition 业务认知域",short:"z-cognition"},n=[{key:"/ontology/schemas",label:"本体列表",icon:e.jsx(o.ApartmentOutlined,{}),desc:"注册 / 查询 / 删除 schema"},{key:"/ontology/detail",label:"本体详情",icon:e.jsx(o.ReadOutlined,{}),desc:"类定义 / 属性 / 统计"},{key:"/ontology/nodes",label:"类与实例",icon:e.jsx(o.PartitionOutlined,{}),desc:"图侧节点浏览"},{key:"/ontology/validate",label:"校验",icon:e.jsx(o.CheckCircleOutlined,{}),desc:"来源 / 快照两套口径"},{key:"/ontology/infer",label:"推理",icon:e.jsx(o.ThunderboltOutlined,{}),desc:"隐含类型与陈述"},{key:"/ontology/materialize",label:"物化",icon:e.jsx(o.DatabaseOutlined,{}),desc:"落成图节点与边"}],i=[{key:"/cognition/terms",label:"术语",icon:e.jsx(o.TagsOutlined,{}),desc:"登记 / 版本 / 回滚"},{key:"/cognition/concepts",label:"概念",icon:e.jsx(o.PartitionOutlined,{}),desc:"六类概念与父子关系"},{key:"/cognition/resolve",label:"消歧",icon:e.jsx(o.SearchOutlined,{}),desc:"词 → 术语 + 证据"},{key:"/cognition/impact",label:"影响面",icon:e.jsx(o.BranchesOutlined,{}),desc:"改之前先看谁引用"},{key:"/cognition/docs",label:"说明",icon:e.jsx(o.ReadOutlined,{}),desc:"能力与 API 清单"}],O=[{title:"本体管理",icon:e.jsx(o.ApartmentOutlined,{}),items:n},{title:"业务认知",icon:e.jsx(o.BulbOutlined,{}),items:i}],v=[{path:"/cognition/terms",Component:s},{path:"/cognition/terms/detail",Component:l},{path:"/cognition/concepts",Component:a},{path:"/cognition/resolve",Component:r},{path:"/cognition/impact",Component:c},{path:"/cognition/docs",Component:m},{path:"/ontology/schemas",Component:g},{path:"/ontology/detail",Component:y},{path:"/ontology/nodes",Component:u},{path:"/ontology/validate",Component:d},{path:"/ontology/infer",Component:p},{path:"/ontology/materialize",Component:h}];exports.appMeta=P;exports.menuItems=i;exports.menuSections=O;exports.ontologyMenuItems=n;exports.routes=v;
|
package/dist/pages.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { lazy as
|
|
3
|
-
import { TagsOutlined as
|
|
4
|
-
const
|
|
5
|
-
{ key: "/ontology/schemas", label: "本体列表", icon: /* @__PURE__ */
|
|
6
|
-
{ key: "/ontology/detail", label: "本体详情", icon: /* @__PURE__ */
|
|
7
|
-
{ key: "/ontology/nodes", label: "类与实例", icon: /* @__PURE__ */
|
|
8
|
-
{ key: "/ontology/validate", label: "校验", icon: /* @__PURE__ */
|
|
9
|
-
{ key: "/ontology/infer", label: "推理", icon: /* @__PURE__ */
|
|
10
|
-
{ key: "/ontology/materialize", label: "物化", icon: /* @__PURE__ */
|
|
11
|
-
],
|
|
12
|
-
{ key: "/cognition/terms", label: "术语", icon: /* @__PURE__ */
|
|
13
|
-
{ key: "/cognition/concepts", label: "概念", icon: /* @__PURE__ */
|
|
14
|
-
{ key: "/cognition/resolve", label: "消歧", icon: /* @__PURE__ */
|
|
15
|
-
{ key: "/cognition/impact", label: "影响面", icon: /* @__PURE__ */
|
|
16
|
-
{ key: "/cognition/docs", label: "说明", icon: /* @__PURE__ */
|
|
17
|
-
], x = [
|
|
18
|
-
{ title: "本体管理", icon: "🧩", items: z },
|
|
19
|
-
{ title: "业务认知", icon: "🧠", items: v }
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { lazy as t } from "react";
|
|
3
|
+
import { TagsOutlined as c, PartitionOutlined as e, SearchOutlined as l, BranchesOutlined as a, ReadOutlined as n, ApartmentOutlined as i, BulbOutlined as s, CheckCircleOutlined as m, ThunderboltOutlined as p, DatabaseOutlined as g } from "@ant-design/icons";
|
|
4
|
+
const r = t(() => import("./TermsPage-BJWfX1hw.js")), d = t(() => import("./TermDetailPage-CPPzVMdp.js")), y = t(() => import("./ConceptsPage-CLEcHolu.js")), h = t(() => import("./ResolvePage-CmrRVFkA.js")), u = t(() => import("./ImpactPage-BiajQqHA.js")), O = t(() => import("./DocsPage-DNkkd9Sm.js")), C = t(() => import("./OntologyListPage-DJnVZ_19.js")), b = t(() => import("./OntologyDetailPage-BIZLIZ23.js")), P = t(() => import("./OntologyNodesPage-CiGsZLSG.js")), k = t(() => import("./OntologyValidatePage-WX4sAfzY.js")), f = t(() => import("./OntologyInferPage-BhHrVjSM.js")), z = t(() => import("./OntologyMaterializePage-DxxtArEt.js")), x = { title: "z-cognition 业务认知域", short: "z-cognition" }, v = [
|
|
5
|
+
{ key: "/ontology/schemas", label: "本体列表", icon: /* @__PURE__ */ o(i, {}), desc: "注册 / 查询 / 删除 schema" },
|
|
6
|
+
{ key: "/ontology/detail", label: "本体详情", icon: /* @__PURE__ */ o(n, {}), desc: "类定义 / 属性 / 统计" },
|
|
7
|
+
{ key: "/ontology/nodes", label: "类与实例", icon: /* @__PURE__ */ o(e, {}), desc: "图侧节点浏览" },
|
|
8
|
+
{ key: "/ontology/validate", label: "校验", icon: /* @__PURE__ */ o(m, {}), desc: "来源 / 快照两套口径" },
|
|
9
|
+
{ key: "/ontology/infer", label: "推理", icon: /* @__PURE__ */ o(p, {}), desc: "隐含类型与陈述" },
|
|
10
|
+
{ key: "/ontology/materialize", label: "物化", icon: /* @__PURE__ */ o(g, {}), desc: "落成图节点与边" }
|
|
11
|
+
], I = [
|
|
12
|
+
{ key: "/cognition/terms", label: "术语", icon: /* @__PURE__ */ o(c, {}), desc: "登记 / 版本 / 回滚" },
|
|
13
|
+
{ key: "/cognition/concepts", label: "概念", icon: /* @__PURE__ */ o(e, {}), desc: "六类概念与父子关系" },
|
|
14
|
+
{ key: "/cognition/resolve", label: "消歧", icon: /* @__PURE__ */ o(l, {}), desc: "词 → 术语 + 证据" },
|
|
15
|
+
{ key: "/cognition/impact", label: "影响面", icon: /* @__PURE__ */ o(a, {}), desc: "改之前先看谁引用" },
|
|
16
|
+
{ key: "/cognition/docs", label: "说明", icon: /* @__PURE__ */ o(n, {}), desc: "能力与 API 清单" }
|
|
20
17
|
], A = [
|
|
21
|
-
{
|
|
22
|
-
{
|
|
23
|
-
|
|
24
|
-
{ path: "/cognition/
|
|
25
|
-
{ path: "/cognition/
|
|
26
|
-
{ path: "/cognition/
|
|
27
|
-
{ path: "/
|
|
28
|
-
{ path: "/
|
|
18
|
+
{ title: "本体管理", icon: /* @__PURE__ */ o(i, {}), items: v },
|
|
19
|
+
{ title: "业务认知", icon: /* @__PURE__ */ o(s, {}), items: I }
|
|
20
|
+
], B = [
|
|
21
|
+
{ path: "/cognition/terms", Component: r },
|
|
22
|
+
{ path: "/cognition/terms/detail", Component: d },
|
|
23
|
+
{ path: "/cognition/concepts", Component: y },
|
|
24
|
+
{ path: "/cognition/resolve", Component: h },
|
|
25
|
+
{ path: "/cognition/impact", Component: u },
|
|
26
|
+
{ path: "/cognition/docs", Component: O },
|
|
27
|
+
{ path: "/ontology/schemas", Component: C },
|
|
28
|
+
{ path: "/ontology/detail", Component: b },
|
|
29
29
|
{ path: "/ontology/nodes", Component: P },
|
|
30
|
-
{ path: "/ontology/validate", Component:
|
|
31
|
-
{ path: "/ontology/infer", Component:
|
|
32
|
-
{ path: "/ontology/materialize", Component:
|
|
30
|
+
{ path: "/ontology/validate", Component: k },
|
|
31
|
+
{ path: "/ontology/infer", Component: f },
|
|
32
|
+
{ path: "/ontology/materialize", Component: z }
|
|
33
33
|
];
|
|
34
34
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
x as appMeta,
|
|
36
|
+
I as menuItems,
|
|
37
|
+
A as menuSections,
|
|
38
|
+
v as ontologyMenuItems,
|
|
39
|
+
B as routes
|
|
40
40
|
};
|