KevinHuSh commited on
Commit
6b8fc2c
·
1 Parent(s): 3859fce

add front end code (#27)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. web/.env +0 -0
  2. web/.gitignore +9 -0
  3. web/.npmrc +2 -0
  4. web/.umirc.ts +28 -0
  5. web/package-lock.json +0 -0
  6. web/package.json +35 -0
  7. web/reducer.js +27 -0
  8. web/routes.js +89 -0
  9. web/src/.umi/core/EmptyRoute.tsx +9 -0
  10. web/src/.umi/core/defineApp.ts +17 -0
  11. web/src/.umi/core/helmet.ts +10 -0
  12. web/src/.umi/core/helmetContext.ts +4 -0
  13. web/src/.umi/core/history.ts +66 -0
  14. web/src/.umi/core/historyIntelli.ts +132 -0
  15. web/src/.umi/core/plugin.ts +45 -0
  16. web/src/.umi/core/pluginConfig.ts +292 -0
  17. web/src/.umi/core/pluginConfigJoi.d.ts +7 -0
  18. web/src/.umi/core/polyfill.ts +220 -0
  19. web/src/.umi/core/route.tsx +22 -0
  20. web/src/.umi/core/terminal.ts +37 -0
  21. web/src/.umi/exports.ts +22 -0
  22. web/src/.umi/plugin-dva/dva.tsx +60 -0
  23. web/src/.umi/plugin-dva/index.ts +5 -0
  24. web/src/.umi/plugin-dva/models.ts +20 -0
  25. web/src/.umi/plugin-dva/runtime.tsx +9 -0
  26. web/src/.umi/plugin-dva/runtimeConfig.d.ts +19 -0
  27. web/src/.umi/plugin-dva/types.d.ts +58 -0
  28. web/src/.umi/plugin-icons/icons.tsx +8 -0
  29. web/src/.umi/plugin-icons/index.css +27 -0
  30. web/src/.umi/plugin-icons/index.tsx +243 -0
  31. web/src/.umi/testBrowser.tsx +87 -0
  32. web/src/.umi/tsconfig.json +43 -0
  33. web/src/.umi/typings.d.ts +136 -0
  34. web/src/.umi/umi.ts +76 -0
  35. web/src/assets/logo.png +0 -0
  36. web/src/assets/yay.jpg +0 -0
  37. web/src/icons/github.svg +10 -0
  38. web/src/icons/google.svg +13 -0
  39. web/src/layouts/components/user/index.tsx +38 -0
  40. web/src/layouts/index.less +33 -0
  41. web/src/layouts/index.tsx +74 -0
  42. web/src/locales/config.ts +24 -0
  43. web/src/locales/en.json +20 -0
  44. web/src/locales/zh.json +20 -0
  45. web/src/pages/404.jsx +17 -0
  46. web/src/pages/add-knowledge/components/knowledge-file/createEFileModal.tsx +72 -0
  47. web/src/pages/add-knowledge/components/knowledge-file/index.less +24 -0
  48. web/src/pages/add-knowledge/components/knowledge-file/index.tsx +218 -0
  49. web/src/pages/add-knowledge/components/knowledge-file/model.ts +127 -0
  50. web/src/pages/add-knowledge/components/knowledge-file/segmentSetModal.tsx +84 -0
web/.env ADDED
File without changes
web/.gitignore ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ /node_modules
2
+ /.env.local
3
+ /.umirc.local.ts
4
+ /config/config.local.ts
5
+ /src/.umi
6
+ /src/.umi-production
7
+ /src/.umi-test
8
+ /dist
9
+ .swc
web/.npmrc ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ registry=https://registry.npmmirror.com/
2
+
web/.umirc.ts ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { defineConfig } from "umi";
2
+ import routes from './routes'
3
+
4
+ export default defineConfig({
5
+ outputPath: 'dist',
6
+ // alias: { '@': './src' },
7
+ routes,
8
+ npmClient: 'npm',
9
+ base: '/',
10
+ publicPath: '/client/dist/',
11
+ icons: {
12
+
13
+ },
14
+ hash: true,
15
+ history: {
16
+ type: 'hash',
17
+ },
18
+ plugins: ['@umijs/plugins/dist/dva'],
19
+ dva: {},
20
+ proxy: {
21
+ '/v1': {
22
+ 'target': 'http://54.80.112.79:9380/',
23
+ 'changeOrigin': true,
24
+ 'pathRewrite': { '^/v1': '/v1' },
25
+ },
26
+ },
27
+ });
28
+
web/package-lock.json ADDED
The diff for this file is too large to render. See raw diff
 
web/package.json ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "private": true,
3
+ "author": "zhaofengchao <[email protected]>",
4
+ "scripts": {
5
+ "dev": "umi dev",
6
+ "build": "umi build",
7
+ "postinstall": "umi setup",
8
+ "setup": "umi setup",
9
+ "start": "npm run dev"
10
+ },
11
+ "dependencies": {
12
+ "@ant-design/icons": "^5.2.6",
13
+ "@ant-design/pro-components": "^2.6.46",
14
+ "@ant-design/pro-layout": "^7.17.16",
15
+ "antd": "^5.12.7",
16
+ "axios": "^1.6.3",
17
+ "classnames": "^2.5.1",
18
+ "i18next": "^23.7.16",
19
+ "js-base64": "^3.7.5",
20
+ "jsencrypt": "^3.3.2",
21
+ "lodash": "^4.17.21",
22
+ "react-i18next": "^14.0.0",
23
+ "react-infinite-scroll-component": "^6.1.0",
24
+ "umi": "^4.0.90",
25
+ "umi-request": "^1.4.0"
26
+ },
27
+ "devDependencies": {
28
+ "@types/lodash": "^4.14.202",
29
+ "@types/react": "^18.0.33",
30
+ "@types/react-dom": "^18.0.11",
31
+ "@umijs/plugins": "^4.1.0",
32
+ "typescript": "^5.0.3",
33
+ "umi-plugin-icons": "^0.1.1"
34
+ }
35
+ }
web/reducer.js ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React, { useReducer } from 'react'
2
+ const CHANGE_LOCALE = 'CHANGE_LOCALE'
3
+
4
+ const mainContext = React.createContext()
5
+
6
+ const reducer = (state, action) => {
7
+ switch (action.type) {
8
+ case CHANGE_LOCALE:
9
+ return { ...state, locale: action.locale || 'zh' }
10
+ default:
11
+ return state
12
+ }
13
+ }
14
+
15
+ const ContextProvider = (props) => {
16
+ const [state, dispatch] = useReducer(reducer, {
17
+ locale: 'zh'
18
+ })
19
+ return (
20
+ <mainContext.Provider value={{ state, dispatch }}>
21
+ {props.children}
22
+ </mainContext.Provider>
23
+ )
24
+ }
25
+
26
+ export { reducer, mainContext, ContextProvider }
27
+
web/routes.js ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ const routes = [
4
+ {
5
+ path: '/login',
6
+ component: '@/pages/login',
7
+ layout: false
8
+ },
9
+ {
10
+ path: '/',
11
+ component: '@/layouts', // 默认页面
12
+ redirect: '/knowledge',
13
+ // wrappers: [
14
+ // '@/wrappers/auth',
15
+ // ]
16
+ },
17
+
18
+ {
19
+ id: 2,
20
+ name: '知识库',
21
+ icon: 'home',
22
+ auth: [3, 4, 100],
23
+ path: '/knowledge',
24
+ component: '@/pages/knowledge',
25
+ pathname: 'knowledge'
26
+ },
27
+ {
28
+ id: 2,
29
+ name: '知识库',
30
+ icon: 'home',
31
+ auth: [3, 4, 100],
32
+ path: '/knowledge/add/*',
33
+ component: '@/pages/add-knowledge',
34
+ pathname: 'knowledge',
35
+ // routes: [{
36
+ // id: 3,
37
+ // name: '设置',
38
+ // icon: 'home',
39
+ // auth: [3, 4, 100],
40
+ // path: '/knowledge/add/setting',
41
+ // component: '@/pages/setting',
42
+ // pathname: "setting"
43
+ // }, {
44
+ // id: 1,
45
+ // name: '文件',
46
+ // icon: 'file',
47
+ // auth: [3, 4, 100],
48
+ // path: '/knowledge/add/file',
49
+ // component: '@/pages/file',
50
+ // pathname: 'file'
51
+ // },]
52
+ },
53
+ {
54
+ id: 3,
55
+ name: '聊天',
56
+ icon: 'home',
57
+ auth: [3, 4, 100],
58
+ path: '/chat',
59
+ component: '@/pages/chat',
60
+ pathname: "chat"
61
+ },
62
+ {
63
+ id: 3,
64
+ name: '设置',
65
+ icon: 'home',
66
+ auth: [3, 4, 100],
67
+ path: '/setting',
68
+ component: '@/pages/setting',
69
+ pathname: "setting"
70
+ },
71
+ {
72
+ id: 1,
73
+ name: '文件',
74
+ icon: 'file',
75
+ auth: [3, 4, 100],
76
+ path: '/file',
77
+ component: '@/pages/file',
78
+ pathname: 'file'
79
+ },
80
+ {
81
+ path: '/*',
82
+ component: '@/pages/404',
83
+ layout: false
84
+ }
85
+
86
+ ];
87
+
88
+
89
+ module.exports = routes;
web/src/.umi/core/EmptyRoute.tsx ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ // @ts-nocheck
2
+ // This file is generated by Umi automatically
3
+ // DO NOT CHANGE IT MANUALLY!
4
+ import React from 'react';
5
+ import { Outlet, useOutletContext } from 'umi';
6
+ export default function EmptyRoute() {
7
+ const context = useOutletContext();
8
+ return <Outlet context={context} />;
9
+ }
web/src/.umi/core/defineApp.ts ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // @ts-nocheck
2
+ // This file is generated by Umi automatically
3
+ // DO NOT CHANGE IT MANUALLY!
4
+ import type { IRuntimeConfig as Plugin0 } from 'C:/Users/zfc/Desktop/docgpt/client/src/.umi/plugin-dva/runtimeConfig.d'
5
+ interface IDefaultRuntimeConfig {
6
+ onRouteChange?: (props: { routes: any, clientRoutes: any, location: any, action: any, isFirst: boolean }) => void;
7
+ patchRoutes?: (props: { routes: any }) => void;
8
+ patchClientRoutes?: (props: { routes: any }) => void;
9
+ render?: (oldRender: () => void) => void;
10
+ rootContainer?: (lastRootContainer: JSX.Element, args?: any) => void;
11
+ [key: string]: any;
12
+ }
13
+ export type RuntimeConfig = IDefaultRuntimeConfig & Plugin0
14
+
15
+ export function defineApp(config: RuntimeConfig): RuntimeConfig {
16
+ return config;
17
+ }
web/src/.umi/core/helmet.ts ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ // @ts-nocheck
2
+ // This file is generated by Umi automatically
3
+ // DO NOT CHANGE IT MANUALLY!
4
+ import React from 'react';
5
+ import { HelmetProvider } from 'C:/Users/zfc/Desktop/docgpt/client/node_modules/@umijs/renderer-react';
6
+ import { context } from './helmetContext';
7
+
8
+ export const innerProvider = (container) => {
9
+ return React.createElement(HelmetProvider, { context }, container);
10
+ }
web/src/.umi/core/helmetContext.ts ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ // @ts-nocheck
2
+ // This file is generated by Umi automatically
3
+ // DO NOT CHANGE IT MANUALLY!
4
+ export const context = {};
web/src/.umi/core/history.ts ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // @ts-nocheck
2
+ // This file is generated by Umi automatically
3
+ // DO NOT CHANGE IT MANUALLY!
4
+ import { createHashHistory, createMemoryHistory, createBrowserHistory } from 'C:/Users/zfc/Desktop/docgpt/client/node_modules/@umijs/renderer-react';
5
+ import type { UmiHistory } from './historyIntelli';
6
+
7
+ let history: UmiHistory;
8
+ let basename: string = '/';
9
+ export function createHistory(opts: any) {
10
+ let h;
11
+ if (opts.type === 'hash') {
12
+ h = createHashHistory();
13
+ } else if (opts.type === 'memory') {
14
+ h = createMemoryHistory(opts);
15
+ } else {
16
+ h = createBrowserHistory();
17
+ }
18
+ if (opts.basename) {
19
+ basename = opts.basename;
20
+ }
21
+
22
+
23
+ history = {
24
+ ...h,
25
+ push(to, state) {
26
+ h.push(patchTo(to, h), state);
27
+ },
28
+ replace(to, state) {
29
+ h.replace(patchTo(to, h), state);
30
+ },
31
+ get location() {
32
+ return h.location;
33
+ },
34
+ get action() {
35
+ return h.action;
36
+ }
37
+ }
38
+
39
+ return h;
40
+ }
41
+
42
+ // Patch `to` to support basename
43
+ // Refs:
44
+ // https://github.com/remix-run/history/blob/3e9dab4/packages/history/index.ts#L484
45
+ // https://github.com/remix-run/history/blob/dev/docs/api-reference.md#to
46
+ function patchTo(to: any, h: History) {
47
+ if (typeof to === 'string') {
48
+ return `${stripLastSlash(basename)}${to}`;
49
+ } else if (typeof to === 'object') {
50
+
51
+ const currentPathname = h.location.pathname;
52
+
53
+ return {
54
+ ...to,
55
+ pathname: to.pathname? `${stripLastSlash(basename)}${to.pathname}` : currentPathname,
56
+ };
57
+ } else {
58
+ throw new Error(`Unexpected to: ${to}`);
59
+ }
60
+ }
61
+
62
+ function stripLastSlash(path) {
63
+ return path.slice(-1) === '/' ? path.slice(0, -1) : path;
64
+ }
65
+
66
+ export { history };
web/src/.umi/core/historyIntelli.ts ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // @ts-nocheck
2
+ // This file is generated by Umi automatically
3
+ // DO NOT CHANGE IT MANUALLY!
4
+ import { getRoutes } from './route'
5
+ import type { History } from 'C:/Users/zfc/Desktop/docgpt/client/node_modules/@umijs/renderer-react'
6
+
7
+ type Routes = Awaited<ReturnType<typeof getRoutes>>['routes']
8
+ type AllRoute = Routes[keyof Routes]
9
+ type IsRoot<T extends any> = 'parentId' extends keyof T ? false : true
10
+
11
+ // show `/` in not `layout / wrapper` only
12
+ type GetAllRouteWithoutLayout<Item extends AllRoute> = Item extends any
13
+ ? 'isWrapper' extends keyof Item
14
+ ? never
15
+ : 'isLayout' extends keyof Item
16
+ ? never
17
+ : Item
18
+ : never
19
+ type AllRouteWithoutLayout = GetAllRouteWithoutLayout<AllRoute>
20
+ type IndexRoutePathname = '/' extends AllRouteWithoutLayout['path']
21
+ ? '/'
22
+ : never
23
+
24
+ type GetChildrens<T extends any> = T extends any
25
+ ? IsRoot<T> extends true
26
+ ? never
27
+ : T
28
+ : never
29
+ type Childrens = GetChildrens<AllRoute>
30
+ type Root = Exclude<AllRoute, Childrens>
31
+ type AllIds = AllRoute['id']
32
+
33
+ type GetChildrensByParentId<
34
+ Id extends AllIds,
35
+ Item = AllRoute
36
+ > = Item extends any
37
+ ? 'parentId' extends keyof Item
38
+ ? Item['parentId'] extends Id
39
+ ? Item
40
+ : never
41
+ : never
42
+ : never
43
+
44
+ type RouteObject<
45
+ Id extends AllIds,
46
+ Item = GetChildrensByParentId<Id>
47
+ > = IsNever<Item> extends true
48
+ ? ''
49
+ : Item extends AllRoute
50
+ ? {
51
+ [Key in Item['path'] as TrimSlash<Key>]: UnionMerge<
52
+ RouteObject<Item['id']>
53
+ >
54
+ }
55
+ : never
56
+
57
+ type GetRootRouteObject<Item extends Root> = Item extends Root
58
+ ? {
59
+ [K in Item['path'] as TrimSlash<K>]: UnionMerge<RouteObject<Item['id']>>
60
+ }
61
+ : never
62
+ type MergedResult = UnionMerge<GetRootRouteObject<Root>>
63
+
64
+ // --- patch history types ---
65
+
66
+ type HistoryTo = Parameters<History['push']>['0']
67
+ type HistoryPath = Exclude<HistoryTo, string>
68
+
69
+ type UmiPathname = Path<MergedResult> | (string & {})
70
+ interface UmiPath extends HistoryPath {
71
+ pathname: UmiPathname
72
+ }
73
+ type UmiTo = UmiPathname | UmiPath
74
+
75
+ type UmiPush = (to: UmiTo, state?: any) => void
76
+ type UmiReplace = (to: UmiTo, state?: any) => void
77
+
78
+
79
+ export interface UmiHistory extends History {
80
+ push: UmiPush
81
+ replace: UmiReplace
82
+ }
83
+
84
+ // --- type utils ---
85
+ type TrimLeftSlash<T extends string> = T extends `/${infer R}`
86
+ ? TrimLeftSlash<R>
87
+ : T
88
+ type TrimRightSlash<T extends string> = T extends `${infer R}/`
89
+ ? TrimRightSlash<R>
90
+ : T
91
+ type TrimSlash<T extends string> = TrimLeftSlash<TrimRightSlash<T>>
92
+
93
+ type IsNever<T> = [T] extends [never] ? true : false
94
+ type IsEqual<A, B> = (<G>() => G extends A ? 1 : 2) extends <G>() => G extends B
95
+ ? 1
96
+ : 2
97
+ ? true
98
+ : false
99
+
100
+ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (
101
+ k: infer I
102
+ ) => void
103
+ ? I
104
+ : never
105
+ type UnionMerge<U> = UnionToIntersection<U> extends infer O
106
+ ? { [K in keyof O]: O[K] }
107
+ : never
108
+
109
+ type ExcludeEmptyKey<T> = IsEqual<T, ''> extends true ? never : T
110
+
111
+ type PathConcat<
112
+ TKey extends string,
113
+ TValue,
114
+ N = TrimSlash<TKey>
115
+ > = TValue extends string
116
+ ? ExcludeEmptyKey<N>
117
+ :
118
+ | ExcludeEmptyKey<N>
119
+ | `${N & string}${IsNever<ExcludeEmptyKey<N>> extends true
120
+ ? ''
121
+ : '/'}${UnionPath<TValue>}`
122
+
123
+ type UnionPath<T> = {
124
+ [K in keyof T]-?: PathConcat<K & string, T[K]>
125
+ }[keyof T]
126
+
127
+ type MakeSureLeftSlash<T> = T extends any
128
+ ? `/${TrimRightSlash<T & string>}`
129
+ : never
130
+
131
+ // exclude `/*`, because it always at the top of the IDE tip list
132
+ type Path<T, K = UnionPath<T>> = Exclude<MakeSureLeftSlash<K>, '/*'> | IndexRoutePathname
web/src/.umi/core/plugin.ts ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // @ts-nocheck
2
+ // This file is generated by Umi automatically
3
+ // DO NOT CHANGE IT MANUALLY!
4
+ import * as Plugin_0 from '@@/core/helmet.ts';
5
+ import * as Plugin_1 from 'C:/Users/zfc/Desktop/docgpt/client/src/.umi/plugin-dva/runtime.tsx';
6
+ import { PluginManager } from 'umi';
7
+
8
+ function __defaultExport (obj) {
9
+ if (obj.default) {
10
+ return typeof obj.default === 'function' ? obj.default() : obj.default
11
+ }
12
+ return obj;
13
+ }
14
+ export function getPlugins() {
15
+ return [
16
+ {
17
+ apply: Plugin_0,
18
+ path: process.env.NODE_ENV === 'production' ? void 0 : '@@/core/helmet.ts',
19
+ },
20
+ {
21
+ apply: Plugin_1,
22
+ path: process.env.NODE_ENV === 'production' ? void 0 : 'C:/Users/zfc/Desktop/docgpt/client/src/.umi/plugin-dva/runtime.tsx',
23
+ },
24
+ ];
25
+ }
26
+
27
+ export function getValidKeys() {
28
+ return ['patchRoutes','patchClientRoutes','modifyContextOpts','modifyClientRenderOpts','rootContainer','innerProvider','i18nProvider','accessProvider','dataflowProvider','outerProvider','render','onRouteChange','dva',];
29
+ }
30
+
31
+ let pluginManager = null;
32
+
33
+ export function createPluginManager() {
34
+ pluginManager = PluginManager.create({
35
+ plugins: getPlugins(),
36
+ validKeys: getValidKeys(),
37
+ });
38
+
39
+
40
+ return pluginManager;
41
+ }
42
+
43
+ export function getPluginManager() {
44
+ return pluginManager;
45
+ }
web/src/.umi/core/pluginConfig.ts ADDED
@@ -0,0 +1,292 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // @ts-nocheck
2
+ // This file is generated by Umi automatically
3
+ // DO NOT CHANGE IT MANUALLY!
4
+ import { IConfigFromPluginsJoi } from "./pluginConfigJoi.d";
5
+
6
+ interface IConfigTypes {
7
+ codeSplitting: {
8
+ jsStrategy: "bigVendors" | "depPerChunk" | "granularChunks";
9
+ jsStrategyOptions?: ({
10
+
11
+ } | undefined);
12
+ cssStrategy?: ("mergeAll" | undefined);
13
+ cssStrategyOptions?: ({
14
+
15
+ } | undefined);
16
+ };
17
+ title: string;
18
+ styles: Array<string | {
19
+ src?: (string | undefined);
20
+ } | {
21
+ content?: (string | undefined);
22
+ } | { [x: string]: any }>;
23
+ scripts: Array<string | {
24
+ src?: (string | undefined);
25
+ } | {
26
+ content?: (string | undefined);
27
+ } | { [x: string]: any }>;
28
+ routes: Array<{
29
+ component?: (string | undefined);
30
+ layout?: (false | undefined);
31
+ path?: (string | undefined);
32
+ redirect?: (string | undefined);
33
+ routes?: IConfigTypes['routes'];
34
+ wrappers?: (Array<string> | undefined);
35
+ } | { [x: string]: any }>;
36
+ routeLoader: {
37
+ moduleType: "esm" | "cjs";
38
+ };
39
+ reactRouter5Compat: boolean | {
40
+
41
+ };
42
+ presets: Array<string>;
43
+ plugins: Array<string>;
44
+ npmClient: "pnpm" | "tnpm" | "cnpm" | "yarn" | "npm";
45
+ mountElementId: string;
46
+ metas: Array<{
47
+ charset?: (string | undefined);
48
+ content?: (string | undefined);
49
+ "http-equiv"?: (string | undefined);
50
+ name?: (string | undefined);
51
+ } | { [x: string]: any }>;
52
+ links: Array<{
53
+ crossorigin?: (string | undefined);
54
+ href?: (string | undefined);
55
+ hreflang?: (string | undefined);
56
+ media?: (string | undefined);
57
+ referrerpolicy?: (string | undefined);
58
+ rel?: (string | undefined);
59
+ sizes?: (any | undefined);
60
+ title?: (any | undefined);
61
+ type?: (any | undefined);
62
+ } | { [x: string]: any }>;
63
+ historyWithQuery: {
64
+
65
+ };
66
+ history: {
67
+ type: "browser" | "hash" | "memory";
68
+ };
69
+ headScripts: Array<string | {
70
+ src?: (string | undefined);
71
+ } | {
72
+ content?: (string | undefined);
73
+ } | { [x: string]: any }>;
74
+ esbuildMinifyIIFE: boolean;
75
+ conventionRoutes: {
76
+ base?: (string | undefined);
77
+ exclude?: (Array<any> | undefined);
78
+ };
79
+ conventionLayout: boolean;
80
+ base: string;
81
+ analyze: {
82
+
83
+ };
84
+ writeToDisk: boolean;
85
+ theme: { [x: string]: any };
86
+ targets: { [x: string]: any };
87
+ svgr: { [x: string]: any };
88
+ svgo: { [x: string]: any } | boolean;
89
+ stylusLoader: { [x: string]: any };
90
+ styleLoader: { [x: string]: any };
91
+ srcTranspilerOptions: {
92
+ esbuild?: ({ [x: string]: any } | undefined);
93
+ swc?: ({ [x: string]: any } | undefined);
94
+ };
95
+ srcTranspiler: "babel" | "esbuild" | "swc";
96
+ sassLoader: { [x: string]: any };
97
+ runtimePublicPath: {
98
+
99
+ };
100
+ purgeCSS: { [x: string]: any };
101
+ publicPath: string;
102
+ proxy: { [x: string]: any } | Array<any>;
103
+ postcssLoader: { [x: string]: any };
104
+ outputPath: string;
105
+ normalCSSLoaderModules: { [x: string]: any };
106
+ mfsu: {
107
+ cacheDirectory?: (string | undefined);
108
+ chainWebpack?: (((...args: any[]) => unknown) | undefined);
109
+ esbuild?: (boolean | undefined);
110
+ exclude?: (Array<string | any> | undefined);
111
+ include?: (Array<string> | undefined);
112
+ mfName?: (string | undefined);
113
+ remoteAliases?: (Array<string> | undefined);
114
+ remoteName?: (string | undefined);
115
+ runtimePublicPath?: (boolean | undefined);
116
+ shared?: ({ [x: string]: any } | undefined);
117
+ strategy?: ("eager" | "normal" | undefined);
118
+ } | boolean;
119
+ mdx: {
120
+ loader?: (string | undefined);
121
+ loaderOptions?: ({ [x: string]: any } | undefined);
122
+ };
123
+ manifest: {
124
+ basePath?: (string | undefined);
125
+ fileName?: (string | undefined);
126
+ };
127
+ lessLoader: { [x: string]: any };
128
+ jsMinifierOptions: { [x: string]: any };
129
+ jsMinifier: "esbuild" | "swc" | "terser" | "uglifyJs" | "none";
130
+ inlineLimit: number;
131
+ ignoreMomentLocale: boolean;
132
+ https: {
133
+ cert?: (string | undefined);
134
+ hosts?: (Array<string> | undefined);
135
+ http2?: (boolean | undefined);
136
+ key?: (string | undefined);
137
+ };
138
+ hash: boolean;
139
+ forkTSChecker: { [x: string]: any };
140
+ fastRefresh: boolean;
141
+ extraPostCSSPlugins: Array<any>;
142
+ extraBabelPresets: Array<string | Array<any>>;
143
+ extraBabelPlugins: Array<string | Array<any>>;
144
+ extraBabelIncludes: Array<string | any>;
145
+ externals: { [x: string]: any } | string | ((...args: any[]) => unknown);
146
+ esm: {
147
+
148
+ };
149
+ devtool: "cheap-source-map" | "cheap-module-source-map" | "eval" | "eval-source-map" | "eval-cheap-source-map" | "eval-cheap-module-source-map" | "eval-nosources-cheap-source-map" | "eval-nosources-cheap-module-source-map" | "eval-nosources-source-map" | "source-map" | "hidden-source-map" | "hidden-nosources-cheap-source-map" | "hidden-nosources-cheap-module-source-map" | "hidden-nosources-source-map" | "hidden-cheap-source-map" | "hidden-cheap-module-source-map" | "inline-source-map" | "inline-cheap-source-map" | "inline-cheap-module-source-map" | "inline-nosources-cheap-source-map" | "inline-nosources-cheap-module-source-map" | "inline-nosources-source-map" | "nosources-source-map" | "nosources-cheap-source-map" | "nosources-cheap-module-source-map" | boolean;
150
+ depTranspiler: "babel" | "esbuild" | "swc" | "none";
151
+ define: { [x: string]: any };
152
+ deadCode: {
153
+ context?: (string | undefined);
154
+ detectUnusedExport?: (boolean | undefined);
155
+ detectUnusedFiles?: (boolean | undefined);
156
+ exclude?: (Array<string> | undefined);
157
+ failOnHint?: (boolean | undefined);
158
+ patterns?: (Array<string> | undefined);
159
+ };
160
+ cssPublicPath: string;
161
+ cssMinifierOptions: { [x: string]: any };
162
+ cssMinifier: "cssnano" | "esbuild" | "parcelCSS" | "none";
163
+ cssLoaderModules: { [x: string]: any };
164
+ cssLoader: { [x: string]: any };
165
+ copy: Array<{
166
+ from: string;
167
+ to: string;
168
+ } | string>;
169
+ checkDepCssModules?: boolean;
170
+ cacheDirectoryPath: string;
171
+ babelLoaderCustomize: string;
172
+ autoprefixer: { [x: string]: any };
173
+ autoCSSModules: boolean;
174
+ alias: { [x: string]: any };
175
+ crossorigin: boolean | {
176
+ includes?: (Array<any> | undefined);
177
+ };
178
+ esmi: {
179
+ cdnOrigin: string;
180
+ shimUrl?: (string | undefined);
181
+ };
182
+ exportStatic: {
183
+ extraRoutePaths?: (((...args: any[]) => unknown) | Array<string> | undefined);
184
+ ignorePreRenderError?: (boolean | undefined);
185
+ };
186
+ favicons: Array<string>;
187
+ helmet: boolean;
188
+ icons: {
189
+ autoInstall?: ({
190
+
191
+ } | undefined);
192
+ defaultComponentConfig?: ({
193
+
194
+ } | undefined);
195
+ alias?: ({
196
+
197
+ } | undefined);
198
+ include?: (Array<string> | undefined);
199
+ };
200
+ mock: {
201
+ exclude?: (Array<string> | undefined);
202
+ include?: (Array<string> | undefined);
203
+ };
204
+ mpa: {
205
+ template?: (string | undefined);
206
+ layout?: (string | undefined);
207
+ getConfigFromEntryFile?: (boolean | undefined);
208
+ entry?: ({
209
+
210
+ } | undefined);
211
+ };
212
+ phantomDependency: {
213
+ exclude?: (Array<string> | undefined);
214
+ };
215
+ polyfill: {
216
+ imports?: (Array<string> | undefined);
217
+ };
218
+ routePrefetch: {
219
+
220
+ };
221
+ terminal: {
222
+
223
+ };
224
+ tmpFiles: boolean;
225
+ clientLoader: {
226
+
227
+ };
228
+ routeProps: {
229
+
230
+ };
231
+ ssr: {
232
+ serverBuildPath?: (string | undefined);
233
+ platform?: (string | undefined);
234
+ builder?: ("esbuild" | "webpack" | undefined);
235
+ };
236
+ lowImport: {
237
+ libs?: (Array<any> | undefined);
238
+ css?: (string | undefined);
239
+ };
240
+ vite: {
241
+
242
+ };
243
+ apiRoute: {
244
+ platform?: (string | undefined);
245
+ };
246
+ monorepoRedirect: boolean | {
247
+ srcDir?: (Array<string> | undefined);
248
+ exclude?: (Array<any> | undefined);
249
+ peerDeps?: (boolean | undefined);
250
+ };
251
+ test: {
252
+
253
+ };
254
+ clickToComponent: {
255
+ /** 默认情况下,点击将默认编辑器为vscode, 你可以设置编辑器 vscode 或者 vscode-insiders */
256
+ editor?: (string | undefined);
257
+ };
258
+ legacy: {
259
+ buildOnly?: (boolean | undefined);
260
+ nodeModulesTransform?: (boolean | undefined);
261
+ checkOutput?: (boolean | undefined);
262
+ };
263
+ /** 设置 babel class-properties 启用 loose
264
+ @doc https://umijs.org/docs/api/config#classpropertiesloose */
265
+ classPropertiesLoose: boolean | {
266
+
267
+ };
268
+ ui: {
269
+
270
+ };
271
+ hmrGuardian: boolean;
272
+ verifyCommit: {
273
+ scope?: (Array<string> | undefined);
274
+ allowEmoji?: (boolean | undefined);
275
+ };
276
+ run: {
277
+ globals?: (Array<string> | undefined);
278
+ };
279
+ dva: {
280
+ extraModels?: (Array<string> | undefined);
281
+ immer?: ({ [x: string]: any } | undefined);
282
+ skipModelValidate?: (boolean | undefined);
283
+ };
284
+ };
285
+
286
+ type PrettifyWithCloseable<T> = {
287
+ [K in keyof T]: T[K] | false;
288
+ } & {};
289
+
290
+ export type IConfigFromPlugins = PrettifyWithCloseable<
291
+ IConfigFromPluginsJoi & Partial<IConfigTypes>
292
+ >;
web/src/.umi/core/pluginConfigJoi.d.ts ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ // This file is generated by Umi automatically
2
+ // DO NOT CHANGE IT MANUALLY!
3
+ // Created by Umi Plugin
4
+
5
+ export interface IConfigFromPluginsJoi {
6
+
7
+ }
web/src/.umi/core/polyfill.ts ADDED
@@ -0,0 +1,220 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // @ts-nocheck
2
+ // This file is generated by Umi automatically
3
+ // DO NOT CHANGE IT MANUALLY!
4
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.error.cause.js";
5
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.aggregate-error.js";
6
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.aggregate-error.cause.js";
7
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.array.at.js";
8
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.array.find-last.js";
9
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.array.find-last-index.js";
10
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.array.push.js";
11
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.array.reduce.js";
12
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.array.reduce-right.js";
13
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.array.to-reversed.js";
14
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.array.to-sorted.js";
15
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.array.to-spliced.js";
16
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.array.with.js";
17
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.map.group-by.js";
18
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.object.group-by.js";
19
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.object.has-own.js";
20
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.promise.any.js";
21
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.promise.with-resolvers.js";
22
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.reflect.to-string-tag.js";
23
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.regexp.flags.js";
24
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.string.at-alternative.js";
25
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.string.is-well-formed.js";
26
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.string.replace-all.js";
27
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.string.to-well-formed.js";
28
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.typed-array.at.js";
29
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.typed-array.find-last.js";
30
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.typed-array.find-last-index.js";
31
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.typed-array.set.js";
32
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.typed-array.to-reversed.js";
33
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.typed-array.to-sorted.js";
34
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/es.typed-array.with.js";
35
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.suppressed-error.constructor.js";
36
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array.from-async.js";
37
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array.filter-out.js";
38
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array.filter-reject.js";
39
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array.group.js";
40
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array.group-by.js";
41
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array.group-by-to-map.js";
42
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array.group-to-map.js";
43
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array.is-template-object.js";
44
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array.last-index.js";
45
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array.last-item.js";
46
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array.unique-by.js";
47
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array-buffer.detached.js";
48
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array-buffer.transfer.js";
49
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.array-buffer.transfer-to-fixed-length.js";
50
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-disposable-stack.constructor.js";
51
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.constructor.js";
52
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.as-indexed-pairs.js";
53
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.async-dispose.js";
54
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.drop.js";
55
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.every.js";
56
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.filter.js";
57
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.find.js";
58
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.flat-map.js";
59
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.for-each.js";
60
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.from.js";
61
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.indexed.js";
62
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.map.js";
63
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.reduce.js";
64
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.some.js";
65
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.take.js";
66
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.async-iterator.to-array.js";
67
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.bigint.range.js";
68
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.composite-key.js";
69
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.composite-symbol.js";
70
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.data-view.get-float16.js";
71
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.data-view.get-uint8-clamped.js";
72
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.data-view.set-float16.js";
73
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.data-view.set-uint8-clamped.js";
74
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.disposable-stack.constructor.js";
75
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.function.demethodize.js";
76
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.function.is-callable.js";
77
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.function.is-constructor.js";
78
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.function.metadata.js";
79
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.function.un-this.js";
80
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.constructor.js";
81
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.as-indexed-pairs.js";
82
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.dispose.js";
83
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.drop.js";
84
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.every.js";
85
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.filter.js";
86
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.find.js";
87
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.flat-map.js";
88
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.for-each.js";
89
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.from.js";
90
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.indexed.js";
91
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.map.js";
92
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.range.js";
93
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.reduce.js";
94
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.some.js";
95
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.take.js";
96
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.to-array.js";
97
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.iterator.to-async.js";
98
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.json.is-raw-json.js";
99
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.json.parse.js";
100
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.json.raw-json.js";
101
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.delete-all.js";
102
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.emplace.js";
103
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.every.js";
104
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.filter.js";
105
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.find.js";
106
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.find-key.js";
107
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.from.js";
108
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.includes.js";
109
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.key-by.js";
110
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.key-of.js";
111
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.map-keys.js";
112
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.map-values.js";
113
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.merge.js";
114
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.of.js";
115
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.reduce.js";
116
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.some.js";
117
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.update.js";
118
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.update-or-insert.js";
119
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.map.upsert.js";
120
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.clamp.js";
121
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.deg-per-rad.js";
122
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.degrees.js";
123
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.fscale.js";
124
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.f16round.js";
125
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.iaddh.js";
126
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.imulh.js";
127
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.isubh.js";
128
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.rad-per-deg.js";
129
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.radians.js";
130
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.scale.js";
131
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.seeded-prng.js";
132
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.signbit.js";
133
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.math.umulh.js";
134
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.number.from-string.js";
135
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.number.range.js";
136
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.object.iterate-entries.js";
137
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.object.iterate-keys.js";
138
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.object.iterate-values.js";
139
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.observable.js";
140
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.promise.try.js";
141
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.reflect.define-metadata.js";
142
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.reflect.delete-metadata.js";
143
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.reflect.get-metadata.js";
144
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.reflect.get-metadata-keys.js";
145
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.reflect.get-own-metadata.js";
146
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.reflect.get-own-metadata-keys.js";
147
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.reflect.has-metadata.js";
148
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.reflect.has-own-metadata.js";
149
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.reflect.metadata.js";
150
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.regexp.escape.js";
151
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.add-all.js";
152
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.delete-all.js";
153
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.difference.v2.js";
154
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.difference.js";
155
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.every.js";
156
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.filter.js";
157
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.find.js";
158
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.from.js";
159
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.intersection.v2.js";
160
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.intersection.js";
161
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.is-disjoint-from.v2.js";
162
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.is-disjoint-from.js";
163
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.is-subset-of.v2.js";
164
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.is-subset-of.js";
165
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.is-superset-of.v2.js";
166
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.is-superset-of.js";
167
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.join.js";
168
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.map.js";
169
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.of.js";
170
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.reduce.js";
171
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.some.js";
172
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.symmetric-difference.v2.js";
173
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.symmetric-difference.js";
174
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.union.v2.js";
175
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.set.union.js";
176
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.string.at.js";
177
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.string.cooked.js";
178
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.string.code-points.js";
179
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.string.dedent.js";
180
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.symbol.async-dispose.js";
181
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.symbol.dispose.js";
182
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.symbol.is-registered-symbol.js";
183
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.symbol.is-registered.js";
184
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.symbol.is-well-known-symbol.js";
185
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.symbol.is-well-known.js";
186
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.symbol.matcher.js";
187
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.symbol.metadata.js";
188
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.symbol.metadata-key.js";
189
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.symbol.observable.js";
190
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.symbol.pattern-match.js";
191
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.symbol.replace-all.js";
192
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.typed-array.from-async.js";
193
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.typed-array.filter-out.js";
194
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.typed-array.filter-reject.js";
195
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.typed-array.group-by.js";
196
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.typed-array.to-spliced.js";
197
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.typed-array.unique-by.js";
198
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.uint8-array.from-base64.js";
199
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.uint8-array.from-hex.js";
200
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.uint8-array.to-base64.js";
201
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.uint8-array.to-hex.js";
202
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.weak-map.delete-all.js";
203
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.weak-map.from.js";
204
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.weak-map.of.js";
205
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.weak-map.emplace.js";
206
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.weak-map.upsert.js";
207
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.weak-set.add-all.js";
208
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.weak-set.delete-all.js";
209
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.weak-set.from.js";
210
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/esnext.weak-set.of.js";
211
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/web.dom-exception.stack.js";
212
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/web.immediate.js";
213
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/web.self.js";
214
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/web.structured-clone.js";
215
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/web.url.can-parse.js";
216
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/web.url-search-params.delete.js";
217
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/web.url-search-params.has.js";
218
+ import "C:/Users/zfc/Desktop/docgpt/client/node_modules/core-js/modules/web.url-search-params.size.js";
219
+ import 'C:/Users/zfc/Desktop/docgpt/client/node_modules/@umijs/preset-umi/node_modules/regenerator-runtime/runtime.js';
220
+ export {};
web/src/.umi/core/route.tsx ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // @ts-nocheck
2
+ // This file is generated by Umi automatically
3
+ // DO NOT CHANGE IT MANUALLY!
4
+ import React from 'react';
5
+
6
+ export async function getRoutes() {
7
+ const routes = {"1":{"path":"/login","layout":false,"id":"1"},"2":{"path":"/","redirect":"/knowledge","parentId":"@@/global-layout","id":"2"},"3":{"id":"3","name":"知识库","icon":"home","auth":[3,4,100],"path":"/knowledge","pathname":"knowledge","parentId":"@@/global-layout"},"4":{"id":"4","name":"知识库","icon":"home","auth":[3,4,100],"path":"/knowledge/add/*","pathname":"knowledge","parentId":"@@/global-layout"},"5":{"id":"5","name":"聊天","icon":"home","auth":[3,4,100],"path":"/chat","pathname":"chat","parentId":"@@/global-layout"},"6":{"id":"6","name":"设置","icon":"home","auth":[3,4,100],"path":"/setting","pathname":"setting","parentId":"@@/global-layout"},"7":{"id":"7","name":"文件","icon":"file","auth":[3,4,100],"path":"/file","pathname":"file","parentId":"@@/global-layout"},"8":{"path":"/*","layout":false,"id":"8"},"@@/global-layout":{"id":"@@/global-layout","path":"/","isLayout":true}} as const;
8
+ return {
9
+ routes,
10
+ routeComponents: {
11
+ '1': React.lazy(() => import(/* webpackChunkName: "p__login__index" */'@/pages/login/index.tsx')),
12
+ '2': React.lazy(() => import(/* webpackChunkName: "layouts__index" */'@/layouts/index.tsx')),
13
+ '3': React.lazy(() => import(/* webpackChunkName: "p__knowledge__index" */'@/pages/knowledge/index.tsx')),
14
+ '4': React.lazy(() => import(/* webpackChunkName: "p__add-knowledge__index" */'@/pages/add-knowledge/index.tsx')),
15
+ '5': React.lazy(() => import(/* webpackChunkName: "p__chat__index" */'@/pages/chat/index.tsx')),
16
+ '6': React.lazy(() => import(/* webpackChunkName: "p__setting__index" */'@/pages/setting/index.tsx')),
17
+ '7': React.lazy(() => import(/* webpackChunkName: "p__file__index" */'@/pages/file/index.tsx')),
18
+ '8': React.lazy(() => import(/* webpackChunkName: "p__404" */'@/pages/404.jsx')),
19
+ '@@/global-layout': React.lazy(() => import(/* webpackChunkName: "layouts__index" */'C:/Users/zfc/Desktop/docgpt/client/src/layouts/index.tsx')),
20
+ },
21
+ };
22
+ }
web/src/.umi/core/terminal.ts ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // @ts-nocheck
2
+ // This file is generated by Umi automatically
3
+ // DO NOT CHANGE IT MANUALLY!
4
+ let count = 0;
5
+ let groupLevel = 0;
6
+ function send(type: string, message?: string) {
7
+ if(process.env.NODE_ENV==='production'){
8
+ return;
9
+ }else{
10
+ const encodedMessage = message ? `&m=${encodeURI(message)}` : '';
11
+ fetch(`/__umi/api/terminal?type=${type}&t=${Date.now()}&c=${count++}&g=${groupLevel}${encodedMessage}`, { mode: 'no-cors' })
12
+ }
13
+ }
14
+ function prettyPrint(obj: any) {
15
+ return JSON.stringify(obj, null, 2);
16
+ }
17
+ function stringifyObjs(objs: any[]) {
18
+ const obj = objs.length > 1 ? objs.map(stringify).join(' ') : objs[0];
19
+ return typeof obj === 'object' ? `${prettyPrint(obj)}` : obj.toString();
20
+ }
21
+ function stringify(obj: any) {
22
+ return typeof obj === 'object' ? `${JSON.stringify(obj)}` : obj.toString();
23
+ }
24
+ const terminal = {
25
+ log(...objs: any[]) { send('log', stringifyObjs(objs)) },
26
+ info(...objs: any[]) { send('info', stringifyObjs(objs)) },
27
+ warn(...objs: any[]) { send('warn', stringifyObjs(objs)) },
28
+ error(...objs: any[]) { send('error', stringifyObjs(objs)) },
29
+ group() { groupLevel++ },
30
+ groupCollapsed() { groupLevel++ },
31
+ groupEnd() { groupLevel && --groupLevel },
32
+ clear() { send('clear') },
33
+ trace(...args: any[]) { console.trace(...args) },
34
+ profile(...args: any[]) { console.profile(...args) },
35
+ profileEnd(...args: any[]) { console.profileEnd(...args) },
36
+ };
37
+ export { terminal };
web/src/.umi/exports.ts ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // @ts-nocheck
2
+ // This file is generated by Umi automatically
3
+ // DO NOT CHANGE IT MANUALLY!
4
+ // defineApp
5
+ export { defineApp } from './core/defineApp'
6
+ export type { RuntimeConfig } from './core/defineApp'
7
+ // plugins
8
+ export { connect, useDispatch, useStore, useSelector, getDvaApp } from 'C:/Users/zfc/Desktop/docgpt/client/src/.umi/plugin-dva';
9
+ export { Icon } from 'C:/Users/zfc/Desktop/docgpt/client/src/.umi/plugin-icons';
10
+ // plugins types.d.ts
11
+ export * from 'C:/Users/zfc/Desktop/docgpt/client/src/.umi/plugin-dva/types.d';
12
+ // @umijs/renderer-*
13
+ export { createBrowserHistory, createHashHistory, createMemoryHistory, Helmet, HelmetProvider, createSearchParams, generatePath, matchPath, matchRoutes, Navigate, NavLink, Outlet, resolvePath, useLocation, useMatch, useNavigate, useOutlet, useOutletContext, useParams, useResolvedPath, useRoutes, useSearchParams, useAppData, useClientLoaderData, useRouteProps, useSelectedRoutes, useServerLoaderData, renderClient, __getRoot, Link, useRouteData, __useFetcher, withRouter } from 'C:/Users/zfc/Desktop/docgpt/client/node_modules/@umijs/renderer-react';
14
+ export type { History } from 'C:/Users/zfc/Desktop/docgpt/client/node_modules/@umijs/renderer-react'
15
+ // umi/client/client/plugin
16
+ export { ApplyPluginsType, PluginManager } from 'C:/Users/zfc/Desktop/docgpt/client/node_modules/umi/client/client/plugin.js';
17
+ export { history, createHistory } from './core/history';
18
+ export { terminal } from './core/terminal';
19
+ // react ssr
20
+ export const useServerInsertedHTML: Function = () => {};
21
+ // test
22
+ export { TestBrowser } from './testBrowser';
web/src/.umi/plugin-dva/dva.tsx ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // @ts-nocheck
2
+ // This file is generated by Umi automatically
3
+ // DO NOT CHANGE IT MANUALLY!
4
+ // It's faked dva
5
+ // aliased to @umijs/plugins/templates/dva
6
+ import { create, Provider } from 'C:/Users/zfc/Desktop/docgpt/client/node_modules/@umijs/plugins/libs/dva.tsx';
7
+ import createLoading from 'C:/Users/zfc/Desktop/docgpt/client/node_modules/dva-loading/dist/index.js';
8
+
9
+ import React, { useRef } from 'react';
10
+ import { history, ApplyPluginsType, useAppData } from 'umi';
11
+ import { models } from './models';
12
+
13
+ let dvaApp: any;
14
+
15
+ export function RootContainer(props: any) {
16
+ const { pluginManager } = useAppData();
17
+ const app = useRef<any>();
18
+ const runtimeDva = pluginManager.applyPlugins({
19
+ key: 'dva',
20
+ type: ApplyPluginsType.modify,
21
+ initialValue: {},
22
+ });
23
+ if (!app.current) {
24
+ app.current = create(
25
+ {
26
+ history,
27
+ ...(runtimeDva.config || {}),
28
+ },
29
+ {
30
+ initialReducer: {},
31
+ setupMiddlewares(middlewares: Function[]) {
32
+ return [...middlewares];
33
+ },
34
+ setupApp(app: IDvaApp) {
35
+ app._history = history;
36
+ },
37
+ },
38
+ );
39
+ dvaApp = app.current;
40
+ app.current.use(createLoading());
41
+
42
+
43
+
44
+ (runtimeDva.plugins || []).forEach((p) => {
45
+ app.current.use(p);
46
+ });
47
+ for (const id of Object.keys(models)) {
48
+ app.current.model({
49
+ namespace: models[id].namespace,
50
+ ...models[id].model,
51
+ });
52
+ }
53
+ app.current.start();
54
+ }
55
+ return <Provider store={app.current!._store}>{props.children}</Provider>;
56
+ }
57
+
58
+ export function getDvaApp() {
59
+ return dvaApp;
60
+ }
web/src/.umi/plugin-dva/index.ts ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ // @ts-nocheck
2
+ // This file is generated by Umi automatically
3
+ // DO NOT CHANGE IT MANUALLY!
4
+ export { connect, useDispatch, useStore, useSelector } from 'C:/Users/zfc/Desktop/docgpt/client/node_modules/@umijs/plugins/libs/dva.tsx';
5
+ export { getDvaApp } from './dva';
web/src/.umi/plugin-dva/models.ts ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // @ts-nocheck
2
+ // This file is generated by Umi automatically
3
+ // DO NOT CHANGE IT MANUALLY!
4
+ import model_1 from 'C:/Users/zfc/Desktop/docgpt/client/src/pages/add-knowledge/components/knowledge-file/model';
5
+ import model_2 from 'C:/Users/zfc/Desktop/docgpt/client/src/pages/add-knowledge/components/knowledge-setting/model';
6
+ import model_3 from 'C:/Users/zfc/Desktop/docgpt/client/src/pages/add-knowledge/model';
7
+ import model_4 from 'C:/Users/zfc/Desktop/docgpt/client/src/pages/chat/model';
8
+ import model_5 from 'C:/Users/zfc/Desktop/docgpt/client/src/pages/knowledge/model';
9
+ import model_6 from 'C:/Users/zfc/Desktop/docgpt/client/src/pages/login/model';
10
+ import model_7 from 'C:/Users/zfc/Desktop/docgpt/client/src/pages/setting/model';
11
+
12
+ export const models = {
13
+ model_1: { namespace: 'add-knowledge.components.knowledge-file.model', model: model_1 },
14
+ model_2: { namespace: 'add-knowledge.components.knowledge-setting.model', model: model_2 },
15
+ model_3: { namespace: 'add-knowledge.model', model: model_3 },
16
+ model_4: { namespace: 'chat.model', model: model_4 },
17
+ model_5: { namespace: 'knowledge.model', model: model_5 },
18
+ model_6: { namespace: 'login.model', model: model_6 },
19
+ model_7: { namespace: 'setting.model', model: model_7 },
20
+ } as const
web/src/.umi/plugin-dva/runtime.tsx ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ // @ts-nocheck
2
+ // This file is generated by Umi automatically
3
+ // DO NOT CHANGE IT MANUALLY!
4
+ import React from 'react';
5
+ import { RootContainer } from './dva';
6
+
7
+ export function dataflowProvider(container, opts) {
8
+ return React.createElement(RootContainer, opts, container);
9
+ }
web/src/.umi/plugin-dva/runtimeConfig.d.ts ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // This file is generated by Umi automatically
2
+ // DO NOT CHANGE IT MANUALLY!
3
+ export interface IRuntimeConfig {
4
+ dva?: {
5
+ config?: {
6
+ initialState?: Record<string, any>;
7
+ onError?: any;
8
+ onStateChange?: any;
9
+ onAction?: any;
10
+ onHmr?: any;
11
+ onReducer?: any;
12
+ onEffect?: any;
13
+ extraReducers?: any;
14
+ extraEnhancers?: any;
15
+ [key: string]: any;
16
+ },
17
+ plugins?: string[];
18
+ }
19
+ }
web/src/.umi/plugin-dva/types.d.ts ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // This file is generated by Umi automatically
2
+ // DO NOT CHANGE IT MANUALLY!
3
+ import type { History } from 'umi';
4
+
5
+ export interface ConnectProps {
6
+ dispatch?: Dispatch;
7
+ }
8
+ type RequiredConnectProps = Required<ConnectProps>
9
+ export type ConnectRC<
10
+ T = {},
11
+ > = React.ForwardRefRenderFunction<any, T & RequiredConnectProps>;
12
+ interface Action<T = any> {
13
+ type: T
14
+ }
15
+ interface AnyAction extends Action {
16
+ // Allows any extra properties to be defined in an action.
17
+ [extraProps: string]: any
18
+ }
19
+ interface Dispatch<A extends Action = AnyAction> {
20
+ <T extends A>(action: T): T
21
+ }
22
+ interface EffectsCommandMap {
23
+ put: <A extends AnyAction>(action: A) => any,
24
+ call: Function,
25
+ select: Function,
26
+ take: Function,
27
+ cancel: Function,
28
+ [key: string]: any,
29
+ }
30
+ interface Action<T = any> {
31
+ type: T
32
+ }
33
+ export type Reducer<S = any, A extends Action = AnyAction> = (prevState: S, action: A) => S;
34
+ export type Effect = (action: AnyAction, effects: EffectsCommandMap) => void;
35
+ type EffectType = 'takeEvery' | 'takeLatest' | 'watcher' | 'throttle';
36
+ type EffectWithType = [Effect, { type: EffectType }];
37
+ export type Subscription = (api: SubscriptionAPI, done: Function) => void;
38
+
39
+ export interface ReducersMapObject<T> {
40
+ [key: string]: Reducer<T>,
41
+ }
42
+ export interface EffectsMapObject {
43
+ [key: string]: Effect | EffectWithType,
44
+ }
45
+ export interface SubscriptionAPI {
46
+ dispatch: Dispatch<any>,
47
+ history: History,
48
+ }
49
+ export interface SubscriptionsMapObject {
50
+ [key: string]: Subscription,
51
+ }
52
+ export interface DvaModel<T, E = EffectsMapObject, R = ReducersMapObject<T>> {
53
+ namespace: string,
54
+ state?: T,
55
+ reducers?: R,
56
+ effects?: E,
57
+ subscriptions?: SubscriptionsMapObject,
58
+ }
web/src/.umi/plugin-icons/icons.tsx ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ // @ts-nocheck
2
+ // This file is generated by Umi automatically
3
+ // DO NOT CHANGE IT MANUALLY!
4
+ import React from 'react';
5
+ const localGoogle = props => <svg width={16} height={17} viewBox="0 0 16 17" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}><g clipPath="url(#clip0_660_28)"><path d="M8 6.99902V10.0972H12.3054C12.1164 11.0936 11.549 11.9372 10.6981 12.5045L13.2945 14.5191C14.8072 13.1227 15.68 11.0718 15.68 8.63547C15.68 8.0682 15.6291 7.5227 15.5345 6.99911L8 6.99902Z" fill="#4285F4" /><path d="M3.51649 9.97632L2.93092 10.4246L0.858154 12.0391C2.17451 14.65 4.8725 16.4536 7.99974 16.4536C10.1597 16.4536 11.9706 15.7409 13.2942 14.5191L10.6979 12.5046C9.98516 12.9846 9.07606 13.2755 7.99974 13.2755C5.91976 13.2755 4.15254 11.8719 3.51976 9.98094L3.51649 9.97632Z" fill="#34A853" /><path d="M0.858119 4.86816C0.312695 5.94448 0 7.15905 0 8.45357C0 9.74809 0.312695 10.9627 0.858119 12.039C0.858119 12.0462 3.51998 9.97352 3.51998 9.97352C3.35998 9.49352 3.26541 8.98446 3.26541 8.45349C3.26541 7.92251 3.35998 7.41345 3.51998 6.93345L0.858119 4.86816Z" fill="#FBBC05" /><path d="M7.99991 3.63907C9.17811 3.63907 10.2254 4.04633 11.0617 4.83179L13.3526 2.54091C11.9635 1.24639 10.1599 0.453613 7.99991 0.453613C4.87266 0.453613 2.17451 2.24997 0.858154 4.86816L3.51994 6.93362C4.15263 5.04269 5.91992 3.63907 7.99991 3.63907Z" fill="#EA4335" /></g><defs><clipPath id="clip0_660_28"><rect width={16} height={16} fill="white" transform="translate(0 0.453613)" /></clipPath></defs></svg>;
6
+ export { localGoogle };
7
+ const localGithub = props => <svg width={17} height={17} viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}><g clipPath="url(#clip0_660_5)"><path fillRule="evenodd" clipRule="evenodd" d="M8.50662 0.453613C4.07917 0.453613 0.5 4.05917 0.5 8.51972C0.5 12.0853 2.79329 15.1035 5.9747 16.1717C6.37246 16.252 6.51816 15.9981 6.51816 15.7846C6.51816 15.5976 6.50505 14.9566 6.50505 14.2888C4.2778 14.7696 3.81399 13.3272 3.81399 13.3272C3.45606 12.3924 2.92572 12.1522 2.92572 12.1522C2.19674 11.658 2.97882 11.658 2.97882 11.658C3.78744 11.7115 4.21175 12.486 4.21175 12.486C4.92745 13.7145 6.08074 13.3674 6.54471 13.1537C6.61092 12.6328 6.82315 12.2723 7.0485 12.072C5.27211 11.885 3.40312 11.1906 3.40312 8.0923C3.40312 7.21091 3.72107 6.4898 4.22486 5.92897C4.14538 5.7287 3.86693 4.90057 4.30451 3.79219C4.30451 3.79219 4.98055 3.57848 6.50488 4.62016C7.1575 4.44359 7.83054 4.35377 8.50662 4.35302C9.18266 4.35302 9.87181 4.4466 10.5082 4.62016C12.0327 3.57848 12.7087 3.79219 12.7087 3.79219C13.1463 4.90057 12.8677 5.7287 12.7882 5.92897C13.3053 6.4898 13.6101 7.21091 13.6101 8.0923C13.6101 11.1906 11.7411 11.8716 9.95146 12.072C10.2432 12.3257 10.4949 12.8064 10.4949 13.5677C10.4949 14.6493 10.4818 15.5174 10.4818 15.7844C10.4818 15.9981 10.6277 16.252 11.0253 16.1719C14.2067 15.1033 16.5 12.0853 16.5 8.51972C16.5131 4.05917 12.9208 0.453613 8.50662 0.453613Z" fill="#24292F" /></g><defs><clipPath id="clip0_660_5"><rect width={16} height={16} fill="white" transform="translate(0.5 0.453613)" /></clipPath></defs></svg>;
8
+ export { localGithub };
web/src/.umi/plugin-icons/index.css ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .umiIconDoNotUseThisHover {
2
+ display: none;
3
+ }
4
+ .umiIconDoNotUseThis:hover svg {
5
+ display: none;
6
+ }
7
+ .umiIconDoNotUseThis:hover .umiIconDoNotUseThisHover {
8
+ display: inline-block;
9
+ }
10
+ .umiIconLoadingCircle {
11
+ display: inline-block;
12
+ -webkit-animation: loadingCircle 1s infinite linear;
13
+ animation: umiIconLoadingCircle 1s linear infinite;
14
+ }
15
+
16
+ @-webkit-keyframes umiIconLoadingCircle {
17
+ 100% {
18
+ -webkit-transform: rotate(360deg);
19
+ transform: rotate(360deg);
20
+ }
21
+ }
22
+ @keyframes umiIconLoadingCircle {
23
+ 100% {
24
+ -webkit-transform: rotate(360deg);
25
+ transform: rotate(360deg);
26
+ }
27
+ }
web/src/.umi/plugin-icons/index.tsx ADDED
@@ -0,0 +1,243 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // @ts-nocheck
2
+ // This file is generated by Umi automatically
3
+ // DO NOT CHANGE IT MANUALLY!
4
+ import React from 'react';
5
+ import * as iconsMap from './icons';
6
+ import './index.css';
7
+
8
+ const alias = {};
9
+ type AliasKeys = keyof typeof alias;
10
+ const localIcons = ["github","google"] as const;
11
+ type LocalIconsKeys = typeof localIcons[number];
12
+
13
+ type IconCollections = 'academicons' |
14
+ 'akar-icons' |
15
+ 'ant-design' |
16
+ 'arcticons' |
17
+ 'basil' |
18
+ 'bi' |
19
+ 'bpmn' |
20
+ 'brandico' |
21
+ 'bx' |
22
+ 'bxl' |
23
+ 'bxs' |
24
+ 'bytesize' |
25
+ 'carbon' |
26
+ 'charm' |
27
+ 'ci' |
28
+ 'cib' |
29
+ 'cif' |
30
+ 'cil' |
31
+ 'circle-flags' |
32
+ 'circum' |
33
+ 'clarity' |
34
+ 'codicon' |
35
+ 'cryptocurrency-color' |
36
+ 'cryptocurrency' |
37
+ 'dashicons' |
38
+ 'ei' |
39
+ 'el' |
40
+ 'emblemicons' |
41
+ 'emojione-monotone' |
42
+ 'emojione-v1' |
43
+ 'emojione' |
44
+ 'entypo-social' |
45
+ 'entypo' |
46
+ 'eos-icons' |
47
+ 'ep' |
48
+ 'et' |
49
+ 'eva' |
50
+ 'fa-brands' |
51
+ 'fa-regular' |
52
+ 'fa-solid' |
53
+ 'fa' |
54
+ 'fa6-brands' |
55
+ 'fa6-regular' |
56
+ 'fa6-solid' |
57
+ 'fad' |
58
+ 'fe' |
59
+ 'feather' |
60
+ 'file-icons' |
61
+ 'flag' |
62
+ 'flagpack' |
63
+ 'flat-color-icons' |
64
+ 'flat-ui' |
65
+ 'fluent-emoji-flat' |
66
+ 'fluent-emoji-high-contrast' |
67
+ 'fluent-emoji' |
68
+ 'fluent-mdl2' |
69
+ 'fluent' |
70
+ 'fontelico' |
71
+ 'fontisto' |
72
+ 'foundation' |
73
+ 'fxemoji' |
74
+ 'gala' |
75
+ 'game-icons' |
76
+ 'geo' |
77
+ 'gg' |
78
+ 'gis' |
79
+ 'gridicons' |
80
+ 'grommet-icons' |
81
+ 'healthicons' |
82
+ 'heroicons-outline' |
83
+ 'heroicons-solid' |
84
+ 'heroicons' |
85
+ 'humbleicons' |
86
+ 'ic' |
87
+ 'icomoon-free' |
88
+ 'icon-park-outline' |
89
+ 'icon-park-solid' |
90
+ 'icon-park-twotone' |
91
+ 'icon-park' |
92
+ 'iconoir' |
93
+ 'icons8' |
94
+ 'il' |
95
+ 'ion' |
96
+ 'iwwa' |
97
+ 'jam' |
98
+ 'la' |
99
+ 'line-md' |
100
+ 'logos' |
101
+ 'ls' |
102
+ 'lucide' |
103
+ 'majesticons' |
104
+ 'maki' |
105
+ 'map' |
106
+ 'material-symbols' |
107
+ 'mdi-light' |
108
+ 'mdi' |
109
+ 'medical-icon' |
110
+ 'memory' |
111
+ 'mi' |
112
+ 'mingcute' |
113
+ 'mono-icons' |
114
+ 'nimbus' |
115
+ 'nonicons' |
116
+ 'noto-v1' |
117
+ 'noto' |
118
+ 'octicon' |
119
+ 'oi' |
120
+ 'ooui' |
121
+ 'openmoji' |
122
+ 'pajamas' |
123
+ 'pepicons-pop' |
124
+ 'pepicons-print' |
125
+ 'pepicons' |
126
+ 'ph' |
127
+ 'pixelarticons' |
128
+ 'prime' |
129
+ 'ps' |
130
+ 'quill' |
131
+ 'radix-icons' |
132
+ 'raphael' |
133
+ 'ri' |
134
+ 'si-glyph' |
135
+ 'simple-icons' |
136
+ 'simple-line-icons' |
137
+ 'skill-icons' |
138
+ 'subway' |
139
+ 'svg-spinners' |
140
+ 'system-uicons' |
141
+ 'tabler' |
142
+ 'teenyicons' |
143
+ 'topcoat' |
144
+ 'twemoji' |
145
+ 'typcn' |
146
+ 'uil' |
147
+ 'uim' |
148
+ 'uis' |
149
+ 'uit' |
150
+ 'uiw' |
151
+ 'vaadin' |
152
+ 'vs' |
153
+ 'vscode-icons' |
154
+ 'websymbol' |
155
+ 'whh' |
156
+ 'wi' |
157
+ 'wpf' |
158
+ 'zmdi' |
159
+ 'zondicons';
160
+ type Icon = `${IconCollections}:${string}`;
161
+
162
+ interface IUmiIconProps extends React.SVGAttributes<SVGElement> {
163
+ icon: AliasKeys | Icon | `local:${LocalIconsKeys}`;
164
+ hover?: AliasKeys | string;
165
+ className?: string;
166
+ viewBox?: string;
167
+ width?: string;
168
+ height?: string;
169
+ style?: any;
170
+ spin?: boolean;
171
+ rotate?: number | string;
172
+ flip?: 'vertical' | 'horizontal' | 'horizontal,vertical' | 'vertical,horizontal';
173
+ }
174
+
175
+ export const Icon = React.forwardRef<HTMLSpanElement, IUmiIconProps>((props, ref) => {
176
+ const { icon, hover, style, className = '' , rotate, spin, flip, ...extraProps } = props;
177
+ const iconName = normalizeIconName(alias[icon] || icon);
178
+ const Component = iconsMap[iconName];
179
+ if (!Component) {
180
+ // TODO: give a error icon when dev, to help developer find the error
181
+ return null;
182
+ }
183
+ const HoverComponent = hover ? iconsMap[normalizeIconName(alias[hover] || hover)] : null;
184
+ const cls = spin ? 'umiIconLoadingCircle' : undefined;
185
+ const svgStyle = {};
186
+ const transform: string[] = [];
187
+ if (rotate) {
188
+ const rotateDeg = normalizeRotate(rotate);
189
+ transform.push(`rotate(${rotateDeg}deg)`);
190
+ }
191
+ if (flip) {
192
+ const flipMap = flip.split(',').reduce((memo, item) => {
193
+ memo[item] = 1;
194
+ return memo;
195
+ }, {});
196
+ if (flipMap.vertical) {
197
+ transform.push(`rotateY(180deg)`);
198
+ }
199
+ if (flipMap.horizontal) {
200
+ transform.push(`rotateX(180deg)`);
201
+ }
202
+ }
203
+ if (transform.length) {
204
+ const transformStr = transform.join('');
205
+ svgStyle.msTransform = transformStr;
206
+ svgStyle.transform = transformStr;
207
+ }
208
+
209
+ const spanClassName = HoverComponent ? 'umiIconDoNotUseThis ' : '' + className;
210
+ const spanClass = spanClassName ? { className: spanClassName } : {};
211
+
212
+ return (
213
+ <span role="img" ref={ref} {...spanClass} style={style}>
214
+ <Component {...extraProps} className={cls} style={svgStyle} />
215
+ {
216
+ HoverComponent ? <HoverComponent {...extraProps} className={'umiIconDoNotUseThisHover ' + cls} style={svgStyle} /> : null
217
+ }
218
+ </span>
219
+ );
220
+ });
221
+
222
+ function normalizeRotate(rotate: number | string) {
223
+ if (typeof rotate === 'number') {
224
+ return rotate * 90;
225
+ }
226
+ if (typeof rotate === 'string') {
227
+ if (rotate.endsWith('deg')) {
228
+ return parseInt(rotate, 10);
229
+ }
230
+ if (rotate.endsWith('%')) {
231
+ return parseInt(rotate, 10) / 100 * 360;
232
+ }
233
+ return 0;
234
+ }
235
+ }
236
+
237
+ function camelCase(str: string) {
238
+ return str.replace(/\//g, '-').replace(/-([a-zA-Z]|[1-9])/g, (g) => g[1].toUpperCase());
239
+ }
240
+
241
+ function normalizeIconName(name: string) {
242
+ return camelCase(name.replace(':', '-'));
243
+ }
web/src/.umi/testBrowser.tsx ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // @ts-nocheck
2
+ // This file is generated by Umi automatically
3
+ // DO NOT CHANGE IT MANUALLY!
4
+ import React, { useEffect, useState } from 'react';
5
+ import { ApplyPluginsType } from 'umi';
6
+ import { renderClient, RenderClientOpts } from 'C:/Users/zfc/Desktop/docgpt/client/node_modules/@umijs/renderer-react';
7
+ import { createHistory } from './core/history';
8
+ import { createPluginManager } from './core/plugin';
9
+ import { getRoutes } from './core/route';
10
+ import type { Location } from 'history';
11
+
12
+
13
+ const publicPath = '/';
14
+ const runtimePublicPath = false;
15
+
16
+ type TestBrowserProps = {
17
+ location?: Partial<Location>;
18
+ historyRef?: React.MutableRefObject<Location>;
19
+ };
20
+
21
+ export function TestBrowser(props: TestBrowserProps) {
22
+ const pluginManager = createPluginManager();
23
+ const [context, setContext] = useState<RenderClientOpts | undefined>(
24
+ undefined
25
+ );
26
+ useEffect(() => {
27
+ const genContext = async () => {
28
+ const { routes, routeComponents } = await getRoutes(pluginManager);
29
+ // allow user to extend routes
30
+ await pluginManager.applyPlugins({
31
+ key: 'patchRoutes',
32
+ type: ApplyPluginsType.event,
33
+ args: {
34
+ routes,
35
+ routeComponents,
36
+ },
37
+ });
38
+ const contextOpts = pluginManager.applyPlugins({
39
+ key: 'modifyContextOpts',
40
+ type: ApplyPluginsType.modify,
41
+ initialValue: {},
42
+ });
43
+ const basename = contextOpts.basename || '/';
44
+ const history = createHistory({
45
+ type: 'memory',
46
+ basename,
47
+ });
48
+ const context = {
49
+ routes,
50
+ routeComponents,
51
+ pluginManager,
52
+ rootElement: contextOpts.rootElement || document.getElementById('root'),
53
+ publicPath,
54
+ runtimePublicPath,
55
+ history,
56
+ basename,
57
+ components: true,
58
+ };
59
+ const modifiedContext = pluginManager.applyPlugins({
60
+ key: 'modifyClientRenderOpts',
61
+ type: ApplyPluginsType.modify,
62
+ initialValue: context,
63
+ });
64
+ return modifiedContext;
65
+ };
66
+ genContext().then((context) => {
67
+ setContext(context);
68
+ if (props.location) {
69
+ context?.history?.push(props.location);
70
+ }
71
+ if (props.historyRef) {
72
+ props.historyRef.current = context?.history;
73
+ }
74
+ });
75
+ }, []);
76
+
77
+ if (context === undefined) {
78
+ return <div id="loading" />;
79
+ }
80
+
81
+ const Children = renderClient(context);
82
+ return (
83
+ <React.Fragment>
84
+ <Children />
85
+ </React.Fragment>
86
+ );
87
+ }
web/src/.umi/tsconfig.json ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "compilerOptions": {
3
+ "target": "esnext",
4
+ "module": "esnext",
5
+ "lib": [
6
+ "dom",
7
+ "dom.iterable",
8
+ "esnext"
9
+ ],
10
+ "allowJs": true,
11
+ "skipLibCheck": true,
12
+ "moduleResolution": "bundler",
13
+ "importHelpers": true,
14
+ "noEmit": true,
15
+ "jsx": "react-jsx",
16
+ "esModuleInterop": true,
17
+ "sourceMap": true,
18
+ "baseUrl": "../../",
19
+ "strict": true,
20
+ "resolveJsonModule": true,
21
+ "allowSyntheticDefaultImports": true,
22
+ "paths": {
23
+ "@/*": [
24
+ "src/*"
25
+ ],
26
+ "@@/*": [
27
+ "src/.umi/*"
28
+ ],
29
+ "umi": [
30
+ "C:\\Users\\zfc\\Desktop\\docgpt\\client\\node_modules\\umi"
31
+ ],
32
+ "umi/typings": [
33
+ "src/.umi/typings"
34
+ ]
35
+ }
36
+ },
37
+ "include": [
38
+ "../../.umirc.ts",
39
+ "../../**/*.d.ts",
40
+ "../../**/*.ts",
41
+ "../../**/*.tsx"
42
+ ]
43
+ }
web/src/.umi/typings.d.ts ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // This file is generated by Umi automatically
2
+ // DO NOT CHANGE IT MANUALLY!
3
+ type CSSModuleClasses = { readonly [key: string]: string }
4
+ declare module '*.css' {
5
+ const classes: CSSModuleClasses
6
+ export default classes
7
+ }
8
+ declare module '*.scss' {
9
+ const classes: CSSModuleClasses
10
+ export default classes
11
+ }
12
+ declare module '*.sass' {
13
+ const classes: CSSModuleClasses
14
+ export default classes
15
+ }
16
+ declare module '*.less' {
17
+ const classes: CSSModuleClasses
18
+ export default classes
19
+ }
20
+ declare module '*.styl' {
21
+ const classes: CSSModuleClasses
22
+ export default classes
23
+ }
24
+ declare module '*.stylus' {
25
+ const classes: CSSModuleClasses
26
+ export default classes
27
+ }
28
+
29
+ // images
30
+ declare module '*.jpg' {
31
+ const src: string
32
+ export default src
33
+ }
34
+ declare module '*.jpeg' {
35
+ const src: string
36
+ export default src
37
+ }
38
+ declare module '*.png' {
39
+ const src: string
40
+ export default src
41
+ }
42
+ declare module '*.gif' {
43
+ const src: string
44
+ export default src
45
+ }
46
+ declare module '*.svg' {
47
+ import * as React from 'react';
48
+ export const ReactComponent: React.FunctionComponent<React.SVGProps<
49
+ SVGSVGElement
50
+ > & { title?: string }>;
51
+
52
+ const src: string
53
+ export default src
54
+ }
55
+ declare module '*.ico' {
56
+ const src: string
57
+ export default src
58
+ }
59
+ declare module '*.webp' {
60
+ const src: string
61
+ export default src
62
+ }
63
+ declare module '*.avif' {
64
+ const src: string
65
+ export default src
66
+ }
67
+
68
+ // media
69
+ declare module '*.mp4' {
70
+ const src: string
71
+ export default src
72
+ }
73
+ declare module '*.webm' {
74
+ const src: string
75
+ export default src
76
+ }
77
+ declare module '*.ogg' {
78
+ const src: string
79
+ export default src
80
+ }
81
+ declare module '*.mp3' {
82
+ const src: string
83
+ export default src
84
+ }
85
+ declare module '*.wav' {
86
+ const src: string
87
+ export default src
88
+ }
89
+ declare module '*.flac' {
90
+ const src: string
91
+ export default src
92
+ }
93
+ declare module '*.aac' {
94
+ const src: string
95
+ export default src
96
+ }
97
+
98
+ // fonts
99
+ declare module '*.woff' {
100
+ const src: string
101
+ export default src
102
+ }
103
+ declare module '*.woff2' {
104
+ const src: string
105
+ export default src
106
+ }
107
+ declare module '*.eot' {
108
+ const src: string
109
+ export default src
110
+ }
111
+ declare module '*.ttf' {
112
+ const src: string
113
+ export default src
114
+ }
115
+ declare module '*.otf' {
116
+ const src: string
117
+ export default src
118
+ }
119
+
120
+ // other
121
+ declare module '*.wasm' {
122
+ const initWasm: (options: WebAssembly.Imports) => Promise<WebAssembly.Exports>
123
+ export default initWasm
124
+ }
125
+ declare module '*.webmanifest' {
126
+ const src: string
127
+ export default src
128
+ }
129
+ declare module '*.pdf' {
130
+ const src: string
131
+ export default src
132
+ }
133
+ declare module '*.txt' {
134
+ const src: string
135
+ export default src
136
+ }
web/src/.umi/umi.ts ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // @ts-nocheck
2
+ // This file is generated by Umi automatically
3
+ // DO NOT CHANGE IT MANUALLY!
4
+ import './core/polyfill';
5
+
6
+ import { renderClient } from 'C:/Users/zfc/Desktop/docgpt/client/node_modules/@umijs/renderer-react';
7
+ import { getRoutes } from './core/route';
8
+ import { createPluginManager } from './core/plugin';
9
+ import { createHistory } from './core/history';
10
+ import { ApplyPluginsType } from 'umi';
11
+
12
+
13
+ const publicPath = "/client/dist/";
14
+ const runtimePublicPath = false;
15
+
16
+ async function render() {
17
+ const pluginManager = createPluginManager();
18
+ const { routes, routeComponents } = await getRoutes(pluginManager);
19
+
20
+ // allow user to extend routes
21
+ await pluginManager.applyPlugins({
22
+ key: 'patchRoutes',
23
+ type: ApplyPluginsType.event,
24
+ args: {
25
+ routes,
26
+ routeComponents,
27
+ },
28
+ });
29
+
30
+ const contextOpts = pluginManager.applyPlugins({
31
+ key: 'modifyContextOpts',
32
+ type: ApplyPluginsType.modify,
33
+ initialValue: {},
34
+ });
35
+
36
+ const basename = contextOpts.basename || '/';
37
+ const historyType = contextOpts.historyType || 'hash';
38
+
39
+ const history = createHistory({
40
+ type: historyType,
41
+ basename,
42
+ ...contextOpts.historyOpts,
43
+ });
44
+
45
+ return (pluginManager.applyPlugins({
46
+ key: 'render',
47
+ type: ApplyPluginsType.compose,
48
+ initialValue() {
49
+ const context = {
50
+ routes,
51
+ routeComponents,
52
+ pluginManager,
53
+ rootElement: contextOpts.rootElement || document.getElementById('root'),
54
+ publicPath,
55
+ runtimePublicPath,
56
+ history,
57
+ historyType,
58
+ basename,
59
+ callback: contextOpts.callback,
60
+ };
61
+ const modifiedContext = pluginManager.applyPlugins({
62
+ key: 'modifyClientRenderOpts',
63
+ type: ApplyPluginsType.modify,
64
+ initialValue: context,
65
+ });
66
+ return renderClient(modifiedContext);
67
+ },
68
+ }))();
69
+ }
70
+
71
+
72
+ render();
73
+
74
+ window.g_umi = {
75
+ version: '4.1.0',
76
+ };
web/src/assets/logo.png ADDED
web/src/assets/yay.jpg ADDED
web/src/icons/github.svg ADDED
web/src/icons/google.svg ADDED
web/src/layouts/components/user/index.tsx ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React, { useMemo } from 'react';
2
+ import type { MenuProps } from 'antd';
3
+ import { Button, Dropdown, } from 'antd';
4
+ import { history } from 'umi'
5
+ import { useTranslation, Trans } from 'react-i18next'
6
+
7
+ const App: React.FC = () => {
8
+ const { t } = useTranslation()
9
+ const logout = () => { history.push('/login') }
10
+ const toSetting = () => { history.push('/setting') }
11
+ const items: MenuProps['items'] = useMemo(() => {
12
+ return [
13
+ {
14
+ key: '1',
15
+ label: (
16
+ <Button type="text" onClick={logout}>{t('header.logout')}</Button>
17
+ ),
18
+ },
19
+ {
20
+ key: '2',
21
+ label: (
22
+ <Button type="text" onClick={toSetting}>{t('header.setting')}</Button>
23
+ ),
24
+ },
25
+ ]
26
+ }, []);
27
+
28
+ return (<>
29
+ <Dropdown menu={{ items }} placement="bottomLeft" arrow>
30
+ <img
31
+ style={{ width: '50px', height: '50px', borderRadius: '25px' }}
32
+ src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
33
+ />
34
+ </Dropdown>
35
+ </>)
36
+ }
37
+
38
+ export default App;
web/src/layouts/index.less ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .navs {
2
+ ul {
3
+ padding: 0;
4
+ list-style: none;
5
+ display: flex;
6
+ }
7
+
8
+ li {
9
+ margin-right: 1em;
10
+ }
11
+ }
12
+
13
+ .layout {
14
+ height: 100vh;
15
+ }
16
+
17
+ body {
18
+ margin: 0;
19
+ }
20
+
21
+ .tag {
22
+ height: 40px;
23
+ padding: 0 30px;
24
+ margin: 0 5px;
25
+ border: 1px solid #000;
26
+ border-radius: 10px;
27
+ cursor: pointer;
28
+ }
29
+
30
+ .checked {
31
+ color: #1677ff;
32
+ border-color: #1677ff;
33
+ }
web/src/layouts/index.tsx ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React, { useEffect, useState } from 'react';
2
+ import { history, Outlet, useLocation, useNavigate } from 'umi';
3
+ import { useTranslation, Trans } from 'react-i18next'
4
+ import classnames from 'classnames'
5
+ import '../locales/config';
6
+ import logo from '@/assets/logo.png'
7
+ import {
8
+ RedditOutlined
9
+ } from '@ant-design/icons';
10
+ import { Layout, Button, theme, Space, } from 'antd';
11
+ import styles from './index.less'
12
+ import User from './components/user'
13
+ import { head } from 'lodash';
14
+
15
+ const { Header, Content } = Layout;
16
+
17
+ const App: React.FC = (props) => {
18
+ const { t } = useTranslation()
19
+ const navigate = useNavigate()
20
+ const {
21
+ token: { colorBgContainer, borderRadiusLG },
22
+ } = theme.useToken();
23
+ const [current, setCurrent] = useState('knowledge');
24
+
25
+ const location = useLocation();
26
+ useEffect(() => {
27
+ if (location.pathname !== '/') {
28
+ const path = location.pathname.split('/')
29
+ setCurrent(path[1]);
30
+ }
31
+ console.log(location.pathname.split('/'))
32
+ }, [location.pathname])
33
+
34
+ const handleChange = (path: string) => {
35
+ setCurrent(path)
36
+ navigate(path);
37
+ };
38
+ const tagsData = [{ path: '/knowledge', name: 'knowledge' }, { path: '/chat', name: 'chat' }, { path: '/file', name: 'file' }];
39
+
40
+ return (
41
+ <Layout className={styles.layout} >
42
+ <Layout>
43
+ <Header style={{ padding: '0 8px', background: colorBgContainer, display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
44
+
45
+ <img src={logo} alt="" style={{ height: 30, width: 30 }} />
46
+ <Space size={[0, 8]} wrap>
47
+ {tagsData.map((item) =>
48
+ (<span key={item.name} className={classnames(styles['tag'], {
49
+ [styles['checked']]: current === item.name
50
+ })} onClick={() => handleChange(item.path)}>
51
+ {item.name}
52
+ </span>)
53
+ )}
54
+ </Space>
55
+ <User ></User>
56
+ </Header>
57
+ <Content
58
+ style={{
59
+ margin: '24px 16px',
60
+
61
+ minHeight: 280,
62
+ background: colorBgContainer,
63
+ borderRadius: borderRadiusLG,
64
+ overflow: 'auto'
65
+ }}
66
+ >
67
+ <Outlet />
68
+ </Content>
69
+ </Layout>
70
+ </Layout >
71
+ );
72
+ };
73
+
74
+ export default App;
web/src/locales/config.ts ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import i18n from 'i18next';
2
+ import { initReactI18next } from 'react-i18next';
3
+
4
+ import translation_en from './en.json';
5
+ import translation_zh from './zh.json';
6
+
7
+ const resources = {
8
+ en: {
9
+ translation: translation_en,
10
+ },
11
+ zh: {
12
+ translation: translation_zh,
13
+ },
14
+ };
15
+
16
+ i18n.use(initReactI18next).init({
17
+ resources,
18
+ lng: 'zh',
19
+ interpolation: {
20
+ escapeValue: false,
21
+ },
22
+ });
23
+
24
+ export default i18n;
web/src/locales/en.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "header": {
3
+ "register": "Register",
4
+ "signin": "Sign In",
5
+ "home": "Home",
6
+ "setting": "用户设置",
7
+ "logout": "登出"
8
+ },
9
+ "footer": {
10
+ "detail": "All rights reserved @ React"
11
+ },
12
+ "layout": {
13
+ "file": "file",
14
+ "knowledge": "knowledge",
15
+ "chat": "chat"
16
+ },
17
+ "setting": {
18
+ "btn": "en"
19
+ }
20
+ }
web/src/locales/zh.json ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "header": {
3
+ "register": "注册",
4
+ "signin": "登陆",
5
+ "home": "首页",
6
+ "setting": "user setting",
7
+ "logout": "logout"
8
+ },
9
+ "footer": {
10
+ "detail": "版权所有 @ React"
11
+ },
12
+ "layout": {
13
+ "file": "文件",
14
+ "knowledge": "知识库",
15
+ "chat": "聊天"
16
+ },
17
+ "setting": {
18
+ "btn": "中文"
19
+ }
20
+ }
web/src/pages/404.jsx ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { Button, Result } from 'antd';
2
+ import React from 'react';
3
+ import { history } from 'umi';
4
+
5
+ const NoFoundPage = () => {
6
+ return (<Result
7
+ status="404"
8
+ title="404"
9
+ subTitle="页面未找到,请输入正确的地址。"
10
+ extra={< Button type="primary" onClick={() => history.push('/')}>
11
+ 返回主页
12
+ </Button>}
13
+ />
14
+ )
15
+ };
16
+
17
+ export default NoFoundPage;
web/src/pages/add-knowledge/components/knowledge-file/createEFileModal.tsx ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { connect } from 'umi';
2
+ import i18n from 'i18next';
3
+ import { useTranslation, Trans } from 'react-i18next'
4
+ import { Input, Modal, Form } from 'antd'
5
+ import { rsaPsw } from '@/utils'
6
+ import styles from './index.less';
7
+
8
+ type FieldType = {
9
+ name?: string;
10
+ };
11
+ const Index = ({ kFModel, dispatch, getKfList, kb_id }) => {
12
+ const { isShowCEFwModal } = kFModel
13
+ const { t } = useTranslation()
14
+ const handleCancel = () => {
15
+ dispatch({
16
+ type: 'kFModel/updateState',
17
+ payload: {
18
+ isShowCEFwModal: false
19
+ }
20
+ });
21
+ };
22
+ const [form] = Form.useForm()
23
+ const handleOk = async () => {
24
+ try {
25
+ const values = await form.validateFields();
26
+ dispatch({
27
+ type: 'kFModel/document_create',
28
+ payload: {
29
+ name: values.name,
30
+ kb_id
31
+ },
32
+ callback: () => {
33
+ dispatch({
34
+ type: 'kFModel/updateState',
35
+ payload: {
36
+ isShowCEFwModal: false
37
+ }
38
+ });
39
+ getKfList && getKfList()
40
+ }
41
+ });
42
+
43
+ } catch (errorInfo) {
44
+ console.log('Failed:', errorInfo);
45
+ }
46
+ };
47
+
48
+ return (
49
+ <Modal title="Basic Modal" open={isShowCEFwModal} onOk={handleOk} onCancel={handleCancel}>
50
+ <Form
51
+ form={form}
52
+ name="validateOnly"
53
+ labelCol={{ span: 8 }}
54
+ wrapperCol={{ span: 16 }}
55
+ style={{ maxWidth: 600 }}
56
+ autoComplete="off"
57
+ >
58
+ <Form.Item<FieldType>
59
+ label="文件名"
60
+ name="name"
61
+ rules={[{ required: true, message: 'Please input name!' }]}
62
+ >
63
+ <Input />
64
+ </Form.Item>
65
+
66
+ </Form>
67
+ </Modal >
68
+
69
+
70
+ );
71
+ }
72
+ export default connect(({ kFModel, loading }) => ({ kFModel, loading }))(Index);
web/src/pages/add-knowledge/components/knowledge-file/index.less ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .filter {
2
+ height: 32px;
3
+ display: flex;
4
+ margin: 10px 0;
5
+ justify-content: space-between;
6
+
7
+ .search {
8
+ flex: 1;
9
+ }
10
+
11
+ .operate {
12
+ width: 200px;
13
+ }
14
+ }
15
+
16
+ .img {
17
+ height: 16px;
18
+ width: 16px;
19
+ margin-right: 6px;
20
+ }
21
+
22
+ .column {
23
+ min-width: 200px
24
+ }
web/src/pages/add-knowledge/components/knowledge-file/index.tsx ADDED
@@ -0,0 +1,218 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import React, { useCallback, useEffect, useMemo, useState } from 'react';
2
+ import { connect, useNavigate, useLocation } from 'umi'
3
+ import { Space, Table, Tag, Input, Button, Switch, Popover, Dropdown, } from 'antd';
4
+ import type { MenuProps } from 'antd';
5
+ import { PlusOutlined, DownOutlined } from '@ant-design/icons'
6
+ import { debounce } from 'lodash';
7
+ import type { ColumnsType } from 'antd/es/table';
8
+ import UploadFile from './upload'
9
+ import CreateEPModal from './createEFileModal'
10
+ import SegmentSetModal from './segmentSetModal'
11
+ import styles from './index.less'
12
+
13
+ interface DataType {
14
+ name: string;
15
+ chunk_num: string;
16
+ token_num: number;
17
+ update_date: string;
18
+ size: string;
19
+ status: string;
20
+ id: string;
21
+ parser_id: string
22
+ }
23
+
24
+
25
+
26
+ const Index: React.FC = ({ kFModel, dispatch, id }) => {
27
+ const { data, loading } = kFModel
28
+ const [inputValue, setInputValue] = useState('')
29
+ const [doc_id, setDocId] = useState('0')
30
+ const [parser_id, setParserId] = useState('0')
31
+ const changeValue = (value: string) => {
32
+ {
33
+ console.log(value)
34
+ }
35
+ }
36
+ const getKfList = () => {
37
+ dispatch({
38
+ type: 'kFModel/getKfList',
39
+ payload: {
40
+ kb_id: id
41
+ }
42
+ });
43
+ }
44
+ useEffect(() => {
45
+ if (id) {
46
+ getKfList()
47
+ }
48
+ }, [id])
49
+ const debounceChange = debounce(changeValue, 300)
50
+ const debounceCallback = useCallback((value: string) => debounceChange(value), [])
51
+ const handleInputChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
52
+ const value = e.target.value
53
+ setInputValue(value)
54
+ debounceCallback(e.target.value)
55
+
56
+ }
57
+ const onChangeStatus = (e: boolean, doc_id: string) => {
58
+ dispatch({
59
+ type: 'kFModel/updateDocumentStatus',
60
+ payload: {
61
+ doc_id,
62
+ status: Number(e)
63
+ },
64
+ callback() {
65
+ getKfList()
66
+ }
67
+ });
68
+ }
69
+ const onRmDocument = () => {
70
+ dispatch({
71
+ type: 'kFModel/document_rm',
72
+ payload: {
73
+ doc_id
74
+ },
75
+ callback() {
76
+ getKfList()
77
+ }
78
+ });
79
+
80
+ }
81
+ const showCEFModal = () => {
82
+ dispatch({
83
+ type: 'kFModel/updateState',
84
+ payload: {
85
+ isShowCEFwModal: true
86
+ }
87
+ });
88
+ };
89
+
90
+ const showSegmentSetModal = () => {
91
+ dispatch({
92
+ type: 'kFModel/updateState',
93
+ payload: {
94
+ isShowSegmentSetModal: true
95
+ }
96
+ });
97
+ };
98
+ const actionItems: MenuProps['items'] = useMemo(() => {
99
+ return [
100
+ {
101
+ key: '1',
102
+ label: (
103
+ <div>
104
+ <UploadFile kb_id={id} getKfList={getKfList} />
105
+ </div>
106
+
107
+ ),
108
+ },
109
+ {
110
+ key: '2',
111
+ label: (
112
+ <div>
113
+ <Button type="link" onClick={showCEFModal}> 导入虚拟文件</Button>
114
+ </div>
115
+ ),
116
+ // disabled: true,
117
+ },
118
+ ]
119
+ }, [id]);
120
+ const chunkItems: MenuProps['items'] = [
121
+ {
122
+ key: '1',
123
+ label: (
124
+ <div>
125
+
126
+ <Button type="link" onClick={showSegmentSetModal}> 分段设置</Button>
127
+ </div>
128
+
129
+ ),
130
+ },
131
+ {
132
+ key: '2',
133
+ label: (
134
+ <div>
135
+ <Button type="link" onClick={onRmDocument}> 删除</Button>
136
+ </div>
137
+ ),
138
+ // disabled: true,
139
+ },
140
+ ]
141
+ const columns: ColumnsType<DataType> = [
142
+ {
143
+ title: '名称',
144
+ dataIndex: 'name',
145
+ key: 'name',
146
+ render: (text) => <a><img className={styles.img} src='https://gw.alipayobjects.com/zos/antfincdn/efFD%24IOql2/weixintupian_20170331104822.jpg' alt="" />{text}</a>,
147
+ className: `${styles.column}`
148
+ },
149
+ {
150
+ title: '数据总量',
151
+ dataIndex: 'chunk_num',
152
+ key: 'chunk_num',
153
+ className: `${styles.column}`
154
+ },
155
+ {
156
+ title: 'Tokens',
157
+ dataIndex: 'token_num',
158
+ key: 'token_num',
159
+ className: `${styles.column}`
160
+ },
161
+ {
162
+ title: '文件大小',
163
+ dataIndex: 'size',
164
+ key: 'size',
165
+ className: `${styles.column}`
166
+ },
167
+ {
168
+ title: '状态',
169
+ key: 'status',
170
+ dataIndex: 'status',
171
+ className: `${styles.column}`,
172
+ render: (_, { status: string, id }) => (
173
+ <>
174
+ <Switch defaultChecked={status === '1'} onChange={(e) => {
175
+ onChangeStatus(e, id)
176
+ }} />
177
+ </>
178
+ ),
179
+ },
180
+ {
181
+ title: 'Action',
182
+ key: 'action',
183
+ className: `${styles.column}`,
184
+ render: (_, record) => (
185
+ <Space size="middle">
186
+ <Dropdown menu={{ items: chunkItems }} trigger={['click']}>
187
+ <a onClick={() => {
188
+ setDocId(record.id)
189
+ setParserId(record.parser_id)
190
+ }}>
191
+ 分段设置 <DownOutlined />
192
+ </a>
193
+ </Dropdown>
194
+ </Space>
195
+ ),
196
+ },
197
+ ];
198
+ return <>
199
+ <div className={styles.filter}>
200
+ <div className="search">
201
+ <Input placeholder="搜索" value={inputValue} allowClear onChange={handleInputChange} />
202
+ </div>
203
+ <div className="operate">
204
+ <Dropdown menu={{ items: actionItems }} trigger={['click']} >
205
+ <a>
206
+ 导入文件 <DownOutlined />
207
+ </a>
208
+ </Dropdown>
209
+
210
+ </div>
211
+ </div>
212
+ <Table rowKey='id' columns={columns} dataSource={data} loading={loading} pagination={false} scroll={{ scrollToFirstRowOnChange: true, x: true }} />
213
+ <CreateEPModal getKfList={getKfList} kb_id={id} />
214
+ <SegmentSetModal getKfList={getKfList} parser_id={parser_id} doc_id={doc_id} />
215
+ </>
216
+ };
217
+
218
+ export default connect(({ kFModel, loading }) => ({ kFModel, loading }))(Index);
web/src/pages/add-knowledge/components/knowledge-file/model.ts ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { message } from 'antd';
2
+ import { addParam } from '@/utils';
3
+ import kbService from '@/services/kbService';
4
+
5
+ const Model = {
6
+ namespace: 'kFModel',
7
+ state: {
8
+ isShowCEFwModal: false,
9
+ isShowTntModal: false,
10
+ isShowSegmentSetModal: false,
11
+ loading: false,
12
+ tenantIfo: {}
13
+ },
14
+ subscriptions: {
15
+ setup({ dispatch, history }) {
16
+ history.listen(location => {
17
+ });
18
+ }
19
+ },
20
+ effects: {
21
+ * createKf({ payload = {}, callback }, { call, put }) {
22
+ const { data, response } = yield call(kbService.createKb, payload);
23
+ const { retcode, data: res, retmsg } = data
24
+ if (retcode === 0) {
25
+
26
+ message.success('创建成功!');
27
+ }
28
+ },
29
+ * updateKf({ payload = {}, callback }, { call, put }) {
30
+ const { data, response } = yield call(kbService.updateKb, payload);
31
+ const { retcode, data: res, retmsg } = data
32
+ if (retcode === 0) {
33
+ message.success('修改成功!');
34
+
35
+ }
36
+ },
37
+ *getKfDetail({ payload = {}, callback }, { call, put }) {
38
+ const { data, response } = yield call(kbService.get_kb_detail, payload);
39
+ const { retcode, data: res, retmsg } = data
40
+ if (retcode === 0) {
41
+ // localStorage.setItem('userInfo',res.)
42
+ callback && callback(res)
43
+ }
44
+ },
45
+ *getKfList({ payload = {} }, { call, put }) {
46
+ yield put({
47
+ type: 'updateState',
48
+ payload: {
49
+ loading: true
50
+ }
51
+ });
52
+ const { data, response } = yield call(kbService.get_document_list, payload);
53
+ const { retcode, data: res, retmsg } = data
54
+ yield put({
55
+ type: 'updateState',
56
+ payload: {
57
+ loading: false
58
+ }
59
+ });
60
+ if (retcode === 0) {
61
+ yield put({
62
+ type: 'updateState',
63
+ payload: {
64
+ data: res
65
+ }
66
+ });
67
+ }
68
+ },
69
+ *updateDocumentStatus({ payload = {}, callback }, { call, put }) {
70
+ yield put({
71
+ type: 'updateState',
72
+ payload: {
73
+ loading: true
74
+ }
75
+ });
76
+ const { data, response } = yield call(kbService.document_change_status, payload);
77
+ const { retcode, data: res, retmsg } = data
78
+ if (retcode === 0) {
79
+ message.success('修改成功!');
80
+ yield put({
81
+ type: 'updateState',
82
+ payload: {
83
+ loading: false
84
+ }
85
+ });
86
+ callback && callback()
87
+ }
88
+
89
+ },
90
+ *document_rm({ payload = {}, callback }, { call, put }) {
91
+ const { data, response } = yield call(kbService.document_rm, payload);
92
+ const { retcode, data: res, retmsg } = data
93
+ if (retcode === 0) {
94
+ message.success('删除成功!');
95
+ callback && callback()
96
+ }
97
+
98
+ },
99
+ *document_create({ payload = {}, callback }, { call, put }) {
100
+ const { data, response } = yield call(kbService.document_create, payload);
101
+ const { retcode, data: res, retmsg } = data
102
+ if (retcode === 0) {
103
+ message.success('创建成功!');
104
+ callback && callback()
105
+ }
106
+
107
+ },
108
+ *document_change_parser({ payload = {}, callback }, { call, put }) {
109
+ const { data, response } = yield call(kbService.document_change_parser, payload);
110
+ const { retcode, data: res, retmsg } = data
111
+ if (retcode === 0) {
112
+ message.success('修改成功!');
113
+ callback && callback()
114
+ }
115
+
116
+ },
117
+ },
118
+ reducers: {
119
+ updateState(state, { payload }) {
120
+ return {
121
+ ...state,
122
+ ...payload
123
+ };
124
+ }
125
+ }
126
+ };
127
+ export default Model;
web/src/pages/add-knowledge/components/knowledge-file/segmentSetModal.tsx ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { connect } from 'umi';
2
+ import i18n from 'i18next';
3
+ import { useTranslation, Trans } from 'react-i18next'
4
+ import { Input, Modal, Form, Tag, Space } from 'antd'
5
+ import { rsaPsw } from '@/utils'
6
+ import { useEffect, useState } from 'react';
7
+ import styles from './index.less';
8
+ const { CheckableTag } = Tag;
9
+ type FieldType = {
10
+ name?: string;
11
+ };
12
+ const Index = ({ kFModel, settingModel, dispatch, getKfList, parser_id, doc_id }) => {
13
+ const [selectedTag, setSelectedTag] = useState('')
14
+ const { tenantIfo = {} } = settingModel
15
+ const { parser_ids = '' } = tenantIfo
16
+ useEffect(() => {
17
+ dispatch({
18
+ type: 'settingModel/getTenantInfo',
19
+ payload: {
20
+ }
21
+ });
22
+ setSelectedTag(parser_id)
23
+ }, [parser_id])
24
+ const { isShowSegmentSetModal } = kFModel
25
+ const { t } = useTranslation()
26
+ const handleCancel = () => {
27
+ dispatch({
28
+ type: 'kFModel/updateState',
29
+ payload: {
30
+ isShowSegmentSetModal: false
31
+ }
32
+ });
33
+ };
34
+ const handleOk = () => {
35
+ console.log(1111, selectedTag)
36
+ dispatch({
37
+ type: 'kFModel/document_change_parser',
38
+ payload: {
39
+ parser_id: selectedTag,
40
+ doc_id
41
+ },
42
+ callback: () => {
43
+ dispatch({
44
+ type: 'kFModel/updateState',
45
+ payload: {
46
+ isShowSegmentSetModal: false
47
+ }
48
+ });
49
+ getKfList && getKfList()
50
+ }
51
+ });
52
+ };
53
+
54
+ const handleChange = (tag: string, checked: boolean) => {
55
+ const nextSelectedTag = checked
56
+ ? tag
57
+ : selectedTag;
58
+ console.log('You are interested in: ', nextSelectedTag);
59
+ setSelectedTag(nextSelectedTag);
60
+ };
61
+
62
+ return (
63
+ <Modal title="Basic Modal" open={isShowSegmentSetModal} onOk={handleOk} onCancel={handleCancel}>
64
+ <Space size={[0, 8]} wrap>
65
+ <div className={styles.tags}>
66
+ {
67
+ parser_ids.split(',').map((tag: string) => {
68
+ return (<CheckableTag
69
+ key={tag}
70
+ checked={selectedTag === tag}
71
+ onChange={(checked) => handleChange(tag, checked)}
72
+ >
73
+ {tag}
74
+ </CheckableTag>)
75
+ })
76
+ }
77
+ </div>
78
+ </Space>
79
+ </Modal >
80
+
81
+
82
+ );
83
+ }
84
+ export default connect(({ kFModel, settingModel, loading }) => ({ kFModel, settingModel, loading }))(Index);