@gientech/modual 1.3.3 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +129 -129
- package/{dist/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}/defaultWeLogo.svg +14 -14
- package/{dist/assets/index-mPgEc8KC.js → assets/index-CDNF071H.js} +38 -38
- package/{dist/assets/index-XvC_4jDB.js → assets/index-Ce4td48i.js} +20 -20
- package/{dist/assets → assets}/mysql.svg +14 -14
- package/{dist/chat.js → chat.js} +2 -2
- package/database.js +20 -0
- package/{dist/databaseId.js → databaseId.js} +1 -1
- package/{dist/databaseTable.js → databaseTable.js} +1 -1
- package/{dist/modelManage.js → modelManage.js} +1 -1
- package/package.json +39 -83
- package/{dist/sensitive.js → sensitive.js} +1 -1
- package/{dist/streamFilesReader.js → streamFilesReader.js} +10 -10
- package/{dist/worker → worker}/pdf.worker.min.js +21 -21
- package/.editorconfig +0 -38
- package/.prettierignore +0 -16
- package/.prettierrc +0 -17
- package/USAGE.md +0 -191
- package/bash.exe.stackdump +0 -40
- package/components.json +0 -21
- package/dist/README.md +0 -129
- package/dist/assets/database_add.svg +0 -53
- package/dist/database.js +0 -20
- package/dist/package.json +0 -56
- package/doc_assets/2.png +0 -0
- package/doc_assets/demo.md +0 -27
- package/doc_assets/demos/dist-app/assets/index.Dh-ZAS9Z.css +0 -2
- package/doc_assets/demos/dist-app/assets/index.Dv8KVW18.js +0 -23699
- package/doc_assets/demos/dist-app/assets/index.Dv8KVW18.js.map +0 -1
- package/doc_assets/demos/dist-app/index.html +0 -14
- package/doc_assets/demos/dist-app/vite.svg +0 -1
- 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/install.md +0 -5
- package/eslint.config.js +0 -92
- package/index.html +0 -13
- package/postcss.config.cjs +0 -19
- package/public/vite.svg +0 -1
- package/public/worker/pdf.worker.min.js +0 -22
- package/scripts/README.md +0 -133
- package/scripts/build-demo.js +0 -88
- package/scripts/demo-selector.js +0 -216
- package/scripts/dev-demo.js +0 -76
- package/scripts/preview-demo.js +0 -130
- package/scripts/run-demo.bat +0 -34
- package/src/assets/img/downArrow.png +0 -0
- package/src/assets/img/excel.png +0 -0
- package/src/assets/img/img.png +0 -0
- package/src/assets/img/pdf.png +0 -0
- package/src/assets/img/ppt.png +0 -0
- package/src/assets/img/txt.png +0 -0
- package/src/assets/img/word.png +0 -0
- package/src/assets/login/homeBg.png +0 -0
- package/src/assets/login/left.jpg +0 -0
- package/src/assets/login/logoImg.png +0 -0
- package/src/examples/LoginPage/index.tsx +0 -18
- package/src/examples/aaa/index.tsx +0 -3758
- package/src/examples/chat/components/DrawerGraphPreview.tsx +0 -78
- package/src/examples/chat/index.tsx +0 -190
- package/src/examples/gientechStreamFilesReader/index.tsx +0 -1016
- package/src/examples/ragDatabaseDataPage/index.tsx +0 -36
- package/src/examples/ragDatabaseIdPage/index.tsx +0 -44
- package/src/examples/ragDatabasePage/index.tsx +0 -36
- package/src/examples/ragModelManagePage/index.tsx +0 -37
- package/src/examples/ragSearchPage/index.tsx +0 -0
- package/src/examples/ragSensitiveWordsPage/index.tsx +0 -32
- package/src/examples/streamFiles/index.tsx +0 -384
- package/src/lib_enter.ts +0 -38
- package/src/main.tsx +0 -5
- package/src/main.tsx.backup +0 -5
- package/src/modules/chat/Conversations/Item.tsx +0 -167
- package/src/modules/chat/Conversations/List.tsx +0 -143
- package/src/modules/chat/Conversations/groupByTime.ts +0 -39
- package/src/modules/chat/Conversations/index.tsx +0 -212
- package/src/modules/chat/constants.tsx +0 -33
- package/src/modules/chat/data.txt +0 -82
- package/src/modules/chat/index.tsx +0 -1908
- package/src/modules/chat/types.ts +0 -17
- package/src/modules/database/CreateModal.tsx +0 -398
- 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 +0 -11
- 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/assets/mysql.svg +0 -14
- package/src/modules/database/index.tsx +0 -466
- package/src/modules/database/server.ts +0 -196
- package/src/modules/databaseId/CustomCom.tsx +0 -156
- package/src/modules/databaseId/EditConfig.tsx +0 -268
- package/src/modules/databaseId/UploadDrawer.tsx +0 -520
- 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/index.tsx +0 -734
- package/src/modules/databaseId/server.ts +0 -286
- package/src/modules/databaseId/style.css +0 -5
- package/src/modules/databaseTable/EditRowDrawer.tsx +0 -119
- package/src/modules/databaseTable/index.tsx +0 -357
- package/src/modules/databaseTable/server.ts +0 -180
- package/src/modules/headlessChat/constants.tsx +0 -32
- package/src/modules/headlessChat/index.tsx +0 -1065
- package/src/modules/headlessChat/types.ts +0 -23
- package/src/modules/login/components/Login/LoginBox/index.tsx +0 -102
- package/src/modules/login/components/Login/RegisterBox/index.tsx +0 -180
- package/src/modules/login/components/Login/index.tsx +0 -100
- package/src/modules/login/index.tsx +0 -106
- 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 -249
- package/src/modules/modelManage/assets/empty.png +0 -0
- package/src/modules/modelManage/const.ts +0 -50
- package/src/modules/modelManage/index.tsx +0 -439
- package/src/modules/modelManage/server.ts +0 -185
- 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/index.tsx +0 -313
- package/src/modules/sensitive/server.ts +0 -122
- package/src/modules/streamFilesReader/GientechStreamReader.tsx +0 -1555
- 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 -111
- 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 -310
- package/src/utils/gientechCommon/components/FileCardCommon.tsx +0 -82
- package/src/utils/gientechCommon/components/FileManager/index.tsx +0 -390
- package/src/utils/gientechCommon/components/FileManager/style.css +0 -5
- package/src/utils/gientechCommon/components/Messages/GientechNewChatWelcome.tsx +0 -296
- package/src/utils/gientechCommon/components/Messages/ReferenceCard.tsx +0 -339
- 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 -345
- 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/request.ts +0 -37
- package/src/utils/gientechCommon/utils/serverFn.ts +0 -172
- package/src/utils/index.tsx +0 -126
- package/src/utils/testconfigs/demologin/index.tsx +0 -32
- package/src/utils/testconfigs/index.ts +0 -53
- package/src/vite-env.d.ts +0 -11
- package/stats.html +0 -4949
- package/tailwind.config.js +0 -170
- package/tsconfig.app.json +0 -30
- package/tsconfig.app.tsbuildinfo +0 -11
- package/tsconfig.json +0 -13
- package/tsconfig.node.json +0 -22
- package/tsconfig.node.tsbuildinfo +0 -1
- package/vite.config.ts +0 -177
- package/workflows/release.yml +0 -60
- /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}/_commonjsHelpers-gnU0ypJ3.js +0 -0
- /package/{dist/assets → assets}/circle-alert-g2Y6zAjt.js +0 -0
- /package/{dist/assets → assets}/empty.png +0 -0
- /package/{dist/assets → assets}/index-CEK88UzR.js +0 -0
- /package/{dist/assets → assets}/index-CpW6Dhpp.js +0 -0
- /package/{dist/assets → assets}/plus-omCUN0e3.js +0 -0
- /package/{dist/assets → assets}/style.css +0 -0
- /package/{dist/assets → assets}/style2.css +0 -0
- /package/{dist/assets → assets}/style3.css +0 -0
- /package/{dist/assets → assets}/styled-components.browser.esm-DPkS13KC.js +0 -0
- /package/{dist/assets → assets}/x-vPcWt3fC.js +0 -0
- /package/{dist/chat.d.ts → chat.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/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
package/.editorconfig
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# EditorConfig is awesome: https://EditorConfig.org
|
|
2
|
-
|
|
3
|
-
# top-most EditorConfig file
|
|
4
|
-
root = true
|
|
5
|
-
|
|
6
|
-
# Unix-style newlines with a newline ending every file
|
|
7
|
-
[*]
|
|
8
|
-
end_of_line = lf
|
|
9
|
-
insert_final_newline = true
|
|
10
|
-
charset = utf-8
|
|
11
|
-
trim_trailing_whitespace = true
|
|
12
|
-
|
|
13
|
-
# TypeScript and JavaScript files
|
|
14
|
-
[*.{ts,tsx,js,jsx}]
|
|
15
|
-
indent_style = space
|
|
16
|
-
indent_size = 2
|
|
17
|
-
quote_type = single
|
|
18
|
-
max_line_length = 100
|
|
19
|
-
|
|
20
|
-
# CSS files
|
|
21
|
-
[*.css]
|
|
22
|
-
indent_style = space
|
|
23
|
-
indent_size = 2
|
|
24
|
-
|
|
25
|
-
# Markdown files
|
|
26
|
-
[*.md]
|
|
27
|
-
trim_trailing_whitespace = false
|
|
28
|
-
max_line_length = off
|
|
29
|
-
|
|
30
|
-
# JSON files
|
|
31
|
-
[*.json]
|
|
32
|
-
indent_style = space
|
|
33
|
-
indent_size = 2
|
|
34
|
-
|
|
35
|
-
# YAML files
|
|
36
|
-
[*.{yml,yaml}]
|
|
37
|
-
indent_style = space
|
|
38
|
-
indent_size = 2
|
package/.prettierignore
DELETED
package/.prettierrc
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"semi": true,
|
|
3
|
-
"singleQuote": true,
|
|
4
|
-
"tabWidth": 2,
|
|
5
|
-
"printWidth": 100,
|
|
6
|
-
"trailingComma": "es5",
|
|
7
|
-
"bracketSpacing": true,
|
|
8
|
-
"arrowParens": "avoid",
|
|
9
|
-
"endOfLine": "lf",
|
|
10
|
-
"jsxSingleQuote": false,
|
|
11
|
-
"quoteProps": "as-needed",
|
|
12
|
-
"useTabs": false,
|
|
13
|
-
"htmlWhitespaceSensitivity": "css",
|
|
14
|
-
"embeddedLanguageFormatting": "auto",
|
|
15
|
-
"singleAttributePerLine": false,
|
|
16
|
-
"bracketSameLine": false
|
|
17
|
-
}
|
package/USAGE.md
DELETED
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
# Gientech 多模块使用指南
|
|
2
|
-
|
|
3
|
-
## 安装
|
|
4
|
-
|
|
5
|
-
### 方式一:npm 安装
|
|
6
|
-
```bash
|
|
7
|
-
npm install @gientech/modual
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
### 方式二:本地安装
|
|
11
|
-
```bash
|
|
12
|
-
npm install /path/to/gientech/dist
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## 使用方式
|
|
16
|
-
|
|
17
|
-
### 1. Chat 聊天模块
|
|
18
|
-
|
|
19
|
-
```javascript
|
|
20
|
-
// 导入 chat 模块
|
|
21
|
-
import { GientechChat } from '@gientech/modual/chat';
|
|
22
|
-
|
|
23
|
-
// 在 React 组件中使用
|
|
24
|
-
function App() {
|
|
25
|
-
return (
|
|
26
|
-
<div>
|
|
27
|
-
<GientechChat
|
|
28
|
-
config={{
|
|
29
|
-
apiUrl: 'https://your-api.com',
|
|
30
|
-
token: 'your-token'
|
|
31
|
-
}}
|
|
32
|
-
// 其他配置...
|
|
33
|
-
/>
|
|
34
|
-
</div>
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### 2. Database 数据库模块
|
|
40
|
-
|
|
41
|
-
```javascript
|
|
42
|
-
import { GientechDatabase } from '@gientech/modual/database';
|
|
43
|
-
|
|
44
|
-
function DatabasePage() {
|
|
45
|
-
return (
|
|
46
|
-
<GientechDatabase
|
|
47
|
-
config={{
|
|
48
|
-
apiUrl: 'https://your-api.com',
|
|
49
|
-
token: 'your-token'
|
|
50
|
-
}}
|
|
51
|
-
/>
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### 3. DatabaseTable 数据库表格模块
|
|
57
|
-
|
|
58
|
-
```javascript
|
|
59
|
-
import { GientechDatabaseTable } from '@gientech/modual/databaseTable';
|
|
60
|
-
|
|
61
|
-
function TablePage() {
|
|
62
|
-
return (
|
|
63
|
-
<GientechDatabaseTable
|
|
64
|
-
config={{
|
|
65
|
-
apiUrl: 'https://your-api.com',
|
|
66
|
-
token: 'your-token'
|
|
67
|
-
}}
|
|
68
|
-
/>
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### 4. HeadlessChat 无头聊天模块
|
|
74
|
-
|
|
75
|
-
```javascript
|
|
76
|
-
import { GientechHeadlessChat } from '@gientech/modual/headlessChat';
|
|
77
|
-
|
|
78
|
-
function HeadlessChatPage() {
|
|
79
|
-
return (
|
|
80
|
-
<GientechHeadlessChat
|
|
81
|
-
config={{
|
|
82
|
-
apiUrl: 'https://your-api.com',
|
|
83
|
-
token: 'your-token'
|
|
84
|
-
}}
|
|
85
|
-
/>
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### 5. Login 登录模块
|
|
91
|
-
|
|
92
|
-
```javascript
|
|
93
|
-
import { GientechLogin } from '@gientech/modual/login';
|
|
94
|
-
|
|
95
|
-
function LoginPage() {
|
|
96
|
-
return (
|
|
97
|
-
<GientechLogin
|
|
98
|
-
config={{
|
|
99
|
-
apiUrl: 'https://your-api.com',
|
|
100
|
-
token: 'your-token'
|
|
101
|
-
}}
|
|
102
|
-
/>
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
### 6. Search 搜索模块
|
|
108
|
-
|
|
109
|
-
```javascript
|
|
110
|
-
import { KnowledgeSearch } from '@gientech/modual/search';
|
|
111
|
-
|
|
112
|
-
function SearchPage() {
|
|
113
|
-
return (
|
|
114
|
-
<KnowledgeSearch
|
|
115
|
-
config={{
|
|
116
|
-
apiUrl: 'https://your-api.com',
|
|
117
|
-
token: 'your-token'
|
|
118
|
-
}}
|
|
119
|
-
/>
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
## 样式引入
|
|
125
|
-
|
|
126
|
-
```javascript
|
|
127
|
-
// 引入样式
|
|
128
|
-
import '@gientech/modual/style.css';
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
## 在 HTML 中直接使用
|
|
132
|
-
|
|
133
|
-
```html
|
|
134
|
-
<!DOCTYPE html>
|
|
135
|
-
<html>
|
|
136
|
-
<head>
|
|
137
|
-
<meta charset="UTF-8">
|
|
138
|
-
<title>Gientech Demo</title>
|
|
139
|
-
<!-- 引入样式 -->
|
|
140
|
-
<link rel="stylesheet" href="./node_modules/@gientech/modual/style.css">
|
|
141
|
-
</head>
|
|
142
|
-
<body>
|
|
143
|
-
<div id="app"></div>
|
|
144
|
-
|
|
145
|
-
<!-- 引入 React 和相关依赖 -->
|
|
146
|
-
<script src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
|
|
147
|
-
<script src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
|
|
148
|
-
<script src="https://unpkg.com/antd@5/dist/antd.min.js"></script>
|
|
149
|
-
|
|
150
|
-
<!-- 引入模块 -->
|
|
151
|
-
<script type="module">
|
|
152
|
-
import { GientechChat } from './node_modules/@gientech/modual/chat.js';
|
|
153
|
-
|
|
154
|
-
// 渲染组件
|
|
155
|
-
const root = ReactDOM.createRoot(document.getElementById('app'));
|
|
156
|
-
root.render(React.createElement(GientechChat, {
|
|
157
|
-
config: {
|
|
158
|
-
apiUrl: 'https://your-api.com',
|
|
159
|
-
token: 'your-token'
|
|
160
|
-
}
|
|
161
|
-
}));
|
|
162
|
-
</script>
|
|
163
|
-
</body>
|
|
164
|
-
</html>
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
## 依赖要求
|
|
168
|
-
|
|
169
|
-
确保项目中已安装以下依赖:
|
|
170
|
-
|
|
171
|
-
```json
|
|
172
|
-
{
|
|
173
|
-
"dependencies": {
|
|
174
|
-
"react": "^18.0.0",
|
|
175
|
-
"react-dom": "^18.0.0",
|
|
176
|
-
"antd": "^5.0.0",
|
|
177
|
-
"@mxmweb/xviewer": "*",
|
|
178
|
-
"@mxmweb/fviewer": "*",
|
|
179
|
-
"@mxmweb/rtext": "*",
|
|
180
|
-
"@mxmweb/zui": "*",
|
|
181
|
-
"@mxmweb/aichat": "*"
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
## 注意事项
|
|
187
|
-
|
|
188
|
-
1. 每个模块都是独立的,可以按需引入
|
|
189
|
-
2. 所有模块都需要相应的依赖包
|
|
190
|
-
3. 确保 API 配置正确
|
|
191
|
-
4. 样式文件需要单独引入
|
package/bash.exe.stackdump
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
Stack trace:
|
|
2
|
-
Frame Function Args
|
|
3
|
-
0007FFFFCD30 00021006118E (0002102A6010, 000210272B51, 000000000063, 0007FFFFB660) msys-2.0.dll+0x2118E
|
|
4
|
-
0007FFFFCD30 0002100469BA (0007FFFFC710, 000200000000, 000700000000, 000700000001) msys-2.0.dll+0x69BA
|
|
5
|
-
0007FFFFCD30 0002100469F2 (000000000000, 000000000000, 000000000063, 000700000003) msys-2.0.dll+0x69F2
|
|
6
|
-
0007FFFFCD30 000210101D21 (000210177B53, 000800007798, 000000000000, 0002102752E0) msys-2.0.dll+0xC1D21
|
|
7
|
-
0007FFFFCD30 000210101D39 (0002101779A0, 0003000000FF, 000000000006, 0007FFFFC890) msys-2.0.dll+0xC1D39
|
|
8
|
-
0007FFFFCD30 000210104704 (0007FFFFCD30, 000000000000, 0007FFFFC890, 0002102752E0) msys-2.0.dll+0xC4704
|
|
9
|
-
0007FFFFCD30 000210059095 (000000000004, 000000000004, 0007FFFFC9E8, 0000FFFFFFFF) msys-2.0.dll+0x19095
|
|
10
|
-
0007FFFFCD30 000210059865 (000210070B52, 00021024CB20, 000800004540, 000000000030) msys-2.0.dll+0x19865
|
|
11
|
-
0007FFFFCD30 000210059D77 (00021017DB25, 000000000000, 000000000000, 000000000000) msys-2.0.dll+0x19D77
|
|
12
|
-
0007FFFFCD30 00021005A0B6 (0002100CB9A0, 000000000000, FFFFFFFFFFFFFF43, 000200000000) msys-2.0.dll+0x1A0B6
|
|
13
|
-
0007FFFFCD30 000210047151 (000000000000, 000000000000, 000000000000, 000000000000) msys-2.0.dll+0x7151
|
|
14
|
-
0007FFFFFFF0 000210045C86 (000000000000, 000000000000, 000000000000, 000000000000) msys-2.0.dll+0x5C86
|
|
15
|
-
0007FFFFFFF0 000210045D34 (000000000000, 000000000000, 000000000000, 000000000000) msys-2.0.dll+0x5D34
|
|
16
|
-
End of stack trace
|
|
17
|
-
Loaded modules:
|
|
18
|
-
000100400000 bash.exe
|
|
19
|
-
7FFD10F50000 ntdll.dll
|
|
20
|
-
7FFD0FA20000 KERNEL32.DLL
|
|
21
|
-
7FFD0E710000 KERNELBASE.dll
|
|
22
|
-
7FFD10800000 USER32.dll
|
|
23
|
-
7FFD0EB80000 win32u.dll
|
|
24
|
-
7FFD10370000 GDI32.dll
|
|
25
|
-
7FFD0E220000 gdi32full.dll
|
|
26
|
-
000210040000 msys-2.0.dll
|
|
27
|
-
7FFD0EBB0000 msvcp_win.dll
|
|
28
|
-
7FFD0E5F0000 ucrtbase.dll
|
|
29
|
-
7FFD0F630000 advapi32.dll
|
|
30
|
-
7FFD10430000 msvcrt.dll
|
|
31
|
-
7FFD0F350000 sechost.dll
|
|
32
|
-
7FFD0EAD0000 bcrypt.dll
|
|
33
|
-
7FFD104E0000 RPCRT4.dll
|
|
34
|
-
7FFD0DA20000 CRYPTBASE.DLL
|
|
35
|
-
7FFD0EB00000 bcryptPrimitives.dll
|
|
36
|
-
7FFD0F5F0000 IMM32.DLL
|
|
37
|
-
7FFD02F20000 netapi32.dll
|
|
38
|
-
7FFCFB7A0000 SAMCLI.DLL
|
|
39
|
-
7FFD05410000 SAMLIB.dll
|
|
40
|
-
7FFD0CD40000 NETUTILS.DLL
|
package/components.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
-
"style": "new-york",
|
|
4
|
-
"rsc": false,
|
|
5
|
-
"tsx": true,
|
|
6
|
-
"tailwind": {
|
|
7
|
-
"config": "tailwind.config.js",
|
|
8
|
-
"css": "src/style.css",
|
|
9
|
-
"baseColor": "slate",
|
|
10
|
-
"cssVariables": false,
|
|
11
|
-
"prefix": ""
|
|
12
|
-
},
|
|
13
|
-
"aliases": {
|
|
14
|
-
"components": "@/components",
|
|
15
|
-
"utils": "@/components/shadcn/utils",
|
|
16
|
-
"ui": "@/components/shadcn/ui",
|
|
17
|
-
"lib": "@/components/shadcn/lib",
|
|
18
|
-
"hooks": "@/components/shadcn/hooks"
|
|
19
|
-
},
|
|
20
|
-
"iconLibrary": "lucide"
|
|
21
|
-
}
|
package/dist/README.md
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
# @mxmweb工具库开发环境说明文档
|
|
2
|
-
|
|
3
|
-
一个用于快速初始化项目的工具库,提供了一系列常用的工具函数和组件。
|
|
4
|
-
|
|
5
|
-
## 特性
|
|
6
|
-
|
|
7
|
-
- 🚀 快速初始化项目
|
|
8
|
-
- 📦 自动配置开发环境
|
|
9
|
-
- 🛠 提供常用工具函数
|
|
10
|
-
- 🎨 内置 UI 组件
|
|
11
|
-
- 📝 TypeScript 支持
|
|
12
|
-
- 🔧 可配置性强
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
## 开发指南
|
|
17
|
-
|
|
18
|
-
### 环境要求
|
|
19
|
-
|
|
20
|
-
- Node.js >= 18
|
|
21
|
-
- pnpm >= 8
|
|
22
|
-
|
|
23
|
-
### 本地开发
|
|
24
|
-
|
|
25
|
-
1. 克隆仓库
|
|
26
|
-
```bash
|
|
27
|
-
git clone https://github.com/your-username/mxmweb.git
|
|
28
|
-
cd mxmweb/apps/init
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
2. 安装依赖
|
|
32
|
-
```bash
|
|
33
|
-
pnpm install
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
3. 启动开发服务器
|
|
37
|
-
```bash
|
|
38
|
-
pnpm dev 启动全部工程
|
|
39
|
-
pnpm --filter @mxmweb/fileviewer dev 启动指定开发工程
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
### 构建
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
pnpm build
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### 代码规范
|
|
49
|
-
|
|
50
|
-
- 使用 TypeScript 编写代码
|
|
51
|
-
- 遵循 ESLint 和 Prettier 配置
|
|
52
|
-
- 使用 EditorConfig 保持一致的代码风格
|
|
53
|
-
- 编写清晰的提交信息,遵循 [Conventional Commits](https://www.conventionalcommits.org/)
|
|
54
|
-
|
|
55
|
-
### 提交规范
|
|
56
|
-
|
|
57
|
-
提交信息应该遵循以下格式:
|
|
58
|
-
|
|
59
|
-
```
|
|
60
|
-
<type>(<scope>): <subject>
|
|
61
|
-
|
|
62
|
-
<body>
|
|
63
|
-
|
|
64
|
-
<footer>
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
类型(type):
|
|
68
|
-
- feat: 新功能
|
|
69
|
-
- fix: 修复
|
|
70
|
-
- docs: 文档
|
|
71
|
-
- style: 格式
|
|
72
|
-
- refactor: 重构
|
|
73
|
-
- test: 测试
|
|
74
|
-
- chore: 构建过程或辅助工具的变动
|
|
75
|
-
|
|
76
|
-
### 发布流程
|
|
77
|
-
|
|
78
|
-
1. 确保代码已经提交并推送到 main 分支
|
|
79
|
-
2. 运行发布命令:
|
|
80
|
-
```bash
|
|
81
|
-
pnpm release
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
3. 或者使用预发布测试:
|
|
85
|
-
```bash
|
|
86
|
-
pnpm release:dry
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### GitHub Actions 配置
|
|
90
|
-
|
|
91
|
-
1. 在 GitHub 仓库设置中添加以下 Secrets:
|
|
92
|
-
- `NPM_TOKEN`: npm 发布令牌
|
|
93
|
-
- `GITHUB_TOKEN`: GitHub 令牌(自动提供)
|
|
94
|
-
|
|
95
|
-
2. 确保仓库设置中启用了 Actions:
|
|
96
|
-
- 进入仓库的 Settings > Actions > General
|
|
97
|
-
- 在 "Actions permissions" 中选择 "Allow all actions and reusable workflows"
|
|
98
|
-
|
|
99
|
-
3. 推送代码到 main 分支,Actions 将自动运行:
|
|
100
|
-
- 安装依赖
|
|
101
|
-
- 构建项目
|
|
102
|
-
- 运行测试
|
|
103
|
-
- 发布到 npm
|
|
104
|
-
- 创建 GitHub Release
|
|
105
|
-
- 更新 CHANGELOG.md
|
|
106
|
-
|
|
107
|
-
## 目录结构
|
|
108
|
-
|
|
109
|
-
```
|
|
110
|
-
src/
|
|
111
|
-
├── application/ # 应用入口
|
|
112
|
-
├── components/ # UI 组件
|
|
113
|
-
├── hooks/ # React Hooks
|
|
114
|
-
├── utils/ # 工具函数
|
|
115
|
-
└── types/ # 类型定义
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
## 贡献指南
|
|
119
|
-
|
|
120
|
-
欢迎提交 Pull Request 或创建 Issue。在提交代码前,请确保:
|
|
121
|
-
|
|
122
|
-
1. 代码符合项目规范
|
|
123
|
-
2. 添加了必要的测试
|
|
124
|
-
3. 更新了相关文档
|
|
125
|
-
4. 提交信息符合规范
|
|
126
|
-
|
|
127
|
-
## 许可证
|
|
128
|
-
|
|
129
|
-
MIT
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M14 12C14 10.8954 14.8954 10 16 10H29C31.2091 10 33 11.7909 33 14V26C33 30.4183 29.4183 34 25 34H16C14.8954 34 14 33.1046 14 32V12Z" fill="url(#paint0_linear_4121_5043)"/>
|
|
3
|
-
<foreignObject x="-1" y="-1" width="32" height="36"><div xmlns="http://www.w3.org/1999/xhtml" style="backdrop-filter:blur(2px);clip-path:url(#bgblur_0_4121_5043_clip_path);height:100%;width:100%"></div></foreignObject><g data-figma-bg-blur-radius="4">
|
|
4
|
-
<path d="M3 7C3 4.79086 4.79086 3 7 3H23C25.2091 3 27 4.79086 27 7V19C27 25.6274 21.6274 31 15 31H7C4.79086 31 3 29.2091 3 27V7Z" fill="white" fill-opacity="0.46"/>
|
|
5
|
-
<path d="M7 3.25H23C25.0711 3.25 26.75 4.92893 26.75 7V19C26.75 25.4893 21.4893 30.75 15 30.75H7C4.92893 30.75 3.25 29.0711 3.25 27V7C3.25 4.92893 4.92893 3.25 7 3.25Z" stroke="white" stroke-opacity="0.34" stroke-width="0.5"/>
|
|
6
|
-
</g>
|
|
7
|
-
<g filter="url(#filter1_d_4121_5043)">
|
|
8
|
-
<path d="M8 10H21" stroke="white" stroke-width="2" stroke-linecap="round"/>
|
|
9
|
-
</g>
|
|
10
|
-
<g filter="url(#filter2_d_4121_5043)">
|
|
11
|
-
<path d="M8 16H21" stroke="white" stroke-width="2" stroke-linecap="round"/>
|
|
12
|
-
</g>
|
|
13
|
-
<g filter="url(#filter3_d_4121_5043)">
|
|
14
|
-
<path d="M8 22H18" stroke="white" stroke-width="2" stroke-linecap="round"/>
|
|
15
|
-
</g>
|
|
16
|
-
<defs>
|
|
17
|
-
<clipPath id="bgblur_0_4121_5043_clip_path" transform="translate(1 1)"><path d="M3 7C3 4.79086 4.79086 3 7 3H23C25.2091 3 27 4.79086 27 7V19C27 25.6274 21.6274 31 15 31H7C4.79086 31 3 29.2091 3 27V7Z"/>
|
|
18
|
-
</clipPath><filter id="filter1_d_4121_5043" x="3" y="5" width="23" height="10" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
19
|
-
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
20
|
-
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
|
21
|
-
<feOffset/>
|
|
22
|
-
<feGaussianBlur stdDeviation="2"/>
|
|
23
|
-
<feComposite in2="hardAlpha" operator="out"/>
|
|
24
|
-
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0.396078 0 0 0 0 0.984314 0 0 0 0.4 0"/>
|
|
25
|
-
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4121_5043"/>
|
|
26
|
-
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4121_5043" result="shape"/>
|
|
27
|
-
</filter>
|
|
28
|
-
<filter id="filter2_d_4121_5043" x="3" y="11" width="23" height="10" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
29
|
-
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
30
|
-
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
|
31
|
-
<feOffset/>
|
|
32
|
-
<feGaussianBlur stdDeviation="2"/>
|
|
33
|
-
<feComposite in2="hardAlpha" operator="out"/>
|
|
34
|
-
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0.396078 0 0 0 0 0.984314 0 0 0 0.4 0"/>
|
|
35
|
-
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4121_5043"/>
|
|
36
|
-
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4121_5043" result="shape"/>
|
|
37
|
-
</filter>
|
|
38
|
-
<filter id="filter3_d_4121_5043" x="3" y="17" width="20" height="10" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
39
|
-
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
40
|
-
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
|
41
|
-
<feOffset/>
|
|
42
|
-
<feGaussianBlur stdDeviation="2"/>
|
|
43
|
-
<feComposite in2="hardAlpha" operator="out"/>
|
|
44
|
-
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0.396078 0 0 0 0 0.984314 0 0 0 0.4 0"/>
|
|
45
|
-
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_4121_5043"/>
|
|
46
|
-
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_4121_5043" result="shape"/>
|
|
47
|
-
</filter>
|
|
48
|
-
<linearGradient id="paint0_linear_4121_5043" x1="23.5" y1="10" x2="23.5" y2="34" gradientUnits="userSpaceOnUse">
|
|
49
|
-
<stop stop-color="#64A0FD"/>
|
|
50
|
-
<stop offset="1" stop-color="#015AFF"/>
|
|
51
|
-
</linearGradient>
|
|
52
|
-
</defs>
|
|
53
|
-
</svg>
|
package/dist/database.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{jsxs as L,jsx as n,Fragment as de}from"react/jsx-runtime";import{useState as F,useMemo as W,useRef as q,useEffect as De}from"react";import{k as $,J,i as me,m as be}from"./assets/index-mPgEc8KC.js";import"./assets/index-CEK88UzR.js";import{d as ye}from"./assets/styled-components.browser.esm-DPkS13KC.js";import{Modal as K,Tooltip as Fe,message as R}from"antd";import Ie from"axios";/* empty css */import"react-dom";import"./assets/circle-alert-g2Y6zAjt.js";const Ee=({url:m,token:v,role:B,eventsEmit:E})=>{const c=Ie.create({baseURL:m,timeout:1e6});return c.interceptors.request.use(e=>{let t=v;return!t&&!["user/login","user/kaptcha","user/regist"].some(u=>e.url.includes(u))?(E&&E("request:error_auth",{errorMsg:"\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F",redirect:"/login"}),Promise.reject(new Error("\u672A\u767B\u5F55\u6216token\u5DF2\u8FC7\u671F"))):(e.headers.Authorization=t||"",e.headers.userName=B==="\u672A\u767B\u5F55\u7528\u6237"?"":B,e)}),c.interceptors.response.use(e=>{const t=["user/kaptcha"],i=e.data;if(t.some(g=>e.config.url&&e.config.url.includes(g))||i.size&&i.type)return i;const{success:u,errorMsg:b,errorCode:D}=i;return u?i:(E&&E("request:error_business",{errorCode:D,errorMsg:b||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",response:i}),!1)},async e=>{var t,i,u,b,D,g,C,h,w;if(e.message==="canceled")return Promise.reject(e);if(E){let d="request:error_network",j={errorMsg:"\u7F51\u7EDC\u8BF7\u6C42\u5931\u8D25",error:e};((t=e==null?void 0:e.response)==null?void 0:t.status)===401?(d="request:error_auth",j={errorMsg:"\u6CA1\u6709\u8DB3\u591F\u6743\u9650",error:e,redirect:"/login"}):(((u=(i=e==null?void 0:e.response)==null?void 0:i.data)==null?void 0:u.errorCode)==="30013"||((D=(b=e==null?void 0:e.response)==null?void 0:b.data)==null?void 0:D.errorCode)==="30023")&&(d="request:error_business",j={errorCode:(C=(g=e==null?void 0:e.response)==null?void 0:g.data)==null?void 0:C.errorCode,errorMsg:((w=(h=e==null?void 0:e.response)==null?void 0:h.data)==null?void 0:w.errorMsg)||"\u8BF7\u6C42\u51FA\u9519\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5",error:e}),E(d,j)}return console.log("Error occurs",e),Promise.reject(e)}),{getDatabaseList:async e=>{try{const t=await c.get(`/queryPageDBList?${new URLSearchParams(e).toString()}`),{success:i,data:u}=t;if(i)return u}catch(t){console.log("getDatabaseList error:",t)}},getShareDatabaseList:async e=>{try{const t=await c.get(`/queryShareDBList?${new URLSearchParams(e).toString()}`),{success:i,data:u}=t;if(i)return u}catch(t){console.log("getShareDatabaseList error:",t)}},delDatabaseById:async(e,t)=>{const i=O(t);try{const u=await c.delete(`/${i}/deleteDB/${e}`),{success:b,data:D}=u;if(b)return D}catch(u){console.log("delDatabaseById error:",u)}},saveDatabase:async(e,t)=>{const i=O(t);try{const u=await c.post(`/${i}/saveDBInfo`,e),{success:b,data:D}=u;if(b)return D}catch(u){console.log("saveDatabase error:",u)}},testConnection:async e=>{try{const t=await c.post("/directDB/testConnect",e),{success:i,data:u}=t;if(i)return u}catch(t){console.log("testConnection error:",t)}},syncSchema:async e=>{try{const t=await c.get(`/directDB/syncSchema/${e}`),{success:i,data:u}=t;if(i)return u}catch(t){console.log("syncSchema error:",t)}}}},O=m=>m=="DataTable"?"dataTable":"directDB",ge="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzYiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCAzNiAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCjxwYXRoIGQ9Ik0xNCAxMkMxNCAxMC44OTU0IDE0Ljg5NTQgMTAgMTYgMTBIMjlDMzEuMjA5MSAxMCAzMyAxMS43OTA5IDMzIDE0VjI2QzMzIDMwLjQxODMgMjkuNDE4MyAzNCAyNSAzNEgxNkMxNC44OTU0IDM0IDE0IDMzLjEwNDYgMTQgMzJWMTJaIiBmaWxsPSJ1cmwoI3BhaW50MF9saW5lYXJfNDQ3Ml8xODA1MikiLz4NCjxmb3JlaWduT2JqZWN0IHg9Ii0xIiB5PSItMSIgd2lkdGg9IjMyIiBoZWlnaHQ9IjM2Ij48ZGl2IHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hodG1sIiBzdHlsZT0iYmFja2Ryb3AtZmlsdGVyOmJsdXIoMnB4KTtjbGlwLXBhdGg6dXJsKCNiZ2JsdXJfMF80NDcyXzE4MDUyX2NsaXBfcGF0aCk7aGVpZ2h0OjEwMCU7d2lkdGg6MTAwJSI+PC9kaXY+PC9mb3JlaWduT2JqZWN0PjxnIGRhdGEtZmlnbWEtYmctYmx1ci1yYWRpdXM9IjQiPg0KPHBhdGggZD0iTTMgN0MzIDQuNzkwODYgNC43OTA4NiAzIDcgM0gyM0MyNS4yMDkxIDMgMjcgNC43OTA4NiAyNyA3VjE5QzI3IDI1LjYyNzQgMjEuNjI3NCAzMSAxNSAzMUg3QzQuNzkwODYgMzEgMyAyOS4yMDkxIDMgMjdWN1oiIGZpbGw9IndoaXRlIiBmaWxsLW9wYWNpdHk9IjAuNDYiLz4NCjxwYXRoIGQ9Ik03IDMuMjVIMjNDMjUuMDcxMSAzLjI1IDI2Ljc1IDQuOTI4OTMgMjYuNzUgN1YxOUMyNi43NSAyNS40ODkzIDIxLjQ4OTMgMzAuNzUgMTUgMzAuNzVIN0M0LjkyODkzIDMwLjc1IDMuMjUgMjkuMDcxMSAzLjI1IDI3VjdDMy4yNSA0LjkyODkzIDQuOTI4OTMgMy4yNSA3IDMuMjVaIiBzdHJva2U9IndoaXRlIiBzdHJva2Utb3BhY2l0eT0iMC4zNCIgc3Ryb2tlLXdpZHRoPSIwLjUiLz4NCjwvZz4NCjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIxX2RfNDQ3Ml8xODA1MikiPg0KPHBhdGggZD0iTTE0IDE5VjExLjY2NjciIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMS44Mzk3MiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+DQo8cGF0aCBkPSJNMTEgMTRMMTIgMTNMMTQgMTFMMTYgMTNMMTcgMTQiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+DQo8cGF0aCBkPSJNMTAgMjJIMTgiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIi8+DQo8L2c+DQo8ZGVmcz4NCjxjbGlwUGF0aCBpZD0iYmdibHVyXzBfNDQ3Ml8xODA1Ml9jbGlwX3BhdGgiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMSkiPjxwYXRoIGQ9Ik0zIDdDMyA0Ljc5MDg2IDQuNzkwODYgMyA3IDNIMjNDMjUuMjA5MSAzIDI3IDQuNzkwODYgMjcgN1YxOUMyNyAyNS42Mjc0IDIxLjYyNzQgMzEgMTUgMzFIN0M0Ljc5MDg2IDMxIDMgMjkuMjA5MSAzIDI3VjdaIi8+DQo8L2NsaXBQYXRoPjxmaWx0ZXIgaWQ9ImZpbHRlcjFfZF80NDcyXzE4MDUyIiB4PSI1IiB5PSI2IiB3aWR0aD0iMTgiIGhlaWdodD0iMjEiIGZpbHRlclVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgY29sb3ItaW50ZXJwb2xhdGlvbi1maWx0ZXJzPSJzUkdCIj4NCjxmZUZsb29kIGZsb29kLW9wYWNpdHk9IjAiIHJlc3VsdD0iQmFja2dyb3VuZEltYWdlRml4Ii8+DQo8ZmVDb2xvck1hdHJpeCBpbj0iU291cmNlQWxwaGEiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAxMjcgMCIgcmVzdWx0PSJoYXJkQWxwaGEiLz4NCjxmZU9mZnNldC8+DQo8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIyIi8+DQo8ZmVDb21wb3NpdGUgaW4yPSJoYXJkQWxwaGEiIG9wZXJhdG9yPSJvdXQiLz4NCjxmZUNvbG9yTWF0cml4IHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwLjM5NjA3OCAwIDAgMCAwIDAuOTg0MzE0IDAgMCAwIDAuNCAwIi8+DQo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluMj0iQmFja2dyb3VuZEltYWdlRml4IiByZXN1bHQ9ImVmZmVjdDFfZHJvcFNoYWRvd180NDcyXzE4MDUyIi8+DQo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9ImVmZmVjdDFfZHJvcFNoYWRvd180NDcyXzE4MDUyIiByZXN1bHQ9InNoYXBlIi8+DQo8L2ZpbHRlcj4NCjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQwX2xpbmVhcl80NDcyXzE4MDUyIiB4MT0iMjMuNSIgeTE9IjEwIiB4Mj0iMjMuNSIgeTI9IjM0IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+DQo8c3RvcCBzdG9wLWNvbG9yPSIjNjRBMEZEIi8+DQo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiMwMTVBRkYiLz4NCjwvbGluZWFyR3JhZGllbnQ+DQo8L2RlZnM+DQo8L3N2Zz4NCg==",pe=""+new URL("assets/database_connect.svg",import.meta.url).href,Me=""+new URL("assets/mysql.svg",import.meta.url).href,fe=""+new URL("assets/SQLServer.png",import.meta.url).href,Ae=""+new URL("assets/PostgreSQL.png",import.meta.url).href,Ce=""+new URL("assets/Doris.png",import.meta.url).href,he=[{label:"MySQL",value:"MySQL",icon:Me},{label:"PostgreSQL",value:"PostgreSQL",icon:Ae},{label:"SQLServer",value:"SQLServer",icon:fe},{label:"Doris",value:"Doris",icon:Ce}],Be=({drawerTitle:m,drawerVisible:v,isConnectSuccess:B,handleDrawerClose:E,dbInfo:c,dbType:l,eventsEmit:M})=>{const[Q,V]=F(!1),[G,N]=F(!1),[e,t]=F({}),[i,u]=F(!1),b=W(()=>({id:l,layout:"vertical",formWidth:"500px",fields:[{id:"name",name:"name",label:"\u6570\u636E\u5E93\u540D\u79F0",type:"input",required:!0,placeholder:"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7",validate:a=>{if(!a)return"\u6570\u636E\u5E93\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A";if(!/[\u4E00-\u9FA5A-Za-z0-9\W]/.test(a))return"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7"},counter:100},{id:"description",name:"description",label:"\u6570\u636E\u5E93\u63CF\u8FF0",type:"textarea",counter:150,required:!1,placeholder:"\u8BF7\u8F93\u5165\u6570\u636E\u5E93\u63CF\u8FF0,\u6B64\u63CF\u8FF0\u4EC5\u7528\u4E8E\u533A\u5206\u4E0D\u540C\u6570\u636E\u5E93,\u4E0D\u4F1A\u5F71\u54CD\u6570\u636E\u5E93\u8C03\u7528",defaultValue:""}]}),[l,c]),D=W(()=>({id:l,layout:"vertical",formWidth:"470px",fields:[{id:"name",name:"name",label:"\u6570\u636E\u5E93\u540D\u79F0",type:"input",required:!0,placeholder:"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7",validate:a=>{if(!a)return"\u6570\u636E\u5E93\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A";if(!/[\u4E00-\u9FA5A-Za-z0-9\W]/.test(a))return"\u4EC5\u652F\u6301\u6C49\u5B57\u3001\u6570\u5B57\u3001\u82F1\u6587\u3001\u7B26\u53F7"},counter:100},{id:"description",name:"description",label:"\u6570\u636E\u5E93\u63CF\u8FF0",type:"textarea",required:!1,counter:150,placeholder:"\u8BF7\u8F93\u5165\u6570\u636E\u5E93\u63CF\u8FF0,\u6B64\u63CF\u8FF0\u4EC5\u7528\u4E8E\u533A\u5206\u4E0D\u540C\u6570\u636E\u5E93,\u4E0D\u4F1A\u5F71\u54CD\u6570\u636E\u5E93\u8C03\u7528",defaultValue:""},{id:"db-info",label:"\u76F4\u8FDE\u6570\u636E\u6E90\u4FE1\u606F",type:"title",level:2},{id:"dbType",name:"dbType",label:"\u6570\u636E\u6E90\u7C7B\u578B",type:"select",disabled:!!c,required:!0,options:he.map(a=>{const{label:r,value:p,icon:k}=a;return{label:r,value:p,render:()=>L("div",{className:"flex items-center gap-2",children:[n("img",{src:k,width:24}),n("span",{children:r})]})}})},{id:"dbHost",name:"dbHost",label:"\u4E3B\u673A\u5730\u5740",type:"input",required:!0,disabled:!!c,placeholder:"\u8BF7\u8F93\u5165IP\u5730\u5740\u6216\u8005\u57DF\u540D"},{id:"dbPort",name:"dbPort",label:"\u7AEF\u53E3\u53F7",type:"number",required:!0,disabled:!!c,placeholder:"\u8BF7\u8F93\u5165\u7AEF\u53E3\u540D\u79F0"},{id:"dbDatabase",name:"dbDatabase",label:"\u8FDE\u63A5\u6570\u636E\u5E93\u540D",disabled:!!c,placeholder:"\u8BF7\u8F93\u5165\u8FDE\u63A5\u6570\u636E\u5E93\u540D",required:!0,type:"input"},{type:"col",children:[{id:"dbUser",type:"input",name:"dbUser",label:"\u7528\u6237\u540D",disabled:!!c,placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D",required:!0},{id:"dbPassword",type:"password",name:"dbPassword",label:"\u5BC6\u7801",placeholder:"\u8BF7\u8F93\u5165\u5BC6\u7801",required:!0,disabled:i?!1:!!c}]}]}),[l,c,i]),g=q(null),C=(a,r,p)=>{switch(console.log("[Form] eventsEmit:",a,r,p),a){case"form:ready":r.formRef&&(g.current=r.formRef);break;case"form_field_change":console.log("\u5B57\u6BB5\u503C\u53D8\u5316:",r),t(k=>({...k,[r.fieldId]:r.value}));break;case"form_validation_error":console.log("\u8868\u5355\u9A8C\u8BC1\u9519\u8BEF:",r);break;default:console.log("\u672A\u5904\u7406\u7684\u4E8B\u4EF6:",a,r)}M==null||M(a,r,p)},h=async()=>{try{V(!0);const a=await g.current.getAllData();a.isValid&&(console.log(a,"==="),l=="DirectDB"&&m=="\u7F16\u8F91\u6570\u636E\u5E93"&&!i&&(a.fields=a.fields.filter(r=>r.name=="name"||r.name=="description")),await M("form_submitted",a,void 0),u(!1))}catch(a){console.error("\u274C \u63D0\u4EA4\u8868\u5355\u6570\u636E\u5931\u8D25:",a)}finally{V(!1)}},w=async()=>{try{N(!0);const a=await g.current.getAllData();if(a.isValid){const r=a.fields.reduce((p,k)=>(p[k.name]=k.value,p),{});await M("form:connect_test",r,void 0)}}catch{N(!1)}finally{N(!1)}},d=W(()=>{const a=l=="DataTable"?b:D;return{label:"\u52A8\u6001\u8868\u5355\u793A\u4F8B",defaultActiveId:a.id,model:null,views:[{label:"\u7528\u6237\u6CE8\u518C\u8868\u5355",id:a.id,type:"form",size:"md",formWidth:a.formWidth,formConfig:{layout:a.layout,showReset:!1,showSubmit:!1,formWidth:a.formWidth,getFormData:()=>({...e,timestamp:new Date().toISOString(),formId:a.id}),onFieldChange:(r,p)=>{C("form_field_change",{fieldId:r,value:p},void 0)},onValidationError:r=>{C("form_validation_error",r,void 0)}}}],dataSource:[{id:a.id,fields:a.fields,defaultValues:{...c}}],eventsEmit:C}},[l,b,D,v,c]),j=W(()=>l=="DirectDB"?c?i&&!B:!B:!1,[l,B,i,v]);return L(K,{title:m,width:620,onCancel:()=>{E(),u(!1)},open:v,destroyOnHidden:!0,footer:L("div",{className:"flex justify-end gap-3",children:[n(J,{mode:"default",label:"\u53D6\u6D88",onClick:()=>{E(),u(!1)}}),n(J,{mode:"primary",label:"\u786E\u8BA4",loading:Q,disabled:j,onClick:h})]}),children:[n($,{...d},"example-form"),l==="DirectDB"&&n(de,{children:m=="\u7F16\u8F91\u6570\u636E\u5E93"&&!i?n(J,{mode:"primary",className:"mt-[10px]",label:"\u4FEE\u6539\u5BC6\u7801",onClick:()=>{u(!0),g.current.setValues({dbPassword:void 0})}}):n(Fe,{title:"\u9700\u901A\u8FC7\u6D4B\u8BD5\u624D\u53EF\u521B\u5EFA\u6210\u529F",children:n(J,{mode:"primary",className:"mt-[10px]",label:"\u8FDE\u63A5\u6D4B\u8BD5",loading:G,onClick:w})})})]})},Ne=""+new URL("assets/empty.png",import.meta.url).href,{confirm:we}=K,je=ye.div`
|
|
2
|
-
width: 282px;
|
|
3
|
-
height: 81px;
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: row;
|
|
6
|
-
justify-space:between;
|
|
7
|
-
align-items: center;
|
|
8
|
-
border-radius: 4px;
|
|
9
|
-
padding:12px;
|
|
10
|
-
|
|
11
|
-
flexD
|
|
12
|
-
color: #2a2a2a;
|
|
13
|
-
background-color: #ffffff;
|
|
14
|
-
&:hover {
|
|
15
|
-
color: #055aff;
|
|
16
|
-
border: 1px solid #2b69ff;
|
|
17
|
-
background-color: #F1F5FF;
|
|
18
|
-
};
|
|
19
|
-
border: 1px solid #EBEBEB
|
|
20
|
-
`,ke=[{key:"add_file_db",label:"\u4E0A\u4F20\u6570\u636E\u5E93",dsc:"\u901A\u8FC7\u4E0A\u4F20Excel\u3001csv\u7B49\u683C\u5F0F\u6570\u636E\u8868\u521B\u5EFA\u6570\u636E\u5E93\u3002",icon:ge},{key:"add_direct_db",label:"\u76F4\u8FDE\u6570\u636E\u5E93",dsc:"\u901A\u8FC7\u4E0E\u5DF2\u6709\u4E1A\u52A1\u5EFA\u7ACB\u8FDE\u63A5\u521B\u5EFA\u6570\u636E\u5E93\u3002",icon:pe}],Pe=m=>{const{url:v,token:B,role:E,CustomComponents:c,getBtnDisabled:l}=m,[M,Q]=F("my-db"),[V,G]=F({app:"ready",container:"ready",content:"ready"}),[N,e]=F(!1),[t,i]=F([{id:"my-db",data:[]},{id:"shared-db",data:[]}]),u=q(null),[b,D]=F(!1),[g,C]=F(""),[h,w]=F("DataTable"),[d,j]=F(),[a,r]=F(!1),{getDatabaseList:p,delDatabaseById:k,saveDatabase:ee,testConnection:ue,getShareDatabaseList:te,syncSchema:ae}=Ee({url:v,token:B,role:E,eventsEmit:m.eventsEmit}),H=W(()=>[{label:"\u6211\u7684\u6570\u636E\u5E93",id:"my-db",type:"card",cardType:"database",rowHeight:220,viewPageSize:12,viewBehavior:"pagination",actions:[{label:"\u7F16\u8F91",key:"edit"},{label:"\u5220\u9664",key:"delete"}],toolbar:[{type:"customized",key:"add",render:()=>n(me,{mode:"primary",label:"\u521B\u5EFA\u6570\u636E\u5E93",actions:ke.map(o=>({key:o.key,component:n(je,{children:L("div",{className:"flex flex-grow",children:[n("div",{className:"mr-[6px]",children:n("img",{src:o.icon})}),L("div",{children:[n("div",{className:"text-base font-bold mb-1 text-[14px]",children:o.label}),n("div",{className:"text-[#888] text-[10px]",children:o.dsc})]})]})},o.key)})),eventEmit:Y})},{type:"fuzzy_search",key:"search",label:"\u8F93\u5165\u540D\u79F0\u641C\u7D22",searchKeys:["name","description"],position:"right"}]},{label:"\u5171\u4EAB\u6570\u636E\u5E93",id:"shared-db",type:"card",cardType:"database",rowHeight:240,toolbar:[{type:"fuzzy_search",key:"search",label:"\u641C\u7D22",position:"right"}],actions:[{label:"\u7F16\u8F91",key:"edit"},{label:"\u5220\u9664",key:"delete"}]}],[t]);De(()=>{G(o=>({...o,content:"loading"})),se()},[]);const se=async()=>{var o,s,f,y;try{const[A,z]=await Promise.allSettled([p({pageNo:1,pageSize:999}),te({pageNo:1,pageSize:999})]);let Z=[];if(A.status==="fulfilled"&&A.value&&(o=A.value)!=null&&o.records){const x=X((s=A.value)==null?void 0:s.records);Z.push({id:"my-db",data:x||[]})}if(z.status==="fulfilled"&&z.value&&(f=z.value)!=null&&f.records){const x=X((y=z.value)==null?void 0:y.records);Z.push({id:"shared-db",data:x||[]})}i(Z),G(x=>({...x,content:"ready"}))}catch(A){console.log("[DatabaseApiError] getDatabaseList:",A)}},X=o=>(o||[]).map(s=>{const f=U("shared-db").map((y,A)=>({...y,key:y.type==="divider"?`${y.key}_${s.id}`:y.key,disabled:l&&l(y.key=="edit"?7:4,s.permission)}));return s.datasourceType=="DirectDB"&&f.push({label:"\u540C\u6B65\u8868\u7ED3\u6784",key:"sync_schema",disabled:l&&l(7,s.permission)}),console.log("[DatabaseViewAdopter] actions:",f),{...s,actions:f||[]}}),ie="admin",re=()=>L("div",{className:"flex flex-col items-center justify-center h-full",children:[n("div",{className:"text-xl font-semibold mb-3",style:{color:"#374151"},children:n("img",{src:Ne,width:120})}),n("div",{className:"text-base mb-6",style:{color:"#6b7280"},children:"\u6682\u65E0\u6570\u636E\uFF0C\u8BF7\u5148\u6DFB\u52A0\u6570\u636E\u5E93"})]}),U=o=>{const s=H.find(y=>y.id===o);return(s==null?void 0:s.actions)||[]},oe=W(()=>{var s;const o=((s=t==null?void 0:t.find(f=>f.id===M))==null?void 0:s.data)||[];return N?[]:o},[M,t,N]),_=()=>{D(!1),r(!1),j(void 0)},ce=async o=>{console.log("[DatabaseViewAdopter] \u6D4B\u8BD5\u8FDE\u63A5:",o);const s=await ue(o);return s&&(r(!0),R.success("\u8FDE\u63A5\u6D4B\u8BD5\u6210\u529F\uFF01")),s};async function Y(o,s,f){var y,A,z,Z,x;switch(console.log("[DatabaseViewAdopter] mergedEventsEmit",o,s),o){case"card_delete":we({title:"\u786E\u8BA4\u5220\u9664\u6570\u636E\u5E93\uFF1F",content:"\u5220\u9664\u540E\uFF0C\u8BE5\u6570\u636E\u5E93\u5C06\u65E0\u6CD5\u6062\u590D",okText:"\u5220\u9664",cancelText:"\u53D6\u6D88",async onOk(){await k(s.id,s.datasourceType)&&(u!=null&&u.current)&&(u==null||u.current.appFn.removeItem(s.id))},onCancel(){console.log("Cancel")}});break;case"card_edit":C("\u7F16\u8F91\u6570\u636E\u5E93"),D(!0),w(s.datasourceType),delete s.render,j(s);break;case"select":Q(s.id);break;case"filesDir_clicked":Q(s.id);break;case"dropdown_action":C("\u521B\u5EFA\u6570\u636E\u5E93"),D(!0),s.key=="add_file_db"?w("DataTable"):w("DirectDB");break;case"form_submitted":try{const S=s.fields.reduce((T,I)=>(T[I.name]=I.value,T),{}),ne=d?{id:d==null?void 0:d.id,...S}:S,P=await ee(ne,h);if(P){if(d){const T={...d,...S,datasourceType:h,actions:U("my-db").map((I,le)=>({...I,key:I.type==="divider"?`${I.key}_${P}`:I.key,allow:!0}))};(A=(y=u==null?void 0:u.current)==null?void 0:y.appFn)==null||A.updateItem(T,d==null?void 0:d.id),R.success("\u6570\u636E\u5E93\u7F16\u8F91\u6210\u529F\uFF01")}else{const T={...S,...P,createBy:ie,datasourceType:h,actions:U("my-db").map((I,le)=>({...I,key:I.type==="divider"?`${I.key}_${P}`:I.key,allow:!0}))};(Z=(z=u==null?void 0:u.current)==null?void 0:z.appFn)==null||Z.addItem(T,{animate:!0,position:"start"}),R.success("\u6570\u636E\u5E93\u521B\u5EFA\u6210\u529F\uFF01")}return P}}catch(S){console.error("\u4FDD\u5B58\u5931\u8D25\uFF01",S)}finally{_()}break;case"form:connect_test":return await ce(s);case"toolbar_test_empty":console.log("[DatabaseViewAdopter] toolbar_test_empty \u4E8B\u4EF6\u89E6\u53D1"),e(!N);break;case"card_sync_schema":await ae(s.id)&&(r(!0),R.success("\u540C\u6B65\u8868\u7ED3\u6784\u6210\u529F\uFF01"));break;default:(x=m.eventsEmit)==null||x.call(m,o,s);break}}return L(be,{title:"\u6570\u636E\u5E93\u7BA1\u7406",children:[n($,{ref:u,label:"",model:"tabs",defaultActiveId:M,views:H,dataSource:oe,eventsEmit:Y,status:V,CustomComponents:{EmptyData:re,...c},styles:m.styles},"db"),n(Be,{drawerTitle:g,drawerVisible:b,isConnectSuccess:a,dbType:h,dbInfo:d,handleDrawerClose:_,eventsEmit:Y})]})};export{Pe as default};
|
package/dist/package.json
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@gientech/modual",
|
|
3
|
-
"license": "MIT",
|
|
4
|
-
"style": "assets/style.css",
|
|
5
|
-
"private": false,
|
|
6
|
-
"version": "1.3.3",
|
|
7
|
-
"author": "hanfeng_Zhang",
|
|
8
|
-
"type": "module",
|
|
9
|
-
"scripts": {
|
|
10
|
-
"test": "yarn link",
|
|
11
|
-
"disconnect": "yarn unlink"
|
|
12
|
-
},
|
|
13
|
-
"peerDependencies": {
|
|
14
|
-
"react": ">=18",
|
|
15
|
-
"react-dom": ">=18"
|
|
16
|
-
},
|
|
17
|
-
"exports": {
|
|
18
|
-
"./chat": {
|
|
19
|
-
"types": "./chat.d.ts",
|
|
20
|
-
"import": "./chat.js",
|
|
21
|
-
"default": "./chat.js"
|
|
22
|
-
},
|
|
23
|
-
"./database": {
|
|
24
|
-
"types": "./database.d.ts",
|
|
25
|
-
"import": "./database.js",
|
|
26
|
-
"default": "./database.js"
|
|
27
|
-
},
|
|
28
|
-
"./databaseId": {
|
|
29
|
-
"types": "./databaseId.d.ts",
|
|
30
|
-
"import": "./databaseId.js",
|
|
31
|
-
"default": "./databaseId.js"
|
|
32
|
-
},
|
|
33
|
-
"./modelManage": {
|
|
34
|
-
"types": "./modelManage.d.ts",
|
|
35
|
-
"import": "./modelManage.js",
|
|
36
|
-
"default": "./modelManage.js"
|
|
37
|
-
},
|
|
38
|
-
"./databaseTable": {
|
|
39
|
-
"types": "./databaseTable.d.ts",
|
|
40
|
-
"import": "./databaseTable.js",
|
|
41
|
-
"default": "./databaseTable.js"
|
|
42
|
-
},
|
|
43
|
-
"./sensitive": {
|
|
44
|
-
"types": "./sensitive.d.ts",
|
|
45
|
-
"import": "./sensitive.js",
|
|
46
|
-
"default": "./sensitive.js"
|
|
47
|
-
},
|
|
48
|
-
"./streamFilesReader": {
|
|
49
|
-
"types": "./streamFilesReader.d.ts",
|
|
50
|
-
"import": "./streamFilesReader.js",
|
|
51
|
-
"default": "./streamFilesReader.js"
|
|
52
|
-
},
|
|
53
|
-
"./style.css": "./assets/style.css",
|
|
54
|
-
"./assets/style.css": "./assets/style.css"
|
|
55
|
-
}
|
|
56
|
-
}
|
package/doc_assets/2.png
DELETED
|
Binary file
|
package/doc_assets/demo.md
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# 业务演示
|
|
2
|
-
|
|
3
|
-
## 基础功能演示
|
|
4
|
-
|
|
5
|
-
这是一个完整的业务演示文档,展示了各种功能特性。
|
|
6
|
-
|
|
7
|
-
### 图片演示
|
|
8
|
-
|
|
9
|
-

|
|
10
|
-

|
|
11
|
-
|
|
12
|
-
### 样式演示
|
|
13
|
-
<iframe src="./demos/dist-app/index.html" width="100%" height="400" frameborder="0"></iframe>
|
|
14
|
-
|
|
15
|
-
## 高级功能
|
|
16
|
-
|
|
17
|
-
### 混合路径资源
|
|
18
|
-
|
|
19
|
-

|
|
20
|
-
## 总结
|
|
21
|
-
|
|
22
|
-
这个演示文档展示了:
|
|
23
|
-
- 图片引用
|
|
24
|
-
- iframe 嵌入
|
|
25
|
-
- CSS/JS 资源
|
|
26
|
-
- 嵌套目录结构
|
|
27
|
-
- 相对路径处理
|