@yuku123/z-cognition-component 1.0.0 → 1.0.1

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.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("react"),S=require("react-router-dom"),t=require("antd"),p=require("@ant-design/icons"),h=require("./api.cjs"),l=require("./EvidenceFormList-CQNgMNCG.cjs"),{TextArea:b}=t.Input;function v(){const x=S.useNavigate(),[y,g]=a.useState([]),[j,c]=a.useState(!1),[d,u]=a.useState(""),[w,r]=a.useState(!1),[I,m]=a.useState(!1),[o]=t.Form.useForm(),i=async(n=d)=>{c(!0);try{g(await h.cognitionApi.listConcepts({domain:n}))}catch(s){t.message.error(s.message)}finally{c(!1)}};a.useEffect(()=>{i()},[]);const f=async()=>{const n=await o.validateFields();m(!0);try{await h.cognitionApi.createConcept({...n,actor:n.actor||"console",note:n.note||"console create"}),t.message.success(`概念 ${n.conceptKey} 已登记`),r(!1),o.resetFields(),await i()}catch(s){t.message.error(s.field?`${s.field}: ${s.message}`:s.message)}finally{m(!1)}};return e.jsxs("div",{children:[e.jsxs(t.Space,{wrap:!0,style:{marginBottom:16},children:[e.jsx(t.Input,{placeholder:"域(如 trade)",allowClear:!0,style:{width:180},value:d,onChange:n=>u(n.target.value),onPressEnter:()=>i()}),e.jsx(t.Button,{icon:e.jsx(p.ReloadOutlined,{}),onClick:()=>{u(""),i("")},children:"重置"}),e.jsx(t.Button,{type:"primary",icon:e.jsx(p.PlusOutlined,{}),onClick:()=>r(!0),children:"新建概念"})]}),e.jsx(t.Table,{rowKey:"conceptKey",size:"middle",loading:j,dataSource:y,pagination:{pageSize:20,showSizeChanger:!1},columns:[{title:"conceptKey",dataIndex:"conceptKey",width:200},{title:"名称",dataIndex:"name",width:180},{title:"类型",dataIndex:"conceptType",width:120,render:n=>e.jsx(t.Tag,{children:n})},{title:"域",dataIndex:"domain",width:120},{title:"父概念",dataIndex:"parentKey",width:180,render:n=>n||"—"},{title:"版本",dataIndex:"revisionNo",width:70,render:n=>`r${n}`},{title:"定义",dataIndex:"definition",ellipsis:!0},{title:"操作",width:110,render:(n,s)=>e.jsx(t.Button,{size:"small",onClick:()=>x(`/cognition/impact?subjectType=concept&subjectKey=${encodeURIComponent(s.conceptKey)}`),children:"影响面"})}]}),e.jsx(t.Modal,{title:"新建概念(证据必填)",open:w,onCancel:()=>r(!1),onOk:f,confirmLoading:I,width:800,destroyOnHidden:!0,children:e.jsxs(t.Form,{form:o,layout:"vertical",children:[e.jsxs(t.Space,{size:"large",wrap:!0,children:[e.jsx(t.Form.Item,{name:"conceptKey",label:"conceptKey",rules:[{required:!0,message:"必填"},{pattern:l.KEY_PATTERN,message:"^[a-z][a-z0-9_.-]{1,127}$"}],children:e.jsx(t.Input,{style:{width:240},placeholder:"order"})}),e.jsx(t.Form.Item,{name:"name",label:"名称",rules:[{required:!0,message:"必填"}],children:e.jsx(t.Input,{style:{width:200},placeholder:"订单"})}),e.jsx(t.Form.Item,{name:"conceptType",label:"类型",rules:[{required:!0,message:"必填"}],initialValue:"ENTITY",children:e.jsx(t.Select,{style:{width:140},options:l.CONCEPT_TYPES.map(n=>({value:n,label:n}))})}),e.jsx(t.Form.Item,{name:"domain",label:"域",children:e.jsx(t.Input,{style:{width:140}})}),e.jsx(t.Form.Item,{name:"parentKey",label:"父概念",children:e.jsx(t.Input,{style:{width:180}})})]}),e.jsx(t.Form.Item,{name:"definition",label:"定义",rules:[{required:!0,message:"必填"}],children:e.jsx(b,{rows:3})}),e.jsx(t.Form.Item,{label:"证据(至少一条)",required:!0,children:e.jsx(l.EvidenceFormList,{})})]})})]})}exports.default=v;
@@ -60,7 +60,7 @@ function H() {
60
60
  d,
61
61
  {
62
62
  size: "small",
63
- onClick: () => w(`/impact?subjectType=concept&subjectKey=${encodeURIComponent(n.conceptKey)}`),
63
+ onClick: () => w(`/cognition/impact?subjectType=concept&subjectKey=${encodeURIComponent(n.conceptKey)}`),
64
64
  children: "影响面"
65
65
  }
66
66
  )
