@yuku123/z-cognition-component 2.0.2 → 2.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-lib/BaseInput-rxw05EpT.js +1096 -0
- package/dist-lib/ClockCircleOutlined-DqK04lTb.js +12 -0
- package/dist-lib/Collapse-D9XOithE.js +523 -0
- package/dist-lib/{ConceptsPage-BOeKdDKI.js → ConceptsPage-DOf_CJlz.js} +13 -16
- package/dist-lib/DeleteOutlined-DnGmqa7C.js +12 -0
- package/dist-lib/{DocsPage-BZOBFp3c.js → DocsPage-CiC7TU96.js} +4 -4
- package/dist-lib/EllipsisOutlined-VzQrhleP.js +1109 -0
- package/dist-lib/EvidenceFormList-CrE2FzHk.js +90 -0
- package/dist-lib/{EyeOutlined-DGSrX-0M.js → EyeOutlined-CIFgRd6d.js} +4 -4
- package/dist-lib/ImpactPage-CYiuqy0S.js +68 -0
- package/dist-lib/{LeftOutlined-Cgo6Izj-.js → LeftOutlined-Be44-JWT.js} +1 -1
- package/dist-lib/{OntologyDetailPage-B8DyU8WW.js → OntologyDetailPage-mgK_NQxP.js} +99 -93
- package/dist-lib/{OntologyInferPage-CvcjxpBB.js → OntologyInferPage-NUaoaQpN.js} +38 -40
- package/dist-lib/{OntologyListPage-Cb0XfpWE.js → OntologyListPage-C9wH01y0.js} +47 -49
- package/dist-lib/OntologyMaterializePage-D_fDqYHY.js +134 -0
- package/dist-lib/OntologyNodesPage-5kH7RHwE.js +2844 -0
- package/dist-lib/{OntologyValidatePage-abQVJwzV.js → OntologyValidatePage-DtkYK_l4.js} +49 -52
- package/dist-lib/Pagination-BuFXTevS.js +1112 -0
- package/dist-lib/PlusOutlined-BSTPGLOH.js +21 -0
- package/dist-lib/{ReloadOutlined-CS-e-TmN.js → ReloadOutlined-B26pDoyV.js} +19 -10
- package/dist-lib/{ResolvePage-rbQ-8nNZ.js → ResolvePage-Cz9HORZ3.js} +31 -33
- package/dist-lib/{RotateRightOutlined-q7zp2e47.js → RotateRightOutlined-CYlCNRvD.js} +1 -1
- package/dist-lib/Skeleton-CxFsInYI.js +671 -0
- package/dist-lib/Table-Civ838nE.js +20514 -0
- package/dist-lib/{Table-CDagah-g.js → Table-D1RvQXGM.js} +414 -414
- package/dist-lib/TermDetailPage-BtkOpbPT.js +263 -0
- package/dist-lib/{TermsPage-CuufAyuL.js → TermsPage-BuzCMYov.js} +28 -31
- package/dist-lib/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/dist-lib/accessAk-DlxcvD0O.js +64 -0
- package/dist-lib/{agents-CvgRLQw2.js → agents-CabJdV6W.js} +46 -46
- package/dist-lib/{ai-DYDhijtn.js → ai-DZ6fqUyK.js} +32 -32
- package/dist-lib/{ai-chat-share-DJnybJtS.js → ai-chat-share-CYSU7UlK.js} +13 -14
- package/dist-lib/ak-manage-MTp2UyyK.js +805 -0
- package/dist-lib/{approval-3IbhY8Lp.js → approval-F9OYS1Ov.js} +25 -26
- package/dist-lib/{approvals-Cd6CVzz4.js → approvals-DDEl02-L.js} +42 -43
- package/dist-lib/{assistant-cIXgilaE.js → assistant-CcC1rvys.js} +48 -49
- package/dist-lib/{assistant-history-BQzH4ChB.js → assistant-history-fmy8IsJL.js} +5 -5
- package/dist-lib/{assistant-summary-LKTj_HKM.js → assistant-summary-kuK5-mku.js} +1 -1
- package/dist-lib/{audit-CxuJ5unU.js → audit-C0GYByqU.js} +1 -1
- package/dist-lib/{bios-BplnCOF4.js → bios-_axkM_DR.js} +128 -130
- package/dist-lib/callSuper-CuPJalb0.js +7 -0
- package/dist-lib/callSuper-CwIeyYoc.js +7 -0
- package/dist-lib/category-BPLw60Ia.js +76 -0
- package/dist-lib/causal-CcWolsb5.js +789 -0
- package/dist-lib/{changelog-BoGqt_81.js → changelog-BQdmpq5H.js} +2 -2
- package/dist-lib/changelog-DC6nlUDh.js +103 -0
- package/dist-lib/chat-panel-CgpP4Xf5.js +1543 -0
- package/dist-lib/chunk-6KYCQHYJ-DcgZQlO5.js +1627 -0
- package/dist-lib/code-space-CZ3CzVcA.js +1070 -0
- package/dist-lib/{colors-sdAcAcU3.js → colors-BsFEfaVs.js} +1 -1
- package/dist-lib/community-D9mD_Tq1.js +217 -0
- package/dist-lib/community-ESJc4qtl.js +70 -0
- package/dist-lib/community-material-page-Ct5uMwhv.js +747 -0
- package/dist-lib/connections-DrxmCfe3.js +1065 -0
- package/dist-lib/context-T27uno74.js +54 -0
- package/dist-lib/{createForOfIteratorHelper-DEx_aTey.js → createForOfIteratorHelper-3K1vcDqi.js} +1 -1
- package/dist-lib/{dayjs.min-BauDENhn.js → dayjs.min-DoEf5yCX.js} +1 -1
- package/dist-lib/{detail-Cx5c4KJH.js → detail-DXOJf57e.js} +39 -40
- package/dist-lib/detail-kPAVlzm3.js +84 -0
- package/dist-lib/{detail-BaX7WiWV.js → detail-lGslEB8s.js} +5847 -7224
- package/dist-lib/development-aLXXcLcF.js +167 -0
- package/dist-lib/{docx-preview-B5nQuTwk.js → docx-preview-D4v2g8Yg.js} +1 -1
- package/dist-lib/{downloads-C3Oz04OW.js → downloads-DFOEFvX6.js} +3 -4
- package/dist-lib/{edit-Cbn2eJaJ.js → edit-BbtVK23D.js} +200 -204
- package/dist-lib/{editor-mtaJBQXz.js → editor-DbLQFOUf.js} +25 -26
- package/dist-lib/editor-page-B_H0fRAI.js +1169 -0
- package/dist-lib/embed-BUaR8PAn.js +51816 -0
- package/dist-lib/embed.css +2 -2
- package/dist-lib/{evaluation-BoHiY8yT.js → evaluation-8Tx-3UQh.js} +14 -15
- package/dist-lib/execution-Dz5dBEFl.js +159 -0
- package/dist-lib/focus-set-lt52maBX.js +38 -0
- package/dist-lib/{format-UGmYKemG.js → format-CWI99NCN.js} +1 -1
- package/dist-lib/graph-BllA9bmL.js +44 -0
- package/dist-lib/graph-DacHEbKr.js +640 -0
- package/dist-lib/index-4tbtbcAt.js +550 -0
- package/dist-lib/index-B6G8CZ1v.js +915 -0
- package/dist-lib/index-BDWjubAD.js +390 -0
- package/dist-lib/{index-BEjXaDfk.js → index-BI-rknta.js} +53 -54
- package/dist-lib/index-BLGPH51v.js +251 -0
- package/dist-lib/index-BMv3kGDG.js +236 -0
- package/dist-lib/{index-CHBNrCMy.js → index-BOB3j3H_.js} +29 -29
- package/dist-lib/index-BU2GXuww.js +413 -0
- package/dist-lib/index-BVgdmf6r.js +2487 -0
- package/dist-lib/index-BWmgE7bB.js +2075 -0
- package/dist-lib/{index-B57Fj7Y0.js → index-Be_iqVpx.js} +50 -52
- package/dist-lib/{index-y7jVGGI0.js → index-Bf8IQq4A.js} +21 -23
- package/dist-lib/{index-DsuUGhTA.js → index-Bi7O9pQv.js} +177 -179
- package/dist-lib/index-Bs4MevzC.js +16075 -0
- package/dist-lib/{index-DBlG9uXV.js → index-Bt9F-2Fl.js} +520 -597
- package/dist-lib/{index-Cj4DDWyj.js → index-BtW_nQBU.js} +10 -11
- package/dist-lib/{index-CyKWCYMK.js → index-BuGHtvxH.js} +81 -84
- package/dist-lib/{index-Bc-Vin3j.js → index-CDxeB8C4.js} +47 -49
- package/dist-lib/index-CNBwau86.js +1166 -0
- package/dist-lib/{index-9aQ4BzIK.js → index-CS6H40rM.js} +24 -25
- package/dist-lib/index-CSnvcFg-.js +543 -0
- package/dist-lib/{index-o65vKUwa.js → index-CSoMwNHq.js} +82 -83
- package/dist-lib/{index-C3AMwzIi.js → index-CZipVp1G.js} +1 -1
- package/dist-lib/index-CdNxm2We.js +1987 -0
- package/dist-lib/{index-DMTPsTna.js → index-CjFA5T3K.js} +3 -4
- package/dist-lib/{index-Bm1sK-VN.js → index-D23tZfhi.js} +10 -10
- package/dist-lib/index-D35Ry0PG.js +1162 -0
- package/dist-lib/index-D7nLwQye.js +5012 -0
- package/dist-lib/index-DQ16Zb7x.js +546 -0
- package/dist-lib/{index-BwVZgt5s.js → index-DR9LGJpi.js} +46 -48
- package/dist-lib/index-DRcTwC17.js +418 -0
- package/dist-lib/index-DTgboCiF.js +566 -0
- package/dist-lib/index-Dd9pPAT3.js +2192 -0
- package/dist-lib/{index-Vu6sPBci.js → index-Ddx6XQu5.js} +285 -280
- package/dist-lib/index-Di2bQwQn.js +242 -0
- package/dist-lib/{index-Cy9i4Kx7.js → index-DlqhOJnd.js} +101 -105
- package/dist-lib/index-DxzorPvG.js +13960 -0
- package/dist-lib/{index-CLTfICbf.js → index-GQGXGr9M.js} +6 -6
- package/dist-lib/{index-nQSVLWfW.js → index-IB3GOib9.js} +81 -83
- package/dist-lib/index-If4xc1-H.js +559 -0
- package/dist-lib/index-Pcxp_AYe.js +1719 -0
- package/dist-lib/{index-ounfql2z.js → index-QkktEus5.js} +25 -27
- package/dist-lib/{index-B22_2Dzh.js → index-fVCVIu8I.js} +2 -2
- package/dist-lib/{index-D3GHtSlM.js → index-jHh-ITBK.js} +28 -29
- package/dist-lib/index-keRQ37lH.js +853 -0
- package/dist-lib/index-mUlorJxp.js +3279 -0
- package/dist-lib/{index-BSlCGnzo.js → index-n6hK1r_G.js} +12 -12
- package/dist-lib/index-qYfXuLnZ.js +34 -0
- package/dist-lib/index-yPMzsLHL.js +77 -0
- package/dist-lib/index.js +3 -4
- package/dist-lib/json-field-Bu-gFb6c.js +196 -0
- package/dist-lib/{jszip.min-DcEHhn-b.js → jszip.min-dcaDnWUw.js} +1 -1
- package/dist-lib/{kb-form-modal-B0rM1ZvV.js → kb-form-modal-DsXpXfNT.js} +64 -63
- package/dist-lib/{kbTeam-Bh_FQH28.js → kbTeam-D8hsAHI5.js} +3 -3
- package/dist-lib/{knowledge-base-Cl1Ka1e6.js → knowledge-base-D2XMD7iI.js} +111 -111
- package/dist-lib/{knowledge-hub-CPuzdRiq.js → knowledge-hub-BoBR8-j-.js} +52 -53
- package/dist-lib/login-B4C374Y_.js +36 -0
- package/dist-lib/{markdown-lite-Cu62Fl7J.js → markdown-lite-ROKlyMXg.js} +156 -160
- package/dist-lib/material-CqtPqoZj.js +204 -0
- package/dist-lib/material-draft-markdown-BKlKt3pc.js +443 -0
- package/dist-lib/material-original-preview-pzANkVK5.js +214 -0
- package/dist-lib/{material-preview-docx-CH-09KeC.js → material-preview-docx-lp_xPipj.js} +1 -1
- package/dist-lib/{material-preview-pptx-D8XGDF-u.js → material-preview-pptx-6Byitp0J.js} +1 -1
- package/dist-lib/material-workspace-model-BUpogooV.js +328 -0
- package/dist-lib/{member-DKDx77PD.js → member-CCTFfLDC.js} +1 -1
- package/dist-lib/memory-reorganization-CBTDCRhV.js +8 -0
- package/dist-lib/memory-spaces-CZGIBlz2.js +2340 -0
- package/dist-lib/{message-BrooQ3Q7.js → message-Chq3cAdy.js} +24 -25
- package/dist-lib/{message-Dievi8Jw.js → message-Rz7LvGMk.js} +1 -1
- package/dist-lib/{messages-xTNmTS9g.js → messages-DciGawgR.js} +15 -16
- package/dist-lib/meta-BWgVxZgd.js +708 -0
- package/dist-lib/{metrics-DiHYqBKB.js → metrics-iWreq4IL.js} +2 -2
- package/dist-lib/mobile-CNrK04Ak.js +2413 -0
- package/dist-lib/{monitor-BBCu3zRe.js → monitor-BpUJZCht.js} +8 -8
- package/dist-lib/{monitor-BXsdMJSV.js → monitor-CaTKbDI1.js} +4 -4
- package/dist-lib/{my-access-CEGErUgv.js → my-access-ZH5CWVGF.js} +120 -132
- package/dist-lib/{my-permissions-wSr5zv7g.js → my-permissions-edhi0lav.js} +22 -23
- package/dist-lib/navigation-2WdPUP2T.js +102 -0
- package/dist-lib/{new-BevAuTe5.js → new-Dq6mvU2w.js} +14 -15
- package/dist-lib/{ontology-DXGSJC-y.js → ontology-BX6X1X2J.js} +50 -52
- package/dist-lib/ontology-dataprep-BjMnFRBG.js +322 -0
- package/dist-lib/{ontology-domains-jTG7CZm8.js → ontology-domains-B7AuwW8S.js} +100 -103
- package/dist-lib/ontology-extract-FpJ6K8z6.js +295 -0
- package/dist-lib/ontology-extract-wbvBwGZO.js +3199 -0
- package/dist-lib/ontology-flow-CJsIvS35.js +456 -0
- package/dist-lib/ontology-flow-Cgi8Fk-i.js +154 -0
- package/dist-lib/ontology-modeling-C_6GvHBT.js +15136 -0
- package/dist-lib/ontology-modeling-CeDS1-FE.js +510 -0
- package/dist-lib/ontology-scenarios-4Ar7Y8Kt.js +675 -0
- package/dist-lib/{ontology-scenarios-J5kw6xgi.js → ontology-scenarios-BaYN82pv.js} +1289 -1305
- package/dist-lib/ontology-task-config-CDt7NdIq.js +122 -0
- package/dist-lib/ontology-terms-CnFarWZX.js +66 -0
- package/dist-lib/ontology-terms-CxTp2Dcq.js +1195 -0
- package/dist-lib/pages-CticGC6S.js +512 -0
- package/dist-lib/pages.js +3 -3
- package/dist-lib/{permission-BUXo69Ne.js → permission-CNqwhyF3.js} +41 -41
- package/dist-lib/pipeline-layout-CJlOMXJF.js +70 -0
- package/dist-lib/{pptx-preview.es-AUrdYKu3.js → pptx-preview.es-D4ODiBv2.js} +2 -2
- package/dist-lib/preset-Bp_mvsJm.js +56827 -0
- package/dist-lib/{preset-gh5SGoYT.js → preset-CfByvcqu.js} +8 -8
- package/dist-lib/progress-ImhDvynO.js +778 -0
- package/dist-lib/{quota-D31cXjul.js → quota-B38BWyPo.js} +4 -3
- package/dist-lib/row-DeVE0t_N.js +154 -0
- package/dist-lib/runs-ILSUwEOv.js +565 -0
- package/dist-lib/{save-blob-CiWNK-cX.js → save-blob-C5BbV45B.js} +2 -2
- package/dist-lib/{scenario-mapping-preview-DQ_OBV4Z.js → scenario-mapping-preview-7v1SRE7V.js} +43 -45
- package/dist-lib/scenario-simple-form-mFm6f2ho.js +989 -0
- package/dist-lib/{schedule-BktxwX3S.js → schedule-DzB9rZrm.js} +8 -8
- package/dist-lib/script-CKdVDsYh.js +2709 -0
- package/dist-lib/{settings-dsB3H65I.js → settings-CaihqQtz.js} +121 -121
- package/dist-lib/{shared-CTCzvhyE.js → shared-B51Q5536.js} +1 -1
- package/dist-lib/{shared-utils-BstybhBG.js → shared-utils-Ck5sql2m.js} +2 -2
- package/dist-lib/{skills-CHPlMsgO.js → skills-By3A0Dc1.js} +39 -40
- package/dist-lib/{source-selection-tXqc855k.js → source-selection-sIKyG7xR.js} +16 -16
- package/dist-lib/sources-DvIMColY.js +279 -0
- package/dist-lib/style-BHQZmWlH.js +191 -0
- package/dist-lib/{task-config-BiTOiZj0.js → task-config-CoPFj_FN.js} +4 -4
- package/dist-lib/{tech-BKlGPkV0.js → tech-BJgEEFrT.js} +3 -4
- package/dist-lib/templates-CODaf2QI.js +58 -0
- package/dist-lib/tenant-login-DmN4qfah.js +338 -0
- package/dist-lib/{tools-CouQ4FWk.js → tools-CyRz1Ofg.js} +14 -14
- package/dist-lib/use-current-tenant-otPCQ3X8.js +22 -0
- package/dist-lib/{use-domain-access-BPlNfoiP.js → use-domain-access-BuD99GTw.js} +15 -15
- package/dist-lib/{use-g6-graph-WLX0PweO.js → use-g6-graph-C5h9frJM.js} +1 -1
- package/dist-lib/{use-graph-layers-ja-ZIC_R.js → use-graph-layers-Cbd3Jggb.js} +48 -50
- package/dist-lib/use-resizable-columns-BpMCRKif.js +59 -0
- package/dist-lib/useBreakpoint-B8dF3ifo.js +87 -0
- package/dist-lib/{useForm-Byp1LopG.js → useForm-BZkiMeaN.js} +9 -9
- package/dist-lib/{version-control-panel-CkBm36Yk.js → version-control-panel-HdMlbpbO.js} +26 -27
- package/dist-lib/{version-management-B4kIbdVc.js → version-management-BYoxw4GV.js} +6 -7
- package/dist-lib/{welcome-F5iZoFB1.js → welcome-CMNXQf8J.js} +3 -4
- package/package.json +1 -1
- package/dist-lib/ApartmentOutlined-M6qSurnE.js +0 -12
- package/dist-lib/ArrowLeftOutlined-DowsrSUj.js +0 -12
- package/dist-lib/EvidenceFormList-DXqqSpPV.js +0 -91
- package/dist-lib/ImpactPage-DyhUR6fT.js +0 -71
- package/dist-lib/OntologyMaterializePage-B0f9TnJa.js +0 -136
- package/dist-lib/OntologyNodesPage-D4MWlm6q.js +0 -1268
- package/dist-lib/Pagination-Dxslodkq.js +0 -1344
- package/dist-lib/PlusOutlined-B_dXo_97.js +0 -12
- package/dist-lib/SearchOutlined-puH6bCY6.js +0 -979
- package/dist-lib/Skeleton-DXcERb5r.js +0 -557
- package/dist-lib/TagsOutlined-B4_qkn6-.js +0 -20
- package/dist-lib/TermDetailPage-CP0D6OvA.js +0 -242
- package/dist-lib/TextArea-DTpTS5HL.js +0 -1897
- package/dist-lib/ThunderboltOutlined-Bf54AaFE.js +0 -20
- package/dist-lib/callSuper-DZEfdkXG.js +0 -7
- package/dist-lib/changelog-Cn81Dvgk.js +0 -69
- package/dist-lib/chunk-YDNE64FV-DGyyfCo0.js +0 -2004
- package/dist-lib/context-Buz0ggsK.js +0 -710
- package/dist-lib/context-DpmyNOn3.js +0 -21
- package/dist-lib/embed-CR8XVkMy.js +0 -31148
- package/dist-lib/focus-set-h0YtOUB2.js +0 -427
- package/dist-lib/index-CaXylbQR.js +0 -3419
- package/dist-lib/index-Cfu1W1H6.js +0 -535
- package/dist-lib/index-CrMcNEAZ.js +0 -9656
- package/dist-lib/index-DBtGE89a.js +0 -168
- package/dist-lib/index-DjFPRXl5.js +0 -1484
- package/dist-lib/index-DvWHYX81.js +0 -450
- package/dist-lib/index-PBT9GksC.js +0 -340
- package/dist-lib/index-bOY1cBol.js +0 -4890
- package/dist-lib/meta-BD_qYTZu.js +0 -540
- package/dist-lib/ontology-modeling-CjRsa-DR.js +0 -1039
- package/dist-lib/ontology-modeling-DOj68TuI.js +0 -38946
- package/dist-lib/ontology-scenarios-CcAagMiP.js +0 -660
- package/dist-lib/pages-CsexFuEz.js +0 -73
- package/dist-lib/row-B5MnGm9M.js +0 -156
- package/dist-lib/scenario-simple-form-DESMvU7A.js +0 -2396
- package/dist-lib/useClosable-BY7FgWKy.js +0 -59
|
@@ -0,0 +1,2340 @@
|
|
|
1
|
+
import { jsxs as c, jsx as e, Fragment as H } from "react/jsx-runtime";
|
|
2
|
+
import fe, { useState as v, useCallback as V, useEffect as K, useRef as te, useMemo as ee } from "react";
|
|
3
|
+
import { a5 as Oe, a6 as ot, a7 as lt, a8 as it, a9 as st, r as O, I as R, B as x, aa as se, j as ct, h as ce, S as ke, A as _e, ab as dt, u as mt, a as ut } from "./embed-BUaR8PAn.js";
|
|
4
|
+
import { u as pt } from "./use-split-width-SsLqbGjr.js";
|
|
5
|
+
import { D as ht } from "./index-BWmgE7bB.js";
|
|
6
|
+
import { u as je } from "./use-resizable-columns-BpMCRKif.js";
|
|
7
|
+
import { T as A } from "./index-DR9LGJpi.js";
|
|
8
|
+
import { I as F } from "./index-CNBwau86.js";
|
|
9
|
+
import { F as Be } from "./Table-D1RvQXGM.js";
|
|
10
|
+
import { M as Fe } from "./index-Di2bQwQn.js";
|
|
11
|
+
import { M as We } from "./index-yPMzsLHL.js";
|
|
12
|
+
import { A as L } from "./index-IB3GOib9.js";
|
|
13
|
+
import { F as z } from "./index-Bt9F-2Fl.js";
|
|
14
|
+
import { D as me } from "./index-DlqhOJnd.js";
|
|
15
|
+
import { T as yt } from "./index-Bi7O9pQv.js";
|
|
16
|
+
import { S as bt } from "./index-BDWjubAD.js";
|
|
17
|
+
import { D as ft } from "./index-CS6H40rM.js";
|
|
18
|
+
import { T as Ge } from "./index-CDxeB8C4.js";
|
|
19
|
+
import { i as Re, S as ne } from "./index-BLGPH51v.js";
|
|
20
|
+
import { M as gt } from "./material-draft-markdown-BKlKt3pc.js";
|
|
21
|
+
import { T as Y } from "./index-BI-rknta.js";
|
|
22
|
+
import { L as ge } from "./index-DTgboCiF.js";
|
|
23
|
+
import { S as vt } from "./index-jHh-ITBK.js";
|
|
24
|
+
const Ve = ["wrap", "nowrap", "wrap-reverse"], He = ["flex-start", "flex-end", "start", "end", "center", "space-between", "space-around", "space-evenly", "stretch", "normal", "left", "right"], Ke = ["center", "start", "end", "flex-start", "flex-end", "self-start", "self-end", "baseline", "normal", "stretch"], kt = (t, n) => {
|
|
25
|
+
const l = n.wrap === !0 ? "wrap" : n.wrap;
|
|
26
|
+
return {
|
|
27
|
+
[`${t}-wrap-${l}`]: l && Ve.includes(l)
|
|
28
|
+
};
|
|
29
|
+
}, Ct = (t, n) => {
|
|
30
|
+
const l = {};
|
|
31
|
+
return Ke.forEach((o) => {
|
|
32
|
+
l[`${t}-align-${o}`] = n.align === o;
|
|
33
|
+
}), l[`${t}-align-stretch`] = !n.align && !!n.vertical, l;
|
|
34
|
+
}, wt = (t, n) => {
|
|
35
|
+
const l = {};
|
|
36
|
+
return He.forEach((o) => {
|
|
37
|
+
l[`${t}-justify-${o}`] = n.justify === o;
|
|
38
|
+
}), l;
|
|
39
|
+
};
|
|
40
|
+
function xt(t, n) {
|
|
41
|
+
return Oe(Object.assign(Object.assign(Object.assign({}, kt(t, n)), Ct(t, n)), wt(t, n)));
|
|
42
|
+
}
|
|
43
|
+
const Nt = (t) => {
|
|
44
|
+
const {
|
|
45
|
+
componentCls: n
|
|
46
|
+
} = t;
|
|
47
|
+
return {
|
|
48
|
+
[n]: {
|
|
49
|
+
display: "flex",
|
|
50
|
+
margin: 0,
|
|
51
|
+
padding: 0,
|
|
52
|
+
"&-vertical": {
|
|
53
|
+
flexDirection: "column"
|
|
54
|
+
},
|
|
55
|
+
"&-rtl": {
|
|
56
|
+
direction: "rtl"
|
|
57
|
+
},
|
|
58
|
+
"&:empty": {
|
|
59
|
+
display: "none"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}, $t = (t) => {
|
|
64
|
+
const {
|
|
65
|
+
componentCls: n
|
|
66
|
+
} = t;
|
|
67
|
+
return {
|
|
68
|
+
[n]: {
|
|
69
|
+
"&-gap-small": {
|
|
70
|
+
gap: t.flexGapSM
|
|
71
|
+
},
|
|
72
|
+
"&-gap-middle": {
|
|
73
|
+
gap: t.flexGap
|
|
74
|
+
},
|
|
75
|
+
"&-gap-large": {
|
|
76
|
+
gap: t.flexGapLG
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}, Mt = (t) => {
|
|
81
|
+
const {
|
|
82
|
+
componentCls: n
|
|
83
|
+
} = t, l = {};
|
|
84
|
+
return Ve.forEach((o) => {
|
|
85
|
+
l[`${n}-wrap-${o}`] = {
|
|
86
|
+
flexWrap: o
|
|
87
|
+
};
|
|
88
|
+
}), l;
|
|
89
|
+
}, St = (t) => {
|
|
90
|
+
const {
|
|
91
|
+
componentCls: n
|
|
92
|
+
} = t, l = {};
|
|
93
|
+
return Ke.forEach((o) => {
|
|
94
|
+
l[`${n}-align-${o}`] = {
|
|
95
|
+
alignItems: o
|
|
96
|
+
};
|
|
97
|
+
}), l;
|
|
98
|
+
}, It = (t) => {
|
|
99
|
+
const {
|
|
100
|
+
componentCls: n
|
|
101
|
+
} = t, l = {};
|
|
102
|
+
return He.forEach((o) => {
|
|
103
|
+
l[`${n}-justify-${o}`] = {
|
|
104
|
+
justifyContent: o
|
|
105
|
+
};
|
|
106
|
+
}), l;
|
|
107
|
+
}, Tt = () => ({}), Et = ot("Flex", (t) => {
|
|
108
|
+
const {
|
|
109
|
+
paddingXS: n,
|
|
110
|
+
padding: l,
|
|
111
|
+
paddingLG: o
|
|
112
|
+
} = t, a = lt(t, {
|
|
113
|
+
flexGapSM: n,
|
|
114
|
+
flexGap: l,
|
|
115
|
+
flexGapLG: o
|
|
116
|
+
});
|
|
117
|
+
return [Nt(a), $t(a), Mt(a), St(a), It(a)];
|
|
118
|
+
}, Tt, {
|
|
119
|
+
// Flex component don't apply extra font style
|
|
120
|
+
// https://github.com/ant-design/ant-design/issues/46403
|
|
121
|
+
resetStyle: !1
|
|
122
|
+
});
|
|
123
|
+
var Pt = function(t, n) {
|
|
124
|
+
var l = {};
|
|
125
|
+
for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && n.indexOf(o) < 0 && (l[o] = t[o]);
|
|
126
|
+
if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, o = Object.getOwnPropertySymbols(t); a < o.length; a++)
|
|
127
|
+
n.indexOf(o[a]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[a]) && (l[o[a]] = t[o[a]]);
|
|
128
|
+
return l;
|
|
129
|
+
};
|
|
130
|
+
const Ce = /* @__PURE__ */ fe.forwardRef((t, n) => {
|
|
131
|
+
const {
|
|
132
|
+
prefixCls: l,
|
|
133
|
+
rootClassName: o,
|
|
134
|
+
className: a,
|
|
135
|
+
style: k,
|
|
136
|
+
flex: r,
|
|
137
|
+
gap: u,
|
|
138
|
+
vertical: i = !1,
|
|
139
|
+
component: s = "div",
|
|
140
|
+
children: p
|
|
141
|
+
} = t, w = Pt(t, ["prefixCls", "rootClassName", "className", "style", "flex", "gap", "vertical", "component", "children"]), {
|
|
142
|
+
flex: b,
|
|
143
|
+
direction: y,
|
|
144
|
+
getPrefixCls: m
|
|
145
|
+
} = fe.useContext(it), C = m("flex", l), [f, S, M] = Et(C), N = i ?? (b == null ? void 0 : b.vertical), $ = Oe(a, o, b == null ? void 0 : b.className, C, S, M, xt(C, t), {
|
|
146
|
+
[`${C}-rtl`]: y === "rtl",
|
|
147
|
+
[`${C}-gap-${u}`]: Re(u),
|
|
148
|
+
[`${C}-vertical`]: N
|
|
149
|
+
}), E = Object.assign(Object.assign({}, b == null ? void 0 : b.style), k);
|
|
150
|
+
return r && (E.flex = r), u && !Re(u) && (E.gap = u), f(/* @__PURE__ */ fe.createElement(s, Object.assign({
|
|
151
|
+
ref: n,
|
|
152
|
+
className: $,
|
|
153
|
+
style: E
|
|
154
|
+
}, st(w, ["justify", "wrap", "align"])), p));
|
|
155
|
+
});
|
|
156
|
+
process.env.NODE_ENV !== "production" && (Ce.displayName = "Flex");
|
|
157
|
+
const _ = "/kb/v1/memory";
|
|
158
|
+
function zt({ baseCodes: t, query: n, topK: l, maxChars: o }, a) {
|
|
159
|
+
return O(`${_}/recall`, {
|
|
160
|
+
method: "POST",
|
|
161
|
+
data: { baseCodes: t, query: n, topK: l, maxChars: o },
|
|
162
|
+
signal: a
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
function Dt({ baseCode: t, current: n, size: l }, o) {
|
|
166
|
+
return O(`${_}/index/rebuild`, {
|
|
167
|
+
method: "POST",
|
|
168
|
+
data: { baseCode: t, current: n, size: l },
|
|
169
|
+
signal: o
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
function Rt(t) {
|
|
173
|
+
return O(`${_}/space/list`, { signal: t });
|
|
174
|
+
}
|
|
175
|
+
function Ue({ code: t, name: n, description: l }, o) {
|
|
176
|
+
return O(`${_}/space/save`, {
|
|
177
|
+
method: "POST",
|
|
178
|
+
data: { code: t, name: n, description: l },
|
|
179
|
+
signal: o
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
function Lt(t, n) {
|
|
183
|
+
return O(`${_}/space/remove`, {
|
|
184
|
+
method: "POST",
|
|
185
|
+
data: { code: t },
|
|
186
|
+
signal: n
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function At(t) {
|
|
190
|
+
return O(`${_}/base/list`, { signal: t });
|
|
191
|
+
}
|
|
192
|
+
function we({ code: t, name: n, description: l, type: o, spaceCode: a }, k) {
|
|
193
|
+
return O(`${_}/base/save`, {
|
|
194
|
+
method: "POST",
|
|
195
|
+
data: { code: t, name: n, description: l, type: o, spaceCode: a },
|
|
196
|
+
signal: k
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
function Ot(t, n) {
|
|
200
|
+
return O(`${_}/base/remove`, {
|
|
201
|
+
method: "POST",
|
|
202
|
+
data: { code: t },
|
|
203
|
+
signal: n
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
function Le(t, n) {
|
|
207
|
+
const l = new URLSearchParams({
|
|
208
|
+
baseCode: t.baseCode,
|
|
209
|
+
keyword: t.keyword ?? "",
|
|
210
|
+
current: String(t.current),
|
|
211
|
+
size: String(Math.min(100, Math.max(1, t.size)))
|
|
212
|
+
});
|
|
213
|
+
return t.enabled !== void 0 && l.set("enabled", String(t.enabled)), O(`${_}/item/page?${l}`, { signal: n });
|
|
214
|
+
}
|
|
215
|
+
function de({ code: t, baseCode: n, title: l, description: o, content: a, tags: k, sourceText: r, enabled: u }, i) {
|
|
216
|
+
return O(`${_}/item/save`, {
|
|
217
|
+
method: "POST",
|
|
218
|
+
data: { code: t, baseCode: n, title: l, description: o, content: a, tags: k, sourceText: r, enabled: u },
|
|
219
|
+
signal: i
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
function qe(t, n) {
|
|
223
|
+
return O(`${_}/item/remove`, {
|
|
224
|
+
method: "POST",
|
|
225
|
+
data: { code: t },
|
|
226
|
+
signal: n
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
function _t(t, n) {
|
|
230
|
+
return O(
|
|
231
|
+
`${_}/space/member/list?${new URLSearchParams({ spaceCode: t })}`,
|
|
232
|
+
{ signal: n }
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
function jt(t, n, l, o) {
|
|
236
|
+
return O(`${_}/space/member/save`, {
|
|
237
|
+
method: "POST",
|
|
238
|
+
data: { spaceCode: t, principalId: n, role: l },
|
|
239
|
+
signal: o
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
function Bt(t, n, l) {
|
|
243
|
+
return O(`${_}/space/member/remove`, {
|
|
244
|
+
method: "POST",
|
|
245
|
+
data: { spaceCode: t, principalId: n },
|
|
246
|
+
signal: l
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
function Ft(t, n) {
|
|
250
|
+
return O(
|
|
251
|
+
`${_}/member/list?${new URLSearchParams({ keyword: t })}`,
|
|
252
|
+
{ signal: n }
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
function Z(t) {
|
|
256
|
+
return t instanceof Error ? t.message : "请求失败,请重试";
|
|
257
|
+
}
|
|
258
|
+
function xe(t) {
|
|
259
|
+
const [n, l] = v(0), [o, a] = v(), k = V(() => l((u) => u + 1), []);
|
|
260
|
+
K(() => {
|
|
261
|
+
const u = new AbortController();
|
|
262
|
+
let i, s = "";
|
|
263
|
+
return t(u.signal).then((p) => {
|
|
264
|
+
i = p;
|
|
265
|
+
}).catch((p) => {
|
|
266
|
+
s = Z(p);
|
|
267
|
+
}).finally(() => {
|
|
268
|
+
u.signal.aborted || a({ load: t, revision: n, data: i, error: s });
|
|
269
|
+
}), () => u.abort();
|
|
270
|
+
}, [t, n]);
|
|
271
|
+
const r = (o == null ? void 0 : o.load) !== t || (o == null ? void 0 : o.revision) !== n;
|
|
272
|
+
return {
|
|
273
|
+
data: r || o == null ? void 0 : o.data,
|
|
274
|
+
loading: r,
|
|
275
|
+
error: r ? "" : (o == null ? void 0 : o.error) ?? "",
|
|
276
|
+
reload: k
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
function q() {
|
|
280
|
+
const [t, n] = v(!1), [l, o] = v(""), a = te(null);
|
|
281
|
+
return K(() => () => {
|
|
282
|
+
var r;
|
|
283
|
+
return (r = a.current) == null ? void 0 : r.abort();
|
|
284
|
+
}, []), { busy: t, error: l, execute: async (r, u) => {
|
|
285
|
+
if (a.current) return;
|
|
286
|
+
const i = new AbortController();
|
|
287
|
+
a.current = i, n(!0), o("");
|
|
288
|
+
try {
|
|
289
|
+
const s = await r(i.signal);
|
|
290
|
+
if (s === !1) throw new Error("操作未成功,请重试");
|
|
291
|
+
i.signal.aborted || u(s);
|
|
292
|
+
} catch (s) {
|
|
293
|
+
i.signal.aborted || o(Z(s));
|
|
294
|
+
} finally {
|
|
295
|
+
a.current = null, i.signal.aborted || n(!1);
|
|
296
|
+
}
|
|
297
|
+
} };
|
|
298
|
+
}
|
|
299
|
+
function W(t, n) {
|
|
300
|
+
var l;
|
|
301
|
+
return t ? `共享记忆库 / ${((l = n.find((o) => o.code === t)) == null ? void 0 : l.name) ?? `不可用共享记忆库(${t})`}` : "我的记忆库";
|
|
302
|
+
}
|
|
303
|
+
function U(t, n) {
|
|
304
|
+
return `${W(t.spaceCode, n)} / ${t.name}`;
|
|
305
|
+
}
|
|
306
|
+
function Wt(t) {
|
|
307
|
+
return "code" in t ? `${t.kind}:${t.code}` : t.kind;
|
|
308
|
+
}
|
|
309
|
+
function Q(t) {
|
|
310
|
+
return `${t.ownerType === "PERSONAL" || t.ownerType === "USER" ? "个人" : t.ownerType} · ${t.ownerCode}`;
|
|
311
|
+
}
|
|
312
|
+
function Gt(t) {
|
|
313
|
+
return [
|
|
314
|
+
{ key: "personal", title: "我的记忆库" },
|
|
315
|
+
{
|
|
316
|
+
key: "spaces",
|
|
317
|
+
title: "共享记忆库",
|
|
318
|
+
selectable: !1,
|
|
319
|
+
children: t.map((n) => ({
|
|
320
|
+
key: `space:${n.code}`,
|
|
321
|
+
title: n.name,
|
|
322
|
+
disabled: !n.canManage
|
|
323
|
+
}))
|
|
324
|
+
}
|
|
325
|
+
];
|
|
326
|
+
}
|
|
327
|
+
function Vt(t) {
|
|
328
|
+
return t === "personal" ? "" : t.startsWith("space:") ? t.slice(6) : void 0;
|
|
329
|
+
}
|
|
330
|
+
function Ne({
|
|
331
|
+
base: t,
|
|
332
|
+
spaces: n,
|
|
333
|
+
onDialog: l
|
|
334
|
+
}) {
|
|
335
|
+
const o = [
|
|
336
|
+
{ key: "config", label: "记忆库配置" },
|
|
337
|
+
...t.canManage ? [
|
|
338
|
+
{
|
|
339
|
+
key: "move",
|
|
340
|
+
label: `移动记忆库(当前位置:${U(t, n)})`
|
|
341
|
+
},
|
|
342
|
+
{ key: "remove", label: "删除记忆库", danger: !0 }
|
|
343
|
+
] : []
|
|
344
|
+
];
|
|
345
|
+
return /* @__PURE__ */ e(
|
|
346
|
+
Ht,
|
|
347
|
+
{
|
|
348
|
+
ariaLabel: `${t.name} 操作`,
|
|
349
|
+
items: o,
|
|
350
|
+
onPick: (a) => l(
|
|
351
|
+
a === "move" ? { kind: "move", base: t } : a === "remove" ? { kind: "deleteBase", base: t } : { kind: "base", base: t, spaceCode: t.spaceCode ?? "" }
|
|
352
|
+
)
|
|
353
|
+
}
|
|
354
|
+
);
|
|
355
|
+
}
|
|
356
|
+
function Ht({
|
|
357
|
+
ariaLabel: t,
|
|
358
|
+
items: n,
|
|
359
|
+
onPick: l
|
|
360
|
+
}) {
|
|
361
|
+
return /* @__PURE__ */ e(
|
|
362
|
+
ht,
|
|
363
|
+
{
|
|
364
|
+
trigger: ["click"],
|
|
365
|
+
menu: {
|
|
366
|
+
items: n.map((o) => ({ key: o.key, label: o.label, danger: o.danger })),
|
|
367
|
+
onClick: ({ key: o, domEvent: a }) => {
|
|
368
|
+
a.stopPropagation(), l(o);
|
|
369
|
+
}
|
|
370
|
+
},
|
|
371
|
+
children: /* @__PURE__ */ e(
|
|
372
|
+
x,
|
|
373
|
+
{
|
|
374
|
+
type: "text",
|
|
375
|
+
size: "small",
|
|
376
|
+
"aria-label": t,
|
|
377
|
+
icon: /* @__PURE__ */ e(R, { name: "more-horizontal", size: 14 }),
|
|
378
|
+
onClick: (o) => o.stopPropagation()
|
|
379
|
+
}
|
|
380
|
+
)
|
|
381
|
+
}
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
function Kt({
|
|
385
|
+
spaces: t,
|
|
386
|
+
bases: n,
|
|
387
|
+
selected: l,
|
|
388
|
+
onSelect: o,
|
|
389
|
+
onDialog: a
|
|
390
|
+
}) {
|
|
391
|
+
const k = n.filter((i) => !i.spaceCode), r = (i, s, p, w, b, y, m) => /* @__PURE__ */ c(
|
|
392
|
+
"div",
|
|
393
|
+
{
|
|
394
|
+
className: `kb-tree-row kb-section-head${y ? " active" : ""}`,
|
|
395
|
+
onClick: (C) => {
|
|
396
|
+
C.target.closest("button") || m();
|
|
397
|
+
},
|
|
398
|
+
children: [
|
|
399
|
+
/* @__PURE__ */ c("button", { className: "kb-tree-main", type: "button", onClick: m, children: [
|
|
400
|
+
/* @__PURE__ */ e(R, { name: s, size: 14 }),
|
|
401
|
+
/* @__PURE__ */ e("span", { className: "label", children: i })
|
|
402
|
+
] }),
|
|
403
|
+
/* @__PURE__ */ e("span", { className: "n", "aria-hidden": "true", children: p }),
|
|
404
|
+
/* @__PURE__ */ e(
|
|
405
|
+
"button",
|
|
406
|
+
{
|
|
407
|
+
className: "kb-tree-add",
|
|
408
|
+
type: "button",
|
|
409
|
+
title: w,
|
|
410
|
+
"aria-label": w,
|
|
411
|
+
onClick: (C) => {
|
|
412
|
+
C.stopPropagation(), b();
|
|
413
|
+
},
|
|
414
|
+
children: /* @__PURE__ */ e(R, { name: "plus", size: 11 })
|
|
415
|
+
}
|
|
416
|
+
)
|
|
417
|
+
]
|
|
418
|
+
}
|
|
419
|
+
), u = (i, s) => /* @__PURE__ */ c(
|
|
420
|
+
"div",
|
|
421
|
+
{
|
|
422
|
+
className: `kb-tree-row${l.kind === "base" && l.code === i.code ? " active" : ""}`,
|
|
423
|
+
style: { paddingLeft: 6 + (s + 1) * 14 },
|
|
424
|
+
children: [
|
|
425
|
+
/* @__PURE__ */ c(
|
|
426
|
+
"button",
|
|
427
|
+
{
|
|
428
|
+
className: "kb-tree-main",
|
|
429
|
+
type: "button",
|
|
430
|
+
title: U(i, t),
|
|
431
|
+
onClick: () => o({ kind: "base", code: i.code }),
|
|
432
|
+
children: [
|
|
433
|
+
/* @__PURE__ */ e(R, { name: "database", size: 13 }),
|
|
434
|
+
/* @__PURE__ */ e("span", { className: "label", children: i.name })
|
|
435
|
+
]
|
|
436
|
+
}
|
|
437
|
+
),
|
|
438
|
+
/* @__PURE__ */ e("span", { className: "kb-tree-tools", children: /* @__PURE__ */ e(Ne, { base: i, spaces: t, onDialog: a }) })
|
|
439
|
+
]
|
|
440
|
+
},
|
|
441
|
+
`base:${i.code}`
|
|
442
|
+
);
|
|
443
|
+
return /* @__PURE__ */ c("nav", { className: "kb-scope-tree", "aria-label": "记忆库范围", children: [
|
|
444
|
+
/* @__PURE__ */ c("div", { className: "kb-tree-root", children: [
|
|
445
|
+
r(
|
|
446
|
+
"我的记忆库",
|
|
447
|
+
"user",
|
|
448
|
+
k.length,
|
|
449
|
+
"新建我的记忆库",
|
|
450
|
+
() => a({ kind: "base", spaceCode: "" }),
|
|
451
|
+
l.kind === "personal",
|
|
452
|
+
() => o({ kind: "personal" })
|
|
453
|
+
),
|
|
454
|
+
/* @__PURE__ */ e("div", { className: "kb-flat-list", children: k.map((i) => u(i, 0)) })
|
|
455
|
+
] }),
|
|
456
|
+
/* @__PURE__ */ c("div", { className: "kb-tree-root", children: [
|
|
457
|
+
r(
|
|
458
|
+
"共享记忆库",
|
|
459
|
+
"users",
|
|
460
|
+
t.length,
|
|
461
|
+
"新建共享记忆库",
|
|
462
|
+
() => a({ kind: "space" }),
|
|
463
|
+
l.kind === "spaces",
|
|
464
|
+
() => o({ kind: "spaces" })
|
|
465
|
+
),
|
|
466
|
+
/* @__PURE__ */ e("div", { className: "kb-flat-list", children: t.map((i) => /* @__PURE__ */ c("div", { children: [
|
|
467
|
+
/* @__PURE__ */ c(
|
|
468
|
+
"div",
|
|
469
|
+
{
|
|
470
|
+
className: `kb-tree-row${l.kind === "space" && l.code === i.code ? " active" : ""}`,
|
|
471
|
+
style: { paddingLeft: 20 },
|
|
472
|
+
children: [
|
|
473
|
+
/* @__PURE__ */ c(
|
|
474
|
+
"button",
|
|
475
|
+
{
|
|
476
|
+
className: "kb-tree-main",
|
|
477
|
+
type: "button",
|
|
478
|
+
title: i.name,
|
|
479
|
+
onClick: () => o({ kind: "space", code: i.code }),
|
|
480
|
+
children: [
|
|
481
|
+
/* @__PURE__ */ e(R, { name: "folder", size: 13 }),
|
|
482
|
+
/* @__PURE__ */ e("span", { className: "label", children: i.name })
|
|
483
|
+
]
|
|
484
|
+
}
|
|
485
|
+
),
|
|
486
|
+
/* @__PURE__ */ e("span", { className: "kb-tree-tools", children: i.canManage && /* @__PURE__ */ e(
|
|
487
|
+
x,
|
|
488
|
+
{
|
|
489
|
+
className: "kb-tree-tool",
|
|
490
|
+
type: "text",
|
|
491
|
+
size: "small",
|
|
492
|
+
title: "共享记忆库设置",
|
|
493
|
+
"aria-label": "共享记忆库设置",
|
|
494
|
+
icon: /* @__PURE__ */ e(R, { name: "settings", size: 12 }),
|
|
495
|
+
onClick: (s) => {
|
|
496
|
+
s.stopPropagation(), a({ kind: "space", space: i });
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
) })
|
|
500
|
+
]
|
|
501
|
+
}
|
|
502
|
+
),
|
|
503
|
+
n.filter((s) => s.spaceCode === i.code).map((s) => u(s, 1))
|
|
504
|
+
] }, `space:${i.code}`)) })
|
|
505
|
+
] })
|
|
506
|
+
] });
|
|
507
|
+
}
|
|
508
|
+
const ie = 20;
|
|
509
|
+
function Ut({
|
|
510
|
+
selection: t,
|
|
511
|
+
spaces: n,
|
|
512
|
+
bases: l,
|
|
513
|
+
onSelect: o,
|
|
514
|
+
onDialog: a,
|
|
515
|
+
onReload: k
|
|
516
|
+
}) {
|
|
517
|
+
const [r, u] = v(""), [i, s] = v(ie), [p, w] = v({}), b = te(null), y = t.kind === "spaces", m = t.kind === "space" ? n.find((g) => g.code === t.code) : void 0, C = y ? "共享记忆库" : W(m == null ? void 0 : m.code, n), f = ee(() => (y ? n.map((h) => ({ kind: "space", entity: h })) : l.filter(
|
|
518
|
+
(h) => (h.spaceCode ?? "") === ((m == null ? void 0 : m.code) ?? "")
|
|
519
|
+
).map((h) => ({ kind: "base", entity: h }))).filter(
|
|
520
|
+
({ entity: h }) => `${h.name} ${h.description ?? ""}`.toLowerCase().includes(r.toLowerCase())
|
|
521
|
+
), [l, m == null ? void 0 : m.code, y, r, n]), S = ee(
|
|
522
|
+
() => [
|
|
523
|
+
{
|
|
524
|
+
key: "name",
|
|
525
|
+
title: "名称",
|
|
526
|
+
width: 230,
|
|
527
|
+
sorter: (g, h) => g.entity.name.localeCompare(h.entity.name),
|
|
528
|
+
ellipsis: { showTitle: !1 },
|
|
529
|
+
render: (g, h) => /* @__PURE__ */ e(A, { title: h.entity.name, children: /* @__PURE__ */ e(
|
|
530
|
+
"button",
|
|
531
|
+
{
|
|
532
|
+
type: "button",
|
|
533
|
+
className: "memory-name memory-link",
|
|
534
|
+
onClick: () => o({ kind: h.kind, code: h.entity.code }),
|
|
535
|
+
children: h.entity.name
|
|
536
|
+
}
|
|
537
|
+
) })
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
key: "description",
|
|
541
|
+
title: "描述",
|
|
542
|
+
width: 250,
|
|
543
|
+
sorter: (g, h) => (g.entity.description ?? "").localeCompare(
|
|
544
|
+
h.entity.description ?? ""
|
|
545
|
+
),
|
|
546
|
+
ellipsis: { showTitle: !1 },
|
|
547
|
+
render: (g, h) => /* @__PURE__ */ e(A, { title: h.entity.description, children: /* @__PURE__ */ e("span", { children: h.entity.description || "—" }) })
|
|
548
|
+
},
|
|
549
|
+
...y ? [] : [
|
|
550
|
+
{
|
|
551
|
+
key: "type",
|
|
552
|
+
title: "类型",
|
|
553
|
+
width: 120,
|
|
554
|
+
sorter: (g, h) => (g.kind === "base" ? g.entity.type ?? "" : "").localeCompare(
|
|
555
|
+
h.kind === "base" ? h.entity.type ?? "" : ""
|
|
556
|
+
),
|
|
557
|
+
ellipsis: { showTitle: !1 },
|
|
558
|
+
render: (g, h) => /* @__PURE__ */ e(A, { title: h.kind === "base" ? h.entity.type : "", children: /* @__PURE__ */ e("span", { children: h.kind === "base" && h.entity.type || "—" }) })
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
key: "location",
|
|
562
|
+
title: "落点",
|
|
563
|
+
width: 200,
|
|
564
|
+
sorter: (g, h) => W(
|
|
565
|
+
g.kind === "base" ? g.entity.spaceCode : "",
|
|
566
|
+
n
|
|
567
|
+
).localeCompare(
|
|
568
|
+
W(
|
|
569
|
+
h.kind === "base" ? h.entity.spaceCode : "",
|
|
570
|
+
n
|
|
571
|
+
)
|
|
572
|
+
),
|
|
573
|
+
ellipsis: { showTitle: !1 },
|
|
574
|
+
render: (g, h) => /* @__PURE__ */ e(
|
|
575
|
+
A,
|
|
576
|
+
{
|
|
577
|
+
title: W(
|
|
578
|
+
h.kind === "base" ? h.entity.spaceCode : "",
|
|
579
|
+
n
|
|
580
|
+
),
|
|
581
|
+
children: /* @__PURE__ */ e("span", { children: W(
|
|
582
|
+
h.kind === "base" ? h.entity.spaceCode : "",
|
|
583
|
+
n
|
|
584
|
+
) })
|
|
585
|
+
}
|
|
586
|
+
)
|
|
587
|
+
}
|
|
588
|
+
],
|
|
589
|
+
{
|
|
590
|
+
key: "owner",
|
|
591
|
+
title: "归属",
|
|
592
|
+
width: 180,
|
|
593
|
+
sorter: (g, h) => Q(g.entity).localeCompare(Q(h.entity)),
|
|
594
|
+
ellipsis: { showTitle: !1 },
|
|
595
|
+
render: (g, h) => /* @__PURE__ */ e(A, { title: Q(h.entity), children: /* @__PURE__ */ e("span", { children: Q(h.entity) }) })
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
key: "action",
|
|
599
|
+
title: "操作",
|
|
600
|
+
width: 70,
|
|
601
|
+
render: (g, h) => h.kind === "base" ? /* @__PURE__ */ e(
|
|
602
|
+
Ne,
|
|
603
|
+
{
|
|
604
|
+
base: h.entity,
|
|
605
|
+
spaces: n,
|
|
606
|
+
onDialog: a
|
|
607
|
+
}
|
|
608
|
+
) : h.entity.canManage ? /* @__PURE__ */ e(
|
|
609
|
+
x,
|
|
610
|
+
{
|
|
611
|
+
size: "small",
|
|
612
|
+
onClick: (D) => {
|
|
613
|
+
D.stopPropagation(), a({ kind: "space", space: h.entity });
|
|
614
|
+
},
|
|
615
|
+
children: "设置"
|
|
616
|
+
}
|
|
617
|
+
) : "—"
|
|
618
|
+
}
|
|
619
|
+
],
|
|
620
|
+
[y, a, o, n]
|
|
621
|
+
), M = ee(() => {
|
|
622
|
+
const g = S.find((D) => D.key === p.key), h = g == null ? void 0 : g.sorter;
|
|
623
|
+
return typeof h == "function" && p.order ? [...f].sort(
|
|
624
|
+
(D, I) => h(D, I, p.order ?? void 0) * (p.order === "descend" ? -1 : 1)
|
|
625
|
+
) : f;
|
|
626
|
+
}, [S, f, p]), N = je(
|
|
627
|
+
S.map((g) => ({
|
|
628
|
+
...g,
|
|
629
|
+
sortOrder: g.key === p.key ? p.order : null
|
|
630
|
+
})),
|
|
631
|
+
{ excludeKeys: ["action"] }
|
|
632
|
+
), $ = y || t.kind === "personal" || (m == null ? void 0 : m.canManage), E = ee(
|
|
633
|
+
() => M.slice(0, i),
|
|
634
|
+
[M, i]
|
|
635
|
+
);
|
|
636
|
+
K(() => {
|
|
637
|
+
const g = b.current;
|
|
638
|
+
g && i < M.length && g.scrollHeight <= g.clientHeight && s((h) => h + ie);
|
|
639
|
+
}, [M, i]);
|
|
640
|
+
const j = () => {
|
|
641
|
+
const g = b.current;
|
|
642
|
+
g && i < M.length && g.scrollTop + g.clientHeight >= g.scrollHeight - 120 && s((h) => h + ie);
|
|
643
|
+
};
|
|
644
|
+
return /* @__PURE__ */ c(H, { children: [
|
|
645
|
+
/* @__PURE__ */ c("div", { className: "memory-toolbar", children: [
|
|
646
|
+
/* @__PURE__ */ e(A, { title: C, children: /* @__PURE__ */ e("span", { className: "memory-location", children: C }) }),
|
|
647
|
+
/* @__PURE__ */ e(
|
|
648
|
+
F.Search,
|
|
649
|
+
{
|
|
650
|
+
"aria-label": "搜索目录",
|
|
651
|
+
placeholder: y ? "搜索共享记忆库" : "搜索记忆库",
|
|
652
|
+
allowClear: !0,
|
|
653
|
+
onSearch: (g) => {
|
|
654
|
+
u(g), s(ie);
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
),
|
|
658
|
+
/* @__PURE__ */ e(
|
|
659
|
+
x,
|
|
660
|
+
{
|
|
661
|
+
"aria-label": "刷新目录",
|
|
662
|
+
icon: /* @__PURE__ */ e(R, { name: "refresh", size: 14 }),
|
|
663
|
+
onClick: k
|
|
664
|
+
}
|
|
665
|
+
),
|
|
666
|
+
$ && /* @__PURE__ */ e(A, { title: y ? "新建共享记忆库" : `新建记忆库至 ${C}`, children: /* @__PURE__ */ e(
|
|
667
|
+
x,
|
|
668
|
+
{
|
|
669
|
+
type: "primary",
|
|
670
|
+
icon: /* @__PURE__ */ e(R, { name: "plus", size: 14 }),
|
|
671
|
+
onClick: () => a(
|
|
672
|
+
y ? { kind: "space" } : { kind: "base", spaceCode: (m == null ? void 0 : m.code) ?? "" }
|
|
673
|
+
),
|
|
674
|
+
children: y ? "新建共享记忆库" : "新建记忆库"
|
|
675
|
+
}
|
|
676
|
+
) })
|
|
677
|
+
] }),
|
|
678
|
+
/* @__PURE__ */ e(
|
|
679
|
+
"div",
|
|
680
|
+
{
|
|
681
|
+
className: "memory-results",
|
|
682
|
+
ref: b,
|
|
683
|
+
onScroll: j,
|
|
684
|
+
children: /* @__PURE__ */ e(
|
|
685
|
+
Be,
|
|
686
|
+
{
|
|
687
|
+
size: "small",
|
|
688
|
+
rowKey: (g) => `${g.kind}:${g.entity.code}`,
|
|
689
|
+
columns: N.columns,
|
|
690
|
+
components: N.components,
|
|
691
|
+
dataSource: E,
|
|
692
|
+
pagination: !1,
|
|
693
|
+
scroll: { x: y ? 730 : 1050 },
|
|
694
|
+
onChange: (g, h, D) => {
|
|
695
|
+
const I = Array.isArray(D) ? D[0] : D;
|
|
696
|
+
w({ key: String(I.columnKey), order: I.order });
|
|
697
|
+
},
|
|
698
|
+
locale: {
|
|
699
|
+
emptyText: /* @__PURE__ */ e(
|
|
700
|
+
se,
|
|
701
|
+
{
|
|
702
|
+
image: se.PRESENTED_IMAGE_SIMPLE,
|
|
703
|
+
description: r ? "没有匹配结果" : y ? "暂无共享记忆库" : "暂无记忆库"
|
|
704
|
+
}
|
|
705
|
+
)
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
)
|
|
709
|
+
}
|
|
710
|
+
)
|
|
711
|
+
] });
|
|
712
|
+
}
|
|
713
|
+
function qt({
|
|
714
|
+
spaceCode: t,
|
|
715
|
+
spaces: n,
|
|
716
|
+
onClose: l,
|
|
717
|
+
onDone: o
|
|
718
|
+
}) {
|
|
719
|
+
const [a, k] = v(""), [r, u] = v(""), [i, s] = v(""), [p, w] = v(""), [b, y] = v(!1), m = W(t, n), C = async () => {
|
|
720
|
+
const f = a.trim();
|
|
721
|
+
if (!f) {
|
|
722
|
+
w("请输入记忆库名称");
|
|
723
|
+
return;
|
|
724
|
+
}
|
|
725
|
+
w(""), y(!0);
|
|
726
|
+
try {
|
|
727
|
+
const S = await we({
|
|
728
|
+
name: f,
|
|
729
|
+
description: i.trim(),
|
|
730
|
+
type: r.trim(),
|
|
731
|
+
spaceCode: t
|
|
732
|
+
});
|
|
733
|
+
if (!S) return;
|
|
734
|
+
o(S);
|
|
735
|
+
} catch (S) {
|
|
736
|
+
w(S instanceof Error ? S.message : "保存失败,请重试");
|
|
737
|
+
} finally {
|
|
738
|
+
y(!1);
|
|
739
|
+
}
|
|
740
|
+
};
|
|
741
|
+
return /* @__PURE__ */ e(
|
|
742
|
+
ct,
|
|
743
|
+
{
|
|
744
|
+
icon: "plus",
|
|
745
|
+
title: "新建记忆库",
|
|
746
|
+
width: 600,
|
|
747
|
+
onClose: l,
|
|
748
|
+
footRight: /* @__PURE__ */ c(H, { children: [
|
|
749
|
+
/* @__PURE__ */ e("button", { className: "btn", type: "button", onClick: l, children: "取消" }),
|
|
750
|
+
/* @__PURE__ */ c(
|
|
751
|
+
"button",
|
|
752
|
+
{
|
|
753
|
+
className: "btn primary",
|
|
754
|
+
type: "button",
|
|
755
|
+
disabled: b,
|
|
756
|
+
onClick: () => void C(),
|
|
757
|
+
children: [
|
|
758
|
+
/* @__PURE__ */ e(R, { name: "check", size: 13 }),
|
|
759
|
+
"创建记忆库"
|
|
760
|
+
]
|
|
761
|
+
}
|
|
762
|
+
)
|
|
763
|
+
] }),
|
|
764
|
+
body: /* @__PURE__ */ c("div", { children: [
|
|
765
|
+
/* @__PURE__ */ c("div", { className: "form-grid", children: [
|
|
766
|
+
/* @__PURE__ */ c("div", { className: "field", children: [
|
|
767
|
+
/* @__PURE__ */ c("label", { children: [
|
|
768
|
+
"记忆库名称 ",
|
|
769
|
+
/* @__PURE__ */ e("span", { className: "req", children: "*" })
|
|
770
|
+
] }),
|
|
771
|
+
/* @__PURE__ */ e(
|
|
772
|
+
"input",
|
|
773
|
+
{
|
|
774
|
+
className: "input",
|
|
775
|
+
value: a,
|
|
776
|
+
maxLength: 100,
|
|
777
|
+
placeholder: "例如:feature-team 项目记忆",
|
|
778
|
+
onChange: (f) => k(f.target.value)
|
|
779
|
+
}
|
|
780
|
+
)
|
|
781
|
+
] }),
|
|
782
|
+
/* @__PURE__ */ c("div", { className: "field", children: [
|
|
783
|
+
/* @__PURE__ */ e("label", { children: "类型" }),
|
|
784
|
+
/* @__PURE__ */ e(
|
|
785
|
+
"input",
|
|
786
|
+
{
|
|
787
|
+
className: "input",
|
|
788
|
+
value: r,
|
|
789
|
+
maxLength: 64,
|
|
790
|
+
placeholder: "自由填写类型",
|
|
791
|
+
onChange: (f) => u(f.target.value)
|
|
792
|
+
}
|
|
793
|
+
)
|
|
794
|
+
] }),
|
|
795
|
+
/* @__PURE__ */ c("div", { className: "field span-2", children: [
|
|
796
|
+
/* @__PURE__ */ e("label", { children: "描述" }),
|
|
797
|
+
/* @__PURE__ */ e(
|
|
798
|
+
"textarea",
|
|
799
|
+
{
|
|
800
|
+
className: "textarea",
|
|
801
|
+
value: i,
|
|
802
|
+
maxLength: 2e3,
|
|
803
|
+
placeholder: "说明这个记忆库服务什么场景",
|
|
804
|
+
onChange: (f) => s(f.target.value)
|
|
805
|
+
}
|
|
806
|
+
)
|
|
807
|
+
] }),
|
|
808
|
+
/* @__PURE__ */ c("div", { className: "field span-2", children: [
|
|
809
|
+
/* @__PURE__ */ e("label", { children: "落点" }),
|
|
810
|
+
/* @__PURE__ */ e("div", { className: "readonly-value", children: m })
|
|
811
|
+
] })
|
|
812
|
+
] }),
|
|
813
|
+
p ? /* @__PURE__ */ e("div", { className: "note", style: { color: "var(--red)", marginTop: 10 }, children: p }) : null
|
|
814
|
+
] })
|
|
815
|
+
}
|
|
816
|
+
);
|
|
817
|
+
}
|
|
818
|
+
function re({
|
|
819
|
+
title: t,
|
|
820
|
+
detail: n,
|
|
821
|
+
remove: l,
|
|
822
|
+
onClose: o,
|
|
823
|
+
onDone: a
|
|
824
|
+
}) {
|
|
825
|
+
const k = q();
|
|
826
|
+
return /* @__PURE__ */ c(
|
|
827
|
+
We,
|
|
828
|
+
{
|
|
829
|
+
open: !0,
|
|
830
|
+
title: t,
|
|
831
|
+
okText: "删除",
|
|
832
|
+
okButtonProps: { danger: !0 },
|
|
833
|
+
cancelText: "取消",
|
|
834
|
+
confirmLoading: k.busy,
|
|
835
|
+
cancelButtonProps: { disabled: k.busy },
|
|
836
|
+
closable: !k.busy,
|
|
837
|
+
maskClosable: !1,
|
|
838
|
+
onCancel: o,
|
|
839
|
+
onOk: () => k.execute(l, a),
|
|
840
|
+
children: [
|
|
841
|
+
/* @__PURE__ */ e("p", { children: n }),
|
|
842
|
+
k.error && /* @__PURE__ */ e(L, { type: "error", showIcon: !0, message: k.error })
|
|
843
|
+
]
|
|
844
|
+
}
|
|
845
|
+
);
|
|
846
|
+
}
|
|
847
|
+
function Ae({
|
|
848
|
+
kind: t,
|
|
849
|
+
base: n,
|
|
850
|
+
space: l,
|
|
851
|
+
spaceCode: o,
|
|
852
|
+
spaces: a,
|
|
853
|
+
onClose: k,
|
|
854
|
+
onDone: r
|
|
855
|
+
}) {
|
|
856
|
+
const u = t === "base" ? n : l, i = u ? u.canManage : t === "space" || !o || a.some(
|
|
857
|
+
(b) => b.code === o && b.canManage
|
|
858
|
+
), [s] = z.useForm(), p = q(), w = t === "base" ? W(o, a) : "共享记忆库";
|
|
859
|
+
return /* @__PURE__ */ c(
|
|
860
|
+
me,
|
|
861
|
+
{
|
|
862
|
+
open: !0,
|
|
863
|
+
width: 480,
|
|
864
|
+
title: `${u ? "" : "新建"}${t === "base" ? "记忆库" : "共享记忆库"}${u ? "配置" : ""}`,
|
|
865
|
+
onClose: k,
|
|
866
|
+
closable: !p.busy,
|
|
867
|
+
maskClosable: !p.busy,
|
|
868
|
+
keyboard: !p.busy,
|
|
869
|
+
extra: i && /* @__PURE__ */ e(
|
|
870
|
+
x,
|
|
871
|
+
{
|
|
872
|
+
type: "primary",
|
|
873
|
+
loading: p.busy,
|
|
874
|
+
onClick: () => s.submit(),
|
|
875
|
+
children: "保存"
|
|
876
|
+
}
|
|
877
|
+
),
|
|
878
|
+
children: [
|
|
879
|
+
p.error && /* @__PURE__ */ e(L, { type: "error", showIcon: !0, message: p.error }),
|
|
880
|
+
/* @__PURE__ */ c(
|
|
881
|
+
z,
|
|
882
|
+
{
|
|
883
|
+
form: s,
|
|
884
|
+
layout: "vertical",
|
|
885
|
+
disabled: !i || p.busy,
|
|
886
|
+
initialValues: {
|
|
887
|
+
name: (u == null ? void 0 : u.name) ?? "",
|
|
888
|
+
description: (u == null ? void 0 : u.description) ?? "",
|
|
889
|
+
type: (n == null ? void 0 : n.type) ?? ""
|
|
890
|
+
},
|
|
891
|
+
onFinish: (b) => {
|
|
892
|
+
if (!i) return;
|
|
893
|
+
const y = {
|
|
894
|
+
code: u == null ? void 0 : u.code,
|
|
895
|
+
name: b.name.trim(),
|
|
896
|
+
description: b.description
|
|
897
|
+
};
|
|
898
|
+
p.execute(
|
|
899
|
+
(m) => t === "space" ? Ue(y, m) : we(
|
|
900
|
+
{ ...y, type: b.type, spaceCode: o },
|
|
901
|
+
m
|
|
902
|
+
),
|
|
903
|
+
r
|
|
904
|
+
);
|
|
905
|
+
},
|
|
906
|
+
children: [
|
|
907
|
+
/* @__PURE__ */ e(
|
|
908
|
+
z.Item,
|
|
909
|
+
{
|
|
910
|
+
label: "名称",
|
|
911
|
+
name: "name",
|
|
912
|
+
rules: [
|
|
913
|
+
{ required: !0, whitespace: !0, message: "请输入名称" },
|
|
914
|
+
{ max: 100 }
|
|
915
|
+
],
|
|
916
|
+
children: /* @__PURE__ */ e(F, { maxLength: 100 })
|
|
917
|
+
}
|
|
918
|
+
),
|
|
919
|
+
/* @__PURE__ */ e(z.Item, { label: "描述", name: "description", rules: [{ max: 2e3 }], children: /* @__PURE__ */ e(F.TextArea, { rows: 4, maxLength: 2e3, showCount: !0 }) }),
|
|
920
|
+
t === "base" && /* @__PURE__ */ e(z.Item, { label: "类型", name: "type", children: /* @__PURE__ */ e(F, { placeholder: "自由填写类型" }) }),
|
|
921
|
+
/* @__PURE__ */ e(z.Item, { label: "落点", children: /* @__PURE__ */ e(A, { title: w, children: /* @__PURE__ */ e("div", { className: "memory-wrap", children: w }) }) }),
|
|
922
|
+
u && /* @__PURE__ */ e(
|
|
923
|
+
z.Item,
|
|
924
|
+
{
|
|
925
|
+
label: /* @__PURE__ */ c("span", { children: [
|
|
926
|
+
"归属",
|
|
927
|
+
" ",
|
|
928
|
+
/* @__PURE__ */ e(A, { title: "归属由服务端确定,移动位置不会改变记忆库自身归属", children: /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(R, { name: "help-circle", size: 12 }) }) })
|
|
929
|
+
] }),
|
|
930
|
+
children: /* @__PURE__ */ e("div", { className: "memory-wrap", children: Q(u) })
|
|
931
|
+
}
|
|
932
|
+
)
|
|
933
|
+
]
|
|
934
|
+
}
|
|
935
|
+
)
|
|
936
|
+
]
|
|
937
|
+
}
|
|
938
|
+
);
|
|
939
|
+
}
|
|
940
|
+
function Jt({
|
|
941
|
+
base: t,
|
|
942
|
+
spaces: n,
|
|
943
|
+
onClose: l,
|
|
944
|
+
onDone: o
|
|
945
|
+
}) {
|
|
946
|
+
const [a, k] = v(), r = q(), u = a !== void 0 && (a === "" || n.some((i) => i.code === a && i.canManage));
|
|
947
|
+
return /* @__PURE__ */ c(
|
|
948
|
+
We,
|
|
949
|
+
{
|
|
950
|
+
open: !0,
|
|
951
|
+
title: "移动记忆库",
|
|
952
|
+
okText: "确认移动",
|
|
953
|
+
cancelText: "取消",
|
|
954
|
+
confirmLoading: r.busy,
|
|
955
|
+
okButtonProps: {
|
|
956
|
+
disabled: !u || a === (t.spaceCode ?? "") || !t.canManage
|
|
957
|
+
},
|
|
958
|
+
cancelButtonProps: { disabled: r.busy },
|
|
959
|
+
closable: !r.busy,
|
|
960
|
+
maskClosable: !1,
|
|
961
|
+
onCancel: l,
|
|
962
|
+
onOk: () => {
|
|
963
|
+
!u || a === void 0 || !t.canManage || r.execute(
|
|
964
|
+
(i) => we(
|
|
965
|
+
{
|
|
966
|
+
code: t.code,
|
|
967
|
+
name: t.name,
|
|
968
|
+
description: t.description,
|
|
969
|
+
type: t.type,
|
|
970
|
+
spaceCode: a
|
|
971
|
+
},
|
|
972
|
+
i
|
|
973
|
+
),
|
|
974
|
+
o
|
|
975
|
+
);
|
|
976
|
+
},
|
|
977
|
+
children: [
|
|
978
|
+
/* @__PURE__ */ c("p", { className: "memory-wrap", children: [
|
|
979
|
+
"当前位置:",
|
|
980
|
+
U(t, n)
|
|
981
|
+
] }),
|
|
982
|
+
/* @__PURE__ */ e(
|
|
983
|
+
yt,
|
|
984
|
+
{
|
|
985
|
+
"aria-label": "目标位置",
|
|
986
|
+
blockNode: !0,
|
|
987
|
+
defaultExpandAll: !0,
|
|
988
|
+
treeData: Gt(n),
|
|
989
|
+
selectedKeys: a === void 0 ? [] : [a ? `space:${a}` : "personal"],
|
|
990
|
+
onSelect: (i) => k(i.length ? Vt(String(i[0])) : void 0)
|
|
991
|
+
}
|
|
992
|
+
),
|
|
993
|
+
/* @__PURE__ */ c("p", { className: "memory-wrap", children: [
|
|
994
|
+
"完整落点:",
|
|
995
|
+
a === void 0 ? "请选择目标共享记忆库或我的记忆库" : `${W(a, n)} / ${t.name}`
|
|
996
|
+
] }),
|
|
997
|
+
r.error && /* @__PURE__ */ e(L, { type: "error", showIcon: !0, message: r.error })
|
|
998
|
+
]
|
|
999
|
+
}
|
|
1000
|
+
);
|
|
1001
|
+
}
|
|
1002
|
+
function Qt({
|
|
1003
|
+
base: t,
|
|
1004
|
+
initialItem: n,
|
|
1005
|
+
initialEditing: l,
|
|
1006
|
+
onClose: o,
|
|
1007
|
+
onChanged: a,
|
|
1008
|
+
onSaved: k
|
|
1009
|
+
}) {
|
|
1010
|
+
var C;
|
|
1011
|
+
const [r, u] = v(n), [i, s] = v(l || !n), [p, w] = v(!1), [b] = z.useForm(), y = q(), m = (f) => {
|
|
1012
|
+
u(f), s(!1), a(), k == null || k(f);
|
|
1013
|
+
};
|
|
1014
|
+
return /* @__PURE__ */ c(
|
|
1015
|
+
me,
|
|
1016
|
+
{
|
|
1017
|
+
open: !0,
|
|
1018
|
+
width: 680,
|
|
1019
|
+
rootClassName: "memory-item-drawer",
|
|
1020
|
+
title: r ? "记忆条目" : "新建记忆条目",
|
|
1021
|
+
onClose: o,
|
|
1022
|
+
closable: !y.busy,
|
|
1023
|
+
maskClosable: !y.busy,
|
|
1024
|
+
keyboard: !y.busy,
|
|
1025
|
+
extra: t.canWrite && /* @__PURE__ */ e(ne, { children: i ? /* @__PURE__ */ c(H, { children: [
|
|
1026
|
+
/* @__PURE__ */ e(
|
|
1027
|
+
x,
|
|
1028
|
+
{
|
|
1029
|
+
disabled: y.busy || !r,
|
|
1030
|
+
onClick: () => s(!1),
|
|
1031
|
+
children: "取消编辑"
|
|
1032
|
+
}
|
|
1033
|
+
),
|
|
1034
|
+
/* @__PURE__ */ e(
|
|
1035
|
+
x,
|
|
1036
|
+
{
|
|
1037
|
+
type: "primary",
|
|
1038
|
+
loading: y.busy,
|
|
1039
|
+
onClick: () => b.submit(),
|
|
1040
|
+
children: "保存"
|
|
1041
|
+
}
|
|
1042
|
+
)
|
|
1043
|
+
] }) : r && /* @__PURE__ */ c(H, { children: [
|
|
1044
|
+
/* @__PURE__ */ e(
|
|
1045
|
+
x,
|
|
1046
|
+
{
|
|
1047
|
+
disabled: y.busy,
|
|
1048
|
+
onClick: () => {
|
|
1049
|
+
b.setFieldsValue(r), s(!0);
|
|
1050
|
+
},
|
|
1051
|
+
children: "编辑"
|
|
1052
|
+
}
|
|
1053
|
+
),
|
|
1054
|
+
/* @__PURE__ */ e(
|
|
1055
|
+
x,
|
|
1056
|
+
{
|
|
1057
|
+
loading: y.busy,
|
|
1058
|
+
onClick: () => y.execute(
|
|
1059
|
+
(f) => de(
|
|
1060
|
+
{ ...r, enabled: !r.enabled },
|
|
1061
|
+
f
|
|
1062
|
+
),
|
|
1063
|
+
m
|
|
1064
|
+
),
|
|
1065
|
+
children: r.enabled ? "停用" : "启用"
|
|
1066
|
+
}
|
|
1067
|
+
),
|
|
1068
|
+
/* @__PURE__ */ e(
|
|
1069
|
+
x,
|
|
1070
|
+
{
|
|
1071
|
+
danger: !0,
|
|
1072
|
+
disabled: y.busy,
|
|
1073
|
+
onClick: () => w(!0),
|
|
1074
|
+
children: "删除"
|
|
1075
|
+
}
|
|
1076
|
+
)
|
|
1077
|
+
] }) }),
|
|
1078
|
+
children: [
|
|
1079
|
+
y.error && /* @__PURE__ */ e(L, { type: "error", showIcon: !0, message: y.error }),
|
|
1080
|
+
i ? /* @__PURE__ */ c(
|
|
1081
|
+
z,
|
|
1082
|
+
{
|
|
1083
|
+
form: b,
|
|
1084
|
+
layout: "vertical",
|
|
1085
|
+
disabled: !t.canWrite || y.busy,
|
|
1086
|
+
initialValues: r ?? {
|
|
1087
|
+
title: "",
|
|
1088
|
+
description: "",
|
|
1089
|
+
content: "",
|
|
1090
|
+
tags: [],
|
|
1091
|
+
sourceText: "",
|
|
1092
|
+
enabled: !0
|
|
1093
|
+
},
|
|
1094
|
+
onFinish: (f) => {
|
|
1095
|
+
t.canWrite && y.execute(
|
|
1096
|
+
(S) => de(
|
|
1097
|
+
{
|
|
1098
|
+
code: r == null ? void 0 : r.code,
|
|
1099
|
+
baseCode: t.code,
|
|
1100
|
+
title: f.title.trim(),
|
|
1101
|
+
description: f.description,
|
|
1102
|
+
content: f.content,
|
|
1103
|
+
tags: f.tags ?? [],
|
|
1104
|
+
sourceText: f.sourceText,
|
|
1105
|
+
enabled: f.enabled
|
|
1106
|
+
},
|
|
1107
|
+
S
|
|
1108
|
+
),
|
|
1109
|
+
m
|
|
1110
|
+
);
|
|
1111
|
+
},
|
|
1112
|
+
children: [
|
|
1113
|
+
/* @__PURE__ */ e(
|
|
1114
|
+
z.Item,
|
|
1115
|
+
{
|
|
1116
|
+
name: "title",
|
|
1117
|
+
label: "标题",
|
|
1118
|
+
rules: [
|
|
1119
|
+
{ required: !0, whitespace: !0, message: "请输入标题" },
|
|
1120
|
+
{ max: 200 }
|
|
1121
|
+
],
|
|
1122
|
+
children: /* @__PURE__ */ e(F, { maxLength: 200 })
|
|
1123
|
+
}
|
|
1124
|
+
),
|
|
1125
|
+
/* @__PURE__ */ e(
|
|
1126
|
+
z.Item,
|
|
1127
|
+
{
|
|
1128
|
+
name: "description",
|
|
1129
|
+
label: "说明",
|
|
1130
|
+
rules: [{ max: 2e3 }],
|
|
1131
|
+
children: /* @__PURE__ */ e(
|
|
1132
|
+
F.TextArea,
|
|
1133
|
+
{
|
|
1134
|
+
rows: 2,
|
|
1135
|
+
maxLength: 2e3,
|
|
1136
|
+
autoSize: { minRows: 1, maxRows: 4 },
|
|
1137
|
+
placeholder: "一句话说明这条记忆何时有用,召回时优先读取"
|
|
1138
|
+
}
|
|
1139
|
+
)
|
|
1140
|
+
}
|
|
1141
|
+
),
|
|
1142
|
+
/* @__PURE__ */ e(
|
|
1143
|
+
z.Item,
|
|
1144
|
+
{
|
|
1145
|
+
name: "tags",
|
|
1146
|
+
label: "标签",
|
|
1147
|
+
rules: [
|
|
1148
|
+
{
|
|
1149
|
+
validator: (f, S) => !S || S.length <= 20 && S.every(
|
|
1150
|
+
(M) => M.trim().length > 0 && M.length <= 64
|
|
1151
|
+
) ? Promise.resolve() : Promise.reject(new Error("最多 20 个标签,每项 1–64 字"))
|
|
1152
|
+
}
|
|
1153
|
+
],
|
|
1154
|
+
children: /* @__PURE__ */ e(ce, { mode: "tags", tokenSeparators: [",", ","], maxCount: 20 })
|
|
1155
|
+
}
|
|
1156
|
+
),
|
|
1157
|
+
/* @__PURE__ */ e(z.Item, { name: "sourceText", label: "来源", rules: [{ max: 2e3 }], children: /* @__PURE__ */ e(F.TextArea, { rows: 3, maxLength: 2e3, showCount: !0 }) }),
|
|
1158
|
+
/* @__PURE__ */ e(z.Item, { name: "enabled", label: "启用", valuePropName: "checked", children: /* @__PURE__ */ e(bt, {}) }),
|
|
1159
|
+
/* @__PURE__ */ e(
|
|
1160
|
+
z.Item,
|
|
1161
|
+
{
|
|
1162
|
+
name: "content",
|
|
1163
|
+
label: "正文",
|
|
1164
|
+
rules: [
|
|
1165
|
+
{ required: !0, whitespace: !0, message: "请输入正文" },
|
|
1166
|
+
{ max: 2e4 }
|
|
1167
|
+
],
|
|
1168
|
+
children: /* @__PURE__ */ e(
|
|
1169
|
+
Fe,
|
|
1170
|
+
{
|
|
1171
|
+
mode: "live",
|
|
1172
|
+
placeholder: "用 Markdown 记录这条记忆,支持工具栏与 ⌘S 保存…"
|
|
1173
|
+
}
|
|
1174
|
+
)
|
|
1175
|
+
}
|
|
1176
|
+
)
|
|
1177
|
+
]
|
|
1178
|
+
}
|
|
1179
|
+
) : r && /* @__PURE__ */ e(
|
|
1180
|
+
ft,
|
|
1181
|
+
{
|
|
1182
|
+
column: 1,
|
|
1183
|
+
size: "small",
|
|
1184
|
+
layout: "vertical",
|
|
1185
|
+
items: [
|
|
1186
|
+
{
|
|
1187
|
+
key: "title",
|
|
1188
|
+
label: "标题",
|
|
1189
|
+
children: /* @__PURE__ */ e("div", { className: "memory-wrap", children: r.title })
|
|
1190
|
+
},
|
|
1191
|
+
{
|
|
1192
|
+
key: "description",
|
|
1193
|
+
label: "说明",
|
|
1194
|
+
children: /* @__PURE__ */ e("div", { className: "memory-wrap", children: r.description || "—" })
|
|
1195
|
+
},
|
|
1196
|
+
{
|
|
1197
|
+
key: "content",
|
|
1198
|
+
label: "正文",
|
|
1199
|
+
children: /* @__PURE__ */ e("div", { className: "memory-full-content", children: r.content })
|
|
1200
|
+
},
|
|
1201
|
+
{
|
|
1202
|
+
key: "tags",
|
|
1203
|
+
label: "标签",
|
|
1204
|
+
children: (C = r.tags) != null && C.length ? r.tags.map((f, S) => /* @__PURE__ */ e(A, { title: f, children: /* @__PURE__ */ e(Ge, { className: "memory-wrap", children: f }) }, `${f}-${S}`)) : "—"
|
|
1205
|
+
},
|
|
1206
|
+
{
|
|
1207
|
+
key: "source",
|
|
1208
|
+
label: "来源",
|
|
1209
|
+
children: /* @__PURE__ */ e("div", { className: "memory-full-content", children: r.sourceText || "—" })
|
|
1210
|
+
},
|
|
1211
|
+
{
|
|
1212
|
+
key: "enabled",
|
|
1213
|
+
label: "状态",
|
|
1214
|
+
children: r.enabled ? "启用" : "停用"
|
|
1215
|
+
},
|
|
1216
|
+
{ key: "updated", label: "更新时间", children: r.updateTime }
|
|
1217
|
+
]
|
|
1218
|
+
}
|
|
1219
|
+
),
|
|
1220
|
+
p && r && /* @__PURE__ */ e(
|
|
1221
|
+
re,
|
|
1222
|
+
{
|
|
1223
|
+
title: "删除记忆条目",
|
|
1224
|
+
detail: `删除「${r.title}」后不可恢复。`,
|
|
1225
|
+
remove: (f) => qe(r.code, f),
|
|
1226
|
+
onClose: () => w(!1),
|
|
1227
|
+
onDone: () => {
|
|
1228
|
+
a(), o();
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
)
|
|
1232
|
+
]
|
|
1233
|
+
}
|
|
1234
|
+
);
|
|
1235
|
+
}
|
|
1236
|
+
function Zt(t, n) {
|
|
1237
|
+
const l = te(null), [o, a] = v(), [k, r] = v(), [u, i] = v(""), [s, p] = v({
|
|
1238
|
+
status: "idle",
|
|
1239
|
+
processed: 0,
|
|
1240
|
+
current: 0
|
|
1241
|
+
});
|
|
1242
|
+
return K(() => () => {
|
|
1243
|
+
var m;
|
|
1244
|
+
return (m = l.current) == null ? void 0 : m.abort();
|
|
1245
|
+
}, []), { busy: o, result: k, error: u, rebuild: s, recall: async (m) => {
|
|
1246
|
+
if (l.current) return;
|
|
1247
|
+
if (!m.trim() || m.length > 1e3) {
|
|
1248
|
+
i("请输入 1–1000 字的自然语言问题"), r(void 0);
|
|
1249
|
+
return;
|
|
1250
|
+
}
|
|
1251
|
+
const C = new AbortController();
|
|
1252
|
+
l.current = C, a("recall"), i(""), r(void 0);
|
|
1253
|
+
try {
|
|
1254
|
+
const f = await zt(
|
|
1255
|
+
{
|
|
1256
|
+
baseCodes: n.length ? n : [t.code],
|
|
1257
|
+
query: m.trim(),
|
|
1258
|
+
topK: 5,
|
|
1259
|
+
maxChars: 6e3
|
|
1260
|
+
},
|
|
1261
|
+
C.signal
|
|
1262
|
+
);
|
|
1263
|
+
C.signal.aborted || r(f);
|
|
1264
|
+
} catch (f) {
|
|
1265
|
+
C.signal.aborted || i(Z(f));
|
|
1266
|
+
} finally {
|
|
1267
|
+
l.current === C && (l.current = null, C.signal.aborted || a(void 0));
|
|
1268
|
+
}
|
|
1269
|
+
}, rebuildIndex: async () => {
|
|
1270
|
+
if (!t.canManage || l.current) return;
|
|
1271
|
+
const m = new AbortController();
|
|
1272
|
+
l.current = m, a("rebuild"), r(void 0);
|
|
1273
|
+
let C = 0, f = 1;
|
|
1274
|
+
const S = 10;
|
|
1275
|
+
p((M) => ({
|
|
1276
|
+
status: "running",
|
|
1277
|
+
processed: C,
|
|
1278
|
+
current: f,
|
|
1279
|
+
error: M.error
|
|
1280
|
+
}));
|
|
1281
|
+
try {
|
|
1282
|
+
for (; !m.signal.aborted; ) {
|
|
1283
|
+
const M = await Dt(
|
|
1284
|
+
{ baseCode: t.code, current: f, size: S },
|
|
1285
|
+
m.signal
|
|
1286
|
+
);
|
|
1287
|
+
if (m.signal.aborted) return;
|
|
1288
|
+
const N = Number(M.processed), $ = Number(M.total), E = Number(M.current), j = Number(M.size);
|
|
1289
|
+
if (![N, $, E, j].every(Number.isSafeInteger) || N < 0 || $ < 0 || E !== f || j !== S)
|
|
1290
|
+
throw new Error("重建进度响应无效,请重试");
|
|
1291
|
+
if (C += N, E * j >= $) {
|
|
1292
|
+
p({ status: "success", processed: C, total: $, current: f });
|
|
1293
|
+
return;
|
|
1294
|
+
}
|
|
1295
|
+
f = E + 1, p((g) => ({
|
|
1296
|
+
...g,
|
|
1297
|
+
status: "running",
|
|
1298
|
+
processed: C,
|
|
1299
|
+
total: $,
|
|
1300
|
+
current: f
|
|
1301
|
+
}));
|
|
1302
|
+
}
|
|
1303
|
+
} catch (M) {
|
|
1304
|
+
m.signal.aborted || p((N) => ({
|
|
1305
|
+
...N,
|
|
1306
|
+
status: "error",
|
|
1307
|
+
error: Z(M)
|
|
1308
|
+
}));
|
|
1309
|
+
} finally {
|
|
1310
|
+
l.current === m && (l.current = null, m.signal.aborted || a(void 0));
|
|
1311
|
+
}
|
|
1312
|
+
}, cancel: () => {
|
|
1313
|
+
var m;
|
|
1314
|
+
(m = l.current) == null || m.abort(), l.current = null, a(void 0), p(
|
|
1315
|
+
(C) => C.status === "running" ? { ...C, status: "stopped" } : C
|
|
1316
|
+
);
|
|
1317
|
+
} };
|
|
1318
|
+
}
|
|
1319
|
+
function Xt({
|
|
1320
|
+
base: t,
|
|
1321
|
+
scopeBases: n,
|
|
1322
|
+
scopeLabel: l,
|
|
1323
|
+
onClose: o
|
|
1324
|
+
}) {
|
|
1325
|
+
const [a, k] = v(""), { busy: r, result: u, error: i, rebuild: s, recall: p, rebuildIndex: w, cancel: b } = Zt(t, n.map((m) => m.code)), y = () => {
|
|
1326
|
+
b(), o();
|
|
1327
|
+
};
|
|
1328
|
+
return /* @__PURE__ */ e(
|
|
1329
|
+
me,
|
|
1330
|
+
{
|
|
1331
|
+
open: !0,
|
|
1332
|
+
width: 680,
|
|
1333
|
+
title: "语义召回",
|
|
1334
|
+
onClose: y,
|
|
1335
|
+
footer: /* @__PURE__ */ e(x, { onClick: y, children: "关闭" }),
|
|
1336
|
+
children: /* @__PURE__ */ c(Ce, { vertical: !0, gap: "middle", children: [
|
|
1337
|
+
/* @__PURE__ */ c(Y.Text, { children: [
|
|
1338
|
+
"「",
|
|
1339
|
+
l,
|
|
1340
|
+
"」下全部 ",
|
|
1341
|
+
n.length,
|
|
1342
|
+
" 个记忆库按需召回:仅在手动提交后检索这些库, 不是关键词搜索。记忆是历史线索,需核实现状;结果仅供只读参考,摘录可能截断。"
|
|
1343
|
+
] }),
|
|
1344
|
+
/* @__PURE__ */ e(
|
|
1345
|
+
F.TextArea,
|
|
1346
|
+
{
|
|
1347
|
+
"aria-label": "自然语言问题",
|
|
1348
|
+
placeholder: "用自然语言描述你想找回的记忆",
|
|
1349
|
+
value: a,
|
|
1350
|
+
onChange: (m) => k(m.target.value),
|
|
1351
|
+
rows: 4,
|
|
1352
|
+
maxLength: 1e3,
|
|
1353
|
+
showCount: !0,
|
|
1354
|
+
disabled: !!r
|
|
1355
|
+
}
|
|
1356
|
+
),
|
|
1357
|
+
/* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(
|
|
1358
|
+
x,
|
|
1359
|
+
{
|
|
1360
|
+
type: "primary",
|
|
1361
|
+
"aria-label": "开始召回",
|
|
1362
|
+
loading: r === "recall",
|
|
1363
|
+
disabled: !!r || !a.trim() || a.length > 1e3,
|
|
1364
|
+
onClick: () => void p(a),
|
|
1365
|
+
children: "开始召回"
|
|
1366
|
+
}
|
|
1367
|
+
) }),
|
|
1368
|
+
r === "recall" && /* @__PURE__ */ e(Y.Text, { children: "正在语义召回…" }),
|
|
1369
|
+
i && /* @__PURE__ */ e(
|
|
1370
|
+
L,
|
|
1371
|
+
{
|
|
1372
|
+
type: "error",
|
|
1373
|
+
showIcon: !0,
|
|
1374
|
+
message: "语义召回失败",
|
|
1375
|
+
description: i
|
|
1376
|
+
}
|
|
1377
|
+
),
|
|
1378
|
+
u && /* @__PURE__ */ c(H, { children: [
|
|
1379
|
+
/* @__PURE__ */ c(Y.Text, { type: "secondary", children: [
|
|
1380
|
+
"嵌入模型:",
|
|
1381
|
+
u.embeddingModel || "未返回",
|
|
1382
|
+
"; 重排模型:",
|
|
1383
|
+
u.rerankModel || "未返回"
|
|
1384
|
+
] }),
|
|
1385
|
+
u.hits.length === 0 ? /* @__PURE__ */ e(
|
|
1386
|
+
L,
|
|
1387
|
+
{
|
|
1388
|
+
type: "info",
|
|
1389
|
+
message: "未召回相关记忆",
|
|
1390
|
+
description: "请换一种描述后手动重试。"
|
|
1391
|
+
}
|
|
1392
|
+
) : /* @__PURE__ */ e(
|
|
1393
|
+
ge,
|
|
1394
|
+
{
|
|
1395
|
+
itemLayout: "vertical",
|
|
1396
|
+
dataSource: u.hits,
|
|
1397
|
+
renderItem: (m) => /* @__PURE__ */ c(ge.Item, { children: [
|
|
1398
|
+
/* @__PURE__ */ e(
|
|
1399
|
+
ge.Item.Meta,
|
|
1400
|
+
{
|
|
1401
|
+
title: /* @__PURE__ */ e("span", { className: "memory-wrap", children: m.item.title }),
|
|
1402
|
+
description: /* @__PURE__ */ c("span", { className: "memory-wrap", children: [
|
|
1403
|
+
"相关度:",
|
|
1404
|
+
m.score,
|
|
1405
|
+
";来源:",
|
|
1406
|
+
m.item.sourceText || "未提供来源"
|
|
1407
|
+
] })
|
|
1408
|
+
}
|
|
1409
|
+
),
|
|
1410
|
+
/* @__PURE__ */ e("div", { className: "memory-full-content", children: m.excerpt })
|
|
1411
|
+
] }, m.item.code)
|
|
1412
|
+
}
|
|
1413
|
+
)
|
|
1414
|
+
] }),
|
|
1415
|
+
t.canManage && /* @__PURE__ */ c(Ce, { vertical: !0, gap: "small", children: [
|
|
1416
|
+
/* @__PURE__ */ e(Y.Text, { type: "secondary", children: "索引由库 owner 维护,每批 10 条。停止或关闭仅取消当前请求,不能撤回已完成的批次, 服务端可能继续处理在途请求;失败或停止后可从第 1 页幂等重跑。" }),
|
|
1417
|
+
/* @__PURE__ */ c(ne, { children: [
|
|
1418
|
+
/* @__PURE__ */ e(
|
|
1419
|
+
x,
|
|
1420
|
+
{
|
|
1421
|
+
"aria-label": "重建召回索引",
|
|
1422
|
+
disabled: !!r,
|
|
1423
|
+
loading: r === "rebuild",
|
|
1424
|
+
onClick: () => void w(),
|
|
1425
|
+
children: "重建召回索引"
|
|
1426
|
+
}
|
|
1427
|
+
),
|
|
1428
|
+
r === "rebuild" && /* @__PURE__ */ e(x, { onClick: b, children: "停止重建" })
|
|
1429
|
+
] }),
|
|
1430
|
+
s.status !== "idle" && /* @__PURE__ */ c(Y.Text, { role: "status", children: [
|
|
1431
|
+
"已确认处理 ",
|
|
1432
|
+
s.processed,
|
|
1433
|
+
" 条 / 总计 ",
|
|
1434
|
+
s.total ?? "待返回",
|
|
1435
|
+
" 条",
|
|
1436
|
+
s.status === "running" && `,正在处理第 ${s.current} 批`
|
|
1437
|
+
] }),
|
|
1438
|
+
s.error && /* @__PURE__ */ e(
|
|
1439
|
+
L,
|
|
1440
|
+
{
|
|
1441
|
+
type: "error",
|
|
1442
|
+
showIcon: !0,
|
|
1443
|
+
message: s.status === "error" ? "召回索引重建失败" : "上次重建失败",
|
|
1444
|
+
description: s.error
|
|
1445
|
+
}
|
|
1446
|
+
),
|
|
1447
|
+
s.status === "stopped" && /* @__PURE__ */ e(L, { type: "warning", message: "已停止等待重建,未确认批次的结果未知,可幂等重跑。" }),
|
|
1448
|
+
s.status === "success" && /* @__PURE__ */ e(L, { type: "success", showIcon: !0, message: `召回索引重建完成,已处理 ${s.processed} 条` })
|
|
1449
|
+
] })
|
|
1450
|
+
] })
|
|
1451
|
+
}
|
|
1452
|
+
);
|
|
1453
|
+
}
|
|
1454
|
+
const ve = 20;
|
|
1455
|
+
function Yt({
|
|
1456
|
+
base: t,
|
|
1457
|
+
bases: n,
|
|
1458
|
+
spaces: l,
|
|
1459
|
+
onDialog: o
|
|
1460
|
+
}) {
|
|
1461
|
+
var De;
|
|
1462
|
+
const [a, k] = v({
|
|
1463
|
+
keyword: "",
|
|
1464
|
+
enabled: void 0
|
|
1465
|
+
}), [r, u] = v(0), [i, s] = v([]), [p, w] = v(0), [b, y] = v("loading"), [m, C] = v(""), [f, S] = v(2), [M, N] = v(!1), [$, E] = v(!1), [j, g] = v(""), h = te(null), D = te(null), [I, J] = v(), [X, ue] = v(), [Je, pe] = v(!1), [Qe, $e] = v(), [he, Ze] = v(!0), [Me, ae] = v(!1), [oe, Se] = v(""), [Ie, Te] = v("live"), Ee = V(
|
|
1466
|
+
(d) => Le(
|
|
1467
|
+
{
|
|
1468
|
+
baseCode: t.code,
|
|
1469
|
+
current: 1,
|
|
1470
|
+
size: ve,
|
|
1471
|
+
keyword: a.keyword,
|
|
1472
|
+
enabled: a.enabled
|
|
1473
|
+
},
|
|
1474
|
+
d
|
|
1475
|
+
),
|
|
1476
|
+
[t.code, a]
|
|
1477
|
+
);
|
|
1478
|
+
K(() => {
|
|
1479
|
+
var P;
|
|
1480
|
+
const d = new AbortController();
|
|
1481
|
+
return (P = D.current) == null || P.abort(), E(!1), g(""), y("loading"), C(""), Ee(d.signal).then((B) => {
|
|
1482
|
+
d.signal.aborted || (s(B.records), w(B.total), S(2), N(B.records.length === 0), y("ready"));
|
|
1483
|
+
}).catch((B) => {
|
|
1484
|
+
d.signal.aborted || (C(Z(B)), y("error"));
|
|
1485
|
+
}), () => d.abort();
|
|
1486
|
+
}, [Ee, r]);
|
|
1487
|
+
const ye = V(() => u((d) => d + 1), []), le = V(() => {
|
|
1488
|
+
if (b !== "ready" || $ || M || f > Math.max(1, Math.ceil(p / ve))) return;
|
|
1489
|
+
const d = new AbortController();
|
|
1490
|
+
D.current = d, E(!0), g(""), Le(
|
|
1491
|
+
{
|
|
1492
|
+
baseCode: t.code,
|
|
1493
|
+
current: f,
|
|
1494
|
+
size: ve,
|
|
1495
|
+
keyword: a.keyword,
|
|
1496
|
+
enabled: a.enabled
|
|
1497
|
+
},
|
|
1498
|
+
d.signal
|
|
1499
|
+
).then((P) => {
|
|
1500
|
+
d.signal.aborted || (s((B) => {
|
|
1501
|
+
const at = new Set(B.map((be) => be.code));
|
|
1502
|
+
return [
|
|
1503
|
+
...B,
|
|
1504
|
+
...P.records.filter((be) => !at.has(be.code))
|
|
1505
|
+
];
|
|
1506
|
+
}), w(P.total), S(f + 1), P.records.length === 0 && N(!0));
|
|
1507
|
+
}).catch((P) => {
|
|
1508
|
+
d.signal.aborted || g(Z(P));
|
|
1509
|
+
}).finally(() => {
|
|
1510
|
+
D.current === d && (D.current = null), d.signal.aborted || E(!1);
|
|
1511
|
+
});
|
|
1512
|
+
}, [t.code, b, $, M, p, f, a]);
|
|
1513
|
+
K(() => {
|
|
1514
|
+
if (b !== "ready") return;
|
|
1515
|
+
const d = h.current;
|
|
1516
|
+
!d || d.scrollHeight > d.clientHeight || le();
|
|
1517
|
+
}, [b, i, p, f, M, $, le]);
|
|
1518
|
+
const Xe = () => {
|
|
1519
|
+
const d = h.current;
|
|
1520
|
+
d && (d.scrollTop + d.clientHeight < d.scrollHeight - 120 || le());
|
|
1521
|
+
}, Pe = V((d) => {
|
|
1522
|
+
s(
|
|
1523
|
+
(P) => P.map((B) => B.code === d.code ? d : B)
|
|
1524
|
+
);
|
|
1525
|
+
}, []), Ye = V((d) => {
|
|
1526
|
+
s((P) => P.filter((B) => B.code !== d)), w((P) => Math.max(0, P - 1));
|
|
1527
|
+
}, []), T = i.find((d) => d.code === I), G = q(), et = n.filter(
|
|
1528
|
+
(d) => (d.spaceCode ?? "") === (t.spaceCode ?? "")
|
|
1529
|
+
), tt = W(t.spaceCode, l), nt = () => {
|
|
1530
|
+
T && G.execute(
|
|
1531
|
+
(d) => de({ ...T, enabled: !T.enabled }, d),
|
|
1532
|
+
(d) => Pe(d)
|
|
1533
|
+
);
|
|
1534
|
+
};
|
|
1535
|
+
K(() => {
|
|
1536
|
+
ae(!1), Te("live");
|
|
1537
|
+
}, [I]);
|
|
1538
|
+
const rt = () => {
|
|
1539
|
+
T && (Se(T.content), ae(!0));
|
|
1540
|
+
}, ze = () => {
|
|
1541
|
+
!T || !oe.trim() || G.execute(
|
|
1542
|
+
(d) => de({ ...T, content: oe }, d),
|
|
1543
|
+
(d) => {
|
|
1544
|
+
ae(!1), Pe(d);
|
|
1545
|
+
}
|
|
1546
|
+
);
|
|
1547
|
+
};
|
|
1548
|
+
return /* @__PURE__ */ c(H, { children: [
|
|
1549
|
+
/* @__PURE__ */ c("div", { className: "memory-toolbar", children: [
|
|
1550
|
+
/* @__PURE__ */ e(A, { title: U(t, l), children: /* @__PURE__ */ e("span", { className: "memory-location", children: U(t, l) }) }),
|
|
1551
|
+
/* @__PURE__ */ e(
|
|
1552
|
+
F.Search,
|
|
1553
|
+
{
|
|
1554
|
+
"aria-label": "搜索记忆条目",
|
|
1555
|
+
placeholder: "搜索条目",
|
|
1556
|
+
allowClear: !0,
|
|
1557
|
+
onSearch: (d) => k((P) => ({ ...P, keyword: d }))
|
|
1558
|
+
}
|
|
1559
|
+
),
|
|
1560
|
+
/* @__PURE__ */ e(x, { onClick: () => $e(t.code), children: "语义召回" }),
|
|
1561
|
+
/* @__PURE__ */ e(
|
|
1562
|
+
ce,
|
|
1563
|
+
{
|
|
1564
|
+
"aria-label": "启用状态筛选",
|
|
1565
|
+
value: a.enabled === void 0 ? "all" : String(a.enabled),
|
|
1566
|
+
options: [
|
|
1567
|
+
{ value: "all", label: "全部状态" },
|
|
1568
|
+
{ value: "true", label: "启用" },
|
|
1569
|
+
{ value: "false", label: "停用" }
|
|
1570
|
+
],
|
|
1571
|
+
onChange: (d) => k((P) => ({
|
|
1572
|
+
...P,
|
|
1573
|
+
enabled: d === "all" ? void 0 : d === "true"
|
|
1574
|
+
}))
|
|
1575
|
+
}
|
|
1576
|
+
),
|
|
1577
|
+
/* @__PURE__ */ e(
|
|
1578
|
+
x,
|
|
1579
|
+
{
|
|
1580
|
+
"aria-label": "刷新条目",
|
|
1581
|
+
icon: /* @__PURE__ */ e(R, { name: "refresh", size: 14 }),
|
|
1582
|
+
onClick: ye
|
|
1583
|
+
}
|
|
1584
|
+
),
|
|
1585
|
+
t.canWrite && /* @__PURE__ */ e(
|
|
1586
|
+
x,
|
|
1587
|
+
{
|
|
1588
|
+
type: "primary",
|
|
1589
|
+
icon: /* @__PURE__ */ e(R, { name: "plus", size: 14 }),
|
|
1590
|
+
onClick: () => ue({ editing: !0 }),
|
|
1591
|
+
children: "新建条目"
|
|
1592
|
+
}
|
|
1593
|
+
),
|
|
1594
|
+
/* @__PURE__ */ e(Ne, { base: t, spaces: l, onDialog: o })
|
|
1595
|
+
] }),
|
|
1596
|
+
/* @__PURE__ */ c("div", { className: "memory-item-split", children: [
|
|
1597
|
+
/* @__PURE__ */ e("div", { className: "memory-item-pane", children: /* @__PURE__ */ c(
|
|
1598
|
+
"div",
|
|
1599
|
+
{
|
|
1600
|
+
className: "memory-item-rows",
|
|
1601
|
+
ref: h,
|
|
1602
|
+
onScroll: Xe,
|
|
1603
|
+
role: "list",
|
|
1604
|
+
"aria-label": "记忆条目列表",
|
|
1605
|
+
children: [
|
|
1606
|
+
b === "error" ? /* @__PURE__ */ e("div", { className: "memory-state", children: /* @__PURE__ */ e(
|
|
1607
|
+
L,
|
|
1608
|
+
{
|
|
1609
|
+
type: "error",
|
|
1610
|
+
message: "条目加载失败",
|
|
1611
|
+
description: m,
|
|
1612
|
+
action: /* @__PURE__ */ e(x, { onClick: ye, children: "重试" })
|
|
1613
|
+
}
|
|
1614
|
+
) }) : b === "loading" ? /* @__PURE__ */ e("div", { className: "memory-state", role: "status", "aria-label": "条目加载中", children: /* @__PURE__ */ e(ke, {}) }) : i.length === 0 ? /* @__PURE__ */ e(
|
|
1615
|
+
se,
|
|
1616
|
+
{
|
|
1617
|
+
image: se.PRESENTED_IMAGE_SIMPLE,
|
|
1618
|
+
description: a.keyword || a.enabled !== void 0 ? "没有匹配条目" : "暂无记忆条目"
|
|
1619
|
+
}
|
|
1620
|
+
) : i.map((d) => /* @__PURE__ */ c(
|
|
1621
|
+
"div",
|
|
1622
|
+
{
|
|
1623
|
+
role: "listitem",
|
|
1624
|
+
className: `memory-item-row${d.code === I ? " active" : ""}${d.enabled ? "" : " off"}`,
|
|
1625
|
+
children: [
|
|
1626
|
+
/* @__PURE__ */ c(
|
|
1627
|
+
"button",
|
|
1628
|
+
{
|
|
1629
|
+
type: "button",
|
|
1630
|
+
className: "memory-item-main",
|
|
1631
|
+
onClick: () => J(d.code),
|
|
1632
|
+
children: [
|
|
1633
|
+
/* @__PURE__ */ e("span", { className: "t", children: d.title }),
|
|
1634
|
+
/* @__PURE__ */ c("span", { className: "m", children: [
|
|
1635
|
+
/* @__PURE__ */ e(
|
|
1636
|
+
"span",
|
|
1637
|
+
{
|
|
1638
|
+
className: `memory-status${d.enabled ? " on" : ""}`,
|
|
1639
|
+
children: d.enabled ? "启用" : "停用"
|
|
1640
|
+
}
|
|
1641
|
+
),
|
|
1642
|
+
d.updateTime ? /* @__PURE__ */ e("span", { children: d.updateTime }) : null
|
|
1643
|
+
] })
|
|
1644
|
+
]
|
|
1645
|
+
}
|
|
1646
|
+
),
|
|
1647
|
+
t.canWrite && /* @__PURE__ */ e(A, { title: "编辑元信息", children: /* @__PURE__ */ e(
|
|
1648
|
+
"button",
|
|
1649
|
+
{
|
|
1650
|
+
type: "button",
|
|
1651
|
+
className: "memory-item-gear",
|
|
1652
|
+
"aria-label": `编辑元信息:${d.title}`,
|
|
1653
|
+
onClick: () => {
|
|
1654
|
+
J(d.code), ue({ item: d, editing: !0 });
|
|
1655
|
+
},
|
|
1656
|
+
children: /* @__PURE__ */ e(R, { name: "settings", size: 12 })
|
|
1657
|
+
}
|
|
1658
|
+
) })
|
|
1659
|
+
]
|
|
1660
|
+
},
|
|
1661
|
+
d.code
|
|
1662
|
+
)),
|
|
1663
|
+
$ && /* @__PURE__ */ e("div", { className: "memory-more-hint", role: "status", children: "正在加载更多…" }),
|
|
1664
|
+
j && /* @__PURE__ */ c("div", { className: "memory-more-hint memory-more-error", children: [
|
|
1665
|
+
/* @__PURE__ */ c("span", { children: [
|
|
1666
|
+
"加载更多失败:",
|
|
1667
|
+
j
|
|
1668
|
+
] }),
|
|
1669
|
+
/* @__PURE__ */ e(x, { size: "small", onClick: le, children: "重试" })
|
|
1670
|
+
] })
|
|
1671
|
+
]
|
|
1672
|
+
}
|
|
1673
|
+
) }),
|
|
1674
|
+
/* @__PURE__ */ e("div", { className: "memory-item-detail", children: T ? /* @__PURE__ */ c(H, { children: [
|
|
1675
|
+
/* @__PURE__ */ c("div", { className: "memory-detail-head", children: [
|
|
1676
|
+
/* @__PURE__ */ e("h2", { className: "memory-detail-title", children: T.title }),
|
|
1677
|
+
t.canWrite && /* @__PURE__ */ e("div", { className: "memory-detail-actions", children: Me ? /* @__PURE__ */ c(H, { children: [
|
|
1678
|
+
/* @__PURE__ */ e(
|
|
1679
|
+
vt,
|
|
1680
|
+
{
|
|
1681
|
+
size: "small",
|
|
1682
|
+
"aria-label": "编辑器模式",
|
|
1683
|
+
options: [
|
|
1684
|
+
{ label: "预览", value: "live" },
|
|
1685
|
+
{ label: "源码", value: "source" }
|
|
1686
|
+
],
|
|
1687
|
+
value: Ie,
|
|
1688
|
+
onChange: (d) => Te(d)
|
|
1689
|
+
}
|
|
1690
|
+
),
|
|
1691
|
+
/* @__PURE__ */ e(
|
|
1692
|
+
x,
|
|
1693
|
+
{
|
|
1694
|
+
size: "small",
|
|
1695
|
+
type: "primary",
|
|
1696
|
+
loading: G.busy,
|
|
1697
|
+
disabled: !oe.trim(),
|
|
1698
|
+
onClick: ze,
|
|
1699
|
+
children: "保存"
|
|
1700
|
+
}
|
|
1701
|
+
),
|
|
1702
|
+
/* @__PURE__ */ e(
|
|
1703
|
+
x,
|
|
1704
|
+
{
|
|
1705
|
+
size: "small",
|
|
1706
|
+
disabled: G.busy,
|
|
1707
|
+
onClick: () => ae(!1),
|
|
1708
|
+
children: "取消"
|
|
1709
|
+
}
|
|
1710
|
+
)
|
|
1711
|
+
] }) : /* @__PURE__ */ c(H, { children: [
|
|
1712
|
+
/* @__PURE__ */ e(
|
|
1713
|
+
x,
|
|
1714
|
+
{
|
|
1715
|
+
size: "small",
|
|
1716
|
+
disabled: G.busy,
|
|
1717
|
+
onClick: rt,
|
|
1718
|
+
children: "编辑"
|
|
1719
|
+
}
|
|
1720
|
+
),
|
|
1721
|
+
/* @__PURE__ */ e(
|
|
1722
|
+
x,
|
|
1723
|
+
{
|
|
1724
|
+
size: "small",
|
|
1725
|
+
"aria-pressed": he,
|
|
1726
|
+
onClick: () => Ze((d) => !d),
|
|
1727
|
+
children: he ? "渲染" : "源码"
|
|
1728
|
+
}
|
|
1729
|
+
),
|
|
1730
|
+
/* @__PURE__ */ e(
|
|
1731
|
+
x,
|
|
1732
|
+
{
|
|
1733
|
+
size: "small",
|
|
1734
|
+
loading: G.busy,
|
|
1735
|
+
onClick: nt,
|
|
1736
|
+
children: T.enabled ? "停用" : "启用"
|
|
1737
|
+
}
|
|
1738
|
+
),
|
|
1739
|
+
/* @__PURE__ */ e(
|
|
1740
|
+
x,
|
|
1741
|
+
{
|
|
1742
|
+
size: "small",
|
|
1743
|
+
danger: !0,
|
|
1744
|
+
disabled: G.busy,
|
|
1745
|
+
onClick: () => pe(!0),
|
|
1746
|
+
children: "删除"
|
|
1747
|
+
}
|
|
1748
|
+
)
|
|
1749
|
+
] }) })
|
|
1750
|
+
] }),
|
|
1751
|
+
T.description ? /* @__PURE__ */ e("p", { className: "memory-detail-desc", children: T.description }) : null,
|
|
1752
|
+
/* @__PURE__ */ c("div", { className: "memory-detail-meta", children: [
|
|
1753
|
+
/* @__PURE__ */ e(
|
|
1754
|
+
"span",
|
|
1755
|
+
{
|
|
1756
|
+
className: `memory-status${T.enabled ? " on" : ""}`,
|
|
1757
|
+
children: T.enabled ? "启用" : "停用"
|
|
1758
|
+
}
|
|
1759
|
+
),
|
|
1760
|
+
(De = T.tags) == null ? void 0 : De.map((d, P) => /* @__PURE__ */ e(A, { title: d, children: /* @__PURE__ */ e(Ge, { className: "memory-wrap", children: d }) }, `${d}-${P}`)),
|
|
1761
|
+
T.updateTime ? /* @__PURE__ */ e("span", { children: T.updateTime }) : null,
|
|
1762
|
+
T.sourceText ? /* @__PURE__ */ c("span", { className: "memory-wrap", children: [
|
|
1763
|
+
"来源:",
|
|
1764
|
+
/* @__PURE__ */ e("span", { children: T.sourceText })
|
|
1765
|
+
] }) : null
|
|
1766
|
+
] }),
|
|
1767
|
+
G.error && /* @__PURE__ */ e(L, { type: "error", showIcon: !0, message: G.error }),
|
|
1768
|
+
Me ? /* @__PURE__ */ e(
|
|
1769
|
+
Fe,
|
|
1770
|
+
{
|
|
1771
|
+
mode: Ie,
|
|
1772
|
+
value: oe,
|
|
1773
|
+
placeholder: "用 Markdown 记录这条记忆,支持工具栏与 ⌘S 保存…",
|
|
1774
|
+
onChange: Se,
|
|
1775
|
+
onSave: ze
|
|
1776
|
+
}
|
|
1777
|
+
) : he ? /* @__PURE__ */ e("div", { className: "memory-full-content memory-md", children: /* @__PURE__ */ e(gt, { content: T.content }) }) : /* @__PURE__ */ e("div", { className: "memory-full-content", children: T.content })
|
|
1778
|
+
] }) : b !== "ready" ? null : /* @__PURE__ */ e("div", { className: "memory-state", children: "在左侧选择条目查看内容" }) })
|
|
1779
|
+
] }),
|
|
1780
|
+
Qe === t.code && /* @__PURE__ */ e(
|
|
1781
|
+
Xt,
|
|
1782
|
+
{
|
|
1783
|
+
base: t,
|
|
1784
|
+
scopeBases: et,
|
|
1785
|
+
scopeLabel: tt,
|
|
1786
|
+
onClose: () => $e(void 0)
|
|
1787
|
+
},
|
|
1788
|
+
`${t.code}:${t.canManage}`
|
|
1789
|
+
),
|
|
1790
|
+
X && /* @__PURE__ */ e(
|
|
1791
|
+
Qt,
|
|
1792
|
+
{
|
|
1793
|
+
base: t,
|
|
1794
|
+
initialItem: X.item,
|
|
1795
|
+
initialEditing: X.editing,
|
|
1796
|
+
onClose: () => ue(void 0),
|
|
1797
|
+
onChanged: ye,
|
|
1798
|
+
onSaved: (d) => J(d.code)
|
|
1799
|
+
}
|
|
1800
|
+
),
|
|
1801
|
+
Je && T && /* @__PURE__ */ e(
|
|
1802
|
+
re,
|
|
1803
|
+
{
|
|
1804
|
+
title: "删除记忆条目",
|
|
1805
|
+
detail: `删除「${T.title}」后不可恢复。`,
|
|
1806
|
+
remove: (d) => qe(T.code, d),
|
|
1807
|
+
onClose: () => pe(!1),
|
|
1808
|
+
onDone: () => {
|
|
1809
|
+
pe(!1), T && Ye(T.code), J(void 0);
|
|
1810
|
+
}
|
|
1811
|
+
}
|
|
1812
|
+
)
|
|
1813
|
+
] });
|
|
1814
|
+
}
|
|
1815
|
+
const en = [
|
|
1816
|
+
{ value: "READER", label: "只读" },
|
|
1817
|
+
{ value: "EDITOR", label: "编辑" }
|
|
1818
|
+
];
|
|
1819
|
+
function tn({
|
|
1820
|
+
spaceCode: t,
|
|
1821
|
+
initial: n,
|
|
1822
|
+
onDone: l,
|
|
1823
|
+
onCancel: o
|
|
1824
|
+
}) {
|
|
1825
|
+
const [a, k] = v(""), [r, u] = v(
|
|
1826
|
+
n
|
|
1827
|
+
), [i, s] = v((n == null ? void 0 : n.role) ?? "READER"), p = V(
|
|
1828
|
+
(y) => Ft(a, y),
|
|
1829
|
+
[a]
|
|
1830
|
+
), w = xe(p), b = q();
|
|
1831
|
+
return /* @__PURE__ */ c("div", { className: "memory-member-editor", children: [
|
|
1832
|
+
b.error && /* @__PURE__ */ e(L, { type: "error", message: b.error, showIcon: !0 }),
|
|
1833
|
+
/* @__PURE__ */ c(ne, { wrap: !0, children: [
|
|
1834
|
+
/* @__PURE__ */ e(
|
|
1835
|
+
ce,
|
|
1836
|
+
{
|
|
1837
|
+
"aria-label": "目录成员",
|
|
1838
|
+
placeholder: "搜索目录成员",
|
|
1839
|
+
showSearch: !0,
|
|
1840
|
+
filterOption: !1,
|
|
1841
|
+
labelInValue: !0,
|
|
1842
|
+
disabled: !!n || b.busy,
|
|
1843
|
+
loading: w.loading,
|
|
1844
|
+
value: r ? { value: r.principalId, label: r.name } : void 0,
|
|
1845
|
+
onSearch: k,
|
|
1846
|
+
onChange: (y) => {
|
|
1847
|
+
var m;
|
|
1848
|
+
return u(
|
|
1849
|
+
(m = w.data) == null ? void 0 : m.find(
|
|
1850
|
+
(C) => C.principalId === y.value
|
|
1851
|
+
)
|
|
1852
|
+
);
|
|
1853
|
+
},
|
|
1854
|
+
options: (w.data ?? []).map((y) => ({
|
|
1855
|
+
value: y.principalId,
|
|
1856
|
+
label: `${y.name} (${y.principalId})`
|
|
1857
|
+
})),
|
|
1858
|
+
notFoundContent: w.loading ? "正在搜索目录" : w.error ? "目录加载失败" : "没有匹配成员",
|
|
1859
|
+
style: { width: 230 }
|
|
1860
|
+
}
|
|
1861
|
+
),
|
|
1862
|
+
/* @__PURE__ */ e(
|
|
1863
|
+
ce,
|
|
1864
|
+
{
|
|
1865
|
+
"aria-label": "成员角色",
|
|
1866
|
+
value: i,
|
|
1867
|
+
disabled: b.busy,
|
|
1868
|
+
options: en,
|
|
1869
|
+
onChange: s,
|
|
1870
|
+
style: { width: 100 }
|
|
1871
|
+
}
|
|
1872
|
+
),
|
|
1873
|
+
/* @__PURE__ */ e(
|
|
1874
|
+
x,
|
|
1875
|
+
{
|
|
1876
|
+
type: "primary",
|
|
1877
|
+
disabled: !r,
|
|
1878
|
+
loading: b.busy,
|
|
1879
|
+
onClick: () => {
|
|
1880
|
+
r && b.execute(
|
|
1881
|
+
(y) => jt(
|
|
1882
|
+
t,
|
|
1883
|
+
r.principalId,
|
|
1884
|
+
i,
|
|
1885
|
+
y
|
|
1886
|
+
),
|
|
1887
|
+
l
|
|
1888
|
+
);
|
|
1889
|
+
},
|
|
1890
|
+
children: "保存成员"
|
|
1891
|
+
}
|
|
1892
|
+
),
|
|
1893
|
+
/* @__PURE__ */ e(x, { disabled: b.busy, onClick: o, children: "取消" })
|
|
1894
|
+
] }),
|
|
1895
|
+
w.error && /* @__PURE__ */ e(
|
|
1896
|
+
L,
|
|
1897
|
+
{
|
|
1898
|
+
type: "error",
|
|
1899
|
+
message: w.error,
|
|
1900
|
+
action: /* @__PURE__ */ e(x, { onClick: w.reload, children: "重试目录" })
|
|
1901
|
+
}
|
|
1902
|
+
)
|
|
1903
|
+
] });
|
|
1904
|
+
}
|
|
1905
|
+
function nn({
|
|
1906
|
+
space: t,
|
|
1907
|
+
bases: n,
|
|
1908
|
+
onClose: l,
|
|
1909
|
+
onSaved: o
|
|
1910
|
+
}) {
|
|
1911
|
+
var M;
|
|
1912
|
+
const { message: a } = _e.useApp(), [k] = z.useForm(), r = q(), u = n.filter(
|
|
1913
|
+
(N) => (N.spaceCode ?? "") === t.code
|
|
1914
|
+
).length, i = V(
|
|
1915
|
+
(N) => t.canManage ? _t(t.code, N) : Promise.resolve([]),
|
|
1916
|
+
[t.code, t.canManage]
|
|
1917
|
+
), s = xe(i), [p, w] = v(), [b, y] = v(), [m, C] = v(!1), f = ee(
|
|
1918
|
+
() => [
|
|
1919
|
+
{
|
|
1920
|
+
key: "name",
|
|
1921
|
+
title: "成员",
|
|
1922
|
+
width: 200,
|
|
1923
|
+
sorter: (N, $) => N.name.localeCompare($.name),
|
|
1924
|
+
ellipsis: { showTitle: !1 },
|
|
1925
|
+
render: (N, $) => /* @__PURE__ */ e(A, { title: `${$.name} (${$.principalId})`, children: /* @__PURE__ */ e("span", { className: "memory-name", children: $.name }) })
|
|
1926
|
+
},
|
|
1927
|
+
{
|
|
1928
|
+
key: "principalId",
|
|
1929
|
+
title: "成员 ID",
|
|
1930
|
+
dataIndex: "principalId",
|
|
1931
|
+
width: 130,
|
|
1932
|
+
sorter: (N, $) => N.principalId - $.principalId,
|
|
1933
|
+
ellipsis: !0
|
|
1934
|
+
},
|
|
1935
|
+
{
|
|
1936
|
+
key: "role",
|
|
1937
|
+
title: "角色",
|
|
1938
|
+
width: 100,
|
|
1939
|
+
sorter: (N, $) => N.role.localeCompare($.role),
|
|
1940
|
+
render: (N, $) => $.role === "EDITOR" ? "编辑" : "只读"
|
|
1941
|
+
},
|
|
1942
|
+
{
|
|
1943
|
+
key: "action",
|
|
1944
|
+
title: "操作",
|
|
1945
|
+
width: 150,
|
|
1946
|
+
render: (N, $) => /* @__PURE__ */ c(ne, { children: [
|
|
1947
|
+
/* @__PURE__ */ e(
|
|
1948
|
+
x,
|
|
1949
|
+
{
|
|
1950
|
+
size: "small",
|
|
1951
|
+
type: "link",
|
|
1952
|
+
disabled: !!p,
|
|
1953
|
+
onClick: () => w({ member: $ }),
|
|
1954
|
+
children: "改角色"
|
|
1955
|
+
}
|
|
1956
|
+
),
|
|
1957
|
+
/* @__PURE__ */ e(
|
|
1958
|
+
x,
|
|
1959
|
+
{
|
|
1960
|
+
size: "small",
|
|
1961
|
+
type: "link",
|
|
1962
|
+
danger: !0,
|
|
1963
|
+
disabled: !!p,
|
|
1964
|
+
onClick: () => y($),
|
|
1965
|
+
children: "移除"
|
|
1966
|
+
}
|
|
1967
|
+
)
|
|
1968
|
+
] })
|
|
1969
|
+
}
|
|
1970
|
+
],
|
|
1971
|
+
[p]
|
|
1972
|
+
), S = je(f, { excludeKeys: ["action"] });
|
|
1973
|
+
return t.canManage ? /* @__PURE__ */ c(
|
|
1974
|
+
me,
|
|
1975
|
+
{
|
|
1976
|
+
open: !0,
|
|
1977
|
+
width: 680,
|
|
1978
|
+
title: /* @__PURE__ */ e(A, { title: t.name, children: /* @__PURE__ */ c("span", { className: "memory-drawer-title", children: [
|
|
1979
|
+
"共享记忆库设置 · ",
|
|
1980
|
+
t.name
|
|
1981
|
+
] }) }),
|
|
1982
|
+
onClose: l,
|
|
1983
|
+
closable: !r.busy,
|
|
1984
|
+
maskClosable: !r.busy,
|
|
1985
|
+
keyboard: !r.busy,
|
|
1986
|
+
extra: /* @__PURE__ */ e(
|
|
1987
|
+
x,
|
|
1988
|
+
{
|
|
1989
|
+
type: "primary",
|
|
1990
|
+
loading: r.busy,
|
|
1991
|
+
onClick: () => k.submit(),
|
|
1992
|
+
children: "保存"
|
|
1993
|
+
}
|
|
1994
|
+
),
|
|
1995
|
+
children: [
|
|
1996
|
+
r.error && /* @__PURE__ */ e(L, { type: "error", showIcon: !0, message: r.error }),
|
|
1997
|
+
/* @__PURE__ */ c(
|
|
1998
|
+
z,
|
|
1999
|
+
{
|
|
2000
|
+
form: k,
|
|
2001
|
+
layout: "vertical",
|
|
2002
|
+
disabled: r.busy,
|
|
2003
|
+
initialValues: {
|
|
2004
|
+
name: t.name,
|
|
2005
|
+
description: t.description ?? ""
|
|
2006
|
+
},
|
|
2007
|
+
onFinish: (N) => {
|
|
2008
|
+
r.execute(
|
|
2009
|
+
($) => Ue(
|
|
2010
|
+
{
|
|
2011
|
+
code: t.code,
|
|
2012
|
+
name: N.name.trim(),
|
|
2013
|
+
description: N.description
|
|
2014
|
+
},
|
|
2015
|
+
$
|
|
2016
|
+
),
|
|
2017
|
+
($) => o($)
|
|
2018
|
+
);
|
|
2019
|
+
},
|
|
2020
|
+
children: [
|
|
2021
|
+
/* @__PURE__ */ e(
|
|
2022
|
+
z.Item,
|
|
2023
|
+
{
|
|
2024
|
+
label: "名称",
|
|
2025
|
+
name: "name",
|
|
2026
|
+
rules: [
|
|
2027
|
+
{ required: !0, whitespace: !0, message: "请输入名称" },
|
|
2028
|
+
{ max: 100 }
|
|
2029
|
+
],
|
|
2030
|
+
children: /* @__PURE__ */ e(F, { maxLength: 100 })
|
|
2031
|
+
}
|
|
2032
|
+
),
|
|
2033
|
+
/* @__PURE__ */ e(z.Item, { label: "描述", name: "description", rules: [{ max: 2e3 }], children: /* @__PURE__ */ e(F.TextArea, { rows: 3, maxLength: 2e3, showCount: !0 }) }),
|
|
2034
|
+
/* @__PURE__ */ e(z.Item, { label: "归属", children: /* @__PURE__ */ e("div", { className: "memory-wrap", children: Q(t) }) })
|
|
2035
|
+
]
|
|
2036
|
+
}
|
|
2037
|
+
),
|
|
2038
|
+
/* @__PURE__ */ c("div", { className: "memory-settings-section", children: [
|
|
2039
|
+
/* @__PURE__ */ c("div", { className: "memory-section-head", children: [
|
|
2040
|
+
/* @__PURE__ */ c("span", { children: [
|
|
2041
|
+
"共享记忆库成员",
|
|
2042
|
+
/* @__PURE__ */ e(A, { title: "成员配置不会绕过试用门禁;共享记忆库访问以服务端授权为准", children: /* @__PURE__ */ e("span", { className: "memory-section-hint", children: /* @__PURE__ */ e(R, { name: "help-circle", size: 12 }) }) })
|
|
2043
|
+
] }),
|
|
2044
|
+
/* @__PURE__ */ e(x, { disabled: !!p, onClick: () => w({}), children: "添加成员" })
|
|
2045
|
+
] }),
|
|
2046
|
+
p && /* @__PURE__ */ e(
|
|
2047
|
+
tn,
|
|
2048
|
+
{
|
|
2049
|
+
spaceCode: t.code,
|
|
2050
|
+
initial: p.member,
|
|
2051
|
+
onCancel: () => w(void 0),
|
|
2052
|
+
onDone: () => {
|
|
2053
|
+
w(void 0), s.reload(), a.success("成员配置已保存;共享记忆库访问以服务端授权为准");
|
|
2054
|
+
}
|
|
2055
|
+
},
|
|
2056
|
+
((M = p.member) == null ? void 0 : M.principalId) ?? "new"
|
|
2057
|
+
),
|
|
2058
|
+
s.error ? /* @__PURE__ */ e(
|
|
2059
|
+
L,
|
|
2060
|
+
{
|
|
2061
|
+
type: "error",
|
|
2062
|
+
message: "成员加载失败",
|
|
2063
|
+
description: s.error,
|
|
2064
|
+
action: /* @__PURE__ */ e(x, { onClick: s.reload, children: "重试" })
|
|
2065
|
+
}
|
|
2066
|
+
) : /* @__PURE__ */ e("div", { className: "memory-table", children: /* @__PURE__ */ e(
|
|
2067
|
+
Be,
|
|
2068
|
+
{
|
|
2069
|
+
size: "small",
|
|
2070
|
+
rowKey: "principalId",
|
|
2071
|
+
loading: s.loading,
|
|
2072
|
+
columns: S.columns,
|
|
2073
|
+
components: S.components,
|
|
2074
|
+
dataSource: s.data ?? [],
|
|
2075
|
+
pagination: !1,
|
|
2076
|
+
scroll: { x: 580 },
|
|
2077
|
+
locale: {
|
|
2078
|
+
emptyText: s.loading ? "正在加载成员" : "暂无共享成员"
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
) }),
|
|
2082
|
+
b && /* @__PURE__ */ e(
|
|
2083
|
+
re,
|
|
2084
|
+
{
|
|
2085
|
+
title: "移除共享记忆库成员",
|
|
2086
|
+
detail: `将移除「${b.name}」在「${t.name}」中的共享角色。`,
|
|
2087
|
+
remove: (N) => Bt(t.code, b.principalId, N),
|
|
2088
|
+
onClose: () => y(void 0),
|
|
2089
|
+
onDone: () => {
|
|
2090
|
+
y(void 0), s.reload();
|
|
2091
|
+
}
|
|
2092
|
+
}
|
|
2093
|
+
)
|
|
2094
|
+
] }),
|
|
2095
|
+
/* @__PURE__ */ c("div", { className: "memory-settings-section memory-danger-zone", children: [
|
|
2096
|
+
/* @__PURE__ */ e("div", { className: "memory-section-head", children: /* @__PURE__ */ e("span", { children: "危险区" }) }),
|
|
2097
|
+
/* @__PURE__ */ c("div", { className: "memory-danger-row", children: [
|
|
2098
|
+
/* @__PURE__ */ c("div", { className: "memory-danger-info", children: [
|
|
2099
|
+
/* @__PURE__ */ e("b", { children: "删除共享记忆库" }),
|
|
2100
|
+
/* @__PURE__ */ e("small", { children: u > 0 ? `其中还有 ${u} 个记忆库,全部移动或删除后才能删除。` : "删除「共享记忆库 / " + t.name + "」后不可恢复;其中的记忆库会一并清理。" })
|
|
2101
|
+
] }),
|
|
2102
|
+
/* @__PURE__ */ c(
|
|
2103
|
+
x,
|
|
2104
|
+
{
|
|
2105
|
+
danger: !0,
|
|
2106
|
+
disabled: u > 0 || r.busy || m,
|
|
2107
|
+
title: u > 0 ? "请先把其中的记忆库移动或删除" : void 0,
|
|
2108
|
+
onClick: () => C(!0),
|
|
2109
|
+
children: [
|
|
2110
|
+
/* @__PURE__ */ e(R, { name: "trash", size: 13 }),
|
|
2111
|
+
"删除共享记忆库"
|
|
2112
|
+
]
|
|
2113
|
+
}
|
|
2114
|
+
)
|
|
2115
|
+
] })
|
|
2116
|
+
] }),
|
|
2117
|
+
m && /* @__PURE__ */ e(
|
|
2118
|
+
re,
|
|
2119
|
+
{
|
|
2120
|
+
title: "删除共享记忆库",
|
|
2121
|
+
detail: `删除「共享记忆库 / ${t.name}」后不可恢复;非空共享记忆库不能删除,请先移动或删除其中的记忆库。`,
|
|
2122
|
+
remove: (N) => Lt(t.code, N),
|
|
2123
|
+
onClose: () => C(!1),
|
|
2124
|
+
onDone: () => {
|
|
2125
|
+
C(!1), o();
|
|
2126
|
+
}
|
|
2127
|
+
}
|
|
2128
|
+
)
|
|
2129
|
+
]
|
|
2130
|
+
}
|
|
2131
|
+
) : null;
|
|
2132
|
+
}
|
|
2133
|
+
function rn() {
|
|
2134
|
+
var g, h, D;
|
|
2135
|
+
const { message: t } = _e.useApp(), n = mt(), { canSeeMenu: l } = ut(), o = l("menu.access.mine"), [a, k] = v({
|
|
2136
|
+
kind: "personal"
|
|
2137
|
+
}), [r, u] = v(), i = V(async (I) => {
|
|
2138
|
+
const [J, X] = await Promise.all([
|
|
2139
|
+
Rt(I),
|
|
2140
|
+
At(I)
|
|
2141
|
+
]);
|
|
2142
|
+
return { spaces: J, bases: X };
|
|
2143
|
+
}, []), s = xe(i), p = ((g = s.data) == null ? void 0 : g.spaces) ?? [], w = ((h = s.data) == null ? void 0 : h.bases) ?? [], b = a.kind === "base" ? w.find((I) => I.code === a.code) : void 0, y = s.data && (a.kind === "base" && !b || a.kind === "space" && !p.some((I) => I.code === a.code)), { width: m, containerRef: C, startResize: f, resetWidth: S } = pt({
|
|
2144
|
+
storageKey: "memory.scopeWidth",
|
|
2145
|
+
defaultWidth: 236,
|
|
2146
|
+
minWidth: 190,
|
|
2147
|
+
maxWidth: 420
|
|
2148
|
+
}), [M, N] = v(() => {
|
|
2149
|
+
try {
|
|
2150
|
+
return localStorage.getItem("memory.scopeCollapsed") === "1";
|
|
2151
|
+
} catch {
|
|
2152
|
+
return !1;
|
|
2153
|
+
}
|
|
2154
|
+
}), $ = () => N((I) => {
|
|
2155
|
+
try {
|
|
2156
|
+
localStorage.setItem("memory.scopeCollapsed", I ? "0" : "1");
|
|
2157
|
+
} catch {
|
|
2158
|
+
}
|
|
2159
|
+
return !I;
|
|
2160
|
+
}), E = () => u(void 0), j = (I) => {
|
|
2161
|
+
E(), s.reload(), t.success(I);
|
|
2162
|
+
};
|
|
2163
|
+
return /* @__PURE__ */ c(
|
|
2164
|
+
"div",
|
|
2165
|
+
{
|
|
2166
|
+
className: `view memory-view split-layout${M ? " nav-collapsed" : ""}`,
|
|
2167
|
+
ref: C,
|
|
2168
|
+
style: { "--split-w": M ? "0px" : `${m}px` },
|
|
2169
|
+
children: [
|
|
2170
|
+
/* @__PURE__ */ c("aside", { className: "memory-nav", hidden: M, children: [
|
|
2171
|
+
s.data ? /* @__PURE__ */ e(
|
|
2172
|
+
Kt,
|
|
2173
|
+
{
|
|
2174
|
+
spaces: p,
|
|
2175
|
+
bases: w,
|
|
2176
|
+
selected: a,
|
|
2177
|
+
onSelect: k,
|
|
2178
|
+
onDialog: u
|
|
2179
|
+
}
|
|
2180
|
+
) : /* @__PURE__ */ e("div", { className: "memory-state", children: s.loading ? /* @__PURE__ */ e(ke, {}) : "目录不可用" }),
|
|
2181
|
+
o && /* @__PURE__ */ c(
|
|
2182
|
+
"button",
|
|
2183
|
+
{
|
|
2184
|
+
type: "button",
|
|
2185
|
+
className: "memory-nav-foot",
|
|
2186
|
+
onClick: () => n("/my-access"),
|
|
2187
|
+
children: [
|
|
2188
|
+
/* @__PURE__ */ e(R, { name: "plug", size: 13 }),
|
|
2189
|
+
/* @__PURE__ */ e("span", { children: "接入文档" })
|
|
2190
|
+
]
|
|
2191
|
+
}
|
|
2192
|
+
)
|
|
2193
|
+
] }),
|
|
2194
|
+
/* @__PURE__ */ e(
|
|
2195
|
+
"div",
|
|
2196
|
+
{
|
|
2197
|
+
className: `split-handle${M ? " collapsed" : ""}`,
|
|
2198
|
+
role: "separator",
|
|
2199
|
+
"aria-label": "调整记忆库树宽度",
|
|
2200
|
+
"aria-orientation": "vertical",
|
|
2201
|
+
title: "拖动调整宽度,双击复位",
|
|
2202
|
+
onPointerDown: f,
|
|
2203
|
+
onDoubleClick: S,
|
|
2204
|
+
children: /* @__PURE__ */ e(
|
|
2205
|
+
"button",
|
|
2206
|
+
{
|
|
2207
|
+
className: "split-collapse",
|
|
2208
|
+
type: "button",
|
|
2209
|
+
"aria-label": M ? "展开记忆库树" : "收起记忆库树",
|
|
2210
|
+
title: M ? "展开记忆库树" : "收起记忆库树",
|
|
2211
|
+
onPointerDown: (I) => I.stopPropagation(),
|
|
2212
|
+
onDoubleClick: (I) => I.stopPropagation(),
|
|
2213
|
+
onClick: $,
|
|
2214
|
+
children: /* @__PURE__ */ e(R, { name: M ? "chevron-right" : "chevron-left", size: 12 })
|
|
2215
|
+
}
|
|
2216
|
+
)
|
|
2217
|
+
}
|
|
2218
|
+
),
|
|
2219
|
+
/* @__PURE__ */ e("section", { className: "memory-main memory-table", children: s.loading ? /* @__PURE__ */ e(
|
|
2220
|
+
"div",
|
|
2221
|
+
{
|
|
2222
|
+
className: "memory-state",
|
|
2223
|
+
role: "status",
|
|
2224
|
+
"aria-label": "记忆目录加载中",
|
|
2225
|
+
children: /* @__PURE__ */ e(ke, {})
|
|
2226
|
+
}
|
|
2227
|
+
) : s.error ? /* @__PURE__ */ e("div", { className: "memory-state", children: /* @__PURE__ */ e(
|
|
2228
|
+
L,
|
|
2229
|
+
{
|
|
2230
|
+
type: "error",
|
|
2231
|
+
message: "记忆目录加载失败",
|
|
2232
|
+
description: s.error,
|
|
2233
|
+
action: /* @__PURE__ */ e(x, { onClick: s.reload, children: "重试" })
|
|
2234
|
+
}
|
|
2235
|
+
) }) : y ? /* @__PURE__ */ e("div", { className: "memory-state", children: /* @__PURE__ */ e(
|
|
2236
|
+
L,
|
|
2237
|
+
{
|
|
2238
|
+
type: "warning",
|
|
2239
|
+
message: "所选共享记忆库或记忆库已不可用",
|
|
2240
|
+
description: "请在左侧重新选择,不会自动切换到我的记忆库。"
|
|
2241
|
+
}
|
|
2242
|
+
) }) : b ? /* @__PURE__ */ e(
|
|
2243
|
+
Yt,
|
|
2244
|
+
{
|
|
2245
|
+
base: b,
|
|
2246
|
+
bases: w,
|
|
2247
|
+
spaces: p,
|
|
2248
|
+
onDialog: u
|
|
2249
|
+
},
|
|
2250
|
+
b.code
|
|
2251
|
+
) : /* @__PURE__ */ e(
|
|
2252
|
+
Ut,
|
|
2253
|
+
{
|
|
2254
|
+
selection: a,
|
|
2255
|
+
spaces: p,
|
|
2256
|
+
bases: w,
|
|
2257
|
+
onSelect: k,
|
|
2258
|
+
onDialog: u,
|
|
2259
|
+
onReload: s.reload
|
|
2260
|
+
},
|
|
2261
|
+
Wt(a)
|
|
2262
|
+
) }),
|
|
2263
|
+
(r == null ? void 0 : r.kind) === "space" && !r.space && /* @__PURE__ */ e(
|
|
2264
|
+
Ae,
|
|
2265
|
+
{
|
|
2266
|
+
kind: "space",
|
|
2267
|
+
spaceCode: "",
|
|
2268
|
+
spaces: p,
|
|
2269
|
+
onClose: E,
|
|
2270
|
+
onDone: () => j("共享记忆库已保存")
|
|
2271
|
+
}
|
|
2272
|
+
),
|
|
2273
|
+
(r == null ? void 0 : r.kind) === "space" && ((D = r.space) == null ? void 0 : D.canManage) && /* @__PURE__ */ e(
|
|
2274
|
+
nn,
|
|
2275
|
+
{
|
|
2276
|
+
space: r.space,
|
|
2277
|
+
bases: w,
|
|
2278
|
+
onClose: E,
|
|
2279
|
+
onSaved: (I) => {
|
|
2280
|
+
if (E(), s.reload(), I) {
|
|
2281
|
+
t.success("共享记忆库已保存");
|
|
2282
|
+
return;
|
|
2283
|
+
}
|
|
2284
|
+
a.kind === "space" && a.code === r.space.code && k({ kind: "spaces" }), t.success("共享记忆库已删除");
|
|
2285
|
+
}
|
|
2286
|
+
}
|
|
2287
|
+
),
|
|
2288
|
+
(r == null ? void 0 : r.kind) === "base" && !r.base && /* @__PURE__ */ e(
|
|
2289
|
+
qt,
|
|
2290
|
+
{
|
|
2291
|
+
spaceCode: r.spaceCode,
|
|
2292
|
+
spaces: p,
|
|
2293
|
+
onClose: E,
|
|
2294
|
+
onDone: () => j("记忆库已创建")
|
|
2295
|
+
}
|
|
2296
|
+
),
|
|
2297
|
+
(r == null ? void 0 : r.kind) === "base" && r.base && /* @__PURE__ */ e(
|
|
2298
|
+
Ae,
|
|
2299
|
+
{
|
|
2300
|
+
kind: "base",
|
|
2301
|
+
base: r.base,
|
|
2302
|
+
spaceCode: r.spaceCode,
|
|
2303
|
+
spaces: p,
|
|
2304
|
+
onClose: E,
|
|
2305
|
+
onDone: () => j("记忆库已保存")
|
|
2306
|
+
}
|
|
2307
|
+
),
|
|
2308
|
+
(r == null ? void 0 : r.kind) === "move" && /* @__PURE__ */ e(
|
|
2309
|
+
Jt,
|
|
2310
|
+
{
|
|
2311
|
+
base: r.base,
|
|
2312
|
+
spaces: p,
|
|
2313
|
+
onClose: E,
|
|
2314
|
+
onDone: (I) => j(`已移动至 ${U(I, p)}`)
|
|
2315
|
+
}
|
|
2316
|
+
),
|
|
2317
|
+
(r == null ? void 0 : r.kind) === "deleteBase" && /* @__PURE__ */ e(
|
|
2318
|
+
re,
|
|
2319
|
+
{
|
|
2320
|
+
title: "删除记忆库",
|
|
2321
|
+
detail: `删除「${U(r.base, p)}」后不可恢复;有条目的记忆库不能删除,请先清空条目。`,
|
|
2322
|
+
remove: (I) => Ot(r.base.code, I),
|
|
2323
|
+
onClose: E,
|
|
2324
|
+
onDone: () => {
|
|
2325
|
+
a.kind === "base" && a.code === r.base.code && k(
|
|
2326
|
+
r.base.spaceCode ? { kind: "space", code: r.base.spaceCode } : { kind: "personal" }
|
|
2327
|
+
), j("记忆库已删除");
|
|
2328
|
+
}
|
|
2329
|
+
}
|
|
2330
|
+
)
|
|
2331
|
+
]
|
|
2332
|
+
}
|
|
2333
|
+
);
|
|
2334
|
+
}
|
|
2335
|
+
function In() {
|
|
2336
|
+
return /* @__PURE__ */ e(dt, { menuCode: "menu.memory.manage", children: /* @__PURE__ */ e(rn, {}) });
|
|
2337
|
+
}
|
|
2338
|
+
export {
|
|
2339
|
+
In as default
|
|
2340
|
+
};
|