yqj123
commited on
Commit
·
fad2ec7
1
Parent(s):
9bf75d4
update knowledge_kb (#34)
Browse files* update typescript
* add chunk api
* remove useless code
This view is limited to 50 files because it contains too many changes.
See raw diff
- web/.gitignore +2 -2
- web/.umirc.ts +8 -7
- web/package-lock.json +1 -1
- web/src/.umi/core/EmptyRoute.tsx +0 -9
- web/src/.umi/core/defineApp.ts +0 -17
- web/src/.umi/core/helmet.ts +0 -10
- web/src/.umi/core/helmetContext.ts +0 -4
- web/src/.umi/core/history.ts +0 -66
- web/src/.umi/core/historyIntelli.ts +0 -132
- web/src/.umi/core/plugin.ts +0 -45
- web/src/.umi/core/pluginConfig.ts +0 -292
- web/src/.umi/core/pluginConfigJoi.d.ts +0 -7
- web/src/.umi/core/polyfill.ts +0 -220
- web/src/.umi/core/route.tsx +0 -22
- web/src/.umi/core/terminal.ts +0 -37
- web/src/.umi/exports.ts +0 -22
- web/src/.umi/plugin-dva/dva.tsx +0 -60
- web/src/.umi/plugin-dva/index.ts +0 -5
- web/src/.umi/plugin-dva/models.ts +0 -20
- web/src/.umi/plugin-dva/runtime.tsx +0 -9
- web/src/.umi/plugin-dva/runtimeConfig.d.ts +0 -19
- web/src/.umi/plugin-dva/types.d.ts +0 -58
- web/src/.umi/plugin-icons/icons.tsx +0 -8
- web/src/.umi/plugin-icons/index.css +0 -27
- web/src/.umi/plugin-icons/index.tsx +0 -243
- web/src/.umi/testBrowser.tsx +0 -87
- web/src/.umi/tsconfig.json +0 -43
- web/src/.umi/typings.d.ts +0 -136
- web/src/.umi/umi.ts +0 -76
- web/src/pages/add-knowledge/components/knowledge-chunk/createModal.tsx +99 -0
- web/src/pages/add-knowledge/components/knowledge-chunk/editTag.tsx +142 -0
- web/src/pages/add-knowledge/components/knowledge-chunk/index.less +70 -0
- web/src/pages/add-knowledge/components/knowledge-chunk/index.tsx +224 -0
- web/src/pages/add-knowledge/components/knowledge-chunk/model.ts +134 -0
- web/src/pages/add-knowledge/components/knowledge-file/createEFileModal.tsx +10 -3
- web/src/pages/add-knowledge/components/knowledge-file/index.less +4 -0
- web/src/pages/add-knowledge/components/knowledge-file/index.tsx +31 -21
- web/src/pages/add-knowledge/components/knowledge-file/model.ts +30 -3
- web/src/pages/add-knowledge/components/knowledge-file/segmentSetModal.tsx +15 -8
- web/src/pages/add-knowledge/components/knowledge-file/upload.tsx +12 -9
- web/src/pages/add-knowledge/components/knowledge-setting/index.tsx +17 -39
- web/src/pages/add-knowledge/components/knowledge-setting/model.ts +21 -2
- web/src/pages/add-knowledge/index.tsx +20 -9
- web/src/pages/add-knowledge/model.ts +23 -3
- web/src/pages/chat/index.tsx +10 -14
- web/src/pages/chat/model.ts +9 -15
- web/src/pages/file/index.tsx +1 -1
- web/src/pages/knowledge/index.tsx +13 -13
- web/src/pages/knowledge/model.ts +18 -2
- web/src/pages/login/index.tsx +1 -0
web/.gitignore
CHANGED
|
@@ -2,8 +2,8 @@
|
|
| 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
|
|
|
|
| 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/.umirc.ts
CHANGED
|
@@ -8,6 +8,7 @@ export default defineConfig({
|
|
| 8 |
npmClient: 'npm',
|
| 9 |
base: '/',
|
| 10 |
publicPath: '/client/dist/',
|
|
|
|
| 11 |
icons: {
|
| 12 |
|
| 13 |
},
|
|
@@ -17,12 +18,12 @@ export default defineConfig({
|
|
| 17 |
},
|
| 18 |
plugins: ['@umijs/plugins/dist/dva'],
|
| 19 |
dva: {},
|
| 20 |
-
proxy: {
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
},
|
| 27 |
});
|
| 28 |
|
|
|
|
| 8 |
npmClient: 'npm',
|
| 9 |
base: '/',
|
| 10 |
publicPath: '/client/dist/',
|
| 11 |
+
esbuildMinifyIIFE: true,
|
| 12 |
icons: {
|
| 13 |
|
| 14 |
},
|
|
|
|
| 18 |
},
|
| 19 |
plugins: ['@umijs/plugins/dist/dva'],
|
| 20 |
dva: {},
|
| 21 |
+
// proxy: {
|
| 22 |
+
// '/v1': {
|
| 23 |
+
// 'target': 'http://54.80.112.79:9380/',
|
| 24 |
+
// 'changeOrigin': true,
|
| 25 |
+
// 'pathRewrite': { '^/v1': '/v1' },
|
| 26 |
+
// },
|
| 27 |
+
// },
|
| 28 |
});
|
| 29 |
|
web/package-lock.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"name": "
|
| 3 |
"lockfileVersion": 3,
|
| 4 |
"requires": true,
|
| 5 |
"packages": {
|
|
|
|
| 1 |
{
|
| 2 |
+
"name": "web",
|
| 3 |
"lockfileVersion": 3,
|
| 4 |
"requires": true,
|
| 5 |
"packages": {
|
web/src/.umi/core/EmptyRoute.tsx
DELETED
|
@@ -1,9 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,17 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,10 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,4 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,66 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,132 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,45 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,292 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,7 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,220 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,22 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,37 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,22 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,60 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,5 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,20 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,9 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,19 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,58 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,8 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,27 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,243 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,87 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,43 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,136 +0,0 @@
|
|
| 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
DELETED
|
@@ -1,76 +0,0 @@
|
|
| 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/pages/add-knowledge/components/knowledge-chunk/createModal.tsx
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import React, { useEffect, useState } from 'react'
|
| 2 |
+
import { connect, Dispatch } from 'umi';
|
| 3 |
+
import i18n from 'i18next';
|
| 4 |
+
import { useTranslation, Trans } from 'react-i18next'
|
| 5 |
+
import { Input, Modal, Form } from 'antd'
|
| 6 |
+
import styles from './index.less';
|
| 7 |
+
import type { chunkModelState } from './model'
|
| 8 |
+
import EditTag from './editTag'
|
| 9 |
+
|
| 10 |
+
type FieldType = {
|
| 11 |
+
content_ltks?: string;
|
| 12 |
+
};
|
| 13 |
+
interface kFProps {
|
| 14 |
+
dispatch: Dispatch;
|
| 15 |
+
chunkModel: chunkModelState;
|
| 16 |
+
getChunkList: () => void;
|
| 17 |
+
doc_id: string
|
| 18 |
+
}
|
| 19 |
+
const Index: React.FC<kFProps> = ({ chunkModel, dispatch, getChunkList, doc_id }) => {
|
| 20 |
+
const { isShowCreateModal, chunk_id, chunkInfo } = chunkModel
|
| 21 |
+
const [important_kwd, setImportantKwd] = useState(['Unremovable', 'Tag 2', 'Tag 3']);
|
| 22 |
+
const { t } = useTranslation()
|
| 23 |
+
const handleCancel = () => {
|
| 24 |
+
dispatch({
|
| 25 |
+
type: 'chunkModel/updateState',
|
| 26 |
+
payload: {
|
| 27 |
+
isShowCreateModal: false
|
| 28 |
+
}
|
| 29 |
+
});
|
| 30 |
+
};
|
| 31 |
+
useEffect(() => {
|
| 32 |
+
if (chunk_id && isShowCreateModal) {
|
| 33 |
+
dispatch({
|
| 34 |
+
type: 'chunkModel/get_chunk',
|
| 35 |
+
payload: {
|
| 36 |
+
chunk_id
|
| 37 |
+
},
|
| 38 |
+
callback(info: any) {
|
| 39 |
+
console.log(info)
|
| 40 |
+
const { content_ltks, important_kwd = [] } = info
|
| 41 |
+
form.setFieldsValue({ content_ltks })
|
| 42 |
+
setImportantKwd(important_kwd)
|
| 43 |
+
}
|
| 44 |
+
});
|
| 45 |
+
}
|
| 46 |
+
}, [chunk_id, isShowCreateModal])
|
| 47 |
+
const [form] = Form.useForm()
|
| 48 |
+
const handleOk = async () => {
|
| 49 |
+
try {
|
| 50 |
+
const values = await form.validateFields();
|
| 51 |
+
dispatch({
|
| 52 |
+
type: 'chunkModel/create_hunk',
|
| 53 |
+
payload: {
|
| 54 |
+
content_ltks: values.content_ltks,
|
| 55 |
+
doc_id,
|
| 56 |
+
chunk_id,
|
| 57 |
+
important_kwd
|
| 58 |
+
},
|
| 59 |
+
callback: () => {
|
| 60 |
+
dispatch({
|
| 61 |
+
type: 'chunkModel/updateState',
|
| 62 |
+
payload: {
|
| 63 |
+
isShowCreateModal: false
|
| 64 |
+
}
|
| 65 |
+
});
|
| 66 |
+
getChunkList && getChunkList()
|
| 67 |
+
}
|
| 68 |
+
});
|
| 69 |
+
|
| 70 |
+
} catch (errorInfo) {
|
| 71 |
+
console.log('Failed:', errorInfo);
|
| 72 |
+
}
|
| 73 |
+
};
|
| 74 |
+
|
| 75 |
+
return (
|
| 76 |
+
<Modal title="Basic Modal" open={isShowCreateModal} onOk={handleOk} onCancel={handleCancel}>
|
| 77 |
+
<Form
|
| 78 |
+
form={form}
|
| 79 |
+
name="validateOnly"
|
| 80 |
+
labelCol={{ span: 5 }}
|
| 81 |
+
wrapperCol={{ span: 19 }}
|
| 82 |
+
style={{ maxWidth: 600 }}
|
| 83 |
+
autoComplete="off"
|
| 84 |
+
>
|
| 85 |
+
<Form.Item<FieldType>
|
| 86 |
+
label="chunk 内容"
|
| 87 |
+
name="content_ltks"
|
| 88 |
+
rules={[{ required: true, message: 'Please input name!' }]}
|
| 89 |
+
>
|
| 90 |
+
<Input.TextArea />
|
| 91 |
+
</Form.Item>
|
| 92 |
+
<EditTag tags={important_kwd} setTags={setImportantKwd} />
|
| 93 |
+
</Form>
|
| 94 |
+
</Modal >
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
);
|
| 98 |
+
}
|
| 99 |
+
export default connect(({ chunkModel, loading }) => ({ chunkModel, loading }))(Index);
|
web/src/pages/add-knowledge/components/knowledge-chunk/editTag.tsx
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import React, { useEffect, useRef, useState } from 'react';
|
| 2 |
+
import { PlusOutlined } from '@ant-design/icons';
|
| 3 |
+
import type { InputRef } from 'antd';
|
| 4 |
+
import { Input, Space, Tag, theme, Tooltip } from 'antd';
|
| 5 |
+
interface editTagsProps {
|
| 6 |
+
tags: any[],
|
| 7 |
+
setTags: (tags: any[]) => void
|
| 8 |
+
}
|
| 9 |
+
const App: React.FC<editTagsProps> = ({ tags, setTags }) => {
|
| 10 |
+
const { token } = theme.useToken();
|
| 11 |
+
|
| 12 |
+
const [inputVisible, setInputVisible] = useState(false);
|
| 13 |
+
const [inputValue, setInputValue] = useState('');
|
| 14 |
+
const [editInputIndex, setEditInputIndex] = useState(-1);
|
| 15 |
+
const [editInputValue, setEditInputValue] = useState('');
|
| 16 |
+
const inputRef = useRef<InputRef>(null);
|
| 17 |
+
const editInputRef = useRef<InputRef>(null);
|
| 18 |
+
|
| 19 |
+
useEffect(() => {
|
| 20 |
+
if (inputVisible) {
|
| 21 |
+
inputRef.current?.focus();
|
| 22 |
+
}
|
| 23 |
+
}, [inputVisible]);
|
| 24 |
+
|
| 25 |
+
useEffect(() => {
|
| 26 |
+
editInputRef.current?.focus();
|
| 27 |
+
}, [editInputValue]);
|
| 28 |
+
|
| 29 |
+
const handleClose = (removedTag: string) => {
|
| 30 |
+
const newTags = tags.filter((tag) => tag !== removedTag);
|
| 31 |
+
console.log(newTags);
|
| 32 |
+
setTags(newTags);
|
| 33 |
+
};
|
| 34 |
+
|
| 35 |
+
const showInput = () => {
|
| 36 |
+
setInputVisible(true);
|
| 37 |
+
};
|
| 38 |
+
|
| 39 |
+
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
| 40 |
+
setInputValue(e.target.value);
|
| 41 |
+
};
|
| 42 |
+
|
| 43 |
+
const handleInputConfirm = () => {
|
| 44 |
+
if (inputValue && !tags.includes(inputValue)) {
|
| 45 |
+
setTags([...tags, inputValue]);
|
| 46 |
+
}
|
| 47 |
+
setInputVisible(false);
|
| 48 |
+
setInputValue('');
|
| 49 |
+
};
|
| 50 |
+
|
| 51 |
+
const handleEditInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
| 52 |
+
setEditInputValue(e.target.value);
|
| 53 |
+
};
|
| 54 |
+
|
| 55 |
+
const handleEditInputConfirm = () => {
|
| 56 |
+
const newTags = [...tags];
|
| 57 |
+
newTags[editInputIndex] = editInputValue;
|
| 58 |
+
setTags(newTags);
|
| 59 |
+
setEditInputIndex(-1);
|
| 60 |
+
setEditInputValue('');
|
| 61 |
+
};
|
| 62 |
+
|
| 63 |
+
const tagInputStyle: React.CSSProperties = {
|
| 64 |
+
width: 64,
|
| 65 |
+
height: 22,
|
| 66 |
+
marginInlineEnd: 8,
|
| 67 |
+
verticalAlign: 'top',
|
| 68 |
+
};
|
| 69 |
+
|
| 70 |
+
const tagPlusStyle: React.CSSProperties = {
|
| 71 |
+
height: 22,
|
| 72 |
+
background: token.colorBgContainer,
|
| 73 |
+
borderStyle: 'dashed',
|
| 74 |
+
};
|
| 75 |
+
|
| 76 |
+
return (
|
| 77 |
+
<Space size={[0, 8]} wrap>
|
| 78 |
+
{tags.map((tag, index) => {
|
| 79 |
+
if (editInputIndex === index) {
|
| 80 |
+
return (
|
| 81 |
+
<Input
|
| 82 |
+
ref={editInputRef}
|
| 83 |
+
key={tag}
|
| 84 |
+
size="small"
|
| 85 |
+
style={tagInputStyle}
|
| 86 |
+
value={editInputValue}
|
| 87 |
+
onChange={handleEditInputChange}
|
| 88 |
+
onBlur={handleEditInputConfirm}
|
| 89 |
+
onPressEnter={handleEditInputConfirm}
|
| 90 |
+
/>
|
| 91 |
+
);
|
| 92 |
+
}
|
| 93 |
+
const isLongTag = tag.length > 20;
|
| 94 |
+
const tagElem = (
|
| 95 |
+
<Tag
|
| 96 |
+
key={tag}
|
| 97 |
+
closable={index !== 0}
|
| 98 |
+
style={{ userSelect: 'none' }}
|
| 99 |
+
onClose={() => handleClose(tag)}
|
| 100 |
+
>
|
| 101 |
+
<span
|
| 102 |
+
onDoubleClick={(e) => {
|
| 103 |
+
if (index !== 0) {
|
| 104 |
+
setEditInputIndex(index);
|
| 105 |
+
setEditInputValue(tag);
|
| 106 |
+
e.preventDefault();
|
| 107 |
+
}
|
| 108 |
+
}}
|
| 109 |
+
>
|
| 110 |
+
{isLongTag ? `${tag.slice(0, 20)}...` : tag}
|
| 111 |
+
</span>
|
| 112 |
+
</Tag>
|
| 113 |
+
);
|
| 114 |
+
return isLongTag ? (
|
| 115 |
+
<Tooltip title={tag} key={tag}>
|
| 116 |
+
{tagElem}
|
| 117 |
+
</Tooltip>
|
| 118 |
+
) : (
|
| 119 |
+
tagElem
|
| 120 |
+
);
|
| 121 |
+
})}
|
| 122 |
+
{inputVisible ? (
|
| 123 |
+
<Input
|
| 124 |
+
ref={inputRef}
|
| 125 |
+
type="text"
|
| 126 |
+
size="small"
|
| 127 |
+
style={tagInputStyle}
|
| 128 |
+
value={inputValue}
|
| 129 |
+
onChange={handleInputChange}
|
| 130 |
+
onBlur={handleInputConfirm}
|
| 131 |
+
onPressEnter={handleInputConfirm}
|
| 132 |
+
/>
|
| 133 |
+
) : (
|
| 134 |
+
<Tag style={tagPlusStyle} onClick={showInput}>
|
| 135 |
+
添加关键词
|
| 136 |
+
</Tag>
|
| 137 |
+
)}
|
| 138 |
+
</Space>
|
| 139 |
+
);
|
| 140 |
+
};
|
| 141 |
+
|
| 142 |
+
export default App;
|
web/src/pages/add-knowledge/components/knowledge-chunk/index.less
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.chunkPage {
|
| 2 |
+
padding: 24px;
|
| 3 |
+
|
| 4 |
+
display: flex;
|
| 5 |
+
height: calc(100vh - 112px);
|
| 6 |
+
flex-direction: column;
|
| 7 |
+
|
| 8 |
+
.filter {
|
| 9 |
+
margin: 10px 0;
|
| 10 |
+
display: flex;
|
| 11 |
+
height: 32px;
|
| 12 |
+
justify-content: space-between;
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
.pageContent {
|
| 16 |
+
flex: 1;
|
| 17 |
+
width: 100%;
|
| 18 |
+
padding-right: 12px;
|
| 19 |
+
overflow-y: auto;
|
| 20 |
+
|
| 21 |
+
.spin {
|
| 22 |
+
min-height: 400px;
|
| 23 |
+
}
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
.pageFooter {
|
| 27 |
+
height: 32px;
|
| 28 |
+
}
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
.container {
|
| 32 |
+
height: 100px;
|
| 33 |
+
display: flex;
|
| 34 |
+
flex-direction: column;
|
| 35 |
+
justify-content: space-between;
|
| 36 |
+
|
| 37 |
+
.content {
|
| 38 |
+
display: flex;
|
| 39 |
+
justify-content: space-between;
|
| 40 |
+
|
| 41 |
+
.context {
|
| 42 |
+
flex: 1;
|
| 43 |
+
// width: 207px;
|
| 44 |
+
height: 88px;
|
| 45 |
+
overflow: hidden;
|
| 46 |
+
}
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
.footer {
|
| 50 |
+
height: 20px;
|
| 51 |
+
|
| 52 |
+
.text {
|
| 53 |
+
margin-left: 10px;
|
| 54 |
+
}
|
| 55 |
+
}
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
.card {
|
| 59 |
+
:global {
|
| 60 |
+
.ant-card-body {
|
| 61 |
+
padding: 10px;
|
| 62 |
+
margin: 0;
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
margin-bottom: 10px;
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
cursor: pointer;
|
| 69 |
+
|
| 70 |
+
}
|
web/src/pages/add-knowledge/components/knowledge-chunk/index.tsx
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import React, { useEffect, useState, useCallback } from 'react';
|
| 2 |
+
import { useNavigate, connect, Dispatch } from 'umi'
|
| 3 |
+
import { Card, Row, Col, Input, Select, Switch, Pagination, Spin, Button, Popconfirm } from 'antd';
|
| 4 |
+
import { MinusSquareOutlined, DeleteOutlined, } from '@ant-design/icons';
|
| 5 |
+
import type { PaginationProps } from 'antd';
|
| 6 |
+
import { api_host } from '@/utils/api'
|
| 7 |
+
import CreateModal from './createModal'
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
import styles from './index.less'
|
| 11 |
+
import { debounce } from 'lodash';
|
| 12 |
+
import type { chunkModelState } from './model'
|
| 13 |
+
interface chunkProps {
|
| 14 |
+
dispatch: Dispatch;
|
| 15 |
+
chunkModel: chunkModelState;
|
| 16 |
+
doc_id: string
|
| 17 |
+
}
|
| 18 |
+
const Index: React.FC<chunkProps> = ({ chunkModel, dispatch, doc_id }) => {
|
| 19 |
+
const [keywords, SetKeywords] = useState('')
|
| 20 |
+
const [available_int, setAvailableInt] = useState(-1)
|
| 21 |
+
const navigate = useNavigate()
|
| 22 |
+
const [pagination, setPagination] = useState({ page: 1, size: 30 })
|
| 23 |
+
// const [datas, setDatas] = useState(data)
|
| 24 |
+
const { data = [], total, loading } = chunkModel
|
| 25 |
+
console.log(chunkModel)
|
| 26 |
+
const getChunkList = (value?: string) => {
|
| 27 |
+
dispatch({
|
| 28 |
+
type: 'chunkModel/updateState',
|
| 29 |
+
payload: {
|
| 30 |
+
loading: true
|
| 31 |
+
}
|
| 32 |
+
});
|
| 33 |
+
interface payloadType {
|
| 34 |
+
doc_id: string;
|
| 35 |
+
keywords?: string;
|
| 36 |
+
available_int?: number
|
| 37 |
+
}
|
| 38 |
+
const payload: payloadType = {
|
| 39 |
+
doc_id,
|
| 40 |
+
keywords: value || keywords,
|
| 41 |
+
available_int
|
| 42 |
+
}
|
| 43 |
+
if (payload.available_int === -1) {
|
| 44 |
+
delete payload.available_int
|
| 45 |
+
}
|
| 46 |
+
dispatch({
|
| 47 |
+
type: 'chunkModel/chunk_list',
|
| 48 |
+
payload: {
|
| 49 |
+
...payload,
|
| 50 |
+
...pagination
|
| 51 |
+
}
|
| 52 |
+
});
|
| 53 |
+
}
|
| 54 |
+
const confirm = (id: string) => {
|
| 55 |
+
console.log(id)
|
| 56 |
+
dispatch({
|
| 57 |
+
type: 'chunkModel/rm_chunk',
|
| 58 |
+
payload: {
|
| 59 |
+
chunk_ids: [id]
|
| 60 |
+
},
|
| 61 |
+
callback: getChunkList
|
| 62 |
+
});
|
| 63 |
+
};
|
| 64 |
+
const handleEditchunk = (chunk_id?: string) => {
|
| 65 |
+
dispatch({
|
| 66 |
+
type: 'chunkModel/updateState',
|
| 67 |
+
payload: {
|
| 68 |
+
isShowCreateModal: true,
|
| 69 |
+
chunk_id
|
| 70 |
+
},
|
| 71 |
+
callback: getChunkList
|
| 72 |
+
});
|
| 73 |
+
}
|
| 74 |
+
const onShowSizeChange: PaginationProps['onShowSizeChange'] = (page, size) => {
|
| 75 |
+
setPagination({ page, size })
|
| 76 |
+
};
|
| 77 |
+
const switchChunk = (id: string, available_int: boolean) => {
|
| 78 |
+
dispatch({
|
| 79 |
+
type: 'chunkModel/updateState',
|
| 80 |
+
payload: {
|
| 81 |
+
loading: true
|
| 82 |
+
}
|
| 83 |
+
});
|
| 84 |
+
dispatch({
|
| 85 |
+
type: 'chunkModel/switch_chunk',
|
| 86 |
+
payload: {
|
| 87 |
+
chunk_ids: [id],
|
| 88 |
+
available_int: Number(available_int),
|
| 89 |
+
doc_id
|
| 90 |
+
},
|
| 91 |
+
callback: getChunkList
|
| 92 |
+
});
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
useEffect(() => {
|
| 96 |
+
getChunkList()
|
| 97 |
+
}, [doc_id, available_int, pagination])
|
| 98 |
+
const debounceChange = debounce(getChunkList, 300)
|
| 99 |
+
const debounceCallback = useCallback((value: string) => debounceChange(value), [])
|
| 100 |
+
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
| 101 |
+
const value = e.target.value
|
| 102 |
+
SetKeywords(value)
|
| 103 |
+
debounceCallback(value)
|
| 104 |
+
}
|
| 105 |
+
const handleSelectChange = (value: number) => {
|
| 106 |
+
setAvailableInt(value)
|
| 107 |
+
}
|
| 108 |
+
console.log('loading', loading)
|
| 109 |
+
return (<>
|
| 110 |
+
<div className={styles.chunkPage}>
|
| 111 |
+
<div className={styles.filter}>
|
| 112 |
+
<div>
|
| 113 |
+
<Input placeholder="搜索" style={{ width: 220 }} value={keywords} allowClear onChange={handleInputChange} />
|
| 114 |
+
<Select
|
| 115 |
+
showSearch
|
| 116 |
+
placeholder="是否启用"
|
| 117 |
+
optionFilterProp="children"
|
| 118 |
+
value={available_int}
|
| 119 |
+
onChange={handleSelectChange}
|
| 120 |
+
style={{ width: 220 }}
|
| 121 |
+
options={[
|
| 122 |
+
{
|
| 123 |
+
value: -1,
|
| 124 |
+
label: '全部',
|
| 125 |
+
},
|
| 126 |
+
{
|
| 127 |
+
value: 1,
|
| 128 |
+
label: '启用',
|
| 129 |
+
},
|
| 130 |
+
{
|
| 131 |
+
value: 0,
|
| 132 |
+
label: '未启用',
|
| 133 |
+
},
|
| 134 |
+
]}
|
| 135 |
+
/>
|
| 136 |
+
|
| 137 |
+
</div>
|
| 138 |
+
<Button onClick={() => { handleEditchunk() }} type='link'>添加分段</Button>
|
| 139 |
+
</div>
|
| 140 |
+
<div className={styles.pageContent}>
|
| 141 |
+
<Spin spinning={loading} className={styles.spin} size='large'>
|
| 142 |
+
<Row gutter={{ xs: 8, sm: 16, md: 24, lg: 24 }} >
|
| 143 |
+
{
|
| 144 |
+
data.map((item: any) => {
|
| 145 |
+
return (<Col className="gutter-row" key={item.chunk_id} xs={24} sm={12} md={12} lg={8}>
|
| 146 |
+
<Card className={styles.card}
|
| 147 |
+
onClick={() => { handleEditchunk(item.chunk_id) }}
|
| 148 |
+
>
|
| 149 |
+
<img style={{ width: '50px' }} src={`${api_host}/document/image/${item.img_id}`} alt="" />
|
| 150 |
+
<div className={styles.container}>
|
| 151 |
+
<div className={styles.content}>
|
| 152 |
+
<span className={styles.context}>
|
| 153 |
+
{item.content_ltks}
|
| 154 |
+
</span>
|
| 155 |
+
<span className={styles.delete}>
|
| 156 |
+
<Switch size="small" defaultValue={item.available_int == '1'} onChange={(checked: boolean, e: any) => {
|
| 157 |
+
e.stopPropagation();
|
| 158 |
+
e.nativeEvent.stopImmediatePropagation(); switchChunk(item.chunk_id, checked)
|
| 159 |
+
}} />
|
| 160 |
+
</span>
|
| 161 |
+
</div>
|
| 162 |
+
<div className={styles.footer}>
|
| 163 |
+
<span className={styles.text}>
|
| 164 |
+
<MinusSquareOutlined />{item.doc_num}文档
|
| 165 |
+
</span>
|
| 166 |
+
<span className={styles.text}>
|
| 167 |
+
<MinusSquareOutlined />{item.chunk_num}个
|
| 168 |
+
</span>
|
| 169 |
+
<span className={styles.text}>
|
| 170 |
+
<MinusSquareOutlined />{item.token_num}千字符
|
| 171 |
+
</span>
|
| 172 |
+
<span style={{ float: 'right' }}>
|
| 173 |
+
<Popconfirm
|
| 174 |
+
title="Delete the task"
|
| 175 |
+
description="Are you sure to delete this task?"
|
| 176 |
+
onConfirm={(e: any) => {
|
| 177 |
+
e.stopPropagation();
|
| 178 |
+
e.nativeEvent.stopImmediatePropagation()
|
| 179 |
+
console.log(confirm)
|
| 180 |
+
confirm(item.chunk_id)
|
| 181 |
+
|
| 182 |
+
}}
|
| 183 |
+
okText="Yes"
|
| 184 |
+
cancelText="No"
|
| 185 |
+
>
|
| 186 |
+
<DeleteOutlined onClick={(e) => {
|
| 187 |
+
e.stopPropagation();
|
| 188 |
+
e.nativeEvent.stopImmediatePropagation()
|
| 189 |
+
}} />
|
| 190 |
+
</Popconfirm>
|
| 191 |
+
|
| 192 |
+
</span>
|
| 193 |
+
</div>
|
| 194 |
+
|
| 195 |
+
</div>
|
| 196 |
+
</Card>
|
| 197 |
+
</Col>)
|
| 198 |
+
})
|
| 199 |
+
}
|
| 200 |
+
</Row>
|
| 201 |
+
</Spin>
|
| 202 |
+
|
| 203 |
+
</div>
|
| 204 |
+
<div className={styles.pageFooter}>
|
| 205 |
+
<Pagination
|
| 206 |
+
responsive
|
| 207 |
+
showLessItems
|
| 208 |
+
showQuickJumper
|
| 209 |
+
showSizeChanger
|
| 210 |
+
onChange={onShowSizeChange}
|
| 211 |
+
defaultPageSize={30}
|
| 212 |
+
pageSizeOptions={[30, 60, 90]}
|
| 213 |
+
defaultCurrent={pagination.page}
|
| 214 |
+
total={total}
|
| 215 |
+
/>
|
| 216 |
+
</div>
|
| 217 |
+
|
| 218 |
+
</div >
|
| 219 |
+
<CreateModal doc_id={doc_id} getChunkList={getChunkList} />
|
| 220 |
+
</>
|
| 221 |
+
)
|
| 222 |
+
};
|
| 223 |
+
|
| 224 |
+
export default connect(({ chunkModel, loading }) => ({ chunkModel, loading }))(Index);
|
web/src/pages/add-knowledge/components/knowledge-chunk/model.ts
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { Effect, Reducer, Subscription } from 'umi'
|
| 2 |
+
import { message } from 'antd';
|
| 3 |
+
import kbService from '@/services/kbService';
|
| 4 |
+
|
| 5 |
+
export interface chunkModelState {
|
| 6 |
+
loading: boolean;
|
| 7 |
+
data: any[];
|
| 8 |
+
total: number;
|
| 9 |
+
isShowCreateModal: boolean;
|
| 10 |
+
chunk_id: string;
|
| 11 |
+
chunkInfo: any
|
| 12 |
+
}
|
| 13 |
+
export interface chunkgModelType {
|
| 14 |
+
namespace: 'chunkModel';
|
| 15 |
+
state: chunkModelState;
|
| 16 |
+
effects: {
|
| 17 |
+
chunk_list: Effect;
|
| 18 |
+
get_chunk: Effect;
|
| 19 |
+
create_hunk: Effect;
|
| 20 |
+
switch_chunk: Effect;
|
| 21 |
+
rm_chunk: Effect;
|
| 22 |
+
};
|
| 23 |
+
reducers: {
|
| 24 |
+
updateState: Reducer<chunkModelState>;
|
| 25 |
+
};
|
| 26 |
+
subscriptions: { setup: Subscription };
|
| 27 |
+
}
|
| 28 |
+
const Model: chunkgModelType = {
|
| 29 |
+
namespace: 'chunkModel',
|
| 30 |
+
state: {
|
| 31 |
+
loading: false,
|
| 32 |
+
data: [],
|
| 33 |
+
total: 0,
|
| 34 |
+
isShowCreateModal: false,
|
| 35 |
+
chunk_id: '',
|
| 36 |
+
chunkInfo: {}
|
| 37 |
+
},
|
| 38 |
+
subscriptions: {
|
| 39 |
+
setup({ dispatch, history }) {
|
| 40 |
+
history.listen(location => {
|
| 41 |
+
console.log(location)
|
| 42 |
+
});
|
| 43 |
+
}
|
| 44 |
+
},
|
| 45 |
+
effects: {
|
| 46 |
+
* chunk_list({ payload = {}, callback }, { call, put }) {
|
| 47 |
+
const { data, response } = yield call(kbService.chunk_list, payload);
|
| 48 |
+
|
| 49 |
+
const { retcode, data: res, retmsg } = data
|
| 50 |
+
if (retcode === 0) {
|
| 51 |
+
console.log(res)
|
| 52 |
+
yield put({
|
| 53 |
+
type: 'updateState',
|
| 54 |
+
payload: {
|
| 55 |
+
data: res.chunks,
|
| 56 |
+
total: res.total,
|
| 57 |
+
loading: false
|
| 58 |
+
}
|
| 59 |
+
});
|
| 60 |
+
callback && callback()
|
| 61 |
+
|
| 62 |
+
}
|
| 63 |
+
},
|
| 64 |
+
*switch_chunk({ payload = {}, callback }, { call, put }) {
|
| 65 |
+
const { data, response } = yield call(kbService.switch_chunk, payload);
|
| 66 |
+
const { retcode, data: res, retmsg } = data
|
| 67 |
+
if (retcode === 0) {
|
| 68 |
+
callback && callback()
|
| 69 |
+
|
| 70 |
+
}
|
| 71 |
+
},
|
| 72 |
+
*rm_chunk({ payload = {}, callback }, { call, put }) {
|
| 73 |
+
console.log('shanchu')
|
| 74 |
+
const { data, response } = yield call(kbService.rm_chunk, payload);
|
| 75 |
+
const { retcode, data: res, retmsg } = data
|
| 76 |
+
if (retcode === 0) {
|
| 77 |
+
callback && callback()
|
| 78 |
+
|
| 79 |
+
}
|
| 80 |
+
},
|
| 81 |
+
* get_chunk({ payload = {}, callback }, { call, put }) {
|
| 82 |
+
const { data, response } = yield call(kbService.get_chunk, payload);
|
| 83 |
+
const { retcode, data: res, retmsg } = data
|
| 84 |
+
if (retcode === 0) {
|
| 85 |
+
|
| 86 |
+
yield put({
|
| 87 |
+
type: 'updateState',
|
| 88 |
+
payload: {
|
| 89 |
+
chunkInfo: res
|
| 90 |
+
}
|
| 91 |
+
});
|
| 92 |
+
callback && callback(res)
|
| 93 |
+
|
| 94 |
+
}
|
| 95 |
+
},
|
| 96 |
+
*create_hunk({ payload = {} }, { call, put }) {
|
| 97 |
+
yield put({
|
| 98 |
+
type: 'updateState',
|
| 99 |
+
payload: {
|
| 100 |
+
loading: true
|
| 101 |
+
}
|
| 102 |
+
});
|
| 103 |
+
let service = kbService.create_chunk
|
| 104 |
+
if (payload.chunk_id) {
|
| 105 |
+
service = kbService.set_chunk
|
| 106 |
+
}
|
| 107 |
+
const { data, response } = yield call(service, payload);
|
| 108 |
+
const { retcode, data: res, retmsg } = data
|
| 109 |
+
yield put({
|
| 110 |
+
type: 'updateState',
|
| 111 |
+
payload: {
|
| 112 |
+
loading: false
|
| 113 |
+
}
|
| 114 |
+
});
|
| 115 |
+
if (retcode === 0) {
|
| 116 |
+
yield put({
|
| 117 |
+
type: 'updateState',
|
| 118 |
+
payload: {
|
| 119 |
+
isShowCreateModal: false
|
| 120 |
+
}
|
| 121 |
+
});
|
| 122 |
+
}
|
| 123 |
+
},
|
| 124 |
+
},
|
| 125 |
+
reducers: {
|
| 126 |
+
updateState(state, { payload }) {
|
| 127 |
+
return {
|
| 128 |
+
...state,
|
| 129 |
+
...payload
|
| 130 |
+
};
|
| 131 |
+
}
|
| 132 |
+
}
|
| 133 |
+
};
|
| 134 |
+
export default Model;
|
web/src/pages/add-knowledge/components/knowledge-file/createEFileModal.tsx
CHANGED
|
@@ -1,14 +1,21 @@
|
|
| 1 |
-
import
|
|
|
|
| 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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
const { isShowCEFwModal } = kFModel
|
| 13 |
const { t } = useTranslation()
|
| 14 |
const handleCancel = () => {
|
|
|
|
| 1 |
+
import React from 'react'
|
| 2 |
+
import { connect, Dispatch } from 'umi';
|
| 3 |
import i18n from 'i18next';
|
| 4 |
import { useTranslation, Trans } from 'react-i18next'
|
| 5 |
import { Input, Modal, Form } from 'antd'
|
|
|
|
| 6 |
import styles from './index.less';
|
| 7 |
+
import type { kFModelState } from './model'
|
| 8 |
|
| 9 |
type FieldType = {
|
| 10 |
name?: string;
|
| 11 |
};
|
| 12 |
+
interface kFProps {
|
| 13 |
+
dispatch: Dispatch;
|
| 14 |
+
kFModel: kFModelState;
|
| 15 |
+
getKfList: () => void;
|
| 16 |
+
kb_id: string
|
| 17 |
+
}
|
| 18 |
+
const Index: React.FC<kFProps> = ({ kFModel, dispatch, getKfList, kb_id }) => {
|
| 19 |
const { isShowCEFwModal } = kFModel
|
| 20 |
const { t } = useTranslation()
|
| 21 |
const handleCancel = () => {
|
web/src/pages/add-knowledge/components/knowledge-file/index.less
CHANGED
|
@@ -21,4 +21,8 @@
|
|
| 21 |
|
| 22 |
.column {
|
| 23 |
min-width: 200px
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
}
|
|
|
|
| 21 |
|
| 22 |
.column {
|
| 23 |
min-width: 200px
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
.tochunks {
|
| 27 |
+
cursor: pointer;
|
| 28 |
}
|
web/src/pages/add-knowledge/components/knowledge-file/index.tsx
CHANGED
|
@@ -1,14 +1,15 @@
|
|
| 1 |
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
| 2 |
-
import { connect,
|
| 3 |
-
import { Space, Table,
|
| 4 |
import type { MenuProps } from 'antd';
|
| 5 |
-
import {
|
| 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;
|
|
@@ -21,32 +22,37 @@ interface DataType {
|
|
| 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 |
-
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
}
|
| 35 |
-
}
|
| 36 |
-
const getKfList = () => {
|
| 37 |
dispatch({
|
| 38 |
type: 'kFModel/getKfList',
|
| 39 |
-
payload
|
| 40 |
-
kb_id: id
|
| 41 |
-
}
|
| 42 |
});
|
| 43 |
}
|
| 44 |
useEffect(() => {
|
| 45 |
-
if (
|
| 46 |
getKfList()
|
| 47 |
}
|
| 48 |
-
}, [
|
| 49 |
-
const debounceChange = debounce(
|
| 50 |
const debounceCallback = useCallback((value: string) => debounceChange(value), [])
|
| 51 |
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
| 52 |
const value = e.target.value
|
|
@@ -101,7 +107,7 @@ const Index: React.FC = ({ kFModel, dispatch, id }) => {
|
|
| 101 |
key: '1',
|
| 102 |
label: (
|
| 103 |
<div>
|
| 104 |
-
<UploadFile kb_id={
|
| 105 |
</div>
|
| 106 |
|
| 107 |
),
|
|
@@ -116,7 +122,7 @@ const Index: React.FC = ({ kFModel, dispatch, id }) => {
|
|
| 116 |
// disabled: true,
|
| 117 |
},
|
| 118 |
]
|
| 119 |
-
}, [
|
| 120 |
const chunkItems: MenuProps['items'] = [
|
| 121 |
{
|
| 122 |
key: '1',
|
|
@@ -138,12 +144,16 @@ const Index: React.FC = ({ kFModel, dispatch, id }) => {
|
|
| 138 |
// disabled: true,
|
| 139 |
},
|
| 140 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
const columns: ColumnsType<DataType> = [
|
| 142 |
{
|
| 143 |
title: '名称',
|
| 144 |
dataIndex: 'name',
|
| 145 |
key: 'name',
|
| 146 |
-
render: (text) => <
|
| 147 |
className: `${styles.column}`
|
| 148 |
},
|
| 149 |
{
|
|
@@ -198,7 +208,7 @@ const Index: React.FC = ({ kFModel, dispatch, id }) => {
|
|
| 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']} >
|
|
@@ -210,7 +220,7 @@ const Index: React.FC = ({ kFModel, dispatch, id }) => {
|
|
| 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={
|
| 214 |
<SegmentSetModal getKfList={getKfList} parser_id={parser_id} doc_id={doc_id} />
|
| 215 |
</>
|
| 216 |
};
|
|
|
|
| 1 |
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
| 2 |
+
import { connect, Dispatch, useNavigate } from 'umi'
|
| 3 |
+
import { Space, Table, Input, Button, Switch, Dropdown, } from 'antd';
|
| 4 |
import type { MenuProps } from 'antd';
|
| 5 |
+
import { 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 |
+
import type { kFModelState } from './model'
|
| 13 |
|
| 14 |
interface DataType {
|
| 15 |
name: string;
|
|
|
|
| 22 |
parser_id: string
|
| 23 |
}
|
| 24 |
|
| 25 |
+
interface kFProps {
|
| 26 |
+
dispatch: Dispatch;
|
| 27 |
+
kFModel: kFModelState;
|
| 28 |
+
kb_id: string
|
| 29 |
+
}
|
| 30 |
|
| 31 |
+
const Index: React.FC<kFProps> = ({ kFModel, dispatch, kb_id }) => {
|
|
|
|
| 32 |
const { data, loading } = kFModel
|
| 33 |
const [inputValue, setInputValue] = useState('')
|
| 34 |
const [doc_id, setDocId] = useState('0')
|
| 35 |
const [parser_id, setParserId] = useState('0')
|
| 36 |
+
let navigate = useNavigate();
|
| 37 |
+
const getKfList = (keywords?: string) => {
|
| 38 |
+
const payload = {
|
| 39 |
+
kb_id,
|
| 40 |
+
keywords
|
| 41 |
+
}
|
| 42 |
+
if (!keywords) {
|
| 43 |
+
delete payload.keywords
|
| 44 |
}
|
|
|
|
|
|
|
| 45 |
dispatch({
|
| 46 |
type: 'kFModel/getKfList',
|
| 47 |
+
payload
|
|
|
|
|
|
|
| 48 |
});
|
| 49 |
}
|
| 50 |
useEffect(() => {
|
| 51 |
+
if (kb_id) {
|
| 52 |
getKfList()
|
| 53 |
}
|
| 54 |
+
}, [kb_id])
|
| 55 |
+
const debounceChange = debounce(getKfList, 300)
|
| 56 |
const debounceCallback = useCallback((value: string) => debounceChange(value), [])
|
| 57 |
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
| 58 |
const value = e.target.value
|
|
|
|
| 107 |
key: '1',
|
| 108 |
label: (
|
| 109 |
<div>
|
| 110 |
+
<UploadFile kb_id={kb_id} getKfList={getKfList} />
|
| 111 |
</div>
|
| 112 |
|
| 113 |
),
|
|
|
|
| 122 |
// disabled: true,
|
| 123 |
},
|
| 124 |
]
|
| 125 |
+
}, [kb_id]);
|
| 126 |
const chunkItems: MenuProps['items'] = [
|
| 127 |
{
|
| 128 |
key: '1',
|
|
|
|
| 144 |
// disabled: true,
|
| 145 |
},
|
| 146 |
]
|
| 147 |
+
const toChunk = (id: string) => {
|
| 148 |
+
console.log(id)
|
| 149 |
+
navigate(`/knowledge/add/setting?activeKey=file&id=${kb_id}&doc_id=${id}`);
|
| 150 |
+
}
|
| 151 |
const columns: ColumnsType<DataType> = [
|
| 152 |
{
|
| 153 |
title: '名称',
|
| 154 |
dataIndex: 'name',
|
| 155 |
key: 'name',
|
| 156 |
+
render: (text: any, { id }) => <div className={styles.tochunks} onClick={() => toChunk(id)}><img className={styles.img} src='https://gw.alipayobjects.com/zos/antfincdn/efFD%24IOql2/weixintupian_20170331104822.jpg' alt="" />{text}</div>,
|
| 157 |
className: `${styles.column}`
|
| 158 |
},
|
| 159 |
{
|
|
|
|
| 208 |
return <>
|
| 209 |
<div className={styles.filter}>
|
| 210 |
<div className="search">
|
| 211 |
+
<Input placeholder="搜索" value={inputValue} style={{ width: 220 }} allowClear onChange={handleInputChange} />
|
| 212 |
</div>
|
| 213 |
<div className="operate">
|
| 214 |
<Dropdown menu={{ items: actionItems }} trigger={['click']} >
|
|
|
|
| 220 |
</div>
|
| 221 |
</div>
|
| 222 |
<Table rowKey='id' columns={columns} dataSource={data} loading={loading} pagination={false} scroll={{ scrollToFirstRowOnChange: true, x: true }} />
|
| 223 |
+
<CreateEPModal getKfList={getKfList} kb_id={kb_id} />
|
| 224 |
<SegmentSetModal getKfList={getKfList} parser_id={parser_id} doc_id={doc_id} />
|
| 225 |
</>
|
| 226 |
};
|
web/src/pages/add-knowledge/components/knowledge-file/model.ts
CHANGED
|
@@ -1,15 +1,42 @@
|
|
| 1 |
import { message } from 'antd';
|
| 2 |
-
import {
|
| 3 |
import kbService from '@/services/kbService';
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 }) {
|
|
|
|
| 1 |
import { message } from 'antd';
|
| 2 |
+
import { Effect, Reducer, Subscription } from 'umi'
|
| 3 |
import kbService from '@/services/kbService';
|
| 4 |
|
| 5 |
+
export interface kFModelState {
|
| 6 |
+
isShowCEFwModal: boolean;
|
| 7 |
+
isShowTntModal: boolean;
|
| 8 |
+
isShowSegmentSetModal: boolean;
|
| 9 |
+
loading: boolean;
|
| 10 |
+
tenantIfo: any;
|
| 11 |
+
data: any[]
|
| 12 |
+
}
|
| 13 |
+
export interface kFModelType {
|
| 14 |
+
namespace: 'kFModel';
|
| 15 |
+
state: kFModelState;
|
| 16 |
+
effects: {
|
| 17 |
+
createKf: Effect;
|
| 18 |
+
updateKf: Effect;
|
| 19 |
+
getKfDetail: Effect;
|
| 20 |
+
getKfList: Effect;
|
| 21 |
+
updateDocumentStatus: Effect;
|
| 22 |
+
document_rm: Effect;
|
| 23 |
+
document_create: Effect;
|
| 24 |
+
document_change_parser: Effect;
|
| 25 |
+
};
|
| 26 |
+
reducers: {
|
| 27 |
+
updateState: Reducer<kFModelState>;
|
| 28 |
+
};
|
| 29 |
+
subscriptions: { setup: Subscription };
|
| 30 |
+
}
|
| 31 |
+
const Model: kFModelType = {
|
| 32 |
namespace: 'kFModel',
|
| 33 |
state: {
|
| 34 |
isShowCEFwModal: false,
|
| 35 |
isShowTntModal: false,
|
| 36 |
isShowSegmentSetModal: false,
|
| 37 |
loading: false,
|
| 38 |
+
tenantIfo: {},
|
| 39 |
+
data: []
|
| 40 |
},
|
| 41 |
subscriptions: {
|
| 42 |
setup({ dispatch, history }) {
|
web/src/pages/add-knowledge/components/knowledge-file/segmentSetModal.tsx
CHANGED
|
@@ -1,15 +1,22 @@
|
|
| 1 |
-
import
|
|
|
|
| 2 |
import i18n from 'i18next';
|
| 3 |
-
import { useTranslation,
|
| 4 |
-
import {
|
| 5 |
-
import { rsaPsw } from '@/utils'
|
| 6 |
import { useEffect, useState } from 'react';
|
| 7 |
import styles from './index.less';
|
|
|
|
|
|
|
| 8 |
const { CheckableTag } = Tag;
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
const [selectedTag, setSelectedTag] = useState('')
|
| 14 |
const { tenantIfo = {} } = settingModel
|
| 15 |
const { parser_ids = '' } = tenantIfo
|
|
|
|
| 1 |
+
import React from 'react';
|
| 2 |
+
import { connect, Dispatch } from 'umi';
|
| 3 |
import i18n from 'i18next';
|
| 4 |
+
import { useTranslation, } from 'react-i18next'
|
| 5 |
+
import { Modal, Tag, Space } from 'antd'
|
|
|
|
| 6 |
import { useEffect, useState } from 'react';
|
| 7 |
import styles from './index.less';
|
| 8 |
+
import type { kFModelState } from './model'
|
| 9 |
+
import type { settingModelState } from '@/pages/setting/model'
|
| 10 |
const { CheckableTag } = Tag;
|
| 11 |
+
interface kFProps {
|
| 12 |
+
dispatch: Dispatch;
|
| 13 |
+
kFModel: kFModelState;
|
| 14 |
+
settingModel: settingModelState;
|
| 15 |
+
getKfList: () => void;
|
| 16 |
+
parser_id: string;
|
| 17 |
+
doc_id: string;
|
| 18 |
+
}
|
| 19 |
+
const Index: React.FC<kFProps> = ({ kFModel, settingModel, dispatch, getKfList, parser_id, doc_id }) => {
|
| 20 |
const [selectedTag, setSelectedTag] = useState('')
|
| 21 |
const { tenantIfo = {} } = settingModel
|
| 22 |
const { parser_ids = '' } = tenantIfo
|
web/src/pages/add-knowledge/components/knowledge-file/upload.tsx
CHANGED
|
@@ -1,20 +1,23 @@
|
|
| 1 |
import React from 'react';
|
| 2 |
import { connect } from 'umi'
|
| 3 |
-
import { UploadOutlined } from '@ant-design/icons';
|
| 4 |
import type { UploadProps } from 'antd';
|
| 5 |
-
import { Button,
|
| 6 |
import uploadService from '@/services/uploadService'
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
const { retcode, data } = await uploadService.uploadFile(file, kb_id);
|
| 13 |
if (retcode === 0) {
|
| 14 |
-
onSuccess(data, file);
|
| 15 |
|
| 16 |
} else {
|
| 17 |
-
onError(data);
|
| 18 |
}
|
| 19 |
getKfList && getKfList()
|
| 20 |
};
|
|
|
|
| 1 |
import React from 'react';
|
| 2 |
import { connect } from 'umi'
|
|
|
|
| 3 |
import type { UploadProps } from 'antd';
|
| 4 |
+
import { Button, Upload } from 'antd';
|
| 5 |
import uploadService from '@/services/uploadService'
|
| 6 |
+
interface PropsType {
|
| 7 |
+
kb_id: string;
|
| 8 |
+
getKfList: () => void
|
| 9 |
+
}
|
| 10 |
+
type UploadRequestOption = Parameters<
|
| 11 |
+
NonNullable<UploadProps["customRequest"]>
|
| 12 |
+
>[0];
|
| 13 |
+
const Index: React.FC<PropsType> = ({ kb_id, getKfList }) => {
|
| 14 |
+
const createRequest: (props: UploadRequestOption) => void = async function ({ file, onSuccess, onError }) {
|
| 15 |
const { retcode, data } = await uploadService.uploadFile(file, kb_id);
|
| 16 |
if (retcode === 0) {
|
| 17 |
+
onSuccess && onSuccess(data, file);
|
| 18 |
|
| 19 |
} else {
|
| 20 |
+
onError && onError(data);
|
| 21 |
}
|
| 22 |
getKfList && getKfList()
|
| 23 |
};
|
web/src/pages/add-knowledge/components/knowledge-setting/index.tsx
CHANGED
|
@@ -1,6 +1,8 @@
|
|
| 1 |
import React, { useEffect, useState } from 'react';
|
| 2 |
-
import { useNavigate, connect } from 'umi'
|
| 3 |
-
import { Button, Form, Input,
|
|
|
|
|
|
|
| 4 |
import styles from './index.less'
|
| 5 |
const { CheckableTag } = Tag;
|
| 6 |
const layout = {
|
|
@@ -10,41 +12,17 @@ const layout = {
|
|
| 10 |
};
|
| 11 |
const { Option } = Select
|
| 12 |
/* eslint-disable no-template-curly-in-string */
|
| 13 |
-
const validateMessages = {
|
| 14 |
-
required: '${label} is required!',
|
| 15 |
-
types: {
|
| 16 |
-
email: '${label} is not a valid email!',
|
| 17 |
-
number: '${label} is not a valid number!',
|
| 18 |
-
},
|
| 19 |
-
number: {
|
| 20 |
-
range: '${label} must be between ${min} and ${max}',
|
| 21 |
-
},
|
| 22 |
-
};
|
| 23 |
-
/* eslint-enable no-template-curly-in-string */
|
| 24 |
-
|
| 25 |
|
| 26 |
-
interface
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
last: string;
|
| 32 |
-
};
|
| 33 |
-
email: string;
|
| 34 |
-
picture: {
|
| 35 |
-
large: string;
|
| 36 |
-
medium: string;
|
| 37 |
-
thumbnail: string;
|
| 38 |
-
};
|
| 39 |
-
nat: string;
|
| 40 |
}
|
| 41 |
-
const
|
| 42 |
-
|
| 43 |
-
const Index: React.FC = ({ settingModel, kSModel, dispatch, ...props }) => {
|
| 44 |
let navigate = useNavigate();
|
| 45 |
const { tenantIfo = {} } = settingModel
|
| 46 |
const { parser_ids = '', embd_id = '' } = tenantIfo
|
| 47 |
-
const { id = '' } = props
|
| 48 |
const [form] = Form.useForm();
|
| 49 |
|
| 50 |
useEffect(() => {
|
|
@@ -53,12 +31,12 @@ const Index: React.FC = ({ settingModel, kSModel, dispatch, ...props }) => {
|
|
| 53 |
payload: {
|
| 54 |
}
|
| 55 |
});
|
| 56 |
-
if (
|
| 57 |
|
| 58 |
dispatch({
|
| 59 |
type: 'kSModel/getKbDetail',
|
| 60 |
payload: {
|
| 61 |
-
kb_id
|
| 62 |
},
|
| 63 |
callback(detail: any) {
|
| 64 |
console.log(detail)
|
|
@@ -69,20 +47,20 @@ const Index: React.FC = ({ settingModel, kSModel, dispatch, ...props }) => {
|
|
| 69 |
});
|
| 70 |
}
|
| 71 |
|
| 72 |
-
}, [
|
| 73 |
const [selectedTag, setSelectedTag] = useState('')
|
| 74 |
const values = Form.useWatch([], form);
|
| 75 |
console.log(values, '......变化')
|
| 76 |
const onFinish = () => {
|
| 77 |
form.validateFields().then(
|
| 78 |
() => {
|
| 79 |
-
if (
|
| 80 |
dispatch({
|
| 81 |
type: 'kSModel/updateKb',
|
| 82 |
payload: {
|
| 83 |
...values,
|
| 84 |
parser_id: selectedTag,
|
| 85 |
-
kb_id
|
| 86 |
embd_id: undefined
|
| 87 |
}
|
| 88 |
});
|
|
@@ -94,7 +72,7 @@ const Index: React.FC = ({ settingModel, kSModel, dispatch, ...props }) => {
|
|
| 94 |
parser_id: selectedTag
|
| 95 |
},
|
| 96 |
callback(id: string) {
|
| 97 |
-
navigate(`/knowledge/add/setting?activeKey=file&id=${
|
| 98 |
}
|
| 99 |
});
|
| 100 |
}
|
|
@@ -140,7 +118,7 @@ const Index: React.FC = ({ settingModel, kSModel, dispatch, ...props }) => {
|
|
| 140 |
hasFeedback
|
| 141 |
rules={[{ required: true, message: 'Please select your country!' }]}
|
| 142 |
>
|
| 143 |
-
<Select placeholder="Please select a country"
|
| 144 |
{embd_id.split(',').map((item: string) => {
|
| 145 |
return <Option value={item} key={item}>{item}</Option>
|
| 146 |
})}
|
|
|
|
| 1 |
import React, { useEffect, useState } from 'react';
|
| 2 |
+
import { useNavigate, connect, Dispatch } from 'umi'
|
| 3 |
+
import { Button, Form, Input, Radio, Select, Tag, Space, } from 'antd';
|
| 4 |
+
import type { kSModelState } from './model'
|
| 5 |
+
import type { settingModelState } from '@/pages/setting/model'
|
| 6 |
import styles from './index.less'
|
| 7 |
const { CheckableTag } = Tag;
|
| 8 |
const layout = {
|
|
|
|
| 12 |
};
|
| 13 |
const { Option } = Select
|
| 14 |
/* eslint-disable no-template-curly-in-string */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
+
interface kSProps {
|
| 17 |
+
dispatch: Dispatch;
|
| 18 |
+
kSModel: kSModelState;
|
| 19 |
+
settingModel: settingModelState;
|
| 20 |
+
kb_id: string
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
}
|
| 22 |
+
const Index: React.FC<kSProps> = ({ settingModel, kSModel, dispatch, kb_id }) => {
|
|
|
|
|
|
|
| 23 |
let navigate = useNavigate();
|
| 24 |
const { tenantIfo = {} } = settingModel
|
| 25 |
const { parser_ids = '', embd_id = '' } = tenantIfo
|
|
|
|
| 26 |
const [form] = Form.useForm();
|
| 27 |
|
| 28 |
useEffect(() => {
|
|
|
|
| 31 |
payload: {
|
| 32 |
}
|
| 33 |
});
|
| 34 |
+
if (kb_id) {
|
| 35 |
|
| 36 |
dispatch({
|
| 37 |
type: 'kSModel/getKbDetail',
|
| 38 |
payload: {
|
| 39 |
+
kb_id
|
| 40 |
},
|
| 41 |
callback(detail: any) {
|
| 42 |
console.log(detail)
|
|
|
|
| 47 |
});
|
| 48 |
}
|
| 49 |
|
| 50 |
+
}, [kb_id])
|
| 51 |
const [selectedTag, setSelectedTag] = useState('')
|
| 52 |
const values = Form.useWatch([], form);
|
| 53 |
console.log(values, '......变化')
|
| 54 |
const onFinish = () => {
|
| 55 |
form.validateFields().then(
|
| 56 |
() => {
|
| 57 |
+
if (kb_id) {
|
| 58 |
dispatch({
|
| 59 |
type: 'kSModel/updateKb',
|
| 60 |
payload: {
|
| 61 |
...values,
|
| 62 |
parser_id: selectedTag,
|
| 63 |
+
kb_id,
|
| 64 |
embd_id: undefined
|
| 65 |
}
|
| 66 |
});
|
|
|
|
| 72 |
parser_id: selectedTag
|
| 73 |
},
|
| 74 |
callback(id: string) {
|
| 75 |
+
navigate(`/knowledge/add/setting?activeKey=file&id=${kb_id}`);
|
| 76 |
}
|
| 77 |
});
|
| 78 |
}
|
|
|
|
| 118 |
hasFeedback
|
| 119 |
rules={[{ required: true, message: 'Please select your country!' }]}
|
| 120 |
>
|
| 121 |
+
<Select placeholder="Please select a country" >
|
| 122 |
{embd_id.split(',').map((item: string) => {
|
| 123 |
return <Option value={item} key={item}>{item}</Option>
|
| 124 |
})}
|
web/src/pages/add-knowledge/components/knowledge-setting/model.ts
CHANGED
|
@@ -1,8 +1,27 @@
|
|
| 1 |
import { message } from 'antd';
|
| 2 |
-
import {
|
| 3 |
import kbService from '@/services/kbService';
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
namespace: 'kSModel',
|
| 7 |
state: {
|
| 8 |
isShowPSwModal: false,
|
|
|
|
| 1 |
import { message } from 'antd';
|
| 2 |
+
import { Effect, Reducer, Subscription } from 'umi'
|
| 3 |
import kbService from '@/services/kbService';
|
| 4 |
|
| 5 |
+
export interface kSModelState {
|
| 6 |
+
isShowPSwModal: boolean;
|
| 7 |
+
isShowTntModal: boolean;
|
| 8 |
+
loading: boolean;
|
| 9 |
+
tenantIfo: any
|
| 10 |
+
}
|
| 11 |
+
export interface kSModelType {
|
| 12 |
+
namespace: 'kSModel';
|
| 13 |
+
state: kSModelState;
|
| 14 |
+
effects: {
|
| 15 |
+
createKb: Effect;
|
| 16 |
+
updateKb: Effect;
|
| 17 |
+
getKbDetail: Effect;
|
| 18 |
+
};
|
| 19 |
+
reducers: {
|
| 20 |
+
updateState: Reducer<kSModelState>;
|
| 21 |
+
};
|
| 22 |
+
subscriptions: { setup: Subscription };
|
| 23 |
+
}
|
| 24 |
+
const Model: kSModelType = {
|
| 25 |
namespace: 'kSModel',
|
| 26 |
state: {
|
| 27 |
isShowPSwModal: false,
|
web/src/pages/add-knowledge/index.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
-
import { connect, useNavigate, useLocation } from 'umi'
|
| 2 |
-
import React, {
|
| 3 |
import type { MenuProps } from 'antd';
|
| 4 |
-
import {
|
| 5 |
import {
|
| 6 |
ToolOutlined,
|
| 7 |
BarsOutlined,
|
|
@@ -10,17 +10,24 @@ import {
|
|
| 10 |
import File from './components/knowledge-file'
|
| 11 |
import Setting from './components/knowledge-setting'
|
| 12 |
import Search from './components/knowledge-search'
|
|
|
|
| 13 |
import styles from './index.less'
|
| 14 |
import { getWidth } from '@/utils'
|
|
|
|
| 15 |
|
| 16 |
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
const [collapsed, setCollapsed] = useState(false);
|
| 19 |
-
const { id, activeKey } = kAModel
|
| 20 |
const [windowWidth, setWindowWidth] = useState(getWidth());
|
| 21 |
let navigate = useNavigate();
|
| 22 |
const location = useLocation();
|
| 23 |
// 标记一下
|
|
|
|
| 24 |
useEffect(() => {
|
| 25 |
const widthSize = () => {
|
| 26 |
const width = getWidth()
|
|
@@ -44,7 +51,9 @@ const Index: React.FC = ({ kAModel, dispatch }) => {
|
|
| 44 |
dispatch({
|
| 45 |
type: 'kAModel/updateState',
|
| 46 |
payload: {
|
| 47 |
-
|
|
|
|
|
|
|
| 48 |
}
|
| 49 |
});
|
| 50 |
}, [location])
|
|
@@ -94,9 +103,11 @@ const Index: React.FC = ({ kAModel, dispatch }) => {
|
|
| 94 |
/>
|
| 95 |
</div>
|
| 96 |
<div className={styles.content}>
|
| 97 |
-
{activeKey === 'file' && <File
|
| 98 |
-
{activeKey === 'setting' && <Setting
|
| 99 |
-
{activeKey === 'search' && <Search
|
|
|
|
|
|
|
| 100 |
</div>
|
| 101 |
</div>
|
| 102 |
</>
|
|
|
|
| 1 |
+
import { connect, useNavigate, useLocation, Dispatch } from 'umi'
|
| 2 |
+
import React, { useState, useEffect } from 'react';
|
| 3 |
import type { MenuProps } from 'antd';
|
| 4 |
+
import { Menu } from 'antd';
|
| 5 |
import {
|
| 6 |
ToolOutlined,
|
| 7 |
BarsOutlined,
|
|
|
|
| 10 |
import File from './components/knowledge-file'
|
| 11 |
import Setting from './components/knowledge-setting'
|
| 12 |
import Search from './components/knowledge-search'
|
| 13 |
+
import Chunk from './components/knowledge-chunk'
|
| 14 |
import styles from './index.less'
|
| 15 |
import { getWidth } from '@/utils'
|
| 16 |
+
import { kAModelState } from './model'
|
| 17 |
|
| 18 |
|
| 19 |
+
interface kAProps {
|
| 20 |
+
dispatch: Dispatch;
|
| 21 |
+
kAModel: kAModelState;
|
| 22 |
+
}
|
| 23 |
+
const Index: React.FC<kAProps> = ({ kAModel, dispatch }) => {
|
| 24 |
const [collapsed, setCollapsed] = useState(false);
|
| 25 |
+
const { id, activeKey, doc_id } = kAModel
|
| 26 |
const [windowWidth, setWindowWidth] = useState(getWidth());
|
| 27 |
let navigate = useNavigate();
|
| 28 |
const location = useLocation();
|
| 29 |
// 标记一下
|
| 30 |
+
console.log(doc_id, '>>>>>>>>>>>>>doc_id')
|
| 31 |
useEffect(() => {
|
| 32 |
const widthSize = () => {
|
| 33 |
const width = getWidth()
|
|
|
|
| 51 |
dispatch({
|
| 52 |
type: 'kAModel/updateState',
|
| 53 |
payload: {
|
| 54 |
+
doc_id: undefined,
|
| 55 |
+
...map,
|
| 56 |
+
|
| 57 |
}
|
| 58 |
});
|
| 59 |
}, [location])
|
|
|
|
| 103 |
/>
|
| 104 |
</div>
|
| 105 |
<div className={styles.content}>
|
| 106 |
+
{activeKey === 'file' && !doc_id && <File kb_id={id} />}
|
| 107 |
+
{activeKey === 'setting' && <Setting kb_id={id} />}
|
| 108 |
+
{activeKey === 'search' && <Search />}
|
| 109 |
+
{activeKey === 'file' && !!doc_id && <Chunk doc_id={doc_id} />}
|
| 110 |
+
|
| 111 |
</div>
|
| 112 |
</div>
|
| 113 |
</>
|
web/src/pages/add-knowledge/model.ts
CHANGED
|
@@ -1,8 +1,27 @@
|
|
|
|
|
| 1 |
import { message } from 'antd';
|
| 2 |
-
import { addParam } from '@/utils';
|
| 3 |
import kbService from '@/services/kbService';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
namespace: 'kAModel',
|
| 7 |
state: {
|
| 8 |
isShowPSwModal: false,
|
|
@@ -10,7 +29,8 @@ const Model = {
|
|
| 10 |
loading: false,
|
| 11 |
tenantIfo: {},
|
| 12 |
activeKey: 'setting',
|
| 13 |
-
id: ''
|
|
|
|
| 14 |
|
| 15 |
},
|
| 16 |
subscriptions: {
|
|
|
|
| 1 |
+
import { Effect, Reducer, Subscription } from 'umi'
|
| 2 |
import { message } from 'antd';
|
|
|
|
| 3 |
import kbService from '@/services/kbService';
|
| 4 |
+
export interface kAModelState {
|
| 5 |
+
isShowPSwModal: boolean;
|
| 6 |
+
isShowTntModal: boolean;
|
| 7 |
+
loading: boolean;
|
| 8 |
+
tenantIfo: any;
|
| 9 |
+
activeKey: string;
|
| 10 |
+
id: string;
|
| 11 |
+
doc_id: string
|
| 12 |
+
}
|
| 13 |
+
export interface kAModelType {
|
| 14 |
+
namespace: 'kAModel';
|
| 15 |
+
state: kAModelState;
|
| 16 |
+
effects: {
|
| 17 |
|
| 18 |
+
};
|
| 19 |
+
reducers: {
|
| 20 |
+
updateState: Reducer<kAModelState>;
|
| 21 |
+
};
|
| 22 |
+
subscriptions: { setup: Subscription };
|
| 23 |
+
}
|
| 24 |
+
const Model: kAModelType = {
|
| 25 |
namespace: 'kAModel',
|
| 26 |
state: {
|
| 27 |
isShowPSwModal: false,
|
|
|
|
| 29 |
loading: false,
|
| 30 |
tenantIfo: {},
|
| 31 |
activeKey: 'setting',
|
| 32 |
+
id: '',
|
| 33 |
+
doc_id: ''
|
| 34 |
|
| 35 |
},
|
| 36 |
subscriptions: {
|
web/src/pages/chat/index.tsx
CHANGED
|
@@ -1,19 +1,15 @@
|
|
| 1 |
-
import React
|
| 2 |
-
import {
|
|
|
|
| 3 |
|
| 4 |
-
interface
|
| 5 |
-
|
| 6 |
-
|
| 7 |
}
|
| 8 |
|
| 9 |
-
const
|
| 10 |
-
const { name } =
|
| 11 |
-
return <div>chat:
|
| 12 |
};
|
| 13 |
|
| 14 |
-
export default connect(
|
| 15 |
-
({ index, loading }: { index: IndexModelState; loading: Loading }) => ({
|
| 16 |
-
index,
|
| 17 |
-
loading: loading.models.index,
|
| 18 |
-
}),
|
| 19 |
-
)(IndexPage);
|
|
|
|
| 1 |
+
import React from 'react';
|
| 2 |
+
import { connect, Dispatch } from 'umi';
|
| 3 |
+
import type { chatModelState } from './model'
|
| 4 |
|
| 5 |
+
interface chatProps {
|
| 6 |
+
chatModel: chatModelState;
|
| 7 |
+
dispatch: Dispatch
|
| 8 |
}
|
| 9 |
|
| 10 |
+
const View: React.FC<chatProps> = ({ chatModel, dispatch }) => {
|
| 11 |
+
const { name } = chatModel;
|
| 12 |
+
return <div>chat:{name} </div>;
|
| 13 |
};
|
| 14 |
|
| 15 |
+
export default connect(({ chatModel, loading }) => ({ chatModel, loading }))(View);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
web/src/pages/chat/model.ts
CHANGED
|
@@ -1,25 +1,23 @@
|
|
| 1 |
-
import { Effect,
|
| 2 |
|
| 3 |
-
export interface
|
| 4 |
name: string;
|
| 5 |
}
|
| 6 |
|
| 7 |
-
export interface
|
| 8 |
-
namespace: '
|
| 9 |
-
state:
|
| 10 |
effects: {
|
| 11 |
query: Effect;
|
| 12 |
};
|
| 13 |
reducers: {
|
| 14 |
-
save: Reducer<
|
| 15 |
-
// 启用 immer 之后
|
| 16 |
-
// save: ImmerReducer<IndexModelState>;
|
| 17 |
};
|
| 18 |
subscriptions: { setup: Subscription };
|
| 19 |
}
|
| 20 |
|
| 21 |
-
const
|
| 22 |
-
namespace: '
|
| 23 |
state: {
|
| 24 |
name: 'kate',
|
| 25 |
},
|
|
@@ -34,10 +32,6 @@ const IndexModel: IndexModelType = {
|
|
| 34 |
...action.payload,
|
| 35 |
};
|
| 36 |
},
|
| 37 |
-
// 启用 immer 之后
|
| 38 |
-
// save(state, action) {
|
| 39 |
-
// state.name = action.payload;
|
| 40 |
-
// },
|
| 41 |
},
|
| 42 |
subscriptions: {
|
| 43 |
setup({ dispatch, history }) {
|
|
@@ -49,4 +43,4 @@ const IndexModel: IndexModelType = {
|
|
| 49 |
},
|
| 50 |
};
|
| 51 |
|
| 52 |
-
export default
|
|
|
|
| 1 |
+
import { Effect, Reducer, Subscription } from 'umi';
|
| 2 |
|
| 3 |
+
export interface chatModelState {
|
| 4 |
name: string;
|
| 5 |
}
|
| 6 |
|
| 7 |
+
export interface chatModelType {
|
| 8 |
+
namespace: 'chatModel';
|
| 9 |
+
state: chatModelState;
|
| 10 |
effects: {
|
| 11 |
query: Effect;
|
| 12 |
};
|
| 13 |
reducers: {
|
| 14 |
+
save: Reducer<chatModelState>;
|
|
|
|
|
|
|
| 15 |
};
|
| 16 |
subscriptions: { setup: Subscription };
|
| 17 |
}
|
| 18 |
|
| 19 |
+
const Model: chatModelType = {
|
| 20 |
+
namespace: 'chatModel',
|
| 21 |
state: {
|
| 22 |
name: 'kate',
|
| 23 |
},
|
|
|
|
| 32 |
...action.payload,
|
| 33 |
};
|
| 34 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
},
|
| 36 |
subscriptions: {
|
| 37 |
setup({ dispatch, history }) {
|
|
|
|
| 43 |
},
|
| 44 |
};
|
| 45 |
|
| 46 |
+
export default Model;
|
web/src/pages/file/index.tsx
CHANGED
|
@@ -20,7 +20,7 @@ const App: React.FC = () => {
|
|
| 20 |
}
|
| 21 |
useEffect(() => {
|
| 22 |
const timer = setInterval(() => {
|
| 23 |
-
setFileList((fileList) => {
|
| 24 |
const percent = fileList[0]?.percent
|
| 25 |
if (percent + 10 >= 100) {
|
| 26 |
clearInterval(timer)
|
|
|
|
| 20 |
}
|
| 21 |
useEffect(() => {
|
| 22 |
const timer = setInterval(() => {
|
| 23 |
+
setFileList((fileList: any) => {
|
| 24 |
const percent = fileList[0]?.percent
|
| 25 |
if (percent + 10 >= 100) {
|
| 26 |
clearInterval(timer)
|
web/src/pages/knowledge/index.tsx
CHANGED
|
@@ -1,20 +1,20 @@
|
|
| 1 |
import React, { useEffect, useState, } from 'react';
|
| 2 |
-
import { useNavigate, connect } from 'umi'
|
| 3 |
import { Card, List, Popconfirm, message, FloatButton, Row, Col } from 'antd';
|
| 4 |
import { MinusSquareOutlined, DeleteOutlined, PlusOutlined } from '@ant-design/icons';
|
| 5 |
import styles from './index.less'
|
| 6 |
import { formatDate } from '@/utils/date'
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
}
|
| 13 |
-
const Index: React.FC = ({ knowledgeModel, dispatch }) => {
|
| 14 |
const navigate = useNavigate()
|
| 15 |
// const [datas, setDatas] = useState(data)
|
| 16 |
-
const { data } = knowledgeModel
|
| 17 |
-
|
|
|
|
| 18 |
dispatch({
|
| 19 |
type: 'knowledgeModel/rmKb',
|
| 20 |
payload: {
|
|
@@ -49,8 +49,8 @@ const Index: React.FC = ({ knowledgeModel, dispatch }) => {
|
|
| 49 |
<FloatButton onClick={handleAddKnowledge} icon={<PlusOutlined />} type="primary" style={{ right: 24, top: 100 }} />
|
| 50 |
<Row gutter={{ xs: 8, sm: 16, md: 24, lg: 32 }}>
|
| 51 |
{
|
| 52 |
-
data.map((item
|
| 53 |
-
return (<Col className="gutter-row" key={item.
|
| 54 |
<Card className={styles.card}
|
| 55 |
onClick={() => { handleEditKnowledge(item.id) }}
|
| 56 |
>
|
|
@@ -63,7 +63,7 @@ const Index: React.FC = ({ knowledgeModel, dispatch }) => {
|
|
| 63 |
<Popconfirm
|
| 64 |
title="Delete the task"
|
| 65 |
description="Are you sure to delete this task?"
|
| 66 |
-
onConfirm={(e) => {
|
| 67 |
e.stopPropagation();
|
| 68 |
e.nativeEvent.stopImmediatePropagation()
|
| 69 |
confirm(item.id)
|
|
|
|
| 1 |
import React, { useEffect, useState, } from 'react';
|
| 2 |
+
import { useNavigate, connect, Dispatch } from 'umi'
|
| 3 |
import { Card, List, Popconfirm, message, FloatButton, Row, Col } from 'antd';
|
| 4 |
import { MinusSquareOutlined, DeleteOutlined, PlusOutlined } from '@ant-design/icons';
|
| 5 |
import styles from './index.less'
|
| 6 |
import { formatDate } from '@/utils/date'
|
| 7 |
+
import type { knowledgeModelState } from './model'
|
| 8 |
+
interface KnowledgeProps {
|
| 9 |
+
dispatch: Dispatch;
|
| 10 |
+
knowledgeModel: knowledgeModelState
|
| 11 |
+
}
|
| 12 |
+
const Index: React.FC<KnowledgeProps> = ({ knowledgeModel, dispatch }) => {
|
|
|
|
| 13 |
const navigate = useNavigate()
|
| 14 |
// const [datas, setDatas] = useState(data)
|
| 15 |
+
const { data = [] } = knowledgeModel
|
| 16 |
+
console.log(knowledgeModel)
|
| 17 |
+
const confirm = (id: string) => {
|
| 18 |
dispatch({
|
| 19 |
type: 'knowledgeModel/rmKb',
|
| 20 |
payload: {
|
|
|
|
| 49 |
<FloatButton onClick={handleAddKnowledge} icon={<PlusOutlined />} type="primary" style={{ right: 24, top: 100 }} />
|
| 50 |
<Row gutter={{ xs: 8, sm: 16, md: 24, lg: 32 }}>
|
| 51 |
{
|
| 52 |
+
data.map((item: any) => {
|
| 53 |
+
return (<Col className="gutter-row" key={item.name} xs={24} sm={12} md={8} lg={6}>
|
| 54 |
<Card className={styles.card}
|
| 55 |
onClick={() => { handleEditKnowledge(item.id) }}
|
| 56 |
>
|
|
|
|
| 63 |
<Popconfirm
|
| 64 |
title="Delete the task"
|
| 65 |
description="Are you sure to delete this task?"
|
| 66 |
+
onConfirm={(e: any) => {
|
| 67 |
e.stopPropagation();
|
| 68 |
e.nativeEvent.stopImmediatePropagation()
|
| 69 |
confirm(item.id)
|
web/src/pages/knowledge/model.ts
CHANGED
|
@@ -1,8 +1,24 @@
|
|
|
|
|
| 1 |
import { message } from 'antd';
|
| 2 |
-
import { addParam } from '@/utils';
|
| 3 |
import kbService from '@/services/kbService';
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
namespace: 'knowledgeModel',
|
| 7 |
state: {
|
| 8 |
loading: false,
|
|
|
|
| 1 |
+
import { Effect, Reducer, Subscription } from 'umi'
|
| 2 |
import { message } from 'antd';
|
|
|
|
| 3 |
import kbService from '@/services/kbService';
|
| 4 |
|
| 5 |
+
export interface knowledgeModelState {
|
| 6 |
+
loading: boolean;
|
| 7 |
+
data: any[]
|
| 8 |
+
}
|
| 9 |
+
export interface knowledgegModelType {
|
| 10 |
+
namespace: 'knowledgeModel';
|
| 11 |
+
state: knowledgeModelState;
|
| 12 |
+
effects: {
|
| 13 |
+
rmKb: Effect;
|
| 14 |
+
getList: Effect;
|
| 15 |
+
};
|
| 16 |
+
reducers: {
|
| 17 |
+
updateState: Reducer<knowledgeModelState>;
|
| 18 |
+
};
|
| 19 |
+
subscriptions: { setup: Subscription };
|
| 20 |
+
}
|
| 21 |
+
const Model: knowledgegModelType = {
|
| 22 |
namespace: 'knowledgeModel',
|
| 23 |
state: {
|
| 24 |
loading: false,
|
web/src/pages/login/index.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import { Input, Form, Button, Checkbox } from 'antd';
|
|
| 3 |
import styles from './index.less';
|
| 4 |
import { rsaPsw } from '@/utils'
|
| 5 |
import { useState, useEffect, FC } from 'react';
|
|
|
|
| 6 |
interface LoginProps {
|
| 7 |
dispatch: Dispatch;
|
| 8 |
}
|
|
|
|
| 3 |
import styles from './index.less';
|
| 4 |
import { rsaPsw } from '@/utils'
|
| 5 |
import { useState, useEffect, FC } from 'react';
|
| 6 |
+
|
| 7 |
interface LoginProps {
|
| 8 |
dispatch: Dispatch;
|
| 9 |
}
|