@@ -74,7 +74,7 @@ function Ee() {
74
74
  }));
75
75
  return /* @__PURE__ */ o(ae, { spinning: M, children: [
76
76
  /* @__PURE__ */ o(F, { style: { marginBottom: 16 }, wrap: !0, children: [
77
- /* @__PURE__ */ e(p, { icon: /* @__PURE__ */ e(oe, {}), onClick: () => q("/terms"), children: "返回列表" }),
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
80
  /* @__PURE__ */ e(g, { style: { width: 300 }, placeholder: "left", value: v, onChange: A, options: K }),
@@ -0,0 +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[O]=E.useSearchParams(),$=E.useNavigate(),l=O.get("key")||"",[i,k]=n.useState(null),[f,B]=n.useState([]),[y,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(f)}),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=y.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:()=>$("/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:f,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:y,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,{size:"small",icon:e.jsx(d.RollbackOutlined,{}),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;
@@ -1,20 +1,20 @@
1
1
  import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
2
  import { useState as o, useEffect as A } from "react";
3
3
  import { useNavigate as O } from "react-router-dom";
4
- import { Input as r, Form as a, Space as g, Select as h, Button as u, Table as z, Modal as F, message as p, Tag as f } from "antd";
4
+ import { Input as r, Form as a, Space as y, Select as h, Button as u, Table as z, Modal as F, message as p, Tag as f } from "antd";
5
5
  import { SearchOutlined as I, ReloadOutlined as R, PlusOutlined as $ } from "@ant-design/icons";
6
6
  import { cognitionApi as b } from "./api.js";
7
7
  import { T as v, K as P, a as L, S as _ } from "./EvidenceFormList-097ICr7D.js";
8
8
  const { TextArea: N } = r;
9
9
  function D() {
10
- const C = O(), [T, S] = o([]), [x, w] = o(!1), [n, s] = o({ q: "", domain: "", status: "" }), [K, c] = o(!1), [E, y] = o(!1), [m] = a.useForm(), i = async (t = n) => {
11
- w(!0);
10
+ const C = O(), [T, S] = o([]), [x, g] = o(!1), [n, s] = o({ q: "", domain: "", status: "" }), [K, c] = o(!1), [E, w] = o(!1), [m] = a.useForm(), i = async (t = n) => {
11
+ g(!0);
12
12
  try {
13
13
  S(await b.listTerms(t));
14
14
  } catch (l) {
15
15
  p.error(l.message);
16
16
  } finally {
17
- w(!1);
17
+ g(!1);
18
18
  }
19
19
  };
20
20
  A(() => {
@@ -22,7 +22,7 @@ function D() {
22
22
  }, []);
23
23
  const k = async () => {
24
24
  const t = await m.validateFields();
25
- y(!0);
25
+ w(!0);
26
26
  try {
27
27
  await b.createTerm({
28
28
  ...t,
@@ -33,14 +33,14 @@ function D() {
33
33
  } catch (l) {
34
34
  p.error(l.field ? `${l.field}: ${l.message}` : l.message);
35
35
  } finally {
36
- y(!1);
36
+ w(!1);
37
37
  }
38
38
  }, q = [
39
39
  {
40
40
  title: "termKey",
41
41
  dataIndex: "termKey",
42
42
  width: 200,
43
- render: (t) => /* @__PURE__ */ e("a", { onClick: () => C(`/terms/detail?key=${encodeURIComponent(t)}`), children: t })
43
+ render: (t) => /* @__PURE__ */ e("a", { onClick: () => C(`/cognition/terms/detail?key=${encodeURIComponent(t)}`), children: t })
44
44
  },
45
45
  { title: "规范名", dataIndex: "canonical", width: 160 },
46
46
  {
@@ -65,7 +65,7 @@ function D() {
65
65
  { title: "更新时间", dataIndex: "updatedAt", width: 190 }
66
66
  ];
67
67
  return /* @__PURE__ */ d("div", { children: [
68
- /* @__PURE__ */ d(g, { wrap: !0, style: { marginBottom: 16 }, children: [
68
+ /* @__PURE__ */ d(y, { wrap: !0, style: { marginBottom: 16 }, children: [
69
69
  /* @__PURE__ */ e(
70
70
  r,
71
71
  {
@@ -129,7 +129,7 @@ function D() {
129
129
  width: 820,
130
130
  destroyOnHidden: !0,
131
131
  children: /* @__PURE__ */ d(a, { form: m, layout: "vertical", children: [
132
- /* @__PURE__ */ d(g, { size: "large", wrap: !0, children: [
132
+ /* @__PURE__ */ d(y, { size: "large", wrap: !0, children: [
133
133
  /* @__PURE__ */ e(
134
134
  a.Item,
135
135
  {
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),f=require("react-router-dom"),t=require("antd"),d=require("@ant-design/icons"),x=require("./api.cjs"),o=require("./EvidenceFormList-CQNgMNCG.cjs"),{TextArea:T}=t.Input;function v(){const p=f.useNavigate(),[j,g]=n.useState([]),[y,m]=n.useState(!1),[r,i]=n.useState({q:"",domain:"",status:""}),[w,c]=n.useState(!1),[I,h]=n.useState(!1),[u]=t.Form.useForm(),l=async(a=r)=>{m(!0);try{g(await x.cognitionApi.listTerms(a))}catch(s){t.message.error(s.message)}finally{m(!1)}};n.useEffect(()=>{l()},[]);const S=async()=>{const a=await u.validateFields();h(!0);try{await x.cognitionApi.createTerm({...a,status:a.status||"ACTIVE",actor:a.actor||"console",note:a.note||"console create"}),t.message.success(`术语 ${a.termKey} 已登记`),c(!1),u.resetFields(),await l()}catch(s){t.message.error(s.field?`${s.field}: ${s.message}`:s.message)}finally{h(!1)}},b=[{title:"termKey",dataIndex:"termKey",width:200,render:a=>e.jsx("a",{onClick:()=>p(`/cognition/terms/detail?key=${encodeURIComponent(a)}`),children:a})},{title:"规范名",dataIndex:"canonical",width:160},{title:"别名",dataIndex:"aliases",render:a=>a&&a.length?a.map(s=>e.jsx(t.Tag,{children:s},s)):e.jsx("span",{style:{color:"#bbb"},children:"—"})},{title:"域",dataIndex:"domain",width:120},{title:"状态",dataIndex:"status",width:110,render:a=>e.jsx(t.Tag,{color:o.STATUS_COLOR[a]||"blue",children:a})},{title:"概念",dataIndex:"conceptKey",width:160,render:a=>a||e.jsx("span",{style:{color:"#bbb"},children:"—"})},{title:"版本",dataIndex:"revisionNo",width:70,render:a=>`r${a}`},{title:"更新时间",dataIndex:"updatedAt",width:190}];return e.jsxs("div",{children:[e.jsxs(t.Space,{wrap:!0,style:{marginBottom:16},children:[e.jsx(t.Input,{placeholder:"按 key / 规范名 / 别名搜索",allowClear:!0,prefix:e.jsx(d.SearchOutlined,{}),style:{width:260},value:r.q,onChange:a=>i({...r,q:a.target.value}),onPressEnter:()=>l()}),e.jsx(t.Input,{placeholder:"域(如 trade)",allowClear:!0,style:{width:160},value:r.domain,onChange:a=>i({...r,domain:a.target.value}),onPressEnter:()=>l()}),e.jsx(t.Select,{placeholder:"状态",allowClear:!0,style:{width:140},value:r.status||void 0,onChange:a=>i({...r,status:a||""}),options:o.TERM_STATUSES.map(a=>({value:a,label:a}))}),e.jsx(t.Button,{icon:e.jsx(d.SearchOutlined,{}),onClick:()=>l(),children:"查询"}),e.jsx(t.Button,{icon:e.jsx(d.ReloadOutlined,{}),onClick:()=>{i({q:"",domain:"",status:""}),l({})},children:"重置"}),e.jsx(t.Button,{type:"primary",icon:e.jsx(d.PlusOutlined,{}),onClick:()=>c(!0),children:"新建术语"})]}),e.jsx(t.Table,{rowKey:"termKey",size:"middle",loading:y,columns:b,dataSource:j,pagination:{pageSize:20,showSizeChanger:!1},scroll:{x:1100}}),e.jsx(t.Modal,{title:"新建术语(证据必填)",open:w,onCancel:()=>c(!1),onOk:S,confirmLoading:I,width:820,destroyOnHidden:!0,children:e.jsxs(t.Form,{form:u,layout:"vertical",children:[e.jsxs(t.Space,{size:"large",wrap:!0,children:[e.jsx(t.Form.Item,{name:"termKey",label:"termKey",rules:[{required:!0,message:"必填"},{pattern:o.KEY_PATTERN,message:"^[a-z][a-z0-9_.-]{1,127}$"}],children:e.jsx(t.Input,{style:{width:260},placeholder:"order.gmv"})}),e.jsx(t.Form.Item,{name:"canonical",label:"规范名",rules:[{required:!0,message:"必填"}],children:e.jsx(t.Input,{style:{width:220},placeholder:"成交总额"})}),e.jsx(t.Form.Item,{name:"domain",label:"域",children:e.jsx(t.Input,{style:{width:140},placeholder:"trade"})}),e.jsx(t.Form.Item,{name:"owner",label:"owner",children:e.jsx(t.Input,{style:{width:140},placeholder:"@team"})}),e.jsx(t.Form.Item,{name:"status",label:"状态",initialValue:"ACTIVE",children:e.jsx(t.Select,{style:{width:130},options:o.TERM_STATUSES.map(a=>({value:a,label:a}))})})]}),e.jsx(t.Form.Item,{name:"aliases",label:"别名",children:e.jsx(t.Select,{mode:"tags",placeholder:"回车追加",tokenSeparators:[","]})}),e.jsx(t.Form.Item,{name:"conceptKey",label:"绑定概念(可空)",children:e.jsx(t.Input,{placeholder:"order"})}),e.jsx(t.Form.Item,{name:"definition",label:"定义",rules:[{required:!0,message:"必填"}],children:e.jsx(T,{rows:3,placeholder:"一句话说清口径;口径细节写到规则/指标,别塞进定义"})}),e.jsx(t.Form.Item,{name:"note",label:"变更说明",children:e.jsx(t.Input,{placeholder:"console create"})}),e.jsx(t.Form.Item,{label:"证据(至少一条)",required:!0,children:e.jsx(o.EvidenceFormList,{})})]})})]})}exports.default=v;
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-B8CnXbTP.cjs"),T=require("./TermDetailPage-DHNi7J_B.cjs"),o=require("./ConceptsPage-DXVhBUzW.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;
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-DQcYkPdm.cjs"),o=require("./ConceptsPage-BH4lEiVn.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
- import { default as x } from "./TermsPage-B_xTQR5N.js";
4
- import { default as d } from "./TermDetailPage-DvGL-fe0.js";
5
- import { default as C } from "./ConceptsPage-0GGsA1U2.js";
3
+ import { default as x } from "./TermsPage-BJWfX1hw.js";
4
+ import { default as d } from "./TermDetailPage-BiF5UVM5.js";
5
+ import { default as C } from "./ConceptsPage-C8nsSzRc.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";
package/dist/pages.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),e=require("react"),t=require("@ant-design/icons"),n=e.lazy(()=>Promise.resolve().then(()=>require("./TermsPage-B8CnXbTP.cjs"))),i=e.lazy(()=>Promise.resolve().then(()=>require("./TermDetailPage-DHNi7J_B.cjs"))),s=e.lazy(()=>Promise.resolve().then(()=>require("./ConceptsPage-DXVhBUzW.cjs"))),c=e.lazy(()=>Promise.resolve().then(()=>require("./ResolvePage-BDb56PdI.cjs"))),r=e.lazy(()=>Promise.resolve().then(()=>require("./ImpactPage-BMvZUgTJ.cjs"))),a=e.lazy(()=>Promise.resolve().then(()=>require("./DocsPage-CmGTg0A3.cjs"))),l={title:"z-cognition 业务认知域",short:"z-cognition"},m=[{key:"/cognition/terms",label:"术语",icon:o.jsx(t.TagsOutlined,{}),desc:"登记 / 版本 / 回滚"},{key:"/cognition/concepts",label:"概念",icon:o.jsx(t.PartitionOutlined,{}),desc:"六类概念与父子关系"},{key:"/cognition/resolve",label:"消歧",icon:o.jsx(t.SearchOutlined,{}),desc:"词 → 术语 + 证据"},{key:"/cognition/impact",label:"影响面",icon:o.jsx(t.BranchesOutlined,{}),desc:"改之前先看谁引用"},{key:"/cognition/docs",label:"说明",icon:o.jsx(t.ReadOutlined,{}),desc:"能力与 API 清单"}],p=[{path:"/cognition/terms",Component:n},{path:"/cognition/terms/detail",Component:i},{path:"/cognition/concepts",Component:s},{path:"/cognition/resolve",Component:c},{path:"/cognition/impact",Component:r},{path:"/cognition/docs",Component:a}];exports.appMeta=l;exports.menuItems=m;exports.routes=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),e=require("react"),t=require("@ant-design/icons"),n=e.lazy(()=>Promise.resolve().then(()=>require("./TermsPage-CE3E3fG-.cjs"))),i=e.lazy(()=>Promise.resolve().then(()=>require("./TermDetailPage-DQcYkPdm.cjs"))),s=e.lazy(()=>Promise.resolve().then(()=>require("./ConceptsPage-BH4lEiVn.cjs"))),c=e.lazy(()=>Promise.resolve().then(()=>require("./ResolvePage-BDb56PdI.cjs"))),r=e.lazy(()=>Promise.resolve().then(()=>require("./ImpactPage-BMvZUgTJ.cjs"))),a=e.lazy(()=>Promise.resolve().then(()=>require("./DocsPage-CmGTg0A3.cjs"))),l={title:"z-cognition 业务认知域",short:"z-cognition"},m=[{key:"/cognition/terms",label:"术语",icon:o.jsx(t.TagsOutlined,{}),desc:"登记 / 版本 / 回滚"},{key:"/cognition/concepts",label:"概念",icon:o.jsx(t.PartitionOutlined,{}),desc:"六类概念与父子关系"},{key:"/cognition/resolve",label:"消歧",icon:o.jsx(t.SearchOutlined,{}),desc:"词 → 术语 + 证据"},{key:"/cognition/impact",label:"影响面",icon:o.jsx(t.BranchesOutlined,{}),desc:"改之前先看谁引用"},{key:"/cognition/docs",label:"说明",icon:o.jsx(t.ReadOutlined,{}),desc:"能力与 API 清单"}],p=[{path:"/cognition/terms",Component:n},{path:"/cognition/terms/detail",Component:i},{path:"/cognition/concepts",Component:s},{path:"/cognition/resolve",Component:c},{path:"/cognition/impact",Component:r},{path:"/cognition/docs",Component:a}];exports.appMeta=l;exports.menuItems=m;exports.routes=p;
package/dist/pages.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
2
  import { lazy as o } from "react";
3
3
  import { TagsOutlined as n, PartitionOutlined as e, SearchOutlined as i, BranchesOutlined as c, ReadOutlined as s } from "@ant-design/icons";
4
- const a = o(() => import("./TermsPage-B_xTQR5N.js")), p = o(() => import("./TermDetailPage-DvGL-fe0.js")), m = o(() => import("./ConceptsPage-0GGsA1U2.js")), r = o(() => import("./ResolvePage-CmrRVFkA.js")), l = o(() => import("./ImpactPage-BiajQqHA.js")), g = o(() => import("./DocsPage-DNkkd9Sm.js")), u = { title: "z-cognition 业务认知域", short: "z-cognition" }, C = [
4
+ const a = o(() => import("./TermsPage-BJWfX1hw.js")), p = o(() => import("./TermDetailPage-BiF5UVM5.js")), m = o(() => import("./ConceptsPage-C8nsSzRc.js")), r = o(() => import("./ResolvePage-CmrRVFkA.js")), l = o(() => import("./ImpactPage-BiajQqHA.js")), g = o(() => import("./DocsPage-DNkkd9Sm.js")), u = { title: "z-cognition 业务认知域", short: "z-cognition" }, C = [
5
5
  { key: "/cognition/terms", label: "术语", icon: /* @__PURE__ */ t(n, {}), desc: "登记 / 版本 / 回滚" },
6
6
  { key: "/cognition/concepts", label: "概念", icon: /* @__PURE__ */ t(e, {}), desc: "六类概念与父子关系" },
7
7
  { key: "/cognition/resolve", label: "消歧", icon: /* @__PURE__ */ t(i, {}), desc: "词 → 术语 + 证据" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuku123/z-cognition-component",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "z-cognition 业务认知域共享组件层(library mode)—— 术语 / 概念 / 消歧 / 影响面",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("react"),S=require("react-router-dom"),t=require("antd"),p=require("@ant-design/icons"),h=require("./api.cjs"),l=require("./EvidenceFormList-CQNgMNCG.cjs"),{TextArea:b}=t.Input;function v(){const x=S.useNavigate(),[y,g]=a.useState([]),[j,c]=a.useState(!1),[d,u]=a.useState(""),[w,i]=a.useState(!1),[I,m]=a.useState(!1),[o]=t.Form.useForm(),r=async(n=d)=>{c(!0);try{g(await h.cognitionApi.listConcepts({domain:n}))}catch(s){t.message.error(s.message)}finally{c(!1)}};a.useEffect(()=>{r()},[]);const f=async()=>{const n=await o.validateFields();m(!0);try{await h.cognitionApi.createConcept({...n,actor:n.actor||"console",note:n.note||"console create"}),t.message.success(`概念 ${n.conceptKey} 已登记`),i(!1),o.resetFields(),await r()}catch(s){t.message.error(s.field?`${s.field}: ${s.message}`:s.message)}finally{m(!1)}};return e.jsxs("div",{children:[e.jsxs(t.Space,{wrap:!0,style:{marginBottom:16},children:[e.jsx(t.Input,{placeholder:"域(如 trade)",allowClear:!0,style:{width:180},value:d,onChange:n=>u(n.target.value),onPressEnter:()=>r()}),e.jsx(t.Button,{icon:e.jsx(p.ReloadOutlined,{}),onClick:()=>{u(""),r("")},children:"重置"}),e.jsx(t.Button,{type:"primary",icon:e.jsx(p.PlusOutlined,{}),onClick:()=>i(!0),children:"新建概念"})]}),e.jsx(t.Table,{rowKey:"conceptKey",size:"middle",loading:j,dataSource:y,pagination:{pageSize:20,showSizeChanger:!1},columns:[{title:"conceptKey",dataIndex:"conceptKey",width:200},{title:"名称",dataIndex:"name",width:180},{title:"类型",dataIndex:"conceptType",width:120,render:n=>e.jsx(t.Tag,{children:n})},{title:"域",dataIndex:"domain",width:120},{title:"父概念",dataIndex:"parentKey",width:180,render:n=>n||"—"},{title:"版本",dataIndex:"revisionNo",width:70,render:n=>`r${n}`},{title:"定义",dataIndex:"definition",ellipsis:!0},{title:"操作",width:110,render:(n,s)=>e.jsx(t.Button,{size:"small",onClick:()=>x(`/impact?subjectType=concept&subjectKey=${encodeURIComponent(s.conceptKey)}`),children:"影响面"})}]}),e.jsx(t.Modal,{title:"新建概念(证据必填)",open:w,onCancel:()=>i(!1),onOk:f,confirmLoading:I,width:800,destroyOnHidden:!0,children:e.jsxs(t.Form,{form:o,layout:"vertical",children:[e.jsxs(t.Space,{size:"large",wrap:!0,children:[e.jsx(t.Form.Item,{name:"conceptKey",label:"conceptKey",rules:[{required:!0,message:"必填"},{pattern:l.KEY_PATTERN,message:"^[a-z][a-z0-9_.-]{1,127}$"}],children:e.jsx(t.Input,{style:{width:240},placeholder:"order"})}),e.jsx(t.Form.Item,{name:"name",label:"名称",rules:[{required:!0,message:"必填"}],children:e.jsx(t.Input,{style:{width:200},placeholder:"订单"})}),e.jsx(t.Form.Item,{name:"conceptType",label:"类型",rules:[{required:!0,message:"必填"}],initialValue:"ENTITY",children:e.jsx(t.Select,{style:{width:140},options:l.CONCEPT_TYPES.map(n=>({value:n,label:n}))})}),e.jsx(t.Form.Item,{name:"domain",label:"域",children:e.jsx(t.Input,{style:{width:140}})}),e.jsx(t.Form.Item,{name:"parentKey",label:"父概念",children:e.jsx(t.Input,{style:{width:180}})})]}),e.jsx(t.Form.Item,{name:"definition",label:"定义",rules:[{required:!0,message:"必填"}],children:e.jsx(b,{rows:3})}),e.jsx(t.Form.Item,{label:"证据(至少一条)",required:!0,children:e.jsx(l.EvidenceFormList,{})})]})})]})}exports.default=v;
@@ -1 +0,0 @@
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[O]=E.useSearchParams(),$=E.useNavigate(),l=O.get("key")||"",[i,k]=n.useState(null),[f,B]=n.useState([]),[y,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(f)}),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=y.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:()=>$("/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:f,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:y,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,{size:"small",icon:e.jsx(d.RollbackOutlined,{}),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;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),f=require("react-router-dom"),t=require("antd"),d=require("@ant-design/icons"),x=require("./api.cjs"),o=require("./EvidenceFormList-CQNgMNCG.cjs"),{TextArea:T}=t.Input;function v(){const p=f.useNavigate(),[j,g]=n.useState([]),[y,m]=n.useState(!1),[r,i]=n.useState({q:"",domain:"",status:""}),[w,c]=n.useState(!1),[I,h]=n.useState(!1),[u]=t.Form.useForm(),l=async(a=r)=>{m(!0);try{g(await x.cognitionApi.listTerms(a))}catch(s){t.message.error(s.message)}finally{m(!1)}};n.useEffect(()=>{l()},[]);const S=async()=>{const a=await u.validateFields();h(!0);try{await x.cognitionApi.createTerm({...a,status:a.status||"ACTIVE",actor:a.actor||"console",note:a.note||"console create"}),t.message.success(`术语 ${a.termKey} 已登记`),c(!1),u.resetFields(),await l()}catch(s){t.message.error(s.field?`${s.field}: ${s.message}`:s.message)}finally{h(!1)}},b=[{title:"termKey",dataIndex:"termKey",width:200,render:a=>e.jsx("a",{onClick:()=>p(`/terms/detail?key=${encodeURIComponent(a)}`),children:a})},{title:"规范名",dataIndex:"canonical",width:160},{title:"别名",dataIndex:"aliases",render:a=>a&&a.length?a.map(s=>e.jsx(t.Tag,{children:s},s)):e.jsx("span",{style:{color:"#bbb"},children:"—"})},{title:"域",dataIndex:"domain",width:120},{title:"状态",dataIndex:"status",width:110,render:a=>e.jsx(t.Tag,{color:o.STATUS_COLOR[a]||"blue",children:a})},{title:"概念",dataIndex:"conceptKey",width:160,render:a=>a||e.jsx("span",{style:{color:"#bbb"},children:"—"})},{title:"版本",dataIndex:"revisionNo",width:70,render:a=>`r${a}`},{title:"更新时间",dataIndex:"updatedAt",width:190}];return e.jsxs("div",{children:[e.jsxs(t.Space,{wrap:!0,style:{marginBottom:16},children:[e.jsx(t.Input,{placeholder:"按 key / 规范名 / 别名搜索",allowClear:!0,prefix:e.jsx(d.SearchOutlined,{}),style:{width:260},value:r.q,onChange:a=>i({...r,q:a.target.value}),onPressEnter:()=>l()}),e.jsx(t.Input,{placeholder:"域(如 trade)",allowClear:!0,style:{width:160},value:r.domain,onChange:a=>i({...r,domain:a.target.value}),onPressEnter:()=>l()}),e.jsx(t.Select,{placeholder:"状态",allowClear:!0,style:{width:140},value:r.status||void 0,onChange:a=>i({...r,status:a||""}),options:o.TERM_STATUSES.map(a=>({value:a,label:a}))}),e.jsx(t.Button,{icon:e.jsx(d.SearchOutlined,{}),onClick:()=>l(),children:"查询"}),e.jsx(t.Button,{icon:e.jsx(d.ReloadOutlined,{}),onClick:()=>{i({q:"",domain:"",status:""}),l({})},children:"重置"}),e.jsx(t.Button,{type:"primary",icon:e.jsx(d.PlusOutlined,{}),onClick:()=>c(!0),children:"新建术语"})]}),e.jsx(t.Table,{rowKey:"termKey",size:"middle",loading:y,columns:b,dataSource:j,pagination:{pageSize:20,showSizeChanger:!1},scroll:{x:1100}}),e.jsx(t.Modal,{title:"新建术语(证据必填)",open:w,onCancel:()=>c(!1),onOk:S,confirmLoading:I,width:820,destroyOnHidden:!0,children:e.jsxs(t.Form,{form:u,layout:"vertical",children:[e.jsxs(t.Space,{size:"large",wrap:!0,children:[e.jsx(t.Form.Item,{name:"termKey",label:"termKey",rules:[{required:!0,message:"必填"},{pattern:o.KEY_PATTERN,message:"^[a-z][a-z0-9_.-]{1,127}$"}],children:e.jsx(t.Input,{style:{width:260},placeholder:"order.gmv"})}),e.jsx(t.Form.Item,{name:"canonical",label:"规范名",rules:[{required:!0,message:"必填"}],children:e.jsx(t.Input,{style:{width:220},placeholder:"成交总额"})}),e.jsx(t.Form.Item,{name:"domain",label:"域",children:e.jsx(t.Input,{style:{width:140},placeholder:"trade"})}),e.jsx(t.Form.Item,{name:"owner",label:"owner",children:e.jsx(t.Input,{style:{width:140},placeholder:"@team"})}),e.jsx(t.Form.Item,{name:"status",label:"状态",initialValue:"ACTIVE",children:e.jsx(t.Select,{style:{width:130},options:o.TERM_STATUSES.map(a=>({value:a,label:a}))})})]}),e.jsx(t.Form.Item,{name:"aliases",label:"别名",children:e.jsx(t.Select,{mode:"tags",placeholder:"回车追加",tokenSeparators:[","]})}),e.jsx(t.Form.Item,{name:"conceptKey",label:"绑定概念(可空)",children:e.jsx(t.Input,{placeholder:"order"})}),e.jsx(t.Form.Item,{name:"definition",label:"定义",rules:[{required:!0,message:"必填"}],children:e.jsx(T,{rows:3,placeholder:"一句话说清口径;口径细节写到规则/指标,别塞进定义"})}),e.jsx(t.Form.Item,{name:"note",label:"变更说明",children:e.jsx(t.Input,{placeholder:"console create"})}),e.jsx(t.Form.Item,{label:"证据(至少一条)",required:!0,children:e.jsx(o.EvidenceFormList,{})})]})})]})}exports.default=v;