@gientech/modual 2.0.8 → 2.0.9
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/INSTALL_TROUBLESHOOTING.md +316 -0
- package/USAGE.md +247 -0
- package/bash.exe.stackdump +40 -0
- package/components.json +21 -0
- package/dist/README.md +761 -0
- package/dist/package.json +68 -0
- 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/doc_assets/v2.0.7/345/217/230/346/233/264/346/200/273/347/273/223.md +115 -0
- package/doc_assets//346/226/271/346/241/210//344/274/230/345/214/226/346/226/271/346/241/210-/345/244/232/344/274/232/350/257/235SSE/350/277/236/346/216/245/347/256/241/347/220/206.md +504 -0
- package/eslint.config.js +92 -0
- package/index.html +13 -0
- package/package.json +103 -41
- package/package.json.demo-backup +109 -0
- package/postcss.config.cjs +19 -0
- package/public/icons/answerAwartar.png +0 -0
- package/public/icons/docx-file.png +0 -0
- package/public/icons/folder.png +0 -0
- package/public/icons/html.png +0 -0
- package/public/icons/image.png +0 -0
- package/public/icons/jpg-file.png +0 -0
- package/public/icons/json.png +0 -0
- package/public/icons/md.png +0 -0
- package/public/icons/pdf.png +0 -0
- package/public/icons/pptx.png +0 -0
- package/public/icons/questionAwartar.png +0 -0
- package/public/icons/sheets.png +0 -0
- package/public/icons/txt.png +0 -0
- package/public/icons/xlsx.png +0 -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/decrypt-api-key.js +95 -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/close.png +0 -0
- package/src/assets/img/database.png +0 -0
- package/src/assets/img/downArrow.png +0 -0
- package/src/assets/img/downLoad.png +0 -0
- package/src/assets/img/excel.png +0 -0
- package/src/assets/img/graphIcon.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/singleQa.png +0 -0
- package/src/assets/img/txt.png +0 -0
- package/src/assets/img/webSearch.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/ConversationAssistantPage/index.tsx +41 -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 +166 -0
- package/src/examples/chat/logo03.png +0 -0
- package/src/examples/gientechStreamFilesReader/index.tsx +951 -0
- package/src/examples/headlessChat/assets/mind.svg +6 -0
- package/src/examples/headlessChat/assets/net.svg +7 -0
- package/src/examples/headlessChat/index.tsx +285 -0
- package/src/examples/ragDatabaseDataPage/index.tsx +40 -0
- package/src/examples/ragDatabaseIdPage/index.tsx +47 -0
- package/src/examples/ragDatabasePage/index.tsx +36 -0
- package/src/examples/ragModelManagePage/index.tsx +38 -0
- package/src/examples/ragSearchPage/index.tsx +0 -0
- package/src/examples/ragSensitiveWordsPage/index.tsx +32 -0
- package/src/examples/streamFiles/index.tsx +417 -0
- package/src/lib_enter.ts +43 -0
- package/src/main.tsx +5 -0
- package/src/main.tsx.backup +5 -0
- package/src/modules/CHAT_UNIFICATION_PLAN.md +324 -0
- package/src/modules/assistantConfig/assets/databse.svg +6 -0
- package/src/modules/assistantConfig/assets/empty.png +0 -0
- package/src/modules/assistantConfig/assets/graph.svg +4 -0
- package/src/modules/assistantConfig/assets/knowledge.svg +4 -0
- package/src/modules/assistantConfig/assets/sensitive.svg +5 -0
- package/src/modules/assistantConfig/components/Database.tsx +171 -0
- package/src/modules/assistantConfig/components/Graph.tsx +177 -0
- package/src/modules/assistantConfig/components/Knowledge.tsx +276 -0
- package/src/modules/assistantConfig/components/NotFoundContent.tsx +21 -0
- package/src/modules/assistantConfig/components/Paragraph.tsx +51 -0
- package/src/modules/assistantConfig/components/ParamsItem.tsx +39 -0
- package/src/modules/assistantConfig/components/ResourceBinderItem.tsx +133 -0
- package/src/modules/assistantConfig/components/SearchableSelector.tsx +500 -0
- package/src/modules/assistantConfig/components/Sensitive.tsx +221 -0
- package/src/modules/assistantConfig/components/SliderInput.tsx +65 -0
- package/src/modules/assistantConfig/constants.tsx +75 -0
- package/src/modules/assistantConfig/index.tsx +710 -0
- package/src/modules/assistantConfig/server.ts +262 -0
- package/src/modules/chat/Conversations/Item.tsx +167 -0
- package/src/modules/chat/Conversations/List.tsx +210 -0
- package/src/modules/chat/Conversations/groupByTime.ts +39 -0
- package/src/modules/chat/Conversations/index.tsx +252 -0
- package/src/modules/chat/ReferenceBar.tsx +622 -0
- package/src/modules/chat/constants.tsx +57 -0
- package/src/modules/chat/index.tsx +2449 -0
- package/src/modules/chat/referenceCom/DeleteModal.tsx +75 -0
- package/src/modules/chat/referenceCom/DrawerContent.tsx +136 -0
- package/src/modules/chat/referenceCom/DrawerDatabase.tsx +102 -0
- package/src/modules/chat/referenceCom/DrawerGraphPreview.tsx +86 -0
- package/src/modules/chat/referenceCom/DrawerPreview.tsx +73 -0
- package/src/modules/chat/referenceCom/DrawerTitle.tsx +26 -0
- package/src/modules/chat/referenceCom/RenameModal.tsx +86 -0
- package/src/modules/chat/referenceCom/TagCom.tsx +30 -0
- package/src/modules/chat/style.less +3 -0
- package/src/modules/chat/types.ts +17 -0
- package/src/modules/chat/utils/index.ts +348 -0
- package/src/modules/database/CreateModal.tsx +403 -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 +477 -0
- package/src/modules/database/server.ts +196 -0
- package/src/modules/databaseId/CustomCom.tsx +156 -0
- package/src/modules/databaseId/EditConfig.tsx +280 -0
- package/src/modules/databaseId/UploadDrawer.tsx +535 -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 +769 -0
- package/src/modules/databaseId/server.ts +286 -0
- package/src/modules/databaseId/style.css +5 -0
- package/src/modules/databaseTable/EditRowDrawer.tsx +124 -0
- package/src/modules/databaseTable/index.tsx +359 -0
- package/src/modules/databaseTable/server.ts +180 -0
- package/src/modules/headlessChat/ReferenceBar.tsx +783 -0
- package/src/modules/headlessChat/constants.tsx +54 -0
- package/src/modules/headlessChat/index.tsx +1782 -0
- package/src/modules/headlessChat/referenceCom/DeleteModal.tsx +75 -0
- package/src/modules/headlessChat/referenceCom/DrawerContent.tsx +136 -0
- package/src/modules/headlessChat/referenceCom/DrawerDatabase.tsx +102 -0
- package/src/modules/headlessChat/referenceCom/DrawerGraphPreview.tsx +86 -0
- package/src/modules/headlessChat/referenceCom/DrawerPreview.tsx +73 -0
- package/src/modules/headlessChat/referenceCom/DrawerTitle.tsx +26 -0
- package/src/modules/headlessChat/referenceCom/RenameModal.tsx +86 -0
- package/src/modules/headlessChat/referenceCom/TagCom.tsx +30 -0
- package/src/modules/headlessChat/style.less +3 -0
- package/src/modules/headlessChat/types.ts +23 -0
- package/src/modules/headlessChat/utils/index.ts +348 -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/ReplaceModal.tsx +124 -0
- package/src/modules/modelManage/assets/empty.png +0 -0
- package/src/modules/modelManage/const.ts +51 -0
- package/src/modules/modelManage/index.tsx +606 -0
- package/src/modules/modelManage/server.ts +223 -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 +1625 -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/decryptApiKey.ts +40 -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 +319 -0
- package/src/utils/gientechCommon/components/FileCardCommon.tsx +82 -0
- package/src/utils/gientechCommon/components/FileManager/index.tsx +418 -0
- package/src/utils/gientechCommon/components/FileManager/style.css +5 -0
- package/src/utils/gientechCommon/components/Messages/GientechNewChatWelcome.tsx +581 -0
- package/src/utils/gientechCommon/components/Messages/ReferenceCard.tsx +359 -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 +417 -0
- package/src/utils/gientechCommon/hooks/useFileDisplayTools.tsx +251 -0
- package/src/utils/gientechCommon/hooks/useFileManager.ts +208 -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/fileUtils.ts +86 -0
- package/src/utils/gientechCommon/utils/request.ts +37 -0
- package/src/utils/gientechCommon/utils/serverFn.ts +172 -0
- package/src/utils/index.tsx +142 -0
- package/src/utils/testconfigs/demologin/index.tsx +32 -0
- package/src/utils/testconfigs/index.ts +59 -0
- package/src/vite-env.d.ts +42 -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.app.ts +93 -0
- package/vite.config.ts +232 -0
- package/workflows/release.yml +60 -0
- package//346/215/242/350/241/214/346/240/274/345/274/217/344/277/235/346/214/201/344/274/230/345/214/226/346/226/271/346/241/210.md +359 -0
- /package/{assets → dist/assets}/Doris.png +0 -0
- /package/{assets → dist/assets}/GientechStreamReader-CNj6Rcm7.js +0 -0
- /package/{assets → dist/assets}/PostgreSQL.png +0 -0
- /package/{assets → dist/assets}/SQLServer.png +0 -0
- /package/{assets → dist/assets}/database.svg +0 -0
- /package/{assets → dist/assets}/database_add.svg +0 -0
- /package/{assets → dist/assets}/database_connect.svg +0 -0
- /package/{assets → dist/assets}/database_upload.svg +0 -0
- /package/{assets → dist/assets}/databse.svg +0 -0
- /package/{assets → dist/assets}/defaultWeLogo.svg +0 -0
- /package/{assets → dist/assets}/empty.png +0 -0
- /package/{assets → dist/assets}/graph.svg +0 -0
- /package/{assets → dist/assets}/homeBg.png +0 -0
- /package/{assets → dist/assets}/index-B2yNvzjy.js +0 -0
- /package/{assets → dist/assets}/index-BJv0t0eJ.js +0 -0
- /package/{assets → dist/assets}/index-BKe5FgcC.js +0 -0
- /package/{assets → dist/assets}/index-CU45mVZ4.js +0 -0
- /package/{assets → dist/assets}/index-CpW6Dhpp.js +0 -0
- /package/{assets → dist/assets}/index-D72cKELw.js +0 -0
- /package/{assets → dist/assets}/index-DdVFXD_y.js +0 -0
- /package/{assets → dist/assets}/index-DrkSoKz6.js +0 -0
- /package/{assets → dist/assets}/index-ZopkeZtI.js +0 -0
- /package/{assets → dist/assets}/index-g-SUxfJH.js +0 -0
- /package/{assets → dist/assets}/index-j0kQJd0a.js +0 -0
- /package/{assets → dist/assets}/knowledge.svg +0 -0
- /package/{assets → dist/assets}/left.jpg +0 -0
- /package/{assets → dist/assets}/logoImg.png +0 -0
- /package/{assets → dist/assets}/mysql.svg +0 -0
- /package/{assets → dist/assets}/plus-V9zUoSq6.js +0 -0
- /package/{assets → dist/assets}/sensitive.svg +0 -0
- /package/{assets → dist/assets}/style-CGmZ5osp.js +0 -0
- /package/{assets → dist/assets}/style.css +0 -0
- /package/{assets → dist/assets}/style2.css +0 -0
- /package/{assets → dist/assets}/style3.css +0 -0
- /package/{assets → dist/assets}/style4.css +0 -0
- /package/{assets → dist/assets}/worker-BbpylX7l.js +0 -0
- /package/{assets → dist/assets}/x-CnaaLGJF.js +0 -0
- /package/{assistantConfig.d.ts → dist/assistantConfig.d.ts} +0 -0
- /package/{assistantConfig.js → dist/assistantConfig.js} +0 -0
- /package/{chat.d.ts → dist/chat.d.ts} +0 -0
- /package/{chat.js → dist/chat.js} +0 -0
- /package/{database.d.ts → dist/database.d.ts} +0 -0
- /package/{database.js → dist/database.js} +0 -0
- /package/{databaseId.d.ts → dist/databaseId.d.ts} +0 -0
- /package/{databaseId.js → dist/databaseId.js} +0 -0
- /package/{databaseTable.d.ts → dist/databaseTable.d.ts} +0 -0
- /package/{databaseTable.js → dist/databaseTable.js} +0 -0
- /package/{icons → dist/icons}/answerAwartar.png +0 -0
- /package/{icons → dist/icons}/docx-file.png +0 -0
- /package/{icons → dist/icons}/folder.png +0 -0
- /package/{icons → dist/icons}/html.png +0 -0
- /package/{icons → dist/icons}/image.png +0 -0
- /package/{icons → dist/icons}/jpg-file.png +0 -0
- /package/{icons → dist/icons}/json.png +0 -0
- /package/{icons → dist/icons}/md.png +0 -0
- /package/{icons → dist/icons}/pdf.png +0 -0
- /package/{icons → dist/icons}/pptx.png +0 -0
- /package/{icons → dist/icons}/questionAwartar.png +0 -0
- /package/{icons → dist/icons}/sheets.png +0 -0
- /package/{icons → dist/icons}/txt.png +0 -0
- /package/{icons → dist/icons}/xlsx.png +0 -0
- /package/{index.d.ts → dist/index.d.ts} +0 -0
- /package/{index.js → dist/index.js} +0 -0
- /package/{modelManage.d.ts → dist/modelManage.d.ts} +0 -0
- /package/{modelManage.js → dist/modelManage.js} +0 -0
- /package/{sensitive.d.ts → dist/sensitive.d.ts} +0 -0
- /package/{sensitive.js → dist/sensitive.js} +0 -0
- /package/{streamFilesReader.d.ts → dist/streamFilesReader.d.ts} +0 -0
- /package/{streamFilesReader.js → dist/streamFilesReader.js} +0 -0
- /package/{vite.svg → dist/vite.svg} +0 -0
- /package/{worker → dist/worker}/pdf.worker.min.js +0 -0
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Modal, Button, Upload, Popconfirm } from "antd";
|
|
3
|
+
import { FileText, FileImage, FileSpreadsheet, File, Plus, X } from 'lucide-react';
|
|
4
|
+
import { Icon } from '@mxmweb/zui';
|
|
5
|
+
import { useEffect, useState } from "react";
|
|
6
|
+
import './style.css';
|
|
7
|
+
import { type Styles } from '@mxmweb/zui';
|
|
8
|
+
import ReferenceCard from '../Messages/ReferenceCard';
|
|
9
|
+
type ThemeColors = any;
|
|
10
|
+
import { getTypeByName } from "../../../../utils";
|
|
11
|
+
import FileCardCommon from "../FileCardCommon";
|
|
12
|
+
|
|
13
|
+
// 文件类型icon获取函数,优先用用户传入styles.theme.icons
|
|
14
|
+
export function getFileTypeIcon(type: string, styles?: any) {
|
|
15
|
+
const icons = styles?.theme?.icons || {};
|
|
16
|
+
//console.log('type``````````', type,icons)
|
|
17
|
+
switch (type.toLowerCase()) {
|
|
18
|
+
case 'docx':
|
|
19
|
+
case 'doc':
|
|
20
|
+
return icons.docx ? (
|
|
21
|
+
<img src={icons.docx} alt="docx" style={{ width: 20, height: 20 }} />
|
|
22
|
+
) : (
|
|
23
|
+
<Icon type='Files/docx_color' size={18} />
|
|
24
|
+
);
|
|
25
|
+
case 'image':
|
|
26
|
+
case 'jpg':
|
|
27
|
+
case 'jpeg':
|
|
28
|
+
case 'png':
|
|
29
|
+
case 'gif':
|
|
30
|
+
case 'bmp':
|
|
31
|
+
case 'webp':
|
|
32
|
+
case 'svg':
|
|
33
|
+
case 'ico':
|
|
34
|
+
return icons.image ? (
|
|
35
|
+
<img src={icons.image} alt="image" style={{ width: 20, height: 20 }} />
|
|
36
|
+
) : (
|
|
37
|
+
<Icon type='Files/tupian_color' size={18} />
|
|
38
|
+
);
|
|
39
|
+
case 'pptx':
|
|
40
|
+
case 'ppt':
|
|
41
|
+
return icons.pptx ? (
|
|
42
|
+
<img src={icons.pptx} alt="pptx" style={{ width: 20, height: 20 }} />
|
|
43
|
+
) : (
|
|
44
|
+
<Icon type='Files/ppt_color' size={18} />
|
|
45
|
+
);
|
|
46
|
+
case 'sheets':
|
|
47
|
+
case 'excel':
|
|
48
|
+
case 'xls':
|
|
49
|
+
case 'csv':
|
|
50
|
+
case 'xlsx':
|
|
51
|
+
case 'xlsm':
|
|
52
|
+
case 'xlsb':
|
|
53
|
+
case 'xltx':
|
|
54
|
+
case 'xltm':
|
|
55
|
+
case 'xlt':
|
|
56
|
+
case 'xlam':
|
|
57
|
+
return icons.sheets ? (
|
|
58
|
+
<img src={icons.sheets} alt="sheets" style={{ width: 20, height: 20 }} />
|
|
59
|
+
) : (
|
|
60
|
+
<Icon type={type.toLowerCase() === 'csv' ? 'Files/csv_color' : 'Files/xls_color'} size={18} />
|
|
61
|
+
);
|
|
62
|
+
case 'pdf':
|
|
63
|
+
return icons.pdf ? (
|
|
64
|
+
<img src={icons.pdf} alt="pdf" style={{ width: 20, height: 20 }} />
|
|
65
|
+
) : (
|
|
66
|
+
<Icon type='Files/pdf_color' size={18} />
|
|
67
|
+
);
|
|
68
|
+
case 'txt':
|
|
69
|
+
return icons.txt ? (
|
|
70
|
+
<img src={icons.txt} alt="txt" style={{ width: 20, height: 20 }} />
|
|
71
|
+
) : (
|
|
72
|
+
<Icon type='Files/txt_color' size={18} />
|
|
73
|
+
);
|
|
74
|
+
case 'md':
|
|
75
|
+
return icons.md ? (
|
|
76
|
+
<img src={icons.md} alt="txt" style={{ width: 20, height: 20 }} />
|
|
77
|
+
) : (
|
|
78
|
+
<Icon type='Files/txt_color' size={18} />
|
|
79
|
+
);
|
|
80
|
+
case 'json':
|
|
81
|
+
return icons.json ? (
|
|
82
|
+
<img src={icons.json} alt="json" style={{ width: 20, height: 20 }} />
|
|
83
|
+
) : (
|
|
84
|
+
<Icon type='Files/unknow_color' size={18} />
|
|
85
|
+
);
|
|
86
|
+
case 'html':
|
|
87
|
+
case 'htm':
|
|
88
|
+
case 'url':
|
|
89
|
+
return icons.html ? (
|
|
90
|
+
<img src={icons.html} alt="html" style={{ width: 20, height: 20 }} />
|
|
91
|
+
) : (
|
|
92
|
+
<Icon type='Files/lianjie_color' size={18} />
|
|
93
|
+
);
|
|
94
|
+
case 'zip':
|
|
95
|
+
case 'rar':
|
|
96
|
+
case '7z':
|
|
97
|
+
return icons.archive ? (
|
|
98
|
+
<img src={icons.archive} alt="archive" style={{ width: 20, height: 20 }} />
|
|
99
|
+
) : (
|
|
100
|
+
<Icon type='Files/yasuobao_color' size={18} />
|
|
101
|
+
);
|
|
102
|
+
case 'odt':
|
|
103
|
+
case 'ods':
|
|
104
|
+
case 'odp':
|
|
105
|
+
case 'odf':
|
|
106
|
+
return icons.odt ? (
|
|
107
|
+
<img src={icons.odt} alt="odt" style={{ width: 20, height: 20 }} />
|
|
108
|
+
) : (
|
|
109
|
+
<Icon type='Files/odt_color' size={18} />
|
|
110
|
+
);
|
|
111
|
+
case 'xml':
|
|
112
|
+
default:
|
|
113
|
+
return <Icon type='Files/unknow_color' size={18} />;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
interface FileItem {
|
|
117
|
+
file: File;
|
|
118
|
+
preview?: string;
|
|
119
|
+
type: string;
|
|
120
|
+
status?: 'pending' | 'uploading' | 'uploaded' | 'error';
|
|
121
|
+
url?: string;
|
|
122
|
+
error?: string;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Mock数据
|
|
126
|
+
const mockFiles: FileItem[] = [
|
|
127
|
+
{
|
|
128
|
+
file: {
|
|
129
|
+
name: '产品需求文档.pdf',
|
|
130
|
+
size: 1024 * 1024 * 2.5, // 2.5MB
|
|
131
|
+
type: 'application/pdf',
|
|
132
|
+
} as File,
|
|
133
|
+
type: 'pdf',
|
|
134
|
+
status: 'uploaded',
|
|
135
|
+
url: 'https://example.com/file1.pdf',
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
file: {
|
|
139
|
+
name: '数据分析报告.xlsx',
|
|
140
|
+
size: 1024 * 1024 * 1.2, // 1.2MB
|
|
141
|
+
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
142
|
+
} as File,
|
|
143
|
+
type: 'excel',
|
|
144
|
+
status: 'uploaded',
|
|
145
|
+
url: 'https://example.com/file3.xlsx',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
file: {
|
|
149
|
+
name: '系统架构图.png',
|
|
150
|
+
size: 1024 * 512, // 512KB
|
|
151
|
+
type: 'image/png',
|
|
152
|
+
} as File,
|
|
153
|
+
type: 'image',
|
|
154
|
+
status: 'uploaded',
|
|
155
|
+
url: 'https://example.com/file2.png',
|
|
156
|
+
},
|
|
157
|
+
];
|
|
158
|
+
|
|
159
|
+
const formatFileSize = (bytes: number) => {
|
|
160
|
+
if (bytes < 1024) return bytes + ' B';
|
|
161
|
+
if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(1) + ' KB';
|
|
162
|
+
return (bytes / (1024 * 1024)).toFixed(1) + ' MB';
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
export default function FileManager({
|
|
166
|
+
open,
|
|
167
|
+
onCancel,
|
|
168
|
+
files = mockFiles,
|
|
169
|
+
currentFiles = [],
|
|
170
|
+
onUpload,
|
|
171
|
+
onRemoveFile,
|
|
172
|
+
styles,
|
|
173
|
+
eventsEmit
|
|
174
|
+
}: {
|
|
175
|
+
open: boolean;
|
|
176
|
+
onCancel: () => void;
|
|
177
|
+
files: FileItem[];
|
|
178
|
+
styles: Styles;
|
|
179
|
+
currentFiles: FileItem[];
|
|
180
|
+
onUpload?: (files: FileList) => void;
|
|
181
|
+
onRemoveFile?: (file: FileItem, idx: number, type: 'uploaded' | 'pending') => void;
|
|
182
|
+
eventsEmit?: (eventName: string, payload?: any) => void;
|
|
183
|
+
}) {
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
// 状态映射
|
|
187
|
+
const statusMap = {
|
|
188
|
+
pending: '待上传',
|
|
189
|
+
uploading: '上传中',
|
|
190
|
+
uploaded: '已上传',
|
|
191
|
+
analyzing: '解析中',
|
|
192
|
+
analyze_failed: '解析失败',
|
|
193
|
+
error: '失败',
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
// 选中状态
|
|
197
|
+
const [selectedFiles, setSelectedFiles] = useState<number[]>([]);
|
|
198
|
+
|
|
199
|
+
const handleSelect = (idx: number) => {
|
|
200
|
+
setSelectedFiles(prev => prev.includes(idx) ? prev.filter(i => i !== idx) : [...prev, idx]);
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
// 已上传文件删除事件抛出
|
|
204
|
+
const handleRemove = (file: FileItem, idx: number) => {
|
|
205
|
+
eventsEmit && eventsEmit('uploaded_file:removeFromTemp', { file, idx });
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
// 处理文件上传
|
|
209
|
+
const handleUpload = (fileList: FileList) => {
|
|
210
|
+
if (onUpload) {
|
|
211
|
+
onUpload(fileList);
|
|
212
|
+
} else if (eventsEmit) {
|
|
213
|
+
// 如果没有提供 onUpload,通过 eventsEmit 触发上传事件
|
|
214
|
+
eventsEmit('sender:action_upload', { files: fileList });
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
// 主题色,提前定义,避免未初始化访问
|
|
219
|
+
const themeColors: ThemeColors = (styles && styles.theme && styles.theme.colors) ? styles.theme.colors : {
|
|
220
|
+
primary: '#007bff',
|
|
221
|
+
secondary: '#6c757d',
|
|
222
|
+
success: '#008000',
|
|
223
|
+
warning: '#FFA500',
|
|
224
|
+
error: '#FF0000',
|
|
225
|
+
info: '#0000FF',
|
|
226
|
+
background: '#f8f9fa',
|
|
227
|
+
text: '#343a40',
|
|
228
|
+
border: '#dee2e6',
|
|
229
|
+
disabled: '#808080',
|
|
230
|
+
disabledBackground: '#F5F5F5',
|
|
231
|
+
disabledText: '#808080',
|
|
232
|
+
shadow: '#000000',
|
|
233
|
+
appBackground: '#fff',
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
// 拆分文件
|
|
237
|
+
const uploadedFileCards = files.map((f:any, idx) => {
|
|
238
|
+
// console.log(f,'fffffffff')
|
|
239
|
+
return (
|
|
240
|
+
<div key={f.file.name + idx} className="relative flex flex-col gap-2.5 items-center justify-center">
|
|
241
|
+
<div className="absolute right-1 top-1 z-10">
|
|
242
|
+
<Popconfirm
|
|
243
|
+
title="确认从临时对话知识库移除该文件?"
|
|
244
|
+
onConfirm={() => handleRemove(f, idx)}
|
|
245
|
+
okText="确认"
|
|
246
|
+
cancelText="取消"
|
|
247
|
+
>
|
|
248
|
+
<button
|
|
249
|
+
className="bg-white cursor-pointer rounded-full p-0.5"
|
|
250
|
+
style={{
|
|
251
|
+
lineHeight: 0,
|
|
252
|
+
color: themeColors && themeColors.text ? themeColors.text : '#FF0000',
|
|
253
|
+
transition: 'background 0.2s, color 0.2s',
|
|
254
|
+
}}
|
|
255
|
+
onMouseOver={e => {
|
|
256
|
+
(e.currentTarget as HTMLElement).style.color = themeColors && themeColors.error ? themeColors.error : '#FF0000';
|
|
257
|
+
}}
|
|
258
|
+
onMouseOut={e => {
|
|
259
|
+
(e.currentTarget as HTMLElement).style.color = themeColors.text!;
|
|
260
|
+
}}
|
|
261
|
+
title="移除"
|
|
262
|
+
>
|
|
263
|
+
<X className="w-3 h-3" />
|
|
264
|
+
</button>
|
|
265
|
+
</Popconfirm>
|
|
266
|
+
</div>
|
|
267
|
+
<ReferenceCard
|
|
268
|
+
file_type={getTypeByName(f.file.name||f.name)}
|
|
269
|
+
file_name={f.name || f.file.name}
|
|
270
|
+
url={f.url || f.filePath}
|
|
271
|
+
retrieve_tags={[]}
|
|
272
|
+
styles={styles}
|
|
273
|
+
isUploadFile={true}
|
|
274
|
+
eventsEmit={eventsEmit}
|
|
275
|
+
parse_url={f.convertedFilePath}
|
|
276
|
+
pdfPages={f.pdfPages || 0}
|
|
277
|
+
/>
|
|
278
|
+
</div>
|
|
279
|
+
)});
|
|
280
|
+
const pendingFileCards = currentFiles.map((f, idx) => {
|
|
281
|
+
const fileType = f.file.name.split('.').pop() || '';
|
|
282
|
+
const icon = getFileTypeIcon(fileType, styles);
|
|
283
|
+
return (
|
|
284
|
+
<FileCardCommon
|
|
285
|
+
key={f.file.name + idx}
|
|
286
|
+
cardId={`pending-file-card-${idx}`}
|
|
287
|
+
fileName={f.file.name}
|
|
288
|
+
fileSize={f.file.size}
|
|
289
|
+
icon={icon}
|
|
290
|
+
statusText={statusMap[f.status || 'pending']}
|
|
291
|
+
statusColor="text-gray-400"
|
|
292
|
+
showRemove={true}
|
|
293
|
+
onRemove={() => onRemoveFile && onRemoveFile(f, idx, 'pending')}
|
|
294
|
+
themeColors={themeColors}
|
|
295
|
+
style={{ boxShadow: 'none', height: 55, background: '#f8fafc' }}
|
|
296
|
+
/>
|
|
297
|
+
);
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
// 多选删除
|
|
301
|
+
const handleBatchRemove = () => {
|
|
302
|
+
if (eventsEmit) {
|
|
303
|
+
const filesToRemove = selectedFiles.map(idx => ({ file: files[idx], idx })).filter(f => f.file);
|
|
304
|
+
eventsEmit('uploaded_file:remove_batch', filesToRemove);
|
|
305
|
+
}
|
|
306
|
+
setSelectedFiles([]);
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
// 主题色
|
|
310
|
+
const batchDeleteBtnStyle = selectedFiles.length > 0
|
|
311
|
+
? {
|
|
312
|
+
borderColor: themeColors && themeColors.error ? themeColors.error : '#FF0000',
|
|
313
|
+
background: themeColors && themeColors.error ? themeColors.error + '22' : '#FF000022',
|
|
314
|
+
color: themeColors && themeColors.error ? themeColors.error : '#FF0000',
|
|
315
|
+
}
|
|
316
|
+
: {
|
|
317
|
+
borderColor: themeColors && themeColors.disabledText ? themeColors.disabledText : '#808080',
|
|
318
|
+
background: themeColors && themeColors.disabledBackground ? themeColors.disabledBackground : '#F5F5F5',
|
|
319
|
+
color: themeColors && themeColors.disabledText ? themeColors.disabledText : '#808080',
|
|
320
|
+
cursor: 'not-allowed',
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
//console.log(files,'weljkfewoifho23hf8h3289fh8923hf982h389fh2389fh8923h89')
|
|
324
|
+
return (
|
|
325
|
+
<Modal
|
|
326
|
+
open={open}
|
|
327
|
+
onCancel={onCancel}
|
|
328
|
+
footer={null}
|
|
329
|
+
title={'对话临时文件知识库'}
|
|
330
|
+
closable={false}
|
|
331
|
+
width={800}
|
|
332
|
+
styles={{
|
|
333
|
+
body: {
|
|
334
|
+
padding: '0',
|
|
335
|
+
maxHeight: '70vh',
|
|
336
|
+
overflow: 'auto',
|
|
337
|
+
},
|
|
338
|
+
}}
|
|
339
|
+
>
|
|
340
|
+
<div className="file-manager-modal space-y-6 px-4 py-4">
|
|
341
|
+
{/* 已上传文件区域 */}
|
|
342
|
+
<div className="">
|
|
343
|
+
<div className="flex items-center mb-2 justify-between">
|
|
344
|
+
<div className="flex items-center">
|
|
345
|
+
<span className="text-xs font-semibold text-gray-700">已上传文件</span>
|
|
346
|
+
<span className="ml-2 text-xs text-gray-400">{files.length} 个</span>
|
|
347
|
+
</div>
|
|
348
|
+
{/* <button
|
|
349
|
+
className="ml-4 px-2 cursor-pointer py-1 text-xs rounded border"
|
|
350
|
+
disabled={selectedFiles.length === 0}
|
|
351
|
+
onClick={handleBatchRemove}
|
|
352
|
+
style={batchDeleteBtnStyle}
|
|
353
|
+
>
|
|
354
|
+
删除知识文档
|
|
355
|
+
</button> */}
|
|
356
|
+
</div>
|
|
357
|
+
<div
|
|
358
|
+
className="w-full relative min-h-[200px] max-h-[260px] p-2 overflow-y-auto"
|
|
359
|
+
style={{ overflowX: 'hidden' }}
|
|
360
|
+
>
|
|
361
|
+
<div className="flex flex-wrap gap-1">
|
|
362
|
+
{uploadedFileCards.length > 0 ? (
|
|
363
|
+
uploadedFileCards
|
|
364
|
+
) : (
|
|
365
|
+
<div className="flex items-center w-full h-full py-10 justify-center text-gray-400 text-sm">
|
|
366
|
+
暂无已上传文件
|
|
367
|
+
</div>
|
|
368
|
+
)}
|
|
369
|
+
</div>
|
|
370
|
+
</div>
|
|
371
|
+
</div>
|
|
372
|
+
{/* 待上传文件区域 */}
|
|
373
|
+
<div>
|
|
374
|
+
<div className="flex items-center mb-2">
|
|
375
|
+
<span className="text-xs font-semibold text-gray-700">待上传文件</span>
|
|
376
|
+
<span className="ml-2 text-xs text-gray-400">{currentFiles.length} 个</span>
|
|
377
|
+
</div>
|
|
378
|
+
<div className="flex gap-2 overflow-x-auto pb-2">
|
|
379
|
+
{pendingFileCards}
|
|
380
|
+
{/* 上传卡片 */}
|
|
381
|
+
<Upload.Dragger
|
|
382
|
+
multiple
|
|
383
|
+
showUploadList={false}
|
|
384
|
+
beforeUpload={(file, fileList) => {
|
|
385
|
+
if (file === fileList[0]) {
|
|
386
|
+
handleUpload(fileList as unknown as FileList);
|
|
387
|
+
}
|
|
388
|
+
return false;
|
|
389
|
+
}}
|
|
390
|
+
className="!bg-gray-50 !border-dashed !border-gray-300 hover:!border-blue-400 cursor-pointer min-w-[160px] max-w-[220px] flex flex-row items-center justify-center border-2 rounded-lg transition-all"
|
|
391
|
+
style={{ height: 45, boxShadow: 'none', padding: 0 }}
|
|
392
|
+
>
|
|
393
|
+
<div className="flex flex-row items-center pb-8 justify-center">
|
|
394
|
+
<Plus size={20} className="text-blue-400 mr-2" />
|
|
395
|
+
<div className="text-xs text-gray-500">上传文件</div>
|
|
396
|
+
</div>
|
|
397
|
+
</Upload.Dragger>
|
|
398
|
+
</div>
|
|
399
|
+
</div>
|
|
400
|
+
<div className="flex justify-end gap-2">
|
|
401
|
+
<Button type="primary" onClick={onCancel}>
|
|
402
|
+
确认
|
|
403
|
+
</Button>
|
|
404
|
+
{/* <Button onClick={onCancel}>取消</Button> */}
|
|
405
|
+
</div>
|
|
406
|
+
</div>
|
|
407
|
+
<style>{`
|
|
408
|
+
.file-manager-modal .ant-upload-wrapper,
|
|
409
|
+
.file-manager-modal .ant-upload-drag,
|
|
410
|
+
.file-manager-modal .ant-upload-drag-container {
|
|
411
|
+
min-height: 55px !important;
|
|
412
|
+
height: 55px !important;
|
|
413
|
+
padding: 0 !important;
|
|
414
|
+
}
|
|
415
|
+
`}</style>
|
|
416
|
+
</Modal>
|
|
417
|
+
);
|
|
418
|
+
}
|