@gientech/modual 1.4.4 → 1.4.6
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/.editorconfig +38 -0
- package/.prettierignore +16 -0
- package/.prettierrc +17 -0
- package/README.md +129 -129
- package/USAGE.md +191 -0
- package/bash.exe.stackdump +40 -0
- package/components.json +21 -0
- package/dist/README.md +129 -0
- package/dist/assets/AppLoading-mci3gLZt.js +414 -0
- package/{assets/GientechStreamReader-A8zHypyu.js → dist/assets/GientechStreamReader-4496nAm0.js} +2 -2
- package/{assets → dist/assets}/database.svg +11 -11
- package/{assets → dist/assets}/database_add.svg +53 -53
- package/{assets → dist/assets}/database_connect.svg +66 -66
- package/{assets → dist/assets}/database_upload.svg +29 -29
- package/{assets → dist/assets}/defaultWeLogo.svg +14 -14
- package/{assets/index-B7u9FawR.js → dist/assets/index-7rZAt9P3.js} +1 -1
- package/dist/assets/index-BVENTW1Q.js +13 -0
- package/dist/assets/index-Bb8_WB-l.js +1 -0
- package/{assets/index-rydP_SDR.js → dist/assets/index-BpJ9Bm5x.js} +6 -6
- package/dist/assets/index-CNxDI4h-.js +1078 -0
- package/{assets/index-EcdpegTC.js → dist/assets/index-CWzpBU29.js} +1 -1
- package/{assets/index-DiQ4Me9J.js → dist/assets/index-D1m34Ij7.js} +124 -124
- package/{assets/index-CFlRqq2H.js → dist/assets/index-_gBtdXQV.js} +2 -2
- package/{assets/MySQL.svg → dist/assets/mysql.svg} +14 -14
- package/{assets/plus-ufD39rmY.js → dist/assets/plus-CrtEUXaQ.js} +1 -1
- package/dist/assets/style3.css +1 -0
- package/{assets/x-_1-UpSBt.js → dist/assets/x-Dr3EBTzJ.js} +1 -1
- package/{chat.d.ts → dist/chat.d.ts} +1 -1
- package/dist/chat.js +142 -0
- package/dist/database.js +20 -0
- package/{databaseId.js → dist/databaseId.js} +2 -2
- package/dist/databaseTable.js +6 -0
- package/{index.js → dist/index.js} +3 -3
- package/{modelManage.js → dist/modelManage.js} +1 -1
- package/dist/package.json +63 -0
- package/{sensitive.js → dist/sensitive.js} +1 -1
- package/dist/streamFilesReader.js +1 -0
- package/{worker → dist/worker}/pdf.worker.min.js +21 -21
- package/doc_assets/2.png +0 -0
- package/doc_assets/demo.md +27 -0
- package/doc_assets/demos/dist-app/assets/index.Dh-ZAS9Z.css +2 -0
- package/doc_assets/demos/dist-app/assets/index.Dv8KVW18.js +23699 -0
- package/doc_assets/demos/dist-app/assets/index.Dv8KVW18.js.map +1 -0
- package/doc_assets/demos/dist-app/index.html +14 -0
- package/doc_assets/demos/dist-app/vite.svg +1 -0
- package/doc_assets/images/1.png +0 -0
- package/doc_assets/images/3.png +0 -0
- package/doc_assets/images/component-screenshot.png +1 -0
- package/doc_assets/install.md +5 -0
- package/eslint.config.js +92 -0
- package/index.html +13 -0
- package/package.json +99 -44
- package/package.json.demo-backup +109 -0
- package/postcss.config.cjs +19 -0
- package/public/vite.svg +1 -0
- package/public/worker/pdf.worker.min.js +22 -0
- package/scripts/README.md +133 -0
- package/scripts/build-demo.js +88 -0
- package/scripts/demo-selector.js +216 -0
- package/scripts/dev-demo.js +76 -0
- package/scripts/preview-demo.js +130 -0
- package/scripts/run-demo.bat +34 -0
- package/src/assets/img/downArrow.png +0 -0
- package/src/assets/img/excel.png +0 -0
- package/src/assets/img/img.png +0 -0
- package/src/assets/img/pdf.png +0 -0
- package/src/assets/img/ppt.png +0 -0
- package/src/assets/img/txt.png +0 -0
- package/src/assets/img/word.png +0 -0
- package/src/assets/login/homeBg.png +0 -0
- package/src/assets/login/left.jpg +0 -0
- package/src/assets/login/logoImg.png +0 -0
- package/src/examples/Demo/index.tsx +12 -0
- package/src/examples/LoginPage/index.tsx +18 -0
- package/src/examples/chat/components/DrawerGraphPreview.tsx +78 -0
- package/src/examples/chat/index.tsx +177 -0
- package/src/examples/chat/logo03.png +0 -0
- package/src/examples/gientechStreamFilesReader/index.tsx +950 -0
- package/src/examples/ragDatabaseDataPage/index.tsx +36 -0
- package/src/examples/ragDatabaseIdPage/index.tsx +44 -0
- package/src/examples/ragDatabasePage/index.tsx +36 -0
- package/src/examples/ragModelManagePage/index.tsx +37 -0
- package/src/examples/ragSearchPage/index.tsx +0 -0
- package/src/examples/ragSensitiveWordsPage/index.tsx +32 -0
- package/src/examples/streamFiles/index.tsx +384 -0
- package/src/lib_enter.ts +40 -0
- package/src/main.tsx +5 -0
- package/src/main.tsx.backup +5 -0
- package/src/modules/chat/Conversations/Item.tsx +167 -0
- package/src/modules/chat/Conversations/List.tsx +206 -0
- package/src/modules/chat/Conversations/groupByTime.ts +39 -0
- package/src/modules/chat/Conversations/index.tsx +217 -0
- package/src/modules/chat/constants.tsx +33 -0
- package/src/modules/chat/data.txt +82 -0
- package/src/modules/chat/index.tsx +2024 -0
- package/src/modules/chat/types.ts +17 -0
- package/src/modules/database/CreateModal.tsx +398 -0
- package/src/modules/database/assets/Doris.png +0 -0
- package/src/modules/database/assets/PostgreSQL.png +0 -0
- package/src/modules/database/assets/SQLServer.png +0 -0
- package/src/modules/database/assets/database.svg +11 -0
- package/src/modules/database/assets/database_add.svg +53 -0
- package/src/modules/database/assets/database_connect.svg +66 -0
- package/src/modules/database/assets/database_upload.svg +29 -0
- package/src/modules/database/assets/empty.png +0 -0
- package/src/modules/database/assets/mysql.svg +14 -0
- package/src/modules/database/index.tsx +466 -0
- package/src/modules/database/server.ts +196 -0
- package/src/modules/databaseId/CustomCom.tsx +156 -0
- package/src/modules/databaseId/EditConfig.tsx +268 -0
- package/src/modules/databaseId/UploadDrawer.tsx +520 -0
- package/src/modules/databaseId/assets/aiOptimize.svg +10 -0
- package/src/modules/databaseId/assets/empty.png +0 -0
- package/src/modules/databaseId/assets/template.svg +6 -0
- package/src/modules/databaseId/assets/upload.svg +9 -0
- package/src/modules/databaseId/assets/useTemp.svg +6 -0
- package/src/modules/databaseId/index.tsx +734 -0
- package/src/modules/databaseId/server.ts +286 -0
- package/src/modules/databaseId/style.css +5 -0
- package/src/modules/databaseTable/EditRowDrawer.tsx +119 -0
- package/src/modules/databaseTable/index.tsx +357 -0
- package/src/modules/databaseTable/server.ts +180 -0
- package/src/modules/headlessChat/constants.tsx +32 -0
- package/src/modules/headlessChat/index.tsx +1063 -0
- package/src/modules/headlessChat/types.ts +23 -0
- package/src/modules/login/components/Login/LoginBox/index.tsx +102 -0
- package/src/modules/login/components/Login/RegisterBox/index.tsx +180 -0
- package/src/modules/login/components/Login/index.tsx +100 -0
- package/src/modules/login/index.tsx +106 -0
- package/src/modules/login/style.css +3 -0
- package/src/modules/login/useServices.ts +53 -0
- package/src/modules/login/utils.ts +42 -0
- package/src/modules/modelManage/ConfigDrawer.tsx +249 -0
- package/src/modules/modelManage/assets/empty.png +0 -0
- package/src/modules/modelManage/const.ts +50 -0
- package/src/modules/modelManage/index.tsx +439 -0
- package/src/modules/modelManage/server.ts +185 -0
- package/src/modules/nodegraph/index.tsx +1 -0
- package/src/modules/search/assets/Icon-history.svg +8 -0
- package/src/modules/search/assets/answerAwartar.png +0 -0
- package/src/modules/search/assets/doc.png +0 -0
- package/src/modules/search/assets/genera.gif +0 -0
- package/src/modules/search/assets/icon-robot.svg +9 -0
- package/src/modules/search/assets/icon-search-bar.svg +14 -0
- package/src/modules/search/assets/icon-sub-title.svg +3 -0
- package/src/modules/search/assets/icon-title.svg +9 -0
- package/src/modules/search/assets/icon-zoomOut.svg +9 -0
- package/src/modules/search/assets/iconAi.svg +9 -0
- package/src/modules/search/assets/pdf.png +0 -0
- package/src/modules/search/assets/ppt.png +0 -0
- package/src/modules/search/assets/search.svg +3 -0
- package/src/modules/search/assets/selected.svg +4 -0
- package/src/modules/search/assets/txt.png +0 -0
- package/src/modules/search/assets/xls.png +0 -0
- package/src/modules/search/components/AssisSelect.tsx +137 -0
- package/src/modules/search/components/Editor/ChatViewEditor.tsx +261 -0
- package/src/modules/search/components/Editor/aichat.css +1 -0
- package/src/modules/search/components/Editor/constant.ts +13 -0
- package/src/modules/search/components/Editor/index.tsx +113 -0
- package/src/modules/search/components/Editor/plugins/autofomatRules.ts +332 -0
- package/src/modules/search/components/Editor/plugins/convertImgPlugins.tsx +20 -0
- package/src/modules/search/components/Editor/plugins/createIndexes.tsx +38 -0
- package/src/modules/search/components/Editor/plugins/displayer.ts +298 -0
- package/src/modules/search/components/Editor/plugins/imageClick.tsx +32 -0
- package/src/modules/search/components/Editor/plugins/myplugin.tsx +98 -0
- package/src/modules/search/components/Editor/ui/avatar.tsx +19 -0
- package/src/modules/search/components/Editor/ui/blockquote-element.tsx +21 -0
- package/src/modules/search/components/Editor/ui/button.tsx +58 -0
- package/src/modules/search/components/Editor/ui/calendar.tsx +68 -0
- package/src/modules/search/components/Editor/ui/caption.tsx +46 -0
- package/src/modules/search/components/Editor/ui/checkbox.tsx +27 -0
- package/src/modules/search/components/Editor/ui/code-block-combobox.tsx +188 -0
- package/src/modules/search/components/Editor/ui/code-block-element.css +434 -0
- package/src/modules/search/components/Editor/ui/code-block-element.tsx +39 -0
- package/src/modules/search/components/Editor/ui/code-leaf.tsx +24 -0
- package/src/modules/search/components/Editor/ui/code-line-element.tsx +10 -0
- package/src/modules/search/components/Editor/ui/code-syntax-leaf.tsx +21 -0
- package/src/modules/search/components/Editor/ui/column-element.tsx +30 -0
- package/src/modules/search/components/Editor/ui/column-group-element.tsx +94 -0
- package/src/modules/search/components/Editor/ui/command.tsx +75 -0
- package/src/modules/search/components/Editor/ui/comment-avatar.tsx +22 -0
- package/src/modules/search/components/Editor/ui/comment-create-form.tsx +37 -0
- package/src/modules/search/components/Editor/ui/comment-item.tsx +74 -0
- package/src/modules/search/components/Editor/ui/comment-leaf.tsx +49 -0
- package/src/modules/search/components/Editor/ui/comment-more-dropdown.tsx +42 -0
- package/src/modules/search/components/Editor/ui/comment-reply-items.tsx +22 -0
- package/src/modules/search/components/Editor/ui/comment-resolve-button.tsx +32 -0
- package/src/modules/search/components/Editor/ui/comment-value.tsx +34 -0
- package/src/modules/search/components/Editor/ui/comments-popover.tsx +63 -0
- package/src/modules/search/components/Editor/ui/date-element.tsx +83 -0
- package/src/modules/search/components/Editor/ui/dialog.tsx +63 -0
- package/src/modules/search/components/Editor/ui/draggable.tsx +177 -0
- package/src/modules/search/components/Editor/ui/dropdown-menu.tsx +180 -0
- package/src/modules/search/components/Editor/ui/emoji-input-element.tsx +85 -0
- package/src/modules/search/components/Editor/ui/excalidraw-element.tsx +28 -0
- package/src/modules/search/components/Editor/ui/fixed-toolbar-buttons.tsx +76 -0
- package/src/modules/search/components/Editor/ui/fixed-toolbar.tsx +8 -0
- package/src/modules/search/components/Editor/ui/floating-toolbar-buttons.tsx +51 -0
- package/src/modules/search/components/Editor/ui/floating-toolbar.tsx +77 -0
- package/src/modules/search/components/Editor/ui/heading-element.tsx +48 -0
- package/src/modules/search/components/Editor/ui/highlight-leaf.tsx +17 -0
- package/src/modules/search/components/Editor/ui/hr-element.tsx +30 -0
- package/src/modules/search/components/Editor/ui/icons.tsx +267 -0
- package/src/modules/search/components/Editor/ui/image-element.tsx +74 -0
- package/src/modules/search/components/Editor/ui/inline-combobox.tsx +368 -0
- package/src/modules/search/components/Editor/ui/input.tsx +25 -0
- package/src/modules/search/components/Editor/ui/insert-dropdown-menu.tsx +218 -0
- package/src/modules/search/components/Editor/ui/kbd-leaf.tsx +20 -0
- package/src/modules/search/components/Editor/ui/link-element.tsx +29 -0
- package/src/modules/search/components/Editor/ui/link-floating-toolbar.tsx +161 -0
- package/src/modules/search/components/Editor/ui/list-element.tsx +30 -0
- package/src/modules/search/components/Editor/ui/mark-toolbar-button.tsx +24 -0
- package/src/modules/search/components/Editor/ui/media-embed-element.tsx +133 -0
- package/src/modules/search/components/Editor/ui/media-popover.tsx +97 -0
- package/src/modules/search/components/Editor/ui/mention-element.tsx +43 -0
- package/src/modules/search/components/Editor/ui/mention-input-element.tsx +141 -0
- package/src/modules/search/components/Editor/ui/mode-dropdown-menu.tsx +93 -0
- package/src/modules/search/components/Editor/ui/more-dropdown-menu.tsx +67 -0
- package/src/modules/search/components/Editor/ui/paragraph-element.tsx +4 -0
- package/src/modules/search/components/Editor/ui/placeholder.tsx +52 -0
- package/src/modules/search/components/Editor/ui/popover.tsx +32 -0
- package/src/modules/search/components/Editor/ui/resizable.tsx +66 -0
- package/src/modules/search/components/Editor/ui/separator.tsx +25 -0
- package/src/modules/search/components/Editor/ui/style.less +12 -0
- package/src/modules/search/components/Editor/ui/table-cell-element.tsx +143 -0
- package/src/modules/search/components/Editor/ui/table-element.tsx +243 -0
- package/src/modules/search/components/Editor/ui/table-row-element.tsx +22 -0
- package/src/modules/search/components/Editor/ui/tableValue.tsx +135 -0
- package/src/modules/search/components/Editor/ui/todo-list-element.tsx +43 -0
- package/src/modules/search/components/Editor/ui/toggle-element.tsx +31 -0
- package/src/modules/search/components/Editor/ui/toolbar.tsx +157 -0
- package/src/modules/search/components/Editor/ui/tooltip.tsx +65 -0
- package/src/modules/search/components/Editor/ui/turn-into-dropdown-menu.tsx +160 -0
- package/src/modules/search/components/Editor/ui/with-draggables.tsx +175 -0
- package/src/modules/search/components/FileList.tsx +287 -0
- package/src/modules/search/components/ImageGroupView/index.tsx +85 -0
- package/src/modules/search/components/ResultContent.tsx +232 -0
- package/src/modules/search/components/SearchInput.tsx +232 -0
- package/src/modules/search/components/SearchLanding.tsx +74 -0
- package/src/modules/search/components/SearchView.tsx +563 -0
- package/src/modules/search/components/SimpleEditor.tsx +158 -0
- package/src/modules/search/components/SimpleFileList.tsx +215 -0
- package/src/modules/search/index.tsx +10 -0
- package/src/modules/search/reademe.md +1 -0
- package/src/modules/search/servers/apis.tsx +19 -0
- package/src/modules/search/servers/index.ts +184 -0
- package/src/modules/search/style.less +503 -0
- package/src/modules/search/type.ts +22 -0
- package/src/modules/search/utils.ts +34 -0
- package/src/modules/sensitive/index.tsx +313 -0
- package/src/modules/sensitive/server.ts +122 -0
- package/src/modules/streamFilesReader/GientechStreamReader.tsx +1619 -0
- package/src/modules/streamFilesReader/components/Header/Toolbar.tsx +0 -0
- package/src/modules/streamFilesReader/components/Header/index.tsx +297 -0
- package/src/modules/streamFilesReader/index.tsx +3 -0
- package/src/style.css +6 -0
- package/src/type.d.ts +0 -0
- package/src/utils/commonFn.tsx +111 -0
- package/src/utils/gientechCommon/components/AppError.tsx +32 -0
- package/src/utils/gientechCommon/components/AppLoading.tsx +75 -0
- package/src/utils/gientechCommon/components/DeleteModal.tsx +75 -0
- package/src/utils/gientechCommon/components/DisplayError.tsx +33 -0
- package/src/utils/gientechCommon/components/DisplayLoading.tsx +38 -0
- package/src/utils/gientechCommon/components/FeedBackModal.tsx +310 -0
- package/src/utils/gientechCommon/components/FileCardCommon.tsx +82 -0
- package/src/utils/gientechCommon/components/FileManager/index.tsx +390 -0
- package/src/utils/gientechCommon/components/FileManager/style.css +5 -0
- package/src/utils/gientechCommon/components/Messages/GientechNewChatWelcome.tsx +296 -0
- package/src/utils/gientechCommon/components/Messages/ReferenceCard.tsx +339 -0
- package/src/utils/gientechCommon/components/Messages/RetriveItem.tsx +245 -0
- package/src/utils/gientechCommon/components/Messages/WebRetriveItem.tsx +209 -0
- package/src/utils/gientechCommon/components/Messages/defaultBot.png +0 -0
- package/src/utils/gientechCommon/components/Messages/defaultStyleSet.tsx +148 -0
- package/src/utils/gientechCommon/components/Messages/defaultWeLogo.svg +14 -0
- package/src/utils/gientechCommon/components/RenameModal.tsx +86 -0
- package/src/utils/gientechCommon/components/style.less +11 -0
- package/src/utils/gientechCommon/configs/commonConfig.ts +2 -0
- package/src/utils/gientechCommon/configs/senderConfig.ts +0 -0
- package/src/utils/gientechCommon/configs/stylesConfig.ts +142 -0
- package/src/utils/gientechCommon/hooks/AichatUseController.tsx +345 -0
- package/src/utils/gientechCommon/slate/converters/deserializers.ts +763 -0
- package/src/utils/gientechCommon/slate/converters/mockData.ts +232 -0
- package/src/utils/gientechCommon/slate/converters/slateConverters.ts +258 -0
- package/src/utils/gientechCommon/slate/richElements/index.tsx +499 -0
- package/src/utils/gientechCommon/utils/request.ts +37 -0
- package/src/utils/gientechCommon/utils/serverFn.ts +172 -0
- package/src/utils/index.tsx +126 -0
- package/src/utils/testconfigs/demologin/index.tsx +32 -0
- package/src/utils/testconfigs/index.ts +53 -0
- package/src/vite-env.d.ts +11 -0
- package/stats.html +4949 -0
- package/tailwind.config.js +170 -0
- package/tsconfig.app.json +30 -0
- package/tsconfig.app.tsbuildinfo +11 -0
- package/tsconfig.json +13 -0
- package/tsconfig.node.json +22 -0
- package/tsconfig.node.tsbuildinfo +1 -0
- package/vite.config.ts +216 -0
- package/workflows/release.yml +60 -0
- package/assets/AppLoading-BpA2wf4Z.js +0 -414
- package/assets/LeftOutlined-BdBZ6FSD.js +0 -1
- package/assets/index-CNJZ9j4J.js +0 -1
- package/assets/index-DfSHCQcq.js +0 -1289
- package/assets/style3.css +0 -1
- package/chat.js +0 -151
- package/database.js +0 -20
- package/databaseTable.js +0 -18
- package/streamFilesReader.js +0 -1
- /package/{assets → dist/assets}/Doris.png +0 -0
- /package/{assets → dist/assets}/PostgreSQL.png +0 -0
- /package/{assets → dist/assets}/SQLServer.png +0 -0
- /package/{assets → dist/assets}/empty.png +0 -0
- /package/{assets → dist/assets}/homeBg.png +0 -0
- /package/{assets → dist/assets}/index-CpW6Dhpp.js +0 -0
- /package/{assets → dist/assets}/left.jpg +0 -0
- /package/{assets → dist/assets}/logoImg.png +0 -0
- /package/{assets → dist/assets}/style.css +0 -0
- /package/{assets → dist/assets}/style2.css +0 -0
- /package/{assets → dist/assets}/style4.css +0 -0
- /package/{database.d.ts → dist/database.d.ts} +0 -0
- /package/{databaseId.d.ts → dist/databaseId.d.ts} +0 -0
- /package/{databaseTable.d.ts → dist/databaseTable.d.ts} +0 -0
- /package/{index.d.ts → dist/index.d.ts} +0 -0
- /package/{modelManage.d.ts → dist/modelManage.d.ts} +0 -0
- /package/{sensitive.d.ts → dist/sensitive.d.ts} +0 -0
- /package/{streamFilesReader.d.ts → dist/streamFilesReader.d.ts} +0 -0
- /package/{vite.svg → dist/vite.svg} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,jsxs as v,Fragment as fe}from"react/jsx-runtime";import{useMemo as J,useState as C,useRef as de,useCallback as j,useEffect as ye}from"react";import{u as Me}from"./assets/index-CpW6Dhpp.js";import{c as De,
|
|
1
|
+
import{jsx as e,jsxs as v,Fragment as fe}from"react/jsx-runtime";import{useMemo as J,useState as C,useRef as de,useCallback as j,useEffect as ye}from"react";import{u as Me}from"./assets/index-CpW6Dhpp.js";import{c as De,a as Se,a6 as ze,J as $,T as Fe,a7 as Le,a8 as _e,a9 as Ve,aa as Ne,m as Re}from"./assets/index-D1m34Ij7.js";import{M as be}from"./assets/index-_gBtdXQV.js";/* empty css */import{_ as Ae}from"./assets/index-CNxDI4h-.js";import{s as X,M as me}from"./assets/index-BpJ9Bm5x.js";import{D as Be}from"./assets/index-Bb8_WB-l.js";import{X as pe}from"./assets/x-Dr3EBTzJ.js";import{P as Ue}from"./assets/index-CWzpBU29.js";import{B as Ce}from"./assets/index-7rZAt9P3.js";import"react-dom";import"./assets/index-BVENTW1Q.js";/**
|
|
2
2
|
* @license lucide-react v0.456.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -8,4 +8,4 @@ import{jsx as e,jsxs as v,Fragment as fe}from"react/jsx-runtime";import{useMemo
|
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const xe=De("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Ge="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%201C13.4997%201.50025%2013.25%201.99975%2013.25%202.5C13.25%203.00025%2013.4997%203.49975%2014%204C13.4997%203.49975%2013.0003%203.25%2012.5%203.25C11.9997%203.25%2011.5003%203.49975%2011%204C11.5003%203.49975%2011.75%203.00025%2011.75%202.5C11.75%201.99975%2011.5003%201.50025%2011%201C11.5003%201.50025%2011.9997%201.75%2012.5%201.75C13.0003%201.75%2013.4997%201.50025%2014%201Z'%20fill='%23055AFF'/%3e%3cpath%20d='M13%206.28571V13C13%2013.5523%2012.5523%2014%2012%2014H4C3.44772%2014%203%2013.5523%203%2013V3C3%202.44772%203.44772%202%204%202H9.25'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cline%20x1='5.65'%20y1='6.35'%20x2='10.35'%20y2='6.35'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cline%20x1='5.65'%20y1='9.35'%20x2='8.35'%20y2='9.35'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3c/svg%3e",$e="data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42%2022C43.1046%2022%2044%2022.8954%2044%2024V42C44%2043.1046%2043.1046%2044%2042%2044H6C4.89543%2044%204%2043.1046%204%2042V24.0088C4%2022.9042%204.89543%2022.0078%206%2022.0078C7.10457%2022.0078%208%2022.9042%208%2024.0088V40H40V24C40%2022.8954%2040.8954%2022%2042%2022ZM24.0293%204.00195C24.0808%204.00272%2024.1322%204.00504%2024.1836%204.00977C24.1904%204.01042%2024.1973%204.011%2024.2041%204.01172C24.2673%204.01819%2024.3301%204.02757%2024.3926%204.04004C24.3939%204.04031%2024.3952%204.04075%2024.3965%204.04102C24.7693%204.11623%2025.125%204.29691%2025.4141%204.58594L34.4141%2013.5859C35.1951%2014.367%2035.1951%2015.633%2034.4141%2016.4141C33.633%2017.1951%2032.367%2017.1951%2031.5859%2016.4141L25.9922%2010.8203V32C25.9922%2033.1046%2025.0968%2034%2023.9922%2034C22.8876%2034%2021.9922%2033.1046%2021.9922%2032V10.8359L16.4141%2016.4141C15.633%2017.1951%2014.367%2017.1951%2013.5859%2016.4141C12.8049%2015.633%2012.8049%2014.367%2013.5859%2013.5859L22.498%204.67285C22.8016%204.33138%2023.2194%204.09559%2023.6924%204.02441C23.7122%204.02135%2023.732%204.01809%2023.752%204.01562C23.7862%204.01152%2023.8207%204.00919%2023.8555%204.00684C23.8887%204.00446%2023.9218%204.00268%2023.9551%204.00195C23.9674%204.00173%2023.9798%204%2023.9922%204C24.0046%204%2024.0169%204.00173%2024.0293%204.00195Z'%20fill='url(%23paint0_linear_4072_34663)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_4072_34663'%20x1='4'%20y1='-7.25'%20x2='54.4707'%20y2='1.556'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%232B69FF'/%3e%3cstop%20offset='1'%20stop-color='%238F91FF'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",we=({url:a,token:A,role:F,eventsEmit:m})=>{const o=Se.create({baseURL:a,timeout:1e6});return o.interceptors.request.use(t=>{let s=A;return!s&&!["user/login","user/kaptcha","user/regist"].some(l=>t.url.includes(l))?(m&&m("request:error_auth",{errorMsg:"\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F",redirect:"/login"}),Promise.reject(new Error("\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"))):(t.headers.Authorization=s||"",t.headers.userName=F==="\u672A\u767B\u5F55\u7528\u6237"?"":F,t)}),o.interceptors.response.use(t=>{const s=["user/kaptcha"],i=t.data;if(s.some(L=>t.config.url&&t.config.url.includes(L))||i.size&&i.type)return i;const{success:l,errorMsg:h,errorCode:c}=i;if(l)return i;m&&m("request:error_business",{errorCode:c,errorMsg:h||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",response:i})},t=>{var s,i,l,h,c,L,p,_,Y;if(t.message==="canceled")return Promise.reject(t);if(m){let q="request:error_network",Z={errorMsg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:t};((s=t==null?void 0:t.response)==null?void 0:s.status)===401?(q="request:error_auth",Z={errorMsg:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650",error:t,redirect:"/login"}):(((l=(i=t==null?void 0:t.response)==null?void 0:i.data)==null?void 0:l.errorCode)==="30013"||((c=(h=t==null?void 0:t.response)==null?void 0:h.data)==null?void 0:c.errorCode)==="30023")&&(q="request:error_business",Z={errorCode:(p=(L=t==null?void 0:t.response)==null?void 0:L.data)==null?void 0:p.errorCode,errorMsg:((Y=(_=t==null?void 0:t.response)==null?void 0:_.data)==null?void 0:Y.errorMsg)||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",error:t}),m(q,Z)}return Promise.reject(t)}),{getTableList:async t=>{try{const s=await o.get(`/directDB/queryTableList/${t}`),{success:i,data:l}=s;if(i)return l}catch(s){console.log("getTableList error:",s)}},getTableTreeList:async t=>{try{const s=await o.get(`/dataTable/queryTableFileTreeList/${t}`),{success:i,data:l}=s;if(i)return l}catch(s){console.log("getTableTreeList error:",s)}},getDBDetailById:async(t,s)=>{const i=Ee(s);try{const l=await o.get(`/${i}/queryDBInfo/${t}`),{success:h,data:c}=l;if(h)return c}catch(l){console.log("getDBDetailById error:",l)}},delTableById:async(t,s)=>{const i=Ee(s);try{const l=await o.delete(`/${i}/deleteTable/${t}`),{success:h,data:c}=l;if(h)return c}catch(l){console.log("delTableById error:",l)}},delFileById:async t=>{try{const s=await o.delete(`/dataTable/deleteTableFileData/${t}`),{success:i,data:l}=s;if(i)return l}catch(s){console.log("delFileById",s)}},parseFiles:async({fileIds:t,isGenDescription:s,tableDescriptionMap:i})=>{try{const l=await o.post("/dataTable/parseFiles",{fileIds:t,isGenDescription:s,tableDescriptionMap:i}),{success:h,data:c}=l;if(h)return c}catch(l){console.log("parseFiles error:",l)}},reParseFile:async t=>{try{const s=await o.post(`/dataTable/reParseFile/${t}`),{success:i,data:l}=s;if(i)return l}catch(s){console.log("reParseFile error:",s)}},parseAppendFile:async({fileIds:t,tableId:s})=>{try{const i=await o.post("/dataTable/parseAppendFiles",{fileIds:t,tableId:s}),{success:l,data:h}=i;if(l)return h}catch(i){console.log("parseAppendFile error:",i)}},deleteUploadedFiles:async t=>{try{const s=await o.post("/dataTable/cancelUploadFile",{fileIds:t}),{success:i,data:l}=s;if(i)return l}catch(s){console.log("deleteUploadedFiles error:",s)}},getTableInfoById:async t=>{try{const s=await o.get(`/dataTable/queryTableMeta/${t}`),{success:i,data:l}=s;if(i)return l}catch(s){console.log("getTableInfoById error:",s)}},updateTableInfo:async({tableId:t,description:s,businessName:i})=>{try{const l=await o.post("/dataTable/updateTableInfo",{tableId:t,businessName:i,description:s}),{success:h,data:c}=l;if(h)return c}catch(l){console.log("updateTableInfo error:",l)}},optimizeDesc:async t=>{try{const s=await o.get(`/genTableDescription/${t}`),{success:i,data:l}=s;if(i)return l}catch(s){console.log("optimizeDesc error:",s)}}}},Ee=a=>a=="DataTable"?"dataTable":"directDB",oe='<template key="type" placeholder="\u8F93\u5165\u8868\u683C\u7C7B\u578B"></template>\u8868\u683C\u4E3B\u8981\u5C55\u793A\u4E86<template key="scene" placeholder="\u8F93\u5165\u573A\u666F\u540D\u79F0"></template>\u573A\u666F\u7684\u6570\u636E,\u5305\u542B<template key="primary_key" placeholder="\u4E3B\u8981\u5B57\u6BB5(\u53EF\u5199\u591A\u4E2A,\u7528\u987F\u53F7\u5206\u9694)"></template>\u7B49\u4E3B\u8981\u5B57\u6BB5,\u652F\u6301\u7528\u6237\u67E5\u8BE2<template key="search_direction" placeholder="\u5927\u6982\u4ECB\u7ECD\u9700\u8981\u67E5\u8BE2\u7684\u65B9\u5411"></template>\u95EE\u9898,\u5982\u679C\u8BBE\u8BA1\u591A\u8868\u5173\u8054\u67E5\u8BE2,\u6700\u597D\u8BF4\u660E\u6B64\u8868\u683C\u901A\u8FC7<template key="key_name" placeholder="\u5B57\u6BB5\u540D\u79F0"></template>\u5B57\u6BB5\u53EF\u4EE5\u5173\u8054\u53E6\u4E00\u4E2A<template key="table_name" placeholder="\u8868\u683C\u540D\u79F0"></template>\u8868\u683C\u3002',We={colors:{background:"#ffffff",border:"#e5e7eb",appBackground:"#ffffff",listBackground:"#ffffff",dashboardBackground:"#ffffff"},space:{padding:"0",margin:"md",shadow:"none"}},qe=({drawerTitle:a,drawerVisible:A,handleDrawerClose:F,dbId:m,tableInfo:o,token:k,url:O,role:E})=>{const z=J(()=>({id:"upload",layout:"vertical",formWidth:"670px",fields:[{id:"fileIds",name:"fileIds",type:"uploader",required:!1,defaultValue:"",uploaderConfig:{multiple:!o,accept:".csv,.xlsx,.xls",maxFiles:o?1:20,url:"http://10.15.12.13:8888/index/database/dataTable/uploadFile",autoUpload:!0,headers:{Authorization:k},queryParams:{databaseId:m,...o&&{tableId:o.tableId}},placeholder:v("div",{children:[e("div",{className:"text-lg font-bold",children:"\u70B9\u51FB\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u5904\u4E0A\u4F20"}),v("div",{className:"flex flex-col gap-1.8 mt-[12px]",children:[e("div",{className:"text-[#888888] font-[12px]",children:"\u6570\u91CF\uFF1A\u226420 \u6587\u4EF6\uFF08\u5F53\u524D 0/20\uFF09"}),e("div",{className:"text-[#888888] font-[12px]",style:{width:"580px"},children:"\u683C\u5F0F\uFF1A.xlsx / .xls / .csv /\uFF08\u7B2C\u4E00\u884C\u662F\u8868\u5934\uFF0C\u5176\u4ED6\u884C\u662F\u6570\u636E\uFF1BCSV \u652F\u6301 UTF-8/GBK/GB2312\u2026\uFF09"}),e("div",{className:"text-[#888888] font-[12px]",children:"\u5355\u6587\u4EF6\u9650\u5236\uFF1A \u226410\u4E07\u884C\uFF0C\u226460\u5217\uFF08\u8D85\u51FA\u81EA\u52A8\u5FFD\u7565\uFF09\uFF1B \u6BCF\u6587\u4EF6 \u22641\u4E2ASheet"}),e("div",{className:"text-[#888888] font-[12px]",children:"\u4E0A\u4F20\u7684\u6587\u4EF6\uFF0C\u5982\u679C\u6709\u4E0D\u7B26\u5408\u6587\u672C\u683C\u5F0F\u7684\u6570\u636E\u7CFB\u7EDF\u81EA\u52A8\u5FFD\u7565"})]})]}),listName:o?"\u8FFD\u52A0\u6587\u4EF6":"\u4E0A\u4F20\u6587\u4EF6\u5217\u8868",icons:{dragUpload:e("img",{src:$e,width:40}),itemStatus:{pending:e("span",{style:{fontSize:"12px",color:"#6b7280"}}),uploading:e("span",{style:{fontSize:"12px",color:"#007bff"}}),success:e("span",{style:{fontSize:"12px",color:"#10b981"}}),error:e("span",{style:{fontSize:"12px",color:"#ef4444"},children:"\u5931\u8D25"})},fileType:{default:e(ze,{size:20,style:{color:"#6b7280"}})}},...!o&&{buttons:[{label:"\u4F7F\u7528\u6A21\u7248",icon:e("img",{src:Ge}),mode:"text",onClick:()=>{i(!0)}}]},...!o&&{itemForm:[{type:"textarea",name:"description",counter:150,placeholder:"\u4E3A\u4E86\u63D0\u9AD8\u95EE\u7B54\u51C6\u786E\u7387\uFF0C\u8BF7\u8F93\u5165\u63CF\u8FF0"}]}}}]}),[o]),[M,g]=C(!1),[f,R]=C({}),G=de(null),[W,U]=C(!1),[B,t]=C([]),[s,i]=C(!1),[l,h]=C(oe),[c,L]=C(null),[p,_]=C(oe),[Y,q]=C(0),{parseFiles:Z,parseAppendFile:ue,deleteUploadedFiles:te}=we({url:O,token:k,role:E}),K=j(async(d,r,I)=>{var D;switch(console.log("[DynamicFormAdopter] \u4E8B\u4EF6:",d,r),d){case"form:ready":r.formRef?G.current=r.formRef:console.log("\u274C data.formRef \u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u4FDD\u5B58\u8868\u5355\u5F15\u7528");break;case"form:submit":P();break;case"form_field_change":R(b=>({...b,[r.fieldId]:r.value}));break;case"uploader:error":(D=r.item)!=null&&D.id?t(b=>[{id:r.item.id,status:r.item.status},...b]):X.error(r==null?void 0:r.message);break;case"uploader:success":t(b=>[{id:r.item.id,status:r.item.status},...b]);break;case"uploader:remove":const V=r.item.status;t(b=>b.filter(n=>n.id!==r.item.id)),V=="success"&&await ee([r.item.uploadApiRes]);break;default:console.log("\u672A\u5904\u7406\u7684\u4E8B\u4EF6:",d)}},[]),ae=J(()=>({label:"\u52A8\u6001\u8868\u5355\u793A\u4F8B",defaultActiveId:"form-view",model:null,views:[{label:"\u7528\u6237\u6CE8\u518C\u8868\u5355",id:"form-view",type:"form",size:"md",formWidth:z.formWidth,formConfig:{layout:z.layout,showReset:!1,showSubmit:!1,formWidth:z.formWidth,getFormData:()=>({...f,timestamp:new Date().toISOString(),formId:z.id}),onFieldChange:(d,r)=>{K("form_field_change",{fieldId:d,value:r},void 0)},onValidationError:d=>{K("form_validation_error",d,void 0)}}}],dataSource:[{id:z.id,fields:z.fields,defaultValues:{}}],eventsEmit:K,styles:{theme:We}}),[o,z]),P=async()=>{var d;try{g(!0);const r=await G.current.getAllData();if(r.isValid){const I=(d=r.fields.find(D=>D.name=="fileIds"))==null?void 0:d.value;if(Array.isArray(I)&&(I==null?void 0:I.length)>0){let D;if(o)D=await ue({fileIds:I.map(V=>V.uploadApiRes),tableId:o.id});else{const V={fileIds:I.map(b=>b.uploadApiRes),tableDescriptionMap:I.reduce((b,n)=>(b[n.uploadApiRes]=n.formData.description,b),{}),isGenDescription:W};D=await Z(V)}D&&F("refresh")}}}catch(r){console.error("\u8868\u5355\u6570\u636E\u5931\u8D25:",r)}finally{F(),g(!1),U(!1)}},Q=async d=>{var r;try{const I=await G.current.getAllData();if(I.isValid){const D=(r=I.fields.find(V=>V.name=="fileIds"))==null?void 0:r.value;if(D&&Array.isArray(D)&&(D==null?void 0:D.length)>0){const V=D.map(n=>n.uploadApiRes),b=await ee(V)}}}catch(I){console.error("\u8868\u5355\u6570\u636E\u5931\u8D25:",I)}finally{F(),U(!1)}},ee=async d=>{try{const r=await te(d);if(r)return r}catch(r){console.error("\u5220\u9664\u6587\u4EF6\u6570\u636E\u5931\u8D25:",r)}},se=d=>{U(d)},ie=j(d=>{h(d),console.log("\u6A21\u7248\u5185\u5BB9\u53D8\u5316:",d)},[]),le=j(d=>{L(()=>d),console.log("getData\u51FD\u6570\u5DF2\u8BBE\u7F6E")},[]),ne=j(async()=>{try{if(!c){console.error("getData\u51FD\u6570\u5C1A\u672A\u51C6\u5907\u597D\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}const d=c("pure_string");await navigator.clipboard.writeText(d),X.success("\u5DF2\u590D\u5236",1)}catch(d){console.error("\u590D\u5236\u5931\u8D25:",d)}finally{i(!1)}},[c]);return v(Be,{title:a,className:"database-upload-drawer",placement:"right",width:720,closeIcon:!1,extra:e(pe,{size:20,color:"#888888",onClick:()=>Q(),className:"cursor-pointer"}),open:A,destroyOnHidden:!0,footer:v("div",{className:`flex ${o?"justify-end":"justify-between"} items-center`,children:[!o&&v("div",{className:"flex gap-2 items-center",children:[e("span",{children:"\u81EA\u52A8\u751F\u6210\u6570\u636E\u8868\u63CF\u8FF0"})," ",e(Fe,{title:"\u81EA\u52A8\u751F\u6210\u5F00\u542F\u65F6\u5C06\u57FA\u4E8E\u6570\u636E\u667A\u80FD\u751F\u6210\u63CF\u8FF0\uFF1B\u82E5\u5F00\u542F\u6B64\u529F\u80FD\u5E76\u624B\u52A8\u586B\u5199\u63CF\u8FF0\uFF0C\u5C06\u4F18\u5148\u91C7\u7528\u7528\u6237\u586B\u5199\u7684\u5185\u5BB9\u3002",children:e(Le,{size:14})}),e(_e,{onChange:se})]}),v("div",{className:"flex self-end gap-3",children:[e($,{mode:"default",label:"\u53D6\u6D88",onClick:Q}),e($,{mode:"primary",label:"\u786E\u8BA4\u5BFC\u5165",loading:M,disabled:B.some(d=>d.status=="error"),onClick:async()=>{await P()}})]})]}),children:[e(be,{...ae},"upload-file"),e(me,{title:v("div",{children:["\u6A21\u7248",e("span",{className:"text-[12px] text-[#888888] ml-[8px]",children:"\u5B8C\u6210\u7F16\u8F91\u540E\uFF0C\u53EF\u5C06\u6587\u672C\u590D\u5236\u7C98\u8D34\u5230\u76F8\u5E94\u63CF\u8FF0\u6846\u4E2D\u3002"})]}),width:672,destroyOnHidden:!0,open:s,onCancel:()=>i(!1),footer:v("div",{className:"flex justify-end items-center gap-3",children:[e($,{mode:"default",label:"\u91CD\u7F6E",onClick:()=>{_(oe),q(d=>d+1)}}),e($,{mode:"primary",label:"\u590D\u5236",onClick:ne})]}),children:e(Ae,{data:p,onChange:ie,onGetData:le,styles:{theme:{colors:{primary:"#0969da",secondary:"#6b7280",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#3b82f6",background:"#ffffff",text:"#1f2937",border:"#e5e7eb",disabled:"#9ca3af",disabledBackground:"#f3f4f6",disabledText:"#6b7280",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)",appBackground:"transparent",listBackground:"#f9fafb",dashboardBackground:"#ffffff",textSecondary:"#6b7280"},space:{sidebar:"260px",size:"12px",radius:"8px",padding:"1rem",margin:"1rem",shadow:"0 2px 8px rgba(0,0,0,0.1)",lineHeight:"1.8"},icons:{},fonts:{body:{size:"14px",weight:"normal",family:"PingFang SC, Microsoft YaHei, Arial, sans-serif"},heading:{size:"14px",weight:"600",family:"PingFang SC, Microsoft YaHei, Arial, sans-serif"}},others:{baseFontWeight:"normal"}},templateField:{backgroundColor:"#E5EEFF",borderColor:"#84ADFF",borderRadius:"6px",padding:"6px 12px",margin:"2px",fontSize:"14px",fontWeight:"500",minWidth:"80px",textColor:"#84ADFF"}}},Y)})]})},Ze="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%201C13.4997%201.50025%2013.25%201.99975%2013.25%202.5C13.25%203.00025%2013.4997%203.49975%2014%204C13.4997%203.49975%2013.0003%203.25%2012.5%203.25C11.9997%203.25%2011.5003%203.49975%2011%204C11.5003%203.49975%2011.75%203.00025%2011.75%202.5C11.75%201.99975%2011.5003%201.50025%2011%201C11.5003%201.50025%2011.9997%201.75%2012.5%201.75C13.0003%201.75%2013.4997%201.50025%2014%201Z'%20fill='%23055AFF'/%3e%3cpath%20d='M13%206.28571V13C13%2013.5523%2012.5523%2014%2012%2014H4C3.44772%2014%203%2013.5523%203%2013V3C3%202.44772%203.44772%202%204%202H9.25'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cline%20x1='5.65'%20y1='6.35'%20x2='10.35'%20y2='6.35'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cline%20x1='5.65'%20y1='9.35'%20x2='8.35'%20y2='9.35'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3c/svg%3e",je="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_4199_8826)'%3e%3cpath%20d='M15.5554%2012.4444C14.9626%2013.0373%2014.6666%2013.6293%2014.6666%2014.2222C14.6666%2014.8151%2014.9626%2015.4071%2015.5554%2016C14.9626%2015.4071%2014.3706%2015.1111%2013.7777%2015.1111C13.1848%2015.1111%2012.5928%2015.4071%2011.9999%2016C12.5928%2015.4071%2012.8888%2014.8151%2012.8888%2014.2222C12.8888%2013.6293%2012.5928%2013.0373%2011.9999%2012.4444C12.5928%2013.0373%2013.1848%2013.3333%2013.7777%2013.3333C14.3706%2013.3333%2014.9626%2013.0373%2015.5554%2012.4444ZM14.6488%204.01778C15.1905%204.55954%2015.4948%205.29431%2015.4948%206.06044C15.4948%206.82658%2015.1905%207.56135%2014.6488%208.10311L7.735%2015.0169C7.46766%2015.2892%207.14901%2015.5058%206.79746%2015.6543C6.44592%2015.8028%206.06844%2015.8801%205.68684%2015.8819C5.30523%2015.8836%204.92706%2015.8097%204.57417%2015.6645C4.22127%2015.5193%203.90065%2015.3056%203.63081%2015.0357C3.36097%2014.7659%203.14727%2014.4453%203.00205%2014.0924C2.85682%2013.7395%202.78295%2013.3613%202.7847%2012.9797C2.78646%2012.5981%202.8638%2012.2206%203.01226%2011.8691C3.16072%2011.5176%203.37736%2011.1989%203.64967%2010.9316L3.95545%2010.6249L3.85145%2010.5244C3.30922%2010.0267%202.76522%209.77778%202.22211%209.77778C1.62923%209.77778%201.03722%2010.0738%200.444336%2010.6667C1.03722%2010.0738%201.33322%209.48178%201.33322%208.88889C1.33322%208.296%201.03722%207.704%200.444336%207.11111C1.03722%207.704%201.62923%208%202.22211%208C2.815%208%203.407%207.704%203.99989%207.11111C3.407%207.704%203.111%208.296%203.111%208.88889C3.111%209.46667%203.39278%2010.0444%203.95545%2010.6222L10.5634%204.01778C11.1052%203.47606%2011.84%203.17173%2012.6061%203.17173C13.3723%203.17173%2014.107%203.47606%2014.6488%204.01778ZM9.55189%206.91378L4.59189%2011.8738C4.30004%2012.1655%204.13603%2012.5612%204.13594%2012.9739C4.1359%2013.1782%204.17611%2013.3806%204.25426%2013.5694C4.33242%2013.7582%204.44699%2013.9297%204.59145%2014.0742C4.7359%2014.2187%204.9074%2014.3334%205.09617%2014.4116C5.28493%2014.4898%205.48725%2014.5301%205.69158%2014.5302C6.10424%2014.5303%206.50004%2014.3664%206.79189%2014.0747L11.7519%209.11378L9.55189%206.91378ZM11.5066%204.96089L10.495%205.97156L12.695%208.17156L13.7057%207.16C13.9846%206.86582%2014.1377%206.47437%2014.1323%206.069C14.1269%205.66364%2013.9635%205.27639%2013.6768%204.98973C13.3902%204.70306%2013.0029%204.53964%2012.5976%204.53425C12.1922%204.52887%2011.8007%204.68194%2011.5066%204.96089ZM9.59545%200C8.85589%200.740444%208.48434%201.48178%208.48434%202.22222C8.48434%202.96267%208.85589%203.704%209.59545%204.44444C8.85589%203.704%208.11456%203.33333%207.37322%203.33333C6.63367%203.33333%205.89234%203.704%205.151%204.44444C5.89234%203.704%206.26211%202.96267%206.26211%202.22222C6.26211%201.48178%205.89322%200.740444%205.15189%200C5.89322%200.740444%206.63456%201.11111%207.37411%201.11111C8.11545%201.11111%208.85678%200.740444%209.59634%200H9.59545Z'%20fill='%23055AFF'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_4199_8826'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",{confirm:Oe}=me,Ye='<template key="type" placeholder="\u8F93\u5165\u8868\u683C\u7C7B\u578B"></template>\u8868\u683C\u4E3B\u8981\u5C55\u793A\u4E86<template key="scene" placeholder="\u8F93\u5165\u573A\u666F\u540D\u79F0"></template>\u573A\u666F\u7684\u6570\u636E,\u5305\u542B<template key="primary_key" placeholder="\u4E3B\u8981\u5B57\u6BB5(\u53EF\u5199\u591A\u4E2A,\u7528\u987F\u53F7\u5206\u9694)"></template>\u7B49\u4E3B\u8981\u5B57\u6BB5,\u652F\u6301\u7528\u6237\u67E5\u8BE2<template key="search_direction" placeholder="\u5927\u6982\u4ECB\u7ECD\u9700\u8981\u67E5\u8BE2\u7684\u65B9\u5411"></template>\u95EE\u9898,\u5982\u679C\u8BBE\u8BA1\u591A\u8868\u5173\u8054\u67E5\u8BE2,\u6700\u597D\u8BF4\u660E\u6B64\u8868\u683C\u901A\u8FC7<template key="key_name" placeholder="\u5B57\u6BB5\u540D\u79F0"></template>\u5B57\u6BB5\u53EF\u4EE5\u5173\u8054\u53E6\u4E00\u4E2A<template key="table_name" placeholder="\u8868\u683C\u540D\u79F0"></template>\u8868\u683C\u3002',Xe=({drawerTitle:a,drawerVisible:A,tableInfo:F,handleDrawerClose:m,optimizeDesc:o,eventsEmit:k})=>{const O=J(()=>(F==null?void 0:F.data.find(p=>p.columnId=="name").value)||"-",[F]),[E,z]=C(""),[M,g]=C(null),[f,R]=C(""),[G,W]=C(0),[U,B]=C(!1),[t,s]=C(!1);ye(()=>{const p=(F==null?void 0:F.data.find(_=>_.columnId=="description").value)||"-";R(p)},[F]);const i=()=>{Oe({title:"\u4F60\u786E\u5B9A\u8981\u4F7F\u7528\u6A21\u677F\u5417\uFF1F",content:"\u8FD9\u5C06\u66FF\u6362\u4F60\u5F53\u524D\u5DF2\u586B\u5199\u7684\u5185\u5BB9\uFF0C\u4E14\u65E0\u6CD5\u64A4\u9500\u3002",okText:"\u786E\u8BA4\u66FF\u6362",cancelText:"\u53D6\u6D88",onOk(){R(Ye),W(p=>p+1)},onCancel(){console.log("Cancel")}})},l=j(p=>{z(p),console.log("\u6A21\u7248\u5185\u5BB9\u53D8\u5316:",p)},[]),h=j(p=>{g(()=>p),console.log("getData\u51FD\u6570\u5DF2\u8BBE\u7F6E")},[]),c=async()=>{try{B(!0);const p=await o(F.tableId);p&&(R(p),W(_=>_+1),B(!1))}catch{X.error("AI \u4F18\u5316\u5931\u8D25")}},L=j(()=>{if(!M){console.error("getData\u51FD\u6570\u5C1A\u672A\u51C6\u5907\u597D\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}const p=M("pure_string");k("table_info:update",p)},[M,k]);return v(Be,{title:a,placement:"right",width:720,onClose:m,closeIcon:!1,extra:e(pe,{size:20,color:"#888888",onClick:m,className:"cursor-pointer"}),open:A,destroyOnHidden:!0,footer:e("div",{className:"flex justify-end items-center",children:v("div",{className:"flex self-end gap-3",children:[e($,{mode:"default",label:"\u53D6\u6D88",onClick:m}),e($,{mode:"primary",label:"\u786E\u8BA4",onClick:()=>L(),disabled:U})]})}),children:[e("div",{className:"mb-[10px] font-bold",children:O}),v("div",{className:"mb-[10px]",children:[e("span",{style:{color:"#FF3B30",marginRight:"4px"},children:"*"}),e("span",{children:"\u6570\u636E\u8868\u63CF\u8FF0"}),e("span",{className:"text-[#888888] ml-[4px]",children:"(\u8BF7\u51C6\u786E\u586B\u5199\u8868\u683C\u7684\u5E94\u7528\u573A\u666F\u63CF\u8FF0\uFF0C\u5927\u6A21\u578B\u5C06\u4F9D\u8D56\u6B64\u4FE1\u606F\u8BC6\u522B\u5E76\u6B63\u786E\u8C03\u7528\u8BE5\u6570\u636E\u8868\u3002)"})]}),e(Ae,{data:f,onChange:l,onGetData:h,styles:{theme:{colors:{primary:"#0969da",secondary:"#6b7280",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#3b82f6",background:"#ffffff",text:"#1f2937",border:"#e5e7eb",disabled:"#9ca3af",disabledBackground:"#f3f4f6",disabledText:"#6b7280",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)",appBackground:"transparent",listBackground:"#f9fafb",dashboardBackground:"#ffffff",textSecondary:"#6b7280"},space:{sidebar:"260px",size:"12px",radius:"8px",padding:"1rem",margin:"1rem",shadow:"0 2px 8px rgba(0,0,0,0.1)",lineHeight:"1.8"},icons:{},fonts:{body:{size:"14px",weight:"normal",family:"PingFang SC, Microsoft YaHei, Arial, sans-serif"},heading:{size:"14px",weight:"600",family:"PingFang SC, Microsoft YaHei, Arial, sans-serif"}},others:{baseFontWeight:"normal"}},templateField:{backgroundColor:"#E5EEFF",borderColor:"#84ADFF",borderRadius:"6px",padding:"6px 12px",margin:"2px",fontSize:"14px",fontWeight:"500",minWidth:"80px",textColor:"#84ADFF"}}},G),v("div",{children:[e(Ue,{open:t,onOpenChange:p=>s(!!p),content:e("div",{style:{width:"600px",margin:"10px",padding:"10px"},onClick:i,className:"hover:bg-gray-100 h-[80px] cursor-pointer rounded",children:"______\u8868\u683C\u4E3B\u8981\u5C55\u793A\u4E86______\u573A\u666F\u7684\u6570\u636E\uFF0C\u5305\u542B______\u3001______\u3001______\u7B49\u4E3B\u8981\u5B57\u6BB5\uFF0C\u652F\u6301\u7528\u6237\u67E5\u8BE2______\u95EE\u9898(\u5927\u6982\u4ECB\u7ECD)\u5982\u679C\u6D89\u53CA\u591A\u8868\u5173\u8054\u67E5\u8BE2\uFF0C\u6700\u597D\u8BF4\u660E\u6B64\u8868\u683C\u901A\u8FC7______\u5B57\u6BB5\u53EF\u4EE5\u5173\u8054\u53E6\u4E00\u4E2A______\u8868\u683C\u3002"}),title:v("div",{className:"flex justify-between items-center",style:{margin:"10px"},children:[e("div",{className:"text-[16px]",children:"\u6A21\u7248"}),e(pe,{size:20,color:"#888888",onClick:()=>s(!1),className:"cursor-pointer"})]}),trigger:"click",destroyOnHidden:!0,placement:"bottomRight",getPopupContainer:p=>p,children:e("span",{children:e($,{mode:"text",icon:e("img",{src:Ze}),children:"\u4F7F\u7528\u6A21\u7248"})})}),e($,{onClick:c,mode:"text",icon:e("img",{src:je}),loading:U,children:"AI\u4F18\u5316"})]})]})},Ke=""+new URL("assets/empty.png",import.meta.url).href;var H=(a=>(a[a.DATE=0]="DATE",a[a.VIEW=1]="VIEW",a[a.ERROR=2]="ERROR",a[a.AUTHORIZE=3]="AUTHORIZE",a[a.DELETE=4]="DELETE",a[a.ANALYSIS_OR_EXTRACT=5]="ANALYSIS_OR_EXTRACT",a[a.DOWNLOAD=6]="DOWNLOAD",a[a.EDIT=7]="EDIT",a[a.ADD=8]="ADD",a[a.ANALYSIS_CONFIG=9]="ANALYSIS_CONFIG",a[a.AUTHORIZE_CONFIG=10]="AUTHORIZE_CONFIG",a))(H||{}),ve=(a=>(a.GENERATING="generating",a.SUCCESS="success",a.FAIL="fail",a))(ve||{});const re={success:"green",error:"red",warning:"orange",processing:"blue",info:"cyan",default:"default"},Je=a=>typeof a=="string"&&a in re?re[a]:re.default,ce=a=>{const{value:A,cell:F}=a;switch(F.columnId){case"importstatus":return A?e(Fe,{title:"\u6709\u8FFD\u52A0\u5931\u8D25\u7684\u6587\u4EF6\uFF0C\u8BF7\u53CA\u65F6\u5904\u7406",children:e(Ve,{color:"red",bordered:!1,children:"\u8FFD\u52A0\u5931\u8D25"})}):e(fe,{});case"status":const m=Je(a.cell.statusType);return A=="\u5BFC\u5165\u5931\u8D25"?e(Fe,{title:F.errorMsg,children:v("div",{className:"flex items-center gap-2",children:[e(Ce,{color:m,text:A}),e(xe,{size:14,color:"red"})]})}):e(Ce,{color:m,text:A});default:return e(fe,{})}},ge=[{statusType:"success",value:"\u5BFC\u5165\u6210\u529F",status:"30"},{statusType:"error",value:"\u5BFC\u5165\u5931\u8D25",status:"00"},{statusType:"default",value:"\u5F85\u5BFC\u5165",status:"10"},{statusType:"processing",value:"\u5BFC\u5165\u4E2D",status:"20"},{statusType:"processing",value:"\u5BFC\u5165\u4E2D",status:"11"}],Pe=a=>{var m,o;const{cell:A,value:F}=a;return typeof F=="string"?e("div",{title:F,style:{maxWidth:240,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:F}):(m=A.tableMeta)!=null&&m.isGenDescription&&((o=A.tableMeta)==null?void 0:o.generateDescriptionStatus)=="generating"?v("div",{className:"flex items-center gap-1 text-[#84ADFF]",style:{color:"#84ADFF"},children:[e("span",{children:"\u751F\u6210\u4E2D"}),e(He,{size:14})]}):"-"},Qe=({dbInfo:a,setDrawerTitle:A,setDrawerVisible:F,getBtnDisabled:m})=>v("div",{className:"flex flex-col items-center justify-center h-full",children:[e("div",{className:"text-xl font-semibold mb-3",children:e("img",{src:Ke,width:120})}),e("div",{className:"text-base mb-2",style:{color:"#888888"},children:"\u6682\u65E0\u6570\u636E\u6587\u4EF6"}),e("div",{className:"flex gap-3",children:e($,{mode:"primary",label:"\u4E0A\u4F20\u6570\u636E\u6587\u4EF6",disabled:m&&m(8,a==null?void 0:a.permission),onClick:()=>{A("\u4E0A\u4F20\u6570\u636E\u6587\u4EF6"),F(!0)}})})]}),{confirm:he}=me,pu=a=>{const{url:A,token:F,role:m,id:o,dbType:k,CustomComponents:O,getBtnDisabled:E}=a,[z,M]=C({container:"ready",content:"ready"}),g=de(null),f=de(null),[R,G]=C(),[W,U]=C({}),[B,t]=C(),[s,i]=C(!1),[l,h]=C(""),[c,L]=C(),[p,_]=C(!1),[Y,q]=C(""),{getTableList:Z,delTableById:ue,delFileById:te,updateTableInfo:K,optimizeDesc:ae,getTableTreeList:P,reParseFile:Q,getDBDetailById:ee}=we({url:A,token:F,role:m,eventsEmit:a.eventsEmit});ye(()=>(o&&k&&(M(n=>({...n,container:"loading"})),se()),()=>{f.current&&(clearTimeout(f.current),f.current=null)}),[o,k]);const se=async()=>{try{const n=await ee(o,k);n&&(t(n),M(u=>({...u,container:"ready",content:"loading"})))}catch(n){console.log("[TableApiError] getDBInfo:",n)}await b()},ie=async()=>{try{if(k=="DirectDB"){const n=await Z(o);if(n){const u=ne(n);return G(u||[]),M(w=>({...w,content:"ready"})),u||[]}else M(u=>({...u,content:"error"}))}else{const n=await P(o);if(n){const u=le(n);return G(u||[]),M(w=>({...w,content:"ready"})),u||[]}else M(u=>({...u,content:"error"}))}}catch(n){console.log("[TableApiError] getTableList:",n)}};function le(n){return(n||[]).map((u,w)=>{var S,N;let y=ge.find(x=>x.status==u.status);const T=u.children.some(x=>x.status=="00");return{id:u.fileId.toString(),tableId:u.tableId,data:[{columnId:"name",value:(u==null?void 0:u.originalFilename)||"-",type:"label"},{columnId:"description",value:(S=u==null?void 0:u.tableMeta)==null?void 0:S.description,type:"customized",tableMeta:u==null?void 0:u.tableMeta},{columnId:"count",value:`${u.rowCount}\u884C\uFF0C${u.columnCount}\u5217`,type:"text"},{columnId:"status",...y,type:"customized",errorMsg:u.errorMsg},{columnId:"importstatus",value:T,type:"customized"},{columnId:"createdAt",value:u.gmtCreate,type:"date"},{columnId:"updatedAt",value:u.gmtModified,type:"date"},...u.status=="30"?[{columnId:"actions",value:"view",label:"\u67E5\u770B",type:"action",disabled:E&&E(H.VIEW,u.permission)},{columnId:"actions",value:"edit",label:"\u4FEE\u6539\u914D\u7F6E",type:"action",disabled:E&&E(H.EDIT,u.permission)},{columnId:"actions",value:"addData",label:"\u8FFD\u52A0\u6570\u636E",type:"action",disabled:E&&E(H.EDIT,u.permission)}]:[],...u.status=="00"?[{columnId:"actions",value:"reValidate",label:"\u91CD\u65B0\u5BFC\u5165",type:"action"}]:[],{columnId:"actions",value:"delete",label:"\u5220\u9664",type:"action",disabled:E&&E(H.DELETE,u.permission)}],expanded:!1,...u.children&&((N=u.children)==null?void 0:N.length)>0&&{children:[...(u.children||[]).map(x=>{const ke=ge.find(Te=>Te.status==x.status),Ie=[{columnId:"name",value:x.originalFilename,type:"text"},{columnId:"count",value:`${x.rowCount}\u884C\uFF0C${x.columnCount}\u5217`,type:"text"},{columnId:"status",...ke,errorMsg:x.errorMsg,type:"customized"},{columnId:"createdAt",value:x.gmtCreate,type:"date"},{columnId:"updatedAt",value:x.gmtModified,type:"date"},...x.status=="30"?[{columnId:"actions",value:"view",label:"\u67E5\u770B",type:"action",disabled:E&&E(H.VIEW,x.permission)}]:[],...x.status=="00"?[{columnId:"actions",value:"reValidate",label:"\u91CD\u65B0\u5BFC\u5165",type:"action",disabled:E&&E(H.ADD,x.permission)}]:[],{columnId:"actions",value:"delete_sub",label:"\u5220\u9664",type:"action",disabled:E&&E(H.DELETE,x.permission)}];return{id:x.fileId.toString(),tableId:x.tableId,data:Ie}})]}}})}function ne(n){return(n||[]).map((u,w)=>({id:u.id||Me(8),data:[{columnId:"name",value:u.physicalName},{columnId:"cnname",value:u.businessName},{columnId:"colcount",value:u.columnCount},{columnId:"count",value:`${u.rowCount}\u884C\uFF0C${u.columnCount}\u5217`},{columnId:"actions",value:"view",label:"\u67E5\u770B",disabled:E&&E(H.VIEW,u.permission)}]}))}async function d(n,u,w){switch(console.log("[adopter] mergedEventsEmit",n,u,w),n){case"table_action_delete":{try{he({title:"\u786E\u8BA4\u5220\u9664\u6570\u636E\u5E93\uFF1F",content:"\u8BE5\u6570\u636E\u8868\u53CA\u5176\u8FFD\u52A0\u6570\u636E\u90FD\u5C06\u88AB\u5220\u9664\u4E14\u65E0\u6CD5\u6062\u590D",icon:e(xe,{color:"#FF4D4F",className:"mr-[8px]"}),okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",async onOk(){await ue(u.tableId,k)&&(g!=null&&g.current)&&(g==null||g.current.appFn.removeItem(u.id),X.success("\u5220\u9664\u6210\u529F"))}})}catch{console.log("\u5220\u9664\u8868\u6570\u636E\u5931\u8D25")}break}case"table_action_edit":{q("\u4FEE\u6539\u6570\u636E\u914D\u7F6E"),_(!0),L(u);break}case"toolbar_upload":{h("\u4E0A\u4F20\u6570\u636E\u6587\u4EF6"),i(!0);break}case"table_action_addData":{h("\u8FFD\u52A0\u6570\u636E"),i(!0),L(u);break}case"table_action_reValidate":{await Q(u.id)&&(f.current&&(clearTimeout(f.current),f.current=null),await b());break}case"table_info:update":{try{if(c!=null&&c.id){const y=(c==null?void 0:c.data.find(S=>S.columnId=="name").value)||"-";if(await K({tableId:c.tableId,description:u,businessName:y})&&(g!=null&&g.current)){const S={...c,data:c.data.map(N=>N.columnId=="description"?{...N,value:u}:N)};g==null||g.current.appFn.updateItem(S,c.id),X.success("\u4FEE\u6539\u914D\u7F6E\u6210\u529F")}}}catch(y){console.error("\u4FEE\u6539\u914D\u7F6E\u5931\u8D25",y)}finally{D()}break}case"table_action_delete_sub":{try{he({title:"\u786E\u8BA4\u5220\u9664\u6570\u636E\uFF1F",content:"\u5220\u9664\u540E\uFF0C\u8BE5\u6570\u636E\u5C06\u65E0\u6CD5\u6062\u590D",okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",async onOk(){const{id:y,tableId:T}=u;await te(u.id)&&(g!=null&&g.current)&&(U(N=>({...N,[T]:[...N[T]||[],y]})),u.data.find(N=>N.status=="00")&&(f.current&&(clearTimeout(f.current),f.current=null),b()),w.removeItem(y,T),X.success("\u8FFD\u52A0\u6587\u4EF6\u6570\u636E\u5220\u9664\u6210\u529F"))}})}catch{console.log("\u5220\u9664\u8868\u6570\u636E\u5931\u8D25")}break}case"toolbar_auth":{typeof a.eventsEmit=="function"&&a.eventsEmit("toolbar_auth",B);break}default:typeof a.eventsEmit=="function"&&a.eventsEmit(n,u);break}}const r=J(()=>({label:"\u6570\u636E\u8868\u7BA1\u7406",model:null,defaultActiveId:"direct-table-view",views:[{label:"\u6211\u7684\u6570\u636E\u5E93",id:"direct-table-view",type:"table",viewBehavior:"pagination",allowMultiSelect:!1,columns:[{id:"name",title:"\u6570\u636E\u8868\u82F1\u6587\u540D\u79F0",type:"label"},{id:"cnname",title:"\u6570\u636E\u8868\u4E2D\u6587\u540D\u79F0",type:"label"},{id:"colcount",title:"\u5B57\u6BB5\u6570",type:"text"},{id:"count",title:"\u6570\u636E\u91CF",type:"text"},{id:"actions",title:"\u64CD\u4F5C",type:"action"}],toolbar:[{type:"fuzzy_search",key:"search",label:"\u641C\u7D22",searchKeys:["name","description"],position:"right"},{type:"button",key:"auth",label:"\u914D\u7F6E",btnType:"default",position:"right"}]}]}),[R,k]),I=J(()=>({label:"\u6570\u636E\u8868\u7BA1\u7406",model:null,defaultActiveId:"data-table-view",views:[{label:"\u4E0A\u4F20\u6570\u636E\u5217\u8868",id:"data-table-view",type:"table",viewBehavior:"pagination",allowMultiSelect:!1,viewPageSize:10,columns:[{id:"name",title:"\u6587\u4EF6\u540D",type:"label",tip:"\u6587\u4EF6\u540D"},{id:"description",title:"\u63CF\u8FF0",type:"customized",component:e(Pe,{}),helpText:"\u6253\u5F00\u81EA\u52A8\u751F\u6210\u63CF\u8FF0\u5F00\u5173\u540E\uFF0C\u82E5\u63CF\u8FF0\u672A\u6B63\u5E38\u751F\u6210\uFF0C\u5219\u63CF\u8FF0\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u5982\u60A8\u4ECD\u7136\u9700\u8981\u63CF\u8FF0\uFF0C\u5219\u9700\u8981\u624B\u52A8\u6DFB\u52A0"},{id:"count",title:"\u6570\u636E\u91CF",type:"text",tip:"\u6570\u636E\u91CF"},{id:"status",title:"\u5BFC\u5165\u72B6\u6001",type:"customized",component:e(ce,{})},{id:"importstatus",title:"\u8FFD\u52A0\u63D0\u793A",type:"customized",component:e(ce,{})},{id:"createdAt",title:"\u521B\u5EFA\u65F6\u95F4",type:"date",tip:"\u521B\u5EFA\u65F6\u95F4"},{id:"updatedAt",title:"\u66F4\u65B0\u65F6\u95F4",type:"date",tip:"\u66F4\u65B0\u65F6\u95F4"},{id:"actions",title:"\u64CD\u4F5C",type:"action"}],toolbar:[{type:"button",key:"upload",label:"\u4E0A\u4F20\u6570\u636E\u6587\u4EF6",btnType:"primary",disabled:E&&E(H.ADD,B==null?void 0:B.permission),icon:e(Ne,{size:12})},{type:"fuzzy_search",key:"search",label:"\u641C\u7D22",searchKeys:["name","description",["name"]],position:"right"},{type:"button",key:"auth",label:"\u914D\u7F6E",btnType:"default",position:"right"}]}],subTableConfig:{type:"table",allowMultiSelect:!1,viewBehavior:"pagination",viewPageSize:5,columns:[{title:"\u8FFD\u52A0\u6587\u4EF6\u540D",id:"name",type:"text",tip:"\u8FFD\u52A0\u6587\u4EF6\u540D"},{title:"\u6570\u636E\u91CF",id:"count",type:"text",tip:"\u6570\u636E\u91CF"},{id:"status",title:"\u5BFC\u5165\u72B6\u6001",type:"customized",tip:"\u5BFC\u5165\u72B6\u6001",component:e(ce,{})},{title:"\u521B\u5EFA\u65F6\u95F4",id:"createdAt",type:"date",tip:"\u521B\u5EFA\u65F6\u95F4"},{title:"\u66F4\u6539\u65F6\u95F4",id:"updatedAt",type:"date",tip:"\u66F4\u6539\u65F6\u95F4"},{title:"\u64CD\u4F5C",id:"actions",type:"action"}]},subTablePendingIds:W,onSubTableRowAnimationComplete:(n,u)=>{U(w=>({...w,[n]:(w[n]||[]).filter(y=>y!==u)}))}}),[W,R,k,B]),D=n=>{i(!1),_(!1),L(void 0),n=="refresh"&&(f.current&&(clearTimeout(f.current),f.current=null),b())};function V(n){var u;if(!Array.isArray(n))return!0;for(const w of n){if(w.data){const y=w.data.find(S=>S.columnId==="status"),T=w.data.find(S=>S.columnId==="description");if(y&&(y.status==="20"||y.status==="11"||((u=T==null?void 0:T.tableMeta)==null?void 0:u.generateDescriptionStatus)==ve.GENERATING))return!1}if(Array.isArray(w.children)){for(const y of w.children)if(y.data){const T=y.data.find(S=>S.columnId==="status");if(T&&(T.status==="20"||T.status==="11"))return!1}}}return!0}const b=async()=>{const n=await ie();V(n||[])?f.current&&(clearTimeout(f.current),f.current=null):(f.current&&(clearTimeout(f.current),f.current=null),f.current=setTimeout(()=>{b()},5e3))};return v(Re,{title:B==null?void 0:B.name,description:(B==null?void 0:B.description)||"-",goBack:()=>{var n;(n=a.eventsEmit)==null||n.call(a,"goBack",{})},children:[e(be,{dataSource:R,ref:g,eventsEmit:d,status:z,CustomComponents:{EmptyData:()=>e(Qe,{dbInfo:B,setDrawerTitle:h,setDrawerVisible:i,getBtnDisabled:E}),...O},...k=="DataTable"?I:r}),e(qe,{drawerTitle:l,drawerVisible:s,handleDrawerClose:D,dbId:o,token:F,url:A,role:m,tableInfo:c}),e(Xe,{drawerTitle:Y,drawerVisible:p,handleDrawerClose:D,tableInfo:c,optimizeDesc:ae,eventsEmit:d})]})};export{pu as default};
|
|
11
|
+
*/const xe=De("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Ge="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%201C13.4997%201.50025%2013.25%201.99975%2013.25%202.5C13.25%203.00025%2013.4997%203.49975%2014%204C13.4997%203.49975%2013.0003%203.25%2012.5%203.25C11.9997%203.25%2011.5003%203.49975%2011%204C11.5003%203.49975%2011.75%203.00025%2011.75%202.5C11.75%201.99975%2011.5003%201.50025%2011%201C11.5003%201.50025%2011.9997%201.75%2012.5%201.75C13.0003%201.75%2013.4997%201.50025%2014%201Z'%20fill='%23055AFF'/%3e%3cpath%20d='M13%206.28571V13C13%2013.5523%2012.5523%2014%2012%2014H4C3.44772%2014%203%2013.5523%203%2013V3C3%202.44772%203.44772%202%204%202H9.25'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cline%20x1='5.65'%20y1='6.35'%20x2='10.35'%20y2='6.35'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cline%20x1='5.65'%20y1='9.35'%20x2='8.35'%20y2='9.35'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3c/svg%3e",$e="data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42%2022C43.1046%2022%2044%2022.8954%2044%2024V42C44%2043.1046%2043.1046%2044%2042%2044H6C4.89543%2044%204%2043.1046%204%2042V24.0088C4%2022.9042%204.89543%2022.0078%206%2022.0078C7.10457%2022.0078%208%2022.9042%208%2024.0088V40H40V24C40%2022.8954%2040.8954%2022%2042%2022ZM24.0293%204.00195C24.0808%204.00272%2024.1322%204.00504%2024.1836%204.00977C24.1904%204.01042%2024.1973%204.011%2024.2041%204.01172C24.2673%204.01819%2024.3301%204.02757%2024.3926%204.04004C24.3939%204.04031%2024.3952%204.04075%2024.3965%204.04102C24.7693%204.11623%2025.125%204.29691%2025.4141%204.58594L34.4141%2013.5859C35.1951%2014.367%2035.1951%2015.633%2034.4141%2016.4141C33.633%2017.1951%2032.367%2017.1951%2031.5859%2016.4141L25.9922%2010.8203V32C25.9922%2033.1046%2025.0968%2034%2023.9922%2034C22.8876%2034%2021.9922%2033.1046%2021.9922%2032V10.8359L16.4141%2016.4141C15.633%2017.1951%2014.367%2017.1951%2013.5859%2016.4141C12.8049%2015.633%2012.8049%2014.367%2013.5859%2013.5859L22.498%204.67285C22.8016%204.33138%2023.2194%204.09559%2023.6924%204.02441C23.7122%204.02135%2023.732%204.01809%2023.752%204.01562C23.7862%204.01152%2023.8207%204.00919%2023.8555%204.00684C23.8887%204.00446%2023.9218%204.00268%2023.9551%204.00195C23.9674%204.00173%2023.9798%204%2023.9922%204C24.0046%204%2024.0169%204.00173%2024.0293%204.00195Z'%20fill='url(%23paint0_linear_4072_34663)'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_4072_34663'%20x1='4'%20y1='-7.25'%20x2='54.4707'%20y2='1.556'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%232B69FF'/%3e%3cstop%20offset='1'%20stop-color='%238F91FF'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e",we=({url:a,token:A,role:F,eventsEmit:m})=>{const o=Se.create({baseURL:a,timeout:1e6});return o.interceptors.request.use(t=>{let s=A;return!s&&!["user/login","user/kaptcha","user/regist"].some(l=>t.url.includes(l))?(m&&m("request:error_auth",{errorMsg:"\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F",redirect:"/login"}),Promise.reject(new Error("\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"))):(t.headers.Authorization=s||"",t.headers.userName=F==="\u672A\u767B\u5F55\u7528\u6237"?"":F,t)}),o.interceptors.response.use(t=>{const s=["user/kaptcha"],i=t.data;if(s.some(L=>t.config.url&&t.config.url.includes(L))||i.size&&i.type)return i;const{success:l,errorMsg:h,errorCode:c}=i;if(l)return i;m&&m("request:error_business",{errorCode:c,errorMsg:h||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",response:i})},t=>{var s,i,l,h,c,L,p,_,Y;if(t.message==="canceled")return Promise.reject(t);if(m){let q="request:error_network",Z={errorMsg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:t};((s=t==null?void 0:t.response)==null?void 0:s.status)===401?(q="request:error_auth",Z={errorMsg:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650",error:t,redirect:"/login"}):(((l=(i=t==null?void 0:t.response)==null?void 0:i.data)==null?void 0:l.errorCode)==="30013"||((c=(h=t==null?void 0:t.response)==null?void 0:h.data)==null?void 0:c.errorCode)==="30023")&&(q="request:error_business",Z={errorCode:(p=(L=t==null?void 0:t.response)==null?void 0:L.data)==null?void 0:p.errorCode,errorMsg:((Y=(_=t==null?void 0:t.response)==null?void 0:_.data)==null?void 0:Y.errorMsg)||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",error:t}),m(q,Z)}return Promise.reject(t)}),{getTableList:async t=>{try{const s=await o.get(`/directDB/queryTableList/${t}`),{success:i,data:l}=s;if(i)return l}catch(s){console.log("getTableList error:",s)}},getTableTreeList:async t=>{try{const s=await o.get(`/dataTable/queryTableFileTreeList/${t}`),{success:i,data:l}=s;if(i)return l}catch(s){console.log("getTableTreeList error:",s)}},getDBDetailById:async(t,s)=>{const i=Ee(s);try{const l=await o.get(`/${i}/queryDBInfo/${t}`),{success:h,data:c}=l;if(h)return c}catch(l){console.log("getDBDetailById error:",l)}},delTableById:async(t,s)=>{const i=Ee(s);try{const l=await o.delete(`/${i}/deleteTable/${t}`),{success:h,data:c}=l;if(h)return c}catch(l){console.log("delTableById error:",l)}},delFileById:async t=>{try{const s=await o.delete(`/dataTable/deleteTableFileData/${t}`),{success:i,data:l}=s;if(i)return l}catch(s){console.log("delFileById",s)}},parseFiles:async({fileIds:t,isGenDescription:s,tableDescriptionMap:i})=>{try{const l=await o.post("/dataTable/parseFiles",{fileIds:t,isGenDescription:s,tableDescriptionMap:i}),{success:h,data:c}=l;if(h)return c}catch(l){console.log("parseFiles error:",l)}},reParseFile:async t=>{try{const s=await o.post(`/dataTable/reParseFile/${t}`),{success:i,data:l}=s;if(i)return l}catch(s){console.log("reParseFile error:",s)}},parseAppendFile:async({fileIds:t,tableId:s})=>{try{const i=await o.post("/dataTable/parseAppendFiles",{fileIds:t,tableId:s}),{success:l,data:h}=i;if(l)return h}catch(i){console.log("parseAppendFile error:",i)}},deleteUploadedFiles:async t=>{try{const s=await o.post("/dataTable/cancelUploadFile",{fileIds:t}),{success:i,data:l}=s;if(i)return l}catch(s){console.log("deleteUploadedFiles error:",s)}},getTableInfoById:async t=>{try{const s=await o.get(`/dataTable/queryTableMeta/${t}`),{success:i,data:l}=s;if(i)return l}catch(s){console.log("getTableInfoById error:",s)}},updateTableInfo:async({tableId:t,description:s,businessName:i})=>{try{const l=await o.post("/dataTable/updateTableInfo",{tableId:t,businessName:i,description:s}),{success:h,data:c}=l;if(h)return c}catch(l){console.log("updateTableInfo error:",l)}},optimizeDesc:async t=>{try{const s=await o.get(`/genTableDescription/${t}`),{success:i,data:l}=s;if(i)return l}catch(s){console.log("optimizeDesc error:",s)}}}},Ee=a=>a=="DataTable"?"dataTable":"directDB",oe='<template key="type" placeholder="\u8F93\u5165\u8868\u683C\u7C7B\u578B"></template>\u8868\u683C\u4E3B\u8981\u5C55\u793A\u4E86<template key="scene" placeholder="\u8F93\u5165\u573A\u666F\u540D\u79F0"></template>\u573A\u666F\u7684\u6570\u636E,\u5305\u542B<template key="primary_key" placeholder="\u4E3B\u8981\u5B57\u6BB5(\u53EF\u5199\u591A\u4E2A,\u7528\u987F\u53F7\u5206\u9694)"></template>\u7B49\u4E3B\u8981\u5B57\u6BB5,\u652F\u6301\u7528\u6237\u67E5\u8BE2<template key="search_direction" placeholder="\u5927\u6982\u4ECB\u7ECD\u9700\u8981\u67E5\u8BE2\u7684\u65B9\u5411"></template>\u95EE\u9898,\u5982\u679C\u8BBE\u8BA1\u591A\u8868\u5173\u8054\u67E5\u8BE2,\u6700\u597D\u8BF4\u660E\u6B64\u8868\u683C\u901A\u8FC7<template key="key_name" placeholder="\u5B57\u6BB5\u540D\u79F0"></template>\u5B57\u6BB5\u53EF\u4EE5\u5173\u8054\u53E6\u4E00\u4E2A<template key="table_name" placeholder="\u8868\u683C\u540D\u79F0"></template>\u8868\u683C\u3002',We={colors:{background:"#ffffff",border:"#e5e7eb",appBackground:"#ffffff",listBackground:"#ffffff",dashboardBackground:"#ffffff"},space:{padding:"0",margin:"md",shadow:"none"}},qe=({drawerTitle:a,drawerVisible:A,handleDrawerClose:F,dbId:m,tableInfo:o,token:k,url:O,role:E})=>{const z=J(()=>({id:"upload",layout:"vertical",formWidth:"670px",fields:[{id:"fileIds",name:"fileIds",type:"uploader",required:!1,defaultValue:"",uploaderConfig:{multiple:!o,accept:".csv,.xlsx,.xls",maxFiles:o?1:20,url:"http://10.15.12.13:8888/index/database/dataTable/uploadFile",autoUpload:!0,headers:{Authorization:k},queryParams:{databaseId:m,...o&&{tableId:o.tableId}},placeholder:v("div",{children:[e("div",{className:"text-lg font-bold",children:"\u70B9\u51FB\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u5904\u4E0A\u4F20"}),v("div",{className:"flex flex-col gap-1.8 mt-[12px]",children:[e("div",{className:"text-[#888888] font-[12px]",children:"\u6570\u91CF\uFF1A\u226420 \u6587\u4EF6\uFF08\u5F53\u524D 0/20\uFF09"}),e("div",{className:"text-[#888888] font-[12px]",style:{width:"580px"},children:"\u683C\u5F0F\uFF1A.xlsx / .xls / .csv /\uFF08\u7B2C\u4E00\u884C\u662F\u8868\u5934\uFF0C\u5176\u4ED6\u884C\u662F\u6570\u636E\uFF1BCSV \u652F\u6301 UTF-8/GBK/GB2312\u2026\uFF09"}),e("div",{className:"text-[#888888] font-[12px]",children:"\u5355\u6587\u4EF6\u9650\u5236\uFF1A \u226410\u4E07\u884C\uFF0C\u226460\u5217\uFF08\u8D85\u51FA\u81EA\u52A8\u5FFD\u7565\uFF09\uFF1B \u6BCF\u6587\u4EF6 \u22641\u4E2ASheet"}),e("div",{className:"text-[#888888] font-[12px]",children:"\u4E0A\u4F20\u7684\u6587\u4EF6\uFF0C\u5982\u679C\u6709\u4E0D\u7B26\u5408\u6587\u672C\u683C\u5F0F\u7684\u6570\u636E\u7CFB\u7EDF\u81EA\u52A8\u5FFD\u7565"})]})]}),listName:o?"\u8FFD\u52A0\u6587\u4EF6":"\u4E0A\u4F20\u6587\u4EF6\u5217\u8868",icons:{dragUpload:e("img",{src:$e,width:40}),itemStatus:{pending:e("span",{style:{fontSize:"12px",color:"#6b7280"}}),uploading:e("span",{style:{fontSize:"12px",color:"#007bff"}}),success:e("span",{style:{fontSize:"12px",color:"#10b981"}}),error:e("span",{style:{fontSize:"12px",color:"#ef4444"},children:"\u5931\u8D25"})},fileType:{default:e(ze,{size:20,style:{color:"#6b7280"}})}},...!o&&{buttons:[{label:"\u4F7F\u7528\u6A21\u7248",icon:e("img",{src:Ge}),mode:"text",onClick:()=>{i(!0)}}]},...!o&&{itemForm:[{type:"textarea",name:"description",counter:150,placeholder:"\u4E3A\u4E86\u63D0\u9AD8\u95EE\u7B54\u51C6\u786E\u7387\uFF0C\u8BF7\u8F93\u5165\u63CF\u8FF0"}]}}}]}),[o]),[M,g]=C(!1),[f,R]=C({}),G=de(null),[W,U]=C(!1),[B,t]=C([]),[s,i]=C(!1),[l,h]=C(oe),[c,L]=C(null),[p,_]=C(oe),[Y,q]=C(0),{parseFiles:Z,parseAppendFile:ue,deleteUploadedFiles:te}=we({url:O,token:k,role:E}),K=j(async(d,r,I)=>{var D;switch(console.log("[DynamicFormAdopter] \u4E8B\u4EF6:",d,r),d){case"form:ready":r.formRef?G.current=r.formRef:console.log("\u274C data.formRef \u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u4FDD\u5B58\u8868\u5355\u5F15\u7528");break;case"form:submit":P();break;case"form_field_change":R(b=>({...b,[r.fieldId]:r.value}));break;case"uploader:error":(D=r.item)!=null&&D.id?t(b=>[{id:r.item.id,status:r.item.status},...b]):X.error(r==null?void 0:r.message);break;case"uploader:success":t(b=>[{id:r.item.id,status:r.item.status},...b]);break;case"uploader:remove":const V=r.item.status;t(b=>b.filter(n=>n.id!==r.item.id)),V=="success"&&await ee([r.item.uploadApiRes]);break;default:console.log("\u672A\u5904\u7406\u7684\u4E8B\u4EF6:",d)}},[]),ae=J(()=>({label:"\u52A8\u6001\u8868\u5355\u793A\u4F8B",defaultActiveId:"form-view",model:null,views:[{label:"\u7528\u6237\u6CE8\u518C\u8868\u5355",id:"form-view",type:"form",size:"md",formWidth:z.formWidth,formConfig:{layout:z.layout,showReset:!1,showSubmit:!1,formWidth:z.formWidth,getFormData:()=>({...f,timestamp:new Date().toISOString(),formId:z.id}),onFieldChange:(d,r)=>{K("form_field_change",{fieldId:d,value:r},void 0)},onValidationError:d=>{K("form_validation_error",d,void 0)}}}],dataSource:[{id:z.id,fields:z.fields,defaultValues:{}}],eventsEmit:K,styles:{theme:We}}),[o,z]),P=async()=>{var d;try{g(!0);const r=await G.current.getAllData();if(r.isValid){const I=(d=r.fields.find(D=>D.name=="fileIds"))==null?void 0:d.value;if(Array.isArray(I)&&(I==null?void 0:I.length)>0){let D;if(o)D=await ue({fileIds:I.map(V=>V.uploadApiRes),tableId:o.id});else{const V={fileIds:I.map(b=>b.uploadApiRes),tableDescriptionMap:I.reduce((b,n)=>(b[n.uploadApiRes]=n.formData.description,b),{}),isGenDescription:W};D=await Z(V)}D&&F("refresh")}}}catch(r){console.error("\u8868\u5355\u6570\u636E\u5931\u8D25:",r)}finally{F(),g(!1),U(!1)}},Q=async d=>{var r;try{const I=await G.current.getAllData();if(I.isValid){const D=(r=I.fields.find(V=>V.name=="fileIds"))==null?void 0:r.value;if(D&&Array.isArray(D)&&(D==null?void 0:D.length)>0){const V=D.map(n=>n.uploadApiRes),b=await ee(V)}}}catch(I){console.error("\u8868\u5355\u6570\u636E\u5931\u8D25:",I)}finally{F(),U(!1)}},ee=async d=>{try{const r=await te(d);if(r)return r}catch(r){console.error("\u5220\u9664\u6587\u4EF6\u6570\u636E\u5931\u8D25:",r)}},se=d=>{U(d)},ie=j(d=>{h(d),console.log("\u6A21\u7248\u5185\u5BB9\u53D8\u5316:",d)},[]),le=j(d=>{L(()=>d),console.log("getData\u51FD\u6570\u5DF2\u8BBE\u7F6E")},[]),ne=j(async()=>{try{if(!c){console.error("getData\u51FD\u6570\u5C1A\u672A\u51C6\u5907\u597D\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}const d=c("pure_string");await navigator.clipboard.writeText(d),X.success("\u5DF2\u590D\u5236",1)}catch(d){console.error("\u590D\u5236\u5931\u8D25:",d)}finally{i(!1)}},[c]);return v(Be,{title:a,className:"database-upload-drawer",placement:"right",width:720,closeIcon:!1,extra:e(pe,{size:20,color:"#888888",onClick:()=>Q(),className:"cursor-pointer"}),open:A,destroyOnHidden:!0,footer:v("div",{className:`flex ${o?"justify-end":"justify-between"} items-center`,children:[!o&&v("div",{className:"flex gap-2 items-center",children:[e("span",{children:"\u81EA\u52A8\u751F\u6210\u6570\u636E\u8868\u63CF\u8FF0"})," ",e(Fe,{title:"\u81EA\u52A8\u751F\u6210\u5F00\u542F\u65F6\u5C06\u57FA\u4E8E\u6570\u636E\u667A\u80FD\u751F\u6210\u63CF\u8FF0\uFF1B\u82E5\u5F00\u542F\u6B64\u529F\u80FD\u5E76\u624B\u52A8\u586B\u5199\u63CF\u8FF0\uFF0C\u5C06\u4F18\u5148\u91C7\u7528\u7528\u6237\u586B\u5199\u7684\u5185\u5BB9\u3002",children:e(Le,{size:14})}),e(_e,{onChange:se})]}),v("div",{className:"flex self-end gap-3",children:[e($,{mode:"default",label:"\u53D6\u6D88",onClick:Q}),e($,{mode:"primary",label:"\u786E\u8BA4\u5BFC\u5165",loading:M,disabled:B.some(d=>d.status=="error"),onClick:async()=>{await P()}})]})]}),children:[e(be,{...ae},"upload-file"),e(me,{title:v("div",{children:["\u6A21\u7248",e("span",{className:"text-[12px] text-[#888888] ml-[8px]",children:"\u5B8C\u6210\u7F16\u8F91\u540E\uFF0C\u53EF\u5C06\u6587\u672C\u590D\u5236\u7C98\u8D34\u5230\u76F8\u5E94\u63CF\u8FF0\u6846\u4E2D\u3002"})]}),width:672,destroyOnHidden:!0,open:s,onCancel:()=>i(!1),footer:v("div",{className:"flex justify-end items-center gap-3",children:[e($,{mode:"default",label:"\u91CD\u7F6E",onClick:()=>{_(oe),q(d=>d+1)}}),e($,{mode:"primary",label:"\u590D\u5236",onClick:ne})]}),children:e(Ae,{data:p,onChange:ie,onGetData:le,styles:{theme:{colors:{primary:"#0969da",secondary:"#6b7280",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#3b82f6",background:"#ffffff",text:"#1f2937",border:"#e5e7eb",disabled:"#9ca3af",disabledBackground:"#f3f4f6",disabledText:"#6b7280",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)",appBackground:"transparent",listBackground:"#f9fafb",dashboardBackground:"#ffffff",textSecondary:"#6b7280"},space:{sidebar:"260px",size:"12px",radius:"8px",padding:"1rem",margin:"1rem",shadow:"0 2px 8px rgba(0,0,0,0.1)",lineHeight:"1.8"},icons:{},fonts:{body:{size:"14px",weight:"normal",family:"PingFang SC, Microsoft YaHei, Arial, sans-serif"},heading:{size:"14px",weight:"600",family:"PingFang SC, Microsoft YaHei, Arial, sans-serif"}},others:{baseFontWeight:"normal"}},templateField:{backgroundColor:"#E5EEFF",borderColor:"#84ADFF",borderRadius:"6px",padding:"6px 12px",margin:"2px",fontSize:"14px",fontWeight:"500",minWidth:"80px",textColor:"#84ADFF"}}},Y)})]})},Ze="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14%201C13.4997%201.50025%2013.25%201.99975%2013.25%202.5C13.25%203.00025%2013.4997%203.49975%2014%204C13.4997%203.49975%2013.0003%203.25%2012.5%203.25C11.9997%203.25%2011.5003%203.49975%2011%204C11.5003%203.49975%2011.75%203.00025%2011.75%202.5C11.75%201.99975%2011.5003%201.50025%2011%201C11.5003%201.50025%2011.9997%201.75%2012.5%201.75C13.0003%201.75%2013.4997%201.50025%2014%201Z'%20fill='%23055AFF'/%3e%3cpath%20d='M13%206.28571V13C13%2013.5523%2012.5523%2014%2012%2014H4C3.44772%2014%203%2013.5523%203%2013V3C3%202.44772%203.44772%202%204%202H9.25'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cline%20x1='5.65'%20y1='6.35'%20x2='10.35'%20y2='6.35'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cline%20x1='5.65'%20y1='9.35'%20x2='8.35'%20y2='9.35'%20stroke='%23055AFF'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3c/svg%3e",je="data:image/svg+xml,%3csvg%20width='16'%20height='16'%20viewBox='0%200%2016%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_4199_8826)'%3e%3cpath%20d='M15.5554%2012.4444C14.9626%2013.0373%2014.6666%2013.6293%2014.6666%2014.2222C14.6666%2014.8151%2014.9626%2015.4071%2015.5554%2016C14.9626%2015.4071%2014.3706%2015.1111%2013.7777%2015.1111C13.1848%2015.1111%2012.5928%2015.4071%2011.9999%2016C12.5928%2015.4071%2012.8888%2014.8151%2012.8888%2014.2222C12.8888%2013.6293%2012.5928%2013.0373%2011.9999%2012.4444C12.5928%2013.0373%2013.1848%2013.3333%2013.7777%2013.3333C14.3706%2013.3333%2014.9626%2013.0373%2015.5554%2012.4444ZM14.6488%204.01778C15.1905%204.55954%2015.4948%205.29431%2015.4948%206.06044C15.4948%206.82658%2015.1905%207.56135%2014.6488%208.10311L7.735%2015.0169C7.46766%2015.2892%207.14901%2015.5058%206.79746%2015.6543C6.44592%2015.8028%206.06844%2015.8801%205.68684%2015.8819C5.30523%2015.8836%204.92706%2015.8097%204.57417%2015.6645C4.22127%2015.5193%203.90065%2015.3056%203.63081%2015.0357C3.36097%2014.7659%203.14727%2014.4453%203.00205%2014.0924C2.85682%2013.7395%202.78295%2013.3613%202.7847%2012.9797C2.78646%2012.5981%202.8638%2012.2206%203.01226%2011.8691C3.16072%2011.5176%203.37736%2011.1989%203.64967%2010.9316L3.95545%2010.6249L3.85145%2010.5244C3.30922%2010.0267%202.76522%209.77778%202.22211%209.77778C1.62923%209.77778%201.03722%2010.0738%200.444336%2010.6667C1.03722%2010.0738%201.33322%209.48178%201.33322%208.88889C1.33322%208.296%201.03722%207.704%200.444336%207.11111C1.03722%207.704%201.62923%208%202.22211%208C2.815%208%203.407%207.704%203.99989%207.11111C3.407%207.704%203.111%208.296%203.111%208.88889C3.111%209.46667%203.39278%2010.0444%203.95545%2010.6222L10.5634%204.01778C11.1052%203.47606%2011.84%203.17173%2012.6061%203.17173C13.3723%203.17173%2014.107%203.47606%2014.6488%204.01778ZM9.55189%206.91378L4.59189%2011.8738C4.30004%2012.1655%204.13603%2012.5612%204.13594%2012.9739C4.1359%2013.1782%204.17611%2013.3806%204.25426%2013.5694C4.33242%2013.7582%204.44699%2013.9297%204.59145%2014.0742C4.7359%2014.2187%204.9074%2014.3334%205.09617%2014.4116C5.28493%2014.4898%205.48725%2014.5301%205.69158%2014.5302C6.10424%2014.5303%206.50004%2014.3664%206.79189%2014.0747L11.7519%209.11378L9.55189%206.91378ZM11.5066%204.96089L10.495%205.97156L12.695%208.17156L13.7057%207.16C13.9846%206.86582%2014.1377%206.47437%2014.1323%206.069C14.1269%205.66364%2013.9635%205.27639%2013.6768%204.98973C13.3902%204.70306%2013.0029%204.53964%2012.5976%204.53425C12.1922%204.52887%2011.8007%204.68194%2011.5066%204.96089ZM9.59545%200C8.85589%200.740444%208.48434%201.48178%208.48434%202.22222C8.48434%202.96267%208.85589%203.704%209.59545%204.44444C8.85589%203.704%208.11456%203.33333%207.37322%203.33333C6.63367%203.33333%205.89234%203.704%205.151%204.44444C5.89234%203.704%206.26211%202.96267%206.26211%202.22222C6.26211%201.48178%205.89322%200.740444%205.15189%200C5.89322%200.740444%206.63456%201.11111%207.37411%201.11111C8.11545%201.11111%208.85678%200.740444%209.59634%200H9.59545Z'%20fill='%23055AFF'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_4199_8826'%3e%3crect%20width='16'%20height='16'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",{confirm:Oe}=me,Ye='<template key="type" placeholder="\u8F93\u5165\u8868\u683C\u7C7B\u578B"></template>\u8868\u683C\u4E3B\u8981\u5C55\u793A\u4E86<template key="scene" placeholder="\u8F93\u5165\u573A\u666F\u540D\u79F0"></template>\u573A\u666F\u7684\u6570\u636E,\u5305\u542B<template key="primary_key" placeholder="\u4E3B\u8981\u5B57\u6BB5(\u53EF\u5199\u591A\u4E2A,\u7528\u987F\u53F7\u5206\u9694)"></template>\u7B49\u4E3B\u8981\u5B57\u6BB5,\u652F\u6301\u7528\u6237\u67E5\u8BE2<template key="search_direction" placeholder="\u5927\u6982\u4ECB\u7ECD\u9700\u8981\u67E5\u8BE2\u7684\u65B9\u5411"></template>\u95EE\u9898,\u5982\u679C\u8BBE\u8BA1\u591A\u8868\u5173\u8054\u67E5\u8BE2,\u6700\u597D\u8BF4\u660E\u6B64\u8868\u683C\u901A\u8FC7<template key="key_name" placeholder="\u5B57\u6BB5\u540D\u79F0"></template>\u5B57\u6BB5\u53EF\u4EE5\u5173\u8054\u53E6\u4E00\u4E2A<template key="table_name" placeholder="\u8868\u683C\u540D\u79F0"></template>\u8868\u683C\u3002',Xe=({drawerTitle:a,drawerVisible:A,tableInfo:F,handleDrawerClose:m,optimizeDesc:o,eventsEmit:k})=>{const O=J(()=>(F==null?void 0:F.data.find(p=>p.columnId=="name").value)||"-",[F]),[E,z]=C(""),[M,g]=C(null),[f,R]=C(""),[G,W]=C(0),[U,B]=C(!1),[t,s]=C(!1);ye(()=>{const p=(F==null?void 0:F.data.find(_=>_.columnId=="description").value)||"-";R(p)},[F]);const i=()=>{Oe({title:"\u4F60\u786E\u5B9A\u8981\u4F7F\u7528\u6A21\u677F\u5417\uFF1F",content:"\u8FD9\u5C06\u66FF\u6362\u4F60\u5F53\u524D\u5DF2\u586B\u5199\u7684\u5185\u5BB9\uFF0C\u4E14\u65E0\u6CD5\u64A4\u9500\u3002",okText:"\u786E\u8BA4\u66FF\u6362",cancelText:"\u53D6\u6D88",onOk(){R(Ye),W(p=>p+1)},onCancel(){console.log("Cancel")}})},l=j(p=>{z(p),console.log("\u6A21\u7248\u5185\u5BB9\u53D8\u5316:",p)},[]),h=j(p=>{g(()=>p),console.log("getData\u51FD\u6570\u5DF2\u8BBE\u7F6E")},[]),c=async()=>{try{B(!0);const p=await o(F.tableId);p&&(R(p),W(_=>_+1),B(!1))}catch{X.error("AI \u4F18\u5316\u5931\u8D25")}},L=j(()=>{if(!M){console.error("getData\u51FD\u6570\u5C1A\u672A\u51C6\u5907\u597D\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5");return}const p=M("pure_string");k("table_info:update",p)},[M,k]);return v(Be,{title:a,placement:"right",width:720,onClose:m,closeIcon:!1,extra:e(pe,{size:20,color:"#888888",onClick:m,className:"cursor-pointer"}),open:A,destroyOnHidden:!0,footer:e("div",{className:"flex justify-end items-center",children:v("div",{className:"flex self-end gap-3",children:[e($,{mode:"default",label:"\u53D6\u6D88",onClick:m}),e($,{mode:"primary",label:"\u786E\u8BA4",onClick:()=>L(),disabled:U})]})}),children:[e("div",{className:"mb-[10px] font-bold",children:O}),v("div",{className:"mb-[10px]",children:[e("span",{style:{color:"#FF3B30",marginRight:"4px"},children:"*"}),e("span",{children:"\u6570\u636E\u8868\u63CF\u8FF0"}),e("span",{className:"text-[#888888] ml-[4px]",children:"(\u8BF7\u51C6\u786E\u586B\u5199\u8868\u683C\u7684\u5E94\u7528\u573A\u666F\u63CF\u8FF0\uFF0C\u5927\u6A21\u578B\u5C06\u4F9D\u8D56\u6B64\u4FE1\u606F\u8BC6\u522B\u5E76\u6B63\u786E\u8C03\u7528\u8BE5\u6570\u636E\u8868\u3002)"})]}),e(Ae,{data:f,onChange:l,onGetData:h,styles:{theme:{colors:{primary:"#0969da",secondary:"#6b7280",success:"#10b981",warning:"#f59e0b",error:"#ef4444",info:"#3b82f6",background:"#ffffff",text:"#1f2937",border:"#e5e7eb",disabled:"#9ca3af",disabledBackground:"#f3f4f6",disabledText:"#6b7280",shadow:"0 1px 3px rgba(0, 0, 0, 0.1)",appBackground:"transparent",listBackground:"#f9fafb",dashboardBackground:"#ffffff",textSecondary:"#6b7280"},space:{sidebar:"260px",size:"12px",radius:"8px",padding:"1rem",margin:"1rem",shadow:"0 2px 8px rgba(0,0,0,0.1)",lineHeight:"1.8"},icons:{},fonts:{body:{size:"14px",weight:"normal",family:"PingFang SC, Microsoft YaHei, Arial, sans-serif"},heading:{size:"14px",weight:"600",family:"PingFang SC, Microsoft YaHei, Arial, sans-serif"}},others:{baseFontWeight:"normal"}},templateField:{backgroundColor:"#E5EEFF",borderColor:"#84ADFF",borderRadius:"6px",padding:"6px 12px",margin:"2px",fontSize:"14px",fontWeight:"500",minWidth:"80px",textColor:"#84ADFF"}}},G),v("div",{children:[e(Ue,{open:t,onOpenChange:p=>s(!!p),content:e("div",{style:{width:"600px",margin:"10px",padding:"10px"},onClick:i,className:"hover:bg-gray-100 h-[80px] cursor-pointer rounded",children:"______\u8868\u683C\u4E3B\u8981\u5C55\u793A\u4E86______\u573A\u666F\u7684\u6570\u636E\uFF0C\u5305\u542B______\u3001______\u3001______\u7B49\u4E3B\u8981\u5B57\u6BB5\uFF0C\u652F\u6301\u7528\u6237\u67E5\u8BE2______\u95EE\u9898(\u5927\u6982\u4ECB\u7ECD)\u5982\u679C\u6D89\u53CA\u591A\u8868\u5173\u8054\u67E5\u8BE2\uFF0C\u6700\u597D\u8BF4\u660E\u6B64\u8868\u683C\u901A\u8FC7______\u5B57\u6BB5\u53EF\u4EE5\u5173\u8054\u53E6\u4E00\u4E2A______\u8868\u683C\u3002"}),title:v("div",{className:"flex justify-between items-center",style:{margin:"10px"},children:[e("div",{className:"text-[16px]",children:"\u6A21\u7248"}),e(pe,{size:20,color:"#888888",onClick:()=>s(!1),className:"cursor-pointer"})]}),trigger:"click",destroyOnHidden:!0,placement:"bottomRight",getPopupContainer:p=>p,children:e("span",{children:e($,{mode:"text",icon:e("img",{src:Ze}),children:"\u4F7F\u7528\u6A21\u7248"})})}),e($,{onClick:c,mode:"text",icon:e("img",{src:je}),loading:U,children:"AI\u4F18\u5316"})]})]})},Ke=""+new URL("assets/empty.png",import.meta.url).href;var H=(a=>(a[a.DATE=0]="DATE",a[a.VIEW=1]="VIEW",a[a.ERROR=2]="ERROR",a[a.AUTHORIZE=3]="AUTHORIZE",a[a.DELETE=4]="DELETE",a[a.ANALYSIS_OR_EXTRACT=5]="ANALYSIS_OR_EXTRACT",a[a.DOWNLOAD=6]="DOWNLOAD",a[a.EDIT=7]="EDIT",a[a.ADD=8]="ADD",a[a.ANALYSIS_CONFIG=9]="ANALYSIS_CONFIG",a[a.AUTHORIZE_CONFIG=10]="AUTHORIZE_CONFIG",a))(H||{}),ve=(a=>(a.GENERATING="generating",a.SUCCESS="success",a.FAIL="fail",a))(ve||{});const re={success:"green",error:"red",warning:"orange",processing:"blue",info:"cyan",default:"default"},Je=a=>typeof a=="string"&&a in re?re[a]:re.default,ce=a=>{const{value:A,cell:F}=a;switch(F.columnId){case"importstatus":return A?e(Fe,{title:"\u6709\u8FFD\u52A0\u5931\u8D25\u7684\u6587\u4EF6\uFF0C\u8BF7\u53CA\u65F6\u5904\u7406",children:e(Ve,{color:"red",bordered:!1,children:"\u8FFD\u52A0\u5931\u8D25"})}):e(fe,{});case"status":const m=Je(a.cell.statusType);return A=="\u5BFC\u5165\u5931\u8D25"?e(Fe,{title:F.errorMsg,children:v("div",{className:"flex items-center gap-2",children:[e(Ce,{color:m,text:A}),e(xe,{size:14,color:"red"})]})}):e(Ce,{color:m,text:A});default:return e(fe,{})}},ge=[{statusType:"success",value:"\u5BFC\u5165\u6210\u529F",status:"30"},{statusType:"error",value:"\u5BFC\u5165\u5931\u8D25",status:"00"},{statusType:"default",value:"\u5F85\u5BFC\u5165",status:"10"},{statusType:"processing",value:"\u5BFC\u5165\u4E2D",status:"20"},{statusType:"processing",value:"\u5BFC\u5165\u4E2D",status:"11"}],Pe=a=>{var m,o;const{cell:A,value:F}=a;return typeof F=="string"?e("div",{title:F,style:{maxWidth:240,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:F}):(m=A.tableMeta)!=null&&m.isGenDescription&&((o=A.tableMeta)==null?void 0:o.generateDescriptionStatus)=="generating"?v("div",{className:"flex items-center gap-1 text-[#84ADFF]",style:{color:"#84ADFF"},children:[e("span",{children:"\u751F\u6210\u4E2D"}),e(He,{size:14})]}):"-"},Qe=({dbInfo:a,setDrawerTitle:A,setDrawerVisible:F,getBtnDisabled:m})=>v("div",{className:"flex flex-col items-center justify-center h-full",children:[e("div",{className:"text-xl font-semibold mb-3",children:e("img",{src:Ke,width:120})}),e("div",{className:"text-base mb-2",style:{color:"#888888"},children:"\u6682\u65E0\u6570\u636E\u6587\u4EF6"}),e("div",{className:"flex gap-3",children:e($,{mode:"primary",label:"\u4E0A\u4F20\u6570\u636E\u6587\u4EF6",disabled:m&&m(8,a==null?void 0:a.permission),onClick:()=>{A("\u4E0A\u4F20\u6570\u636E\u6587\u4EF6"),F(!0)}})})]}),{confirm:he}=me,mu=a=>{const{url:A,token:F,role:m,id:o,dbType:k,CustomComponents:O,getBtnDisabled:E}=a,[z,M]=C({container:"ready",content:"ready"}),g=de(null),f=de(null),[R,G]=C(),[W,U]=C({}),[B,t]=C(),[s,i]=C(!1),[l,h]=C(""),[c,L]=C(),[p,_]=C(!1),[Y,q]=C(""),{getTableList:Z,delTableById:ue,delFileById:te,updateTableInfo:K,optimizeDesc:ae,getTableTreeList:P,reParseFile:Q,getDBDetailById:ee}=we({url:A,token:F,role:m,eventsEmit:a.eventsEmit});ye(()=>(o&&k&&(M(n=>({...n,container:"loading"})),se()),()=>{f.current&&(clearTimeout(f.current),f.current=null)}),[o,k]);const se=async()=>{try{const n=await ee(o,k);n&&(t(n),M(u=>({...u,container:"ready",content:"loading"})))}catch(n){console.log("[TableApiError] getDBInfo:",n)}await b()},ie=async()=>{try{if(k=="DirectDB"){const n=await Z(o);if(n){const u=ne(n);return G(u||[]),M(w=>({...w,content:"ready"})),u||[]}else M(u=>({...u,content:"error"}))}else{const n=await P(o);if(n){const u=le(n);return G(u||[]),M(w=>({...w,content:"ready"})),u||[]}else M(u=>({...u,content:"error"}))}}catch(n){console.log("[TableApiError] getTableList:",n)}};function le(n){return(n||[]).map((u,w)=>{var S,N;let y=ge.find(x=>x.status==u.status);const T=u.children.some(x=>x.status=="00");return{id:u.fileId.toString(),tableId:u.tableId,data:[{columnId:"name",value:(u==null?void 0:u.originalFilename)||"-",type:"label"},{columnId:"description",value:(S=u==null?void 0:u.tableMeta)==null?void 0:S.description,type:"customized",tableMeta:u==null?void 0:u.tableMeta},{columnId:"count",value:`${u.rowCount}\u884C\uFF0C${u.columnCount}\u5217`,type:"text"},{columnId:"status",...y,type:"customized",errorMsg:u.errorMsg},{columnId:"importstatus",value:T,type:"customized"},{columnId:"createdAt",value:u.gmtCreate,type:"date"},{columnId:"updatedAt",value:u.gmtModified,type:"date"},...u.status=="30"?[{columnId:"actions",value:"view",label:"\u67E5\u770B",type:"action",disabled:E&&E(H.VIEW,u.permission)},{columnId:"actions",value:"edit",label:"\u4FEE\u6539\u914D\u7F6E",type:"action",disabled:E&&E(H.EDIT,u.permission)},{columnId:"actions",value:"addData",label:"\u8FFD\u52A0\u6570\u636E",type:"action",disabled:E&&E(H.EDIT,u.permission)}]:[],...u.status=="00"?[{columnId:"actions",value:"reValidate",label:"\u91CD\u65B0\u5BFC\u5165",type:"action"}]:[],{columnId:"actions",value:"delete",label:"\u5220\u9664",type:"action",disabled:E&&E(H.DELETE,u.permission)}],expanded:!1,...u.children&&((N=u.children)==null?void 0:N.length)>0&&{children:[...(u.children||[]).map(x=>{const ke=ge.find(Te=>Te.status==x.status),Ie=[{columnId:"name",value:x.originalFilename,type:"text"},{columnId:"count",value:`${x.rowCount}\u884C\uFF0C${x.columnCount}\u5217`,type:"text"},{columnId:"status",...ke,errorMsg:x.errorMsg,type:"customized"},{columnId:"createdAt",value:x.gmtCreate,type:"date"},{columnId:"updatedAt",value:x.gmtModified,type:"date"},...x.status=="30"?[{columnId:"actions",value:"view",label:"\u67E5\u770B",type:"action",disabled:E&&E(H.VIEW,x.permission)}]:[],...x.status=="00"?[{columnId:"actions",value:"reValidate",label:"\u91CD\u65B0\u5BFC\u5165",type:"action",disabled:E&&E(H.ADD,x.permission)}]:[],{columnId:"actions",value:"delete_sub",label:"\u5220\u9664",type:"action",disabled:E&&E(H.DELETE,x.permission)}];return{id:x.fileId.toString(),tableId:x.tableId,data:Ie}})]}}})}function ne(n){return(n||[]).map((u,w)=>({id:u.id||Me(8),data:[{columnId:"name",value:u.physicalName},{columnId:"cnname",value:u.businessName},{columnId:"colcount",value:u.columnCount},{columnId:"count",value:`${u.rowCount}\u884C\uFF0C${u.columnCount}\u5217`},{columnId:"actions",value:"view",label:"\u67E5\u770B",disabled:E&&E(H.VIEW,u.permission)}]}))}async function d(n,u,w){switch(console.log("[adopter] mergedEventsEmit",n,u,w),n){case"table_action_delete":{try{he({title:"\u786E\u8BA4\u5220\u9664\u6570\u636E\u5E93\uFF1F",content:"\u8BE5\u6570\u636E\u8868\u53CA\u5176\u8FFD\u52A0\u6570\u636E\u90FD\u5C06\u88AB\u5220\u9664\u4E14\u65E0\u6CD5\u6062\u590D",icon:e(xe,{color:"#FF4D4F",className:"mr-[8px]"}),okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",async onOk(){await ue(u.tableId,k)&&(g!=null&&g.current)&&(g==null||g.current.appFn.removeItem(u.id),X.success("\u5220\u9664\u6210\u529F"))}})}catch{console.log("\u5220\u9664\u8868\u6570\u636E\u5931\u8D25")}break}case"table_action_edit":{q("\u4FEE\u6539\u6570\u636E\u914D\u7F6E"),_(!0),L(u);break}case"toolbar_upload":{h("\u4E0A\u4F20\u6570\u636E\u6587\u4EF6"),i(!0);break}case"table_action_addData":{h("\u8FFD\u52A0\u6570\u636E"),i(!0),L(u);break}case"table_action_reValidate":{await Q(u.id)&&(f.current&&(clearTimeout(f.current),f.current=null),await b());break}case"table_info:update":{try{if(c!=null&&c.id){const y=(c==null?void 0:c.data.find(S=>S.columnId=="name").value)||"-";if(await K({tableId:c.tableId,description:u,businessName:y})&&(g!=null&&g.current)){const S={...c,data:c.data.map(N=>N.columnId=="description"?{...N,value:u}:N)};g==null||g.current.appFn.updateItem(S,c.id),X.success("\u4FEE\u6539\u914D\u7F6E\u6210\u529F")}}}catch(y){console.error("\u4FEE\u6539\u914D\u7F6E\u5931\u8D25",y)}finally{D()}break}case"table_action_delete_sub":{try{he({title:"\u786E\u8BA4\u5220\u9664\u6570\u636E\uFF1F",content:"\u5220\u9664\u540E\uFF0C\u8BE5\u6570\u636E\u5C06\u65E0\u6CD5\u6062\u590D",okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",async onOk(){const{id:y,tableId:T}=u;await te(u.id)&&(g!=null&&g.current)&&(U(N=>({...N,[T]:[...N[T]||[],y]})),u.data.find(N=>N.status=="00")&&(f.current&&(clearTimeout(f.current),f.current=null),b()),w.removeItem(y,T),X.success("\u8FFD\u52A0\u6587\u4EF6\u6570\u636E\u5220\u9664\u6210\u529F"))}})}catch{console.log("\u5220\u9664\u8868\u6570\u636E\u5931\u8D25")}break}case"toolbar_auth":{typeof a.eventsEmit=="function"&&a.eventsEmit("toolbar_auth",B);break}default:typeof a.eventsEmit=="function"&&a.eventsEmit(n,u);break}}const r=J(()=>({label:"\u6570\u636E\u8868\u7BA1\u7406",model:null,defaultActiveId:"direct-table-view",views:[{label:"\u6211\u7684\u6570\u636E\u5E93",id:"direct-table-view",type:"table",viewBehavior:"pagination",allowMultiSelect:!1,columns:[{id:"name",title:"\u6570\u636E\u8868\u82F1\u6587\u540D\u79F0",type:"label"},{id:"cnname",title:"\u6570\u636E\u8868\u4E2D\u6587\u540D\u79F0",type:"label"},{id:"colcount",title:"\u5B57\u6BB5\u6570",type:"text"},{id:"count",title:"\u6570\u636E\u91CF",type:"text"},{id:"actions",title:"\u64CD\u4F5C",type:"action"}],toolbar:[{type:"fuzzy_search",key:"search",label:"\u641C\u7D22",searchKeys:["name","description"],position:"right"},{type:"button",key:"auth",label:"\u914D\u7F6E",btnType:"default",position:"right"}]}]}),[R,k]),I=J(()=>({label:"\u6570\u636E\u8868\u7BA1\u7406",model:null,defaultActiveId:"data-table-view",views:[{label:"\u4E0A\u4F20\u6570\u636E\u5217\u8868",id:"data-table-view",type:"table",viewBehavior:"pagination",allowMultiSelect:!1,viewPageSize:10,columns:[{id:"name",title:"\u6587\u4EF6\u540D",type:"label",tip:"\u6587\u4EF6\u540D"},{id:"description",title:"\u63CF\u8FF0",type:"customized",component:e(Pe,{}),helpText:"\u6253\u5F00\u81EA\u52A8\u751F\u6210\u63CF\u8FF0\u5F00\u5173\u540E\uFF0C\u82E5\u63CF\u8FF0\u672A\u6B63\u5E38\u751F\u6210\uFF0C\u5219\u63CF\u8FF0\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u5982\u60A8\u4ECD\u7136\u9700\u8981\u63CF\u8FF0\uFF0C\u5219\u9700\u8981\u624B\u52A8\u6DFB\u52A0"},{id:"count",title:"\u6570\u636E\u91CF",type:"text",tip:"\u6570\u636E\u91CF"},{id:"status",title:"\u5BFC\u5165\u72B6\u6001",type:"customized",component:e(ce,{})},{id:"importstatus",title:"\u8FFD\u52A0\u63D0\u793A",type:"customized",component:e(ce,{})},{id:"createdAt",title:"\u521B\u5EFA\u65F6\u95F4",type:"date",tip:"\u521B\u5EFA\u65F6\u95F4"},{id:"updatedAt",title:"\u66F4\u65B0\u65F6\u95F4",type:"date",tip:"\u66F4\u65B0\u65F6\u95F4"},{id:"actions",title:"\u64CD\u4F5C",type:"action"}],toolbar:[{type:"button",key:"upload",label:"\u4E0A\u4F20\u6570\u636E\u6587\u4EF6",btnType:"primary",disabled:E&&E(H.ADD,B==null?void 0:B.permission),icon:e(Ne,{size:12})},{type:"fuzzy_search",key:"search",label:"\u641C\u7D22",searchKeys:["name","description",["name"]],position:"right"},{type:"button",key:"auth",label:"\u914D\u7F6E",btnType:"default",position:"right"}]}],subTableConfig:{type:"table",allowMultiSelect:!1,viewBehavior:"pagination",viewPageSize:5,columns:[{title:"\u8FFD\u52A0\u6587\u4EF6\u540D",id:"name",type:"text",tip:"\u8FFD\u52A0\u6587\u4EF6\u540D"},{title:"\u6570\u636E\u91CF",id:"count",type:"text",tip:"\u6570\u636E\u91CF"},{id:"status",title:"\u5BFC\u5165\u72B6\u6001",type:"customized",tip:"\u5BFC\u5165\u72B6\u6001",component:e(ce,{})},{title:"\u521B\u5EFA\u65F6\u95F4",id:"createdAt",type:"date",tip:"\u521B\u5EFA\u65F6\u95F4"},{title:"\u66F4\u6539\u65F6\u95F4",id:"updatedAt",type:"date",tip:"\u66F4\u6539\u65F6\u95F4"},{title:"\u64CD\u4F5C",id:"actions",type:"action"}]},subTablePendingIds:W,onSubTableRowAnimationComplete:(n,u)=>{U(w=>({...w,[n]:(w[n]||[]).filter(y=>y!==u)}))}}),[W,R,k,B]),D=n=>{i(!1),_(!1),L(void 0),n=="refresh"&&(f.current&&(clearTimeout(f.current),f.current=null),b())};function V(n){var u;if(!Array.isArray(n))return!0;for(const w of n){if(w.data){const y=w.data.find(S=>S.columnId==="status"),T=w.data.find(S=>S.columnId==="description");if(y&&(y.status==="20"||y.status==="11"||((u=T==null?void 0:T.tableMeta)==null?void 0:u.generateDescriptionStatus)==ve.GENERATING))return!1}if(Array.isArray(w.children)){for(const y of w.children)if(y.data){const T=y.data.find(S=>S.columnId==="status");if(T&&(T.status==="20"||T.status==="11"))return!1}}}return!0}const b=async()=>{const n=await ie();V(n||[])?f.current&&(clearTimeout(f.current),f.current=null):(f.current&&(clearTimeout(f.current),f.current=null),f.current=setTimeout(()=>{b()},5e3))};return v(Re,{title:B==null?void 0:B.name,description:(B==null?void 0:B.description)||"-",goBack:()=>{var n;(n=a.eventsEmit)==null||n.call(a,"goBack",{})},children:[e(be,{dataSource:R,ref:g,eventsEmit:d,status:z,CustomComponents:{EmptyData:()=>e(Qe,{dbInfo:B,setDrawerTitle:h,setDrawerVisible:i,getBtnDisabled:E}),...O},...k=="DataTable"?I:r}),e(qe,{drawerTitle:l,drawerVisible:s,handleDrawerClose:D,dbId:o,token:F,url:A,role:m,tableInfo:c}),e(Xe,{drawerTitle:Y,drawerVisible:p,handleDrawerClose:D,tableInfo:c,optimizeDesc:ae,eventsEmit:d})]})};export{mu as default};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{jsxs as Y,jsx as N}from"react/jsx-runtime";import*as f from"react";import F,{useContext as de,Children as $e,useState as G,useRef as Le,useEffect as Ne,useMemo as Pe}from"react";import{u as ce}from"./assets/index-CpW6Dhpp.js";import{c as ze,C as ge,h as k,o as Fe,x as ue,g as Me,b as Te,t as E,r as _e,u as Ae,y as Oe,z as je,_ as ye,A as Re,D as be,R as xe,G as He,a as qe,I as We,H as Ge,J as Se,m as ke}from"./assets/index-D1m34Ij7.js";import{D as Ve}from"./assets/index-Bb8_WB-l.js";import{P as Xe,S as Ue}from"./assets/index-BVENTW1Q.js";import{X as Je}from"./assets/x-Dr3EBTzJ.js";import{M as Ke}from"./assets/index-_gBtdXQV.js";import{M as Ye,s as Ce}from"./assets/index-BpJ9Bm5x.js";import"react-dom";/**
|
|
2
|
+
* @license lucide-react v0.456.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const Qe=ze("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]),pe=F.createContext({});pe.Consumer;var ve=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]]);return n};const Ze=t=>{var{prefixCls:e,className:n,avatar:i,title:o,description:p}=t,$=ve(t,["prefixCls","className","avatar","title","description"]);const{getPrefixCls:y}=de(ge),h=y("list",e),a=k(`${h}-item-meta`,n),d=F.createElement("div",{className:`${h}-item-meta-content`},o&&F.createElement("h4",{className:`${h}-item-meta-title`},o),p&&F.createElement("div",{className:`${h}-item-meta-description`},p));return F.createElement("div",Object.assign({},$,{className:a}),i&&F.createElement("div",{className:`${h}-item-meta-avatar`},i),(o||p)&&d)},et=F.forwardRef((t,e)=>{const{prefixCls:n,children:i,actions:o,extra:p,styles:$,className:y,classNames:h,colStyle:a}=t,d=ve(t,["prefixCls","children","actions","extra","styles","className","classNames","colStyle"]),{grid:s,itemLayout:r}=de(pe),{getPrefixCls:g,list:u}=de(ge),D=I=>{var v,O;return k((O=(v=u==null?void 0:u.item)===null||v===void 0?void 0:v.classNames)===null||O===void 0?void 0:O[I],h==null?void 0:h[I])},x=I=>{var v,O;return Object.assign(Object.assign({},(O=(v=u==null?void 0:u.item)===null||v===void 0?void 0:v.styles)===null||O===void 0?void 0:O[I]),$==null?void 0:$[I])},A=()=>{let I=!1;return $e.forEach(i,v=>{typeof v=="string"&&(I=!0)}),I&&$e.count(i)>1},L=()=>r==="vertical"?!!p:!A(),S=g("list",n),P=o&&o.length>0&&F.createElement("ul",{className:k(`${S}-item-action`,D("actions")),key:"actions",style:x("actions")},o.map((I,v)=>F.createElement("li",{key:`${S}-item-action-${v}`},I,v!==o.length-1&&F.createElement("em",{className:`${S}-item-action-split`})))),q=s?"div":"li",R=F.createElement(q,Object.assign({},d,s?{}:{ref:e},{className:k(`${S}-item`,{[`${S}-item-no-flex`]:!L()},y)}),r==="vertical"&&p?[F.createElement("div",{className:`${S}-item-main`,key:"content"},i,P),F.createElement("div",{className:k(`${S}-item-extra`,D("extra")),key:"extra",style:x("extra")},p)]:[i,P,Fe(p,{key:"extra"})]);return s?F.createElement(ue,{ref:e,flex:1,style:a},R):R}),Ee=et;Ee.Meta=Ze;const tt=t=>{const{listBorderedCls:e,componentCls:n,paddingLG:i,margin:o,itemPaddingSM:p,itemPaddingLG:$,marginLG:y,borderRadiusLG:h}=t,a=E(t.calc(h).sub(t.lineWidth).equal());return{[e]:{border:`${E(t.lineWidth)} ${t.lineType} ${t.colorBorder}`,borderRadius:h,[`${n}-header`]:{borderRadius:`${a} ${a} 0 0`},[`${n}-footer`]:{borderRadius:`0 0 ${a} ${a}`},[`${n}-header,${n}-footer,${n}-item`]:{paddingInline:i},[`${n}-pagination`]:{margin:`${E(o)} ${E(y)}`}},[`${e}${n}-sm`]:{[`${n}-item,${n}-header,${n}-footer`]:{padding:p}},[`${e}${n}-lg`]:{[`${n}-item,${n}-header,${n}-footer`]:{padding:$}}}},at=t=>{const{componentCls:e,screenSM:n,screenMD:i,marginLG:o,marginSM:p,margin:$}=t;return{[`@media screen and (max-width:${i}px)`]:{[e]:{[`${e}-item`]:{[`${e}-item-action`]:{marginInlineStart:o}}},[`${e}-vertical`]:{[`${e}-item`]:{[`${e}-item-extra`]:{marginInlineStart:o}}}},[`@media screen and (max-width: ${n}px)`]:{[e]:{[`${e}-item`]:{flexWrap:"wrap",[`${e}-action`]:{marginInlineStart:p}}},[`${e}-vertical`]:{[`${e}-item`]:{flexWrap:"wrap-reverse",[`${e}-item-main`]:{minWidth:t.contentWidth},[`${e}-item-extra`]:{margin:`auto auto ${E($)}`}}}}}},nt=t=>{const{componentCls:e,antCls:n,controlHeight:i,minHeight:o,paddingSM:p,marginLG:$,padding:y,itemPadding:h,colorPrimary:a,itemPaddingSM:d,itemPaddingLG:s,paddingXS:r,margin:g,colorText:u,colorTextDescription:D,motionDurationSlow:x,lineWidth:A,headerBg:L,footerBg:S,emptyTextPadding:P,metaMarginBottom:q,avatarMarginRight:R,titleMarginBottom:I,descriptionFontSize:v}=t;return{[e]:Object.assign(Object.assign({},_e(t)),{position:"relative","--rc-virtual-list-scrollbar-bg":t.colorSplit,"*":{outline:"none"},[`${e}-header`]:{background:L},[`${e}-footer`]:{background:S},[`${e}-header, ${e}-footer`]:{paddingBlock:p},[`${e}-pagination`]:{marginBlockStart:$,[`${n}-pagination-options`]:{textAlign:"start"}},[`${e}-spin`]:{minHeight:o,textAlign:"center"},[`${e}-items`]:{margin:0,padding:0,listStyle:"none"},[`${e}-item`]:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:h,color:u,[`${e}-item-meta`]:{display:"flex",flex:1,alignItems:"flex-start",maxWidth:"100%",[`${e}-item-meta-avatar`]:{marginInlineEnd:R},[`${e}-item-meta-content`]:{flex:"1 0",width:0,color:u},[`${e}-item-meta-title`]:{margin:`0 0 ${E(t.marginXXS)} 0`,color:u,fontSize:t.fontSize,lineHeight:t.lineHeight,"> a":{color:u,transition:`all ${x}`,"&:hover":{color:a}}},[`${e}-item-meta-description`]:{color:D,fontSize:v,lineHeight:t.lineHeight}},[`${e}-item-action`]:{flex:"0 0 auto",marginInlineStart:t.marginXXL,padding:0,fontSize:0,listStyle:"none","& > li":{position:"relative",display:"inline-block",padding:`0 ${E(r)}`,color:D,fontSize:t.fontSize,lineHeight:t.lineHeight,textAlign:"center","&:first-child":{paddingInlineStart:0}},[`${e}-item-action-split`]:{position:"absolute",insetBlockStart:"50%",insetInlineEnd:0,width:A,height:t.calc(t.fontHeight).sub(t.calc(t.marginXXS).mul(2)).equal(),transform:"translateY(-50%)",backgroundColor:t.colorSplit}}},[`${e}-empty`]:{padding:`${E(y)} 0`,color:D,fontSize:t.fontSizeSM,textAlign:"center"},[`${e}-empty-text`]:{padding:P,color:t.colorTextDisabled,fontSize:t.fontSize,textAlign:"center"},[`${e}-item-no-flex`]:{display:"block"}}),[`${e}-grid ${n}-col > ${e}-item`]:{display:"block",maxWidth:"100%",marginBlockEnd:g,paddingBlock:0,borderBlockEnd:"none"},[`${e}-vertical ${e}-item`]:{alignItems:"initial",[`${e}-item-main`]:{display:"block",flex:1},[`${e}-item-extra`]:{marginInlineStart:$},[`${e}-item-meta`]:{marginBlockEnd:q,[`${e}-item-meta-title`]:{marginBlockStart:0,marginBlockEnd:I,color:u,fontSize:t.fontSizeLG,lineHeight:t.lineHeightLG}},[`${e}-item-action`]:{marginBlockStart:y,marginInlineStart:"auto","> li":{padding:`0 ${E(y)}`,"&:first-child":{paddingInlineStart:0}}}},[`${e}-split ${e}-item`]:{borderBlockEnd:`${E(t.lineWidth)} ${t.lineType} ${t.colorSplit}`,"&:last-child":{borderBlockEnd:"none"}},[`${e}-split ${e}-header`]:{borderBlockEnd:`${E(t.lineWidth)} ${t.lineType} ${t.colorSplit}`},[`${e}-split${e}-empty ${e}-footer`]:{borderTop:`${E(t.lineWidth)} ${t.lineType} ${t.colorSplit}`},[`${e}-loading ${e}-spin-nested-loading`]:{minHeight:i},[`${e}-split${e}-something-after-last-item ${n}-spin-container > ${e}-items > ${e}-item:last-child`]:{borderBlockEnd:`${E(t.lineWidth)} ${t.lineType} ${t.colorSplit}`},[`${e}-lg ${e}-item`]:{padding:s},[`${e}-sm ${e}-item`]:{padding:d},[`${e}:not(${e}-vertical)`]:{[`${e}-item-no-flex`]:{[`${e}-item-action`]:{float:"right"}}}}},it=t=>({contentWidth:220,itemPadding:`${E(t.paddingContentVertical)} 0`,itemPaddingSM:`${E(t.paddingContentVerticalSM)} ${E(t.paddingContentHorizontal)}`,itemPaddingLG:`${E(t.paddingContentVerticalLG)} ${E(t.paddingContentHorizontalLG)}`,headerBg:"transparent",footerBg:"transparent",emptyTextPadding:t.padding,metaMarginBottom:t.padding,avatarMarginRight:t.padding,titleMarginBottom:t.paddingSM,descriptionFontSize:t.fontSize}),st=Me("List",t=>{const e=Te(t,{listBorderedCls:`${t.componentCls}-bordered`,minHeight:t.controlHeightLG});return[nt(e),tt(e),at(e)]},it);var ot=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(t,i[o])&&(n[i[o]]=t[i[o]]);return n};function rt(t,e){const{pagination:n=!1,prefixCls:i,bordered:o=!1,split:p=!0,className:$,rootClassName:y,style:h,children:a,itemLayout:d,loadMore:s,grid:r,dataSource:g=[],size:u,header:D,footer:x,loading:A=!1,rowKey:L,renderItem:S,locale:P}=t,q=ot(t,["pagination","prefixCls","bordered","split","className","rootClassName","style","children","itemLayout","loadMore","grid","dataSource","size","header","footer","loading","rowKey","renderItem","locale"]),R=n&&typeof n=="object"?n:{},[I,v]=f.useState(R.defaultCurrent||1),[O,te]=f.useState(R.defaultPageSize||10),{getPrefixCls:ae,direction:ne,className:ie,style:se}=Ae("list"),{renderEmpty:U}=f.useContext(ge),l={current:1,total:0,position:"bottom"},c=C=>(_,W)=>{var le;v(_),te(W),n&&((le=n==null?void 0:n[C])===null||le===void 0||le.call(n,_,W))},b=c("onChange"),M=c("onShowSizeChange"),H=(C,_)=>{if(!S)return null;let W;return typeof L=="function"?W=L(C):L?W=C[L]:W=C.key,W||(W=`list-item-${_}`),f.createElement(f.Fragment,{key:W},S(C,_))},T=!!(s||n||x),m=ae("list",i),[V,B,z]=st(m);let j=A;typeof j=="boolean"&&(j={spinning:j});const J=!!(j!=null&&j.spinning),K=Oe(u);let X="";switch(K){case"large":X="lg";break;case"small":X="sm";break}const Q=k(m,{[`${m}-vertical`]:d==="vertical",[`${m}-${X}`]:X,[`${m}-split`]:p,[`${m}-bordered`]:o,[`${m}-loading`]:J,[`${m}-grid`]:!!r,[`${m}-something-after-last-item`]:T,[`${m}-rtl`]:ne==="rtl"},ie,$,y,B,z),w=je(l,{total:g.length,current:I,pageSize:O},n||{}),De=Math.ceil(w.total/w.pageSize);w.current=Math.min(w.current,De);const fe=n&&f.createElement("div",{className:k(`${m}-pagination`)},f.createElement(Xe,Object.assign({align:"end"},w,{onChange:b,onShowSizeChange:M})));let oe=ye(g);n&&g.length>(w.current-1)*w.pageSize&&(oe=ye(g).splice((w.current-1)*w.pageSize,w.pageSize));const we=Object.keys(r||{}).some(C=>["xs","sm","md","lg","xl","xxl"].includes(C)),he=Re(we),Z=f.useMemo(()=>{for(let C=0;C<be.length;C+=1){const _=be[C];if(he[_])return _}},[he]),Ie=f.useMemo(()=>{if(!r)return;const C=Z&&r[Z]?r[Z]:r.column;if(C)return{width:`${100/C}%`,maxWidth:`${100/C}%`}},[JSON.stringify(r),Z]);let re=J&&f.createElement("div",{style:{minHeight:53}});if(oe.length>0){const C=oe.map(H);re=r?f.createElement(xe,{gutter:r.gutter},f.Children.map(C,_=>f.createElement("div",{key:_==null?void 0:_.key,style:Ie},_))):f.createElement("ul",{className:`${m}-items`},C)}else!a&&!J&&(re=f.createElement("div",{className:`${m}-empty-text`},(P==null?void 0:P.emptyText)||(U==null?void 0:U("List"))||f.createElement(He,{componentName:"List"})));const ee=w.position,Be=f.useMemo(()=>({grid:r,itemLayout:d}),[JSON.stringify(r),d]);return V(f.createElement(pe.Provider,{value:Be},f.createElement("div",Object.assign({ref:e,style:Object.assign(Object.assign({},se),h),className:Q},q),(ee==="top"||ee==="both")&&fe,D&&f.createElement("div",{className:`${m}-header`},D),f.createElement(Ue,Object.assign({},j),re,a),x&&f.createElement("div",{className:`${m}-footer`},x),s||(ee==="bottom"||ee==="both")&&fe)))}const lt=f.forwardRef(rt),me=lt;me.Item=Ee;const ct=({url:t,token:e,role:n,eventsEmit:i})=>{const o=qe.create({baseURL:t,timeout:1e6});return o.interceptors.request.use(a=>{let d=e;return!d&&!["user/login","user/kaptcha","user/regist"].some(r=>a.url.includes(r))?(i&&i("request:error_auth",{errorMsg:"\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F",redirect:"/login"}),Promise.reject(new Error("\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"))):(a.headers.Authorization=d||"",a.headers.userName=n==="\u672A\u767B\u5F55\u7528\u6237"?"":n,a)}),o.interceptors.response.use(a=>{const d=["user/kaptcha"],s=a.data;if(d.some(D=>a.config.url&&a.config.url.includes(D))||s.size&&s.type)return s;const{success:r,errorMsg:g,errorCode:u}=s;return r?s:(i&&i("request:error_business",{errorCode:u,errorMsg:g||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",response:s}),!1)},a=>{var d,s,r,g,u,D,x,A,L;if(a.message==="canceled")return Promise.reject(a);if(i){let S="request:error_network",P={errorMsg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:a};((d=a==null?void 0:a.response)==null?void 0:d.status)===401?(S="request:error_auth",P={errorMsg:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650",error:a,redirect:"/login"}):(((r=(s=a==null?void 0:a.response)==null?void 0:s.data)==null?void 0:r.errorCode)==="30013"||((u=(g=a==null?void 0:a.response)==null?void 0:g.data)==null?void 0:u.errorCode)==="30023")&&(S="request:error_business",P={errorCode:(x=(D=a==null?void 0:a.response)==null?void 0:D.data)==null?void 0:x.errorCode,errorMsg:((L=(A=a==null?void 0:a.response)==null?void 0:A.data)==null?void 0:L.errorMsg)||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",error:a}),i(S,P)}return Promise.reject(a)}),{getTableDataList:async({dbId:a,name:d,params:s})=>{try{const r=await o.get(`/directDB/queryTableData/${a}/${d}?${new URLSearchParams(s).toString()}`),{success:g,data:u}=r;if(g)return u}catch(r){return console.log("getTableDataList error:",r),!1}},updateTableData:async(a,d)=>{try{const s=await o.post(`/dataTable/dataUpdateRow/${a}`,{...d}),{success:r,data:g}=s;if(r)return g}catch(s){return console.log("updateTableData error:",s),!1}},delTableDataById:async({tableId:a,rowId:d})=>{try{const s=await o.delete(`/dataTable/dataDeleteRow/${a}/${d}`),{success:r,data:g}=s;if(r)return g}catch(s){console.log("delTableDataById error:",s)}},getFileDataList:async({fileId:a,params:d})=>{try{const s=await o.get(`/dataTable/queryTableFileData/${a}?${new URLSearchParams(d).toString()}`),{success:r,data:g}=s;return r?g:!1}catch(s){return console.log("e",s),!1}}}},dt=({drawerVisible:t,handleDrawerClose:e,rowData:n})=>{const[i,o]=G(n.data),[p,$]=G(null),[y,h]=G(""),a=s=>{h(s.value),$(s.columnId)},d=s=>{y.trim()&&(o(i.map(r=>r.columnId===s?{...r,value:y}:r)),$(null))};return Y(Ve,{title:"\u5217\u6570\u503C\u4FEE\u6539",placement:"right",width:840,onClose:()=>e("cancel"),open:t,closeIcon:!1,extra:N(Je,{size:20,color:"#888888",onClick:()=>e("cancel"),className:"cursor-pointer"}),footer:Y("div",{className:"flex justify-end items-center gap-3",children:[N(Se,{mode:"default",label:"\u53D6\u6D88",onClick:()=>e("cancel")}),N(Se,{mode:"primary",label:"\u786E\u8BA4",onClick:async()=>{await e("confirm",i)}})]}),children:[Y(xe,{gutter:16,style:{padding:"12px 18px",background:"#fafafa",borderBottom:"1px solid #f0f0f0",fontWeight:"bold"},children:[N(ue,{span:4,children:"\u5217\u540D\u79F0"}),N(ue,{span:20,children:"\u6570\u503C"})]}),N(me,{dataSource:i,renderItem:s=>N(me.Item,{actions:[p!==s.columnId&&N(Ge,{type:"text",icon:N(Qe,{size:14}),onClick:()=>a(s)})],children:Y("div",{style:{display:"flex",width:"100%",height:"54px",lineHeight:"54px"},children:[N("div",{style:{width:"150px",marginLeft:15},children:s.columnName}),N("div",{style:{width:"550px"},children:p===s.columnId?N(We,{value:y,onChange:r=>h(r.target.value),onPressEnter:()=>d(s.columnId),onBlur:()=>d(s.columnId)}):N("div",{className:"w-full truncate",title:s.value,children:s.value})})]})})})]})},{confirm:ut}=Ye;function xt({url:t,token:e,fileId:n,role:i,dbType:o,dbId:p,tableId:$,tableName:y,CustomComponents:h,eventsEmit:a,getBtnDisabled:d}){const[s,r]=G(!1),g=Le(null),[u,D]=G(),[x,A]=G(),[L,S]=G(),[P,q]=G({app:"ready",container:"ready",content:"ready"}),{getTableDataList:R,updateTableData:I,delTableDataById:v,getFileDataList:O}=ct({url:t,token:e,role:i,eventsEmit:a});Ne(()=>{q(l=>({...l,content:"loading"})),te()},[]);const te=async()=>{try{if(o=="DirectDB"){const l=await R({dbId:p,name:y,params:{pageNo:1,pageSize:60}});l&&(l.columns=((l==null?void 0:l.columns)||[]).map(c=>({...c,id:c.id||ce(4)})),l.dataList=(l.dataList||[]).map((c,b)=>({...c,__absIndex:b})),A(l),S(l.permission),q(c=>({...c,content:"ready"})))}else{const l=await O({fileId:n,params:{pageNo:1,pageSize:60}});l&&(l.dataList=(l.dataList||[]).map((c,b)=>({...c,__absIndex:b})),l.columns=((l==null?void 0:l.columns)||[]).map(c=>({...c,id:c.id||ce(4)})),A(l),S(l.permission),q(c=>({...c,content:"ready"})))}}catch(l){console.log("[DatabaseApiError] getDataList:",l)}},ae=l=>((l==null?void 0:l.dataList)||[]).map(b=>{const H=((l==null?void 0:l.columns)||[]).filter(T=>T.physicalName!=="id").map(T=>({columnId:T.id,columnName:T.businessName,physicalName:T.physicalName,value:b[T.physicalName]||"-",type:b.dataType=="DATETIME"?"date":"paragraph"}));return o=="DataTable"&&H.push({columnId:"actions",value:"edit",label:"\u4FEE\u6539",disabled:d&&d(7,L)},{columnId:"actions",value:"delete",label:"\u5220\u9664",disabled:d&&d(4,L)}),{id:b.id,data:H,__absIndex:b.__absIndex}}),ne=l=>{const b=((l==null?void 0:l.columns)||[]).filter(M=>M.physicalName!=="id").map(M=>({title:o=="DirectDB"?M.physicalName:M.businessName,id:M.id,type:M.dataType=="DATETIME"?"date":"paragraph"}));return o=="DataTable"&&b.push({id:"actions",title:"\u64CD\u4F5C",type:"action"}),b},ie=async(l,c,b)=>{var M,H;switch(console.log("[DatabaseTableView] eventsEmit:",l,c,b),l){case"pagination:request_merge_data":{try{const m=(M=c==null?void 0:c.request)==null?void 0:M.pageNo,V=(H=c==null?void 0:c.request)==null?void 0:H.pageSize;if(!m||!V)return;let B;o=="DirectDB"?B=await R({dbId:p,name:y,params:{pageNo:m,pageSize:V}}):B=await O({fileId:n,params:{pageNo:m,pageSize:V}}),B&&(B.dataList=(B.dataList||[]).map((z,j)=>({...z,__absIndex:(m-1)*V+j})),B.columns=((B==null?void 0:B.columns)||[]).map(z=>({...z,id:z.id||ce(4)})),A(z=>{var Q;if(!z)return B;const j=Array.isArray(z.dataList)?z.dataList:[],J=Array.isArray(B.dataList)?B.dataList:[],K=new Map;j.forEach(w=>K.set(w.id,w)),J.forEach(w=>K.set(w.id,w));const X=Array.from(K.values());return{...z,dataList:X,total:z.total??B.total,columns:(Q=z.columns)!=null&&Q.length?z.columns:B.columns}}))}catch(m){console.log("[DatabaseApiError] pagination:request_merge_data:",m)}break}case"table_action_edit":r(!0);const T=(c.data||[]).filter(m=>m.columnId!=="actions");D({id:c.id,data:T});break;case"table_action_delete":try{ut({title:"\u786E\u8BA4\u5220\u9664\u6570\u636E\uFF1F",content:"\u5220\u9664\u540E\uFF0C\u8BE5\u6570\u636E\u5C06\u65E0\u6CD5\u6062\u590D",okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",async onOk(){await v({tableId:$,rowId:c.id})&&(Ce.success("\u8868\u6570\u636E\u5220\u9664\u6210\u529F"),b.removeItem(c.id))},onCancel(){console.log("Cancel")}})}catch{console.log("\u5220\u9664\u8868\u6570\u636E\u5931\u8D25")}break;default:a==null||a(l,c);break}},se=async(l,c)=>{if(l=="confirm")try{const b=c.reduce((H,T)=>(H[T.physicalName]=T.value,H),{});await I($,{...b,id:u==null?void 0:u.id})&&g.current&&(Ce.success("\u6570\u636E\u4FEE\u6539\u6210\u529F"),g.current.appFn.updateItem(c,u==null?void 0:u.id))}catch(b){console.log("[TableRowApiError] updateTableData:",b)}r(!1),D(void 0)},U=Pe(()=>({label:"\u6570\u636E\u5E93\u8868\u683C",defaultActiveId:"database-table",model:null,views:[{label:"\u6570\u636E\u8868\u540D\u79F0",id:"database-table",type:"table",total:(x==null?void 0:x.totalData)||999,requestPagesize:60,viewPageSize:10,allowMultiSelect:!1,columns:ne(x),viewBehavior:"pagination"}],dataSource:ae(x),eventsEmit:ie}),[x,a,o,L]);return Y(ke,{title:y,goBack:()=>{a==null||a("goBack",{})},children:[N(Ke,{ref:g,status:P,CustomComponents:{...h},...U},"table-data"),u&&N(dt,{drawerVisible:s,tableId:n,handleDrawerClose:se,rowData:u})]})}export{xt as default};
|