@gientech/modual 2.2.3-fix.6 → 2.2.3-fix.7
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/README.md +761 -761
- package/{dist/assets/GientechStreamReader-Bae2-4f7.js → assets/GientechStreamReader-r5ZTSZk2.js} +1 -1
- package/{dist/assets/LeftOutlined-COk0w5nY.js → assets/LeftOutlined-DZMeGbKk.js} +1 -1
- package/{dist/assets/circle-plus-DOKqXUMk.js → assets/circle-plus-B73z_SUN.js} +1 -1
- package/{src/modules/database/assets → assets}/database.svg +11 -11
- package/{src/modules/database/assets → assets}/database_add.svg +53 -53
- package/{dist/assets → assets}/database_connect.svg +66 -66
- package/{dist/assets → assets}/database_upload.svg +29 -29
- package/{dist/assets → assets}/databse.svg +6 -6
- package/{dist/assets → assets}/defaultWeLogo.svg +14 -14
- package/{dist/assets → assets}/graph.svg +4 -4
- package/{src/assets/img → assets}/iconAi.svg +9 -9
- package/{dist/assets/index-BKbpfN9S.js → assets/index-97Oe7YBe.js} +1 -1
- package/{dist/assets/index-BXdyn2W3.js → assets/index-B4k3tK0f.js} +1 -1
- package/{dist/assets/index-Bin0NZwF.js → assets/index-BDc2zBbG.js} +7 -3
- package/assets/index-BIEKgWu0.js +27 -0
- package/assets/index-BlAyZ4S3.js +943 -0
- package/assets/index-CzZQWA2P.js +1 -0
- package/{dist/assets/index-CpSzj-Sx.js → assets/index-DHK_n74G.js} +58 -73
- package/assets/index-DPA1HCWQ.js +1372 -0
- package/assets/index-DPyRygOA.js +745 -0
- package/{dist/assets/index-vfI1_Qg0.js → assets/index-iOuQJ8vu.js} +1 -1
- package/{dist/assets/index-Ct_k24Ar.js → assets/index-usBlUHOb.js} +1 -1
- package/{src/modules/assistantConfig/assets → assets}/knowledge.svg +4 -4
- package/{src/modules/database/assets → assets}/mysql.svg +14 -14
- package/assets/plus-BICgMvz9.js +6 -0
- package/assets/search-CD5YKija.js +6 -0
- package/{dist/assets → assets}/sensitive.svg +5 -5
- package/{dist/assets/style-CfNUqKAA.js → assets/style-D8ou48dh.js} +7 -7
- package/assets/style2.css +1 -0
- package/{dist/assets/triangle-alert-CaJaaCaZ.js → assets/triangle-alert-C4Z1AkGW.js} +1 -1
- package/{dist/assets/x-B65AntWN.js → assets/x-DWGzNb9c.js} +1 -1
- package/{dist/assistantConfig.js → assistantConfig.js} +14 -9
- package/chat.js +1 -0
- package/chatCompare.js +1 -0
- package/database.js +20 -0
- package/{dist/databaseId.js → databaseId.js} +1 -1
- package/{dist/databaseTable.js → databaseTable.js} +1 -1
- package/index.js +1 -0
- package/modelManage.js +1 -0
- package/package.json +44 -125
- package/{dist/sensitive.js → sensitive.js} +6 -6
- package/streamFilesReader.js +1 -0
- package/{public/worker → worker}/pdf.worker.min.js +21 -21
- package/.editorconfig +0 -38
- package/.prettierignore +0 -16
- package/.prettierrc +0 -17
- package/CHANGELOG.md +0 -162
- package/Dockerfile +0 -15
- package/USAGE.md +0 -247
- package/bash.exe.stackdump +0 -40
- package/components.json +0 -21
- package/default.conf +0 -19
- package/dist/README.md +0 -761
- package/dist/assets/database.svg +0 -11
- package/dist/assets/database_add.svg +0 -53
- package/dist/assets/iconAi.svg +0 -9
- package/dist/assets/index-1PwCuRjv.js +0 -1061
- package/dist/assets/index-7QvYA6eT.js +0 -1
- package/dist/assets/index-BhUNGJOe.js +0 -27
- package/dist/assets/index-DT3qkjJ3.js +0 -750
- package/dist/assets/index-lFBFf_0k.js +0 -1890
- package/dist/assets/knowledge.svg +0 -4
- package/dist/assets/mysql.svg +0 -14
- package/dist/assets/style2.css +0 -1
- package/dist/chat.js +0 -1
- package/dist/chatCompare.js +0 -1
- package/dist/database.js +0 -20
- package/dist/index.js +0 -1
- package/dist/modelManage.js +0 -1
- package/dist/package.json +0 -73
- package/dist/streamFilesReader.js +0 -1
- package/dist/worker/pdf.worker.min.js +0 -22
- package/doc_assets/images/1.png +0 -0
- package/doc_assets/images/3.png +0 -0
- package/doc_assets/images/component-screenshot.png +0 -1
- package/doc_assets//346/226/271/346/241/210/v2.0.7/345/217/230/346/233/264/346/200/273/347/273/223.md +0 -115
- 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 +0 -504
- package/doc_assets//346/226/271/346/241/210//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 +0 -359
- package/eslint.config.js +0 -92
- package/index.html +0 -13
- package/package.json.demo-backup +0 -109
- package/postcss.config.cjs +0 -19
- 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 +0 -1
- package/rag/assets/index.Bd0tNzw0.js +0 -2797
- package/rag/assets/index.D6t67hlu.css +0 -1
- package/rag/assets/left.KBHV5h7q.jpg +0 -0
- package/rag/assets/worker-BbpylX7l.DptbXke_.js +0 -13
- package/release-it.json +0 -21
- package/scripts/README.md +0 -133
- package/scripts/build-demo.js +0 -88
- package/scripts/check-changelog.cjs +0 -124
- package/scripts/check-version.cjs +0 -49
- package/scripts/decrypt-api-key.js +0 -95
- package/scripts/demo-selector.js +0 -216
- package/scripts/dev-demo.js +0 -85
- package/scripts/open-file.cjs +0 -61
- package/scripts/preview-demo.js +0 -130
- package/scripts/run-demo.bat +0 -34
- 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/search.svg +0 -3
- package/src/assets/img/selected.svg +0 -4
- 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 +0 -42
- package/src/examples/LoginPage/index.tsx +0 -20
- package/src/examples/chat/components/DrawerGraphPreview.tsx +0 -78
- package/src/examples/chat/index.tsx +0 -171
- package/src/examples/chat/logo03.png +0 -0
- package/src/examples/chatCompare/icons/rag_think.svg +0 -8
- package/src/examples/chatCompare/icons/wenda_lianwangsousuo.svg +0 -9
- package/src/examples/chatCompare/index.tsx +0 -154
- package/src/examples/gientechStreamFilesReader/index.tsx +0 -979
- package/src/examples/headlessChat/assets/mind.svg +0 -6
- package/src/examples/headlessChat/assets/net.svg +0 -7
- package/src/examples/headlessChat/index.tsx +0 -298
- package/src/examples/knowledgebaseDetails/index.tsx +0 -119
- package/src/examples/ragDatabaseDataPage/index.tsx +0 -40
- package/src/examples/ragDatabaseIdPage/index.tsx +0 -126
- package/src/examples/ragDatabasePage/index.tsx +0 -36
- package/src/examples/ragModelManagePage/index.tsx +0 -107
- package/src/examples/ragModelManagePage/style.css +0 -7
- package/src/examples/ragSearchPage/index.tsx +0 -0
- package/src/examples/ragSensitiveWordsPage/index.tsx +0 -117
- package/src/examples/ragSensitiveWordsPage/style.css +0 -16
- package/src/examples/sensitiveId/index.tsx +0 -41
- package/src/examples/streamFiles/index.tsx +0 -417
- package/src/examples/utils/demo_setting_pannel.ts +0 -0
- package/src/lib_enter.ts +0 -44
- package/src/main.tsx +0 -5
- package/src/main.tsx.backup +0 -5
- package/src/modules/CHAT_UNIFICATION_PLAN.md +0 -324
- package/src/modules/assistantConfig/assets/databse.svg +0 -6
- package/src/modules/assistantConfig/assets/empty.png +0 -0
- package/src/modules/assistantConfig/assets/graph.svg +0 -4
- package/src/modules/assistantConfig/assets/sensitive.svg +0 -5
- package/src/modules/assistantConfig/components/Database.tsx +0 -171
- package/src/modules/assistantConfig/components/Graph.tsx +0 -177
- package/src/modules/assistantConfig/components/Knowledge.tsx +0 -276
- package/src/modules/assistantConfig/components/NotFoundContent.tsx +0 -21
- package/src/modules/assistantConfig/components/Paragraph.tsx +0 -51
- package/src/modules/assistantConfig/components/ParamsItem.tsx +0 -40
- package/src/modules/assistantConfig/components/ResourceBinderItem.tsx +0 -133
- package/src/modules/assistantConfig/components/SearchableSelector.tsx +0 -500
- package/src/modules/assistantConfig/components/Sensitive.tsx +0 -221
- package/src/modules/assistantConfig/components/SliderInput.tsx +0 -66
- package/src/modules/assistantConfig/constants.tsx +0 -75
- package/src/modules/assistantConfig/index.tsx +0 -785
- package/src/modules/assistantConfig/server.ts +0 -262
- package/src/modules/chat/AllFiles.tsx +0 -158
- package/src/modules/chat/Conversations/Item.tsx +0 -169
- package/src/modules/chat/Conversations/List.tsx +0 -210
- package/src/modules/chat/Conversations/groupByTime.ts +0 -39
- package/src/modules/chat/Conversations/index.tsx +0 -255
- package/src/modules/chat/ReferenceBar.tsx +0 -659
- package/src/modules/chat/constants.tsx +0 -66
- package/src/modules/chat/i18n.ts +0 -151
- package/src/modules/chat/i18n.tsx +0 -151
- package/src/modules/chat/icons/rag_think.svg +0 -8
- package/src/modules/chat/icons/wenda_lianwangsousuo.svg +0 -9
- package/src/modules/chat/index.tsx +0 -2400
- package/src/modules/chat/referenceCom/DeleteModal.tsx +0 -75
- package/src/modules/chat/referenceCom/DrawerContent.tsx +0 -136
- package/src/modules/chat/referenceCom/DrawerDatabase.tsx +0 -102
- package/src/modules/chat/referenceCom/DrawerGraphPreview.tsx +0 -86
- package/src/modules/chat/referenceCom/DrawerPreview.tsx +0 -73
- package/src/modules/chat/referenceCom/DrawerTitle.tsx +0 -26
- package/src/modules/chat/referenceCom/RenameModal.tsx +0 -86
- package/src/modules/chat/referenceCom/TagCom.tsx +0 -30
- package/src/modules/chat/style.css +0 -6
- package/src/modules/chat/style.less +0 -7
- package/src/modules/chat/types.ts +0 -17
- package/src/modules/chat/utils/index.ts +0 -348
- package/src/modules/chatCompare/UseChatCompareHooks.ts +0 -103
- package/src/modules/chatCompare/components/AichatCompareUseController.tsx +0 -754
- package/src/modules/chatCompare/components/AssistantSelector.tsx +0 -127
- package/src/modules/chatCompare/components/ChatInputer.tsx +0 -67
- package/src/modules/chatCompare/components/ChatInstance.tsx +0 -426
- package/src/modules/chatCompare/components/ChatItem.tsx +0 -556
- package/src/modules/chatCompare/components/Sender/FileCardCommon.tsx +0 -97
- package/src/modules/chatCompare/components/Sender/FileUpload.tsx +0 -89
- package/src/modules/chatCompare/components/Sender/FilesDisplay.tsx +0 -309
- package/src/modules/chatCompare/components/Sender/VoiceInput.tsx +0 -80
- package/src/modules/chatCompare/components/Sender/contexts/BadgeContext.tsx +0 -36
- package/src/modules/chatCompare/components/Sender/fileIcon.tsx +0 -100
- package/src/modules/chatCompare/components/Sender/index.tsx +0 -850
- package/src/modules/chatCompare/components/UseChatInstanceHooks.ts +0 -406
- package/src/modules/chatCompare/components/UseScrollHooks.ts +0 -36
- package/src/modules/chatCompare/components/components/AllFiles.tsx +0 -156
- package/src/modules/chatCompare/components/components/DeleteModal.tsx +0 -75
- package/src/modules/chatCompare/components/components/DrawerContent.tsx +0 -138
- package/src/modules/chatCompare/components/components/DrawerDatabase.tsx +0 -110
- package/src/modules/chatCompare/components/components/DrawerGraphPreview.tsx +0 -95
- package/src/modules/chatCompare/components/components/DrawerPreview.tsx +0 -75
- package/src/modules/chatCompare/components/components/DrawerTitle.tsx +0 -26
- package/src/modules/chatCompare/components/components/DrawerVideo.tsx +0 -85
- package/src/modules/chatCompare/components/components/ReferenceBar.tsx +0 -659
- package/src/modules/chatCompare/components/components/RenameModal.tsx +0 -86
- package/src/modules/chatCompare/components/components/TagCom.tsx +0 -30
- package/src/modules/chatCompare/components/defaultStyleSet.tsx +0 -148
- package/src/modules/chatCompare/components/server.ts +0 -208
- package/src/modules/chatCompare/components/serverFn.ts +0 -172
- package/src/modules/chatCompare/components/style.less +0 -97
- package/src/modules/chatCompare/components/useFileManager.ts +0 -173
- package/src/modules/chatCompare/components/utils.ts +0 -31
- package/src/modules/chatCompare/data.ts +0 -842
- package/src/modules/chatCompare/index.tsx +0 -537
- package/src/modules/chatCompare/utils/AiChat.types.tsx +0 -110
- package/src/modules/chatCompare/utils/constants.tsx +0 -70
- package/src/modules/chatCompare/utils/fileUploadValidator.ts +0 -183
- package/src/modules/chatCompare/utils/icons/rag_think.svg +0 -8
- package/src/modules/chatCompare/utils/icons/wenda_lianwangsousuo.svg +0 -9
- package/src/modules/chatCompare/utils/index.ts +0 -46
- package/src/modules/database/CreateModal.tsx +0 -402
- 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_connect.svg +0 -66
- package/src/modules/database/assets/database_upload.svg +0 -29
- package/src/modules/database/assets/empty.png +0 -0
- package/src/modules/database/index.tsx +0 -477
- package/src/modules/database/server.ts +0 -196
- package/src/modules/databaseId/CustomCom.tsx +0 -156
- package/src/modules/databaseId/EditConfig.tsx +0 -280
- package/src/modules/databaseId/UploadDrawer.tsx +0 -535
- package/src/modules/databaseId/assets/aiOptimize.svg +0 -10
- package/src/modules/databaseId/assets/empty.png +0 -0
- package/src/modules/databaseId/assets/template.svg +0 -6
- package/src/modules/databaseId/assets/upload.svg +0 -9
- package/src/modules/databaseId/assets/useTemp.svg +0 -6
- package/src/modules/databaseId/i18n.ts +0 -360
- package/src/modules/databaseId/index.tsx +0 -855
- package/src/modules/databaseId/server.ts +0 -286
- package/src/modules/databaseId/style.css +0 -5
- package/src/modules/databaseTable/EditRowDrawer.tsx +0 -124
- package/src/modules/databaseTable/index.tsx +0 -359
- package/src/modules/databaseTable/server.ts +0 -180
- package/src/modules/headlessChat/ReferenceBar.tsx +0 -783
- package/src/modules/headlessChat/constants.tsx +0 -54
- package/src/modules/headlessChat/index.tsx +0 -1903
- package/src/modules/headlessChat/referenceCom/DeleteModal.tsx +0 -75
- package/src/modules/headlessChat/referenceCom/DrawerContent.tsx +0 -136
- package/src/modules/headlessChat/referenceCom/DrawerDatabase.tsx +0 -102
- package/src/modules/headlessChat/referenceCom/DrawerGraphPreview.tsx +0 -86
- package/src/modules/headlessChat/referenceCom/DrawerPreview.tsx +0 -73
- package/src/modules/headlessChat/referenceCom/DrawerTitle.tsx +0 -26
- package/src/modules/headlessChat/referenceCom/RenameModal.tsx +0 -86
- package/src/modules/headlessChat/referenceCom/TagCom.tsx +0 -30
- package/src/modules/headlessChat/style.less +0 -3
- package/src/modules/headlessChat/types.ts +0 -23
- package/src/modules/headlessChat/utils/index.ts +0 -348
- package/src/modules/knowledgeBase/index.tsx +0 -58
- package/src/modules/knowledgeBase/server.ts +0 -196
- package/src/modules/knowledgebaseDetails/KnowledgeBaseDetails.tsx +0 -169
- package/src/modules/knowledgebaseDetails/components/KnowledgeBaseSummaryCard.tsx +0 -193
- package/src/modules/knowledgebaseDetails/components/fileManagementParts.tsx +0 -534
- package/src/modules/knowledgebaseDetails/components/index.ts +0 -3
- package/src/modules/knowledgebaseDetails/index.ts +0 -3
- package/src/modules/knowledgebaseDetails/modules/ConfigModule.tsx +0 -49
- package/src/modules/knowledgebaseDetails/modules/FaqModule.tsx +0 -47
- package/src/modules/knowledgebaseDetails/modules/KnowledgeParseModule.tsx +0 -771
- package/src/modules/knowledgebaseDetails/modules/RetrievalTestModule.tsx +0 -49
- package/src/modules/knowledgebaseDetails/modules/UploadManagementModule.tsx +0 -49
- package/src/modules/knowledgebaseDetails/modules/types.ts +0 -44
- package/src/modules/knowledgebaseDetails/modules-shim.d.ts +0 -14
- package/src/modules/knowledgebaseDetails/servers/analysis.ts +0 -5
- package/src/modules/knowledgebaseDetails/servers/index.ts +0 -318
- package/src/modules/login/components/Login/LoginBox/index.tsx +0 -105
- package/src/modules/login/components/Login/RegisterBox/index.tsx +0 -181
- package/src/modules/login/components/Login/index.tsx +0 -100
- package/src/modules/login/i18n.ts +0 -217
- package/src/modules/login/index.tsx +0 -113
- package/src/modules/login/style.css +0 -3
- package/src/modules/login/useServices.ts +0 -53
- package/src/modules/login/utils.ts +0 -42
- package/src/modules/modelManage/ConfigDrawer.tsx +0 -267
- package/src/modules/modelManage/ReplaceModal.tsx +0 -113
- package/src/modules/modelManage/assets/empty.png +0 -0
- package/src/modules/modelManage/const.ts +0 -51
- package/src/modules/modelManage/i18n.ts +0 -407
- package/src/modules/modelManage/index.tsx +0 -668
- package/src/modules/modelManage/server.ts +0 -231
- package/src/modules/nodegraph/index.tsx +0 -1
- package/src/modules/search/assets/Icon-history.svg +0 -8
- 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 +0 -9
- package/src/modules/search/assets/icon-search-bar.svg +0 -14
- package/src/modules/search/assets/icon-sub-title.svg +0 -3
- package/src/modules/search/assets/icon-title.svg +0 -9
- package/src/modules/search/assets/icon-zoomOut.svg +0 -9
- package/src/modules/search/assets/iconAi.svg +0 -9
- 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 +0 -3
- package/src/modules/search/assets/selected.svg +0 -4
- 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 +0 -137
- package/src/modules/search/components/Editor/ChatViewEditor.tsx +0 -261
- package/src/modules/search/components/Editor/aichat.css +0 -1
- package/src/modules/search/components/Editor/constant.ts +0 -13
- package/src/modules/search/components/Editor/index.tsx +0 -113
- package/src/modules/search/components/Editor/plugins/autofomatRules.ts +0 -332
- package/src/modules/search/components/Editor/plugins/convertImgPlugins.tsx +0 -20
- package/src/modules/search/components/Editor/plugins/createIndexes.tsx +0 -38
- package/src/modules/search/components/Editor/plugins/displayer.ts +0 -298
- package/src/modules/search/components/Editor/plugins/imageClick.tsx +0 -32
- package/src/modules/search/components/Editor/plugins/myplugin.tsx +0 -98
- package/src/modules/search/components/Editor/ui/avatar.tsx +0 -19
- package/src/modules/search/components/Editor/ui/blockquote-element.tsx +0 -21
- package/src/modules/search/components/Editor/ui/button.tsx +0 -58
- package/src/modules/search/components/Editor/ui/calendar.tsx +0 -68
- package/src/modules/search/components/Editor/ui/caption.tsx +0 -46
- package/src/modules/search/components/Editor/ui/checkbox.tsx +0 -27
- package/src/modules/search/components/Editor/ui/code-block-combobox.tsx +0 -188
- package/src/modules/search/components/Editor/ui/code-block-element.css +0 -434
- package/src/modules/search/components/Editor/ui/code-block-element.tsx +0 -39
- package/src/modules/search/components/Editor/ui/code-leaf.tsx +0 -24
- package/src/modules/search/components/Editor/ui/code-line-element.tsx +0 -10
- package/src/modules/search/components/Editor/ui/code-syntax-leaf.tsx +0 -21
- package/src/modules/search/components/Editor/ui/column-element.tsx +0 -30
- package/src/modules/search/components/Editor/ui/column-group-element.tsx +0 -94
- package/src/modules/search/components/Editor/ui/command.tsx +0 -75
- package/src/modules/search/components/Editor/ui/comment-avatar.tsx +0 -22
- package/src/modules/search/components/Editor/ui/comment-create-form.tsx +0 -37
- package/src/modules/search/components/Editor/ui/comment-item.tsx +0 -74
- package/src/modules/search/components/Editor/ui/comment-leaf.tsx +0 -49
- package/src/modules/search/components/Editor/ui/comment-more-dropdown.tsx +0 -42
- package/src/modules/search/components/Editor/ui/comment-reply-items.tsx +0 -22
- package/src/modules/search/components/Editor/ui/comment-resolve-button.tsx +0 -32
- package/src/modules/search/components/Editor/ui/comment-value.tsx +0 -34
- package/src/modules/search/components/Editor/ui/comments-popover.tsx +0 -63
- package/src/modules/search/components/Editor/ui/date-element.tsx +0 -83
- package/src/modules/search/components/Editor/ui/dialog.tsx +0 -63
- package/src/modules/search/components/Editor/ui/draggable.tsx +0 -177
- package/src/modules/search/components/Editor/ui/dropdown-menu.tsx +0 -180
- package/src/modules/search/components/Editor/ui/emoji-input-element.tsx +0 -85
- package/src/modules/search/components/Editor/ui/excalidraw-element.tsx +0 -28
- package/src/modules/search/components/Editor/ui/fixed-toolbar-buttons.tsx +0 -76
- package/src/modules/search/components/Editor/ui/fixed-toolbar.tsx +0 -8
- package/src/modules/search/components/Editor/ui/floating-toolbar-buttons.tsx +0 -51
- package/src/modules/search/components/Editor/ui/floating-toolbar.tsx +0 -77
- package/src/modules/search/components/Editor/ui/heading-element.tsx +0 -48
- package/src/modules/search/components/Editor/ui/highlight-leaf.tsx +0 -17
- package/src/modules/search/components/Editor/ui/hr-element.tsx +0 -30
- package/src/modules/search/components/Editor/ui/icons.tsx +0 -267
- package/src/modules/search/components/Editor/ui/image-element.tsx +0 -74
- package/src/modules/search/components/Editor/ui/inline-combobox.tsx +0 -368
- package/src/modules/search/components/Editor/ui/input.tsx +0 -25
- package/src/modules/search/components/Editor/ui/insert-dropdown-menu.tsx +0 -218
- package/src/modules/search/components/Editor/ui/kbd-leaf.tsx +0 -20
- package/src/modules/search/components/Editor/ui/link-element.tsx +0 -29
- package/src/modules/search/components/Editor/ui/link-floating-toolbar.tsx +0 -161
- package/src/modules/search/components/Editor/ui/list-element.tsx +0 -30
- package/src/modules/search/components/Editor/ui/mark-toolbar-button.tsx +0 -24
- package/src/modules/search/components/Editor/ui/media-embed-element.tsx +0 -133
- package/src/modules/search/components/Editor/ui/media-popover.tsx +0 -97
- package/src/modules/search/components/Editor/ui/mention-element.tsx +0 -43
- package/src/modules/search/components/Editor/ui/mention-input-element.tsx +0 -141
- package/src/modules/search/components/Editor/ui/mode-dropdown-menu.tsx +0 -93
- package/src/modules/search/components/Editor/ui/more-dropdown-menu.tsx +0 -67
- package/src/modules/search/components/Editor/ui/paragraph-element.tsx +0 -4
- package/src/modules/search/components/Editor/ui/placeholder.tsx +0 -52
- package/src/modules/search/components/Editor/ui/popover.tsx +0 -32
- package/src/modules/search/components/Editor/ui/resizable.tsx +0 -66
- package/src/modules/search/components/Editor/ui/separator.tsx +0 -25
- package/src/modules/search/components/Editor/ui/style.less +0 -12
- package/src/modules/search/components/Editor/ui/table-cell-element.tsx +0 -143
- package/src/modules/search/components/Editor/ui/table-element.tsx +0 -243
- package/src/modules/search/components/Editor/ui/table-row-element.tsx +0 -22
- package/src/modules/search/components/Editor/ui/tableValue.tsx +0 -135
- package/src/modules/search/components/Editor/ui/todo-list-element.tsx +0 -43
- package/src/modules/search/components/Editor/ui/toggle-element.tsx +0 -31
- package/src/modules/search/components/Editor/ui/toolbar.tsx +0 -157
- package/src/modules/search/components/Editor/ui/tooltip.tsx +0 -65
- package/src/modules/search/components/Editor/ui/turn-into-dropdown-menu.tsx +0 -160
- package/src/modules/search/components/Editor/ui/with-draggables.tsx +0 -175
- package/src/modules/search/components/FileList.tsx +0 -287
- package/src/modules/search/components/ImageGroupView/index.tsx +0 -85
- package/src/modules/search/components/ResultContent.tsx +0 -232
- package/src/modules/search/components/SearchInput.tsx +0 -232
- package/src/modules/search/components/SearchLanding.tsx +0 -74
- package/src/modules/search/components/SearchView.tsx +0 -563
- package/src/modules/search/components/SimpleEditor.tsx +0 -158
- package/src/modules/search/components/SimpleFileList.tsx +0 -215
- package/src/modules/search/index.tsx +0 -10
- package/src/modules/search/reademe.md +0 -1
- package/src/modules/search/servers/apis.tsx +0 -19
- package/src/modules/search/servers/index.ts +0 -184
- package/src/modules/search/style.less +0 -503
- package/src/modules/search/type.ts +0 -22
- package/src/modules/search/utils.ts +0 -34
- package/src/modules/sensitive/i18n.ts +0 -391
- package/src/modules/sensitive/index.tsx +0 -604
- package/src/modules/sensitive/sensitiveEditor.tsx +0 -543
- package/src/modules/sensitive/server.ts +0 -197
- package/src/modules/sensitiveId/AutoTag.tsx +0 -311
- package/src/modules/sensitiveId/UploadModal.tsx +0 -181
- package/src/modules/sensitiveId/VirtualWrap.tsx +0 -125
- package/src/modules/sensitiveId/index.tsx +0 -253
- package/src/modules/sensitiveId/server.ts +0 -142
- package/src/modules/streamFilesReader/GientechStreamReader.tsx +0 -1658
- package/src/modules/streamFilesReader/components/Header/Toolbar.tsx +0 -0
- package/src/modules/streamFilesReader/components/Header/index.tsx +0 -297
- package/src/modules/streamFilesReader/index.tsx +0 -3
- package/src/style.css +0 -6
- package/src/type.d.ts +0 -0
- package/src/utils/commonFn.tsx +0 -153
- package/src/utils/decryptApiKey.ts +0 -40
- package/src/utils/gientechCommon/components/AppError.tsx +0 -32
- package/src/utils/gientechCommon/components/AppLoading.tsx +0 -75
- package/src/utils/gientechCommon/components/DeleteModal.tsx +0 -75
- package/src/utils/gientechCommon/components/DisplayError.tsx +0 -33
- package/src/utils/gientechCommon/components/DisplayLoading.tsx +0 -38
- package/src/utils/gientechCommon/components/FeedBackModal.tsx +0 -319
- package/src/utils/gientechCommon/components/FileCardCommon.tsx +0 -82
- package/src/utils/gientechCommon/components/FileManager/index.tsx +0 -418
- package/src/utils/gientechCommon/components/FileManager/style.css +0 -5
- package/src/utils/gientechCommon/components/Messages/GientechNewChatWelcome.tsx +0 -583
- package/src/utils/gientechCommon/components/Messages/ReferenceCard.tsx +0 -359
- package/src/utils/gientechCommon/components/Messages/RetriveItem.tsx +0 -245
- package/src/utils/gientechCommon/components/Messages/WebRetriveItem.tsx +0 -209
- package/src/utils/gientechCommon/components/Messages/defaultBot.png +0 -0
- package/src/utils/gientechCommon/components/Messages/defaultStyleSet.tsx +0 -148
- package/src/utils/gientechCommon/components/Messages/defaultWeLogo.svg +0 -14
- package/src/utils/gientechCommon/components/RenameModal.tsx +0 -86
- package/src/utils/gientechCommon/components/style.less +0 -11
- package/src/utils/gientechCommon/configs/commonConfig.ts +0 -2
- package/src/utils/gientechCommon/configs/senderConfig.ts +0 -0
- package/src/utils/gientechCommon/configs/stylesConfig.ts +0 -142
- package/src/utils/gientechCommon/hooks/AichatUseController.tsx +0 -761
- package/src/utils/gientechCommon/hooks/style.less +0 -8
- package/src/utils/gientechCommon/hooks/useFileDisplayTools.tsx +0 -352
- package/src/utils/gientechCommon/hooks/useFileManager.ts +0 -169
- package/src/utils/gientechCommon/slate/converters/deserializers.ts +0 -763
- package/src/utils/gientechCommon/slate/converters/mockData.ts +0 -232
- package/src/utils/gientechCommon/slate/converters/slateConverters.ts +0 -258
- package/src/utils/gientechCommon/slate/richElements/index.tsx +0 -499
- package/src/utils/gientechCommon/utils/fileUtils.ts +0 -86
- package/src/utils/gientechCommon/utils/index.ts +0 -386
- package/src/utils/gientechCommon/utils/request.ts +0 -37
- package/src/utils/gientechCommon/utils/serverFn.ts +0 -172
- package/src/utils/index.tsx +0 -186
- package/src/utils/testconfigs/demologin/index.tsx +0 -32
- package/src/utils/testconfigs/index.ts +0 -66
- package/src/vite-env.d.ts +0 -49
- package/stats.html +0 -4949
- package/tailwind.config.js +0 -170
- package/tsconfig.app.json +0 -31
- package/tsconfig.app.tsbuildinfo +0 -11
- package/tsconfig.json +0 -17
- package/tsconfig.node.json +0 -23
- package/tsconfig.node.tsbuildinfo +0 -1
- package/vite.config.app.ts +0 -91
- package/vite.config.ts +0 -238
- /package/{dist/assets → assets}/Doris.png +0 -0
- /package/{dist/assets → assets}/PostgreSQL.png +0 -0
- /package/{dist/assets → assets}/SQLServer.png +0 -0
- /package/{dist/assets → assets}/empty.png +0 -0
- /package/{dist/assets → assets}/homeBg.png +0 -0
- /package/{dist/assets → assets}/index-CpW6Dhpp.js +0 -0
- /package/{dist/assets → assets}/left.jpg +0 -0
- /package/{dist/assets → assets}/logoImg.png +0 -0
- /package/{dist/assets → assets}/style.css +0 -0
- /package/{dist/assets → assets}/style3.css +0 -0
- /package/{dist/assets → assets}/style4.css +0 -0
- /package/{dist/assets → assets}/style5.css +0 -0
- /package/{dist/assets → assets}/worker-BbpylX7l.js +0 -0
- /package/{dist/assistantConfig.d.ts → assistantConfig.d.ts} +0 -0
- /package/{dist/chat.d.ts → chat.d.ts} +0 -0
- /package/{dist/chatCompare.d.ts → chatCompare.d.ts} +0 -0
- /package/{dist/database.d.ts → database.d.ts} +0 -0
- /package/{dist/databaseId.d.ts → databaseId.d.ts} +0 -0
- /package/{dist/databaseTable.d.ts → databaseTable.d.ts} +0 -0
- /package/{dist/icons → icons}/answerAwartar.png +0 -0
- /package/{dist/icons → icons}/docx-file.png +0 -0
- /package/{dist/icons → icons}/folder.png +0 -0
- /package/{dist/icons → icons}/html.png +0 -0
- /package/{dist/icons → icons}/image.png +0 -0
- /package/{dist/icons → icons}/jpg-file.png +0 -0
- /package/{dist/icons → icons}/json.png +0 -0
- /package/{dist/icons → icons}/md.png +0 -0
- /package/{dist/icons → icons}/pdf.png +0 -0
- /package/{dist/icons → icons}/pptx.png +0 -0
- /package/{dist/icons → icons}/questionAwartar.png +0 -0
- /package/{dist/icons → icons}/sheets.png +0 -0
- /package/{dist/icons → icons}/txt.png +0 -0
- /package/{dist/icons → icons}/xlsx.png +0 -0
- /package/{dist/index.d.ts → index.d.ts} +0 -0
- /package/{dist/modelManage.d.ts → modelManage.d.ts} +0 -0
- /package/{dist/sensitive.d.ts → sensitive.d.ts} +0 -0
- /package/{dist/streamFilesReader.d.ts → streamFilesReader.d.ts} +0 -0
- /package/{dist/vite.svg → vite.svg} +0 -0
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import { message } from 'antd';
|
|
2
|
-
import axios from 'axios';
|
|
3
|
-
const specialErrorCodes = ['10014'];
|
|
4
|
-
|
|
5
|
-
type IDataSourceType = 'DataTable' | 'DirectDB';
|
|
6
|
-
|
|
7
|
-
export interface SensitiveApiProps {
|
|
8
|
-
url?: string;
|
|
9
|
-
token?: string;
|
|
10
|
-
role?: string;
|
|
11
|
-
/** 由调用方传入,用于 i18n 错误提示兜底 */
|
|
12
|
-
getMessage?: (key: string) => string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/** 敏感词模块业务 Server 约定接口(推荐由外部注入以便复用、mock) */
|
|
16
|
-
export interface SensitiveServer {
|
|
17
|
-
getLibraryList: (params: any) => Promise<any>;
|
|
18
|
-
createLibrary: (params: any) => Promise<any>;
|
|
19
|
-
deleteLibrary: (id: any) => Promise<any>;
|
|
20
|
-
/** 更新敏感词库(如 name、words) */
|
|
21
|
-
updateLibrary: (id: string, params: { name?: string; words?: string[] }) => Promise<any>;
|
|
22
|
-
/** 下载导入模板(GET,带 token),返回 Blob 用于前端触发下载 */
|
|
23
|
-
downloadTemplate: (fileType: 'csv' | 'txt') => Promise<Blob | false>;
|
|
24
|
-
/** 导入敏感词文件:PUT FormData(file),路径 /sensitive/word/:id/import */
|
|
25
|
-
importWords: (libraryId: string, file: File) => Promise<any>;
|
|
26
|
-
getWords : (id: any) => Promise<any>;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const AxiosInstance = ({ url, token, role, getMessage }: SensitiveApiProps): SensitiveServer => {
|
|
30
|
-
const fallback = (key: string, def: string) => (getMessage ? getMessage(key) : def);
|
|
31
|
-
const axios$ = axios.create({
|
|
32
|
-
baseURL: url,
|
|
33
|
-
// 配置请求超时时间
|
|
34
|
-
timeout: 1000000,
|
|
35
|
-
});
|
|
36
|
-
// 请求拦截
|
|
37
|
-
axios$.interceptors.request.use((config: any) => {
|
|
38
|
-
let target_cookie = token;
|
|
39
|
-
|
|
40
|
-
const noA = ['user/login', 'user/kaptcha', 'user/regist'];
|
|
41
|
-
// dangerous behaviour
|
|
42
|
-
if (!target_cookie && !noA.some((item: string) => config.url.includes(item))) {
|
|
43
|
-
window.location.pathname = '/login';
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
config.headers.Authorization = target_cookie || '';
|
|
48
|
-
// 这里传中文会报错
|
|
49
|
-
config.headers.userName = role === '未登录用户' ? '' : role;
|
|
50
|
-
// config.headers.userId = roleId;
|
|
51
|
-
return config;
|
|
52
|
-
});
|
|
53
|
-
// 返回拦截
|
|
54
|
-
axios$.interceptors.response.use(
|
|
55
|
-
response => {
|
|
56
|
-
// 获取接口返回结果
|
|
57
|
-
const noA = ['user/kaptcha'];
|
|
58
|
-
const res = response.data;
|
|
59
|
-
if (noA.some((item: string) => response.config.url && response.config.url.includes(item))) {
|
|
60
|
-
return res;
|
|
61
|
-
}
|
|
62
|
-
if (res.size && res.type) {
|
|
63
|
-
return res;
|
|
64
|
-
}
|
|
65
|
-
const { success, errorMsg, errorCode } = res;
|
|
66
|
-
// 处理特殊错误码的情况,页面自己处理错误,例如上传文件重复
|
|
67
|
-
if (specialErrorCodes.includes(errorCode)) {
|
|
68
|
-
return res;
|
|
69
|
-
}
|
|
70
|
-
if (success) return res;
|
|
71
|
-
message.error(errorMsg || fallback('server.requestError', '请求出错,请稍后再试'));
|
|
72
|
-
return false;
|
|
73
|
-
},
|
|
74
|
-
error => {
|
|
75
|
-
// 主动取消请求,不给报错信息
|
|
76
|
-
if (error.message === 'canceled') {
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
if (
|
|
80
|
-
error?.response?.data?.errorCode === '30013' ||
|
|
81
|
-
error?.response?.data?.errorCode === '30023'
|
|
82
|
-
) {
|
|
83
|
-
message.error((error?.response?.data || {}).errorMsg || fallback('server.requestError', '请求出错,请稍后再试'));
|
|
84
|
-
// location.pathname = '/login';
|
|
85
|
-
}
|
|
86
|
-
if (error?.response?.status === 401) {
|
|
87
|
-
console.log('Error url:', error?.request?.responseURL);
|
|
88
|
-
message.error((error?.response?.data || {}).errorMsg || fallback('server.noPermission', '没有足够权限'));
|
|
89
|
-
//window.location.pathname = "/login";
|
|
90
|
-
}
|
|
91
|
-
console.log('Error occurs', error);
|
|
92
|
-
if ('未设置默认配置!' != (error?.response?.data || {}).errorMsg) {
|
|
93
|
-
message.error((error?.response?.data || {}).errorMsg || fallback('server.requestError', '请求出错,请稍后再试'));
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
);
|
|
97
|
-
const getLibraryList = async (params: any) => {
|
|
98
|
-
try {
|
|
99
|
-
const res: any = await axios$.get(`/sensitive/library?${new URLSearchParams(params).toString()}`);
|
|
100
|
-
const { success, data } = res;
|
|
101
|
-
if (success) return data;
|
|
102
|
-
return false;
|
|
103
|
-
} catch (e) {
|
|
104
|
-
console.log('e', e);
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
const createLibrary = async (params: any) => {
|
|
110
|
-
try {
|
|
111
|
-
const res: any = await axios$.post(`/sensitive/library`, params);
|
|
112
|
-
const { success, data } = res;
|
|
113
|
-
if (success) return data;
|
|
114
|
-
return false;
|
|
115
|
-
} catch (e) {
|
|
116
|
-
console.log('e', e);
|
|
117
|
-
return false;
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
const deleteLibrary = async (id: any) => {
|
|
122
|
-
try {
|
|
123
|
-
const res: any = await axios$.delete(`/sensitive/library/${id}`);
|
|
124
|
-
const { success, data } = res;
|
|
125
|
-
if (success) return data;
|
|
126
|
-
return false;
|
|
127
|
-
} catch (e) {
|
|
128
|
-
console.log('e', e);
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
const updateLibrary = async (id: string, params: { name?: string; words?: string[] }) => {
|
|
134
|
-
try {
|
|
135
|
-
const res: any = await axios$.put(`/sensitive/library/${id}`, params);
|
|
136
|
-
const { success, data } = res;
|
|
137
|
-
if (success) return data;
|
|
138
|
-
return false;
|
|
139
|
-
} catch (e) {
|
|
140
|
-
console.log('e', e);
|
|
141
|
-
return false;
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
/** 下载导入模板:GET 请求,走当前 axios 实例(baseURL 已含用户传入的 proxy),路径仅 /sensitive/word/downloadTemplate */
|
|
146
|
-
const downloadTemplate = async (fileType: 'csv' | 'txt'): Promise<Blob | false> => {
|
|
147
|
-
try {
|
|
148
|
-
const res: any = await axios$.get('/sensitive/word/downloadTemplate', {
|
|
149
|
-
params: { fileType },
|
|
150
|
-
responseType: 'blob',
|
|
151
|
-
});
|
|
152
|
-
if (res && typeof res.size === 'number') return res as Blob;
|
|
153
|
-
return false;
|
|
154
|
-
} catch (e) {
|
|
155
|
-
console.log('e', e);
|
|
156
|
-
return false;
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
/** 导入敏感词文件:PUT /sensitive/word/:libraryId/import,FormData 字段 file(binary),不设 Content-Type 由 axios 自动带 boundary */
|
|
161
|
-
const importWords = async (libraryId: string, file: File): Promise<any> => {
|
|
162
|
-
try {
|
|
163
|
-
const formData = new FormData();
|
|
164
|
-
formData.append('file', file);
|
|
165
|
-
const res: any = await axios$.put(`/sensitive/word/${libraryId}/import`, formData);
|
|
166
|
-
if (res && res.success !== false) return res;
|
|
167
|
-
return false;
|
|
168
|
-
} catch (e) {
|
|
169
|
-
console.log('e', e);
|
|
170
|
-
return false;
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
const getWords = async (id: string) => {
|
|
175
|
-
try {
|
|
176
|
-
const res: any = await axios$.get(`/sensitive/library/${id}`);
|
|
177
|
-
const { success, data } = res;
|
|
178
|
-
if (success) return data;
|
|
179
|
-
return false;
|
|
180
|
-
} catch (e) {
|
|
181
|
-
console.log('e', e);
|
|
182
|
-
return false;
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
return {
|
|
187
|
-
getLibraryList,
|
|
188
|
-
createLibrary,
|
|
189
|
-
deleteLibrary,
|
|
190
|
-
updateLibrary,
|
|
191
|
-
downloadTemplate,
|
|
192
|
-
importWords,
|
|
193
|
-
getWords
|
|
194
|
-
};
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
export default AxiosInstance;
|
|
@@ -1,311 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useMemo, useRef, useState } from "react";
|
|
2
|
-
import { X, Plus } from 'lucide-react';
|
|
3
|
-
import type { InputRef } from "antd";
|
|
4
|
-
import { Input, message, Tag, theme } from "antd";
|
|
5
|
-
import VirtualWrap from "./VirtualWrap";
|
|
6
|
-
import { debounce } from "../../utils/commonFn"
|
|
7
|
-
|
|
8
|
-
const FONT_SIZE = 12;
|
|
9
|
-
const INPUT_WIDTH = 64;
|
|
10
|
-
const ADD_TAG_TYPE = "add_tab_20250208";
|
|
11
|
-
|
|
12
|
-
const canvas = document.createElement("canvas");
|
|
13
|
-
interface AutoTagInterface {
|
|
14
|
-
wrapRef?: any;
|
|
15
|
-
tags: string[];
|
|
16
|
-
setTags: (arg: string[]) => void;
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
fuzzyNameOrId?: string;
|
|
19
|
-
addLabel?: string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const AutoTag = ({
|
|
23
|
-
tags,
|
|
24
|
-
setTags,
|
|
25
|
-
disabled,
|
|
26
|
-
fuzzyNameOrId,
|
|
27
|
-
addLabel,
|
|
28
|
-
wrapRef = null
|
|
29
|
-
}: AutoTagInterface) => {
|
|
30
|
-
const { token } = theme.useToken();
|
|
31
|
-
const [inputVisible, setInputVisible] = useState(false);
|
|
32
|
-
const [editInputIndex, setEditInputIndex] = useState(-1);
|
|
33
|
-
const [editInitVal, setEditInitVal] = useState<string>("");
|
|
34
|
-
const inputRef = useRef<InputRef>(null);
|
|
35
|
-
const editInputRef = useRef<InputRef>(null);
|
|
36
|
-
const tagInputStyle: React.CSSProperties = {
|
|
37
|
-
width: INPUT_WIDTH,
|
|
38
|
-
height: 32,
|
|
39
|
-
marginInlineEnd: 8,
|
|
40
|
-
verticalAlign: "top",
|
|
41
|
-
fontSize: FONT_SIZE,
|
|
42
|
-
lineHeight: 30,
|
|
43
|
-
minWidth: INPUT_WIDTH
|
|
44
|
-
};
|
|
45
|
-
const [containerHeight, setContainerHeight] = useState<number>(0);
|
|
46
|
-
const [containerWidth, setContainerWidth] = useState<number>(0);
|
|
47
|
-
const [canvasContext, setCanvasContext] = useState<any>(
|
|
48
|
-
canvas.getContext("2d")
|
|
49
|
-
);
|
|
50
|
-
const [virtualList, setVirtualList] = useState<Array<any>>([]);
|
|
51
|
-
|
|
52
|
-
useEffect(() => {
|
|
53
|
-
setContainerRect();
|
|
54
|
-
}, [wrapRef]);
|
|
55
|
-
|
|
56
|
-
const handleClose = (removedTag: string) => () => {
|
|
57
|
-
const newTags = tags.filter((tag) => tag.trim() !== removedTag);
|
|
58
|
-
setTags(newTags);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const showInput = () => {
|
|
62
|
-
setInputVisible(true);
|
|
63
|
-
setTimeout(() => inputRef.current?.focus(), 0);
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const getStrLenght = (str: string) => {
|
|
67
|
-
let totalLength = 0;
|
|
68
|
-
|
|
69
|
-
for (let i = 0; i < str.length; i++) {
|
|
70
|
-
// 判断当前字符是字母还是数字
|
|
71
|
-
if (/[a-zA-Z0-9]/.test(str[i])) {
|
|
72
|
-
totalLength += 1.2; // 字母和数字长度为1
|
|
73
|
-
} else {
|
|
74
|
-
// 其他字符(比如汉字、emoji等)长度为2
|
|
75
|
-
totalLength += 2;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return (FONT_SIZE / 2) * totalLength + 30;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const handleInputConfirm = (e: any) => {
|
|
83
|
-
const _value = e.target.value.trim();
|
|
84
|
-
if (_value && !tags.includes(_value)) {
|
|
85
|
-
setTags([...tags, _value.slice(0, 16)]);
|
|
86
|
-
}
|
|
87
|
-
setInputVisible(false);
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
const handleEditInputConfirm = (e: any) => {
|
|
91
|
-
const _value = e.target.value.trim();
|
|
92
|
-
if (_value) {
|
|
93
|
-
const newTags = [...tags];
|
|
94
|
-
newTags[editInputIndex] = _value.slice(0, 16);
|
|
95
|
-
setTags(newTags);
|
|
96
|
-
setEditInputIndex(-1);
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
const tagPlusStyle: React.CSSProperties = {
|
|
101
|
-
height: 32,
|
|
102
|
-
background: token.colorBgContainer,
|
|
103
|
-
borderStyle: "dashed",
|
|
104
|
-
borderColor: "#D9D9D9",
|
|
105
|
-
padding: "0 15px",
|
|
106
|
-
lineHeight: "32px",
|
|
107
|
-
fontSize: FONT_SIZE,
|
|
108
|
-
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
const handleIptChange = debounce((e: React.ChangeEvent<HTMLInputElement>) => {
|
|
112
|
-
const _value = e.target.value.trim();
|
|
113
|
-
const editIpt = editInputRef.current;
|
|
114
|
-
if (_value.length >= 16 && editIpt && editIpt.input) {
|
|
115
|
-
message.warning("敏感词最多可输入16个字符!");
|
|
116
|
-
}
|
|
117
|
-
}, 300);
|
|
118
|
-
|
|
119
|
-
const getTextWidth = (
|
|
120
|
-
text: string,
|
|
121
|
-
fontSize = 12,
|
|
122
|
-
fontFamily = "PingFangSC,微软雅黑,Helvetic"
|
|
123
|
-
) => {
|
|
124
|
-
canvasContext.font = `${fontSize}px ${fontFamily}`;
|
|
125
|
-
return canvasContext.measureText(text).width;
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
const RenderRow = (props: any) => {
|
|
129
|
-
const { item } = props;
|
|
130
|
-
const { list } = item;
|
|
131
|
-
return (
|
|
132
|
-
<div className="mb-4">
|
|
133
|
-
{list && list.length
|
|
134
|
-
? list.map((i: any, index: number) => (
|
|
135
|
-
<span key={`tag_wrap_${index}`}>{renderTag(i)}</span>
|
|
136
|
-
))
|
|
137
|
-
: null}
|
|
138
|
-
</div>
|
|
139
|
-
);
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
const editTag = (label: string, idx: number) => (e: any) => {
|
|
143
|
-
if (disabled) return;
|
|
144
|
-
setEditInputIndex(idx);
|
|
145
|
-
setEditInitVal(label);
|
|
146
|
-
e.preventDefault();
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
const setEditIptWidth = () => {
|
|
150
|
-
const editIpt = editInputRef.current;
|
|
151
|
-
if (editIpt && editIpt.input) {
|
|
152
|
-
editIpt.input.style.width = `${getStrLenght(editIpt.input.value.slice(0, 16))}px`;
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
const setAddIptWidth = () => {
|
|
156
|
-
const addIpt = inputRef.current;
|
|
157
|
-
if (addIpt && addIpt.input) {
|
|
158
|
-
addIpt.input.style.width = `${getStrLenght(addIpt.input.value.slice(0, 16))}px`;
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
const editIptOnInput = debounce(setEditIptWidth, 200);
|
|
163
|
-
|
|
164
|
-
const addIptOnInput = debounce(setAddIptWidth, 200);
|
|
165
|
-
|
|
166
|
-
const renderTag = (tagData: any) => {
|
|
167
|
-
const { idx, label } = tagData;
|
|
168
|
-
return editInputIndex === idx ? (
|
|
169
|
-
<Input
|
|
170
|
-
ref={editInputRef}
|
|
171
|
-
key={`edit-ipt-${idx}`}
|
|
172
|
-
maxLength={16}
|
|
173
|
-
size="small"
|
|
174
|
-
style={tagInputStyle}
|
|
175
|
-
defaultValue={editInitVal}
|
|
176
|
-
onInput={editIptOnInput}
|
|
177
|
-
onBlur={handleEditInputConfirm}
|
|
178
|
-
onPressEnter={handleEditInputConfirm}
|
|
179
|
-
onChange={handleIptChange}
|
|
180
|
-
/>
|
|
181
|
-
) : label === ADD_TAG_TYPE ? (
|
|
182
|
-
inputVisible ? (
|
|
183
|
-
<Input
|
|
184
|
-
ref={inputRef}
|
|
185
|
-
type="text"
|
|
186
|
-
size="small"
|
|
187
|
-
maxLength={16}
|
|
188
|
-
style={tagInputStyle}
|
|
189
|
-
onInput={addIptOnInput}
|
|
190
|
-
onBlur={handleInputConfirm}
|
|
191
|
-
onPressEnter={handleInputConfirm}
|
|
192
|
-
onChange={handleIptChange}
|
|
193
|
-
/>
|
|
194
|
-
) : (
|
|
195
|
-
<Tag
|
|
196
|
-
icon={<Plus size={14} className="inline mr-[6px] mt-[-4px]" />}
|
|
197
|
-
color="processing"
|
|
198
|
-
style={tagPlusStyle}
|
|
199
|
-
onClick={showInput}
|
|
200
|
-
>
|
|
201
|
-
{addLabel || "添加"}
|
|
202
|
-
</Tag>
|
|
203
|
-
)
|
|
204
|
-
) : (
|
|
205
|
-
<Tag
|
|
206
|
-
key={`tag_${idx}`}
|
|
207
|
-
style={{
|
|
208
|
-
userSelect: "none",
|
|
209
|
-
height: "32px",
|
|
210
|
-
lineHeight: "30px",
|
|
211
|
-
padding: "0 15px",
|
|
212
|
-
fontSize: `${FONT_SIZE}px`,
|
|
213
|
-
background: "white",
|
|
214
|
-
borderColor: "#EBEBEB"
|
|
215
|
-
}}
|
|
216
|
-
closable={!disabled}
|
|
217
|
-
onClose={handleClose(label)}
|
|
218
|
-
// closeIcon={<X />}
|
|
219
|
-
>
|
|
220
|
-
<span onDoubleClick={editTag(label, idx)}>{label}</span>
|
|
221
|
-
</Tag>
|
|
222
|
-
);
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
const setContainerRect = () => {
|
|
226
|
-
if (wrapRef && wrapRef.current) {
|
|
227
|
-
const { height, width } = wrapRef.current.getBoundingClientRect();
|
|
228
|
-
setContainerHeight(height);
|
|
229
|
-
setContainerWidth(width);
|
|
230
|
-
}
|
|
231
|
-
};
|
|
232
|
-
|
|
233
|
-
const filterTags = useMemo(() => {
|
|
234
|
-
return (tags || []).concat(ADD_TAG_TYPE).filter((tag) => {
|
|
235
|
-
return fuzzyNameOrId ? tag.indexOf(fuzzyNameOrId) > -1 : true;
|
|
236
|
-
});
|
|
237
|
-
}, [tags, fuzzyNameOrId]);
|
|
238
|
-
|
|
239
|
-
useEffect(() => {
|
|
240
|
-
if (containerWidth && containerHeight && filterTags && filterTags.length) {
|
|
241
|
-
fixRenderData();
|
|
242
|
-
}
|
|
243
|
-
}, [filterTags, containerHeight, containerWidth]);
|
|
244
|
-
|
|
245
|
-
const resizeFn = debounce(() => {
|
|
246
|
-
setContainerRect();
|
|
247
|
-
}, 500);
|
|
248
|
-
|
|
249
|
-
useEffect(() => {
|
|
250
|
-
window.addEventListener("resize", resizeFn);
|
|
251
|
-
return () => {
|
|
252
|
-
window.removeEventListener("resize", resizeFn);
|
|
253
|
-
};
|
|
254
|
-
}, []);
|
|
255
|
-
|
|
256
|
-
useEffect(() => {
|
|
257
|
-
if (editInputIndex >= 0) {
|
|
258
|
-
setEditIptWidth();
|
|
259
|
-
setTimeout(() => {
|
|
260
|
-
editInputRef.current?.focus();
|
|
261
|
-
}, 100);
|
|
262
|
-
}
|
|
263
|
-
}, [editInputIndex]);
|
|
264
|
-
|
|
265
|
-
const fixRenderData = () => {
|
|
266
|
-
const _list: Array<any> = [];
|
|
267
|
-
let _row: Array<any> = [];
|
|
268
|
-
let len: number = 0;
|
|
269
|
-
const tagMargin = 18;
|
|
270
|
-
const fixWidth = 49 + tagMargin;
|
|
271
|
-
// console.log("fixRenderData", containerWidth)
|
|
272
|
-
filterTags.forEach((str: string, idx: number) => {
|
|
273
|
-
const _str = str.trim();
|
|
274
|
-
const strWidth = getTextWidth(_str);
|
|
275
|
-
const tagWidth = strWidth + fixWidth;
|
|
276
|
-
const obj = {
|
|
277
|
-
idx,
|
|
278
|
-
label: _str
|
|
279
|
-
};
|
|
280
|
-
if (len + tagWidth > containerWidth) {
|
|
281
|
-
_list.push({ idx, list: [..._row] });
|
|
282
|
-
_row = [{ ...obj }];
|
|
283
|
-
len = tagWidth;
|
|
284
|
-
} else {
|
|
285
|
-
len = len + tagWidth;
|
|
286
|
-
_row.push({ ...obj });
|
|
287
|
-
}
|
|
288
|
-
});
|
|
289
|
-
_list.push({ idx: _list.length + 1, list: [..._row] });
|
|
290
|
-
setVirtualList([..._list]);
|
|
291
|
-
};
|
|
292
|
-
|
|
293
|
-
const res = useMemo(() => {
|
|
294
|
-
return virtualList.length ? (
|
|
295
|
-
<VirtualWrap
|
|
296
|
-
list={virtualList}
|
|
297
|
-
itemHeight={22}
|
|
298
|
-
paddingY={12}
|
|
299
|
-
wrapPadding={32}
|
|
300
|
-
wrapperRef={wrapRef}
|
|
301
|
-
itemKey="idx"
|
|
302
|
-
>
|
|
303
|
-
<RenderRow />
|
|
304
|
-
</VirtualWrap>
|
|
305
|
-
) : null;
|
|
306
|
-
}, [virtualList, editInputIndex, inputVisible]);
|
|
307
|
-
|
|
308
|
-
return <>{res}</>;
|
|
309
|
-
};
|
|
310
|
-
|
|
311
|
-
export default AutoTag;
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Modal,
|
|
3
|
-
Form,
|
|
4
|
-
UploadProps,
|
|
5
|
-
UploadFile,
|
|
6
|
-
ConfigProvider,
|
|
7
|
-
message, Upload
|
|
8
|
-
} from "antd";
|
|
9
|
-
import { ReactNode, useEffect, useState } from "react";
|
|
10
|
-
import { Button, defaultTheme, type Styles } from '@mxmweb/zui';
|
|
11
|
-
const { Dragger } = Upload;
|
|
12
|
-
import warningLinear from "../../assets/img/warningLinear.png";
|
|
13
|
-
import upload from "../../assets/img/upload.png";
|
|
14
|
-
import File from "../../assets/img/file.png";
|
|
15
|
-
|
|
16
|
-
interface IEmpty {
|
|
17
|
-
isShowCreateModal: boolean;
|
|
18
|
-
closeModal: (isRefresh: boolean) => void;
|
|
19
|
-
uploadType?: string;
|
|
20
|
-
uploadEvents: (action: string, payload?: any) => void;
|
|
21
|
-
accept?: string;
|
|
22
|
-
children?: ReactNode;
|
|
23
|
-
footerChildren?: ReactNode;
|
|
24
|
-
title?: string | ReactNode;
|
|
25
|
-
// UploadFile: (id: string, formData: FormData) => void
|
|
26
|
-
multiple?: boolean;
|
|
27
|
-
subTitle?: string;
|
|
28
|
-
fileName?: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const UploadModal = (props: IEmpty) => {
|
|
32
|
-
const {
|
|
33
|
-
isShowCreateModal,
|
|
34
|
-
closeModal,
|
|
35
|
-
uploadEvents,
|
|
36
|
-
children,
|
|
37
|
-
accept = ".csv,.txt",
|
|
38
|
-
title,
|
|
39
|
-
// UploadFile,
|
|
40
|
-
multiple = true,
|
|
41
|
-
subTitle = "支持单次上传,支持 csv、txt格式。",
|
|
42
|
-
fileName = "file"
|
|
43
|
-
} = props;
|
|
44
|
-
const [createForm] = Form.useForm();
|
|
45
|
-
const [loading, setLoading] = useState(false);
|
|
46
|
-
|
|
47
|
-
const [fileList, setFileList]: any = useState<UploadFile[]>([]);
|
|
48
|
-
const modalStyles = {
|
|
49
|
-
header: {
|
|
50
|
-
padding: "20px 24px",
|
|
51
|
-
borderBottom: "1px solid #F0F0F0",
|
|
52
|
-
margin: 0
|
|
53
|
-
},
|
|
54
|
-
body: { padding: "16px 24px 20px 24px", borderBottom: "1px solid #F0F0F0" },
|
|
55
|
-
mask: {},
|
|
56
|
-
footer: { padding: "16px 24px", margin: 0 },
|
|
57
|
-
content: { padding: 0, borderRadius: "4px" }
|
|
58
|
-
};
|
|
59
|
-
const successFn = () => {
|
|
60
|
-
closeModal(false);
|
|
61
|
-
setLoading(false);
|
|
62
|
-
createForm.resetFields();
|
|
63
|
-
uploadEvents("uploaded");
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const handlerCancle = () => {
|
|
67
|
-
createForm.resetFields();
|
|
68
|
-
closeModal(false);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
const handleOk = async () => {
|
|
72
|
-
const formData = new FormData();
|
|
73
|
-
fileList.forEach((file: any) => {
|
|
74
|
-
formData.append(fileName, file);
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
setLoading(true);
|
|
78
|
-
uploadEvents("uploaded", formData);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
};
|
|
82
|
-
const upLoadProps: UploadProps = {
|
|
83
|
-
multiple,
|
|
84
|
-
fileList,
|
|
85
|
-
onRemove: (file) => {
|
|
86
|
-
setFileList((fileList: any) => {
|
|
87
|
-
const fileListIds = fileList.map((item: any) => item.uid);
|
|
88
|
-
const index = fileListIds.indexOf(file.uid);
|
|
89
|
-
const newFileList = fileList.slice();
|
|
90
|
-
newFileList.splice(index, 1);
|
|
91
|
-
return [...newFileList];
|
|
92
|
-
});
|
|
93
|
-
},
|
|
94
|
-
beforeUpload(file) {
|
|
95
|
-
if (fileList.length) {
|
|
96
|
-
message.warning("只能上传一个文件");
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
setFileList((fileList: any) => {
|
|
100
|
-
return [...fileList, file];
|
|
101
|
-
});
|
|
102
|
-
return false;
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
const renderFooter = () => {
|
|
107
|
-
return (
|
|
108
|
-
<div className="flex justify-end gap-3">
|
|
109
|
-
<Button
|
|
110
|
-
label="取消"
|
|
111
|
-
onClick={handlerCancle}
|
|
112
|
-
/>
|
|
113
|
-
<Button
|
|
114
|
-
mode="primary"
|
|
115
|
-
label="确认"
|
|
116
|
-
loading={loading}
|
|
117
|
-
onClick={handleOk}
|
|
118
|
-
/>
|
|
119
|
-
</div>
|
|
120
|
-
);
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
useEffect(() => {
|
|
124
|
-
if (!isShowCreateModal) {
|
|
125
|
-
setFileList([]);
|
|
126
|
-
}
|
|
127
|
-
}, [isShowCreateModal]);
|
|
128
|
-
|
|
129
|
-
return (
|
|
130
|
-
<ConfigProvider
|
|
131
|
-
modal={{
|
|
132
|
-
styles: modalStyles
|
|
133
|
-
}}
|
|
134
|
-
>
|
|
135
|
-
<Modal
|
|
136
|
-
title={title || "上传文件"}
|
|
137
|
-
open={isShowCreateModal}
|
|
138
|
-
footer={renderFooter}
|
|
139
|
-
onCancel={handlerCancle}
|
|
140
|
-
width={650}
|
|
141
|
-
>
|
|
142
|
-
<div className="">
|
|
143
|
-
<div className="h-[44px] bg-[#E6F4FF] flex items-center px-[12px] mb-[10px] rounded-[4px] justify-between">
|
|
144
|
-
<div className="flex items-center">
|
|
145
|
-
<img
|
|
146
|
-
src={warningLinear}
|
|
147
|
-
width={24}
|
|
148
|
-
height={24}
|
|
149
|
-
className="mr-[8px]"
|
|
150
|
-
/>
|
|
151
|
-
<div className="text-text-color1">先下载模板后上传</div>
|
|
152
|
-
</div>
|
|
153
|
-
{children}
|
|
154
|
-
</div>
|
|
155
|
-
<Dragger
|
|
156
|
-
{...upLoadProps}
|
|
157
|
-
accept={accept}
|
|
158
|
-
iconRender={() => {
|
|
159
|
-
return <img src={File} width={12} height={12} />;
|
|
160
|
-
}}
|
|
161
|
-
style={{ backgroundColor: "#F9FAFC", borderColor: "#D9D9D9" }}
|
|
162
|
-
>
|
|
163
|
-
<div className="flex flex-col items-center">
|
|
164
|
-
<img src={upload} width={48} height={48} />
|
|
165
|
-
<p className="mt-[12px] text-[14px] text-text-color1 mb-[4px]">
|
|
166
|
-
点击或将文件拖拽到此处上传
|
|
167
|
-
</p>
|
|
168
|
-
<span style={{ color: "#999", fontSize: "12px", fontWeight: 400 }}>
|
|
169
|
-
{subTitle}
|
|
170
|
-
</span>
|
|
171
|
-
</div>
|
|
172
|
-
|
|
173
|
-
</Dragger>
|
|
174
|
-
</div>
|
|
175
|
-
<div className="btn-group"></div>
|
|
176
|
-
</Modal>
|
|
177
|
-
</ConfigProvider>
|
|
178
|
-
);
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
export default UploadModal;
|